X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Finit.c;h=8032ffb3d82bd798bd690dea25364937cdc4c3a8;hp=ec0a1c74a26369bf9e7361bc3b3c063552ce73a8;hb=c3d03cdffce070695ba0520d00667b42b8460087;hpb=d0893e6987c21c25ec137438a18cfe1288362139 diff --git a/src/init.c b/src/init.c index ec0a1c74..8032ffb3 100644 --- a/src/init.c +++ b/src/init.c @@ -10,27 +10,20 @@ * q99492@pbhrzx.uni-paderborn.de * *----------------------------------------------------------* * init.c * -* * -* Letzte Aenderung: 15.06.1995 * ***********************************************************/ #include "init.h" -#include "images.h" +#include "misc.h" #include "sound.h" #include "screens.h" -#include "tools.h" -#include "game.h" -#include "misc.h" - +#include "files.h" #include -int sound_process_id=0; +static int sound_process_id = 0; void OpenAll(int argc, char *argv[]) { - LoadLevelInfo(); - LoadPlayerInfo(PLAYER_SETUP); - LoadPlayerInfo(PLAYER_LEVEL); + InitLevelAndPlayerInfo(); InitCounter(); InitSound(); @@ -44,6 +37,7 @@ void OpenAll(int argc, char *argv[]) InitDisplay(argc, argv); InitWindow(argc, argv); InitGfx(); + InitElementProperties(); DrawMainMenu(); @@ -51,6 +45,15 @@ void OpenAll(int argc, char *argv[]) XFlush(display); } +void InitLevelAndPlayerInfo() +{ + if (!LoadLevelInfo()) /* global level info */ + CloseAll(); + + LoadPlayerInfo(PLAYER_SETUP); /* global setup info */ + LoadPlayerInfo(PLAYER_LEVEL); /* level specific info */ +} + void InitSound() { int i; @@ -124,7 +127,7 @@ void InitJoystick() if (access(joystick_device_name[joystick_nr],R_OK)<0) { fprintf(stderr,"%s: cannot access joystick device '%s'\n", - joystick_device_name[joystick_nr],progname); + progname,joystick_device_name[joystick_nr]); joystick_status = JOYSTICK_OFF; return; } @@ -132,7 +135,7 @@ void InitJoystick() if ((joystick_device=open(joystick_device_name[joystick_nr],O_RDONLY))<0) { fprintf(stderr,"%s: cannot open joystick device '%s'\n", - joystick_device_name[joystick_nr],progname); + progname,joystick_device_name[joystick_nr]); joystick_status = JOYSTICK_OFF; return; } @@ -191,6 +194,11 @@ void InitWindow(int argc, char *argv[]) char *window_name = "Rocks'n'Diamonds"; char *icon_name = "Rocks'n'Diamonds"; long window_event_mask; + static struct PictureFile icon_pic = + { + "rocks_icon.xbm", + "rocks_iconmask.xbm" + }; width = WIN_XSIZE; height = WIN_YSIZE; @@ -282,6 +290,15 @@ void InitGfx() char filename[256]; Pixmap shapemask; + static struct PictureFile pic[NUM_PICTURES] = + { + "RocksScreen.xpm", "RocksScreenMaske.xbm", + "RocksDoor.xpm", "RocksDoorMaske.xbm", + "RocksToons.xpm", "RocksToonsMaske.xbm", + "RocksFont.xpm", NULL, + "RocksFont2.xpm", NULL + }; + for(i=0;i