setup.internal.program_copyright);
}
-int effectiveGameStatus()
-{
- if (game_status == GAME_MODE_INFO && info_mode == INFO_MODE_TITLE)
- return GAME_MODE_TITLE;
-
- return game_status;
-}
-
void DrawTitleScreenImage(int nr, boolean initial)
{
int graphic = getTitleScreenGraphic(nr, 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);
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));
if (CheckTitleScreen(levelset_has_changed))
{
+ game_status_last_screen = GAME_MODE_MAIN;
game_status = GAME_MODE_TITLE;
DrawTitleScreen();
static int last_sound = -1, last_music = -1;
boolean return_to_main_menu = FALSE;
struct TitleControlInfo *tci;
- struct TitleFadingInfo fading_default;
- struct TitleFadingInfo fading_last = fading;
- struct TitleFadingInfo fading_next;
int sound, music;
if (button == MB_MENU_INITIALIZE)
last_sound = SND_UNDEFINED;
last_music = MUS_UNDEFINED;
- if (game_status == GAME_MODE_INFO)
+ FadeSetEnterScreen();
+
+ if (game_status_last_screen == GAME_MODE_INFO)
{
if (num_title_screens == 0)
{
FadeOut(REDRAW_ALL);
}
+ /* only required to update logic for redrawing global border */
+ ClearField();
+
+ /* title screens may have different window size */
+ ChangeViewportPropertiesIfNeeded();
+
if (tci->is_image)
DrawTitleScreenImage(tci->local_nr, tci->initial);
else
DrawTitleScreenMessage(tci->local_nr, tci->initial);
- fading_default = (tci->initial ? title_initial_default : title_default);
-
- fading = fading_next = getTitleFading(tci);
-
- if (!(fading_last.fade_mode & FADE_TYPE_TRANSFORM) &&
- fading_next.fade_mode & FADE_TYPE_TRANSFORM)
- {
- fading.fade_mode = FADE_MODE_FADE;
- fading.fade_delay = fading_default.fade_delay;
- }
-
sound = getTitleSound(tci);
music = getTitleMusic(tci);
FadeIn(REDRAW_ALL);
- fading = fading_next;
-
DelayReached(&title_delay, 0); /* reset delay counter */
return;
}
else if (button == MB_MENU_CHOICE)
{
- if (game_status == GAME_MODE_INFO && num_title_screens == 0)
+ if (game_status_last_screen == GAME_MODE_INFO && num_title_screens == 0)
{
FadeSetEnterScreen();
+ game_status = GAME_MODE_INFO;
info_mode = INFO_MODE_MAIN;
+
DrawInfoScreen();
return;
if (music == MUS_UNDEFINED || music != last_music)
FadeMusic();
+ fading = getTitleFading(tci);
+
FadeOut(REDRAW_ALL);
if (tci->is_image)
else
DrawTitleScreenMessage(tci->local_nr, tci->initial);
- fading_next = getTitleFading(tci);
-
sound = getTitleSound(tci);
music = getTitleMusic(tci);
last_sound = sound;
last_music = music;
- /* last screen already faded out, next screen has no animation */
- if (!(fading.fade_mode & FADE_TYPE_TRANSFORM) &&
- fading_next.fade_mode == FADE_MODE_NONE)
- fading = fading_next;
-
FadeIn(REDRAW_ALL);
- fading = fading_next;
-
DelayReached(&title_delay, 0); /* reset delay counter */
}
else
/* force full menu screen redraw after displaying title screens */
redraw_mask = REDRAW_ALL;
- if (game_status == GAME_MODE_INFO)
+ if (game_status_last_screen == GAME_MODE_INFO)
{
+ game_status = GAME_MODE_INFO;
info_mode = INFO_MODE_MAIN;
DrawInfoScreen();
FadeOut(fade_mask);
+ ChangeViewportPropertiesIfNeeded();
+
OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
ClearField();
PlayMenuSound();
PlayMenuMusic();
+#if 1
+ // needed after returning from title screens with different window size
+ OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
+#endif
+
DrawMaskedBorder(fade_mask);
FadeIn(fade_mask);
void DrawInfoScreen_TitleScreen()
{
+ game_status_last_screen = GAME_MODE_INFO;
+ game_status = GAME_MODE_TITLE;
+
DrawTitleScreen();
}