]> git.jsancho.org Git - lugaru.git/commitdiff
Add default stereo settings to config file
authorVadim Trochinsky <vadim.trochinsky@gmail.com>
Sun, 16 May 2010 20:48:08 +0000 (00:48 +0400)
committerVadim Trochinsky <vadim.trochinsky@gmail.com>
Sun, 16 May 2010 20:48:08 +0000 (00:48 +0400)
When reading the stereo settings, check if we're at EOF, and if so, don't try to read it.

Data/config.txt
Source/OpenGL_Windows.cpp

index f613b60c8546c89b9f54af5f5734d578b1423453..203c615fadae7c3efd01178c31f47811010558a5 100644 (file)
@@ -69,4 +69,10 @@ q
 Attack key:
 mouse1
 Chat key:
 Attack key:
 mouse1
 Chat key:
-unknown
\ No newline at end of file
+unknown
+StereoMode:
+0
+StereoSeparation:
+0.05
+StereoReverse:
+0
index a2a58c21f3bb0d24be4299f47e73fbee388b81fc..576df7ecafdd761ca1b138d6448a567f9491c6b4 100644 (file)
@@ -857,15 +857,16 @@ Boolean SetUp (Game & game)
                game.chatkey=CharToKey(string);
                ipstream.ignore(256,'\n');
                ipstream.ignore(256,'\n');
                game.chatkey=CharToKey(string);
                ipstream.ignore(256,'\n');
                ipstream.ignore(256,'\n');
-               ipstream >> i;
-               stereomode = (StereoMode)i;
-               ipstream.ignore(256,'\n');
-               ipstream.ignore(256,'\n');
-               ipstream >> stereoseparation;
-               ipstream.ignore(256,'\n');
-               ipstream.ignore(256,'\n');
-               ipstream >> stereoreverse;
-
+               if (!ipstream.eof()) {
+                       ipstream >> i;
+                       stereomode = (StereoMode)i;
+                       ipstream.ignore(256,'\n');
+                       ipstream.ignore(256,'\n');
+                       ipstream >> stereoseparation;
+                       ipstream.ignore(256,'\n');
+                       ipstream.ignore(256,'\n');
+                       ipstream >> stereoreverse;
+               }
                ipstream.close();
 
                if(detail>2)detail=2;
                ipstream.close();
 
                if(detail>2)detail=2;