rnd-20030111-1-src
authorHolger Schemel <info@artsoft.org>
Sat, 11 Jan 2003 13:56:46 +0000 (14:56 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:39:37 +0000 (10:39 +0200)
src/conf_e2g.c
src/conftime.h
src/editor.c
src/game.c
src/init.c
src/main.c
src/main.h
src/tools.c
src/tools.h

index 795d21ef80295ccc59c885344e117f78779da82e..49948d3472ea54504563cceca890219db46f3656 100644 (file)
@@ -561,7 +561,7 @@ element_to_graphic[] =
     IMG_NUT_MOVING_RIGHT
   },
   {
-    EL_NUT_CRACKING,                           -1, GFX_ACTION_CRACKING,
+    EL_NUT_CRACKING,                           -1, -1,
     IMG_NUT_CRACKING
   },
   {
@@ -749,7 +749,7 @@ element_to_graphic[] =
     IMG_AMOEBA_CREATING
   },
   {
-    EL_AMOEBA_SHRINKING,                       -1, GFX_ACTION_SHRINKING,
+    EL_AMOEBA_SHRINKING,                       -1, -1,
     IMG_AMOEBA_SHRINKING
   },
   {
@@ -885,7 +885,7 @@ element_to_graphic[] =
     IMG_EXIT_CLOSED
   },
   {
-    EL_EXIT_OPENING,                           -1, GFX_ACTION_OPENING,
+    EL_EXIT_OPENING,                           -1, -1,
     IMG_EXIT_OPENING
   },
   {
@@ -1213,7 +1213,7 @@ element_to_graphic[] =
     IMG_SWITCHGATE_CLOSED
   },
   {
-    EL_SWITCHGATE_OPENING,                     -1, GFX_ACTION_OPENING,
+    EL_SWITCHGATE_OPENING,                     -1, -1,
     IMG_SWITCHGATE_OPENING
   },
   {
@@ -1221,7 +1221,7 @@ element_to_graphic[] =
     IMG_SWITCHGATE_OPEN
   },
   {
-    EL_SWITCHGATE_CLOSING,                     -1, GFX_ACTION_CLOSING,
+    EL_SWITCHGATE_CLOSING,                     -1, -1,
     IMG_SWITCHGATE_CLOSING
   },
   {
@@ -1229,7 +1229,7 @@ element_to_graphic[] =
     IMG_TIMEGATE_CLOSED
   },
   {
-    EL_TIMEGATE_OPENING,                       -1, GFX_ACTION_OPENING,
+    EL_TIMEGATE_OPENING,                       -1, -1,
     IMG_TIMEGATE_OPENING
   },
   {
@@ -1237,7 +1237,7 @@ element_to_graphic[] =
     IMG_TIMEGATE_OPEN
   },
   {
-    EL_TIMEGATE_CLOSING,                       -1, GFX_ACTION_CLOSING,
+    EL_TIMEGATE_CLOSING,                       -1, -1,
     IMG_TIMEGATE_CLOSING
   },
   {
@@ -1245,7 +1245,7 @@ element_to_graphic[] =
     IMG_PEARL
   },
   {
-    EL_PEARL_BREAKING,                         -1, GFX_ACTION_BREAKING,
+    EL_PEARL_BREAKING,                         -1, -1,
     IMG_PEARL_BREAKING
   },
   {
index ec1581b4a870f597bd83dd2f1fd68ff1fa03e1fb..5d6ab7f2def21b44598e39e6c2b6253e3d1da0f5 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-01-10 20:34]"
+#define COMPILE_DATE_STRING "[2003-01-11 14:56]"
index 3682bbd09774435d13555bcb0c98ad30d75571d9..c1a03a7cfa192fe29b80f1e9c93b47c5ae9f598f 100644 (file)
@@ -2650,7 +2650,7 @@ static void PickDrawingElement(int button, int element)
 
 static void DrawDrawingWindow()
 {
-  SetMainBackgroundImage(IMG_NONE);
+  SetMainBackgroundImage(IMG_UNDEFINED);
   ClearWindow();
   UnmapLevelEditorWindowGadgets();
 
@@ -2956,7 +2956,7 @@ static void DrawPropertiesWindow()
   DrawGraphicAnimationExt(drawto,
                          SX + xstart * MINI_TILEX,
                          SY + ystart * MINI_TILEY + MINI_TILEY / 2,
-                         el2img(properties_element), NO_MASKING);
+                         el2img(properties_element), -1, NO_MASKING);
 
   FrameCounter = 0;    /* restart animation frame counter */
 
@@ -4347,7 +4347,7 @@ void HandleLevelEditorIdle()
   DrawGraphicAnimationExt(drawto,
                          SX + xpos * TILEX,
                          SY + ypos * TILEY + MINI_TILEY / 2,
-                         el2img(properties_element), NO_MASKING);
+                         el2img(properties_element), -1, NO_MASKING);
 
 #else
   DrawGraphicAnimationExt(drawto,
@@ -4355,7 +4355,7 @@ void HandleLevelEditorIdle()
                          SY + ypos * TILEY + MINI_TILEY / 2,
                          el_dir_act2img(properties_element,
                                         MV_NO_MOVING,
-                                        ...));
+                                        ...), -1, NO_MASKING);
 #endif
 
   MarkTileDirty(xpos, ypos);
index 3b52b06824f111c5e8e29c792a347a32773b200f..095f635e392c97e90af23bdadabd84c3546d3eef 100644 (file)
@@ -114,6 +114,11 @@ static void HandleGameButtons(struct GadgetInfo *);
 
 static struct GadgetInfo *game_gadget[NUM_GAME_BUTTONS];
 
+
+/* ------------------------------------------------------------------------- */
+/* sound definitions                                                         */
+/* ------------------------------------------------------------------------- */
+
 #define SND_ACTION_UNKNOWN             0
 #define SND_ACTION_WAITING             1
 #define SND_ACTION_MOVING              2
