X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=f4a7f1aec7ed0cf9df4c4c3482a81c48c79c2714;hb=1446af0fb66276d75bd2ce82d368292283e555aa;hp=bb185774acfe6c4ee98d5f7fee174c67b45b6239;hpb=e0e2697df0d0da483a91b1248c120aef6b3caf9b;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index bb185774..f4a7f1ae 100644 --- a/src/init.c +++ b/src/init.c @@ -23,7 +23,23 @@ #include "files.h" #include "network.h" #include "netserv.h" +#include "cartoons.h" +static char *image_filename[NUM_PICTURES] = +{ + "RocksScreen.pcx", + "RocksDoor.pcx", + "RocksHeroes.pcx", + "RocksToons.pcx", + "RocksSP.pcx", + "RocksDC.pcx", + "RocksMore.pcx", + "RocksFont.pcx", + "RocksFont2.pcx", + "RocksFont3.pcx" +}; + +static void InitSetup(void); static void InitPlayerInfo(void); static void InitLevelInfo(void); static void InitNetworkServer(void); @@ -49,8 +65,9 @@ void OpenAll(void) PROGRAM_TITLE_STRING, WINDOW_TITLE_STRING, ICON_TITLE_STRING, X11_ICON_FILENAME, X11_ICONMASK_FILENAME, MSDOS_POINTER_FILENAME, - COOKIE_PREFIX, GAME_VERSION_ACTUAL); + COOKIE_PREFIX, FILENAME_PREFIX, GAME_VERSION_ACTUAL); + InitSetup(); InitPlayerInfo(); InitCounter(); @@ -71,11 +88,18 @@ void OpenAll(void) InitGadgets(); /* needs to know number of level series */ InitGfxBackground(); + InitToons(); + DrawMainMenu(); InitNetworkServer(); } +void InitSetup() +{ + LoadSetup(); /* global setup info */ +} + void InitPlayerInfo() { int i; @@ -87,8 +111,6 @@ void InitPlayerInfo() stored_player[i].connected = FALSE; local_player->connected = TRUE; - - LoadSetup(); /* global setup info */ } void InitLevelInfo() @@ -144,46 +166,14 @@ void InitSound() StartSoundserver(); } -void InitGfx() +void InitTileClipmasks() { - int i; - #if defined(TARGET_X11) GC copy_clipmask_gc; XGCValues clip_gc_values; unsigned long clip_gc_valuemask; #endif -#if !defined(PLATFORM_MSDOS) - static char *image_filename[NUM_PICTURES] = - { - "RocksScreen.pcx", - "RocksDoor.pcx", - "RocksHeroes.pcx", - "RocksToons.pcx", - "RocksSP.pcx", - "RocksDC.pcx", - "RocksMore.pcx", - "RocksFont.pcx", - "RocksFont2.pcx", - "RocksFont3.pcx" - }; -#else - static char *image_filename[NUM_PICTURES] = - { - "Screen.pcx", - "Door.pcx", - "Heroes.pcx", - "Toons.pcx", - "SP.pcx", - "DC.pcx", - "More.pcx", - "Font.pcx", - "Font2.pcx", - "Font3.pcx" - }; -#endif - #if defined(TARGET_X11_NATIVE) static struct { @@ -238,43 +228,7 @@ void InitGfx() }; #endif - /* initialize some global variables */ - global.frames_per_second = 0; - global.fps_slowdown = FALSE; - global.fps_slowdown_factor = 1; - - /* initialize screen properties */ - InitGfxFieldInfo(SX, SY, SXSIZE, SYSIZE, - REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE); - InitGfxDoor1Info(DX, DY, DXSIZE, DYSIZE); - InitGfxDoor2Info(VX, VY, VXSIZE, VYSIZE); - InitGfxScrollbufferInfo(FXSIZE, FYSIZE); - - /* create additional image buffers for double-buffering */ - pix[PIX_DB_DOOR] = CreateBitmap(3 * DXSIZE, DYSIZE + VYSIZE, DEFAULT_DEPTH); - pix[PIX_DB_FIELD] = CreateBitmap(FXSIZE, FYSIZE, DEFAULT_DEPTH); - - pix[PIX_SMALLFONT] = LoadImage(image_filename[PIX_SMALLFONT]); - InitFontInfo(NULL, NULL, pix[PIX_SMALLFONT]); - - 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); - - for(i=0; i