rnd-20070418-1-src
authorHolger Schemel <info@artsoft.org>
Wed, 18 Apr 2007 17:53:09 +0000 (19:53 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:55:39 +0000 (10:55 +0200)
* fixed small problem with separate fading definition for game screen

ChangeLog
src/conftime.h
src/game.c
src/init.c
src/main.h
src/screens.c
src/tools.c

index d817ef0deee15026e3c2db2d6e54f589ef928f8d..247a18aced63a74877cac8196cb936bb5f47ee4e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2007-04-18
+       * fixed small problem with separate fading definition for game screen
+
 2007-04-14
        * added additional configuration directives for setup screen draw offset
          menu.draw_xoffset.SETUP[XXX] and menu.draw_yoffset.SETUP[XXX] with XXX
index 02130fc330786a15ac5be4ff61e9d6e7d88e1391..d28cca62d3a119cf047bd7dec6fdbfd4b988e155 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "2007-04-15 00:14"
+#define COMPILE_DATE_STRING "2007-04-18 19:50"
index b18cfda3447d2797e6fb1fe4e470019c7393e38f..1079966e2d26079c20bbf2dbc6bda86a0c212009 100644 (file)
@@ -4124,8 +4124,10 @@ void InitGame()
                local_player->jy - MIDPOSY);
   }
 
+#if 0
   /* do not use PLAYING mask for fading out from main screen */
   game_status = GAME_MODE_MAIN;
+#endif
 
   StopAnimation();
 
@@ -4151,7 +4153,9 @@ void InitGame()
     FadeOut(REDRAW_FIELD);
 #endif
 
+#if 0
   game_status = GAME_MODE_PLAYING;
+#endif
 
   /* !!! FIX THIS (START) !!! */
   if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
index d9f258eeeed65acc476d5b009effc12b1cf2ea02..d1316588d065e0185ddf0efa34e5a83b9b9bcda1 100644 (file)
@@ -4460,6 +4460,10 @@ static void InitGlobal()
   global.frames_per_second = 0;
   global.fps_slowdown = FALSE;
   global.fps_slowdown_factor = 1;
+
+  global.border_status = GAME_MODE_MAIN;
+  global.fading_status = GAME_MODE_MAIN;
+  global.fading_type = TYPE_ENTER_MENU;
 }
 
 void Execute_Command(char *command)
index 700d7e6a3c0a7d5a2afc9d7b1fff62c72a470e70..23d1b49e680f576fb2c5cd8dcc593ba769be0e46 100644 (file)
@@ -2334,6 +2334,11 @@ struct GlobalInfo
   float frames_per_second;
   boolean fps_slowdown;
   int fps_slowdown_factor;
+
+  /* global values for fading screens and masking borders */
+  int border_status;
+  int fading_status;
+  int fading_type;
 };
 
 struct ElementChangeInfo
index 4a0110fb00733cb49bd60ec4a8db5992bdfd7e85..4289203cf9269f05601b370fe7c659cf9d1ff33b 100644 (file)
@@ -6065,6 +6065,21 @@ void HandleGameActions()
     AutoPlayTape();    /* continue automatically playing next tape */
 }
 
+#if 0
+void ChangeGameStatus(int new_game_status)
+{
+  /* for fading out last screen, use the last game status */
+  global.border_status = game_status;
+  global.fading_status = game_status;
+
+  /* ... */
+
+  /* for fading in next screen, use the new game status */
+  global.border_status = new_game_status;
+  global.fading_status = new_game_status;
+}
+#endif
+
 
 /* ---------- new screen button stuff -------------------------------------- */
 
index 3ec8d328d1dca951c9d7e00bd77749cd0652e9d7..2ae872b475000ea3d2f0bddca41248f332f09f1c 100644 (file)
@@ -205,16 +205,16 @@ void DrawMaskedBorder_Rect(int x, int y, int width, int height)
 
 void DrawMaskedBorder_FIELD()
 {
-  if (game_status >= GAME_MODE_TITLE &&
-      game_status <= GAME_MODE_PLAYING &&
-      border.draw_masked[game_status])
+  if (global.border_status >= GAME_MODE_TITLE &&
+      global.border_status <= GAME_MODE_PLAYING &&
+      border.draw_masked[global.border_status])
     DrawMaskedBorder_Rect(REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE);
 }
 
 void DrawMaskedBorder_DOOR_1()
 {
   if (border.draw_masked[GFX_SPECIAL_ARG_DOOR] &&
-      (game_status != GAME_MODE_EDITOR ||
+      (global.border_status != GAME_MODE_EDITOR ||
        border.draw_masked[GFX_SPECIAL_ARG_EDITOR]))
     DrawMaskedBorder_Rect(DX, DY, DXSIZE, DYSIZE);
 }
@@ -222,7 +222,7 @@ void DrawMaskedBorder_DOOR_1()
 void DrawMaskedBorder_DOOR_2()
 {
   if (border.draw_masked[GFX_SPECIAL_ARG_DOOR] &&
-      game_status != GAME_MODE_EDITOR)
+      global.border_status != GAME_MODE_EDITOR)
     DrawMaskedBorder_Rect(VX, VY, VXSIZE, VYSIZE);
 }
 
