1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-07 03:13:49 +00:00

Fix crash on loadstate.

This commit is contained in:
Sergey Lipskiy 2014-04-12 22:49:38 +07:00
parent 7166d0aacf
commit bf168bad0c
3 changed files with 8 additions and 2 deletions

View File

@ -145,7 +145,7 @@ void DepthBuffer_Destroy()
while (depthBuffer.bottom)
DepthBuffer_RemoveBottom();
depthBuffer.top = NULL;
depthBuffer.top = depthBuffer.bottom = depthBuffer.current = NULL;
}
void DepthBuffer_SetBuffer( u32 address )

View File

@ -381,8 +381,10 @@ bool OGL_Start()
OGL_InitStates();
TextureCache_Init();
DepthBuffer_Init();
FrameBuffer_Init();
Combiner_Init();
OGL.renderState = GLInfo::rsNone;
gSP.changed = gDP.changed = 0xFFFFFFFF;
OGL_UpdateScale();
@ -395,7 +397,9 @@ void OGL_Stop()
{
Combiner_Destroy();
FrameBuffer_Destroy();
DepthBuffer_Destroy();
TextureCache_Destroy();
OGL.renderState = GLInfo::rsNone;
#ifdef _WINDOWS
wglMakeCurrent( NULL, NULL );
@ -809,6 +813,8 @@ void OGL_DrawTriangles()
Combiner_UpdateRenderState();
}
combiner.current->compiled->UpdateColors(true);
combiner.current->compiled->UpdateLight(true);
glDrawElements(GL_TRIANGLES, OGL.triangles.num, GL_UNSIGNED_BYTE, OGL.triangles.elements);
OGL.triangles.num = 0;

View File

@ -249,7 +249,7 @@ void RSP_Init()
gDP.loadTile = &gDP.tiles[7];
gSP.textureTile[0] = &gDP.tiles[0];
gSP.textureTile[1] = &gDP.tiles[1];
DepthBuffer_Init();
// DepthBuffer_Init();
GBI_Init();
OGL_Start();
}