@@ -157,6 +162,32 @@ static boolean is_loop_sound[NUM_SOUND_FILES];
 #define IS_LOOP_SOUND(x)       (is_loop_sound[x])
 
 
+/* -------------------------------------------------------------------------
+   definition of elements that automatically change to other elements after
+   a specified time, eventually calling a function when changing
+   ------------------------------------------------------------------------- */
+
+struct ChangingElementInfo
+{
+  int base_element;
+  int next_element;
+  int change_delay;
+  void (*changer_function)(int x, int y);
+};
+
+static struct ChangingElementInfo changing_element_list[] =
+{
+  { EL_NUT_CRACKING,           EL_EMERALD,             6, NULL         },
+  { EL_PEARL_BREAKING,         EL_EMPTY,               8, NULL         },
+  { EL_UNDEFINED,              EL_UNDEFINED,          -1, NULL         }
+};
+
+static struct ChangingElementInfo changing_element[MAX_NUM_ELEMENTS];
+
+#define IS_AUTO_CHANGING(e)  (changing_element[e].base_element != EL_UNDEFINED)
+
+
+
 #ifdef DEBUG
 #if 0
 static unsigned int getStateCheckSum(int counter)
@@ -518,6 +549,7 @@ void InitGameSound()
   debug_print_timestamp(0, NULL);
 #endif
 
+  /* initialize sound effect for all elements to "no sound" */
   for (i=0; i<MAX_NUM_ELEMENTS; i++)
     for (j=0; j<NUM_SND_ACTIONS; j++)
       element_action_sound[i][j] = -1;
@@ -639,18 +671,41 @@ static void InitGameEngine()
     for (i=0; i<ep_em_slippery_wall_num; i++)
     {
       if (level.em_slippery_gems)      /* special EM style gems behaviour */
-       Elementeigenschaften2[ep_em_slippery_wall[i]] |=
+       Properties2[ep_em_slippery_wall[i]] |=
          EP_BIT_EM_SLIPPERY_WALL;
       else
-       Elementeigenschaften2[ep_em_slippery_wall[i]] &=
+       Properties2[ep_em_slippery_wall[i]] &=
          ~EP_BIT_EM_SLIPPERY_WALL;
     }
 
     /* "EL_WALL_GROWING_ACTIVE" wasn't slippery for EM gems in version 2.0.1 */
     if (level.em_slippery_gems && game.engine_version > VERSION_IDENT(2,0,1))
-      Elementeigenschaften2[EL_WALL_GROWING_ACTIVE] |= EP_BIT_EM_SLIPPERY_WALL;
+      Properties2[EL_WALL_GROWING_ACTIVE] |= EP_BIT_EM_SLIPPERY_WALL;
     else
-      Elementeigenschaften2[EL_WALL_GROWING_ACTIVE] &=~EP_BIT_EM_SLIPPERY_WALL;
+      Properties2[EL_WALL_GROWING_ACTIVE] &=~EP_BIT_EM_SLIPPERY_WALL;
+  }
+
+  /* initialize changing elements information */
+  for (i=0; i<MAX_NUM_ELEMENTS; i++)
+  {
+    changing_element[i].base_element = EL_UNDEFINED;
+    changing_element[i].next_element = EL_UNDEFINED;
+    changing_element[i].change_delay = -1;
+    changing_element[i].changer_function = NULL;
+  }
+
+  i = 0;
+  while (changing_element_list[i].base_element != EL_UNDEFINED)
+  {
+    struct ChangingElementInfo *ce = &changing_element_list[i];
+    int element = ce->base_element;
+
+    changing_element[element].base_element     = ce->base_element;
+    changing_element[element].next_element     = ce->next_element;
+    changing_element[element].change_delay     = ce->change_delay;
+    changing_element[element].changer_function = ce->changer_function;
+
+    i++;
   }
 }
 
@@ -3095,7 +3150,7 @@ void StartMoving(int x, int y)
        }
       }
       else if (element == EL_SP_ELECTRON)
-       DrawGraphicAnimation(SCREENX(x), SCREENY(y), IMG_SP_ELECTRON);
+       DrawLevelElementAnimation(x, y, element);
       else if (element == EL_DRAGON)
       {
        int i;
@@ -3353,11 +3408,11 @@ void StartMoving(int x, int y)
               element == EL_SP_SNIKSNAK || element == EL_MOLE)
        DrawLevelField(x, y);
       else if (element == EL_BD_BUTTERFLY || element == EL_BD_FIREFLY)
-       DrawGraphicAnimation(SCREENX(x), SCREENY(y), el2img(element));
+       DrawLevelElementAnimation(x, y, element);
       else if (element == EL_SATELLITE)
-       DrawGraphicAnimation(SCREENX(x), SCREENY(y), IMG_SATELLITE);
+       DrawLevelElementAnimation(x, y, element);
       else if (element == EL_SP_ELECTRON)
-       DrawGraphicAnimation(SCREENX(x), SCREENY(y), IMG_SP_ELECTRON);
+       DrawLevelElementAnimation(x, y, element);
 
       if (DONT_TOUCH(element))
        TestIfBadThingTouchesHero(x, y);
@@ -4132,7 +4187,7 @@ void SiebAktivieren(int x, int y, int type)
 {
   int graphic = (type == 1 ? IMG_MAGIC_WALL_FULL : IMG_BD_MAGIC_WALL_FULL);
 
-  DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
+  DrawLevelGraphicAnimation(x, y, graphic);
 }
 
 void AusgangstuerPruefen(int x, int y)
@@ -4343,7 +4398,7 @@ void EdelsteinFunkeln(int x, int y)
     return;
 
   if (Feld[x][y] == EL_BD_DIAMOND)
