X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=04259035c0974130239dba5b7af61c46142cab1b;hb=7b6d9e43fdb99e1923f4a2a401ae60e7b2975bd8;hp=e5a1738b4840f59a4b2cc3c31fac267cd4f40d71;hpb=909a0a4d74f274b5c05c16cf595b235aa092fc9a;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index e5a1738b..04259035 100644 --- a/src/init.c +++ b/src/init.c @@ -45,6 +45,7 @@ static void InitPlayerInfo(void); static void InitLevelInfo(void); static void InitArtworkInfo(void); static void InitNetworkServer(void); +static void InitSoundServer(void); static void InitSound(void); static void InitGfx(void); static void InitGfxBackground(void); @@ -74,7 +75,7 @@ void OpenAll(void) InitArtworkInfo(); /* needed before loading gfx, sound & music */ InitCounter(); - InitSound(); + InitSoundServer(); InitJoysticks(); InitRND(NEW_RANDOMIZE); @@ -89,6 +90,7 @@ void OpenAll(void) InitLevelInfo(); InitGadgets(); /* needs to know number of level series */ + InitSound(); /* needs to know current level directory */ InitGfxBackground(); InitToons(); @@ -151,37 +153,29 @@ void InitNetworkServer() #endif } -void InitSound() +static void InitSoundServer() { - int i; - OpenAudio(); - - for(i=0; iname); + InitReloadMusic(artwork.mus_current->name); +} + +static void InitTileClipmasks() { #if defined(TARGET_X11) - GC copy_clipmask_gc; XGCValues clip_gc_values; unsigned long clip_gc_valuemask; #if defined(TARGET_X11_NATIVE) + GC copy_clipmask_gc; + static struct { int start; @@ -424,14 +418,14 @@ void ReloadCustomArtwork() if (artwork.sounds_set_current != artwork.snd_current->name) { - printf("reload sounds ...\n"); + InitReloadSounds(artwork.snd_current->name); artwork.sounds_set_current = artwork.snd_current->name; } if (artwork.music_set_current != artwork.mus_current->name) { - printf("reload music ...\n"); + InitReloadMusic(artwork.mus_current->name); artwork.music_set_current = artwork.mus_current->name; } @@ -1600,8 +1594,9 @@ void CloseAllAndExit(int exit_value) int i; StopSounds(); - FreeSounds(NUM_SOUNDS); - CloseAudio(); + FreeAllSounds(); + FreeAllMusic(); + CloseAudio(); /* called after freeing sounds (needed for SDL) */ FreeTileClipmasks(); for(i=0; i