[02/11] ddraw/tests: Rename local vars for ddraw surfaces to reflect their version.

Octavian Voicu octavian.voicu at gmail.com
Mon Nov 7 16:27:05 CST 2011


--
This is the most commonly used convention in the pre-D3D7 code.

Changes in D3D3_ViewportClearTest:
IDirectDrawSurface4 Primary => Primary4

Changes in p8_primary_test:
IDirectDrawSurface Surface1 => Primary1
IDirectDrawSurface offscreen => Surface1
[Surface1 was actually a primary surface; added Primary1 as local var instead]

Changes in DX1_BackBufferFlipTest:
IDirectDrawSurface Primary => Primary1
IDirectDrawSurface Backbuffer => Surface1
---
 dlls/ddraw/tests/visual.c |  128 ++++++++++++++++++++++----------------------
 1 files changed, 64 insertions(+), 64 deletions(-)

diff --git a/dlls/ddraw/tests/visual.c b/dlls/ddraw/tests/visual.c
index 1bac70c..75dd787 100644
--- a/dlls/ddraw/tests/visual.c
+++ b/dlls/ddraw/tests/visual.c
@@ -2202,7 +2202,7 @@ static void D3D3_ViewportClearTest(void)
     HRESULT hr;
     IDirectDraw *DirectDraw1 = NULL;
     IDirectDraw4 *DirectDraw4 = NULL;
-    IDirectDrawSurface4 *Primary = NULL;
+    IDirectDrawSurface4 *Primary4 = NULL;
     IDirect3D3 *Direct3D3 = NULL;
     IDirect3DViewport3 *Viewport3 = NULL;
     IDirect3DViewport3 *SmallViewport3 = NULL;
@@ -2258,7 +2258,7 @@ static void D3D3_ViewportClearTest(void)
     ddsd.dwFlags    = DDSD_CAPS;
     ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE;
 
-    hr = IDirectDraw_CreateSurface(DirectDraw4, &ddsd, &Primary, NULL);
+    hr = IDirectDraw_CreateSurface(DirectDraw4, &ddsd, &Primary4, NULL);
     ok(hr==DD_OK, "IDirectDraw_CreateSurface returned: %08x\n", hr);
     if(FAILED(hr)) goto out;
 
@@ -2266,10 +2266,10 @@ static void D3D3_ViewportClearTest(void)
     ok(hr==DD_OK, "IDirectDraw4_QueryInterface returned: %08x\n", hr);
     if(FAILED(hr)) goto out;
 
-    hr = IDirect3D3_CreateDevice(Direct3D3, &IID_IDirect3DHALDevice, Primary, &Direct3DDevice3, NULL);
+    hr = IDirect3D3_CreateDevice(Direct3D3, &IID_IDirect3DHALDevice, Primary4, &Direct3DDevice3, NULL);
     if(FAILED(hr)) {
         trace("Creating a HAL device failed, trying Ref\n");
-        hr = IDirect3D3_CreateDevice(Direct3D3, &IID_IDirect3DRefDevice, Primary, &Direct3DDevice3, NULL);
+        hr = IDirect3D3_CreateDevice(Direct3D3, &IID_IDirect3DRefDevice, Primary4, &Direct3DDevice3, NULL);
     }
     ok(hr==D3D_OK, "Creating 3D device returned: %x\n", hr);
     if(FAILED(hr)) goto out;
@@ -2355,13 +2355,13 @@ static void D3D3_ViewportClearTest(void)
         ok(hr == D3D_OK, "IDirect3DDevice3_EndScene failed, hr = %08x\n", hr);
         }
 
-    color = D3D3_getPixelColor(DirectDraw4, Primary, 5, 5);
+    color = D3D3_getPixelColor(DirectDraw4, Primary4, 5, 5);
     red =   (color & 0x00ff0000) >> 16;
     green = (color & 0x0000ff00) >>  8;
     blue =  (color & 0x000000ff);
     ok(red == 0 && green == 0xff && blue == 0, "Got color %08x, expected 0000ff00\n", color);
 
