X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=8393c629d76d5c7adbb5540dbb9cd0942fd16ddd;hb=e788c9b6a44d9f2dea7aa048b48a11b14761229e;hp=e5a1738b4840f59a4b2cc3c31fac267cd4f40d71;hpb=909a0a4d74f274b5c05c16cf595b235aa092fc9a;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index e5a1738b..8393c629 100644 --- a/src/init.c +++ b/src/init.c @@ -45,14 +45,23 @@ static void InitPlayerInfo(void); static void InitLevelInfo(void); static void InitArtworkInfo(void); static void InitNetworkServer(void); +static void InitMixer(void); static void InitSound(void); static void InitGfx(void); static void InitGfxBackground(void); static void InitGadgets(void); static void InitElementProperties(void); +static void Execute_Debug_Command(char *); void OpenAll(void) { + if (options.debug_command) + { + Execute_Debug_Command(options.debug_command); + + exit(0); + } + if (options.serveronly) { #if defined(PLATFORM_UNIX) @@ -74,7 +83,7 @@ void OpenAll(void) InitArtworkInfo(); /* needed before loading gfx, sound & music */ InitCounter(); - InitSound(); + InitMixer(); InitJoysticks(); InitRND(NEW_RANDOMIZE); @@ -89,6 +98,7 @@ void OpenAll(void) InitLevelInfo(); InitGadgets(); /* needs to know number of level series */ + InitSound(); /* needs to know current level directory */ InitGfxBackground(); InitToons(); @@ -151,37 +161,29 @@ void InitNetworkServer() #endif } -void InitSound() +static void InitMixer() { - int i; - OpenAudio(); + InitSoundList(sound_effects, NUM_SOUND_EFFECTS); - for(i=0; iname); + InitReloadMusic(artwork.mus_current->name); } -void InitTileClipmasks() +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; @@ -324,7 +326,7 @@ void FreeTileClipmasks() for(i=0; istored_clip_gc) + if (pix[i] != NULL && pix[i]->stored_clip_gc) { XFreeGC(display, pix[i]->stored_clip_gc); pix[i]->stored_clip_gc = None; @@ -359,11 +361,8 @@ void InitGfx() DrawInitText(WINDOW_TITLE_STRING, 20, FC_YELLOW); DrawInitText(WINDOW_SUBTITLE_STRING, 50, FC_RED); -#if defined(PLATFORM_MSDOS) - DrawInitText(PROGRAM_DOS_PORT_STRING, 210, FC_BLUE); - rest(200); -#endif - DrawInitText("Loading graphics:",120,FC_GREEN); + + DrawInitText("Loading graphics:", 120, FC_GREEN); for(i=0; iname) { - 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; } @@ -1595,13 +1594,31 @@ void InitElementProperties() Elementeigenschaften1[i] |= (EP_BIT_CHAR | EP_BIT_INACTIVE); } +void Execute_Debug_Command(char *command) +{ + if (strcmp(command, "create soundinfo.conf") == 0) + { + int i; + + printf("# You can configure additional/alternative sound effects here\n"); + printf("# (The sounds below are default and therefore commented out.)\n"); + printf("\n"); + + for (i=0; i