rnd-20030119-1-src
authorHolger Schemel <info@artsoft.org>
Sun, 19 Jan 2003 18:24:38 +0000 (19:24 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:39:51 +0000 (10:39 +0200)
14 files changed:
src/conf_gfx.c
src/conftime.h
src/game.c
src/init.c
src/libgame/image.c
src/libgame/image.h
src/libgame/misc.c
src/libgame/setup.c
src/libgame/setup.h
src/libgame/sound.c
src/libgame/sound.h
src/libgame/system.h
src/main.c
src/main.h

index 53176615aadfa7573fb28af1eab7e776c983a2a9..dae096899130d329634c90881c96caec483c94c2 100644 (file)
@@ -36,7 +36,7 @@ struct ConfigInfo image_config_suffix[] =
   { ".mode_pingpong2",                 "false",        TYPE_BOOLEAN },
   { ".mode_random",                    "false",        TYPE_BOOLEAN },
   { ".mode_reverse",                   "false",        TYPE_BOOLEAN },
-  { ".global_sync",                    ARG_UNDEFINED,  TYPE_BOOLEAN },
+  { ".global_sync",                    "false",        TYPE_BOOLEAN },
 
   { NULL,                              NULL,           0            }
 };
@@ -531,10 +531,14 @@ struct ConfigInfo image_config[] =
   { "sp_explosion.xpos",                       "8"                     },
   { "sp_explosion.ypos",                       "3"                     },
   { "sp_explosion.frames",                     "8"                     },
+  { "sp_explosion.delay",                      "3"                     },
+  { "sp_explosion.mode_linear",                        "true"                  },
   { "sp_explosion_infotron",                   "RocksSP.pcx"           },
   { "sp_explosion_infotron.xpos",              "8"                     },
   { "sp_explosion_infotron.ypos",              "4"                     },
   { "sp_explosion_infotron.frames",            "8"                     },
+  { "sp_explosion.delay",                      "3"                     },
+  { "sp_explosion.mode_linear",                        "true"                  },
 
   /* images for Sokoban style elements and actions */
 
index 9b4859ba14e2291a08f7018ae8b59377f61598a9..c86c2ea5125dbcc98ed0e36f0c7395cddb87c125 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-01-18 18:43]"
+#define COMPILE_DATE_STRING "[2003-01-19 19:22]"
index 10e6e2fb5b5471726474958a28037e25ff5b7b2e..533119c92b368df93d484018f33fd3d2b35a7b42 100644 (file)
@@ -2178,7 +2178,7 @@ void Impact(int x, int y)
   if ((element == EL_BOMB ||
        element == EL_SP_DISK_ORANGE ||
        element == EL_DX_SUPABOMB) &&
-      (lastline || object_hit))        /* element is bomb */
+      (lastline || object_hit))                /* element is bomb */
   {
     Bang(x, y);
     return;
@@ -2207,7 +2207,8 @@ void Impact(int x, int y)
   if (!lastline && object_hit)         /* check which object was hit */
   {
     if (CAN_CHANGE(element) && 
-       (smashed == EL_MAGIC_WALL || smashed == EL_BD_MAGIC_WALL))
+       (smashed == EL_MAGIC_WALL ||
+        smashed == EL_BD_MAGIC_WALL))
     {
       int xx, yy;
       int activated_magic_wall =
@@ -2228,29 +2229,31 @@ void Impact(int x, int y)
                            SND_BD_MAGIC_WALL_ACTIVATING));
     }
 
-    if (IS_PLAYER(x, y+1))
+    if (IS_PLAYER(x, y + 1))
     {
       KillHeroUnlessProtected(x, y+1);
       return;
     }
     else if (smashed == EL_PENGUIN)
     {
-      Bang(x, y+1);
+      Bang(x, y + 1);
       return;
     }
     else if (element == EL_BD_DIAMOND)
     {
       if (IS_ENEMY(smashed) && IS_BD_ELEMENT(smashed))
       {
-       Bang(x, y+1);
+       Bang(x, y + 1);
        return;
       }
     }