-    DrawGraphicAnimation(SCREENX(x), SCREENY(y), IMG_BD_DIAMOND);
+    DrawLevelElementAnimation(x, y, el2img(Feld[x][y]));
   else
   {
     if (!MovDelay[x][y])       /* next animation frame */
@@ -4359,7 +4414,7 @@ void EdelsteinFunkeln(int x, int y)
 #if 0
       DrawGraphic(SCREENX(x), SCREENY(y), el2img(Feld[x][y]), 0);
 #else
-      DrawGraphicAnimation(SCREENX(x), SCREENY(y), el2img(Feld[x][y]));
+      DrawLevelElementAnimation(x, y, Feld[x][y]);
 #endif
 
       if (MovDelay[x][y])
@@ -4712,15 +4767,43 @@ static void DrawBeltAnimation(int x, int y, int element)
 
   if (belt_dir != MV_NO_MOVING)
   {
-    int graphic = el2img(element);
-
-    DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
+    DrawLevelElementAnimation(x, y, element);
 
     if (!(FrameCounter % 2))
-      PlaySoundLevel(x, y, SND_CONVEYOR_BELT_ACTIVE);
+      PlaySoundLevelAction(x, y, SND_ACTION_ACTIVE);
   }
 }
 
+static void ChangeElement(int x, int y)
+{
+  int element = Feld[x][y];
+  int change_delay = changing_element[element].change_delay;
+
+  if (!MovDelay[x][y])                 /* next animation frame */
+  {
+    MovDelay[x][y] = change_delay + 1;
+    GfxFrame[x][y] = 0;
+  }
+
+  if (MovDelay[x][y])                  /* wait some time before next frame */
+  {
+    MovDelay[x][y]--;
+
+    if (MovDelay[x][y])
+    {
+      DrawLevelElementAnimation(x, y, element);
+
+      return;
+    }
+  }
+
+  Feld[x][y] = changing_element[element].next_element;
+  DrawLevelField(x, y);
+
+  if (changing_element[element].changer_function)
+    changing_element[element].changer_function(x, y);
+}
+
 static void PlayerActions(struct PlayerInfo *player, byte player_action)
 {
   static byte stored_player_action[MAX_PLAYERS];
@@ -5009,7 +5092,7 @@ void GameActions()
 
 #if 1
       if (new_graphic_info[graphic].anim_frames > 1)
-       DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
+       DrawLevelGraphicAnimation(x, y, graphic);
 #endif
 
       continue;
@@ -5023,7 +5106,7 @@ void GameActions()
       if (Feld[x][y] == EL_EMERALD &&
          new_graphic_info[graphic].anim_frames > 1 &&
          !IS_MOVING(x, y))
-       DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
+       DrawLevelGraphicAnimation(x, y, graphic);
 #endif
 
       if (IS_GEM(element) || element == EL_SP_INFOTRON)
@@ -5040,7 +5123,7 @@ void GameActions()
              element == EL_SHIELD_NORMAL ||
              element == EL_SHIELD_DEADLY) &&
             new_graphic_info[graphic].anim_frames > 1)
-      DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
+      DrawLevelGraphicAnimation(x, y, graphic);
 #endif
 
     else if (IS_MOVING(x, y))
@@ -5070,10 +5153,12 @@ void GameActions()
     else if (element == EL_ACID_SPLASH_LEFT ||
             element == EL_ACID_SPLASH_RIGHT)
       Blurb(x, y);
+#if 0
     else if (element == EL_NUT_CRACKING)
       NussKnacken(x, y);
     else if (element == EL_PEARL_BREAKING)
       BreakingPearl(x, y);
+#endif
     else if (element == EL_EXIT_CLOSED)
       AusgangstuerPruefen(x, y);
     else if (element == EL_SP_EXIT_CLOSED)
@@ -5093,8 +5178,10 @@ void GameActions()
       CheckBuggyBase(x, y);
     else if (element == EL_TRAP || element == EL_TRAP_ACTIVE)
       CheckTrap(x, y);
+#if 0
     else if (IS_BELT_ACTIVE(element))
       DrawBeltAnimation(x, y, element);
+#endif
     else if (element == EL_SWITCHGATE_OPENING)
       OpenSwitchgate(x, y);
     else if (element == EL_SWITCHGATE_CLOSING)
@@ -5104,11 +5191,17 @@ void GameActions()
     else if (element == EL_TIMEGATE_CLOSING)
       CloseTimegate(x, y);
 
+    else if (IS_AUTO_CHANGING(element))
+      ChangeElement(x, y);
+
 #if 1
     else if (new_graphic_info[graphic].anim_frames > 1)
-      DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
+      DrawLevelGraphicAnimation(x, y, graphic);
 #endif
 
