mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Merge pull request #3782 from lioncash/stable-bool
ChunkFile: Handle bool in a stable way across platforms
This commit is contained in:
@ -213,6 +213,20 @@ public:
|
|||||||
DoVoid((void*)&x, sizeof(x));
|
DoVoid((void*)&x, sizeof(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Do(bool& x)
|
||||||
|
{
|
||||||
|
// bool's size can vary depending on platform, which can
|
||||||
|
// cause breakages. This treats all bools as if they were
|
||||||
|
// 8 bits in size.
|
||||||
|
u8 stable = static_cast<u8>(x);
|
||||||
|
|
||||||
|
Do(stable);
|
||||||
|
|
||||||
|
if (mode == MODE_READ)
|
||||||
|
x = stable != 0;
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void DoPointer(T*& x, T* const base)
|
void DoPointer(T*& x, T* const base)
|
||||||
{
|
{
|
||||||
|
@ -71,7 +71,7 @@ static Common::Event g_compressAndDumpStateSyncEvent;
|
|||||||
static std::thread g_save_thread;
|
static std::thread g_save_thread;
|
||||||
|
|
||||||
// Don't forget to increase this after doing changes on the savestate system
|
// Don't forget to increase this after doing changes on the savestate system
|
||||||
static const u32 STATE_VERSION = 53; // Last changed in PR 3759
|
static const u32 STATE_VERSION = 54; // Last changed in PR 3782
|
||||||
|
|
||||||
// Maps savestate versions to Dolphin versions.
|
// Maps savestate versions to Dolphin versions.
|
||||||
// Versions after 42 don't need to be added to this list,
|
// Versions after 42 don't need to be added to this list,
|
||||||
|
Reference in New Issue
Block a user