@@ -620,6 +620,29 @@ void FadeExt(int fade_mask, int fade_mode)
 
 void FadeIn(int fade_mask)
 {
+  global.border_status = game_status;
+
+#if 0
+  global.fading_status = game_status;
+
+  if (global.fading_type == TYPE_ENTER_MENU)
+    fading = menu.enter_menu;
+  else if (global.fading_type == TYPE_LEAVE_MENU)
+    fading = menu.leave_menu;
+  else if (global.fading_type == TYPE_ENTER_SCREEN)
+    fading = menu.enter_screen[global.fading_status];
+  else if (global.fading_type == TYPE_LEAVE_SCREEN)
+    fading = menu.leave_screen[global.fading_status];
+
+  printf("::: FadeIn: %s [0x%08x] [%d]\n",
+        global.fading_type == TYPE_ENTER_MENU ? "enter_menu" :
+        global.fading_type == TYPE_LEAVE_MENU ? "leave_menu" :
+        global.fading_type == TYPE_ENTER_SCREEN ? "enter_screen" :
+        global.fading_type == TYPE_LEAVE_SCREEN ? "leave_screen" : "(?)",
+        global.fading_type,
+        global.fading_status);
+#endif
+
 #if 1
   // printf("::: now fading in...\n");
 
@@ -641,6 +664,25 @@ void FadeIn(int fade_mask)
 
 void FadeOut(int fade_mask)
 {
+#if 0
+  if (global.fading_type == TYPE_ENTER_MENU)
+    fading = menu.enter_menu;
+  else if (global.fading_type == TYPE_LEAVE_MENU)
+    fading = menu.leave_menu;
+  else if (global.fading_type == TYPE_ENTER_SCREEN)
+    fading = menu.enter_screen[global.fading_status];
+  else if (global.fading_type == TYPE_LEAVE_SCREEN)
+    fading = menu.leave_screen[global.fading_status];
+
+  printf("::: FadeOut: %s [0x%08x] [%d]\n",
+        global.fading_type == TYPE_ENTER_MENU ? "enter_menu" :
+        global.fading_type == TYPE_LEAVE_MENU ? "leave_menu" :
+        global.fading_type == TYPE_ENTER_SCREEN ? "enter_screen" :
+        global.fading_type == TYPE_LEAVE_SCREEN ? "leave_screen" : "(?)",
+        global.fading_type,
+        global.fading_status);
+#endif
+
 #if 1
   // printf("::: fading.fade_mode == %d\n", fading.fade_mode);
 
@@ -670,6 +712,32 @@ void FadeCrossSaveBackbuffer()
   BlitBitmap(backbuffer, bitmap_db_cross, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0);
 }
 
+#if 0
+void FadeSetEnterMenu()
+{
+  global.fading_type = TYPE_ENTER_MENU;
+}
+
+void FadeSetLeaveMenu()
+{
+  global.fading_type = TYPE_LEAVE_MENU;
+}
+
+void FadeSetEnterScreen()
+{
+  global.fading_type = TYPE_ENTER_SCREEN;
+}
+
+void FadeSetLeaveScreen()
+{
+  // global.fading_type = TYPE_LEAVE_SCREEN;
+
+  global.fading_type = (global.fading_type == TYPE_ENTER_SCREEN ?
+                       TYPE_LEAVE_SCREEN : TYPE_LEAVE_MENU);
+}
+
+#else
+
 static void FadeSetLeaveNext(struct TitleFadingInfo fading_leave, boolean set)
 {
   static struct TitleFadingInfo fading_leave_stored;
@@ -684,6 +752,10 @@ void FadeSetEnterMenu()
 {
   fading = menu.enter_menu;
 
+#if 0
+  printf("::: storing enter_menu\n");
+#endif
+
   FadeSetLeaveNext(fading, TRUE);      /* (keep same fade mode) */
 }
 
@@ -691,6 +763,10 @@ void FadeSetLeaveMenu()
 {
   fading = menu.leave_menu;
 
+#if 0
+  printf("::: storing leave_menu\n");
+#endif
+
   FadeSetLeaveNext(fading, TRUE);      /* (keep same fade mode) */
 }
 
@@ -698,14 +774,32 @@ void FadeSetEnterScreen()
 {
   fading = menu.enter_screen[game_status];
 
+#if 0
+  printf("::: storing leave_screen[%d]\n", game_status);
+#endif
+
+#if 0
+  printf("::: - %d, %d / %d, %d\n",
+        menu.enter_screen[game_status].fade_mode,
+        menu.enter_screen[game_status].fade_delay,
+        menu.leave_screen[game_status].fade_mode,
+        menu.leave_screen[game_status].fade_delay);
+#endif
+
   FadeSetLeaveNext(menu.leave_screen[game_status], TRUE);      /* store */
 }
 
 void FadeSetLeaveScreen()
 {
+#if 0
+  printf("::: recalling last stored value\n");
+#endif
+
   FadeSetLeaveNext(menu.leave_screen[game_status], FALSE);     /* recall */
 }
 
+#endif
+
 void FadeSetFromType(int type)
 {
   if (type & TYPE_ENTER_SCREEN)