From d3da9a67d74836038cb32341870ee246e944ef91 Mon Sep 17 00:00:00 2001 From: hrydgard Date: Sat, 25 Oct 2008 17:09:06 +0000 Subject: [PATCH] savestates work better in Metroid Prime 2 (can jump ingame from intro screens with no graphics corruption) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@962 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/ChunkFile.h | 13 +++++++------ Source/Plugins/Plugin_VideoOGL/Src/BPStructs.h | 1 + Source/Plugins/Plugin_VideoOGL/Src/main.cpp | 5 ++++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Source/Core/Common/Src/ChunkFile.h b/Source/Core/Common/Src/ChunkFile.h index eb31926a48..1e06234bd0 100644 --- a/Source/Core/Common/Src/ChunkFile.h +++ b/Source/Core/Common/Src/ChunkFile.h @@ -80,18 +80,19 @@ public: // TODO PanicAlert("Do(map<>) does not yet work."); } - // Store vectors. + + // Store vectors. template void Do(std::vector &x) { // TODO PanicAlert("Do(vector<>) does not yet work."); } - template - void DoArray(T *x, int count) { - DoVoid((void *)x, sizeof(T) * count); - } - + template + void DoArray(T *x, int count) { + DoVoid((void *)x, sizeof(T) * count); + } + template void Do(T &x) { DoVoid((void *)&x, sizeof(x)); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.h b/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.h index ee38278cd6..b56db6bec9 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.h @@ -22,6 +22,7 @@ void BPInit(); void LoadBPReg(u32 value0); +void BPReload(); void SetColorMask(); bool SetScissorRect(); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp index 1aab16a515..894d269513 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp @@ -204,7 +204,10 @@ void Video_DoState(unsigned char **ptr, int mode) { PointerWrap p(ptr, mode); VideoCommon_DoState(p); - //PanicAlert("Saving/Loading state from OpenGL"); + + // Refresh state. + if (mode == 1) // read + BPReload(); } // This is called after Video_Initialize() from the Core