mirror of
https://gitlab.com/GaryOderNichts/re3-wiiu.git
synced 2024-11-27 03:24:15 +01:00
Fixed settings loading, added TopLineEmptyFile
This commit is contained in:
parent
d84033a710
commit
74ca8bb608
@ -16,6 +16,7 @@
|
|||||||
#include "ModelIndices.h"
|
#include "ModelIndices.h"
|
||||||
#include "Camera.h"
|
#include "Camera.h"
|
||||||
#include "win.h"
|
#include "win.h"
|
||||||
|
#include "PCSave.h"
|
||||||
|
|
||||||
CControllerConfigManager &ControlsManager = *(CControllerConfigManager*)0x8F43A4;
|
CControllerConfigManager &ControlsManager = *(CControllerConfigManager*)0x8F43A4;
|
||||||
|
|
||||||
@ -75,7 +76,7 @@ void CControllerConfigManager::LoadSettings(int32 file)
|
|||||||
char buff[29];
|
char buff[29];
|
||||||
CFileMgr::Read(file, buff, sizeof(buff));
|
CFileMgr::Read(file, buff, sizeof(buff));
|
||||||
|
|
||||||
if (!strcmp(buff, "THIS FILE IS NOT VALID YET"))
|
if (!strncmp(buff, TopLineEmptyFile, sizeof(TopLineEmptyFile)-1))
|
||||||
bValid = false;
|
bValid = false;
|
||||||
else
|
else
|
||||||
CFileMgr::Seek(file, 0, 0);
|
CFileMgr::Seek(file, 0, 0);
|
||||||
|
@ -1148,12 +1148,12 @@ void CMenuManager::LoadSettings()
|
|||||||
CMBlur::BlurOn = true;
|
CMBlur::BlurOn = true;
|
||||||
MousePointerStateHelper.bInvertVertically = true;
|
MousePointerStateHelper.bInvertVertically = true;
|
||||||
|
|
||||||
static char Ver;
|
char Ver[50];
|
||||||
int fileHandle = CFileMgr::OpenFile("gta3.set", "r");
|
int fileHandle = CFileMgr::OpenFile("gta3.set", "r");
|
||||||
if (fileHandle) {
|
if (fileHandle) {
|
||||||
CFileMgr::Read(fileHandle, (char*)&Ver, sizeof(Ver));
|
CFileMgr::Read(fileHandle, Ver, 29);
|
||||||
|
|
||||||
if (strncmp(&Ver, "THIS FILE IS NOT VALID YET", 26)) {
|
if (strncmp(Ver, TopLineEmptyFile, sizeof(TopLineEmptyFile) - 1)) {
|
||||||
CFileMgr::Seek(fileHandle, 0, 0);
|
CFileMgr::Seek(fileHandle, 0, 0);
|
||||||
ControlsManager.LoadSettings(fileHandle);
|
ControlsManager.LoadSettings(fileHandle);
|
||||||
CFileMgr::Read(fileHandle, gString, 20);
|
CFileMgr::Read(fileHandle, gString, 20);
|
||||||
|
@ -19,3 +19,5 @@ extern C_PcSave PcSaveHelper;
|
|||||||
extern int *Slots;
|
extern int *Slots;
|
||||||
extern int *SlotFileName;
|
extern int *SlotFileName;
|
||||||
extern int *SlotSaveDate;
|
extern int *SlotSaveDate;
|
||||||
|
|
||||||
|
const char TopLineEmptyFile[] = "THIS FILE IS NOT VALID YET";
|
||||||
|
Loading…
Reference in New Issue
Block a user