-    color = D3D3_getPixelColor(DirectDraw4, Primary, 405, 105);
+    color = D3D3_getPixelColor(DirectDraw4, Primary4, 405, 105);
     red =   (color & 0x00ff0000) >> 16;
     green = (color & 0x0000ff00) >>  8;
     blue =  (color & 0x000000ff);
@@ -2386,13 +2386,13 @@ static void D3D3_ViewportClearTest(void)
         ok(hr == D3D_OK, "IDirect3DDevice3_EndScene failed, hr = %08x\n", hr);
         }
 
-    color = D3D3_getPixelColor(DirectDraw4, Primary, 5, 5);
+    color = D3D3_getPixelColor(DirectDraw4, Primary4, 5, 5);
     red =   (color & 0x00ff0000) >> 16;
     green = (color & 0x0000ff00) >>  8;
     blue =  (color & 0x000000ff);
     ok(red == 0 && green == 0 && blue == 0, "Got color %08x, expected 00000000\n", color);
 
-    color = D3D3_getPixelColor(DirectDraw4, Primary, 405, 105);
+    color = D3D3_getPixelColor(DirectDraw4, Primary4, 405, 105);
     red =   (color & 0x00ff0000) >> 16;
     green = (color & 0x0000ff00) >>  8;
     blue =  (color & 0x000000ff);
@@ -2404,7 +2404,7 @@ static void D3D3_ViewportClearTest(void)
     if (Viewport3) IDirect3DViewport3_Release(Viewport3);
     if (Direct3DDevice3) IDirect3DDevice3_Release(Direct3DDevice3);
     if (Direct3D3) IDirect3D3_Release(Direct3D3);
-    if (Primary) IDirectDrawSurface4_Release(Primary);
+    if (Primary4) IDirectDrawSurface4_Release(Primary4);
     if (DirectDraw1) IDirectDraw_Release(DirectDraw1);
     if (DirectDraw4) IDirectDraw4_Release(DirectDraw4);
     if(window) DestroyWindow(window);
@@ -2477,7 +2477,7 @@ static void p8_primary_test(void)
     RGBQUAD coltable[256];
     UINT i, i1, i2;
     IDirectDrawPalette *ddprimpal = NULL;
-    IDirectDrawSurface *offscreen = NULL;
+    IDirectDrawSurface *Primary1 = NULL, *Surface1 = NULL;
     WNDCLASS wc = {0};
     DDBLTFX ddbltfx;
     COLORREF color;
@@ -2514,7 +2514,7 @@ static void p8_primary_test(void)
     ddsd.dwSize = sizeof(ddsd);
     ddsd.dwFlags = DDSD_CAPS;
     ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
-    hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &Surface1, NULL);
+    hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &Primary1, NULL);
     ok(hr==DD_OK, "CreateSurface returned: %x\n", hr);
     if (FAILED(hr)) {
         goto out;
@@ -2532,12 +2532,12 @@ static void p8_primary_test(void)
         goto out;
     }
 
-    hr = IDirectDrawSurface_SetPalette(Surface1, ddprimpal);
+    hr = IDirectDrawSurface_SetPalette(Primary1, ddprimpal);
     ok(hr==DD_OK, "IDirectDrawSurface_SetPalette returned: %x\n", hr);
 
-    p8_surface_fill_rect(Surface1, 0, 0, 640, 480, 2);
+    p8_surface_fill_rect(Primary1, 0, 0, 640, 480, 2);
 
-    color = getPixelColor_GDI(Surface1, 10, 10);
+    color = getPixelColor_GDI(Primary1, 10, 10);
     ok(GetRValue(color) == 0 && GetGValue(color) == 0 && GetBValue(color) == 0xFF,
             "got R %02X G %02X B %02X, expected R 00 G 00 B FF\n",
             GetRValue(color), GetGValue(color), GetBValue(color));
@@ -2545,10 +2545,10 @@ static void p8_primary_test(void)
     memset(&ddbltfx, 0, sizeof(ddbltfx));
     ddbltfx.dwSize = sizeof(ddbltfx);
     U5(ddbltfx).dwFillColor = 0;