-    else if ((element == EL_SP_INFOTRON || element == EL_SP_ZONK) &&
-            (smashed == EL_SP_SNIKSNAK || smashed == EL_SP_ELECTRON ||
+    else if ((element == EL_SP_INFOTRON ||
+             element == EL_SP_ZONK) &&
+            (smashed == EL_SP_SNIKSNAK ||
+             smashed == EL_SP_ELECTRON ||
              smashed == EL_SP_DISK_ORANGE))
     {
-      Bang(x, y+1);
+      Bang(x, y + 1);
       return;
     }
     else if (element == EL_ROCK ||
@@ -2258,19 +2261,23 @@ void Impact(int x, int y)
             element == EL_BD_ROCK)
     {
       if (IS_ENEMY(smashed) ||
-         smashed == EL_BOMB || smashed == EL_SP_DISK_ORANGE ||
+         smashed == EL_BOMB ||
+         smashed == EL_SP_DISK_ORANGE ||
          smashed == EL_DX_SUPABOMB ||
-         smashed == EL_SATELLITE || smashed == EL_PIG ||
-         smashed == EL_DRAGON || smashed == EL_MOLE)
+         smashed == EL_SATELLITE ||
+         smashed == EL_PIG ||
+         smashed == EL_DRAGON ||
+         smashed == EL_MOLE)
       {
-       Bang(x, y+1);
+       Bang(x, y + 1);
        return;
       }
-      else if (!IS_MOVING(x, y+1))
+      else if (!IS_MOVING(x, y + 1))
       {
-       if (smashed == EL_LAMP || smashed == EL_LAMP_ACTIVE)
+       if (smashed == EL_LAMP ||
+           smashed == EL_LAMP_ACTIVE)
        {
-         Bang(x, y+1);
+         Bang(x, y + 1);
          return;
        }
        else if (smashed == EL_NUT)
@@ -5224,6 +5231,8 @@ void GameActions()
       ChangeElement(x, y);
 
 #if 1
+    else if (element == EL_EXPLOSION)
+      ;        /* drawing of correct explosion animation is handled separately */
     else if (IS_ANIMATED(graphic))
       DrawLevelGraphicAnimation(x, y, graphic);
 #endif
index 2b1b7931420cc5d8f66cd702400d2b4db57bf917..2b7836e2c2a8633f9e7925c15d554bc9b4e6fb64 100644 (file)
@@ -184,8 +184,21 @@ static void InitArtworkInfo()
 
 static void InitArtworkConfig()
 {
-  InitImageList(image_config, image_config_suffix, NUM_IMAGE_FILES);
-  InitSoundList(sound_config, sound_config_suffix, NUM_SOUND_FILES);
+  static struct ConfigInfo action_suffix[NUM_ACTIONS + 1];
+  static struct ConfigInfo direction_suffix[NUM_DIRECTIONS + 1];
+  static struct ConfigInfo empty[1];
+  int i;
+
+  for (i=0; i<NUM_ACTIONS + 1; i++)
+    action_suffix[i].token = element_action_info[i].suffix;
+  for (i=0; i<NUM_DIRECTIONS + 1; i++)
+    direction_suffix[i].token = element_direction_info[i].suffix;
+  empty[0].token = NULL;
+
+  InitImageList(image_config, NUM_IMAGE_FILES, image_config_suffix,
+               action_suffix, direction_suffix);
+  InitSoundList(sound_config, NUM_SOUND_FILES, sound_config_suffix,
+               action_suffix, empty);
 }
 
 void InitLevelArtworkInfo()
@@ -550,10 +563,6 @@ void ReloadCustomArtwork()
   if (!validLevelSeries(leveldir_current))
     return;
 
-#if 0
-  printf("--> '%s'\n", artwork.gfx_current_identifier);
-#endif
-
   /* when a new level series was selected, check if there was a change
      in custom artwork stored in level series directory */
   if (leveldir_current_identifier != leveldir_current->identifier)
@@ -587,8 +596,8 @@ void ReloadCustomArtwork()
   if (strcmp(artwork.gfx_current_identifier, gfx_new_identifier) != 0 ||
       last_override_level_graphics != setup.override_level_graphics)
   {
-#if 1
-    printf("RELOADING GRAPHICS '%s' -> '%s' (-> '%s')\n",
+#if 0
+    printf("RELOADING GRAPHICS '%s' -> '%s' ('%s')\n",
           artwork.gfx_current_identifier,
           artwork.gfx_current->identifier,
           gfx_new_identifier);
@@ -604,11 +613,7 @@ void ReloadCustomArtwork()
     FreeTileClipmasks();
     InitTileClipmasks();
 
-#if 0
-    artwork.gfx_current_identifier = gfx_new_identifier;
-#else
     artwork.gfx_current_identifier = artwork.gfx_current->identifier;
-#endif
     last_override_level_graphics = setup.override_level_graphics;
 
     redraw_screen = TRUE;
@@ -617,11 +622,11 @@ void ReloadCustomArtwork()
   if (strcmp(artwork.snd_current_identifier, snd_new_identifier) != 0 ||
       last_override_level_sounds != setup.override_level_sounds)
   {
-#if 1
-    printf("RELOADING SOUNDS '%s' -> '%s' (-> '%s')\n",
+#if 0
+    printf("RELOADING SOUNDS '%s' -> '%s' ('%s')\n",
           artwork.snd_current_identifier,
-          snd_new_identifier,
-          artwork.snd_current->identifier);
+          artwork.snd_current->identifier,
+          snd_new_identifier);
 #endif
 
     /* set artwork path to send it to the sound server process */
@@ -630,12 +635,7 @@ void ReloadCustomArtwork()
     InitReloadCustomSounds(snd_new_identifier);
     ReinitializeSounds();
 
-#if 0
-    artwork.snd_current_identifier = snd_new_identifier;
-#else
     artwork.snd_current_identifier = artwork.snd_current->identifier;
-#endif
-
     last_override_level_sounds = setup.override_level_sounds;
 
     redraw_screen = TRUE;
@@ -650,11 +650,7 @@ void ReloadCustomArtwork()
     InitReloadCustomMusic(mus_new_identifier);
     ReinitializeMusic();
 
-#if 0
-    artwork.mus_current_identifier = mus_new_identifier;
-#else
     artwork.mus_current_identifier = artwork.mus_current->identifier;
-#endif
     last_override_level_music = setup.override_level_music;
 
     redraw_screen = TRUE;
@@ -668,10 +664,6 @@ void ReloadCustomArtwork()
     SetDoorState(DOOR_OPEN_ALL);
     CloseDoor(DOOR_CLOSE_ALL | DOOR_NO_DELAY);
   }
-
-#if 0
-  printf("<-- '%s'\n", artwork.gfx_current_identifier);
-#endif
 }
 
 void FreeGadgets()
@@ -701,7 +693,6 @@ void InitGadgets()
 
 void InitElementInfo()
 {
-
   int i, act, dir;
 
   /* set values to -1 to identify later as "uninitialized" values */
@@ -787,7 +778,7 @@ void InitElementInfo()
   }
 }
 
-static void set_graphic_parameters(int graphic, int action, int *parameter)
+static void set_graphic_parameters(int graphic, int *parameter)
 {
   Bitmap *src_bitmap = getBitmapFromImageID(graphic);
   int num_xtiles = (src_bitmap ? src_bitmap->width          : TILEX) / TILEX;
@@ -847,33 +838,22 @@ static void set_graphic_parameters(int graphic, int action, int *parameter)
   if (parameter[GFX_ARG_MODE_REVERSE])
     graphic_info[graphic].anim_mode |= ANIM_REVERSE;
 
-  /* set first frame of animation after determining animation mode */
-  graphic_info[graphic].anim_start_frame = parameter[GFX_ARG_START_FRAME];
-
   /* automatically determine correct start frame, if not defined */
   if (parameter[GFX_ARG_START_FRAME] == ARG_UNDEFINED_VALUE)
     graphic_info[graphic].anim_start_frame = 0;
   else if (graphic_info[graphic].anim_mode & ANIM_REVERSE)
     graphic_info[graphic].anim_start_frame =
       graphic_info[graphic].anim_frames - parameter[GFX_ARG_START_FRAME] - 1;
+  else
+    graphic_info[graphic].anim_start_frame = parameter[GFX_ARG_START_FRAME];
 
   /* animation synchronized with global frame counter, not move position */
   graphic_info[graphic].anim_global_sync = parameter[GFX_ARG_GLOBAL_SYNC];
-
-  /* set global_sync for all animations with undefined "animation action" */
-  if (parameter[GFX_ARG_GLOBAL_SYNC] == ARG_UNDEFINED_VALUE)
-    graphic_info[graphic].anim_global_sync =
-      (action == ACTION_DEFAULT ? TRUE : FALSE);
-
-  /* "linear" animations are never globally synchronized */
-  if (parameter[GFX_ARG_MODE_LINEAR])
-    graphic_info[graphic].anim_global_sync = FALSE;
 }
 
 static void InitGraphicInfo()
 {
   static boolean clipmasks_initialized = FALSE;
-  static int gfx_action[NUM_IMAGE_FILES];
   int i;
 #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
   Pixmap src_pixmap;
@@ -884,25 +864,6 @@ static void InitGraphicInfo()
 
   image_files = getCurrentImageList();
 
-  /* set temporary graphics action field to default value */
-  for (i=0; i<NUM_IMAGE_FILES; i++)
-    gfx_action[i] = ACTION_DEFAULT;
-
-  /* set temporary graphics action field from element_to_graphic list */
-  i = 0;
-  while (element_to_graphic[i].element > -1)
-  {
-    int action    = element_to_graphic[i].action;
-    int graphic   = element_to_graphic[i].graphic;
-
-    if (action == -1)
-      action = ACTION_DEFAULT;
-
-    gfx_action[graphic] = action;
-
-    i++;
-  }
-
 #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
   if (clipmasks_initialized)
   {
@@ -925,7 +886,7 @@ static void InitGraphicInfo()
     int src_x, src_y;
     int first_frame, last_frame;
 
-    set_graphic_parameters(i, gfx_action[i], image_files[i].parameter);
+    set_graphic_parameters(i, image_files[i].parameter);
 
     /* now check if no animation frames are outside of the loaded image */
 
@@ -952,8 +913,7 @@ static void InitGraphicInfo()
       Error(ERR_RETURN, "custom graphic rejected for this element/action");
       Error(ERR_RETURN_LINE, "-");
 
-      set_graphic_parameters(i, gfx_action[i],
-                            image_files[i].default_parameter);
+      set_graphic_parameters(i, image_files[i].default_parameter);
     }
 
     last_frame = graphic_info[i].anim_frames - 1;
@@ -976,8 +936,7 @@ static void InitGraphicInfo()
       Error(ERR_RETURN, "custom graphic rejected for this element/action");
       Error(ERR_RETURN_LINE, "-");
 
-      set_graphic_parameters(i, gfx_action[i],
-                            image_files[i].default_parameter);
+      set_graphic_parameters(i, image_files[i].default_parameter);
     }
 
 #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
@@ -1043,17 +1002,17 @@ static void InitSoundInfo()
 
     /* determine all loop sounds and identify certain sound classes */
 
-    for (j=0; sound_action_properties[j].text; j++)
+    for (j=0; element_action_info[j].suffix; j++)
     {
-      int len_action_text = strlen(sound_action_properties[j].text);
+      int len_action_text = strlen(element_action_info[j].suffix);
 
       if (len_action_text < len_effect_text &&
          strcmp(&sound_files[i].token[len_effect_text - len_action_text],
-                sound_action_properties[j].text) == 0)
+                element_action_info[j].suffix) == 0)
       {
-       sound_effect_properties[i] = sound_action_properties[j].value;
+       sound_effect_properties[i] = element_action_info[j].value;
 
-       if (sound_action_properties[j].is_loop)
+       if (element_action_info[j].is_loop_sound)
          sound_info[i].loop = TRUE;
       }
     }
@@ -1088,11 +1047,11 @@ static void InitSoundInfo()
     int sound_action = ACTION_DIGGING;
     int j = 0;
 
-    while (sound_action_properties[j].text)
+    while (element_action_info[j].suffix)
     {
-      if (sound_action_properties[j].value == sound_action)
+      if (element_action_info[j].value == sound_action)
        printf("element %d, sound action '%s'  == %d\n",
-              element, sound_action_properties[j].text,
+              element, element_action_info[j].suffix,
               element_info_[element].sound[sound_action]);
       j++;
     }
index c4d3080805ec3f685b1494a0010b35e990869fbb..b2ed4d7e2727ae3ba2b7d6b318ef9327506ce362 100644 (file)
@@ -720,9 +720,10 @@ char *getImageConfigFilename()
   return getCustomArtworkConfigFilename(image_info->type);
 }
 
