rnd-20020514-1-src
authorHolger Schemel <info@artsoft.org>
Tue, 14 May 2002 00:30:45 +0000 (02:30 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:37:39 +0000 (10:37 +0200)
src/game.c
src/libgame/sound.c
src/main.c
src/timestamp.h

index 417d00f9b34caaf1b84c9a94bdd7b30194061441..0312c695cccb3ba28d2a893c667d9ecadd79b058 100644 (file)
@@ -76,6 +76,7 @@
 #define DX_TIME                        (DX + XX_TIME)
 #define DY_TIME                        (DY + YY_TIME)
 
+#if 0
 #define IS_LOOP_SOUND(s)       ((s) == SND_BD_MAGIC_WALL_RUNNING ||    \
                                 (s) == SND_BD_BUTTERFLY_MOVING ||      \
                                 (s) == SND_BD_FIREFLY_MOVING ||        \
@@ -98,6 +99,7 @@
                                 (s) == SND_PIG_MOVING ||       \
                                 (s) == SND_DRAGON_MOVING ||    \
                                 (s) == SND_DRAGON_BREATHING_FIRE)
+#endif
 
 /* values for player movement speed (which is in fact a delay value) */
 #define MOVE_DELAY_NORMAL_SPEED        8
@@ -128,6 +130,36 @@ static void HandleGameButtons(struct GadgetInfo *);
 
 static struct GadgetInfo *game_gadget[NUM_GAME_BUTTONS];
 
+static boolean is_loop_sound[NUM_SOUND_EFFECTS];
+static boolean is_loop_sound_initialized = FALSE;
+static int loop_sounds[] =
+{
+  SND_BD_MAGIC_WALL_RUNNING,
+  SND_BD_BUTTERFLY_MOVING,
+  SND_BD_FIREFLY_MOVING,
+  SND_SP_SNIKSNAK_MOVING,
+  SND_SP_ELECTRON_MOVING,
+  SND_DYNAMITE_BURNING,
+  SND_BUG_MOVING,
+  SND_SPACESHIP_MOVING,
+  SND_YAMYAM_MOVING,
+  SND_YAMYAM_WAITING,
+  SND_ROBOT_WHEEL_RUNNING,
+  SND_MAGIC_WALL_RUNNING,
+  SND_BALLOON_MOVING,
+  SND_MOLE_MOVING,
+  SND_TIMEGATE_WHEEL_RUNNING,
+  SND_CONVEYOR_BELT_RUNNING,
+  SND_DYNABOMB_BURNING,
+  SND_PACMAN_MOVING,
+  SND_PENGUIN_MOVING,
+  SND_PIG_MOVING,
+  SND_DRAGON_MOVING,
+  SND_DRAGON_BREATHING_FIRE
+};
+
+#define IS_LOOP_SOUND(x)       (is_loop_sound[x])
+
 
 
 #ifdef DEBUG
@@ -721,6 +753,20 @@ void InitGame()
     }
   }
 
+  /* initialize sound effect properties */
+  if (!is_loop_sound_initialized)
+  {
+    int i;
+
+    for (i=0; i<NUM_SOUND_EFFECTS; i++)
+      is_loop_sound[i] = FALSE;
+
+    for (i=0; i<SIZEOF_ARRAY_INT(loop_sounds); i++)
+      is_loop_sound[loop_sounds[i]] = TRUE;
+
+    is_loop_sound_initialized = TRUE;
+  }
+
   game.version = (tape.playing ? tape.game_version : level.game_version);
   game.emulation = (emulate_bd ? EMU_BOULDERDASH :
                    emulate_sb ? EMU_SOKOBAN :
index 048829f579247e404b95d3e8f9ae7c1236d7acd6..00919d38b9ef604cd384fe06c22628170a9d72fa 100644 (file)
@@ -2091,8 +2091,10 @@ void FreeAllSounds()
   if (Sound == NULL)
     return;
 
+#if 0
   printf("%s: FREEING SOUNDS ...\n",
         IS_CHILD_PROCESS(audio.mixer_pid) ? "CHILD" : "PARENT");
+#endif
 
   for(i=0; i<num_sounds; i++)
     deleteSoundEntry(&Sound[i]);
@@ -2100,8 +2102,10 @@ void FreeAllSounds()
     FreeSound(Sound[i]);
   */
 
+#if 0
   printf("%s: FREEING SOUNDS -- DONE\n",
         IS_CHILD_PROCESS(audio.mixer_pid) ? "CHILD" : "PARENT");
+#endif
 
   free(Sound);
 
index 7c1ac0c525eb6b51e45d74c9611f430f1e86d996..971c97cac31c0d96e38a65efa06d52f157731119 100644 (file)
@@ -136,17 +136,6 @@ char *sound_name[NUM_SOUNDS] =
   "gate.wav"
 };
 
-#if 0
-/* sound effects: setup file identifiers and corresponding default filenames */
-struct SoundEffectInfo sound_effects[NUM_SOUND_EFFECTS] =
-{
-  { "infotron_collecting",             "infotron.wav"          }, /* TEST */
-  { "zonk_falling",                    SND_FILE_UNDEFINED      }, /* TEST */
-  { "zonk_pushing",                    "zonkpush.wav"          }, /* TEST */
-  { "player_screaming",                        "autsch.wav"            }  /* TEST */
-};
-#endif
-
 struct SoundEffectInfo sound_effects[] =
 {
   /* sounds for Boulder Dash style elements and actions */
index 757a3a8fc6c432a149aa670cba6431946526d9a4..91e08e56d2e347b75fb0326d074a71233b3c25f4 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2002-05-12 22:43]"
+#define COMPILE_DATE_STRING "[2002-05-13 21:42]"