Move title screen color initialization to main()

This fixes a bug where if you completed a custom level during
command-line playtesting, when returning to the title screen, the
background would be red and the text would be white.

This is because playtesting skips over the code path of pressing ACTION
to start the game and advance to the title screen, and the code path of
that ACTION press specifically initializes the title screen colors to
cyan.

This is also caused by the fact that completing a custom level doesn't
call map.nexttowercolour(), but my guess is that the intent there was
that the player would select a custom level, complete it, and return to
the title screen on the same screen with the same colors, so I decided
not to add a map.nexttowercolour() there.

Instead, I've moved the cyan color initialization to main(), so that it
is always executed no matter what, and doesn't require you to take a
specific code path to do it.
This commit is contained in:
Misa 2021-01-05 17:18:00 -08:00 committed by Ethan Lee
parent 5e557ffd1a
commit 6b18e3875d
2 changed files with 4 additions and 2 deletions

View File

@ -1686,8 +1686,6 @@ void titleinput()
music.playef(18);
game.screenshake = 10;
game.flashlight = 5;
graphics.titlebg.colstate = 10;
map.nexttowercolour();
}
else
{

View File

@ -227,6 +227,10 @@ int main(int argc, char *argv[])
game.menustart = false;
game.mainmenu = 0;
// Initialize title screen to cyan
graphics.titlebg.colstate = 10;
map.nexttowercolour();
map.ypos = (700-29) * 8;
graphics.towerbg.bypos = map.ypos / 2;
graphics.titlebg.bypos = map.ypos / 2;