rnd-20020921-5-src
authorHolger Schemel <info@artsoft.org>
Sat, 21 Sep 2002 14:16:23 +0000 (16:16 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:38:38 +0000 (10:38 +0200)
src/conftime.h
src/game.c
src/init.c
src/tools.c

index 74c9728a0b236eb06c6a23f955f1c32f98f7c7ed..39b701d2b627247e7496b3f9fb2abc537f50bca8 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2002-09-21 15:51]"
+#define COMPILE_DATE_STRING "[2002-09-21 16:16]"
index beabbab2c66cc25bfe2240049930da7695b19b66..725f69b78521b0a453321c3c8cd04c1f6825f448 100644 (file)
@@ -1996,6 +1996,20 @@ static void ToggleSwitchgateSwitch(int x, int y)
   }
 }
 
+static int getInvisibleActiveFromInvisibleElement(int element)
+{
+  return (element == EL_INVISIBLE_STEELWALL ? EL_INVISIBLE_STEELWALL_ACTIVE :
+         element == EL_INVISIBLE_WALL      ? EL_INVISIBLE_WALL_ACTIVE :
+         EL_INVISIBLE_SAND_ACTIVE);
+}
+
+static int getInvisibleFromInvisibleActiveElement(int element)
+{
+  return (element == EL_INVISIBLE_STEELWALL_ACTIVE ? EL_INVISIBLE_STEELWALL :
+         element == EL_INVISIBLE_WALL_ACTIVE      ? EL_INVISIBLE_WALL :
+         EL_INVISIBLE_SAND);
+}
+
 static void RedrawAllLightSwitchesAndInvisibleElements()
 {
   int x, y;
@@ -2018,11 +2032,24 @@ static void RedrawAllLightSwitchesAndInvisibleElements()
        Feld[x][y] = EL_LIGHT_SWITCH;
        DrawLevelField(x, y);
       }
+      else if (element == EL_INVISIBLE_STEELWALL ||
+              element == EL_INVISIBLE_WALL ||
+              element == EL_INVISIBLE_SAND)
+      {
+       if (game.light_time_left > 0)
+         Feld[x][y] = getInvisibleActiveFromInvisibleElement(element);
+
+       DrawLevelField(x, y);
+      }
+      else if (element == EL_INVISIBLE_STEELWALL_ACTIVE ||
+              element == EL_INVISIBLE_WALL_ACTIVE ||
+              element == EL_INVISIBLE_SAND_ACTIVE)
+      {
+       if (game.light_time_left == 0)
+         Feld[x][y] = getInvisibleFromInvisibleActiveElement(element);
 
-      if (element == EL_INVISIBLE_STEELWALL ||
-         element == EL_INVISIBLE_WALL ||
-         element == EL_INVISIBLE_SAND)
        DrawLevelField(x, y);
+      }
     }
   }
 }
@@ -5021,22 +5048,7 @@ void GameActions()
     game.light_time_left--;
 
     if (game.light_time_left == 0)
-    {
-      for (y=0; y<lev_fieldy; y++) for (x=0; x<lev_fieldx; x++)
-      {
-       element = Feld[x][y];
-
-       if (element == EL_LIGHT_SWITCH_ACTIVE)
-       {
-         Feld[x][y] = EL_LIGHT_SWITCH;
-         DrawLevelField(x, y);
-       }
-       else if (element == EL_INVISIBLE_STEELWALL ||
-                element == EL_INVISIBLE_WALL ||
-                element == EL_INVISIBLE_SAND)
-         DrawLevelField(x, y);
-      }
-    }
+      RedrawAllLightSwitchesAndInvisibleElements();
   }
 
   if (game.timegate_time_left > 0)
