X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FSettings.cpp;h=284baf47fee87a90e732d7ed37a4ef72ef07e737;hb=e4c69ab5c1d15cdb4a909de8ba8f2057fe6f095d;hp=7e62341d4b70bd1b5b6d4289b20eb19e66fa4455;hpb=735daf95aba0eef54d151daae01285f0959825d0;p=lugaru.git diff --git a/Source/Settings.cpp b/Source/Settings.cpp index 7e62341..284baf4 100644 --- a/Source/Settings.cpp +++ b/Source/Settings.cpp @@ -28,7 +28,7 @@ void DefaultSettings(Game &game) { velocityblur=0; volume = 0.8f; ambientsound=1; - vblsync=0; + vblsync=1; debugmode=0; game.crouchkey=SDLK_LSHIFT; @@ -44,6 +44,12 @@ void DefaultSettings(Game &game) { } void SaveSettings(Game &game) { + if(game.newdetail<0) game.newdetail=0; + if(game.newdetail>2) game.newdetail=2; + if(game.newscreenwidth>3000) game.newscreenwidth=screenwidth; + if(game.newscreenwidth<0) game.newscreenwidth=screenwidth; + if(game.newscreenheight>3000) game.newscreenheight=screenheight; + if(game.newscreenheight<0) game.newscreenheight=screenheight; ofstream opstream(ConvertFileName(":Data:config.txt", "w")); opstream << "Screenwidth:\n"; opstream << game.newscreenwidth; @@ -145,6 +151,7 @@ bool LoadSettings(Game &game) { // skip blank lines // assume lines starting with spaces are all blank if ( strlen(setting) == 0 || setting[0] == ' ' || setting[0] == '\t') continue; + //~ printf("setting : %s\n",setting); if ( ipstream.eof() || ipstream.fail() ) { fprintf(stderr, "Error reading config file: Got setting name '%s', but value can't be read\n", setting);