-void InitImageList(struct ConfigInfo *config_list,
+void InitImageList(struct ConfigInfo *config_list, int num_file_list_entries,
                   struct ConfigInfo *config_suffix_list,
-                  int num_file_list_entries)
+                  struct ConfigInfo *ext1_suffix_list,
+                  struct ConfigInfo *ext2_suffix_list)
 {
   int i;
 
@@ -731,14 +732,25 @@ void InitImageList(struct ConfigInfo *config_list,
   image_info->type = ARTWORK_TYPE_GRAPHICS;
 
   image_info->num_file_list_entries = num_file_list_entries;
+
   image_info->num_suffix_list_entries = 0;
   for (i=0; config_suffix_list[i].token != NULL; i++)
     image_info->num_suffix_list_entries++;
 
+  image_info->num_ext1_suffix_list_entries = 0;
+  for (i=0; ext1_suffix_list[i].token != NULL; i++)
+    image_info->num_ext1_suffix_list_entries++;
+
+  image_info->num_ext2_suffix_list_entries = 0;
+  for (i=0; ext2_suffix_list[i].token != NULL; i++)
+    image_info->num_ext2_suffix_list_entries++;
+
   image_info->file_list =
     getFileListFromConfigList(config_list, config_suffix_list,
                              num_file_list_entries);
   image_info->suffix_list = config_suffix_list;
+  image_info->ext1_suffix_list = ext1_suffix_list;
+  image_info->ext2_suffix_list = ext2_suffix_list;
   image_info->custom_setup_list = NULL;
 
   image_info->artwork_list =
index 75c9ad18a2393c33eb72aecd25ad5c2c3d3285ba..0bc0b4b3a2255c0fe6566599281cebdf7a728ead 100644 (file)
@@ -76,7 +76,8 @@ struct FileInfo *getCurrentImageList();
 Bitmap *getBitmapFromImageID(int);
 char *getTokenFromImageID(int);
 char *getImageConfigFilename();
-void InitImageList(struct ConfigInfo *, struct ConfigInfo *, int);
+void InitImageList(struct ConfigInfo *, int, struct ConfigInfo *,
+                  struct ConfigInfo *, struct ConfigInfo *);
 void ReloadCustomImages();
 void FreeAllImages();
 
index abea627781cfebb3d2a20b09351055ccc69177e4..5b083e413c3b6122ce8646528cd31ef701a55f57 100644 (file)
@@ -1614,6 +1614,7 @@ void LoadArtworkConfig(struct ArtworkListInfo *artwork_info)
   int num_suffix_list_entries = artwork_info->num_suffix_list_entries;
   char *filename = getCustomArtworkConfigFilename(artwork_info->type);
   struct SetupFileList *setup_file_list;
+  struct SetupFileList *extra_file_list = NULL;
   char *known_token_value = "[KNOWN_TOKEN]";
   int i, j;
 
@@ -1689,6 +1690,13 @@ void LoadArtworkConfig(struct ArtworkListInfo *artwork_info)
     {
       if (strcmp(setup_file_list->value, known_token_value) != 0)
       {
+       if (extra_file_list == NULL)
+         extra_file_list = newSetupFileList(setup_file_list->token,
+                                            setup_file_list->value);
+       else
+         setTokenValue(extra_file_list, setup_file_list->token,
+                       setup_file_list->value);
+
        if (!unknown_tokens_found)
        {
          Error(ERR_RETURN_LINE, "-");
@@ -1710,6 +1718,8 @@ void LoadArtworkConfig(struct ArtworkListInfo *artwork_info)
 
   freeSetupFileList(setup_file_list);
 
+  freeSetupFileList(extra_file_list);
+
 #if 0
   for (i=0; i<num_file_list_entries; i++)
   {
index 7754e5e4ff42861a6d25f9c681610caca47bb7c8..561c51ed73b7e2afa45142bd5ce9a24a8c742b86 100644 (file)
@@ -1031,7 +1031,7 @@ char *getFormattedSetupEntry(char *token, char *value)
 
 void freeSetupFileList(struct SetupFileList *setup_file_list)
 {
-  if (!setup_file_list)
+  if (setup_file_list == NULL)
     return;
 
   if (setup_file_list->token)
@@ -1043,15 +1043,12 @@ void freeSetupFileList(struct SetupFileList *setup_file_list)
   free(setup_file_list);
 }
 
-static struct SetupFileList *newSetupFileList(char *token, char *value)
+struct SetupFileList *newSetupFileList(char *token, char *value)
 {
   struct SetupFileList *new = checked_malloc(sizeof(struct SetupFileList));
 
-  new->token = checked_malloc(strlen(token) + 1);
-  strcpy(new->token, token);
-
-  new->value = checked_malloc(strlen(value) + 1);
-  strcpy(new->value, value);
+  new->token = getStringCopy(token);
+  new->value = getStringCopy(value);
 
   new->next = NULL;
 
@@ -1060,7 +1057,7 @@ static struct SetupFileList *newSetupFileList(char *token, char *value)
 
 char *getTokenValue(struct SetupFileList *setup_file_list, char *token)
 {
-  if (!setup_file_list)
+  if (setup_file_list == NULL)
     return NULL;
 
   if (strcmp(setup_file_list->token, token) == 0)
@@ -1072,14 +1069,15 @@ char *getTokenValue(struct SetupFileList *setup_file_list, char *token)
 void setTokenValue(struct SetupFileList *setup_file_list,
                   char *token, char *value)
 {
-  if (!setup_file_list)
+  if (setup_file_list == NULL)
     return;
 
   if (strcmp(setup_file_list->token, token) == 0)
   {
-    free(setup_file_list->value);
-    setup_file_list->value = checked_malloc(strlen(value) + 1);
-    strcpy(setup_file_list->value, value);
+    if (setup_file_list->value)
+      free(setup_file_list->value);
+
+    setup_file_list->value = getStringCopy(value);
   }
   else if (setup_file_list->next == NULL)
     setup_file_list->next = newSetupFileList(token, value);
index d3328728e626245a9d74ed90ef9b802cff246b38..e5dc50d88ea7b4c873f64a185d9653730f8efe40 100644 (file)
@@ -206,6 +206,7 @@ boolean checkCookieString(const char *, const char *);
 
 char *getFormattedSetupEntry(char *, char *);
 void freeSetupFileList(struct SetupFileList *);
+struct SetupFileList *newSetupFileList(char *, char *);
 char *getTokenValue(struct SetupFileList *, char *);
 void setTokenValue(struct SetupFileList *, char *, char *);
 struct SetupFileList *loadSetupFileList(char *);
index 1a403e7be7c60ccfd53b0a2b614af3c41f1dd237..460bed15cb4ef98dff342bd63e386392c2fc6cae 100644 (file)
@@ -1770,9 +1770,10 @@ struct FileInfo *getCurrentSoundList()
   return sound_info->file_list;
 }
 
-void InitSoundList(struct ConfigInfo *config_list,
+void InitSoundList(struct ConfigInfo *config_list, int num_file_list_entries,
                   struct ConfigInfo *config_suffix_list,
-                  int num_file_list_entries)
+                  struct ConfigInfo *ext1_suffix_list,
+                  struct ConfigInfo *ext2_suffix_list)
 {
   int i;
 
@@ -1781,14 +1782,25 @@ void InitSoundList(struct ConfigInfo *config_list,
   sound_info->type = ARTWORK_TYPE_SOUNDS;
 
   sound_info->num_file_list_entries = num_file_list_entries;
+
   sound_info->num_suffix_list_entries = 0;
   for (i=0; config_suffix_list[i].token != NULL; i++)
     sound_info->num_suffix_list_entries++;
 
+  sound_info->num_ext1_suffix_list_entries = 0;
+  for (i=0; ext1_suffix_list[i].token != NULL; i++)
+    sound_info->num_ext1_suffix_list_entries++;
+
+  sound_info->num_ext2_suffix_list_entries = 0;
+  for (i=0; ext2_suffix_list[i].token != NULL; i++)
+    sound_info->num_ext2_suffix_list_entries++;
+
   sound_info->file_list =
     getFileListFromConfigList(config_list, config_suffix_list,
                              num_file_list_entries);
   sound_info->suffix_list = config_suffix_list;
+  sound_info->ext1_suffix_list = ext1_suffix_list;
+  sound_info->ext2_suffix_list = ext2_suffix_list;
   sound_info->custom_setup_list = NULL;
 
   sound_info->artwork_list =
index 45905aab9ac0a265c0fe4d804b2e8ec8f7c2e501..9e495961c1e5b6c473421e58421de2f01c586bc5 100644 (file)
@@ -143,7 +143,8 @@ void StopSound(int);
 void StopSounds(void);
 void StopSoundExt(int, int);
 struct FileInfo *getCurrentSoundList();
-void InitSoundList(struct ConfigInfo *, struct ConfigInfo *, int);
+void InitSoundList(struct ConfigInfo *, int, struct ConfigInfo *,
+                  struct ConfigInfo *, struct ConfigInfo *);
 void InitReloadCustomSounds(char *);
 void InitReloadCustomMusic(char *);
 void FreeAllSounds(void);
index f77bc0acf59d9bfcc67f48d1a21b00fb76238ea7..fa722636b27c57679d7628e3f2b6777bb4525836 100644 (file)
@@ -517,9 +517,13 @@ struct ArtworkListInfo
 
   int num_file_list_entries;
   int num_suffix_list_entries;
+  int num_ext1_suffix_list_entries;
+  int num_ext2_suffix_list_entries;
 
   struct FileInfo *file_list;                  /* static artwork file array */
   struct ConfigInfo *suffix_list;              /* parameter suffixes array */
+  struct ConfigInfo *ext1_suffix_list;         /* property suffixes array 1 */
+  struct ConfigInfo *ext2_suffix_list;         /* property suffixes array 2 */
   struct SetupFileList *custom_setup_list;     /* additional definitions */
 
   struct ListNodeInfo **artwork_list;          /* static artwork node array */
index 7cb246320a9febf64a608a66fe714d4d98065ac8..b0a19802b855a91a6389231c5ed3006cf2e6d9f9 100644 (file)
 #include "events.h"
 
 #if 0
-GC             tile_clip_gc;
-Bitmap        *pix[NUM_BITMAPS];
+GC                     tile_clip_gc;
+Bitmap                *pix[NUM_BITMAPS];
 #endif
-Bitmap        *bitmap_db_field, *bitmap_db_door;
+Bitmap                *bitmap_db_field, *bitmap_db_door;
 #if 0
-Pixmap         tile_clipmask[NUM_TILES];
+Pixmap                 tile_clipmask[NUM_TILES];
 #endif
-DrawBuffer     *fieldbuffer;
-DrawBuffer     *drawto_field;
+DrawBuffer          *fieldbuffer;
+DrawBuffer          *drawto_field;
 
-int            game_status = MAINMENU;
-boolean                level_editor_test_game = FALSE;
-boolean                network_playing = FALSE;
+int                    game_status = MAINMENU;
+boolean                        level_editor_test_game = FALSE;
+boolean                        network_playing = FALSE;
 
-int            key_joystick_mapping = 0;
+int                    key_joystick_mapping = 0;
 
-boolean                redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
-int            redraw_x1 = 0, redraw_y1 = 0;
+boolean                        redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
+int                    redraw_x1 = 0, redraw_y1 = 0;
 
-short          Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short          Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short          MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short          MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short          MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short          Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short          Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short          StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-boolean                Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short          JustStopped[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-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];
+short                  Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+boolean                        Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  JustStopped[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  AmoebaCnt[MAX_NUM_AMOEBA];
+short                  AmoebaCnt2[MAX_NUM_AMOEBA];
+short                  ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 
-unsigned long  Properties1[MAX_NUM_ELEMENTS];
-unsigned long  Properties2[MAX_NUM_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];
+int                    GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 
-int            lev_fieldx,lev_fieldy, scroll_x,scroll_y;
+int                    lev_fieldx, lev_fieldy;
+int                    scroll_x, scroll_y;
 
-int            FX = SX, FY = SY, ScrollStepSize;
-int            ScreenMovDir = MV_NO_MOVING, ScreenMovPos = 0;
-int            ScreenGfxPos = 0;
-int            BorderElement = EL_STEELWALL;
-int            GameFrameDelay = GAME_FRAME_DELAY;
-int            FfwdFrameDelay = FFWD_FRAME_DELAY;
-int            BX1 = 0, BY1 = 0, BX2 = SCR_FIELDX-1, BY2 = SCR_FIELDY-1;
-int            SBX_Left, SBX_Right;
-int            SBY_Upper, SBY_Lower;
-int            ZX,ZY, ExitX,ExitY;
-int            AllPlayersGone;
+int                    FX = SX, FY = SY;
+int                    ScrollStepSize;
+int                    ScreenMovDir = MV_NO_MOVING, ScreenMovPos = 0;
+int                    ScreenGfxPos = 0;
+int                    BorderElement = EL_STEELWALL;
+int                    GameFrameDelay = GAME_FRAME_DELAY;
+int                    FfwdFrameDelay = FFWD_FRAME_DELAY;
+int                    BX1 = 0, BY1 = 0;
+int                    BX2 = SCR_FIELDX - 1, BY2 = SCR_FIELDY - 1;
+int                    SBX_Left, SBX_Right;
+int                    SBY_Upper, SBY_Lower;
+int                    ZX, ZY;
+int                    ExitX, ExitY;
+int                    AllPlayersGone;
 
-int            TimeFrames, TimePlayed, TimeLeft;
+int                    TimeFrames, TimePlayed, TimeLeft;
 
-boolean                network_player_action_received = FALSE;
+boolean                        network_player_action_received = FALSE;
 
 struct LevelInfo       level;
 struct PlayerInfo      stored_player[MAX_PLAYERS], *local_player = NULL;
@@ -86,6 +91,13 @@ struct GameInfo              game;
 struct GlobalInfo      global;
 struct FileInfo               *image_files;
 struct FileInfo               *sound_files;
+struct GraphicInfo     graphic_info[NUM_IMAGE_FILES];
+struct SoundInfo       sound_info[NUM_SOUND_FILES];
+
+
+/* ------------------------------------------------------------------------- */
+/* element definitions                                                       */
+/* ------------------------------------------------------------------------- */
 
 struct ElementInfo element_info[MAX_NUM_ELEMENTS] =
 {
@@ -2760,34 +2772,45 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS] =
 
 
 /* ------------------------------------------------------------------------- */
-/* sound definitions                                                         */
+/* element action and direction definitions                                  */
 /* ------------------------------------------------------------------------- */
 
-struct SoundActionProperties sound_action_properties[] =
+struct ElementActionInfo element_action_info[] =
 {
-  /* insert _all_ loop sound actions here */
-  { ".waiting",                ACTION_WAITING,         TRUE },
-  { ".moving",         ACTION_MOVING,          TRUE }, /* continuos moving */
-  { ".active",         ACTION_ACTIVE,          TRUE },
-  { ".growing",                ACTION_GROWING,         TRUE },
-  { ".attacking",      ACTION_ATTACKING,       TRUE },
+  { ".[DEFAULT]",      ACTION_DEFAULT,         TRUE    },
+  { ".waiting",                ACTION_WAITING,         TRUE    },
+  { ".falling",                ACTION_FALLING,         TRUE    },
+  { ".moving",         ACTION_MOVING,          TRUE    },
+  { ".digging",                ACTION_DIGGING,         FALSE   },
+  { ".snapping",       ACTION_SNAPPING,        FALSE   },
+  { ".collecting",     ACTION_COLLECTING,      FALSE   },
+  { ".pushing",                ACTION_PUSHING,         FALSE   },
+  { ".passing",                ACTION_PASSING,         FALSE   },
+  { ".impact",         ACTION_IMPACT,          FALSE   },
+  { ".cracking",       ACTION_CRACKING,        FALSE   },
+  { ".breaking",       ACTION_BREAKING,        FALSE   },
+  { ".activating",     ACTION_ACTIVATING,      FALSE   },
+  { ".opening",                ACTION_OPENING,         FALSE   },
+  { ".closing",                ACTION_CLOSING,         FALSE   },
+  { ".eating",         ACTION_EATING,          FALSE   },
+  { ".attacking",      ACTION_ATTACKING,       TRUE    },
+  { ".growing",                ACTION_GROWING,         TRUE    },
+  { ".shrinking",      ACTION_SHRINKING,       FALSE   },
+  { ".active",         ACTION_ACTIVE,          TRUE    },
+  { ".other",          ACTION_OTHER,           FALSE   },
 
-  /* other (non-loop) sound actions are optional */
-#if 0
-  { ".stepping",       ACTION_MOVING,          FALSE }, /* discrete moving */
-#endif
-  { ".digging",                ACTION_DIGGING,         FALSE },
-  { ".collecting",     ACTION_COLLECTING,      FALSE },
-  { ".passing",                ACTION_PASSING,         FALSE },
-  { ".impact",         ACTION_IMPACT,          FALSE },
-  { ".pushing",                ACTION_PUSHING,         FALSE },
-  { ".activating",     ACTION_ACTIVATING,      FALSE },
-  { NULL,              0,                      0 },
+  { NULL,              0,                      0       },
 };
 
+struct ElementDirectionInfo element_direction_info[] =
+{
+  { ".left",           MV_BIT_LEFT                     },
+  { ".right",          MV_BIT_RIGHT                    },
+  { ".up",             MV_BIT_UP                       },
+  { ".down",           MV_BIT_DOWN                     },
 
-struct GraphicInfo graphic_info[NUM_IMAGE_FILES];
-struct SoundInfo sound_info[NUM_SOUND_FILES];
+  { NULL,              0                               },
+};
 
 
 /* ========================================================================= */
index 221b3530ce324db1c8aeadb85b624c70aa7fad6a..423058b41caa668af44b5ef5a1042c1faaf27070 100644 (file)
 
 #define SND_UNDEFINED          (-1)
 
-#define WIN_XSIZE      672
-#define WIN_YSIZE      560
-
-#define SCR_FIELDX     17
-#define SCR_FIELDY     17
-#define MAX_BUF_XSIZE  (SCR_FIELDX + 2)
-#define MAX_BUF_YSIZE  (SCR_FIELDY + 2)
-#define MIN_LEV_FIELDX 3
-#define MIN_LEV_FIELDY 3
-#define STD_LEV_FIELDX 64
-#define STD_LEV_FIELDY 32
-#define MAX_LEV_FIELDX 128
-#define MAX_LEV_FIELDY 128
-
-#define SCREENX(a)     ((a) - scroll_x)
-#define SCREENY(a)     ((a) - scroll_y)
-#define LEVELX(a)      ((a) + scroll_x)
-#define LEVELY(a)      ((a) + scroll_y)
+#define WIN_XSIZE              672
+#define WIN_YSIZE              560
+
+#define SCR_FIELDX             17
+#define SCR_FIELDY             17
+#define MAX_BUF_XSIZE          (SCR_FIELDX + 2)
+#define MAX_BUF_YSIZE          (SCR_FIELDY + 2)
+#define MIN_LEV_FIELDX         3
+#define MIN_LEV_FIELDY         3
+#define STD_LEV_FIELDX         64
+#define STD_LEV_FIELDY         32
+#define MAX_LEV_FIELDX         128
+#define MAX_LEV_FIELDY         128
+
+#define SCREENX(a)             ((a) - scroll_x)
+#define SCREENY(a)             ((a) - scroll_y)
+#define LEVELX(a)              ((a) + scroll_x)
+#define LEVELY(a)              ((a) + scroll_y)
 #define IN_VIS_FIELD(x,y) ((x)>=0 && (x)<SCR_FIELDX && (y)>=0 &&(y)<SCR_FIELDY)
 #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)
@@ -1060,73 +1060,84 @@ struct SoundInfo
   boolean loop;
 };
 
-struct SoundActionProperties
+struct ElementActionInfo
 {
-  char *text;
+  char *suffix;
+  int value;
+  boolean is_loop_sound;
+};
+
+struct ElementDirectionInfo
+{
+  char *suffix;
   int value;
-  boolean is_loop;
 };
 
 
 #if 0
-extern GC              tile_clip_gc;
-extern Bitmap         *pix[];
+extern GC                      tile_clip_gc;
+extern Bitmap                 *pix[];
 #endif
-extern Bitmap         *bitmap_db_field, *bitmap_db_door;
-extern Pixmap          tile_clipmask[];
-extern DrawBuffer      *fieldbuffer;
-extern DrawBuffer      *drawto_field;
-
-extern int             game_status;
-extern boolean         level_editor_test_game;
-extern boolean         network_playing;
-
-extern int             key_joystick_mapping;
-
-extern boolean         redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
-extern int             redraw_x1, redraw_y1;
-
-extern short           Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short           Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short           MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short           MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short           MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short           Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short           Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short           StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern boolean         Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern short           JustStopped[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-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   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];
-
-extern int             lev_fieldx,lev_fieldy, scroll_x,scroll_y;
-
-extern int             FX,FY, ScrollStepSize;
-extern int             ScreenMovDir, ScreenMovPos, ScreenGfxPos;
-extern int             BorderElement;
-extern int             GameFrameDelay;
-extern int             FfwdFrameDelay;
-extern int             BX1,BY1, BX2,BY2;
-extern int             SBX_Left, SBX_Right;
-extern int             SBY_Upper, SBY_Lower;
-extern int             ZX,ZY, ExitX,ExitY;
-extern int             AllPlayersGone;
-
-extern int             TimeFrames, TimePlayed, TimeLeft;
-extern boolean         SiebAktiv;
-extern int             SiebCount;
-
-extern boolean         network_player_action_received;
-
-extern int             graphics_action_mapping[];
+extern Bitmap                 *bitmap_db_field, *bitmap_db_door;
+extern Pixmap                  tile_clipmask[];
+extern DrawBuffer            *fieldbuffer;
+extern DrawBuffer            *drawto_field;
+
+extern int                     game_status;
+extern boolean                 level_editor_test_game;
+extern boolean                 network_playing;
+
+extern int                     key_joystick_mapping;
+
+extern boolean                 redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
+extern int                     redraw_x1, redraw_y1;
+
+extern short                   Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short                   Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short                   MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short                   MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short                   MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short                   Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short                   Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short                   StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern boolean                 Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short                   JustStopped[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short                   AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short                   AmoebaCnt[MAX_NUM_AMOEBA];
+extern short                   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           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];
+
+extern int                     lev_fieldx, lev_fieldy;
+extern int                     scroll_x, scroll_y;
+
+extern int                     FX, FY;
+extern int                     ScrollStepSize;
+extern int                     ScreenMovDir, ScreenMovPos, ScreenGfxPos;
+extern int                     BorderElement;
+extern int                     GameFrameDelay;
+extern int                     FfwdFrameDelay;
+extern int                     BX1, BY1;
+extern int                     BX2, BY2;
+extern int                     SBX_Left, SBX_Right;
+extern int                     SBY_Upper, SBY_Lower;
+extern int                     ZX, ZY;
+extern int                     ExitX, ExitY;
+extern int                     AllPlayersGone;
+
+extern int                     TimeFrames, TimePlayed, TimeLeft;
+extern boolean                 SiebAktiv;
+extern int                     SiebCount;
+
+extern boolean                 network_player_action_received;
+
+extern int                     graphics_action_mapping[];
 
 extern struct LevelInfo                level;
 extern struct PlayerInfo       stored_player[], *local_player;
@@ -1135,9 +1146,10 @@ extern struct TapeInfo           tape;
 extern struct GameInfo         game;
 extern struct GlobalInfo       global;
 extern struct ElementInfo      element_info[];
+extern struct ElementActionInfo        element_action_info[];
+extern struct ElementDirectionInfo element_direction_info[];
 extern struct GraphicInfo      graphic_info[];
 extern struct SoundInfo                sound_info[];
-extern struct SoundActionProperties sound_action_properties[];
 extern struct ConfigInfo       image_config[], sound_config[];
 extern struct ConfigInfo       image_config_suffix[], sound_config_suffix[];
 extern struct FileInfo        *image_files, *sound_files;