gpu-gles: keep ClientState and texcache ptrs consistent
authornotaz <notasas@gmail.com>
Tue, 17 Jan 2012 00:37:13 +0000 (02:37 +0200)
committernotaz <notasas@gmail.com>
Thu, 19 Jan 2012 21:23:37 +0000 (23:23 +0200)
plugins/gpu-gles/gpuExternals.h
plugins/gpu-gles/gpuPlugin.c
plugins/gpu-gles/gpuTexture.c

index f88b37b..897b446 100644 (file)
@@ -364,6 +364,10 @@ extern short sxmax;
 extern short symin;\r
 extern short symax;\r
 \r
+extern unsigned int CSVERTEX;\r
+extern unsigned int CSCOLOR;\r
+extern unsigned int CSTEXTURE;\r
+\r
 #endif\r
 \r
 //-----------------------------------------------------//\r
index 45a0b92..9d749a5 100644 (file)
@@ -506,6 +506,8 @@ long CALLBACK GPUopen(int hwndGPU)
 \r
  InitializeTextureStore();                             // init texture mem\r
 \r
+ CSTEXTURE = CSVERTEX = CSCOLOR = 0;\r
+\r
 // lGPUstatusRet = 0x74000000;\r
 \r
 // with some emus, we could do the OGL init right here... oh my\r
index 264458e..2f96482 100644 (file)
@@ -612,6 +612,7 @@ void CleanupTextureStore()
   for(j=0;j<MAXTPAGES;j++)                           // loop tex pages\r
    {\r
     free(pscSubtexStore[i][j]);                      // -> clean mem\r
+    pscSubtexStore[i][j]=0;\r
    }\r
  for(i=0;i<MAXSORTTEX;i++)\r
   {\r
@@ -622,6 +623,7 @@ void CleanupTextureStore()
      uiStexturePage[i]=0;                            // --> delete it\r
     }\r
    free(pxSsubtexLeft[i]);                           // -> clean mem\r
+   pxSsubtexLeft[i]=0;\r
   }\r
  //----------------------------------------------------//\r
 }\r