projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20060816-3-src
[rocksndiamonds.git]
/
src
/
screens.c
diff --git
a/src/screens.c
b/src/screens.c
index aa03e16a346a90d05bd92d51aeaf210b3689f62c..cd38087393720868036bdad18708138f65a04ae1 100644
(file)
--- a/
src/screens.c
+++ b/
src/screens.c
@@
-299,7
+299,7
@@
void DrawTitleScreen()
StopAnimation();
}
StopAnimation();
}
-
static void DrawMainMenuExt(int fade_delay
)
+
void DrawMainMenuExt(int redraw_mask, boolean do_fading
)
{
static LevelDirTree *leveldir_last_valid = NULL;
boolean levelset_has_changed = FALSE;
{
static LevelDirTree *leveldir_last_valid = NULL;
boolean levelset_has_changed = FALSE;
@@
-532,7
+532,10
@@
static void DrawMainMenuExt(int fade_delay)
#if 1
#if 1
#if 1
#if 1
- FadeIn(fade_delay);
+ if (do_fading)
+ FadeIn(redraw_mask);
+ else
+ BackToFront();
#else
BackToFront();
#endif
#else
BackToFront();
#endif
@@
-547,9
+550,14
@@
static void DrawMainMenuExt(int fade_delay)
#endif
}
#endif
}
+void DrawAndFadeInMainMenu(int redraw_mask)
+{
+ DrawMainMenuExt(redraw_mask, TRUE);
+}
+
void DrawMainMenu()
{
void DrawMainMenu()
{
- DrawMainMenuExt(
0
);
+ DrawMainMenuExt(
REDRAW_ALL, FALSE
);
}
#if 0
}
#if 0
@@
-589,8
+597,6
@@
void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
boolean return_to_main_menu = FALSE;
boolean use_fading_main_menu = TRUE;
boolean use_cross_fading = TRUE;
boolean return_to_main_menu = FALSE;
boolean use_fading_main_menu = TRUE;
boolean use_cross_fading = TRUE;
- int fade_delay = 500;
- int post_delay = fade_delay / 2;
if (button == MB_MENU_INITIALIZE)
{
if (button == MB_MENU_INITIALIZE)
{
@@
-609,7
+615,7
@@
void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
FadeSoundsAndMusic();
FadeSoundsAndMusic();
- FadeOut(
fade_delay, post_delay
);
+ FadeOut(
REDRAW_ALL
);
}
/* force TITLE music on title info screen */
}
/* force TITLE music on title info screen */
@@
-622,7
+628,7
@@
void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
DrawTitleScreenImage(title_nr);
DrawTitleScreenImage(title_nr);
- FadeIn(
fade_delay
);
+ FadeIn(
REDRAW_ALL
);
return;
}
return;
}
@@
-645,30
+651,34
@@
void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
title_nr++;
if (!use_cross_fading)
title_nr++;
if (!use_cross_fading)
- FadeOut(
fade_delay, post_delay
);
+ FadeOut(
REDRAW_ALL
);
if (title_nr < MAX_NUM_TITLE_SCREENS &&
graphic_info[IMG_TITLESCREEN_1 + title_nr].bitmap != NULL)
{
Bitmap *drawto_last = drawto;
if (title_nr < MAX_NUM_TITLE_SCREENS &&
graphic_info[IMG_TITLESCREEN_1 + title_nr].bitmap != NULL)
{
Bitmap *drawto_last = drawto;
+#if 1
if (use_cross_fading)
if (use_cross_fading)
- drawto = bitmap_db_title;
-
+ FadeCrossSaveBackbuffer();
+#else
+ if (use_cross_fading)
+ drawto = bitmap_db_cross;
+#endif
DrawTitleScreenImage(title_nr);
drawto = drawto_last;
if (use_cross_fading)
DrawTitleScreenImage(title_nr);
drawto = drawto_last;
if (use_cross_fading)
- FadeCross(
fade_delay
);
+ FadeCross(
REDRAW_ALL
);
else
else
- FadeIn(
fade_delay
);
+ FadeIn(
REDRAW_ALL
);
}
else
{
FadeSoundsAndMusic();
}
else
{
FadeSoundsAndMusic();
- FadeOut(
fade_delay, post_delay
);
+ FadeOut(
REDRAW_ALL
);
return_to_main_menu = TRUE;
}
return_to_main_menu = TRUE;
}
@@
-676,8
+686,6
@@
void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
if (return_to_main_menu)
{
if (return_to_main_menu)
{
- int menu_fade_delay = (use_fading_main_menu ? fade_delay : 0);
-
RedrawBackground();
if (game_status == GAME_MODE_INFO)
RedrawBackground();
if (game_status == GAME_MODE_INFO)
@@
-685,14
+693,14
@@
void HandleTitleScreen(int mx, int my, int dx, int dy, int button)
OpenDoor(DOOR_CLOSE_1 | DOOR_CLOSE_2 | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
info_mode = INFO_MODE_MAIN;
OpenDoor(DOOR_CLOSE_1 | DOOR_CLOSE_2 | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
info_mode = INFO_MODE_MAIN;
- DrawInfoScreenExt(
menu_fade_delay
);
+ DrawInfoScreenExt(
use_fading_main_menu
);
}
else /* default: return to main menu */
{
OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2 | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
game_status = GAME_MODE_MAIN;
}
else /* default: return to main menu */
{
OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2 | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
game_status = GAME_MODE_MAIN;
- DrawMainMenuExt(
menu_fade_delay
);
+ DrawMainMenuExt(
REDRAW_ALL, use_fading_main_menu
);
}
}
}
}
}
}
@@
-989,7
+997,7
@@
static struct TokenInfo info_info_main[] =
{ 0, NULL, NULL }
};
{ 0, NULL, NULL }
};
-static void DrawInfoScreen_Main(
int fade_delay
)
+static void DrawInfoScreen_Main(
boolean do_fading
)
{
int i;
{
int i;
@@
-1032,7
+1040,11
@@
static void DrawInfoScreen_Main(int fade_delay)
PlayMenuSound();
PlayMenuMusic();
PlayMenuSound();
PlayMenuMusic();
- FadeIn(fade_delay);
+ if (do_fading)
+ FadeIn(REDRAW_ALL);
+ else
+ BackToFront();
+
InitAnimation();
#else
InitAnimation();
#else
@@
-1443,6
+1455,7
@@
void HandleInfoScreen_Music(int button)
if (button_released || button == MB_MENU_INITIALIZE)
{
if (button_released || button == MB_MENU_INITIALIZE)
{
+ Bitmap *drawto_last = drawto;
int y = 0;
if (button != MB_MENU_INITIALIZE)
int y = 0;
if (button != MB_MENU_INITIALIZE)
@@
-1459,6
+1472,14
@@
void HandleInfoScreen_Music(int button)
FadeSoundsAndMusic();
FadeSoundsAndMusic();
+#if 1
+ if (button != MB_MENU_INITIALIZE)
+ FadeCrossSaveBackbuffer();
+#else
+ if (button != MB_MENU_INITIALIZE)
+ drawto = bitmap_db_cross;
+#endif
+
ClearWindow();
DrawHeadline();
ClearWindow();
DrawHeadline();
@@
-1520,6
+1541,11
@@
void HandleInfoScreen_Music(int button)
DrawTextSCentered(ybottom, FONT_TEXT_4,
"Press any key or button for next page");
DrawTextSCentered(ybottom, FONT_TEXT_4,
"Press any key or button for next page");
+
+ drawto = drawto_last;
+
+ if (button != MB_MENU_INITIALIZE)
+ FadeCross(REDRAW_FIELD);
}
if (list != NULL && list->is_sound && sound_info[list->music].loop)
}
if (list != NULL && list->is_sound && sound_info[list->music].loop)
@@
-1724,9
+1750,26
@@
void HandleInfoScreen_Credits(int button)
}
else if (button == MB_MENU_CHOICE)
{
}
else if (button == MB_MENU_CHOICE)
{
+ Bitmap *drawto_last = drawto;
+ boolean show_screen;
+
screen_nr++;
screen_nr++;
- if (!DrawInfoScreen_CreditsScreen(screen_nr))
+#if 1
+ FadeCrossSaveBackbuffer();
+#else
+ drawto = bitmap_db_cross;
+#endif
+
+ show_screen = DrawInfoScreen_CreditsScreen(screen_nr);
+
+ drawto = drawto_last;
+
+ if (show_screen)
+ {
+ FadeCross(REDRAW_FIELD);
+ }
+ else
{
FadeSoundsAndMusic();
{
FadeSoundsAndMusic();
@@
-1866,7
+1909,7
@@
void HandleInfoScreen_LevelSet(int button)
}
}
}
}
-static void DrawInfoScreenExt(
int fade_delay
)
+static void DrawInfoScreenExt(
boolean do_fading
)
{
SetMainBackgroundImage(IMG_BACKGROUND_INFO);
{
SetMainBackgroundImage(IMG_BACKGROUND_INFO);
@@
-1883,7
+1926,7
@@
static void DrawInfoScreenExt(int fade_delay)
else if (info_mode == INFO_MODE_LEVELSET)
DrawInfoScreen_LevelSet();
else
else if (info_mode == INFO_MODE_LEVELSET)
DrawInfoScreen_LevelSet();
else
- DrawInfoScreen_Main(
fade_delay
);
+ DrawInfoScreen_Main(
do_fading
);
if (info_mode != INFO_MODE_MAIN &&
info_mode != INFO_MODE_TITLE &&
if (info_mode != INFO_MODE_MAIN &&
info_mode != INFO_MODE_TITLE &&
@@
-2393,13
+2436,19
@@
void DrawHallOfFame(int highlight_position)
if (highlight_position < 0)
LoadScore(level_nr);
if (highlight_position < 0)
LoadScore(level_nr);
+ FadeOut(REDRAW_FIELD);
+
+#if 0
FadeToFront();
FadeToFront();
+#endif
InitAnimation();
PlayMenuSound();
PlayMenuMusic();
HandleHallOfFame(highlight_position, 0, 0, 0, MB_MENU_INITIALIZE);
InitAnimation();
PlayMenuSound();
PlayMenuMusic();
HandleHallOfFame(highlight_position, 0, 0, 0, MB_MENU_INITIALIZE);
+
+ FadeIn(REDRAW_FIELD);
}
static void drawHallOfFameList(int first_entry, int highlight_position)
}
static void drawHallOfFameList(int first_entry, int highlight_position)
@@
-2450,7
+2499,6
@@
void HandleHallOfFame(int mx, int my, int dx, int dy, int button)
static int first_entry = 0;
static int highlight_position = 0;
int step = (button == 1 ? 1 : button == 2 ? 5 : 10);
static int first_entry = 0;
static int highlight_position = 0;
int step = (button == 1 ? 1 : button == 2 ? 5 : 10);
- int button_released = !button;
if (button == MB_MENU_INITIALIZE)
{
if (button == MB_MENU_INITIALIZE)
{
@@
-2486,12
+2534,23
@@
void HandleHallOfFame(int mx, int my, int dx, int dy, int button)
drawHallOfFameList(first_entry, highlight_position);
}
}
drawHallOfFameList(first_entry, highlight_position);
}
}
- else if (button
_released
)
+ else if (button
== MB_MENU_LEAVE
)
{
FadeSound(SND_BACKGROUND_SCORES);
{
FadeSound(SND_BACKGROUND_SCORES);
+
game_status = GAME_MODE_MAIN;
game_status = GAME_MODE_MAIN;
+
DrawMainMenu();
}
DrawMainMenu();
}
+ else if (button == MB_MENU_CHOICE)
+ {
+ FadeSound(SND_BACKGROUND_SCORES);
+ FadeOut(REDRAW_FIELD);
+
+ game_status = GAME_MODE_MAIN;
+
+ DrawAndFadeInMainMenu(REDRAW_FIELD);
+ }
if (game_status == GAME_MODE_SCORES)
PlayMenuSoundIfLoop();
if (game_status == GAME_MODE_SCORES)
PlayMenuSoundIfLoop();