SavegameData RAM usage reduced

This commit is contained in:
Rafael 2016-04-06 04:52:45 +02:00
parent a27e699cac
commit 443f90fbc9
2 changed files with 3 additions and 3 deletions

View file

@ -26,7 +26,7 @@ SavegameData::SavegameData(const QString &fileName, QObject *parent) : QObject(p
{ {
// PARSE INT INIT - DO NOT CHANGE THIS VALUES // PARSE INT INIT - DO NOT CHANGE THIS VALUES
savegameHeaderLength = 260; savegameHeaderLength = 260;
verificationValue = QString::fromLatin1("00000001"); verificationValue = QByteArray::fromHex("00000001");
// INIT SAVEGAME // INIT SAVEGAME
savegameStr = ""; savegameStr = "";
@ -57,7 +57,7 @@ bool SavegameData::readingSavegame()
return false; return false;
} }
QByteArray savegameHeaderLine = saveFile->read(savegameHeaderLength); QByteArray savegameHeaderLine = saveFile->read(savegameHeaderLength);
if (QString::fromLatin1(savegameHeaderLine.left(4).toHex()) == verificationValue) if (savegameHeaderLine.left(4) == verificationValue)
{ {
savegameStr = getSavegameDataString(savegameHeaderLine); savegameStr = getSavegameDataString(savegameHeaderLine);
if (savegameStr.length() >= 1) if (savegameStr.length() >= 1)

View file

@ -41,7 +41,7 @@ private:
bool savegameOk; bool savegameOk;
// PARSE INT // PARSE INT
QString verificationValue; QByteArray verificationValue;
int savegameHeaderLength; int savegameHeaderLength;
}; };