-    hr = IDirectDrawSurface_Blt(Surface1, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
+    hr = IDirectDrawSurface_Blt(Primary1, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
     ok(hr == DD_OK, "IDirectDrawSurface_Blt failed with %08x\n", hr);
 
-    color = getPixelColor_GDI(Surface1, 10, 10);
+    color = getPixelColor_GDI(Primary1, 10, 10);
     ok(GetRValue(color) == 0xFF && GetGValue(color) == 0 && GetBValue(color) == 0,
             "got R %02X G %02X B %02X, expected R FF G 00 B 00\n",
             GetRValue(color), GetGValue(color), GetBValue(color));
@@ -2556,10 +2556,10 @@ static void p8_primary_test(void)
     memset(&ddbltfx, 0, sizeof(ddbltfx));
     ddbltfx.dwSize = sizeof(ddbltfx);
     U5(ddbltfx).dwFillColor = 1;
-    hr = IDirectDrawSurface_Blt(Surface1, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
+    hr = IDirectDrawSurface_Blt(Primary1, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
     ok(hr == DD_OK, "IDirectDrawSurface_Blt failed with %08x\n", hr);
 
-    color = getPixelColor_GDI(Surface1, 10, 10);
+    color = getPixelColor_GDI(Primary1, 10, 10);
     ok(GetRValue(color) == 0 && GetGValue(color) == 0xFF && GetBValue(color) == 0,
             "got R %02X G %02X B %02X, expected R 00 G FF B 00\n",
             GetRValue(color), GetGValue(color), GetBValue(color));
@@ -2573,7 +2573,7 @@ static void p8_primary_test(void)
     ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
     ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_PALETTEINDEXED8;
     U1(ddsd.ddpfPixelFormat).dwRGBBitCount      = 8;
-    hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &offscreen, NULL);
+    hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &Surface1, NULL);
     ok(hr == DD_OK ||
        broken(hr == DDERR_INVALIDPIXELFORMAT) || /* VMware */
        broken(hr == DDERR_NODIRECTDRAWHW), /* VMware */
@@ -2587,16 +2587,16 @@ static void p8_primary_test(void)
     hr = IDirectDrawPalette_SetEntries(ddprimpal, 0, 0, 256, entries);
     ok(hr == DD_OK, "IDirectDrawPalette_SetEntries failed with %08x\n", hr);
 
-    hr = IDirectDrawSurface_GetDC(offscreen, &hdc);
+    hr = IDirectDrawSurface_GetDC(Surface1, &hdc);
     ok(hr==DD_OK, "IDirectDrawSurface_GetDC returned: %x\n", hr);
     i = GetDIBColorTable(hdc, 0, 256, coltable);
     ok(i == 256, "GetDIBColorTable returned %u, last error: %x\n", i, GetLastError());
-    hr = IDirectDrawSurface_ReleaseDC(offscreen, hdc);
+    hr = IDirectDrawSurface_ReleaseDC(Surface1, hdc);
     ok(hr==DD_OK, "IDirectDrawSurface_ReleaseDC returned: %x\n", hr);
 
     ok(colortables_check_equality(entries, coltable), "unexpected colortable on offscreen surface\n");
 
-    p8_surface_fill_rect(offscreen, 0, 0, 16, 16, 2);
+    p8_surface_fill_rect(Surface1, 0, 0, 16, 16, 2);
 
     memset(entries, 0, sizeof(entries));
     entries[0].peRed = 0xff;
@@ -2606,30 +2606,30 @@ static void p8_primary_test(void)
     hr = IDirectDrawPalette_SetEntries(ddprimpal, 0, 0, 256, entries);
     ok(hr == DD_OK, "IDirectDrawPalette_SetEntries failed with %08x\n", hr);
 
-    hr = IDirectDrawSurface_BltFast(Surface1, 0, 0, offscreen, NULL, 0);
+    hr = IDirectDrawSurface_BltFast(Primary1, 0, 0, Surface1, NULL, 0);
     ok(hr==DD_OK, "IDirectDrawSurface_BltFast returned: %x\n", hr);
 
-    color = getPixelColor_GDI(Surface1, 1, 1);
+    color = getPixelColor_GDI(Primary1, 1, 1);
     ok(GetRValue(color) == 0 && GetGValue(color) == 0x00 && GetBValue(color) == 0xFF,
             "got R %02X G %02X B %02X, expected R 00 G 00 B FF\n",
             GetRValue(color), GetGValue(color), GetBValue(color));
 
     /* Color keyed blit. */
-    p8_surface_fill_rect(offscreen, 0, 0, 8, 8, 3);
+    p8_surface_fill_rect(Surface1, 0, 0, 8, 8, 3);
     clrKey.dwColorSpaceLowValue = 3;
     clrKey.dwColorSpaceHighValue = 3;
-    hr = IDirectDrawSurface_SetColorKey(offscreen, DDCKEY_SRCBLT, &clrKey);
+    hr = IDirectDrawSurface_SetColorKey(Surface1, DDCKEY_SRCBLT, &clrKey);
     ok(hr==D3D_OK, "IDirectDrawSurfac_SetColorKey returned: %x\n", hr);
 
-    hr = IDirectDrawSurface_BltFast(Surface1, 100, 100, offscreen, NULL, DDBLTFAST_SRCCOLORKEY);
+    hr = IDirectDrawSurface_BltFast(Primary1, 100, 100, Surface1, NULL, DDBLTFAST_SRCCOLORKEY);
     ok(hr==DD_OK, "IDirectDrawSurface_BltFast returned: %x\n", hr);
 
-    color = getPixelColor_GDI(Surface1, 105, 105);
+    color = getPixelColor_GDI(Primary1, 105, 105);
     ok(GetRValue(color) == 0 && GetGValue(color) == 0xFF && GetBValue(color) == 0,
             "got R %02X G %02X B %02X, expected R 00 G FF B 00\n",
             GetRValue(color), GetGValue(color), GetBValue(color));
 
-    color = getPixelColor_GDI(Surface1, 112, 112);
+    color = getPixelColor_GDI(Primary1, 112, 112);
     ok(GetRValue(color) == 0 && GetGValue(color) == 0x00 && GetBValue(color) == 0xFF,
             "got R %02X G %02X B %02X, expected R 00 G 00 B FF\n",
             GetRValue(color), GetGValue(color), GetBValue(color));
@@ -2642,19 +2642,19 @@ static void p8_primary_test(void)
     memset(&ddbltfx, 0, sizeof(ddbltfx));
     ddbltfx.dwSize = sizeof(ddbltfx);
     ddbltfx.ddckSrcColorkey.dwColorSpaceLowValue = ddbltfx.ddckSrcColorkey.dwColorSpaceHighValue = 2;
-    hr = IDirectDrawSurface_Blt(Surface1, &rect, offscreen, NULL,
+    hr = IDirectDrawSurface_Blt(Primary1, &rect, Surface1, NULL,
         DDBLT_WAIT | DDBLT_KEYSRC | DDBLT_KEYSRCOVERRIDE, &ddbltfx);
     ok(hr==DDERR_INVALIDPARAMS, "IDirectDrawSurface_Blt returned: %x\n", hr);
-    hr = IDirectDrawSurface_Blt(Surface1, &rect, offscreen, NULL,
+    hr = IDirectDrawSurface_Blt(Primary1, &rect, Surface1, NULL,
         DDBLT_WAIT | DDBLT_KEYSRCOVERRIDE, &ddbltfx);
     ok(hr==DD_OK, "IDirectDrawSurface_Blt returned: %x\n", hr);
 
-    color = getPixelColor_GDI(Surface1, 105, 205);
+    color = getPixelColor_GDI(Primary1, 105, 205);
     ok(GetRValue(color) == 0x80 && GetGValue(color) == 0 && GetBValue(color) == 0,
             "got R %02X G %02X B %02X, expected R 80 G 00 B 00\n",
             GetRValue(color), GetGValue(color), GetBValue(color));
 
-    color = getPixelColor_GDI(Surface1, 112, 212);
+    color = getPixelColor_GDI(Primary1, 112, 212);
     ok(GetRValue(color) == 0 && GetGValue(color) == 0xFF && GetBValue(color) == 0,
             "got R %02X G %02X B %02X, expected R 00 G FF B 00\n",
             GetRValue(color), GetGValue(color), GetBValue(color));
@@ -2663,7 +2663,7 @@ static void p8_primary_test(void)
        surface conversion and uploading/downloading to/from opengl texture). Similar patterns (
        blitting front buffer areas to/from an offscreen surface mixed with locking) are used by C&C
        Red Alert I. */
-    IDirectDrawSurface_Release(offscreen);
+    IDirectDrawSurface_Release(Surface1);
 
     memset (&ddsd, 0, sizeof (ddsd));
     ddsd.dwSize = sizeof (ddsd);
@@ -2674,7 +2674,7 @@ static void p8_primary_test(void)
     ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
     ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_PALETTEINDEXED8;
     U1(ddsd.ddpfPixelFormat).dwRGBBitCount      = 8;
-    hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &offscreen, NULL);
+    hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &Surface1, NULL);
     ok(hr == DD_OK, "IDirectDraw_CreateSurface returned %08x\n", hr);
 
     if (FAILED(hr)) goto out;
@@ -2684,13 +2684,13 @@ static void p8_primary_test(void)
        front buffer palette later. */
     for (i2 = 0; i2 < 2; i2++) {
         if (i2 == 1) {
-            hr = IDirectDrawSurface_SetPalette(Surface1, NULL);
+            hr = IDirectDrawSurface_SetPalette(Primary1, NULL);
             ok(hr==DD_OK, "IDirectDrawSurface_SetPalette returned: %x\n", hr);
         }
 
         memset(&ddsd, 0, sizeof(ddsd));
         ddsd.dwSize = sizeof(ddsd);
-        hr = IDirectDrawSurface_Lock(Surface1, NULL, &ddsd, DDLOCK_WAIT, NULL);
+        hr = IDirectDrawSurface_Lock(Primary1, NULL, &ddsd, DDLOCK_WAIT, NULL);
         ok(hr==DD_OK, "IDirectDrawSurface_Lock returned: %x\n", hr);
 
         for (i = 0; i < 256; i++) {
@@ -2704,18 +2704,18 @@ static void p8_primary_test(void)
             }
         }
 
-        hr = IDirectDrawSurface_Unlock(Surface1, NULL);
+        hr = IDirectDrawSurface_Unlock(Primary1, NULL);
         ok(hr==DD_OK, "IDirectDrawSurface_UnLock returned: %x\n", hr);
 
-        hr = IDirectDrawSurface_BltFast(offscreen, 0, 0, Surface1, NULL, 0);
+        hr = IDirectDrawSurface_BltFast(Surface1, 0, 0, Primary1, NULL, 0);
         ok(hr==DD_OK, "IDirectDrawSurface_BltFast returned: %x\n", hr);
 
         /* This ensures offscreen surface contents will be downloaded to system memory. */
         memset(&ddsd, 0, sizeof(ddsd));
         ddsd.dwSize = sizeof(ddsd);
-        hr = IDirectDrawSurface_Lock(offscreen, NULL, &ddsd, DDLOCK_WAIT, NULL);
+        hr = IDirectDrawSurface_Lock(Surface1, NULL, &ddsd, DDLOCK_WAIT, NULL);
         ok(hr==DD_OK, "IDirectDrawSurface_Lock returned: %x\n", hr);
-        hr = IDirectDrawSurface_Unlock(offscreen, NULL);
+        hr = IDirectDrawSurface_Unlock(Surface1, NULL);
         ok(hr==DD_OK, "IDirectDrawSurface_UnLock returned: %x\n", hr);
 
         /* Offscreen surface data will have to be converted and uploaded to texture. */
@@ -2723,23 +2723,23 @@ static void p8_primary_test(void)
         rect.top = 0;
         rect.right = 16;
         rect.bottom = 16;
-        hr = IDirectDrawSurface_BltFast(offscreen, 600, 400, Surface1, &rect, 0);
+        hr = IDirectDrawSurface_BltFast(Surface1, 600, 400, Primary1, &rect, 0);
         ok(hr==DD_OK, "IDirectDrawSurface_BltFast returned: %x\n", hr);
 
         /* This ensures offscreen surface contents will be downloaded to system memory. */
         memset(&ddsd, 0, sizeof(ddsd));
         ddsd.dwSize = sizeof(ddsd);
-        hr = IDirectDrawSurface_Lock(offscreen, NULL, &ddsd, DDLOCK_WAIT, NULL);
+        hr = IDirectDrawSurface_Lock(Surface1, NULL, &ddsd, DDLOCK_WAIT, NULL);
         ok(hr==DD_OK, "IDirectDrawSurface_Lock returned: %x\n", hr);
-        hr = IDirectDrawSurface_Unlock(offscreen, NULL);
+        hr = IDirectDrawSurface_Unlock(Surface1, NULL);
         ok(hr==DD_OK, "IDirectDrawSurface_UnLock returned: %x\n", hr);
 
-        hr = IDirectDrawSurface_BltFast(Surface1, 0, 0, offscreen, NULL, 0);
+        hr = IDirectDrawSurface_BltFast(Primary1, 0, 0, Surface1, NULL, 0);
         ok(hr==DD_OK, "IDirectDrawSurface_BltFast returned: %x\n", hr);
 
         memset(&ddsd, 0, sizeof(ddsd));
         ddsd.dwSize = sizeof(ddsd);
-        hr = IDirectDrawSurface_Lock(Surface1, NULL, &ddsd, DDLOCK_WAIT, NULL);
+        hr = IDirectDrawSurface_Lock(Primary1, NULL, &ddsd, DDLOCK_WAIT, NULL);
         ok(hr==DD_OK, "IDirectDrawSurface_Lock returned: %x\n", hr);
 
         differences = 0;
@@ -2752,7 +2752,7 @@ static void p8_primary_test(void)
             if (*p != i) differences++;
         }
 
-        hr = IDirectDrawSurface_Unlock(Surface1, NULL);
+        hr = IDirectDrawSurface_Unlock(Primary1, NULL);
         ok(hr==DD_OK, "IDirectDrawSurface_UnLock returned: %x\n", hr);
 
         ok(differences == 0, i2 == 0 ? "Pass 1. Unexpected front buffer contents after blit (%u differences)\n" :
@@ -2763,8 +2763,8 @@ static void p8_primary_test(void)
     out:
 
     if(ddprimpal) IDirectDrawPalette_Release(ddprimpal);
-    if(offscreen) IDirectDrawSurface_Release(offscreen);
     if(Surface1) IDirectDrawSurface_Release(Surface1);
+    if(Primary1) IDirectDrawSurface_Release(Primary1);
     if(DirectDraw1) IDirectDraw_Release(DirectDraw1);
     if(window) DestroyWindow(window);
 }
@@ -3066,8 +3066,8 @@ static void DX1_BackBufferFlipTest(void)
 {
     HRESULT hr;
     IDirectDraw *DirectDraw1 = NULL;
-    IDirectDrawSurface *Primary = NULL;
-    IDirectDrawSurface *Backbuffer = NULL;
+    IDirectDrawSurface *Primary1 = NULL;
+    IDirectDrawSurface *Surface1 = NULL;
     WNDCLASS wc = {0};
     DDSURFACEDESC ddsd;
     DDBLTFX ddbltfx;
@@ -3105,7 +3105,7 @@ static void DX1_BackBufferFlipTest(void)
     ddsd.dwFlags = DDSD_CAPS;
     ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
 
-    hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &Primary, NULL);
+    hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &Primary1, NULL);
     ok(hr==DD_OK, "IDirectDraw_CreateSurface returned: %08x\n", hr);
 
     memset(&ddsd, 0, sizeof(DDSURFACEDESC));
