Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Merge pull request #298 from Sergeanur/save
save
  • Loading branch information
aap committed Jan 31, 2020
2 parents e1e76f5 + 3c550eb commit 8b367e8d18599400b5e5e5b827f191e6bcb5ffb4
@@ -13,6 +13,7 @@ workspace "re3"
files { "src/objects/*.*" }
files { "src/peds/*.*" }
files { "src/render/*.*" }
files { "src/save/*.*" }
files { "src/skel/*.*" }
files { "src/skel/win/*.*" }
files { "src/text/*.*" }
@@ -31,6 +32,7 @@ workspace "re3"
includedirs { "src/objects" }
includedirs { "src/peds" }
includedirs { "src/render" }
includedirs { "src/save/" }
includedirs { "src/skel/" }
includedirs { "src/skel/win" }
includedirs { "src/text" }
@@ -16,7 +16,7 @@
#include "ModelIndices.h"
#include "Camera.h"
#include "win.h"
#include "PCSave.h"
#include "GenericGameStorage.h"

CControllerConfigManager &ControlsManager = *(CControllerConfigManager*)0x8F43A4;

@@ -15,7 +15,7 @@
#include "Streaming.h"
#include "TxdStore.h"
#include "General.h"
#include "PCSave.h"
#include "GenericGameStorage.h"
#include "Script.h"
#include "Camera.h"
#include "MenuScreens.h"
@@ -448,7 +448,7 @@ void CMenuManager::Draw()
str = TheText.Get(aScreens[m_nCurrScreen].m_aEntries[0].m_EntryName);
break;
case MENUPAGE_SAVE_OVERWRITE_CONFIRM:
if (Slots[m_nCurrSaveSlot] == 1)
if (Slots[m_nCurrSaveSlot] == SLOT_EMPTY)
str = TheText.Get("FESZ_QZ");
else
str = TheText.Get(aScreens[m_nCurrScreen].m_aEntries[0].m_EntryName);
@@ -588,7 +588,7 @@ void CMenuManager::Draw()
CFont::SetRightJustifyOff();
textToPrint[MENUCOLUMN_LEFT] = GetNameOfSavedGame(i - 1);

if (Slots[i-1] != 1)
if (Slots[i-1] != SLOT_EMPTY)
textToPrint[MENUCOLUMN_RIGHT] = GetSavedGameDateAndTime(i - 1);

if (textToPrint[MENUCOLUMN_LEFT][0] == '\0') {
@@ -2228,40 +2228,37 @@ void CMenuManager::ResetHelperText()

void CMenuManager::SaveLoadFileError_SetUpErrorScreen()
{
// TO-DO: Enum
switch (PcSaveHelper.m_nHelper) {
case 1:
case 2:
case 3:
switch (PcSaveHelper.nErrorCode) {
case SAVESTATUS_ERR_SAVE_CREATE:
case SAVESTATUS_ERR_SAVE_WRITE:
case SAVESTATUS_ERR_SAVE_CLOSE:
m_nPrevScreen = m_nCurrScreen;
m_nCurrScreen = MENUPAGE_SAVE_FAILED;
m_nCurrOption = 0;
m_nScreenChangeDelayTimer = CTimer::GetTimeInMillisecondsPauseMode();
break;
case 4:
case 5:
case 6:
case SAVESTATUS_ERR_LOAD_OPEN:
case SAVESTATUS_ERR_LOAD_READ:
case SAVESTATUS_ERR_LOAD_CLOSE:
m_nPrevScreen = m_nCurrScreen;
m_nCurrScreen = MENUPAGE_LOAD_FAILED;
m_nCurrOption = 0;
m_nScreenChangeDelayTimer = CTimer::GetTimeInMillisecondsPauseMode();
break;
case 7:
case SAVESTATUS_ERR_DATA_INVALID:
m_nPrevScreen = m_nCurrScreen;
m_nCurrScreen = MENUPAGE_LOAD_FAILED_2;
m_nCurrOption = 0;
m_nScreenChangeDelayTimer = CTimer::GetTimeInMillisecondsPauseMode();
break;
case 8:
case 9:
case 10:
case SAVESTATUS_DELETEFAILED8:
case SAVESTATUS_DELETEFAILED9:
case SAVESTATUS_DELETEFAILED10:
m_nPrevScreen = m_nCurrScreen;
m_nCurrScreen = MENUPAGE_DELETE_FAILED;
m_nCurrOption = 0;
m_nScreenChangeDelayTimer = CTimer::GetTimeInMillisecondsPauseMode();
break;
default:
return;
}
}

This file was deleted.

This file was deleted.

@@ -19,6 +19,8 @@ extern wchar *gUString2;
extern bool &b_FoundRecentSavedGameWantToLoad;
extern bool gbPrintShite;
extern bool &gbModelViewer;
extern bool &StillToFadeOut;
extern bool &JustLoadedDontFadeInYet;

class CSprite2d;

@@ -0,0 +1,91 @@
#include "common.h"
#include "Date.h"

CDate::CDate()
{
m_nYear = 0;
m_nSecond = 0;
m_nMinute = 0;
m_nHour = 0;
m_nDay = 0;
m_nMonth = 0;
}

bool
CDate::operator>(const CDate &right)
{
if (m_nYear > right.m_nYear)
return true;
if (m_nYear != right.m_nYear)
return false;

if (m_nMonth > right.m_nMonth)
return true;
if (m_nMonth != right.m_nMonth)
return false;

if (m_nDay > right.m_nDay)
return true;
if (m_nDay != right.m_nDay)
return false;

if (m_nHour > right.m_nHour)
return true;
if (m_nHour != right.m_nHour)
return false;

if (m_nMinute > right.m_nMinute)
return true;
if (m_nMinute != right.m_nMinute)
return false;
return m_nSecond > right.m_nSecond;
}

bool
CDate::operator<(const CDate &right)
{
if (m_nYear < right.m_nYear)
return true;
if (m_nYear != right.m_nYear)
return false;

if (m_nMonth < right.m_nMonth)
return true;
if (m_nMonth != right.m_nMonth)
return false;

if (m_nDay < right.m_nDay)
return true;
if (m_nDay != right.m_nDay)
return false;

if (m_nHour < right.m_nHour)
return true;
if (m_nHour != right.m_nHour)
return false;

if (m_nMinute < right.m_nMinute)
return true;
if (m_nMinute != right.m_nMinute)
return false;
return m_nSecond < right.m_nSecond;
}

bool
CDate::operator==(const CDate &right)
{
if (m_nYear != right.m_nYear || m_nMonth != right.m_nMonth || m_nDay != right.m_nDay || m_nHour != right.m_nHour || m_nMinute != right.m_nMinute)
return false;
return m_nSecond == right.m_nSecond;
}

void
CDate::PopulateDateFields(int8 &second, int8 &minute, int8 &hour, int8 &day, int8 &month, int16 year)
{
m_nSecond = second;
m_nMinute = minute;
m_nHour = hour;
m_nDay = day;
m_nMonth = month;
m_nYear = year;
}
@@ -0,0 +1,18 @@
#pragma once

class CDate
{
public:
int m_nSecond;
int m_nMinute;
int m_nHour;
int m_nDay;
int m_nMonth;
int m_nYear;

CDate();
bool operator>(const CDate &right);
bool operator<(const CDate &right);
bool operator==(const CDate &right);
void PopulateDateFields(int8 &second, int8 &minute, int8 &hour, int8 &day, int8 &month, int16 year);
};

0 comments on commit 8b367e8

Please sign in to comment.