From 6f7d3ad4d393500b49cae8bb639325c906abde0b Mon Sep 17 00:00:00 2001 From: Vadim Trochinsky Date: Mon, 17 May 2010 00:08:49 +0400 Subject: [PATCH] Read stereo settings to config file, and read them back. Stereo mode now configured as "none" by default --- Source/GameTick.cpp | 24 ++++++++++++++++++++++++ Source/Globals.cpp | 2 +- Source/OpenGL_Windows.cpp | 17 +++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 4a055ad..a8d0c28 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -2861,6 +2861,12 @@ void Game::Tick() opstream << KeyToChar(attackkey); opstream << "\nChat key:\n"; opstream << KeyToChar(chatkey); + opstream << "\nStereoMode:\n"; + opstream << stereomode; + opstream << "\nStereoSeparation:\n"; + opstream << stereoseparation; + opstream << "\nStereoReverse:\n"; + opstream << stereoreverse; opstream.close(); } if(mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==9||mainmenu==13||mainmenu==10||mainmenu==11||mainmenu==100){ @@ -3256,6 +3262,12 @@ void Game::Tick() opstream << KeyToChar(attackkey); opstream << "\nChat key:\n"; opstream << KeyToChar(chatkey); + opstream << "\nStereoMode:\n"; + opstream << stereomode; + opstream << "\nStereoSeparation:\n"; + opstream << stereoseparation; + opstream << "\nStereoReverse:\n"; + opstream << stereoreverse; opstream.close(); if(mainmenu==3&&gameon)mainmenu=2; @@ -3884,6 +3896,12 @@ void Game::Tick() opstream << KeyToChar(attackkey); opstream << "\nChat key:\n"; opstream << KeyToChar(chatkey); + opstream << "\nStereoMode:\n"; + opstream << stereomode; + opstream << "\nStereoSeparation:\n"; + opstream << stereoseparation; + opstream << "\nStereoReverse:\n"; + opstream << stereoreverse; opstream.close(); } } @@ -4319,6 +4337,12 @@ void Game::Tick() opstream << KeyToChar(attackkey); opstream << "\nChat key:\n"; opstream << KeyToChar(chatkey); + opstream << "\nStereoMode:\n"; + opstream << stereomode; + opstream << "\nStereoSeparation:\n"; + opstream << stereoseparation; + opstream << "\nStereoReverse:\n"; + opstream << stereoreverse; opstream.close(); } } diff --git a/Source/Globals.cpp b/Source/Globals.cpp index e0b189d..b360ce0 100644 --- a/Source/Globals.cpp +++ b/Source/Globals.cpp @@ -268,6 +268,6 @@ bool gamestarted = 0; //TextureList textures; -StereoMode stereomode = stereoHorizontalInterlaced; +StereoMode stereomode = stereoNone; float stereoseparation = 0.05; bool stereoreverse = false; \ No newline at end of file diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index ce00050..a2a58c2 100644 --- a/Source/OpenGL_Windows.cpp +++ b/Source/OpenGL_Windows.cpp @@ -703,6 +703,12 @@ Boolean SetUp (Game & game) opstream << KeyToChar(game.attackkey); opstream << "\nChat key:\n"; opstream << KeyToChar(game.chatkey); + opstream << "\nStereoMode:\n"; + opstream << stereomode; + opstream << "\nStereoSeparation:\n"; + opstream << stereoseparation; + opstream << "\nStereoReverse:\n"; + opstream << stereoreverse; opstream.close(); } if(ipstream){ @@ -849,6 +855,17 @@ Boolean SetUp (Game & game) ipstream.ignore(256,'\n'); ipstream >> string; 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; + ipstream.close(); if(detail>2)detail=2; -- 2.39.5