DXGL r219 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r218‎ | r219 | r220 >
Date:21:01, 24 July 2012
Author:admin
Status:new
Tags:
Comment:
Fix locking surfaces multiple times before blitting.
Modified paths:
  • /ddraw/glDirectDrawSurface.cpp (modified) (history)
  • /dxgltest/Tests3D.cpp (modified) (history)
  • /dxgltest/dxgltest.cpp (modified) (history)

Diff [purge]

Index: ddraw/glDirectDrawSurface.cpp
@@ -932,6 +932,7 @@
933933 renderer->DownloadTexture(buffer,bigbuffer,texture,ddsd.dwWidth,ddsd.dwHeight,fakex,fakey,ddsd.lPitch,
934934 (ddInterface->GetBPPMultipleOf8()/8)*fakex,ddsd.ddpfPixelFormat.dwRGBBitCount,texformat,texformat2);
935935 ddsd.lpSurface = buffer;
 936+ dirty &= ~2;
936937 break;
937938 case 1:
938939 FIXME("glDirectDrawSurface7::Lock: surface type 1 not supported yet");
Index: dxgltest/Tests3D.cpp
@@ -44,7 +44,7 @@
4545 static HWND hWnd;
4646 static int testnum;
4747 static unsigned int randnum;
48 -static int testtypes[] = {0,0};
 48+static int testtypes[] = {0,0,0};
4949
5050 static D3DVECTOR points[256];
5151 static D3DVECTOR normals[256];
@@ -192,9 +192,16 @@
193193 return D3DENUMRET_OK;
194194 }
195195
 196+INT_PTR CALLBACK TexShader7Proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
 197+
196198 void RunTest3D(int testnum, int width, int height, int bpp, int refresh, int backbuffers, int apiver,
197199 int filter, int msaa, double fps, bool fullscreen, bool resizable)
198200 {
 201+ if(testnum == 2)
 202+ {
 203+ DialogBox(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_TEXSHADER),NULL,TexShader7Proc);
 204+ return;
 205+ }
199206 DDSCAPS2 caps;
200207 DDSURFACEDESC2 ddsd;
201208 DDPIXELFORMAT ddpfz;
@@ -623,3 +630,22 @@
624631 void RunTestLooped3D(int test)
625632 {
626633 }
 634+
 635+
 636+INT_PTR CALLBACK TexShader7Proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 637+{
 638+ switch(Msg)
 639+ {
 640+ case WM_INITDIALOG:
 641+
 642+ break;
 643+ case WM_CLOSE:
 644+ EndDialog(hWnd,IDCANCEL);
 645+ break;
 646+ default:
 647+ return FALSE;
 648+ }
 649+ return TRUE;
 650+
 651+
 652+}
Index: dxgltest/dxgltest.cpp
@@ -252,7 +252,8 @@
253253 const TEST_ITEM Tests3D[] =
254254 { // minver maxver buffermin max usesfps defaultfps usestexture usesfsaa name
255255 {7, 7, 0, 2, true, 60.0, false, true, _T("DrawIndexedPrimitive cube with directional light (DX7)")},
256 - {7, 7, 0, 2, true, 60.0, true, true, _T("DrawPrimitive textured cube (DX7)")}
 256+ {7, 7, 0, 2, true, 60.0, true, true, _T("DrawPrimitive textured cube (DX7)")},
 257+ {7, 7, 0, 0, true, 60.0, true, true, _T("Texture Stage shaders (Interactive, DX7)")}
257258 };
258259 const int END_3D = __LINE__ - 4;
259260 const int numtests3d = END_3D - START_3D;