X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fscreens.c;h=30214464c1bd46d791915af73b9c195f3fbd0481;hp=e68ec1a8d37efb07cee16488cc4a1c64f5a1a93f;hb=6b748c845ff51daac061662d016447e122cf6fb3;hpb=7ecbe0a730dc19d8a46ffe6bbcb052f20d0c4152 diff --git a/src/screens.c b/src/screens.c index e68ec1a8..30214464 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1308,6 +1308,14 @@ void DrawTitleScreenMessage(int nr, boolean initial) /* force TITLE font on title message screen */ game_status = getTitleMessageGameMode(initial); + /* if chars *and* width set to "-1", automatically determine width */ + if (tmi->chars == -1 && tmi->width == -1) + tmi->width = viewport.window[game_status].width; + + /* if lines *and* height set to "-1", automatically determine height */ + if (tmi->lines == -1 && tmi->height == -1) + tmi->height = viewport.window[game_status].height; + /* if chars set to "-1", automatically determine by text and font width */ if (tmi->chars == -1) tmi->chars = tmi->width / getFontWidth(tmi->font); @@ -1320,6 +1328,14 @@ void DrawTitleScreenMessage(int nr, boolean initial) else tmi->height = tmi->lines * getFontHeight(tmi->font); + /* if x set to "-1", automatically determine by width and alignment */ + if (tmi->x == -1) + tmi->x = -1 * ALIGNED_XPOS(0, tmi->width, tmi->align); + + /* if y set to "-1", automatically determine by height and alignment */ + if (tmi->y == -1) + tmi->y = -1 * ALIGNED_YPOS(0, tmi->height, tmi->valign); + SetDrawBackgroundMask(REDRAW_ALL); SetWindowBackgroundImage(getTitleBackground(nr, initial, FALSE));