rnd-20061013-1-src
authorHolger Schemel <info@artsoft.org>
Fri, 13 Oct 2006 01:15:22 +0000 (03:15 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:53:15 +0000 (10:53 +0200)
* added directives "border.draw_masked.*" for menu/playfield area and
  door areas to display overlapping/masked borders from "global.border"

17 files changed:
ChangeLog
src/conf_gfx.c
src/conftime.h
src/game.c
src/libgame/sdl.c
src/libgame/sdl.h
src/libgame/system.c
src/libgame/system.h
src/libgame/toons.c
src/libgame/x11.c
src/libgame/x11.h
src/main.c
src/main.h
src/screens.c
src/tape.c
src/tools.c
src/tools.h

index 16e53b91ddf2b410d2961db6633695a83b3319fe..31f250cb5c566de6f1a0128e1a99bed114e7c1f4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+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
index b67f1f53c8568eb7a4ceb6da462409197550a7b2..56c3c61bb069cae106f55258187f8ede9d01d011 100644 (file)
@@ -4513,6 +4513,16 @@ struct ConfigInfo image_config[] =
 
   { "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"                     },
index b9d640b7755f07e0fa4203d96b1b959c8521deb1..795a767949ec4fe0307c8263487268d385745a16 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2006-10-09 21:55]"
+#define COMPILE_DATE_STRING "[2006-10-13 03:06]"
index 4d71c89aa190dddb244c4d818230e530447a6ac9..e868babeec2a4318e6b2bda52a740fb436e5c468 100644 (file)
@@ -2927,10 +2927,9 @@ int NewHiScore()
   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);
@@ -2950,6 +2949,11 @@ inline static int getElementMoveStepsize(int x, int y)
   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)
@@ -3006,19 +3010,35 @@ static void ResetRandomAnimationValue(int x, int y)
 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);
@@ -3026,13 +3046,19 @@ void InitMovingField(int x, int y, int direction)
 
   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;
index d06cca94da5646c067e79efca76810e78daa0209..6ac1229fcc3c761fa3b5ba3b2c2e568b928ce038 100644 (file)
@@ -35,12 +35,12 @@ static int fullscreen_yoffset;
 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;
@@ -240,7 +240,7 @@ boolean SDLSetVideoMode(DrawBuffer **backbuffer, boolean fullscreen)
 
   if (fullscreen && !video.fullscreen_enabled && video.fullscreen_available)
   {
-    setFullscreenParameters();
+    setFullscreenParameters(setup.fullscreen_mode);
 
     video_xoffset = fullscreen_xoffset;
     video_yoffset = fullscreen_yoffset;
@@ -255,6 +255,7 @@ boolean SDLSetVideoMode(DrawBuffer **backbuffer, boolean fullscreen)
 
       /* do not try it again */
       video.fullscreen_available = FALSE;
+
       success = FALSE;
     }
     else
@@ -262,6 +263,8 @@ boolean SDLSetVideoMode(DrawBuffer **backbuffer, boolean fullscreen)
       (*backbuffer)->surface = new_surface;
 
       video.fullscreen_enabled = TRUE;
+      video.fullscreen_mode_current = setup.fullscreen_mode;
+
       success = TRUE;
     }
   }
@@ -383,7 +386,8 @@ void SDLFillRectangle(Bitmap *dst_bitmap, int x, int y, int width, int height,
 }
 
 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;
@@ -497,6 +501,9 @@ void SDLFadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height,
     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);
index 625b89e6fb756d90ab2ea62fdb762e6ec2f67526..5ab0461da88087cfb0e29aa4463400919eec0ab8 100644 (file)
@@ -354,7 +354,8 @@ void SDLCreateBitmapContent(Bitmap *, int, int, int);
 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);
index 6e3eaaba10804489e8f082a5e8303dcffc87a580..55046b8890a428a037ed9b3437c1405d1979db0c 100644 (file)
@@ -462,14 +462,15 @@ void BlitBitmap(Bitmap *src_bitmap, Bitmap *dst_bitmap,
 }
 
 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
 }
 
index 99d7c59deaadd253fa089649b09480745bbf2942..081471abf6c3cfad0830596668c2398fe56fa818 100644 (file)
@@ -1047,7 +1047,8 @@ Bitmap *CreateBitmapStruct(void);
 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);
index c5f1ff39bbdd0de17040a8208f9cd171c638e91f..f48621b950bcf60e4f7184fb0b0af2e83a9100f0 100644 (file)
@@ -335,15 +335,20 @@ void HandleAnimation(int mode)
       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;
 
