rnd-20020914-1-src
[rocksndiamonds.git] / src / game.c
index 4fc13171be985a7b7d2724a7411909d99f424562..a5620a017b0852734cf7f4998af10fabf0c098a9 100644 (file)
@@ -153,7 +153,7 @@ static struct
   { NULL,              0,                      0 },
 };
 static int element_action_sound[NUM_LEVEL_ELEMENTS][NUM_SND_ACTIONS];
-static boolean is_loop_sound[NUM_SOUND_EFFECTS];
+static boolean is_loop_sound[NUM_SOUND_FILES];
 
 #define IS_LOOP_SOUND(x)       (is_loop_sound[x])
 
@@ -507,7 +507,7 @@ void DrawGameDoorValues()
 
 void InitGameSound()
 {
-  int sound_effect_properties[NUM_SOUND_EFFECTS];
+  int sound_effect_properties[NUM_SOUND_FILES];
   int i, j;
 
 #if 0
@@ -518,22 +518,21 @@ void InitGameSound()
     for (j=0; j<NUM_LEVEL_ELEMENTS; j++)
       element_action_sound[j][i] = -1;
 
-  for (i=0; i<NUM_SOUND_EFFECTS; i++)
+  for (i=0; i<NUM_SOUND_FILES; i++)
   {
-    int len_effect_text = strlen(sound_effects[i].text);
+    int len_effect_text = strlen(sound_files[i].token);
 
     sound_effect_properties[i] = SND_ACTION_UNKNOWN;
     is_loop_sound[i] = FALSE;
 
     /* determine all loop sounds and identify certain sound classes */
 
-    j = 0;
-    while (sound_action_properties[j].text)
+    for (j=0; sound_action_properties[j].text; j++)
     {
       int len_action_text = strlen(sound_action_properties[j].text);
 
       if (len_action_text < len_effect_text &&
-         strcmp(&sound_effects[i].text[len_effect_text - len_action_text],
+         strcmp(&sound_files[i].token[len_effect_text - len_action_text],
                 sound_action_properties[j].text) == 0)
       {
        sound_effect_properties[i] = sound_action_properties[j].value;
@@ -541,8 +540,6 @@ void InitGameSound()
        if (sound_action_properties[j].is_loop)
          is_loop_sound[i] = TRUE;
       }
-
-      j++;
     }
 
     /* associate elements and some selected sound actions */
@@ -554,9 +551,9 @@ void InitGameSound()
        int len_class_text = strlen(element_info[j].sound_class_name);
 
        if (len_class_text + 1 < len_effect_text &&
-           strncmp(sound_effects[i].text,
+           strncmp(sound_files[i].token,
                    element_info[j].sound_class_name, len_class_text) == 0 &&
-           sound_effects[i].text[len_class_text] == '.')
+           sound_files[i].token[len_class_text] == '.')
        {
          int sound_action_value = sound_effect_properties[i];
 
@@ -1000,20 +997,12 @@ void InitGame()
 
   OpenDoor(DOOR_OPEN_ALL);
 
-#if 1
-  printf("starting game sound/music...\n");
-#endif
-
   PlaySoundStereo(SND_GAME_STARTING, SOUND_MAX_RIGHT);
   if (setup.sound_music)
     PlayMusic(level_nr);
 
   KeyboardAutoRepeatOff();
 
-#if 1
-  printf("started.\n");
-#endif
-
   if (options.debug)
   {
     for (i=0; i<4; i++)
@@ -3147,7 +3136,11 @@ void StartMoving(int x, int y)
       else if (element == EL_BUTTERFLY || element == EL_FIREFLY)
        DrawGraphicAnimation(x, y, el2gfx(element), 2, 4, ANIM_NORMAL);
       else if (element == EL_SONDE)
+#if 0
        DrawGraphicAnimation(x, y, GFX_SONDE_START, 8, 2, ANIM_NORMAL);
+#else
+       DrawNewGraphicAnimation(x, y, IMG_SATELLITE_MOVING);
+#endif
       else if (element == EL_SP_ELECTRON)
        DrawGraphicAnimation(x, y, GFX2_SP_ELECTRON, 8, 2, ANIM_NORMAL);
 
@@ -3947,7 +3940,7 @@ void AusgangstuerOeffnen(int x, int y)
 
 void AusgangstuerBlinken(int x, int y)
 {
-  DrawGraphicAnimation(x, y, GFX_AUSGANG_AUF, 4, 4, ANIM_OSCILLATE);
+  DrawGraphicAnimation(x, y, GFX_AUSGANG_AUF, 4, 4, ANIM_PINGPONG);
 }
 
 void OpenSwitchgate(int x, int y)
@@ -6490,8 +6483,8 @@ boolean PlaceBomb(struct PlayerInfo *player)
 
 void PlaySoundLevel(int x, int y, int nr)
 {
-  static int loop_sound_frame[NUM_SOUND_EFFECTS];
-  static int loop_sound_volume[NUM_SOUND_EFFECTS];
+  static int loop_sound_frame[NUM_SOUND_FILES];
+  static int loop_sound_volume[NUM_SOUND_FILES];
   int sx = SCREENX(x), sy = SCREENY(y);
   int volume, stereo_position;
   int max_distance = 8;