rnd-20030217-1-src
authorHolger Schemel <info@artsoft.org>
Sun, 16 Feb 2003 23:44:17 +0000 (00:44 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:40:24 +0000 (10:40 +0200)
src/conftime.h
src/editor.c
src/game.c
src/init.c
src/libgame/toons.c
src/main.h
src/tools.c

index 49fba9917b94e09df34991b4d1ae476ad38b0772..6e6a198cb0dec568370dd84a1e82887dafe850b7 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-02-15 00:07]"
+#define COMPILE_DATE_STRING "[2003-02-17 00:43]"
index 633a5586256d065d67ddffdf4e666e20eda4c762..0b62ca192c91ba7f153f274a5d46f5dea9b45a99 100644 (file)
@@ -2491,7 +2491,7 @@ static void CopyCustomElementPropertiesToEditor()
     int properties = Properties1[element];
 
     custom_element_properties[i].indestructible =
-      ((properties & EP_BIT_MASSIVE) != 0 ? TRUE : FALSE);
+      ((properties & EP_BIT_INDESTRUCTIBLE) != 0 ? TRUE : FALSE);
 
     custom_element_properties[i].can_fall =
       ((properties & EP_BIT_CAN_FALL) != 0 ? TRUE : FALSE);
@@ -2518,9 +2518,9 @@ static void CopyCustomElementPropertiesToGame()
     Properties1[element] = EP_BITMASK_DEFAULT;
 
     if (custom_element_properties[i].indestructible)
-      Properties1[element] |= EP_BIT_MASSIVE;
+      Properties1[element] |= EP_BIT_INDESTRUCTIBLE;
     else
-      Properties1[element] &= ~EP_BIT_MASSIVE;
+      Properties1[element] &= ~EP_BIT_INDESTRUCTIBLE;
 
     if (custom_element_properties[i].can_fall)
       Properties1[element] |= EP_BIT_CAN_FALL;
index f86dffae3620dba97bb42b44651eb822562bb30c..324c8e81faf807f4eef82d9c23b6a0e259f971c1 100644 (file)
@@ -471,7 +471,7 @@ void DrawGameDoorValues()
     for (j=0; j<4; j++)
       if (stored_player[i].key[j])
        DrawMiniGraphicExt(drawto, DX_KEYS + j * MINI_TILEX, DY_KEYS,
-                          IMG_KEY1 + j);
+                          el2edimg(EL_KEY1 + j));
 
   DrawText(DX + XX_EMERALDS, DY + YY_EMERALDS,
           int2str(local_player->gems_still_needed, 3), FS_SMALL, FC_YELLOW);
@@ -1512,7 +1512,7 @@ void Explode(int ex, int ey, int phase, int mode)
        RemoveMovingField(x, y);
       }
 
-      if (IS_MASSIVE(element) || element == EL_FLAMES)
+      if (IS_INDESTRUCTIBLE(element) || element == EL_FLAMES)
        continue;
 
       if (IS_PLAYER(x, y) && SHIELD_ON(PLAYERINFO(x, y)))
@@ -1714,7 +1714,7 @@ void DynaExplode(int ex, int ey)
       int y = ey + j * xy[i % 4][1];
       int element;
 
-      if (!IN_LEV_FIELD(x, y) || IS_MASSIVE(Feld[x][y]))
+      if (!IN_LEV_FIELD(x, y) || IS_INDESTRUCTIBLE(Feld[x][y]))
        break;
 
       element = Feld[x][y];
@@ -5934,14 +5934,15 @@ int DigField(struct PlayerInfo *player,
     case EL_KEY4:
     {
       int key_nr = element - EL_KEY1;
+      int graphic = el2edimg(element);
 
       RemoveField(x, y);
       player->key[key_nr] = TRUE;
       RaiseScoreElement(element);
       DrawMiniGraphicExt(drawto, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS,
-                        IMG_KEY1 + key_nr);
+                        graphic);
       DrawMiniGraphicExt(window, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS,
-                        IMG_KEY1 + key_nr);
+                        graphic);
       PlaySoundLevel(x, y, SND_KEY_COLLECTING);
       break;
     }
@@ -5952,14 +5953,15 @@ int DigField(struct PlayerInfo *player,
     case EL_EM_KEY4:
     {
       int key_nr = element - EL_EM_KEY1;
+      int graphic = el2edimg(EL_KEY1 + key_nr);
 
       RemoveField(x, y);
       player->key[key_nr] = TRUE;
       RaiseScoreElement(element);
       DrawMiniGraphicExt(drawto, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS,
-                        IMG_KEY1 + key_nr);
+                        graphic);
       DrawMiniGraphicExt(window, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS,
-                        IMG_KEY1 + key_nr);
+                        graphic);
       PlaySoundLevel(x, y, SND_KEY_COLLECTING);
       break;
     }
