X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=08069f4afa83dd1d9c217157411b20b15ba3c19d;hb=9c6293f12f9dea224bff9050050253e9f52e3819;hp=0a52cc63033eaf3e247f49abfdc2f7ee60e7d4b8;hpb=ae0910c3223faf69f7638780ff8e49cf08bbb554;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 0a52cc63..08069f4a 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,66 +161,29 @@ void InitNetworkServer() #endif } -static void ReloadCustomSounds() +static void InitMixer() { - int i; - - printf("DEBUG: reloading sounds '%s' [%d] ...\n", - artwork.sounds_set_current, audio.soundserver_pid); - -#if 1 - FreeAllSounds(); - - InitSoundList(NUM_SOUNDS); - for(i=0; iname); InitReloadMusic(artwork.mus_current->name); -#endif } -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; @@ -353,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; @@ -392,7 +365,7 @@ void InitGfx() 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; i