+    if (IS_BELT_ACTIVE(element))
+      PlaySoundLevelAction(x, y, SND_ACTION_ACTIVE);
+
     if (game.magic_wall_active)
     {
       boolean sieb = FALSE;
index ce1e9298915dd5e75a493517477e2cd68c48504b..6a2777fd62e6316fce5a45d603db9583baebc97c 100644 (file)
@@ -254,6 +254,7 @@ static void InitSound()
 
 static void InitTileClipmasks()
 {
+#if 0
 #if defined(TARGET_X11)
   XGCValues clip_gc_values;
   unsigned long clip_gc_valuemask;
@@ -388,10 +389,12 @@ static void InitTileClipmasks()
 
 #endif /* TARGET_X11_NATIVE */
 #endif /* TARGET_X11 */
+#endif
 }
 
 void FreeTileClipmasks()
 {
+#if 0
 #if defined(TARGET_X11)
   int i;
 
@@ -420,6 +423,7 @@ void FreeTileClipmasks()
 #endif
 
 #endif /* TARGET_X11 */
+#endif
 }
 
 void InitGfx()
@@ -689,7 +693,7 @@ void InitElementInfo()
   int i, act, dir;
 
   /* set values to -1 to identify later as "uninitialized" values */
-  for (i=0; i<MAX_ELEMENTS; i++)
+  for (i=0; i<MAX_NUM_ELEMENTS; i++)
   {
     for (act=0; act<NUM_GFX_ACTIONS_MAPPED; act++)
     {
@@ -734,7 +738,7 @@ void InitElementInfo()
   }
 
   /* now set all '-1' values to element specific default values */
-  for (i=0; i<MAX_ELEMENTS; i++)
+  for (i=0; i<MAX_NUM_ELEMENTS; i++)
   {
     int default_action_graphic = element_info[i].graphic[GFX_ACTION_DEFAULT];
     int default_action_direction_graphic[NUM_MV_DIRECTIONS];
@@ -2186,21 +2190,21 @@ void InitElementProperties()
   static int num_properties1 = SIZEOF_ARRAY(ep1_num, int *);
   static int num_properties2 = SIZEOF_ARRAY(ep2_num, int *);
 
-  for (i=0; i<MAX_ELEMENTS; i++)
+  for (i=0; i<MAX_NUM_ELEMENTS; i++)
   {
-    Elementeigenschaften1[i] = 0;
-    Elementeigenschaften2[i] = 0;
+    Properties1[i] = 0;
+    Properties2[i] = 0;
   }
 
   for (i=0; i<num_properties1; i++)
     for (j=0; j<*(ep1_num[i]); j++)
-      Elementeigenschaften1[(ep1_array[i])[j]] |= ep1_bit[i];
+      Properties1[(ep1_array[i])[j]] |= ep1_bit[i];
   for (i=0; i<num_properties2; i++)
     for (j=0; j<*(ep2_num[i]); j++)
-      Elementeigenschaften2[(ep2_array[i])[j]] |= ep2_bit[i];
+      Properties2[(ep2_array[i])[j]] |= ep2_bit[i];
 
   for (i=EL_CHAR_START; i<=EL_CHAR_END; i++)
-    Elementeigenschaften1[i] |= (EP_BIT_CHAR | EP_BIT_INACTIVE);
+    Properties1[i] |= (EP_BIT_CHAR | EP_BIT_INACTIVE);
 }
 
 void Execute_Command(char *command)
index 1a71792c9cb288b7a2ce55b266c1858b6e07d149..fc8cd0400821784b028391c898e9204819ae6be7 100644 (file)
 #include "game.h"
 #include "events.h"
 
-GC             tile_clip_gc;
 #if 0
+GC             tile_clip_gc;
 Bitmap        *pix[NUM_BITMAPS];
 #endif
 Bitmap        *bitmap_db_field, *bitmap_db_door;
+#if 0
 Pixmap         tile_clipmask[NUM_TILES];
+#endif
 DrawBuffer     *fieldbuffer;
 DrawBuffer     *drawto_field;
 
@@ -50,8 +52,9 @@ short         AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short          AmoebaCnt[MAX_NUM_AMOEBA], AmoebaCnt2[MAX_NUM_AMOEBA];
 short          ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short          ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-unsigned long  Elementeigenschaften1[MAX_ELEMENTS];
-unsigned long  Elementeigenschaften2[MAX_ELEMENTS];
+
+unsigned long  Properties1[MAX_NUM_ELEMENTS];
+unsigned long  Properties2[MAX_NUM_ELEMENTS];
 
 int            GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short          GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
@@ -172,8 +175,10 @@ int graphics_action_mapping[] =
 struct FileInfo *image_files;
 struct FileInfo *sound_files;
 
-struct ElementInfo element_info[MAX_ELEMENTS] =
+struct ElementInfo element_info[MAX_NUM_ELEMENTS] =
 {
+  /* "real" level file elements */
+
   { "empty_space",             "empty space"                   },      /* 0 */
   { "sand",                    "sand"                          },
   { "wall",                    "normal wall"                   },
@@ -543,7 +548,7 @@ struct ElementInfo element_info[MAX_ELEMENTS] =
   { "dx_bomb",                 "stable bomb (DX style)"        },
   { NULL,                      "-"                             },
   { NULL,                      "-"                             },
-  { "custom",                  "custom element 1"              },
+  { "custom",                  "custom element 1"              },    /* 360 */
   { "custom",                  "custom element 2"              },
   { "custom",                  "custom element 3"              },
   { "custom",                  "custom element 4"              },
@@ -553,7 +558,7 @@ struct ElementInfo element_info[MAX_ELEMENTS] =
   { "custom",                  "custom element 8"              },
   { "custom",                  "custom element 9"              },
   { "custom",                  "custom element 10"             },
-  { "custom",                  "custom element 11"             },
+  { "custom",                  "custom element 11"             },    /* 370 */
   { "custom",                  "custom element 12"             },
   { "custom",                  "custom element 13"             },
   { "custom",                  "custom element 14"             },
@@ -563,7 +568,7 @@ struct ElementInfo element_info[MAX_ELEMENTS] =
   { "custom",                  "custom element 18"             },
   { "custom",                  "custom element 19"             },
   { "custom",                  "custom element 20"             },
-  { "custom",                  "custom element 21"             },
+  { "custom",                  "custom element 21"             },    /* 380 */
   { "custom",                  "custom element 22"             },
   { "custom",                  "custom element 23"             },
   { "custom",                  "custom element 24"             },
@@ -573,7 +578,7 @@ struct ElementInfo element_info[MAX_ELEMENTS] =
   { "custom",                  "custom element 28"             },
   { "custom",                  "custom element 29"             },
   { "custom",                  "custom element 30"             },
-  { "custom",                  "custom element 31"             },
+  { "custom",                  "custom element 31"             },    /* 390 */
   { "custom",                  "custom element 32"             },
   { "custom",                  "custom element 33"             },
   { "custom",                  "custom element 34"             },
@@ -583,7 +588,7 @@ struct ElementInfo element_info[MAX_ELEMENTS] =
   { "custom",                  "custom element 38"             },
   { "custom",                  "custom element 39"             },
   { "custom",                  "custom element 40"             },
-  { "custom",                  "custom element 41"             },
+  { "custom",                  "custom element 41"             },    /* 400 */
   { "custom",                  "custom element 42"             },
   { "custom",                  "custom element 43"             },
   { "custom",                  "custom element 44"             },
@@ -593,7 +598,7 @@ struct ElementInfo element_info[MAX_ELEMENTS] =
   { "custom",                  "custom element 48"             },
   { "custom",                  "custom element 49"             },
   { "custom",                  "custom element 50"             },
-  { "custom",                  "custom element 51"             },
+  { "custom",                  "custom element 51"             },    /* 410 */
   { "custom",                  "custom element 52"             },
   { "custom",                  "custom element 53"             },
   { "custom",                  "custom element 54"             },
@@ -603,7 +608,7 @@ struct ElementInfo element_info[MAX_ELEMENTS] =
   { "custom",                  "custom element 58"             },
   { "custom",                  "custom element 59"             },
   { "custom",                  "custom element 60"             },
-  { "custom",                  "custom element 61"             },
+  { "custom",                  "custom element 61"             },    /* 420 */
   { "custom",                  "custom element 62"             },
   { "custom",                  "custom element 63"             },
   { "custom",                  "custom element 64"             },
@@ -613,7 +618,7 @@ struct ElementInfo element_info[MAX_ELEMENTS] =
   { "custom",                  "custom element 68"             },
   { "custom",                  "custom element 69"             },
   { "custom",                  "custom element 70"             },
-  { "custom",                  "custom element 71"             },
+  { "custom",                  "custom element 71"             },    /* 430 */
   { "custom",                  "custom element 72"             },
   { "custom",                  "custom element 73"             },
   { "custom",                  "custom element 74"             },
@@ -623,7 +628,7 @@ struct ElementInfo element_info[MAX_ELEMENTS] =
   { "custom",                  "custom element 78"             },
   { "custom",                  "custom element 79"             },
   { "custom",                  "custom element 80"             },
-  { "custom",                  "custom element 81"             },
+  { "custom",                  "custom element 81"             },    /* 440 */
   { "custom",                  "custom element 82"             },
   { "custom",                  "custom element 83"             },
   { "custom",                  "custom element 84"             },
@@ -633,7 +638,7 @@ struct ElementInfo element_info[MAX_ELEMENTS] =
   { "custom",                  "custom element 88"             },
   { "custom",                  "custom element 89"             },
   { "custom",                  "custom element 90"             },
-  { "custom",                  "custom element 91"             },
+  { "custom",                  "custom element 91"             },    /* 450 */
   { "custom",                  "custom element 92"             },
   { "custom",                  "custom element 93"             },
   { "custom",                  "custom element 94"             },
@@ -643,7 +648,7 @@ struct ElementInfo element_info[MAX_ELEMENTS] =
   { "custom",                  "custom element 98"             },
   { "custom",                  "custom element 99"             },
   { "custom",                  "custom element 100"            },
-  { "custom",                  "custom element 101"            },
+  { "custom",                  "custom element 101"            },    /* 460 */
   { "custom",                  "custom element 102"            },
   { "custom",                  "custom element 103"            },
   { "custom",                  "custom element 104"            },
@@ -653,7 +658,7 @@ struct ElementInfo element_info[MAX_ELEMENTS] =
   { "custom",                  "custom element 108"            },
   { "custom",                  "custom element 109"            },
   { "custom",                  "custom element 110"            },
-  { "custom",                  "custom element 111"            },
+  { "custom",                  "custom element 111"            },    /* 470 */
   { "custom",                  "custom element 112"            },
   { "custom",                  "custom element 113"            },
   { "custom",                  "custom element 114"            },
@@ -663,7 +668,7 @@ struct ElementInfo element_info[MAX_ELEMENTS] =
   { "custom",                  "custom element 118"            },
   { "custom",                  "custom element 119"            },
   { "custom",                  "custom element 120"            },
-  { "custom",                  "custom element 121"            },
+  { "custom",                  "custom element 121"            },    /* 480 */
   { "custom",                  "custom element 122"            },
   { "custom",                  "custom element 123"            },
   { "custom",                  "custom element 124"            },
@@ -672,14 +677,59 @@ struct ElementInfo element_info[MAX_ELEMENTS] =
   { "custom",                  "custom element 127"            },
   { "custom",                  "custom element 128"            },
 
-  { NULL,                      "-"                             }
+  /* "real" (and therefore drawable) runtime elements */
+
+  { "magic_wall",              "-"                             },
+  { "magic_wall",              "-"                             },
+  { "magic_wall",              "-"                             },    /* 490 */
+  { "magic_wall",              "-"                             },
+  { "wall",                    "-"                             },
+  { "wall",                    "-"                             },
+  { "exit",                    "-"                             },
+  { "sp_terminal",             "-"                             },
+  { "sp_buggy_base",           "-"                             },
+  { "key",                     "-"                             },
+  { "key",                     "-"                             },
+  { "key",                     "-"                             },
+  { "key",                     "-"                             },    /* 500 */
+  { "dynabomb",                        "-"                             },
+  { "dynabomb",                        "-"                             },
+  { "dynabomb",                        "-"                             },
+  { "dynabomb",                        "-"                             },
+  { "switchgate",              "-"                             },
+  { "switchgate",              "-"                             },
+  { "timegate",                        "-"                             },
+  { "timegate",                        "-"                             },
+  { "pearl",                   "-"                             },
+  { "trap",                    "-"                             },    /* 510 */
+  { "murphy_clone",            "-"                             },
+  { "quicksand",               "-"                             },
+  { "magic_wall",              "-"                             },
+  { "magic_wall",              "-"                             },
+  { "amoeba",                  "-"                             },
+  { "sp_exit",                 "-"                             },
+  { "wall",                    "-"                             },
+  { "sand",                    "-"                             },
+  { "wall",                    "-"                             },
+  { "conveyor_belt",           "-"                             },    /* 520 */
+  { "conveyor_belt",           "-"                             },
+  { "conveyor_belt",           "-"                             },
+  { "conveyor_belt",           "-"                             },
+  { "conveyor_belt",           "-"                             },
+  { "conveyor_belt",           "-"                             },
+  { "conveyor_belt",           "-"                             },
+  { "conveyor_belt",           "-"                             },
+  { "conveyor_belt",           "-"                             },
+  { "conveyor_belt",           "-"                             },
+  { "conveyor_belt",           "-"                             },    /* 530 */
+  { "conveyor_belt",           "-"                             },
 
-  /*
-  "-------------------------------",
-  */
+  { NULL,                      "-"                             }
 };
 
+#if 0
 struct GraphicInfo graphic_info[MAX_GRAPHICS];
+#endif
 struct NewGraphicInfo new_graphic_info[NUM_IMAGE_FILES];
 
 
index 6998dd839049bd987afe00f128e1ee59d6462a2c..204f7c415ffb040f13fa2ab0ce41d8e0515bb3ab 100644 (file)
@@ -30,7 +30,7 @@
 #include "conf_gfx.h"
 #include "conf_snd.h"
 
-#define IMG_NONE               (-1)
+#define IMG_UNDEFINED          (-1)
 #define IMG_EMPTY              IMG_EMPTY_SPACE
 #define IMG_SP_EMPTY           IMG_SP_EMPTY_SPACE
 #define IMG_CHAR_START         IMG_CHAR_SPACE
@@ -58,7 +58,7 @@
 #define IN_SCR_FIELD(x,y) ((x)>=BX1 && (x)<=BX2 && (y)>=BY1 &&(y)<=BY2)
 #define IN_LEV_FIELD(x,y) ((x)>=0 && (x)<lev_fieldx && (y)>=0 &&(y)<lev_fieldy)
 
-/* values for 'Elementeigenschaften1' */
+/* values for 'Properties1' */
 #define EP_BIT_AMOEBALIVE      (1 << 0)
 #define EP_BIT_AMOEBOID                (1 << 1)
 #define EP_BIT_SCHLUESSEL      (1 << 2)
 #define EP_BIT_OVER_PLAYER     (1 << 30)
 #define EP_BIT_ACTIVE_BOMB     (1 << 31)
 
-/* values for 'Elementeigenschaften2' */
+/* values for 'Properties2' */
 #define EP_BIT_BELT            (1 << 0)
 #define EP_BIT_BELT_ACTIVE     (1 << 1)
 #define EP_BIT_BELT_SWITCH     (1 << 2)
 #define EP_BIT_TUBE            (1 << 3)
 #define EP_BIT_EM_SLIPPERY_WALL        (1 << 4)
 
-#define IS_AMOEBALIVE(e)       (Elementeigenschaften1[e] & EP_BIT_AMOEBALIVE)
-#define IS_AMOEBOID(e)         (Elementeigenschaften1[e] & EP_BIT_AMOEBOID)
-#define IS_SCHLUESSEL(e)       (Elementeigenschaften1[e] & EP_BIT_SCHLUESSEL)
-#define IS_PFORTE(e)           (Elementeigenschaften1[e] & EP_BIT_PFORTE)
-#define IS_SOLID(e)            (Elementeigenschaften1[e] & EP_BIT_SOLID)
-#define IS_MASSIVE(e)          (Elementeigenschaften1[e] & EP_BIT_MASSIVE)
-#define IS_SLIPPERY(e)         (Elementeigenschaften1[e] & EP_BIT_SLIPPERY)
-#define IS_ENEMY(e)            (Elementeigenschaften1[e] & EP_BIT_ENEMY)
-#define IS_MAUER(e)            (Elementeigenschaften1[e] & EP_BIT_MAUER)
-#define CAN_FALL(e)            (Elementeigenschaften1[e] & EP_BIT_CAN_FALL)
-#define CAN_SMASH(e)           (Elementeigenschaften1[e] & EP_BIT_CAN_SMASH)
-#define CAN_CHANGE(e)          (Elementeigenschaften1[e] & EP_BIT_CAN_CHANGE)
-#define CAN_MOVE(e)            (Elementeigenschaften1[e] & EP_BIT_CAN_MOVE)
-#define COULD_MOVE(e)          (Elementeigenschaften1[e] & EP_BIT_COULD_MOVE)
-#define DONT_TOUCH(e)          (Elementeigenschaften1[e] & EP_BIT_DONT_TOUCH)
-#define DONT_GO_TO(e)          (Elementeigenschaften1[e] & EP_BIT_DONT_GO_TO)
-#define IS_MAMPF2(e)           (Elementeigenschaften1[e] & EP_BIT_MAMPF2)
-#define IS_CHAR(e)             (Elementeigenschaften1[e] & EP_BIT_CHAR)
-#define IS_BD_ELEMENT(e)       (Elementeigenschaften1[e] & EP_BIT_BD_ELEMENT)
-#define IS_SB_ELEMENT(e)       (Elementeigenschaften1[e] & EP_BIT_SB_ELEMENT)
-#define IS_GEM(e)              (Elementeigenschaften1[e] & EP_BIT_GEM)
-#define IS_INACTIVE(e)         (Elementeigenschaften1[e] & EP_BIT_INACTIVE)
-#define IS_EXPLOSIVE(e)                (Elementeigenschaften1[e] & EP_BIT_EXPLOSIVE)
-#define IS_MAMPF3(e)           (Elementeigenschaften1[e] & EP_BIT_MAMPF3)
-#define IS_PUSHABLE(e)         (Elementeigenschaften1[e] & EP_BIT_PUSHABLE)
-#define ELEM_IS_PLAYER(e)      (Elementeigenschaften1[e] & EP_BIT_PLAYER)
-#define HAS_CONTENT(e)         (Elementeigenschaften1[e] & EP_BIT_HAS_CONTENT)
-#define IS_EATABLE(e)          (Elementeigenschaften1[e] & EP_BIT_EATABLE)
-#define IS_SP_ELEMENT(e)       (Elementeigenschaften1[e] & EP_BIT_SP_ELEMENT)
-#define IS_QUICK_GATE(e)       (Elementeigenschaften1[e] & EP_BIT_QUICK_GATE)
-#define IS_OVER_PLAYER(e)      (Elementeigenschaften1[e] & EP_BIT_OVER_PLAYER)
-#define IS_ACTIVE_BOMB(e)      (Elementeigenschaften1[e] & EP_BIT_ACTIVE_BOMB)
-
-#define IS_BELT(e)             (Elementeigenschaften2[e] & EP_BIT_BELT)
-#define IS_BELT_ACTIVE(e)      (Elementeigenschaften2[e] & EP_BIT_BELT_ACTIVE)
-#define IS_BELT_SWITCH(e)      (Elementeigenschaften2[e] & EP_BIT_BELT_SWITCH)
-#define IS_TUBE(e)             (Elementeigenschaften2[e] & EP_BIT_TUBE)
-#define IS_EM_SLIPPERY_WALL(e) (Elementeigenschaften2[e] & EP_BIT_EM_SLIPPERY_WALL)
+#define IS_AMOEBALIVE(e)       (Properties1[e] & EP_BIT_AMOEBALIVE)
+#define IS_AMOEBOID(e)         (Properties1[e] & EP_BIT_AMOEBOID)
+#define IS_SCHLUESSEL(e)       (Properties1[e] & EP_BIT_SCHLUESSEL)
+#define IS_PFORTE(e)           (Properties1[e] & EP_BIT_PFORTE)
+#define IS_SOLID(e)            (Properties1[e] & EP_BIT_SOLID)
+#define IS_MASSIVE(e)          (Properties1[e] & EP_BIT_MASSIVE)
+#define IS_SLIPPERY(e)         (Properties1[e] & EP_BIT_SLIPPERY)
+#define IS_ENEMY(e)            (Properties1[e] & EP_BIT_ENEMY)
+#define IS_MAUER(e)            (Properties1[e] & EP_BIT_MAUER)
+#define CAN_FALL(e)            (Properties1[e] & EP_BIT_CAN_FALL)
+#define CAN_SMASH(e)           (Properties1[e] & EP_BIT_CAN_SMASH)
+#define CAN_CHANGE(e)          (Properties1[e] & EP_BIT_CAN_CHANGE)
+#define CAN_MOVE(e)            (Properties1[e] & EP_BIT_CAN_MOVE)
+#define COULD_MOVE(e)          (Properties1[e] & EP_BIT_COULD_MOVE)
+#define DONT_TOUCH(e)          (Properties1[e] & EP_BIT_DONT_TOUCH)
+#define DONT_GO_TO(e)          (Properties1[e] & EP_BIT_DONT_GO_TO)
+#define IS_MAMPF2(e)           (Properties1[e] & EP_BIT_MAMPF2)
+#define IS_CHAR(e)             (Properties1[e] & EP_BIT_CHAR)
+#define IS_BD_ELEMENT(e)       (Properties1[e] & EP_BIT_BD_ELEMENT)
+#define IS_SB_ELEMENT(e)       (Properties1[e] & EP_BIT_SB_ELEMENT)
+#define IS_GEM(e)              (Properties1[e] & EP_BIT_GEM)
+#define IS_INACTIVE(e)         (Properties1[e] & EP_BIT_INACTIVE)
+#define IS_EXPLOSIVE(e)                (Properties1[e] & EP_BIT_EXPLOSIVE)
+#define IS_MAMPF3(e)           (Properties1[e] & EP_BIT_MAMPF3)
+#define IS_PUSHABLE(e)         (Properties1[e] & EP_BIT_PUSHABLE)
+#define ELEM_IS_PLAYER(e)      (Properties1[e] & EP_BIT_PLAYER)
+#define HAS_CONTENT(e)         (Properties1[e] & EP_BIT_HAS_CONTENT)
+#define IS_EATABLE(e)          (Properties1[e] & EP_BIT_EATABLE)
+#define IS_SP_ELEMENT(e)       (Properties1[e] & EP_BIT_SP_ELEMENT)
+#define IS_QUICK_GATE(e)       (Properties1[e] & EP_BIT_QUICK_GATE)
+#define IS_OVER_PLAYER(e)      (Properties1[e] & EP_BIT_OVER_PLAYER)
+#define IS_ACTIVE_BOMB(e)      (Properties1[e] & EP_BIT_ACTIVE_BOMB)
+
+#define IS_BELT(e)             (Properties2[e] & EP_BIT_BELT)
+#define IS_BELT_ACTIVE(e)      (Properties2[e] & EP_BIT_BELT_ACTIVE)
+#define IS_BELT_SWITCH(e)      (Properties2[e] & EP_BIT_BELT_SWITCH)
+#define IS_TUBE(e)             (Properties2[e] & EP_BIT_TUBE)
+#define IS_EM_SLIPPERY_WALL(e) (Properties2[e] & EP_BIT_EM_SLIPPERY_WALL)
 
 #define IS_PLAYER(x,y)         (ELEM_IS_PLAYER(StorePlayer[x][y]))
 
 #define MAX_LEVEL_AUTHOR_LEN   32
 #define MAX_TAPELEN            (1000 * 50)     /* max. time * framerate */
 #define MAX_SCORE_ENTRIES      100
+#if 0
 #define MAX_ELEMENTS           700             /* 500 static + 200 runtime */
 #define MAX_GRAPHICS           1536            /* see below: NUM_TILES */
+#endif
 #define MAX_NUM_AMOEBA         100
 
 /* values for elements with content */
 **       0 <= element < xxx: real elements, stored in level file
 **      xxx <= element < yyy: flag elements, only used at runtime
 */
-/* "real" level elements */
+/* "real" level file elements */
+#define EL_UNDEFINED                   -1
+
 #define EL_EMPTY_SPACE                 0
 #define EL_EMPTY                       EL_EMPTY_SPACE
 #define EL_SAND                                1
 #define GFX_START_ROCKSMORE            1280
 #define GFX_END_ROCKSMORE              1535
 
+#if 0
 #define NUM_TILES                      1536    /* see above: MAX_GRAPHICS */
+#endif
 
 /* graphics from "RocksScreen" */
 /* Zeile 0 (0) */
@@ -1662,8 +1668,8 @@ struct NewGraphicInfo
 #endif
 };
 
-extern GC              tile_clip_gc;
 #if 0
+extern GC              tile_clip_gc;
 extern Bitmap         *pix[];
 #endif
 extern Bitmap         *bitmap_db_field, *bitmap_db_door;
@@ -1694,8 +1700,9 @@ extern short              AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 extern short           AmoebaCnt[MAX_NUM_AMOEBA], AmoebaCnt2[MAX_NUM_AMOEBA];
 extern short           ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 extern short           ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern unsigned long   Elementeigenschaften1[MAX_ELEMENTS];
-extern unsigned long   Elementeigenschaften2[MAX_ELEMENTS];
+
+extern unsigned long   Properties1[MAX_NUM_ELEMENTS];
+extern unsigned long   Properties2[MAX_NUM_ELEMENTS];
 
 extern int             GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 extern short           GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
@@ -1728,7 +1735,9 @@ extern struct TapeInfo            tape;
 extern struct GameInfo         game;
 extern struct GlobalInfo       global;
 extern struct ElementInfo      element_info[];
+#if 0
 extern struct GraphicInfo      graphic_info[];
+#endif
 extern struct NewGraphicInfo   new_graphic_info[];
 extern struct ConfigInfo       image_config[], sound_config[];
 extern struct ConfigInfo       image_config_suffix[], sound_config_suffix[];
index 2eac4a7235b13d385d47526e6d0b120373c00bca..ecbe07d0f99c10317cb665e3fc6497c74c281526 100644 (file)
@@ -364,7 +364,7 @@ void FadeToFront()
 
 void SetMainBackgroundImage(int graphic)
 {
-  SetMainBackgroundBitmap(graphic == IMG_NONE ? NULL :
+  SetMainBackgroundBitmap(graphic == IMG_UNDEFINED ? NULL :
                          new_graphic_info[graphic].bitmap ?
                          new_graphic_info[graphic].bitmap :
                          new_graphic_info[IMG_BACKGROUND_DEFAULT].bitmap);
@@ -372,7 +372,7 @@ void SetMainBackgroundImage(int graphic)
 
 void SetDoorBackgroundImage(int graphic)
 {
-  SetDoorBackgroundBitmap(graphic == IMG_NONE ? NULL :
+  SetDoorBackgroundBitmap(graphic == IMG_UNDEFINED ? NULL :
                          new_graphic_info[graphic].bitmap ?
                          new_graphic_info[graphic].bitmap :
                          new_graphic_info[IMG_BACKGROUND_DEFAULT].bitmap);
@@ -788,10 +788,10 @@ void DrawPlayer(struct PlayerInfo *player)
   MarkTileDirty(sx,sy);
 }
 
-void DrawGraphicAnimationExt(DrawBuffer *dst_bitmap, int x, int y,
-                            int graphic, int mask_mode)
+inline void DrawGraphicAnimationExt(DrawBuffer *dst_bitmap, int x, int y,
+                                   int graphic, int sync_frame, int mask_mode)
 {
-  int frame = getGraphicAnimationFrame(graphic, -1);
+  int frame = getGraphicAnimationFrame(graphic, sync_frame);
 
   if (mask_mode == USE_MASKING)
     DrawGraphicThruMaskExt(dst_bitmap, x, y, graphic, frame);
@@ -799,19 +799,29 @@ void DrawGraphicAnimationExt(DrawBuffer *dst_bitmap, int x, int y,
     DrawGraphicExt(dst_bitmap, x, y, graphic, frame);
 }
 
-void DrawGraphicAnimation(int x, int y, int graphic)
+inline void DrawGraphicAnimation(int x, int y, int graphic)
 {
-  int ux = LEVELX(x), uy = LEVELY(y);
+  int lx = LEVELX(x), ly = LEVELY(y);
 
   if (!IN_SCR_FIELD(x, y) ||
-      (GfxFrame[ux][uy] % new_graphic_info[graphic].anim_delay) != 0)
+      (GfxFrame[lx][ly] % new_graphic_info[graphic].anim_delay) != 0)
     return;
 
   DrawGraphicAnimationExt(drawto_field, FX + x * TILEX, FY + y * TILEY,
-                         graphic, NO_MASKING);
+                         graphic, GfxFrame[lx][ly], NO_MASKING);
   MarkTileDirty(x, y);
 }
 
+void DrawLevelGraphicAnimation(int x, int y, int graphic)
+{
+  DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
+}
+
+void DrawLevelElementAnimation(int x, int y, int element)
+{
+  DrawGraphicAnimation(SCREENX(x), SCREENY(y), el2img(element));
+}
+
 #if 0
 void getOldGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y)
 {
@@ -2967,9 +2977,9 @@ int el2gfx(int element)
 #if DEBUG
   int graphic_OLD = el2gfx_OLD(element);
 
-  if (element >= MAX_ELEMENTS)
+  if (element >= MAX_NUM_ELEMENTS)
   {
-    Error(ERR_WARN, "el2gfx: element == %d >= MAX_ELEMENTS", element);
+    Error(ERR_WARN, "el2gfx: element == %d >= MAX_NUM_ELEMENTS", element);
   }
 
   if (graphic_NEW != graphic_OLD)
index 7b328f2147bc5ca2d304759b3e23e725b56cabd2..629593dffc5541cfc57006bc0641c25a4e785336 100644 (file)
@@ -74,8 +74,10 @@ void DrawAllPlayers(void);
 void DrawPlayerField(int, int);
 void DrawPlayer(struct PlayerInfo *);
 int getGraphicAnimationFrame(int, int);
+void DrawGraphicAnimationExt(DrawBuffer *, int, int, int, int, int);
 void DrawGraphicAnimation(int, int, int);
-void DrawGraphicAnimationExt(DrawBuffer *, int, int, int, int);
+void DrawLevelGraphicAnimation(int, int, int);
+void DrawLevelElementAnimation(int, int, int);
 void getGraphicSource(int, int, Bitmap **, int *, int *);
 void DrawGraphic(int, int, int, int);
 #if 0