{ "menu.list_size.SCORES", "-1" },
{ "menu.list_size.INFO", "-1" },
+ { "menu.fade_delay", "250" },
+ { "menu.post_delay", "125" },
+
{ "door_1.width", "-1" },
{ "door_1.height", "-1" },
{ "door_1.step_offset", "2" },
-#define COMPILE_DATE_STRING "[2006-08-16 01:45]"
+#define COMPILE_DATE_STRING "[2006-08-16 21:23]"
StopAnimation();
- if (do_fading)
- FadeOutField(TITLE_SCREEN_FADE_DELAY, TITLE_SCREEN_POST_DELAY);
-
if (!game.restart_level)
CloseDoor(DOOR_CLOSE_1);
+ if (do_fading)
+ FadeOut(REDRAW_FIELD);
+
/* !!! FIX THIS (START) !!! */
if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
{
/* !!! FIX THIS (END) !!! */
if (do_fading)
- FadeInField(TITLE_SCREEN_FADE_DELAY);
+ FadeIn(REDRAW_FIELD);
if (!game.restart_level)
{
if (!local_player->LevelSolved_SaveScore)
{
- FadeOutField(TITLE_SCREEN_FADE_DELAY, TITLE_SCREEN_POST_DELAY);
+ FadeOut(REDRAW_FIELD);
game_status = GAME_MODE_MAIN;
- DrawMainMenuExt(TITLE_SCREEN_FADE_DELAY, REDRAW_FIELD);
+ DrawAndFadeInMainMenu(REDRAW_FIELD);
return;
}
}
else
{
- FadeOutField(TITLE_SCREEN_FADE_DELAY, TITLE_SCREEN_POST_DELAY);
+ FadeOut(REDRAW_FIELD);
game_status = GAME_MODE_MAIN;
TapeErase();
}
- DrawMainMenuExt(TITLE_SCREEN_FADE_DELAY, REDRAW_FIELD);
+ DrawAndFadeInMainMenu(REDRAW_FIELD);
}
local_player->LevelSolved_SaveScore = FALSE;
}
else
{
- FadeOutField(TITLE_SCREEN_FADE_DELAY, TITLE_SCREEN_POST_DELAY);
+ FadeOut(REDRAW_FIELD);
game_status = GAME_MODE_MAIN;
- DrawMainMenuExt(TITLE_SCREEN_FADE_DELAY, REDRAW_FIELD);
+ DrawAndFadeInMainMenu(REDRAW_FIELD);
}
}
}
for (i = 0; i < MAX_PLAYERS; i++)
blitplayer(&ply[i]);
+#if 0
SyncDisplay();
blitscreen();
FlushDisplay();
+#endif
}
void game_animscreen(void)
game_initscreen();
game_animscreen();
+
+ /* blit playfield from scroll buffer to back buffer for fading in */
+ BlitScreenToBitmap_EM(backbuffer);
}
void GameActions_EM(byte action[MAX_PLAYERS], boolean warp_mode)
game_animscreen();
+#if 1
+ SyncDisplay();
+
+ blitscreen();
+
+ FlushDisplay();
+#endif
+
RandomEM = RandomEM * 129 + 1;
frame = (frame - 1) & 7;
Error(ERR_EXIT, "cannot get filename for '%s'", CONFIG_TOKEN_FONT_INITIAL);
/* create additional image buffers for double-buffering and cross-fading */
- bitmap_db_title = CreateBitmap(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH);
+ bitmap_db_cross = CreateBitmap(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH);
bitmap_db_field = CreateBitmap(FXSIZE, FYSIZE, DEFAULT_DEPTH);
bitmap_db_panel = CreateBitmap(DXSIZE, DYSIZE, DEFAULT_DEPTH);
bitmap_db_door = CreateBitmap(3 * DXSIZE, DYSIZE + VYSIZE, DEFAULT_DEPTH);
#endif
#if 0
- DrawMainMenuExt(TITLE_SCREEN_FADE_DELAY, REDRAW_ALL);
+ DrawMainMenuExt(REDRAW_ALL);
#else
DrawMainMenu();
#endif
video.width = width;
video.height = height;
video.depth = GetRealDepth(depth);
+
video.fullscreen_available = FULLSCREEN_STATUS;
video.fullscreen_enabled = FALSE;
video.fullscreen_modes = NULL;
#include "events.h"
#include "config.h"
-Bitmap *bitmap_db_title;
+Bitmap *bitmap_db_cross;
Bitmap *bitmap_db_field;
Bitmap *bitmap_db_panel;
Bitmap *bitmap_db_door;
{ "menu.list_size.SCORES", &menu.list_size[GFX_SPECIAL_ARG_SCORES] },
{ "menu.list_size.INFO", &menu.list_size[GFX_SPECIAL_ARG_INFO] },
+ { "menu.fade_delay", &menu.fade_delay },
+ { "menu.post_delay", &menu.post_delay },
+
{ "door_1.width", &door_1.width },
{ "door_1.height", &door_1.height },
{ "door_1.step_offset", &door_1.step_offset },
#define MICROLEVEL_SCROLL_DELAY 50 /* delay for scrolling micro level */
#define MICROLEVEL_LABEL_DELAY 250 /* delay for micro level label */
-/* values for fading in and out */
-#define TITLE_SCREEN_FADE_DELAY 250
-#define TITLE_SCREEN_POST_DELAY (TITLE_SCREEN_FADE_DELAY / 2)
-
/* boundaries of arrays etc. */
#define MAX_LEVEL_NAME_LEN 32
#define MAX_LEVEL_AUTHOR_LEN 32
int list_size[NUM_SPECIAL_GFX_ARGS];
+ int fade_delay;
+ int post_delay;
+
int sound[NUM_SPECIAL_GFX_ARGS];
int music[NUM_SPECIAL_GFX_ARGS];
};
};
-extern Bitmap *bitmap_db_title;
+extern Bitmap *bitmap_db_cross;
extern Bitmap *bitmap_db_field;
extern Bitmap *bitmap_db_panel;
extern Bitmap *bitmap_db_door;
StopAnimation();
}
-void DrawMainMenuExt(int fade_delay, int redraw_mask)
+void DrawMainMenuExt(int redraw_mask, boolean do_fading)
{
static LevelDirTree *leveldir_last_valid = NULL;
boolean levelset_has_changed = FALSE;
#if 1
#if 1
- if (redraw_mask == REDRAW_FIELD)
- FadeInField(fade_delay);
- else if (redraw_mask == REDRAW_ALL)
- FadeIn(fade_delay);
-
- BackToFront();
+ if (do_fading)
+ FadeIn(redraw_mask);
+ else
+ BackToFront();
#else
BackToFront();
#endif
#endif
}
+void DrawAndFadeInMainMenu(int redraw_mask)
+{
+ DrawMainMenuExt(redraw_mask, TRUE);
+}
+
void DrawMainMenu()
{
- DrawMainMenuExt(0, REDRAW_ALL);
+ DrawMainMenuExt(REDRAW_ALL, FALSE);
}
#if 0
boolean return_to_main_menu = FALSE;
boolean use_fading_main_menu = TRUE;
boolean use_cross_fading = TRUE;
- int fade_delay = TITLE_SCREEN_FADE_DELAY;
- int post_delay = TITLE_SCREEN_POST_DELAY;
if (button == MB_MENU_INITIALIZE)
{
FadeSoundsAndMusic();
- FadeOut(fade_delay, post_delay);
+ FadeOut(REDRAW_ALL);
}
/* force TITLE music on title info screen */
DrawTitleScreenImage(title_nr);
- FadeIn(fade_delay);
+ FadeIn(REDRAW_ALL);
return;
}
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 (use_cross_fading)
- drawto = bitmap_db_title;
+ drawto = bitmap_db_cross;
DrawTitleScreenImage(title_nr);
drawto = drawto_last;
if (use_cross_fading)
- FadeCross(fade_delay);
+ FadeCross(REDRAW_ALL);
else
- FadeIn(fade_delay);
+ FadeIn(REDRAW_ALL);
}
else
{
FadeSoundsAndMusic();
- FadeOut(fade_delay, post_delay);
+ FadeOut(REDRAW_ALL);
return_to_main_menu = TRUE;
}
if (return_to_main_menu)
{
- int menu_fade_delay = (use_fading_main_menu ? fade_delay : 0);
-
RedrawBackground();
if (game_status == GAME_MODE_INFO)
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;
- DrawMainMenuExt(menu_fade_delay, REDRAW_ALL);
+ DrawMainMenuExt(REDRAW_ALL, use_fading_main_menu);
}
}
}
{ 0, NULL, NULL }
};
-static void DrawInfoScreen_Main(int fade_delay)
+static void DrawInfoScreen_Main(boolean do_fading)
{
int i;
PlayMenuSound();
PlayMenuMusic();
- FadeIn(fade_delay);
+ if (do_fading)
+ FadeIn(REDRAW_ALL);
+ else
+ BackToFront();
+
InitAnimation();
#else
FadeSoundsAndMusic();
if (button != MB_MENU_INITIALIZE)
- drawto = bitmap_db_title;
+ drawto = bitmap_db_cross;
ClearWindow();
DrawHeadline();
drawto = drawto_last;
if (button != MB_MENU_INITIALIZE)
- FadeCrossField(TITLE_SCREEN_FADE_DELAY);
+ FadeCross(REDRAW_FIELD);
}
if (list != NULL && list->is_sound && sound_info[list->music].loop)
screen_nr++;
- drawto = bitmap_db_title;
+ drawto = bitmap_db_cross;
show_screen = DrawInfoScreen_CreditsScreen(screen_nr);
if (show_screen)
{
- FadeCrossField(TITLE_SCREEN_FADE_DELAY);
+ FadeCross(REDRAW_FIELD);
}
else
{
}
}
-static void DrawInfoScreenExt(int fade_delay)
+static void DrawInfoScreenExt(boolean do_fading)
{
SetMainBackgroundImage(IMG_BACKGROUND_INFO);
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 (highlight_position < 0)
LoadScore(level_nr);
- FadeOutField(TITLE_SCREEN_FADE_DELAY, TITLE_SCREEN_POST_DELAY);
+ FadeOut(REDRAW_FIELD);
#if 0
FadeToFront();
HandleHallOfFame(highlight_position, 0, 0, 0, MB_MENU_INITIALIZE);
- FadeInField(TITLE_SCREEN_FADE_DELAY);
+ FadeIn(REDRAW_FIELD);
}
static void drawHallOfFameList(int first_entry, int highlight_position)
game_status = GAME_MODE_MAIN;
- DrawMainMenuExt(0, REDRAW_FIELD);
+ DrawMainMenu();
}
else if (button == MB_MENU_CHOICE)
{
FadeSound(SND_BACKGROUND_SCORES);
- FadeOutField(TITLE_SCREEN_FADE_DELAY, TITLE_SCREEN_POST_DELAY);
+ FadeOut(REDRAW_FIELD);
game_status = GAME_MODE_MAIN;
- DrawMainMenuExt(TITLE_SCREEN_FADE_DELAY, REDRAW_FIELD);
+ DrawAndFadeInMainMenu(REDRAW_FIELD);
}
if (game_status == GAME_MODE_SCORES)
#define SCROLL_PAGE (2 * SCR_FIELDY)
-void DrawMainMenuExt(int, int);
+void DrawMainMenuExt(int, boolean);
+void DrawAndFadeInMainMenu(int);
void DrawMainMenu(void);
void DrawHallOfFame(int);
BackToFront();
}
-void FadeIn(int fade_delay)
+void FadeExt(int fade_mask, int fade_mode)
{
- if (fade_delay == 0)
- {
- BackToFront();
+ Bitmap *bitmap = (fade_mode == FADE_MODE_CROSSFADE ? bitmap_db_cross : NULL);
+ int fade_delay = menu.fade_delay;
+ int post_delay = (fade_mode == FADE_MODE_FADE_OUT ? menu.post_delay : 0);
+ int x, y, width, height;
- return;
+ if (fade_mask & REDRAW_ALL)
+ {
+ x = 0;
+ y = 0;
+ width = WIN_XSIZE;
+ height = WIN_YSIZE;
}
-
- FadeRectangle(NULL, 0, 0, WIN_XSIZE, WIN_YSIZE,
- FADE_MODE_FADE_IN, fade_delay, 0);
-
- redraw_mask = REDRAW_NONE;
-}
-
-void FadeOut(int fade_delay, int post_delay)
-{
- if (fade_delay == 0)
+ else if (fade_mask & REDRAW_FIELD)
{
- ClearRectangle(backbuffer, 0, 0, WIN_XSIZE, WIN_YSIZE);
- BackToFront();
-
- return;
+ x = REAL_SX;
+ y = REAL_SY;
+ width = FULL_SXSIZE;
+ height = FULL_SYSIZE;
}
- FadeRectangle(NULL, 0, 0, WIN_XSIZE, WIN_YSIZE,
- FADE_MODE_FADE_OUT, fade_delay, post_delay);
-
- redraw_mask = REDRAW_NONE;
-}
+ redraw_mask |= fade_mask;
-void FadeCross(int fade_delay)
-{
if (fade_delay == 0)
{
- BlitBitmap(bitmap_db_title, backbuffer, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0);
+ if (fade_mode == FADE_MODE_CROSSFADE)
+ BlitBitmap(bitmap, backbuffer, x, y, width, height, x, y);
+ else if (fade_mode == FADE_MODE_FADE_OUT)
+ ClearRectangle(backbuffer, x, y, width, height);
+
BackToFront();
return;
}
- FadeRectangle(bitmap_db_title, 0, 0, WIN_XSIZE, WIN_YSIZE,
- FADE_MODE_CROSSFADE, fade_delay, 0);
+ FadeRectangle(bitmap, x, y, width, height, fade_mode, fade_delay, post_delay);
- redraw_mask = REDRAW_NONE;
+ redraw_mask &= ~fade_mask;
}
-void FadeInField(int fade_delay)
+void FadeIn(int fade_mask)
{
- if (fade_delay == 0)
- {
- BackToFront();
-
- return;
- }
-
- FadeRectangle(NULL, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE,
- FADE_MODE_FADE_IN, fade_delay, 0);
-
- redraw_mask &= ~REDRAW_FIELD;
+ FadeExt(fade_mask, FADE_MODE_FADE_IN);
}
-void FadeOutField(int fade_delay, int post_delay)
+void FadeOut(int fade_mask)
{
- if (fade_delay == 0)
- {
- ClearRectangle(backbuffer, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE);
- BackToFront();
-
- return;
- }
-
- FadeRectangle(NULL, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE,
- FADE_MODE_FADE_OUT, fade_delay, post_delay);
-
- redraw_mask &= ~REDRAW_FIELD;
+ FadeExt(fade_mask, FADE_MODE_FADE_OUT);
}
-void FadeCrossField(int fade_delay)
+void FadeCross(int fade_mask)
{
- if (fade_delay == 0)
- {
- BlitBitmap(bitmap_db_title, backbuffer, REAL_SX, REAL_SY,
- FULL_SXSIZE, FULL_SYSIZE, REAL_SX, REAL_SY);
- BackToFront();
-
- return;
- }
-
- FadeRectangle(bitmap_db_title, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE,
- FADE_MODE_CROSSFADE, fade_delay, 0);
-
- redraw_mask &= ~REDRAW_FIELD;
+ FadeExt(fade_mask, FADE_MODE_CROSSFADE);
}
void SetMainBackgroundImageIfDefined(int graphic)
void FadeToFront();
void FadeIn(int);
-void FadeOut(int, int);
+void FadeOut(int);
void FadeCross(int);
-void FadeInField(int);
-void FadeOutField(int, int);
-void FadeCrossField(int);
void ClearWindow();
void SetMainBackgroundImageIfDefined(int);