index 862365fa1259bf46ec62d09a9f8971d969efd2fe..d7be34a66381b5146a798940f08ef9f1fe0b130e 100644 (file)
@@ -175,6 +175,12 @@ static void InitArtworkConfig()
     "global.num_toons",
     NULL
   };
+  static char *ignore_sound_tokens[] =
+  {
+    "name",
+    "sort_priority",
+    NULL
+  };
   int i;
 
   for (i=0; i<MAX_NUM_ELEMENTS + 1; i++)
@@ -189,10 +195,11 @@ static void InitArtworkConfig()
     special_suffix[i] = special_suffix_info[i].suffix;
 
   InitImageList(image_config, NUM_IMAGE_FILES, image_config_suffix,
-               element_prefix, action_suffix, direction_suffix,special_suffix,
-               ignore_image_tokens);
+               element_prefix, action_suffix, direction_suffix,
+               special_suffix, ignore_image_tokens);
   InitSoundList(sound_config, NUM_SOUND_FILES, sound_config_suffix,
-               sound_class_prefix, action_suffix, dummy, dummy, dummy);
+               sound_class_prefix, action_suffix, dummy,
+               dummy, ignore_sound_tokens);
 }
 
 void InitLevelArtworkInfo()
@@ -1337,7 +1344,6 @@ void InitElementProperties()
 
   static int ep_solid[] =
   {
-    EL_STEELWALL,
     EL_WALL,
     EL_WALL_GROWING,
     EL_WALL_GROWING_X,
@@ -1371,16 +1377,43 @@ void InitElementProperties()
     EL_BD_MAGIC_WALL_DEAD,
     EL_GAMEOFLIFE,
     EL_BIOMAZE,
-    EL_ACIDPOOL_TOPLEFT,
-    EL_ACIDPOOL_TOPRIGHT,
-    EL_ACIDPOOL_BOTTOMLEFT,
-    EL_ACIDPOOL_BOTTOM,
-    EL_ACIDPOOL_BOTTOMRIGHT,
     EL_SP_CHIP_SINGLE,
     EL_SP_CHIP_LEFT,
     EL_SP_CHIP_RIGHT,
     EL_SP_CHIP_UPPER,
     EL_SP_CHIP_LOWER,
+    EL_SP_TERMINAL,
+    EL_SP_TERMINAL_ACTIVE,
+    EL_SP_EXIT_CLOSED,
+    EL_SP_EXIT_OPEN,
+    EL_INVISIBLE_WALL,
+    EL_INVISIBLE_WALL_ACTIVE,
+    EL_SWITCHGATE_SWITCH_UP,
+    EL_SWITCHGATE_SWITCH_DOWN,
+    EL_TIMEGATE_SWITCH,
+    EL_TIMEGATE_SWITCH_ACTIVE,
+    EL_EMC_WALL_PILLAR_UPPER,
+    EL_EMC_WALL_PILLAR_MIDDLE,
+    EL_EMC_WALL_PILLAR_LOWER,
+    EL_EMC_WALL4,
+    EL_EMC_WALL5,
+    EL_EMC_WALL6,
+    EL_EMC_WALL7,
+    EL_EMC_WALL8,
+    EL_WALL_PEARL,
+    EL_WALL_CRYSTAL,
+
+    /* the following elements are a direct copy of "indestructible" elements,
+       except "EL_ACID", which is "indestructible", but not "solid"! */
+#if 0
+    EL_ACID,
+#endif
+    EL_STEELWALL,
+    EL_ACIDPOOL_TOPLEFT,
+    EL_ACIDPOOL_TOPRIGHT,
+    EL_ACIDPOOL_BOTTOMLEFT,
+    EL_ACIDPOOL_BOTTOM,
+    EL_ACIDPOOL_BOTTOMRIGHT,
     EL_SP_HARD_GRAY,
     EL_SP_HARD_GREEN,
     EL_SP_HARD_BLUE,
@@ -1392,14 +1425,8 @@ void InitElementProperties()
     EL_SP_HARD_BASE4,
     EL_SP_HARD_BASE5,
     EL_SP_HARD_BASE6,
-    EL_SP_TERMINAL,
-    EL_SP_TERMINAL_ACTIVE,
-    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,
@@ -1412,12 +1439,8 @@ void InitElementProperties()
     EL_CONVEYOR_BELT4_SWITCH_LEFT,
     EL_CONVEYOR_BELT4_SWITCH_MIDDLE,
     EL_CONVEYOR_BELT4_SWITCH_RIGHT,
-    EL_SWITCHGATE_SWITCH_UP,
-    EL_SWITCHGATE_SWITCH_DOWN,
     EL_LIGHT_SWITCH,
     EL_LIGHT_SWITCH_ACTIVE,
-    EL_TIMEGATE_SWITCH,
-    EL_TIMEGATE_SWITCH_ACTIVE,
     EL_SIGN_EXCLAMATION,
     EL_SIGN_RADIOACTIVITY,
     EL_SIGN_STOP,
@@ -1435,17 +1458,7 @@ void InitElementProperties()
     EL_EMC_STEELWALL2,
     EL_EMC_STEELWALL3,
     EL_EMC_STEELWALL4,
-    EL_EMC_WALL_PILLAR_UPPER,
-    EL_EMC_WALL_PILLAR_MIDDLE,
-    EL_EMC_WALL_PILLAR_LOWER,
-    EL_EMC_WALL4,
-    EL_EMC_WALL5,
-    EL_EMC_WALL6,
-    EL_EMC_WALL7,
-    EL_EMC_WALL8,
     EL_CRYSTAL,
-    EL_WALL_PEARL,
-    EL_WALL_CRYSTAL,
     EL_GATE1,
     EL_GATE2,
     EL_GATE3,
@@ -1484,7 +1497,7 @@ void InitElementProperties()
   };
   static int ep_solid_num = SIZEOF_ARRAY_INT(ep_solid);
 
