X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Finit.c;h=dbe878cd7063942f299061ba83186f00eb3b10d5;hp=ae65640f67f152bd51070ef2da3027a9a0a7c10b;hb=c4e1a476135ce36417cdd797481feeaaff4301af;hpb=ae32fd8a4316c5d7f18fe6966f999ebf5509df94 diff --git a/src/init.c b/src/init.c index ae65640f..dbe878cd 100644 --- a/src/init.c +++ b/src/init.c @@ -1,14 +1,14 @@ /*********************************************************** -* Rocks'n'Diamonds -- McDuffin Strikes Back! * +* Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-98 Artsoft Entertainment * -* Holger Schemel * -* Oststrasse 11a * -* 33604 Bielefeld * -* phone: ++49 +521 290471 * -* email: aeglos@valinor.owl.de * +* (c) 1995-2000 Artsoft Entertainment * +* Holger Schemel * +* Detmolder Strasse 189 * +* 33604 Bielefeld * +* Germany * +* e-mail: info@artsoft.org * *----------------------------------------------------------* -* init.c * +* init.c * ***********************************************************/ #include @@ -32,7 +32,6 @@ static void InitLevelInfo(void); static void InitNetworkServer(void); static void InitSound(void); static void InitSoundServer(void); -static void InitDisplay(void); static void InitGfx(void); static void InitGfxBackground(void); static void InitGadgets(void); @@ -40,20 +39,14 @@ static void InitElementProperties(void); void OpenAll(void) { -#if !defined(PLATFORM_UNIX) - initErrorFile(); -#endif - if (options.serveronly) { #if defined(PLATFORM_UNIX) NetworkServer(options.server_port, options.serveronly); #else - Error(ERR_WARN, "networking not supported in Windows version"); + Error(ERR_WARN, "networking only supported in Unix version"); #endif - - /* never reached */ - exit(0); + exit(0); /* never reached */ } InitProgramInfo(UNIX_USERDATA_DIRECTORY, @@ -69,10 +62,10 @@ void OpenAll(void) InitJoysticks(); InitRND(NEW_RANDOMIZE); - signal(SIGINT, CloseAllAndExit); - signal(SIGTERM, CloseAllAndExit); + InitVideoDisplay(); + InitVideoBuffer(&backbuffer, &window, WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH, + setup.fullscreen); - InitDisplay(); InitEventFilter(FilterMouseMotionEvents); InitGfx(); @@ -139,13 +132,11 @@ void InitSound() { int i; - OpenAudio(&audio); - - AllocSoundArray(NUM_SOUNDS); + OpenAudio(); for(i=0; i=0; i++) - { - for(j=0; jformat, 0x00, 0x00, 0x00)); - if ((tile_masked[tile] = SDL_DisplayFormat(sdl_image_tmp)) == NULL) - Error(ERR_EXIT, "SDL_DisplayFormat() failed: %s", SDL_GetError()); - - SDL_FreeSurface(sdl_image_tmp); - - BlitBitmap(src_bitmap, tile_masked[tile], src_x,src_y, TILEX,TILEY, 0,0); - } - } -#endif - -#else /* !TARGET_SDL */ - +#if defined(TARGET_X11) /* create graphic context structures needed for clipping */ clip_gc_values.graphics_exposures = False; clip_gc_valuemask = GCGraphicsExposures; @@ -543,8 +485,7 @@ void InitGfx() src_x, src_y, TILEX, TILEY, 0, 0); } } - -#endif /* !TARGET_SDL */ +#endif /* TARGET_X11 */ } void InitGfxBackground() @@ -1727,40 +1668,22 @@ void CloseAllAndExit(int exit_value) { int i; -#if defined(TARGET_SDL) StopSounds(); FreeSounds(NUM_SOUNDS); -#else + +#if !defined(TARGET_SDL) if (audio.soundserver_pid) - { - StopSounds(); kill(audio.soundserver_pid, SIGTERM); - FreeSounds(NUM_SOUNDS); - } #endif for(i=0; i