summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2021-03-18 17:16:54 (EDT)
committer P. J. McDermott <pj@pehjota.net>2021-03-18 17:16:54 (EDT)
commit7258ef298cd531c9b7dcf6fda0365a2d2ed28057 (patch)
treeb2f129f3a38e136e6b29b5aba623b4d903bd59e1 /src
parent0917cbc2c4ab3ce2e84a633a8df94d670ae44c7e (diff)
downloaddodge-balls-7258ef298cd531c9b7dcf6fda0365a2d2ed28057.zip
dodge-balls-7258ef298cd531c9b7dcf6fda0365a2d2ed28057.tar.gz
dodge-balls-7258ef298cd531c9b7dcf6fda0365a2d2ed28057.tar.bz2
main-menu: Support "\n" in text
Diffstat (limited to 'src')
-rw-r--r--src/main-menu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main-menu.c b/src/main-menu.c
index 30ba76b..7b724a1 100644
--- a/src/main-menu.c
+++ b/src/main-menu.c
@@ -28,12 +28,12 @@
static SDL_Texture *
_db_main_menu_text(TTF_Font *font, const char *text, SDL_Color *color,
- SDL_Renderer *renderer, SDL_Rect *rect)
+ int width, SDL_Renderer *renderer, SDL_Rect *rect)
{
SDL_Surface *surface;
SDL_Texture *texture;
- surface = TTF_RenderText_Blended(font, text, *color);
+ surface = TTF_RenderText_Blended_Wrapped(font, text, *color, width);
if (surface == NULL) {
db_err("Failed to create surface (%s)", TTF_GetError());
return NULL;
@@ -88,7 +88,7 @@ db_main_menu(void)
free(font_path);
return;
}
- texture_title = _db_main_menu_text(font, "Dodge Balls", &text_color,
+ texture_title = _db_main_menu_text(font, "Dodge Balls", &text_color, 0,
renderer, &dest_rect);
if (texture_title == NULL) {
free(font_path);