-  static int ep_massive[] =
+  static int ep_indestructible[] =
   {
     EL_STEELWALL,
     EL_ACID,
@@ -1574,7 +1587,7 @@ void InitElementProperties()
     EL_TUBE_RIGHT_UP,
     EL_TUBE_RIGHT_DOWN
   };
-  static int ep_massive_num = SIZEOF_ARRAY_INT(ep_massive);
+  static int ep_indestructible_num = SIZEOF_ARRAY_INT(ep_indestructible);
 
   static int ep_slippery[] =
   {
@@ -2332,7 +2345,7 @@ void InitElementProperties()
     EP_BIT_SCHLUESSEL,
     EP_BIT_PFORTE,
     EP_BIT_SOLID,
-    EP_BIT_MASSIVE,
+    EP_BIT_INDESTRUCTIBLE,
     EP_BIT_SLIPPERY,
     EP_BIT_ENEMY,
     EP_BIT_MAUER,
@@ -2373,7 +2386,7 @@ void InitElementProperties()
     ep_schluessel,
     ep_pforte,
     ep_solid,
-    ep_massive,
+    ep_indestructible,
     ep_slippery,
     ep_enemy,
     ep_mauer,
@@ -2414,7 +2427,7 @@ void InitElementProperties()
     &ep_schluessel_num,
     &ep_pforte_num,
     &ep_solid_num,
-    &ep_massive_num,
+    &ep_indestructible_num,
     &ep_slippery_num,
     &ep_enemy_num,
     &ep_mauer_num,
index 94c72152c2890d0461b849675d8fd18672033265..613d2017a7993e5aa900f371c0779faa9a261d64 100644 (file)
@@ -85,6 +85,7 @@ static int get_toon_direction(char *direction_raw)
 {
   static char *direction = NULL;
 
+  /* !!! MEMORY LEAK HERE! FIX IT! !!! */
   setString(&direction, getStringToLower(direction_raw));
 
   return (strcmp(direction, "left")  == 0 ? MV_LEFT :
index ebe7f0d9e875b68abe05afc32d42875cc85f82cb..468f910d533f933555ba697fed41356c9cb1702d 100644 (file)
@@ -66,7 +66,7 @@
 #define EP_BIT_SCHLUESSEL      (1 << 2)
 #define EP_BIT_PFORTE          (1 << 3)
 #define EP_BIT_SOLID           (1 << 4)
-#define EP_BIT_MASSIVE         (1 << 5)
+#define EP_BIT_INDESTRUCTIBLE  (1 << 5)
 #define EP_BIT_SLIPPERY                (1 << 6)
 #define EP_BIT_ENEMY           (1 << 7)
 #define EP_BIT_MAUER           (1 << 8)
 #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_INDESTRUCTIBLE(e)   (Properties1[e] & EP_BIT_INDESTRUCTIBLE)
 #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)
index b20e04cb85ef05904d15107494bb2b9f59a54ce9..5569bce9ce46e1d4bbdec448a695dc15d3e8dcc6 100644 (file)
@@ -426,7 +426,7 @@ void SetBorderElement()
   {
     for(x=0; x<lev_fieldx; x++)
     {
-      if (!IS_MASSIVE(Feld[x][y]))
+      if (!IS_INDESTRUCTIBLE(Feld[x][y]))
        BorderElement = EL_STEELWALL;
 
       if (y != 0 && y != lev_fieldy - 1 && x != lev_fieldx - 1)