Skip to content

Commit a757bb3

Browse files
committed
swars: Slightly better mission status message size selection
The function to draw status message still uses primitive 1x/2x only size selection. Until proper text draw function is made, update the scaling so it looks circa proper size in all resolutions.
1 parent 42b15eb commit a757bb3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/game.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6813,10 +6813,17 @@ void draw_mission_concluded(void)
68136813
}
68146814
{
68156815
int scr_x, scr_y;
6816+
int tx_height;
6817+
68166818
// TODO the text position should be computed based on position of panels loaded from file
68176819
scr_x = 11 * pop1_sprites_scale;
68186820
scr_y = 26 * pop1_sprites_scale;
6819-
if (lbDisplay.GraphicsScreenHeight < 400)
6821+
lbFontPtr = small_font;
6822+
tx_height = font_height('A');
6823+
// For window width=320, expect text height=6; if width rises more
6824+
// than half from that without font size compensating, use doubling
6825+
// TODO prepare a function to scale this font to any size, rather than only 1x or 2x selection
6826+
if (lbDisplay.GraphicsWindowWidth < tx_height * (320 * 3 / 2) / 6)
68206827
draw_text_linewrap2b(scr_x, &scr_y, data_15319c);
68216828
else
68226829
draw_text_linewrap1b(scr_x, &scr_y, data_15319c);

0 commit comments

Comments
 (0)