DXGL r616 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r615‎ | r616 | r617 >
Date:14:43, 24 September 2015
Author:admin
Status:new
Tags:
Comment:
Fix multi-backbuffer surface flipping.
Modified paths:
  • /ddraw/glDirectDrawSurface.cpp (modified) (history)
  • /ddraw/glRenderer.cpp (modified) (history)

Diff [purge]

Index: ddraw/glDirectDrawSurface.cpp
@@ -410,7 +410,7 @@
411411 for (int i = 0; i < backcount + 1; i++)
412412 {
413413 front->fliplist[i] = surface->texture;
414 - if (i < surface->ddsd.dwBackBufferCount) surface = surface->backbuffer;
 414+ if (i < backcount) surface = surface->backbuffer;
415415 }
416416 }
417417 TRACE_EXIT(23, DD_OK);
Index: ddraw/glRenderer.cpp
@@ -3102,10 +3102,10 @@
31033103 {
31043104 int i, j, k;
31053105 int vsync = 0;
3106 - GLuint tmp = fliplist[0]->id;
3107 - MIPMAP tmp2[15];
 3106+ GLuint tmp;
 3107+ //MIPMAP tmp2[15];
31083108 int mipcount = fliplist[0]->ddsd.dwMipMapCount;
3109 - memcpy(&tmp2, &fliplist[0]->mipmaps, mipcount*sizeof(MIPMAP));
 3109+ //memcpy(&tmp2, &fliplist[0]->mipmaps, mipcount*sizeof(MIPMAP));
31103110 if (!mipcount) mipcount = 1;
31113111 for (k = 0; k < mipcount; k++)
31123112 {
@@ -3115,6 +3115,7 @@
31163116 }
31173117 for (i = 0; i < flips; i++)
31183118 {
 3119+ tmp = fliplist[0]->id;
31193120 for (j = 0; j < count-1; j++)
31203121 {
31213122 for (k = 0; k < mipcount; k++)
@@ -3126,6 +3127,12 @@
31273128 //memcpy(&fliplist[j]->mipmaps, &fliplist[j + 1]->mipmaps, mipcount*sizeof(MIPMAP));
31283129 fliplist[j]->id = fliplist[j + 1]->id;
31293130 }
 3131+ for (k = 0; k < mipcount; k++)
 3132+ {
 3133+ if (fliplist[count - 1]->mipmaps[k].dirty & 1)
 3134+ glTexture__Upload(fliplist[count - 1], k, FALSE, FALSE);
 3135+ fliplist[count - 1]->mipmaps[k].dirty |= 2;
 3136+ }
31303137 fliplist[count - 1]->id = tmp;
31313138 //memcpy(&fliplist[count - 1]->mipmaps, &tmp2, mipcount*sizeof(MIPMAP));
31323139 }