@@ -3121,11 +3121,11 @@ static void DX1_BackBufferFlipTest(void)
     U3(ddsd.ddpfPixelFormat).dwGBitMask         = 0x0000ff00;
     U4(ddsd.ddpfPixelFormat).dwBBitMask         = 0x000000ff;
 
-    hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &Backbuffer, NULL);
+    hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &Surface1, NULL);
     ok(hr==DD_OK, "IDirectDraw_CreateSurface returned: %08x\n", hr);
     if(FAILED(hr)) goto out;
 
-    hr = IDirectDrawSurface_AddAttachedSurface(Primary, Backbuffer);
+    hr = IDirectDrawSurface_AddAttachedSurface(Primary1, Surface1);
     todo_wine ok(hr == DD_OK || broken(hr == DDERR_CANNOTATTACHSURFACE),
        "Attaching a back buffer to a front buffer returned %08x\n", hr);
     if (FAILED(hr)) goto out;
@@ -3135,35 +3135,35 @@ static void DX1_BackBufferFlipTest(void)
     memset(&ddbltfx, 0, sizeof(ddbltfx));
     ddbltfx.dwSize = sizeof(ddbltfx);
     U5(ddbltfx).dwFillColor = red;
-    hr = IDirectDrawSurface_Blt(Backbuffer, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
+    hr = IDirectDrawSurface_Blt(Surface1, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
     ok(hr == DD_OK, "IDirectDrawSurface_Blt returned: %x\n", hr);
 
     U5(ddbltfx).dwFillColor = white;
-    hr = IDirectDrawSurface_Blt(Primary, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
+    hr = IDirectDrawSurface_Blt(Primary1, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
     ok(hr == DD_OK, "IDirectDrawSurface_Blt returned: %x\n", hr);
 
     /* Check it out */
-    color = getPixelColor_GDI(Primary, 5, 5);
+    color = getPixelColor_GDI(Primary1, 5, 5);
     ok(GetRValue(color) == 0xFF && GetGValue(color) == 0xFF && GetBValue(color) == 0xFF,
             "got R %02X G %02X B %02X, expected R FF G FF B FF\n",
             GetRValue(color), GetGValue(color), GetBValue(color));
 
-    color = getPixelColor_GDI(Backbuffer, 5, 5);
+    color = getPixelColor_GDI(Surface1, 5, 5);
     ok(GetRValue(color) == 0xFF && GetGValue(color) == 0 && GetBValue(color) == 0,
             "got R %02X G %02X B %02X, expected R FF G 00 B 00\n",
             GetRValue(color), GetGValue(color), GetBValue(color));
 
-    hr = IDirectDrawSurface_Flip(Primary, NULL, DDFLIP_WAIT);
+    hr = IDirectDrawSurface_Flip(Primary1, NULL, DDFLIP_WAIT);
     todo_wine ok(hr == DD_OK, "IDirectDrawSurface_Flip returned 0x%08x\n", hr);
 
     if (hr == DD_OK)
     {
-        color = getPixelColor_GDI(Primary, 5, 5);
+        color = getPixelColor_GDI(Primary1, 5, 5);
         ok(GetRValue(color) == 0xFF && GetGValue(color) == 0 && GetBValue(color) == 0,
                 "got R %02X G %02X B %02X, expected R FF G 00 B 00\n",
                 GetRValue(color), GetGValue(color), GetBValue(color));
 
-        color = getPixelColor_GDI(Backbuffer, 5, 5);
+        color = getPixelColor_GDI(Surface1, 5, 5);
         ok((GetRValue(color) == 0xFF && GetGValue(color) == 0xFF && GetBValue(color) == 0xFF) ||
            broken(GetRValue(color) == 0xFF && GetGValue(color) == 0 && GetBValue(color) == 0),  /* broken driver */
                 "got R %02X G %02X B %02X, expected R FF G FF B FF\n",
@@ -3172,13 +3172,13 @@ static void DX1_BackBufferFlipTest(void)
 
     out:
 
-    if (Backbuffer)
+    if (Surface1)
     {
         if (attached)
-            IDirectDrawSurface_DeleteAttachedSurface(Primary, 0, Backbuffer);
-        IDirectDrawSurface_Release(Backbuffer);
+            IDirectDrawSurface_DeleteAttachedSurface(Primary1, 0, Surface1);
+        IDirectDrawSurface_Release(Surface1);
     }
-    if (Primary) IDirectDrawSurface_Release(Primary);
+    if (Primary1) IDirectDrawSurface_Release(Primary1);
     if (DirectDraw1) IDirectDraw_Release(DirectDraw1);
     if (window) DestroyWindow(window);
 }
-- 
1.7.4.1




More information about the wine-patches mailing list