mirror of https://github.com/snes9xgit/snes9x.git
Win32: fix double cg function unloading
This commit is contained in:
parent
2f2d92a9da
commit
9f22745fa5
|
@ -305,6 +305,14 @@ void CDirect3D::DeInitialize()
|
|||
DestroyDrawSurface();
|
||||
SetShader(NULL);
|
||||
|
||||
if(cgContext) {
|
||||
cgDestroyContext(cgContext);
|
||||
cgContext = NULL;
|
||||
}
|
||||
|
||||
if(cgAvailable)
|
||||
cgD3D9SetDevice(NULL);
|
||||
|
||||
if(vertexBuffer) {
|
||||
vertexBuffer->Release();
|
||||
vertexBuffer = NULL;
|
||||
|
@ -320,21 +328,14 @@ void CDirect3D::DeInitialize()
|
|||
pD3D = NULL;
|
||||
}
|
||||
|
||||
if(cgContext) {
|
||||
cgDestroyContext(cgContext);
|
||||
cgContext = NULL;
|
||||
}
|
||||
|
||||
if(cgAvailable)
|
||||
cgD3D9SetDevice(NULL);
|
||||
|
||||
init_done = false;
|
||||
afterRenderWidth = 0;
|
||||
afterRenderHeight = 0;
|
||||
quadTextureSize = 0;
|
||||
fullscreen = false;
|
||||
filterScale = 0;
|
||||
unloadCgLibrary();
|
||||
if(cgAvailable)
|
||||
unloadCgLibrary();
|
||||
cgAvailable = false;
|
||||
}
|
||||
|
||||
|
@ -943,6 +944,10 @@ bool CDirect3D::ResetDevice()
|
|||
//release prior to reset
|
||||
DestroyDrawSurface();
|
||||
|
||||
if(cgAvailable) {
|
||||
cgD3D9SetDevice(NULL);
|
||||
}
|
||||
|
||||
if(effect)
|
||||
effect->OnLostDevice();
|
||||
|
||||
|
@ -975,6 +980,10 @@ bool CDirect3D::ResetDevice()
|
|||
if(effect)
|
||||
effect->OnResetDevice();
|
||||
|
||||
if(cgAvailable) {
|
||||
cgD3D9SetDevice(pDevice);
|
||||
}
|
||||
|
||||
if(GUI.BilinearFilter) {
|
||||
pDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
|
||||
pDevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
|
||||
|
|
|
@ -318,7 +318,8 @@ void COpenGL::DeInitialize()
|
|||
afterRenderHeight = 0;
|
||||
shaderFunctionsLoaded = false;
|
||||
shader_type = OGL_SHADER_NONE;
|
||||
unloadCgLibrary();
|
||||
if(cgAvailable)
|
||||
unloadCgLibrary();
|
||||
cgAvailable = false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue