X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=7a5f5eeb521a651bff36cf587fed803df82831df;hb=2357c391b4a587709627cc30316734b3c83c8134;hp=4a5578e643e3bcc02f2ccc87c6f3b04df1f4d576;hpb=8cef2a63b6c56ba086183693d3f73f02862cbd8f;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 4a5578e6..7a5f5eeb 100644 --- a/src/init.c +++ b/src/init.c @@ -70,7 +70,7 @@ void OpenAll(int argc, char *argv[]) InitCounter(); InitSound(); InitSoundServer(); - InitJoystick(); + InitJoysticks(); InitRND(NEW_RANDOMIZE); signal(SIGINT, CloseAllAndExit); @@ -94,49 +94,22 @@ void InitLevelAndPlayerInfo() { int i; - /* initialize local setup */ - setup.sound_on = TRUE; - setup.sound_loops_on = FALSE; - setup.sound_music_on = FALSE; - setup.sound_simple_on = FALSE; - setup.toons_on = TRUE; - setup.direct_draw_on = FALSE; - setup.scroll_delay_on = FALSE; - setup.soft_scrolling_on = TRUE; - setup.fading_on = FALSE; - setup.autorecord_on = FALSE; - setup.quick_doors = FALSE; - for (i=0; iconnected = TRUE; - local_player->local = TRUE; + + if (!LoadLevelInfo()) /* global level info */ + Error(ERR_EXIT, NULL); + + LoadSetup(); /* global setup info */ + LoadLevelSetup(); /* info about last played level */ } void InitNetworkServer() @@ -151,7 +124,7 @@ void InitNetworkServer() if (!ConnectToServer(options.server_host, options.server_port)) Error(ERR_EXIT, "cannot connect to multiplayer server"); - SendToServer_Nickname(local_player->alias_name); + SendToServer_Nickname(setup.alias_name); SendToServer_ProtocolVersion(); if (nr_wanted) @@ -168,14 +141,14 @@ void InitSound() #ifndef MSDOS if (access(sound_device_name,W_OK)<0) { - Error(ERR_RETURN, "cannot access sound device - no sounds"); + Error(ERR_WARN, "cannot access sound device - no sounds"); sound_status = SOUND_OFF; return; } if ((sound_device = open(sound_device_name,O_WRONLY))<0) { - Error(ERR_RETURN, "cannot open sound device - no sounds"); + Error(ERR_WARN, "cannot open sound device - no sounds"); sound_status = SOUND_OFF; return; } @@ -185,11 +158,19 @@ void InitSound() #ifdef VOXWARE sound_loops_allowed = TRUE; + + /* setup.sound_loops_on = TRUE; + */ + #endif #else sound_loops_allowed = TRUE; + + /* setup.sound_loops_on = TRUE; + */ + #endif for(i=0; i