X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=763ed518dd35ff6d894eef70f03c31a40a5f23a4;hb=93c45991646f65be9d8c3ff07c132e2ebb2c12b4;hp=04259035c0974130239dba5b7af61c46142cab1b;hpb=7b6d9e43fdb99e1923f4a2a401ae60e7b2975bd8;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 04259035..763ed518 100644 --- a/src/init.c +++ b/src/init.c @@ -44,16 +44,25 @@ static void InitSetup(void); static void InitPlayerInfo(void); static void InitLevelInfo(void); static void InitArtworkInfo(void); +static void InitLevelArtworkInfo(void); static void InitNetworkServer(void); -static void InitSoundServer(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) @@ -75,7 +84,7 @@ void OpenAll(void) InitArtworkInfo(); /* needed before loading gfx, sound & music */ InitCounter(); - InitSoundServer(); + InitMixer(); InitJoysticks(); InitRND(NEW_RANDOMIZE); @@ -89,12 +98,15 @@ void OpenAll(void) InitElementProperties(); /* initializes IS_CHAR() for el2gfx() */ InitLevelInfo(); + InitLevelArtworkInfo(); InitGadgets(); /* needs to know number of level series */ InitSound(); /* needs to know current level directory */ InitGfxBackground(); InitToons(); + InitGameEngine(); + DrawMainMenu(); InitNetworkServer(); @@ -130,6 +142,11 @@ void InitArtworkInfo() LoadArtworkInfo(); } +void InitLevelArtworkInfo() +{ + LoadLevelArtworkInfo(); +} + void InitNetworkServer() { #if defined(PLATFORM_UNIX) @@ -153,12 +170,12 @@ void InitNetworkServer() #endif } -static void InitSoundServer() +static void InitMixer() { OpenAudio(); InitSoundList(sound_effects, NUM_SOUND_EFFECTS); - StartSoundserver(); + StartMixer(); } static void InitSound() @@ -318,7 +335,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; @@ -353,11 +370,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; i