+2006-10-12
+ * added directives "border.draw_masked.*" for menu/playfield area and
+ door areas to display overlapping/masked borders from "global.border"
+
2006-10-09
* fixed bug with CE with move speed "not moving" not being animated
* when changing player artwork by CE action, reset animation frame
{ "global.num_toons", "20" },
+ { "border.draw_masked.TITLE", "false" },
+ { "border.draw_masked.MAIN", "false" },
+ { "border.draw_masked.LEVELS", "false" },
+ { "border.draw_masked.SCORES", "false" },
+ { "border.draw_masked.EDITOR", "false" },
+ { "border.draw_masked.INFO", "false" },
+ { "border.draw_masked.SETUP", "false" },
+ { "border.draw_masked.PLAYING", "false" },
+ { "border.draw_masked.DOOR", "false" },
+
{ "menu.draw_xoffset", "0" },
{ "menu.draw_yoffset", "0" },
{ "menu.draw_xoffset.MAIN", "0" },
-#define COMPILE_DATE_STRING "[2006-10-09 21:55]"
+#define COMPILE_DATE_STRING "[2006-10-13 03:06]"
return position;
}
-inline static int getElementMoveStepsize(int x, int y)
+inline static int getElementMoveStepsizeExt(int x, int y, int direction)
{
int element = Feld[x][y];
- int direction = MovDir[x][y];
int dx = (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0);
int dy = (direction == MV_UP ? -1 : direction == MV_DOWN ? +1 : 0);
int horiz_move = (dx != 0);
return step;
}
+inline static int getElementMoveStepsize(int x, int y)
+{
+ return getElementMoveStepsizeExt(x, y, MovDir[x][y]);
+}
+
void InitPlayerGfxAnimation(struct PlayerInfo *player, int action, int dir)
{
if (player->GfxAction != action || player->GfxDir != dir)
void InitMovingField(int x, int y, int direction)
{
int element = Feld[x][y];
- int move_stepsize = getElementMoveStepsize(x, y);
int dx = (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0);
int dy = (direction == MV_UP ? -1 : direction == MV_DOWN ? +1 : 0);
int newx = x + dx;
int newy = y + dy;
- boolean is_moving = (move_stepsize != 0); /* moving or being moved */
+ boolean is_moving_before, is_moving_after;
+#if 0
boolean continues_moving = (WasJustMoving[x][y] && direction == MovDir[x][y]);
+#endif
- /* reset animation only for moving elements that change direction of moving
+ /* check if element was/is moving or being moved before/after mode change */
+#if 1
+ is_moving_before = WasJustMoving[x][y];
+#else
+ is_moving_before = (getElementMoveStepsizeExt(x, y, MovDir[x][y]) != 0);
+#endif
+ is_moving_after = (getElementMoveStepsizeExt(x, y, direction) != 0);
+
+ /* reset animation only for moving elements which change direction of moving
+ or which just started or stopped moving
(else CEs with property "can move" / "not moving" are reset each frame) */
#if USE_GFX_RESET_ONLY_WHEN_MOVING
- if (is_moving && !continues_moving)
+#if 1
+ if (is_moving_before != is_moving_after ||
+ direction != MovDir[x][y])
ResetGfxAnimation(x, y);
+#else
+ if ((is_moving_before || is_moving_after) && !continues_moving)
+ ResetGfxAnimation(x, y);
+#endif
#else
if (!continues_moving)
ResetGfxAnimation(x, y);
MovDir[x][y] = direction;
GfxDir[x][y] = direction;
- GfxAction[x][y] = (!is_moving ? ACTION_WAITING :
+
+#if USE_GFX_RESET_ONLY_WHEN_MOVING
+ GfxAction[x][y] = (!is_moving_after ? ACTION_WAITING :
direction == MV_DOWN && CAN_FALL(element) ?
ACTION_FALLING : ACTION_MOVING);
+#else
+ GfxAction[x][y] = (direction == MV_DOWN && CAN_FALL(element) ?
+ ACTION_FALLING : ACTION_MOVING);
+#endif
/* this is needed for CEs with property "can move" / "not moving" */
- if (is_moving)
+ if (is_moving_after)
{
if (Feld[newx][newy] == EL_EMPTY)
Feld[newx][newy] = EL_BLOCKED;
static int video_xoffset;
static int video_yoffset;
-static void setFullscreenParameters()
+static void setFullscreenParameters(char *fullscreen_mode_string)
{
struct ScreenModeInfo *fullscreen_mode;
int i;
- fullscreen_mode = get_screen_mode_from_string(setup.fullscreen_mode);
+ fullscreen_mode = get_screen_mode_from_string(fullscreen_mode_string);
if (fullscreen_mode == NULL)
return;
if (fullscreen && !video.fullscreen_enabled && video.fullscreen_available)
{
- setFullscreenParameters();
+ setFullscreenParameters(setup.fullscreen_mode);
video_xoffset = fullscreen_xoffset;
video_yoffset = fullscreen_yoffset;
/* do not try it again */
video.fullscreen_available = FALSE;
+
success = FALSE;
}
else
(*backbuffer)->surface = new_surface;
video.fullscreen_enabled = TRUE;
+ video.fullscreen_mode_current = setup.fullscreen_mode;
+
success = TRUE;
}
}
}
void SDLFadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height,
- int fade_mode, int fade_delay, int post_delay)
+ int fade_mode, int fade_delay, int post_delay,
+ void (*draw_border_function)(void))
{
static boolean initialization_needed = TRUE;
static SDL_Surface *surface_source = NULL;
SDL_SetAlpha(surface_target, SDL_SRCALPHA, alpha_final);
SDL_BlitSurface(surface_target, &src_rect, surface_screen, &dst_rect);
+ if (draw_border_function != NULL)
+ draw_border_function();
+
#if 1
/* only update the region of the screen that is affected from fading */
SDL_UpdateRect(surface_screen, dst_x, dst_y, width, height);
void SDLFreeBitmapPointers(Bitmap *);
void SDLCopyArea(Bitmap *, Bitmap *, int, int, int, int, int, int, int);
void SDLFillRectangle(Bitmap *, int, int, int, int, Uint32);
-void SDLFadeRectangle(Bitmap *, int, int, int, int, int, int, int);
+void SDLFadeRectangle(Bitmap *, int, int, int, int, int, int, int,
+ void (*draw_border_function)(void));
void SDLDrawSimpleLine(Bitmap *, int, int, int, int, Uint32);
void SDLDrawLine(Bitmap *, int, int, int, int, Uint32);
Pixel SDLGetPixel(Bitmap *, int, int);
}
void FadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height,
- int fade_mode, int fade_delay, int post_delay)
+ int fade_mode, int fade_delay, int post_delay,
+ void (*draw_border_function)(void))
{
#if defined(TARGET_SDL)
SDLFadeRectangle(bitmap_cross, x, y, width, height,
- fade_mode, fade_delay, post_delay);
+ fade_mode, fade_delay, post_delay, draw_border_function);
#else
X11FadeRectangle(bitmap_cross, x, y, width, height,
- fade_mode, fade_delay, post_delay);
+ fade_mode, fade_delay, post_delay, draw_border_function);
#endif
}
Bitmap *CreateBitmap(int, int, int);
void FreeBitmap(Bitmap *);
void BlitBitmap(Bitmap *, Bitmap *, int, int, int, int, int, int);
-void FadeRectangle(Bitmap *bitmap, int, int, int, int, int, int, int);
+void FadeRectangle(Bitmap *bitmap, int, int, int, int, int, int, int,
+ void (*draw_border_function)(void));
void FillRectangle(Bitmap *, int, int, int, int, Pixel);
void ClearRectangle(Bitmap *, int, int, int, int);
void ClearRectangleOnBackground(Bitmap *, int, int, int, int);
break;
case ANIM_STOP:
- redraw_mask |= (REDRAW_FIELD | REDRAW_FROM_BACKBUFFER);
+ if (anim_running)
+ {
+#if 0
+ redraw_mask |= (REDRAW_FIELD | REDRAW_FROM_BACKBUFFER);
- /* Redraw background even when in direct drawing mode */
- draw_mode = setup.direct_draw;
- setup.direct_draw = FALSE;
- screen_info.update_function();
- setup.direct_draw = draw_mode;
+ /* Redraw background even when in direct drawing mode */
+ draw_mode = setup.direct_draw;
+ setup.direct_draw = FALSE;
+ screen_info.update_function();
+ setup.direct_draw = draw_mode;
+#endif
- anim_running = FALSE;
+ anim_running = FALSE;
+ }
return;
}
void X11FadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height,
- int fade_mode, int fade_delay, int post_delay)
+ int fade_mode, int fade_delay, int post_delay,
+ void (*draw_border_function)(void))
{
/* fading currently not supported -- simply copy backbuffer to screen */
if (fade_mode == FADE_MODE_FADE_OUT)
- X11FillRectangle(window, x, y, width, height, BLACK_PIXEL);
- else
- X11CopyArea(backbuffer, window, x, y, width, height, 0, 0, BLIT_OPAQUE);
+ X11FillRectangle(backbuffer, x, y, width, height, BLACK_PIXEL);
+
+ if (draw_border_function != NULL)
+ draw_border_function();
+
+ X11CopyArea(backbuffer, window, x, y, width, height, 0, 0, BLIT_OPAQUE);
/* as we currently cannot use the fade delay, also do not use post delay */
}
void X11FreeBitmapPointers(Bitmap *);
void X11CopyArea(Bitmap *, Bitmap *, int, int, int, int, int, int, int);
void X11FillRectangle(Bitmap *, int, int, int, int, Pixel);
-void X11FadeRectangle(Bitmap *, int, int, int, int, int, int, int);
+void X11FadeRectangle(Bitmap *, int, int, int, int, int, int, int,
+ void (*draw_border_function)(void));
void X11DrawSimpleLine(Bitmap *, int, int, int, int, Pixel);
Pixel X11GetPixel(Bitmap *, int, int);
Pixel X11GetPixelFromRGB(unsigned int, unsigned int, unsigned int);
struct SetupInfo setup;
struct GameInfo game;
struct GlobalInfo global;
+struct BorderInfo border;
struct MenuInfo menu;
struct DoorInfo door_1, door_2;
struct PreviewInfo preview;
struct TokenIntPtrInfo image_config_vars[] =
{
- { "global.num_toons", &global.num_toons },
+ { "global.num_toons", &global.num_toons },
- { "menu.draw_xoffset", &menu.draw_xoffset[GFX_SPECIAL_ARG_DEFAULT] },
- { "menu.draw_yoffset", &menu.draw_yoffset[GFX_SPECIAL_ARG_DEFAULT] },
- { "menu.draw_xoffset.MAIN", &menu.draw_xoffset[GFX_SPECIAL_ARG_MAIN] },
- { "menu.draw_yoffset.MAIN", &menu.draw_yoffset[GFX_SPECIAL_ARG_MAIN] },
- { "menu.draw_xoffset.LEVELS", &menu.draw_xoffset[GFX_SPECIAL_ARG_LEVELS] },
- { "menu.draw_yoffset.LEVELS", &menu.draw_yoffset[GFX_SPECIAL_ARG_LEVELS] },
- { "menu.draw_xoffset.SCORES", &menu.draw_xoffset[GFX_SPECIAL_ARG_SCORES] },
- { "menu.draw_yoffset.SCORES", &menu.draw_yoffset[GFX_SPECIAL_ARG_SCORES] },
- { "menu.draw_xoffset.EDITOR", &menu.draw_xoffset[GFX_SPECIAL_ARG_EDITOR] },
- { "menu.draw_yoffset.EDITOR", &menu.draw_yoffset[GFX_SPECIAL_ARG_EDITOR] },
- { "menu.draw_xoffset.INFO", &menu.draw_xoffset[GFX_SPECIAL_ARG_INFO] },
- { "menu.draw_yoffset.INFO", &menu.draw_yoffset[GFX_SPECIAL_ARG_INFO] },
- { "menu.draw_xoffset.SETUP", &menu.draw_xoffset[GFX_SPECIAL_ARG_SETUP] },
- { "menu.draw_yoffset.SETUP", &menu.draw_yoffset[GFX_SPECIAL_ARG_SETUP] },
+ { "border.draw_masked.TITLE", &border.draw_masked[GFX_SPECIAL_ARG_TITLE] },
+ { "border.draw_masked.MAIN", &border.draw_masked[GFX_SPECIAL_ARG_MAIN] },
+ { "border.draw_masked.LEVELS", &border.draw_masked[GFX_SPECIAL_ARG_LEVELS] },
+ { "border.draw_masked.SCORES", &border.draw_masked[GFX_SPECIAL_ARG_SCORES] },
+ { "border.draw_masked.EDITOR", &border.draw_masked[GFX_SPECIAL_ARG_EDITOR] },
+ { "border.draw_masked.INFO", &border.draw_masked[GFX_SPECIAL_ARG_INFO] },
+ { "border.draw_masked.SETUP", &border.draw_masked[GFX_SPECIAL_ARG_SETUP] },
+ { "border.draw_masked.PLAYING",&border.draw_masked[GFX_SPECIAL_ARG_PLAYING] },
+ { "border.draw_masked.DOOR", &border.draw_masked[GFX_SPECIAL_ARG_DOOR] },
- { "menu.scrollbar_xoffset", &menu.scrollbar_xoffset },
+ { "menu.draw_xoffset", &menu.draw_xoffset[GFX_SPECIAL_ARG_DEFAULT] },
+ { "menu.draw_yoffset", &menu.draw_yoffset[GFX_SPECIAL_ARG_DEFAULT] },
+ { "menu.draw_xoffset.MAIN", &menu.draw_xoffset[GFX_SPECIAL_ARG_MAIN] },
+ { "menu.draw_yoffset.MAIN", &menu.draw_yoffset[GFX_SPECIAL_ARG_MAIN] },
+ { "menu.draw_xoffset.LEVELS", &menu.draw_xoffset[GFX_SPECIAL_ARG_LEVELS] },
+ { "menu.draw_yoffset.LEVELS", &menu.draw_yoffset[GFX_SPECIAL_ARG_LEVELS] },
+ { "menu.draw_xoffset.SCORES", &menu.draw_xoffset[GFX_SPECIAL_ARG_SCORES] },
+ { "menu.draw_yoffset.SCORES", &menu.draw_yoffset[GFX_SPECIAL_ARG_SCORES] },
+ { "menu.draw_xoffset.EDITOR", &menu.draw_xoffset[GFX_SPECIAL_ARG_EDITOR] },
+ { "menu.draw_yoffset.EDITOR", &menu.draw_yoffset[GFX_SPECIAL_ARG_EDITOR] },
+ { "menu.draw_xoffset.INFO", &menu.draw_xoffset[GFX_SPECIAL_ARG_INFO] },
+ { "menu.draw_yoffset.INFO", &menu.draw_yoffset[GFX_SPECIAL_ARG_INFO] },
+ { "menu.draw_xoffset.SETUP", &menu.draw_xoffset[GFX_SPECIAL_ARG_SETUP] },
+ { "menu.draw_yoffset.SETUP", &menu.draw_yoffset[GFX_SPECIAL_ARG_SETUP] },
- { "menu.list_size", &menu.list_size[GFX_SPECIAL_ARG_DEFAULT] },
- { "menu.list_size.LEVELS", &menu.list_size[GFX_SPECIAL_ARG_LEVELS] },
- { "menu.list_size.SCORES", &menu.list_size[GFX_SPECIAL_ARG_SCORES] },
- { "menu.list_size.INFO", &menu.list_size[GFX_SPECIAL_ARG_INFO] },
+ { "menu.scrollbar_xoffset", &menu.scrollbar_xoffset },
- { "menu.fade_delay", &menu.fade_delay },
- { "menu.post_delay", &menu.post_delay },
+ { "menu.list_size", &menu.list_size[GFX_SPECIAL_ARG_DEFAULT] },
+ { "menu.list_size.LEVELS", &menu.list_size[GFX_SPECIAL_ARG_LEVELS] },
+ { "menu.list_size.SCORES", &menu.list_size[GFX_SPECIAL_ARG_SCORES] },
+ { "menu.list_size.INFO", &menu.list_size[GFX_SPECIAL_ARG_INFO] },
- { "door_1.width", &door_1.width },
- { "door_1.height", &door_1.height },
- { "door_1.step_offset", &door_1.step_offset },
- { "door_1.step_delay", &door_1.step_delay },
- { "door_1.anim_mode", &door_1.anim_mode },
- { "door_2.width", &door_2.width },
- { "door_2.height", &door_2.height },
- { "door_2.step_offset", &door_2.step_offset },
- { "door_2.step_delay", &door_2.step_delay },
- { "door_2.anim_mode", &door_2.anim_mode },
+ { "menu.fade_delay", &menu.fade_delay },
+ { "menu.post_delay", &menu.post_delay },
- { "preview.x", &preview.x },
- { "preview.y", &preview.y },
- { "preview.xsize", &preview.xsize },
- { "preview.ysize", &preview.ysize },
- { "preview.tile_size", &preview.tile_size },
- { "preview.step_offset", &preview.step_offset },
- { "preview.step_delay", &preview.step_delay },
+ { "door_1.width", &door_1.width },
+ { "door_1.height", &door_1.height },
+ { "door_1.step_offset", &door_1.step_offset },
+ { "door_1.step_delay", &door_1.step_delay },
+ { "door_1.anim_mode", &door_1.anim_mode },
+ { "door_2.width", &door_2.width },
+ { "door_2.height", &door_2.height },
+ { "door_2.step_offset", &door_2.step_offset },
+ { "door_2.step_delay", &door_2.step_delay },
+ { "door_2.anim_mode", &door_2.anim_mode },
- { "game.panel.level.x", &game.panel.level.x },
- { "game.panel.level.y", &game.panel.level.y },
- { "game.panel.gems.x", &game.panel.gems.x },
- { "game.panel.gems.y", &game.panel.gems.y },
- { "game.panel.inventory.x", &game.panel.inventory.x },
- { "game.panel.inventory.y", &game.panel.inventory.y },
- { "game.panel.keys.x", &game.panel.keys.x },
- { "game.panel.keys.y", &game.panel.keys.y },
- { "game.panel.score.x", &game.panel.score.x },
- { "game.panel.score.y", &game.panel.score.y },
- { "game.panel.time.x", &game.panel.time.x },
- { "game.panel.time.y", &game.panel.time.y },
+ { "preview.x", &preview.x },
+ { "preview.y", &preview.y },
+ { "preview.xsize", &preview.xsize },
+ { "preview.ysize", &preview.ysize },
+ { "preview.tile_size", &preview.tile_size },
+ { "preview.step_offset", &preview.step_offset },
+ { "preview.step_delay", &preview.step_delay },
- { "[player].boring_delay_fixed", &game.player_boring_delay_fixed },
- { "[player].boring_delay_random", &game.player_boring_delay_random },
- { "[player].sleeping_delay_fixed", &game.player_sleeping_delay_fixed },
- { "[player].sleeping_delay_random", &game.player_sleeping_delay_random },
+ { "game.panel.level.x", &game.panel.level.x },
+ { "game.panel.level.y", &game.panel.level.y },
+ { "game.panel.gems.x", &game.panel.gems.x },
+ { "game.panel.gems.y", &game.panel.gems.y },
+ { "game.panel.inventory.x", &game.panel.inventory.x },
+ { "game.panel.inventory.y", &game.panel.inventory.y },
+ { "game.panel.keys.x", &game.panel.keys.x },
+ { "game.panel.keys.y", &game.panel.keys.y },
+ { "game.panel.score.x", &game.panel.score.x },
+ { "game.panel.score.y", &game.panel.score.y },
+ { "game.panel.time.x", &game.panel.time.x },
+ { "game.panel.time.y", &game.panel.time.y },
- { NULL, NULL, }
+ { "[player].boring_delay_fixed", &game.player_boring_delay_fixed },
+ { "[player].boring_delay_random", &game.player_boring_delay_random },
+ { "[player].sleeping_delay_fixed", &game.player_sleeping_delay_fixed },
+ { "[player].sleeping_delay_random", &game.player_sleeping_delay_random },
+
+ { NULL, NULL, }
};
#define NUM_ENGINE_TYPES 3
+struct BorderInfo
+{
+ int draw_masked[NUM_SPECIAL_GFX_ARGS];
+};
+
struct MenuInfo
{
int draw_xoffset[NUM_SPECIAL_GFX_ARGS];
extern struct HiScore highscore[];
extern struct TapeInfo tape;
extern struct GlobalInfo global;
+extern struct BorderInfo border;
extern struct MenuInfo menu;
extern struct DoorInfo door_1, door_2;
extern struct PreviewInfo preview;
graphic_info[IMG_TITLESCREEN_1].bitmap != NULL)
{
game_status = GAME_MODE_TITLE;
+
DrawTitleScreen();
return;
MapTapeButtons();
MapScreenMenuGadgets(SCREEN_MASK_MAIN);
+ DrawMaskedBorder(REDRAW_ALL);
+
if (do_fading)
FadeIn(redraw_mask);
else
PlayMenuSound();
PlayMenuMusic();
+ DrawMaskedBorder(REDRAW_ALL);
+
if (do_fading)
FadeIn(REDRAW_ALL);
else
GDI_STATE, GD_BUTTON_UNPRESSED,
GDI_DESIGN_UNPRESSED, gd_bitmap, gd_x1, gd_y,
GDI_DESIGN_PRESSED, gd_bitmap, gd_x2, gd_y,
+ GDI_DIRECT_DRAW, FALSE,
GDI_EVENT_MASK, GD_EVENT_RELEASED,
GDI_CALLBACK_ACTION, HandleTapeButtons,
GDI_END);
BlitBitmap(drawto, window, x, y, width, height, x, y);
}
+void DrawMaskedBorder_FIELD()
+{
+ if (game_status >= GAME_MODE_TITLE &&
+ game_status <= GAME_MODE_PLAYING &&
+ border.draw_masked[game_status])
+ BlitBitmapMasked(graphic_info[IMG_GLOBAL_BORDER].bitmap, backbuffer,
+ REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE,
+ REAL_SX, REAL_SY);
+}
+
+void DrawMaskedBorder_DOOR_1()
+{
+ if (border.draw_masked[GFX_SPECIAL_ARG_DOOR] &&
+ (game_status != GAME_MODE_EDITOR ||
+ border.draw_masked[GFX_SPECIAL_ARG_EDITOR]))
+ BlitBitmapMasked(graphic_info[IMG_GLOBAL_BORDER].bitmap, backbuffer,
+ DX, DY, DXSIZE, DYSIZE, DX, DY);
+}
+
+void DrawMaskedBorder_DOOR_2()
+{
+ if (border.draw_masked[GFX_SPECIAL_ARG_DOOR] &&
+ game_status != GAME_MODE_EDITOR)
+ BlitBitmapMasked(graphic_info[IMG_GLOBAL_BORDER].bitmap, backbuffer,
+ VX, VY, VXSIZE, VYSIZE, VX, VY);
+}
+
+void DrawMaskedBorder_DOOR_3()
+{
+ /* currently not available */
+}
+
+void DrawMaskedBorder_ALL()
+{
+ DrawMaskedBorder_FIELD();
+ DrawMaskedBorder_DOOR_1();
+ DrawMaskedBorder_DOOR_2();
+ DrawMaskedBorder_DOOR_3();
+}
+
+void DrawMaskedBorder(int redraw_mask)
+{
+ if (redraw_mask & REDRAW_ALL)
+ DrawMaskedBorder_ALL();
+ else
+ {
+ if (redraw_mask & REDRAW_FIELD)
+ DrawMaskedBorder_FIELD();
+ if (redraw_mask & REDRAW_DOOR_1)
+ DrawMaskedBorder_DOOR_1();
+ if (redraw_mask & REDRAW_DOOR_2)
+ DrawMaskedBorder_DOOR_2();
+ if (redraw_mask & REDRAW_DOOR_3)
+ DrawMaskedBorder_DOOR_3();
+ }
+}
+
void BackToFront()
{
int x,y;
if (game_status != GAME_MODE_PLAYING ||
redraw_mask & REDRAW_FROM_BACKBUFFER)
{
+ DrawMaskedBorder(REDRAW_FIELD);
BlitBitmap(backbuffer, window,
REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE, REAL_SX, REAL_SY);
}
ABS(ScreenMovPos) == ScrollStepSize ||
redraw_tiles > REDRAWTILES_THRESHOLD)
{
+#if 1
+ if (border.draw_masked[GFX_SPECIAL_ARG_MAIN])
+ {
+ BlitBitmap(buffer, backbuffer, fx, fy, SXSIZE, SYSIZE, SX, SY);
+
+ DrawMaskedBorder(REDRAW_FIELD);
+ BlitBitmap(backbuffer, window,
+ REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE,
+ REAL_SX, REAL_SY);
+ }
+ else
+ BlitBitmap(buffer, window, fx, fy, SXSIZE, SYSIZE, SX, SY);
+#else
BlitBitmap(buffer, window, fx, fy, SXSIZE, SYSIZE, SX, SY);
+#endif
#if 0
#ifdef DEBUG
if (redraw_mask & REDRAW_DOORS)
{
if (redraw_mask & REDRAW_DOOR_1)
+ {
+ DrawMaskedBorder(REDRAW_DOOR_1);
BlitBitmap(backbuffer, window, DX, DY, DXSIZE, DYSIZE, DX, DY);
+ }
if (redraw_mask & REDRAW_DOOR_2)
+ {
+ DrawMaskedBorder(REDRAW_DOOR_2);
BlitBitmap(backbuffer, window, VX, VY, VXSIZE, VYSIZE, VX, VY);
+ }
if (redraw_mask & REDRAW_DOOR_3)
+ {
+ DrawMaskedBorder(REDRAW_DOOR_3);
BlitBitmap(backbuffer, window, EX, EY, EXSIZE, EYSIZE, EX, EY);
+ }
redraw_mask &= ~REDRAW_DOORS;
}
void FadeExt(int fade_mask, int fade_mode)
{
+ void (*draw_border_function)(void) = NULL;
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);
y = REAL_SY;
width = FULL_SXSIZE;
height = FULL_SYSIZE;
+
+ draw_border_function = DrawMaskedBorder_FIELD;
}
else /* REDRAW_ALL */
{
return;
}
- FadeRectangle(bitmap, x, y, width, height, fade_mode, fade_delay, post_delay);
+ FadeRectangle(bitmap, x, y, width, height, fade_mode, fade_delay, post_delay,
+ draw_border_function);
redraw_mask &= ~fade_mask;
}
GDI_DECORATION_POSITION, deco_xpos, deco_ypos,
GDI_DECORATION_SIZE, MINI_TILEX, MINI_TILEY,
GDI_DECORATION_SHIFTING, 1, 1,
+ GDI_DIRECT_DRAW, FALSE,
GDI_EVENT_MASK, event_mask,
GDI_CALLBACK_ACTION, HandleToolButtons,
GDI_END);
void ToggleFullscreenIfNeeded()
{
+ boolean change_fullscreen = (setup.fullscreen !=
+ video.fullscreen_enabled);
+ boolean change_fullscreen_mode = (video.fullscreen_enabled &&
+ !strEqual(setup.fullscreen_mode,
+ video.fullscreen_mode_current));
+
+ if (!video.fullscreen_available)
+ return;
+
+#if 1
+ if (change_fullscreen || change_fullscreen_mode)
+#else
if (setup.fullscreen != video.fullscreen_enabled ||
setup.fullscreen_mode != video.fullscreen_mode_current)
+#endif
{
Bitmap *tmp_backbuffer = CreateBitmap(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH);
/* save backbuffer content which gets lost when toggling fullscreen mode */
BlitBitmap(backbuffer, tmp_backbuffer, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0);
+#if 1
+ if (change_fullscreen_mode)
+#else
if (setup.fullscreen && video.fullscreen_enabled)
+#endif
{
- /* keep fullscreen mode, but change screen mode */
+ /* keep fullscreen, but change fullscreen mode (screen resolution) */
+#if 1
+ /* (this is now set in sdl.c) */
+#else
video.fullscreen_mode_current = setup.fullscreen_mode;
- video.fullscreen_enabled = FALSE;
+#endif
+ video.fullscreen_enabled = FALSE; /* force new fullscreen mode */
}
/* toggle fullscreen */
ChangeVideoModeIfNeeded(setup.fullscreen);
+
setup.fullscreen = video.fullscreen_enabled;
/* restore backbuffer content from temporary backbuffer backup bitmap */
void DumpTile(int, int);
+void DrawMaskedBorder_FIELD();
+void DrawMaskedBorder_DOOR_1();
+void DrawMaskedBorder_DOOR_2();
+void DrawMaskedBorder_DOOR_3();
+void DrawMaskedBorder_ALL();
+void DrawMaskedBorder(int);
+
void SetDrawtoField(int);
void RedrawPlayfield(boolean, int, int, int, int);
void BackToFront();