@@ -5885,6 +5897,7 @@ int DigField(struct PlayerInfo *player,
     case EL_EMPTY:
     case EL_SAND:
     case EL_INVISIBLE_SAND:
+    case EL_INVISIBLE_SAND_ACTIVE:
     case EL_TRAP:
     case EL_SP_BASE:
     case EL_SP_BUGGY_BASE:
index c2e69b87e351f5a6487a7daabfcedc2355d4c6b3..b10b8ec9fa1aff18f4b6caaa28dd2e2380c65fd8 100644 (file)
@@ -653,6 +653,7 @@ void InitElementInfo()
     { EL_PACMAN_LEFT,                  GFX_PACMAN_LEFT         },
     { EL_PACMAN_DOWN,                  GFX_PACMAN_DOWN         },
     { EL_INVISIBLE_WALL,               GFX_UNSICHTBAR          },
+    { EL_INVISIBLE_WALL_ACTIVE,                GFX_UNSICHTBAR_ON       },
     { EL_WALL_EMERALD,                 GFX_ERZ_EDEL            },
     { EL_WALL_DIAMOND,                 GFX_ERZ_DIAM            },
     { EL_LAMP,                         GFX_BIRNE_AUS           },
@@ -701,6 +702,7 @@ void InitElementInfo()
     { EL_SP_BUGGY_BASE_ACTIVE,         GFX_SP_BUG_ACTIVE       },
     { EL_SP_ZONK,                      GFX_SP_ZONK             },
     { EL_INVISIBLE_STEELWALL,          GFX_INVISIBLE_STEEL     },
+    { EL_INVISIBLE_STEELWALL_ACTIVE,   GFX_INVISIBLE_STEEL_ON  },
     { EL_BLACK_ORB,                    GFX_BLACK_ORB           },
     { EL_EM_GATE1,                     GFX_EM_GATE_1           },
     { EL_EM_GATE2,                     GFX_EM_GATE_2           },
@@ -790,6 +792,7 @@ void InitElementInfo()
     { EL_MOLE_DOWN,                    GFX_MOLE_DOWN           },
     { EL_STEELWALL_SLANTED,            GFX_STEEL_SLANTED       },
     { EL_INVISIBLE_SAND,               GFX_SAND_INVISIBLE      },
+    { EL_INVISIBLE_SAND_ACTIVE,                GFX_SAND_INVISIBLE_ON   },
     { EL_DX_UNKNOWN_15,                        GFX_DX_UNKNOWN_15       },
     { EL_DX_UNKNOWN_42,                        GFX_DX_UNKNOWN_42       },
     { EL_TIMEGATE_OPEN,                        GFX_TIMEGATE_OPEN       },
@@ -1191,6 +1194,9 @@ void InitElementProperties()
     EL_SP_EXIT_CLOSED,
     EL_SP_EXIT_OPEN,
     EL_INVISIBLE_STEELWALL,
+    EL_INVISIBLE_STEELWALL_ACTIVE,
+    EL_INVISIBLE_WALL,
+    EL_INVISIBLE_WALL_ACTIVE,
     EL_CONVEYOR_BELT1_SWITCH_LEFT,
     EL_CONVEYOR_BELT1_SWITCH_MIDDLE,
     EL_CONVEYOR_BELT1_SWITCH_RIGHT,
@@ -1296,6 +1302,7 @@ void InitElementProperties()
     EL_SP_HARD_BASE5,
     EL_SP_HARD_BASE6,
     EL_INVISIBLE_STEELWALL,
+    EL_INVISIBLE_STEELWALL_ACTIVE,
     EL_CONVEYOR_BELT1_SWITCH_LEFT,
     EL_CONVEYOR_BELT1_SWITCH_MIDDLE,
     EL_CONVEYOR_BELT1_SWITCH_RIGHT,
@@ -1469,6 +1476,9 @@ void InitElementProperties()
     EL_SP_EXIT_CLOSED,
     EL_SP_EXIT_OPEN,
     EL_INVISIBLE_STEELWALL,
+    EL_INVISIBLE_STEELWALL_ACTIVE,
+    EL_INVISIBLE_WALL,
+    EL_INVISIBLE_WALL_ACTIVE,
     EL_STEELWALL_SLANTED,
     EL_EMC_STEELWALL1,
     EL_EMC_STEELWALL2,
@@ -1751,7 +1761,9 @@ void InitElementProperties()
     EL_EM_GATE3_GRAY,
     EL_EM_GATE4_GRAY,
     EL_DYNAMITE,
+    EL_INVISIBLE_STEELWALL,
     EL_INVISIBLE_WALL,
+    EL_INVISIBLE_SAND,
     EL_LAMP,
     EL_LAMP_ACTIVE,
     EL_WALL_EMERALD,
@@ -1808,7 +1820,6 @@ void InitElementProperties()
     EL_SP_HARD_BASE4,
     EL_SP_HARD_BASE5,
     EL_SP_HARD_BASE6,
-    EL_INVISIBLE_STEELWALL,
     EL_CONVEYOR_BELT1_SWITCH_LEFT,
     EL_CONVEYOR_BELT1_SWITCH_MIDDLE,
     EL_CONVEYOR_BELT1_SWITCH_RIGHT,
@@ -1934,7 +1945,8 @@ void InitElementProperties()
     EL_SP_BASE,
     EL_SP_BUGGY_BASE,
     EL_TRAP,
-    EL_INVISIBLE_SAND
+    EL_INVISIBLE_SAND,
+    EL_INVISIBLE_SAND_ACTIVE
   };
   static int ep_eatable_num = SIZEOF_ARRAY_INT(ep_eatable);
 
