Fixed saving states in OGL Linux.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1313 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
7a72ed3e4a
commit
3b67df1b45
|
@ -70,8 +70,8 @@ void DoState(PointerWrap &p)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Begin with video plugin, so that it gets a chance to clear it's caches and writeback modified things to RAM
|
// Begin with video plugin, so that it gets a chance to clear it's caches and writeback modified things to RAM
|
||||||
PluginVideo::Video_DoState(p.GetPPtr(), p.GetMode());
|
PluginVideo::Video_DoState(p.GetPPtr(), p.GetMode());
|
||||||
PluginDSP::DSP_DoState(p.GetPPtr(), p.GetMode());
|
PluginDSP::DSP_DoState(p.GetPPtr(), p.GetMode());
|
||||||
PowerPC::DoState(p);
|
PowerPC::DoState(p);
|
||||||
HW::DoState(p);
|
HW::DoState(p);
|
||||||
CoreTiming::DoState(p);
|
CoreTiming::DoState(p);
|
||||||
|
|
|
@ -93,7 +93,8 @@ void BPWritten(int addr, int changes, int newval)
|
||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
glFrontFace(bpmem.genMode.cullmode == 2 ? GL_CCW : GL_CW);
|
glFrontFace(bpmem.genMode.cullmode == 2 ? GL_CCW : GL_CW);
|
||||||
}
|
}
|
||||||
else glDisable(GL_CULL_FACE);
|
else if(glIsEnabled(GL_CULL_FACE) == GL_TRUE)
|
||||||
|
glDisable(GL_CULL_FACE);
|
||||||
|
|
||||||
PixelShaderMngr::SetGenModeChanged();
|
PixelShaderMngr::SetGenModeChanged();
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,15 +108,17 @@ void TextureMngr::TCacheEntry::SetTextureParameters(TexMode0 &newmode)
|
||||||
|
|
||||||
void TextureMngr::TCacheEntry::Destroy()
|
void TextureMngr::TCacheEntry::Destroy()
|
||||||
{
|
{
|
||||||
|
if(!texture)
|
||||||
|
return;
|
||||||
glDeleteTextures(1, &texture);
|
glDeleteTextures(1, &texture);
|
||||||
if (!isRenderTarget) {
|
if (!isRenderTarget) {
|
||||||
if (!g_Config.bSafeTextureCache) {
|
if (!g_Config.bSafeTextureCache) {
|
||||||
u32 *ptr = (u32*)g_VideoInitialize.pGetMemoryPointer(addr + hashoffset * 4);
|
u32 *ptr = (u32*)g_VideoInitialize.pGetMemoryPointer(addr + hashoffset * 4);
|
||||||
if (*ptr == hash)
|
if (*ptr == hash)
|
||||||
*ptr = oldpixel;
|
*ptr = oldpixel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
texture = 0;
|
texture = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextureMngr::Init()
|
void TextureMngr::Init()
|
||||||
|
|
|
@ -228,19 +228,29 @@ void Video_Initialize(SVideoInitialize* _pVideoInitialize)
|
||||||
}
|
}
|
||||||
|
|
||||||
void Video_DoState(unsigned char **ptr, int mode) {
|
void Video_DoState(unsigned char **ptr, int mode) {
|
||||||
|
#ifdef _WIN32
|
||||||
// Clear all caches that touch RAM
|
if (!wglMakeCurrent(hDC,hRC)) {
|
||||||
TextureMngr::Invalidate();
|
PanicAlert("Can't Activate The GL Rendering Context for saving");
|
||||||
// DisplayListManager::Invalidate();
|
return false;
|
||||||
|
}
|
||||||
VertexLoaderManager::MarkAllDirty();
|
#elif defined(OSX64)
|
||||||
|
cocoaGLMakeCurrent(GLWin.cocoaCtx,GLWin.cocoaWin);
|
||||||
PointerWrap p(ptr, mode);
|
#else // Linux
|
||||||
VideoCommon_DoState(p);
|
glXMakeCurrent(GLWin.dpy, GLWin.win, GLWin.ctx);
|
||||||
|
#endif
|
||||||
// Refresh state.
|
|
||||||
if (mode == PointerWrap::MODE_READ)
|
// Clear all caches that touch RAM
|
||||||
BPReload();
|
TextureMngr::Invalidate();
|
||||||
|
// DisplayListManager::Invalidate();
|
||||||
|
|
||||||
|
VertexLoaderManager::MarkAllDirty();
|
||||||
|
|
||||||
|
PointerWrap p(ptr, mode);
|
||||||
|
VideoCommon_DoState(p);
|
||||||
|
|
||||||
|
// Refresh state.
|
||||||
|
if (mode == PointerWrap::MODE_READ)
|
||||||
|
BPReload();
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is called after Video_Initialize() from the Core
|
// This is called after Video_Initialize() from the Core
|
||||||
|
|
Loading…
Reference in New Issue