#define EX_TYPE_DYNA (1 << 4)
#define EX_TYPE_SINGLE_TILE (EX_TYPE_CENTER | EX_TYPE_BORDER)
-#if 1
#define PANEL_OFF() (local_player->LevelSolved_PanelOff)
#define PANEL_DEACTIVATED(p) ((p)->x < 0 || (p)->y < 0 || PANEL_OFF())
-#define PANEL_XPOS(p) (DX + ALIGNED_MENU_XPOS(p))
-#define PANEL_YPOS(p) (DY + ALIGNED_MENU_YPOS(p))
-#else
-#define PANEL_DEACTIVATED(p) ((p).x < 0 || (p).y < 0)
-#define PANEL_XPOS(p) (ALIGNED_XPOS((p).x, (p).width, (p).align))
-#define PANEL_YPOS(p) ((p).y)
-#endif
+#define PANEL_XPOS(p) (DX + ALIGNED_TEXT_XPOS(p))
+#define PANEL_YPOS(p) (DY + ALIGNED_TEXT_YPOS(p))
/* special positions in the game control window (relative to control window) */
#define XX_LEVEL1 (PANEL_XPOS(game.panel.level))
#if 1
struct TextPosInfo *pos = &game.panel.key[i];
#endif
- int src_x = DOOR_GFX_PAGEX5 + 18;
+ int src_x = DOOR_GFX_PAGEX5 + 18 + (i % 4) * MINI_TILEX;
int src_y = DOOR_GFX_PAGEY1 + 123;
#if 1
int dst_x = PANEL_XPOS(pos);
boolean emulate_bd = TRUE; /* unless non-BOULDERDASH elements found */
boolean emulate_sb = TRUE; /* unless non-SOKOBAN elements found */
boolean emulate_sp = TRUE; /* unless non-SUPAPLEX elements found */
+#if 0
boolean do_fading = (game_status == GAME_MODE_MAIN);
+#endif
int i, j, x, y;
game_status = GAME_MODE_PLAYING;
if (!game.restart_level)
CloseDoor(DOOR_CLOSE_1);
+#if 1
+ if (level_editor_test_game)
+ FadeSkipNextFadeIn();
+ else
+ FadeSetStartItem();
+#else
+ if (level_editor_test_game)
+ fading = fading_none;
+ else
+ fading = menu.destination;
+#endif
+
+#if 1
+ FadeOut(REDRAW_FIELD);
+#else
if (do_fading)
FadeOut(REDRAW_FIELD);
+#endif
/* !!! FIX THIS (START) !!! */
if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
}
/* !!! FIX THIS (END) !!! */
+#if 1
+ FadeIn(REDRAW_FIELD);
+#else
if (do_fading)
FadeIn(REDRAW_FIELD);
BackToFront();
+#endif
if (!game.restart_level)
{
{
game_status = GAME_MODE_MAIN;
+#if 1
+ DrawAndFadeInMainMenu(REDRAW_FIELD);
+#else
DrawMainMenu();
+#endif
return;
}
if (!local_player->LevelSolved_SaveScore)
{
+#if 1
FadeOut(REDRAW_FIELD);
+#endif
game_status = GAME_MODE_MAIN;
}
else
{
+#if 1
FadeOut(REDRAW_FIELD);
+#endif
game_status = GAME_MODE_MAIN;
if (!IN_VIS_FIELD(SCREENX(x), SCREENY(y)) || center_screen)
{
- if (center_screen)
+ if (!level.shifted_relocation || center_screen)
{
+ /* quick relocation (without scrolling), with centering of screen */
+
scroll_x = (x < SBX_Left + MIDPOSX ? SBX_Left :
x > SBX_Right + MIDPOSX ? SBX_Right :
x - MIDPOSX);
}
else
{
+ /* quick relocation (without scrolling), inside visible screen area */
+
if ((move_dir == MV_LEFT && scroll_x > x - MIDPOSX + offset) ||
(move_dir == MV_RIGHT && scroll_x < x - MIDPOSX - offset))
scroll_x = x - MIDPOSX + (scroll_x < x - MIDPOSX ? -offset : +offset);
}
else
{
+#if 1
+ int scroll_xx, scroll_yy;
+
+ if (!level.shifted_relocation || center_screen)
+ {
+ /* visible relocation (with scrolling), with centering of screen */
+
+ scroll_xx = (x < SBX_Left + MIDPOSX ? SBX_Left :
+ x > SBX_Right + MIDPOSX ? SBX_Right :
+ x - MIDPOSX);
+
+ scroll_yy = (y < SBY_Upper + MIDPOSY ? SBY_Upper :
+ y > SBY_Lower + MIDPOSY ? SBY_Lower :
+ y - MIDPOSY);
+ }
+ else
+ {
+ /* visible relocation (with scrolling), but do not center screen */
+
+ int center_scroll_x = (old_x < SBX_Left + MIDPOSX ? SBX_Left :
+ old_x > SBX_Right + MIDPOSX ? SBX_Right :
+ old_x - MIDPOSX);
+
+ int center_scroll_y = (old_y < SBY_Upper + MIDPOSY ? SBY_Upper :
+ old_y > SBY_Lower + MIDPOSY ? SBY_Lower :
+ old_y - MIDPOSY);
+
+ int offset_x = x + (scroll_x - center_scroll_x);
+ int offset_y = y + (scroll_y - center_scroll_y);
+
+ scroll_xx = (offset_x < SBX_Left + MIDPOSX ? SBX_Left :
+ offset_x > SBX_Right + MIDPOSX ? SBX_Right :
+ offset_x - MIDPOSX);
+
+ scroll_yy = (offset_y < SBY_Upper + MIDPOSY ? SBY_Upper :
+ offset_y > SBY_Lower + MIDPOSY ? SBY_Lower :
+ offset_y - MIDPOSY);
+ }
+
+#else
+
+ /* visible relocation (with scrolling), with centering of screen */
+
int scroll_xx = (x < SBX_Left + MIDPOSX ? SBX_Left :
x > SBX_Right + MIDPOSX ? SBX_Right :
x - MIDPOSX);
int scroll_yy = (y < SBY_Upper + MIDPOSY ? SBY_Upper :
y > SBY_Lower + MIDPOSY ? SBY_Lower :
y - MIDPOSY);
+#endif
ScrollScreen(NULL, SCROLL_GO_ON); /* scroll last frame to full tile */
{
if (quick_quit)
{
+#if 1
+
+#if 1
+ FadeSkipNextFadeIn();
+#else
+ fading = fading_none;
+#endif
+
+#else
+ OpenDoor(DOOR_CLOSE_1);
+#endif
+
game_status = GAME_MODE_MAIN;
+#if 1
+ DrawAndFadeInMainMenu(REDRAW_FIELD);
+#else
DrawMainMenu();
+#endif
}
else
{
+#if 0
FadeOut(REDRAW_FIELD);
+#endif
game_status = GAME_MODE_MAIN;