index 9a8c477c08332e8e0eb00048b679003ca94c90cd..5ab9b5a9eedabbe4291a01be612679e23f129039 100644 (file)
@@ -1438,6 +1438,7 @@ void DrawScreenElementExt(int x, int y, int dx, int dy, int element,
     else if (rechts_massiv)
       graphic = GFX_MAUER_L;
   }
+#if 0
   else if ((element == EL_INVISIBLE_STEELWALL ||
            element == EL_INVISIBLE_WALL ||
            element == EL_INVISIBLE_SAND) && game.light_time_left)
@@ -1446,6 +1447,7 @@ void DrawScreenElementExt(int x, int y, int dx, int dy, int element,
               element == EL_INVISIBLE_WALL ? GFX_UNSICHTBAR_ON :
               GFX_SAND_INVISIBLE_ON);
   }
+#endif
 
   if (dx || dy)
     DrawGraphicShifted(x, y, dx, dy, graphic, cut_mode, mask_mode);
@@ -1608,6 +1610,7 @@ void DrawNewScreenElementExt(int x, int y, int dx, int dy, int element,
     else if (rechts_massiv)
       graphic = GFX_MAUER_L;
   }
+#if 0
   else if ((element == EL_INVISIBLE_STEELWALL ||
            element == EL_INVISIBLE_WALL ||
            element == EL_INVISIBLE_SAND) && game.light_time_left)
@@ -1616,6 +1619,7 @@ void DrawNewScreenElementExt(int x, int y, int dx, int dy, int element,
               element == EL_INVISIBLE_WALL ? GFX_UNSICHTBAR_ON :
               GFX_SAND_INVISIBLE_ON);
   }
+#endif
 
   if (dx || dy)
     DrawNewGraphicShifted(x, y, dx, dy, graphic, frame, cut_mode, mask_mode);
@@ -3104,6 +3108,7 @@ int el2gfx_OLD(int element)
     case EL_PACMAN_LEFT:               return GFX_PACMAN_LEFT;
     case EL_PACMAN_DOWN:               return GFX_PACMAN_DOWN;
     case EL_INVISIBLE_WALL:            return GFX_UNSICHTBAR;
+    case EL_INVISIBLE_WALL_ACTIVE:     return GFX_UNSICHTBAR_ON;
     case EL_WALL_EMERALD:              return GFX_ERZ_EDEL;
     case EL_WALL_DIAMOND:              return GFX_ERZ_DIAM;
     case EL_LAMP:                      return GFX_BIRNE_AUS;
@@ -3153,6 +3158,7 @@ int el2gfx_OLD(int element)
     case EL_SP_ZONK:                   return GFX_SP_ZONK;
       /* ^^^^^^^^^^ non-standard position in supaplex graphic set! */
     case EL_INVISIBLE_STEELWALL:       return GFX_INVISIBLE_STEEL;
+    case EL_INVISIBLE_STEELWALL_ACTIVE:        return GFX_INVISIBLE_STEEL_ON;
     case EL_BLACK_ORB:                 return GFX_BLACK_ORB;
     case EL_EM_GATE1:                  return GFX_EM_GATE_1;
     case EL_EM_GATE2:                  return GFX_EM_GATE_2;
@@ -3242,6 +3248,7 @@ int el2gfx_OLD(int element)
     case EL_MOLE_DOWN:                 return GFX_MOLE_DOWN;
     case EL_STEELWALL_SLANTED:         return GFX_STEEL_SLANTED;
     case EL_INVISIBLE_SAND:            return GFX_SAND_INVISIBLE;
+    case EL_INVISIBLE_SAND_ACTIVE:     return GFX_SAND_INVISIBLE_ON;
     case EL_DX_UNKNOWN_15:             return GFX_DX_UNKNOWN_15;
     case EL_DX_UNKNOWN_42:             return GFX_DX_UNKNOWN_42;
     case EL_TIMEGATE_OPEN:             return GFX_TIMEGATE_OPEN;