summaryrefslogtreecommitdiffstats
path: root/src/core/Frontend.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-05-01 08:43:35 +0200
committerGitHub <noreply@github.com>2020-05-01 08:43:35 +0200
commit56cb586f153ac741652d5e7e6eac824fed4e81d6 (patch)
tree93ccc935aea105341faf09df9fa8a04b5d13fe7a /src/core/Frontend.cpp
parentRename m_phy_flagA80 to bSkipLineCol (diff)
parentimproved video modes for glfw (diff)
downloadre3-56cb586f153ac741652d5e7e6eac824fed4e81d6.tar
re3-56cb586f153ac741652d5e7e6eac824fed4e81d6.tar.gz
re3-56cb586f153ac741652d5e7e6eac824fed4e81d6.tar.bz2
re3-56cb586f153ac741652d5e7e6eac824fed4e81d6.tar.lz
re3-56cb586f153ac741652d5e7e6eac824fed4e81d6.tar.xz
re3-56cb586f153ac741652d5e7e6eac824fed4e81d6.tar.zst
re3-56cb586f153ac741652d5e7e6eac824fed4e81d6.zip
Diffstat (limited to '')
-rw-r--r--src/core/Frontend.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 64332cb4..97cb21fd 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -3045,7 +3045,24 @@ CMenuManager::LoadSettings()
if (strncmp(Ver, TopLineEmptyFile, sizeof(TopLineEmptyFile) - 1)) {
CFileMgr::Seek(fileHandle, 0, 0);
ControlsManager.LoadSettings(fileHandle);
+#ifdef IMPROVED_VIDEOMODE
+ CFileMgr::Read(fileHandle, (char*)&m_nPrefsWidth, sizeof(m_nPrefsWidth));
+ CFileMgr::Read(fileHandle, (char*)&m_nPrefsHeight, sizeof(m_nPrefsHeight));
+ CFileMgr::Read(fileHandle, (char*)&m_nPrefsDepth, sizeof(m_nPrefsDepth));
+ CFileMgr::Read(fileHandle, (char*)&m_nPrefsWindowed, sizeof(m_nPrefsWindowed));
+ CFileMgr::Read(fileHandle, (char*)&m_nPrefsSubsystem, sizeof(m_nPrefsSubsystem));
+ if(m_nPrefsWindowed != 0 && m_nPrefsWindowed != 1){
+ // garbage data from vanilla settings file
+ // let skeleton find something
+ m_nPrefsWidth = 0;
+ m_nPrefsHeight = 0;
+ m_nPrefsDepth = 0;
+ m_nPrefsWindowed = 0;
+ m_nPrefsSubsystem = 0;
+ }
+#else
CFileMgr::Read(fileHandle, gString, 20);
+#endif
CFileMgr::Read(fileHandle, gString, 20);
CFileMgr::Read(fileHandle, gString, 4);
CFileMgr::Read(fileHandle, gString, 4);
@@ -3127,7 +3144,15 @@ CMenuManager::SaveSettings()
int fileHandle = CFileMgr::OpenFile("gta3.set", "w+");
if (fileHandle) {
ControlsManager.SaveSettings(fileHandle);
+#ifdef IMPROVED_VIDEOMODE
+ CFileMgr::Write(fileHandle, (char*)&m_nPrefsWidth, sizeof(m_nPrefsWidth));
+ CFileMgr::Write(fileHandle, (char*)&m_nPrefsHeight, sizeof(m_nPrefsHeight));
+ CFileMgr::Write(fileHandle, (char*)&m_nPrefsDepth, sizeof(m_nPrefsDepth));
+ CFileMgr::Write(fileHandle, (char*)&m_nPrefsWindowed, sizeof(m_nPrefsWindowed));
+ CFileMgr::Write(fileHandle, (char*)&m_nPrefsSubsystem, sizeof(m_nPrefsSubsystem));
+#else
CFileMgr::Write(fileHandle, RubbishString, 20);
+#endif
CFileMgr::Write(fileHandle, RubbishString, 20);
CFileMgr::Write(fileHandle, RubbishString, 4);
CFileMgr::Write(fileHandle, RubbishString, 4);