index a9f2343101993f08c5473efc9e4336ebf674a5c7..2bbf76d558e01c1761c82734dd1acdb9ad3edef3 100644 (file)
@@ -363,14 +363,18 @@ void X11FillRectangle(Bitmap *bitmap, int x, int y,
 }
 
 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 */
 }
index 0e2ba46e2aa567b6b2d7930446b73f6100b36969..28e8f5e80863696116e76f4456071820481b969c 100644 (file)
@@ -339,7 +339,8 @@ void X11CreateBitmapContent(Bitmap *, int, int, int);
 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);
index 25bdd22b41086c82189de274f0d9cc67782c00a7..76799920ef4803d5929f1772a651e3627c3ccdf6 100644 (file)
@@ -104,6 +104,7 @@ struct TapeInfo             tape;
 struct SetupInfo       setup;
 struct GameInfo                game;
 struct GlobalInfo      global;
+struct BorderInfo      border;
 struct MenuInfo                menu;
 struct DoorInfo                door_1, door_2;
 struct PreviewInfo     preview;
@@ -4636,71 +4637,81 @@ struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1 + 1] =
 
 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,                                         }
 };
 
 
index a1b5d65976f79df30e5aeb9908d5150365af8c98..b4a34769c919bac28055650ab075c74d43c96728 100644 (file)
 #define NUM_ENGINE_TYPES               3
 
 
+struct BorderInfo
+{
+  int draw_masked[NUM_SPECIAL_GFX_ARGS];
+};
+
 struct MenuInfo
 {
   int draw_xoffset[NUM_SPECIAL_GFX_ARGS];
@@ -2407,6 +2412,7 @@ extern struct LevelInfo           level, level_template;
 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;
index 09e029690df32868e6848f03384501f8afab262b..94c63b8826d76d06b704da0c041cb5e3491089e1 100644 (file)
@@ -358,6 +358,7 @@ void DrawMainMenuExt(int redraw_mask, boolean do_fading)
       graphic_info[IMG_TITLESCREEN_1].bitmap != NULL)
   {
     game_status = GAME_MODE_TITLE;
+
     DrawTitleScreen();
 
     return;
@@ -431,6 +432,8 @@ void DrawMainMenuExt(int redraw_mask, boolean do_fading)
   MapTapeButtons();
   MapScreenMenuGadgets(SCREEN_MASK_MAIN);
 
+  DrawMaskedBorder(REDRAW_ALL);
+
   if (do_fading)
     FadeIn(redraw_mask);
   else
@@ -848,6 +851,8 @@ static void DrawInfoScreen_Main(boolean do_fading)
   PlayMenuSound();
   PlayMenuMusic();
 
+  DrawMaskedBorder(REDRAW_ALL);
+
   if (do_fading)
     FadeIn(REDRAW_ALL);
   else
index 0bdff1530a11888b825a7bf4d13be7b484168703..1aaabf55505f14819adaeb200b8344500ec3d9d8 100644 (file)
@@ -1239,6 +1239,7 @@ void CreateTapeButtons()
                      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);
index 7da6d255c83ac159006baf1ae5849bd83f7effa4..21c5315352ca4e1e5b0c20730ea2d343a2910172 100644 (file)
@@ -194,6 +194,63 @@ void RedrawPlayfield(boolean force_redraw, int x, int y, int width, int height)
   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;
@@ -260,6 +317,7 @@ void BackToFront()
     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);
     }
@@ -278,7 +336,21 @@ void BackToFront()
          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
@@ -302,13 +374,22 @@ void BackToFront()
   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;
   }
@@ -426,6 +507,7 @@ void FadeToFront()
 
 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);
@@ -437,6 +519,8 @@ void FadeExt(int fade_mask, int fade_mode)
     y = REAL_SY;
     width  = FULL_SXSIZE;
     height = FULL_SYSIZE;
+
+    draw_border_function = DrawMaskedBorder_FIELD;
   }
   else         /* REDRAW_ALL */
   {
@@ -458,7 +542,8 @@ void FadeExt(int fade_mask, int fade_mode)
     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;
 }
@@ -3093,6 +3178,7 @@ void CreateToolButtons()
                      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);
@@ -6002,23 +6088,45 @@ void PlayMenuMusic()
 
 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 */
index 7a29b910c99010587860005723b8a817441ed428..ec72a61107b451a0f858b1d35f778429013542fa 100644 (file)
 
 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();