From 440a61a70a5eb14dea5d26aa7cd050e0a3e0e069 Mon Sep 17 00:00:00 2001 From: Vadim Trochinsky Date: Mon, 17 May 2010 00:48:08 +0400 Subject: [PATCH] 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. --- Data/config.txt | 8 +++++++- Source/OpenGL_Windows.cpp | 19 ++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) 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; -- 2.39.5