projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
removed redundant preprocessor directives
[rocksndiamonds.git]
/
src
/
screens.c
diff --git
a/src/screens.c
b/src/screens.c
index 1f01c599d9a037ff0eb42a4d282680b2ad5e663d..9de4b55d4bdbddb06d5a1519ff13cf4dfd74151a 100644
(file)
--- a/
src/screens.c
+++ b/
src/screens.c
@@
-1252,14
+1252,6
@@
void DrawHeadline()
setup.internal.program_copyright);
}
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);
void DrawTitleScreenImage(int nr, boolean initial)
{
int graphic = getTitleScreenGraphic(nr, initial);
@@
-1434,6
+1426,7
@@
void DrawMainMenu()
if (CheckTitleScreen(levelset_has_changed))
{
if (CheckTitleScreen(levelset_has_changed))
{
+ game_status_last_screen = GAME_MODE_MAIN;
game_status = GAME_MODE_TITLE;
DrawTitleScreen();
game_status = GAME_MODE_TITLE;
DrawTitleScreen();
@@
-1490,7
+1483,7
@@
void DrawMainMenu()
OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
- DrawMaskedBorder(
REDRAW_ALL
);
+ DrawMaskedBorder(
fade_mask
);
FadeIn(fade_mask);
FadeSetEnterMenu();
FadeIn(fade_mask);
FadeSetEnterMenu();
@@
-1557,7
+1550,7
@@
void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
last_sound = SND_UNDEFINED;
last_music = MUS_UNDEFINED;
last_sound = SND_UNDEFINED;
last_music = MUS_UNDEFINED;
- if (game_status == GAME_MODE_INFO)
+ if (game_status
_last_screen
== GAME_MODE_INFO)
{
if (num_title_screens == 0)
{
{
if (num_title_screens == 0)
{
@@
-1570,6
+1563,9
@@
void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
FadeSoundsAndMusic();
FadeOut(REDRAW_ALL);
FadeSoundsAndMusic();
FadeOut(REDRAW_ALL);
+
+ /* only required to update logic for redrawing global border */
+ ClearField();
}
if (tci->is_image)
}
if (tci->is_image)
@@
-1619,11
+1615,13
@@
void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
}
else if (button == MB_MENU_CHOICE)
{
}
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();
{
FadeSetEnterScreen();
+ game_status = GAME_MODE_INFO;
info_mode = INFO_MODE_MAIN;
info_mode = INFO_MODE_MAIN;
+
DrawInfoScreen();
return;
DrawInfoScreen();
return;
@@
-1688,8
+1686,9
@@
void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
/* force full menu screen redraw after displaying title screens */
redraw_mask = REDRAW_ALL;
/* 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();
info_mode = INFO_MODE_MAIN;
DrawInfoScreen();
@@
-1827,6
+1826,10
@@
void HandleMainMenu(int mx, int my, int dx, int dy, int button)
}
else if (pos == MAIN_CONTROL_LEVEL_NUMBER && !button)
{
}
else if (pos == MAIN_CONTROL_LEVEL_NUMBER && !button)
{
+ StopAnimation();
+
+ CloseDoor(DOOR_CLOSE_2);
+
game_status = GAME_MODE_LEVELNR;
ChangeViewportPropertiesIfNeeded();
game_status = GAME_MODE_LEVELNR;
ChangeViewportPropertiesIfNeeded();
@@
-1861,6
+1864,10
@@
void HandleMainMenu(int mx, int my, int dx, int dy, int button)
{
if (leveldir_first)
{
{
if (leveldir_first)
{
+ StopAnimation();
+
+ CloseDoor(DOOR_CLOSE_2);
+
game_status = GAME_MODE_LEVELS;
SaveLevelSetup_LastSeries();
game_status = GAME_MODE_LEVELS;
SaveLevelSetup_LastSeries();
@@
-1876,6
+1883,10
@@
void HandleMainMenu(int mx, int my, int dx, int dy, int button)
}
else if (pos == MAIN_CONTROL_SCORES)
{
}
else if (pos == MAIN_CONTROL_SCORES)
{
+ StopAnimation();
+
+ CloseDoor(DOOR_CLOSE_2);
+
game_status = GAME_MODE_SCORES;
DrawHallOfFame(-1);
game_status = GAME_MODE_SCORES;
DrawHallOfFame(-1);
@@
-1886,6
+1897,8
@@
void HandleMainMenu(int mx, int my, int dx, int dy, int button)
!strEqual(setup.player_name, "Artsoft"))
Request("This level is read only!", REQ_CONFIRM);
!strEqual(setup.player_name, "Artsoft"))
Request("This level is read only!", REQ_CONFIRM);
+ StopAnimation();
+
CloseDoor(DOOR_CLOSE_2);
game_status = GAME_MODE_EDITOR;
CloseDoor(DOOR_CLOSE_2);
game_status = GAME_MODE_EDITOR;
@@
-1896,6
+1909,10
@@
void HandleMainMenu(int mx, int my, int dx, int dy, int button)
}
else if (pos == MAIN_CONTROL_INFO)
{
}
else if (pos == MAIN_CONTROL_INFO)
{
+ StopAnimation();
+
+ CloseDoor(DOOR_CLOSE_2);
+
game_status = GAME_MODE_INFO;
info_mode = INFO_MODE_MAIN;
game_status = GAME_MODE_INFO;
info_mode = INFO_MODE_MAIN;
@@
-1905,10
+1922,16
@@
void HandleMainMenu(int mx, int my, int dx, int dy, int button)
}
else if (pos == MAIN_CONTROL_GAME)
{
}
else if (pos == MAIN_CONTROL_GAME)
{
+ StopAnimation();
+
StartGameActions(options.network, setup.autorecord, level.random_seed);
}
else if (pos == MAIN_CONTROL_SETUP)
{
StartGameActions(options.network, setup.autorecord, level.random_seed);
}
else if (pos == MAIN_CONTROL_SETUP)
{
+ StopAnimation();
+
+ CloseDoor(DOOR_CLOSE_2);
+
game_status = GAME_MODE_SETUP;
setup_mode = SETUP_MODE_MAIN;
game_status = GAME_MODE_SETUP;
setup_mode = SETUP_MODE_MAIN;
@@
-2135,12
+2158,7
@@
static void DrawInfoScreen_Main()
FadeOut(fade_mask);
FadeOut(fade_mask);
- if (fade_mask == REDRAW_ALL)
- {
- RedrawGlobalBorder();
-
- OpenDoor(DOOR_CLOSE_1 | DOOR_CLOSE_2 | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
- }
+ OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
ClearField();
ClearField();
@@
-2643,6
+2661,9
@@
void DrawInfoScreen_HelpText(int element, int action, int direction, int ypos)
void DrawInfoScreen_TitleScreen()
{
void DrawInfoScreen_TitleScreen()
{
+ game_status_last_screen = GAME_MODE_INFO;
+ game_status = GAME_MODE_TITLE;
+
DrawTitleScreen();
}
DrawTitleScreen();
}
@@
-3636,11
+3657,15
@@
static void DrawChooseTree(TreeInfo **ti_ptr)
FadeOut(fade_mask);
FadeOut(fade_mask);
+ OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
+
ClearField();
HandleChooseTree(0, 0, 0, 0, MB_MENU_INITIALIZE, ti_ptr);
MapScreenTreeGadgets(*ti_ptr);
ClearField();
HandleChooseTree(0, 0, 0, 0, MB_MENU_INITIALIZE, ti_ptr);
MapScreenTreeGadgets(*ti_ptr);
+ DrawMaskedBorder(fade_mask);
+
FadeIn(fade_mask);
InitAnimation();
FadeIn(fade_mask);
InitAnimation();
@@
-4146,8
+4171,12
@@
void DrawHallOfFame(int highlight_position)
PlayMenuSound();
PlayMenuMusic();
PlayMenuSound();
PlayMenuMusic();
+ OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
+
HandleHallOfFame(highlight_position, 0, 0, 0, MB_MENU_INITIALIZE);
HandleHallOfFame(highlight_position, 0, 0, 0, MB_MENU_INITIALIZE);
+ DrawMaskedBorder(fade_mask);
+
FadeIn(fade_mask);
}
FadeIn(fade_mask);
}
@@
-5745,6
+5774,8
@@
static void DrawSetupScreen_Generic()
FadeOut(fade_mask);
FadeOut(fade_mask);
+ OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
+
ClearField();
if (setup_mode == SETUP_MODE_MAIN)
ClearField();
if (setup_mode == SETUP_MODE_MAIN)
@@
-5832,6
+5863,8
@@
static void DrawSetupScreen_Generic()
if (redraw_all)
redraw_mask = fade_mask = REDRAW_ALL;
if (redraw_all)
redraw_mask = fade_mask = REDRAW_ALL;
+ DrawMaskedBorder(fade_mask);
+
FadeIn(fade_mask);
InitAnimation();
FadeIn(fade_mask);
InitAnimation();