From: Vadim Trochinsky Date: Sun, 16 May 2010 20:48:08 +0000 (+0400) Subject: Add default stereo settings to config file X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=440a61a70a5eb14dea5d26aa7cd050e0a3e0e069;p=lugaru.git Add default stereo settings to config file When reading the stereo settings, check if we're at EOF, and if so, don't try to read it. --- diff --git a/Data/config.txt b/Data/config.txt index f613b60..203c615 100644 --- a/Data/config.txt +++ b/Data/config.txt @@ -69,4 +69,10 @@ q Attack key: mouse1 Chat key: -unknown \ No newline at end of file +unknown +StereoMode: +0 +StereoSeparation: +0.05 +StereoReverse: +0 diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index a2a58c2..576df7e 100644 --- a/Source/OpenGL_Windows.cpp +++ b/Source/OpenGL_Windows.cpp @@ -857,15 +857,16 @@ Boolean SetUp (Game & game) 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;