Input-rec: Set git tagged emu version instead of static version.

The static version was set as 1.7.0, not knowing which nightly version the recordings were made on.
This commit is contained in:
lightningterror 2023-12-10 06:17:26 +01:00 committed by Connor McLaughlin
parent 2bfefaf296
commit 5718c3d14d
2 changed files with 9 additions and 3 deletions

View File

@ -22,6 +22,7 @@
#include "common/FileSystem.h"
#include "DebugTools/Debug.h"
#include "MemoryTypes.h"
#include "svnrev.h"
#include "SysForwardDefs.h"
#include <fmt/format.h>
@ -36,8 +37,13 @@ void InputRecordingFile::InputRecordingFileHeader::init() noexcept
void InputRecordingFile::setEmulatorVersion()
{
static const std::string emuVersion = fmt::format("PCSX2-{}.{}.{}", PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo);
strncpy(m_header.m_emulatorVersion, emuVersion.c_str(), sizeof(m_header.m_emulatorVersion) - 1);
std::string emuVersion;
if (!PCSX2_isReleaseVersion && GIT_TAGGED_COMMIT)
emuVersion = fmt::format("PCSX2-Nightly-{}", GIT_TAG);
else
emuVersion = fmt::format("PCSX2-{}.{}.{}", PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo);
StringUtil::Strlcpy(m_header.m_emulatorVersion, emuVersion.c_str(), sizeof(m_header.m_emulatorVersion));
}
void InputRecordingFile::setAuthor(const std::string& _author)

View File

@ -33,7 +33,7 @@ class InputRecordingFile
public:
void init() noexcept;
} m_header;
} m_header = {};
public: