BSOD: fix placement of the second-last line

This commit is contained in:
Sebastian Krzyszkowiak 2018-01-20 02:45:13 +01:00
parent e2d9d21f3f
commit 0cfef4ddca

View file

@ -241,8 +241,8 @@ SYMBOL_EXPORT void FatalError(struct Game* game, bool exit, char* format, ...) {
const int lines = ceil(error_w / (al_get_display_width(game->display) * 0.8)); const int lines = ceil(error_w / (al_get_display_width(game->display) * 0.8));
const int letters_per_line = (error_len / lines) + 1; const int letters_per_line = (error_len / lines) + 1;
int row = 5, l = 0; int row = 5;
for (; l < lines; ++l) { for (int l = 0; l < lines; ++l) {
int start = l * letters_per_line; int start = l * letters_per_line;
unsigned int end = (l + 1) * letters_per_line; unsigned int end = (l + 1) * letters_per_line;
if (end >= sizeof(text)) { if (end >= sizeof(text)) {
@ -263,11 +263,11 @@ SYMBOL_EXPORT void FatalError(struct Game* game, bool exit, char* format, ...) {
++row; ++row;
if (exit) { if (exit) {
al_draw_text(game->_priv.font_bsod, al_map_rgb(255, 255, 255), offsetx - head2w / 2, (int)(offsety + 11 * fonth * 1.25), ALLEGRO_ALIGN_LEFT, "This is fatal error. My bad."); al_draw_text(game->_priv.font_bsod, al_map_rgb(255, 255, 255), offsetx - head2w / 2, (int)(offsety + row * fonth * 1.25), ALLEGRO_ALIGN_LEFT, "This is fatal error. My bad.");
al_draw_text(game->_priv.font_bsod, al_map_rgb(255, 255, 255), offsetx, (int)(offsety + (row + 2) * fonth * 1.25), ALLEGRO_ALIGN_CENTRE, "Press any key to quit _"); al_draw_text(game->_priv.font_bsod, al_map_rgb(255, 255, 255), offsetx, (int)(offsety + (row + 2) * fonth * 1.25), ALLEGRO_ALIGN_CENTRE, "Press any key to quit _");
} else { } else {
al_draw_text(game->_priv.font_bsod, al_map_rgb(255, 255, 255), offsetx - head2w / 2, (int)(offsety + 11 * fonth * 1.25), ALLEGRO_ALIGN_LEFT, "Anything I can do to help?"); al_draw_text(game->_priv.font_bsod, al_map_rgb(255, 255, 255), offsetx - head2w / 2, (int)(offsety + row * fonth * 1.25), ALLEGRO_ALIGN_LEFT, "Anything I can do to help?");
al_draw_text(game->_priv.font_bsod, al_map_rgb(255, 255, 255), offsetx, (int)(offsety + (row + 2) * fonth * 1.25), ALLEGRO_ALIGN_CENTRE, "Press any key to continue _"); al_draw_text(game->_priv.font_bsod, al_map_rgb(255, 255, 255), offsetx, (int)(offsety + (row + 2) * fonth * 1.25), ALLEGRO_ALIGN_CENTRE, "Press any key to continue _");
} }