Commits

Andrey Lesnikov  committed 869276b

ui_sdl: Extructed load_sounds() from init_sound().

  • Participants
  • Parent commits e40820b

Comments (0)

Files changed (1)

 }
 
 static void
+load_sounds (void){
+  sound_rifle      = Mix_LoadWAV("sounds/gunshot.ogg");
+  sound_run        = Mix_LoadWAV("sounds/running.ogg");
+  sound_submachine = Mix_LoadWAV("sounds/machine_gun_triple.ogg");
+  sound_tank_shoot = Mix_LoadWAV("sounds/tank_shot.ogg");
+  sound_music      = Mix_LoadMUS("sounds/music01.ogg");
+}
+
+static void
 init_sound (void){
   int audio_rate = 22050;
   Uint16 audio_format = AUDIO_S16; 
     printf("Unable to open audio!\n");
     exit(1);
   }
-  sound_rifle      = Mix_LoadWAV("sounds/gunshot.ogg");
-  sound_run        = Mix_LoadWAV("sounds/running.ogg");
-  sound_submachine = Mix_LoadWAV("sounds/machine_gun_triple.ogg");
-  sound_tank_shoot = Mix_LoadWAV("sounds/tank_shot.ogg");
-  sound_music      = Mix_LoadMUS("sounds/music01.ogg");
+  load_sounds();
 #if 0 /*не могу больше это слушать*/
   Mix_PlayMusic(sound_music, -1);
 #endif