DXGL r886 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r885‎ | r886 | r887 >
Date:16:09, 22 December 2018
Author:admin
Status:new
Tags:
Comment:
Partially implement D3D texture test in surface format tests.
Describe texture format fields for 2D shaders.
Modified paths:
  • /ddraw/ShaderGen2D.cpp (modified) (history)
  • /dxglcfg/surfacegen.cpp (modified) (history)
  • /dxglcfg/tests.cpp (modified) (history)

Diff [purge]

Index: ddraw/ShaderGen2D.cpp
@@ -58,6 +58,20 @@
5959 Bits 32-39: Texture type input
6060 Bits 40-47: Texture type output
6161 AND the dwFlags by 0xF2FAADFF before packing ROP index bits
 62+
 63+Texture types:
 64+0x00: Classic DXGL processing
 65+0x01: 32-bit YUV444, 8-bit component (convert from other formats via software)
 66+0x10: 8-bit palette
 67+0x11: 4-bit palette
 68+0x12: 2-bit palette
 69+0x13: 1-bit palette
 70+0x14: 4-bit palette index
 71+0x15: 2-bit palette index
 72+0x16: 1-bit palette index
 73+0x20: (first entry for specific RGB formats)
 74+0x80: (first entry for specific YUV formats)
 75+0xC0: (first entry for compressed)
6276 */
6377
6478 static const char revheader[] =
Index: dxglcfg/surfacegen.cpp
@@ -1662,8 +1662,8 @@
16631663 static const LPTSTR StrFormatTestMethods[] =
16641664 {
16651665 _T("Unknown"),
 1666+ _T("Blt Sysmem"),
16661667 _T("Blt Vidmem"),
1667 - _T("Blt Sysmem"),
16681668 _T("D3D Quad"),
16691669 _T("Overlay")
16701670 };
@@ -1725,7 +1725,7 @@
17261726
17271727 static const LPTSTR strErrorMessages[] =
17281728 {
1729 - _T("Unknown error"),
 1729+ _T("Unknown error: "),
17301730 _T("Error creating src surf: "),
17311731 _T("Error locking src surf: "),
17321732 _T("Error getting hdc: "),
@@ -1732,7 +1732,9 @@
17331733 _T("Error creating dest surf: "),
17341734 _T("Error blitting src to pri: "),
17351735 _T("Error blitting src to dest: "),
1736 - _T("Error blitting dest to pri: ")
 1736+ _T("Error blitting dest to pri: "),
 1737+ _T("Error initializing Direct3D"),
 1738+ _T("Overlays not available yet")
17371739 };
17381740
17391741 void DrawFormatTestHUD(MultiDirectDrawSurface *surface, int srcformat, int destformat, int showhud,
@@ -1809,7 +1811,7 @@
18101812 _tcscat(buffer, strFormatTestPatterns[testpattern]);
18111813 _tcscat(buffer, strFormatTestStatus2);
18121814 if (testmethod < 0) testmethod = 0;
1813 - if (testmethod > 3) testmethod = 0;
 1815+ if (testmethod > 4) testmethod = 0;
18141816 _tcscat(buffer, StrFormatTestMethods[testmethod]);
18151817 TextOutShadow(hdc, posx, posy, buffer, _tcslen(buffer), RGB(0, 0, 192));
18161818 // List source formats
@@ -1911,13 +1913,16 @@
19121914 SetBkColor(hdc, RGB(255, 0, 0));
19131915 SetTextColor(hdc, RGB(255, 255, 255));
19141916 if (errorlocation < 0) errorlocation = 0;
1915 - if (errorlocation > 7) errorlocation = 0;
 1917+ if (errorlocation > 9) errorlocation = 0;
19161918 posx = 0;
19171919 posy = charsize.cy * (rows - 1);
19181920 _tcscpy(buffer, strErrorMessages[errorlocation]);
1919 - _tcscat(buffer, _T("0x"));
1920 - _itot(error, number, 16);
1921 - _tcscat(buffer, number);
 1921+ if ((errorlocation != 8) && (errorlocation != 9))
 1922+ {
 1923+ _tcscat(buffer, _T("0x"));
 1924+ _itot(error, number, 16);
 1925+ _tcscat(buffer, number);
 1926+ }
19221927 TextOutShadow(hdc, posx, posy, buffer, _tcslen(buffer), RGB(192, 0, 0));
19231928 }
19241929 SelectObject(hdc, DefaultFont);
Index: dxglcfg/tests.cpp
@@ -348,6 +348,9 @@
349349 RunSurfaceFormatTest();
350350 break;
351351 case VK_TAB: // Render method
 352+ testmethod++;
 353+ if (testmethod > 4) testmethod = 1;
 354+ RunSurfaceFormatTest();
352355 break;
353356 }
354357 }
@@ -1328,7 +1331,7 @@
13291332 lights[0].dvAttenuation1 = 0.4f;
13301333 error = d3d7dev->SetLight(0, &lights[0]);
13311334 break;
1332 - case 13: // Solid cube
 1335+ case 13: // Textured cube
13331336 MakeCube3D(5, 2);
13341337 cleartexformats();
13351338 d3d7dev->EnumTextureFormats(gettexformat, NULL);
@@ -1510,7 +1513,7 @@
15111514 case 18: // Surface format test
15121515 ddsrender->GetSurfaceDesc(&ddsd);
15131516 ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
1514 - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
 1517+ ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
15151518 ddinterface->CreateSurface(&ddsd, &sprites[0].surface, NULL); // Initial source surface
15161519 srcformat = 0;
15171520 destformat = -1;
@@ -2298,11 +2301,25 @@
22992302 {
23002303 HRESULT error;
23012304 DDSURFACEDESC2 ddsd;
 2305+ DDSURFACEDESC2 ddsdTexture;
23022306 DDBLTFX bltfx;
 2307+ D3DTLVERTEX vertices[4];
 2308+ WORD indices[6] = { 0,3,1,3,0,2 };
 2309+ D3DVIEWPORT7 viewport;
 2310+ D3DDEVICEDESC7 d3ddevdesc;
 2311+ DWORD texwidth, texheight;
23032312 errorlocation = 0;
23042313 errornumber = 0;
2305 - if (ddver > 3)ddsd.dwSize = sizeof(DDSURFACEDESC2);
2306 - else ddsd.dwSize = sizeof(DDSURFACEDESC);
 2314+ if (ddver > 3)
 2315+ {
 2316+ ddsd.dwSize = sizeof(DDSURFACEDESC2);
 2317+ ddsdTexture.dwSize = sizeof(DDSURFACEDESC2);
 2318+ }
 2319+ else
 2320+ {
 2321+ ddsd.dwSize = sizeof(DDSURFACEDESC);
 2322+ ddsdTexture.dwSize = sizeof(DDSURFACEDESC);
 2323+ }
23072324 if (sprites[0].surface)
23082325 {
23092326 sprites[0].surface->Release();
@@ -2314,105 +2331,278 @@
23152332 sprites[1].surface = NULL;
23162333 }
23172334 ddsrender->GetSurfaceDesc(&ddsd);
2318 - ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
2319 - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
2320 - if (srcformat > 0)
 2335+ switch (testmethod)
23212336 {
2322 - ddsd.dwFlags |= DDSD_PIXELFORMAT;
2323 - ddsd.ddpfPixelFormat = surfaceformats[srcformat];
2324 - }
2325 - error = ddinterface->CreateSurface(&ddsd, &sprites[0].surface, NULL);
2326 - if (error)
2327 - {
2328 - errorlocation = 1;
2329 - errornumber = error;
2330 - bltfx.dwSize = sizeof(DDBLTFX);
2331 - bltfx.dwFillColor = 0;
2332 - ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
2333 - }
2334 - else
2335 - {
2336 - // FIXME: Select pattern
2337 - error = sprites[0].surface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL);
2338 - if(error)
 2337+ case 1:
 2338+ case 2:
 2339+ ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
 2340+ ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
 2341+ if (testmethod == 2) ddsd.ddsCaps.dwCaps |= DDSCAPS_VIDEOMEMORY;
 2342+ else ddsd.ddsCaps.dwCaps |= D3DDEBCAPS_SYSTEMMEMORY;
 2343+ if (srcformat > 0)
23392344 {
2340 - errorlocation = 2;
 2345+ ddsd.dwFlags |= DDSD_PIXELFORMAT;
 2346+ ddsd.ddpfPixelFormat = surfaceformats[srcformat];
 2347+ }
 2348+ error = ddinterface->CreateSurface(&ddsd, &sprites[0].surface, NULL);
 2349+ if (error)
 2350+ {
 2351+ errorlocation = 1;
23412352 errornumber = error;
23422353 bltfx.dwSize = sizeof(DDBLTFX);
23432354 bltfx.dwFillColor = 0;
2344 - ddsrender->Blt(NULL,NULL,NULL,DDBLT_WAIT|DDBLT_COLORFILL,&bltfx);
2345 - sprites[0].surface->Release();
2346 - sprites[0].surface = NULL;
 2355+ ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
23472356 }
23482357 else
23492358 {
2350 - DrawPalette(ddsd, (unsigned char*)ddsd.lpSurface);
2351 - error = sprites[0].surface->Unlock(NULL);
2352 - if (destformat != -1)
 2359+ // FIXME: Select pattern
 2360+ error = sprites[0].surface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL);
 2361+ if (error)
23532362 {
2354 - ddsrender->GetSurfaceDesc(&ddsd);
2355 - ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
2356 - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
2357 - if (destformat > 0)
 2363+ errorlocation = 2;
 2364+ errornumber = error;
 2365+ bltfx.dwSize = sizeof(DDBLTFX);
 2366+ bltfx.dwFillColor = 0;
 2367+ ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
 2368+ sprites[0].surface->Release();
 2369+ sprites[0].surface = NULL;
 2370+ }
 2371+ else
 2372+ {
 2373+ DrawPalette(ddsd, (unsigned char*)ddsd.lpSurface);
 2374+ error = sprites[0].surface->Unlock(NULL);
 2375+ if (destformat != -1)
23582376 {
2359 - ddsd.dwFlags |= DDSD_PIXELFORMAT;
2360 - ddsd.ddpfPixelFormat = surfaceformats[destformat];
2361 - }
2362 - error = ddinterface->CreateSurface(&ddsd, &sprites[1].surface, NULL);
2363 - if (error)
2364 - {
2365 - errorlocation = 4;
2366 - errornumber = error;
2367 - bltfx.dwSize = sizeof(DDBLTFX);
2368 - bltfx.dwFillColor = 0;
2369 - ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
2370 - sprites[0].surface->Release();
2371 - sprites[0].surface = NULL;
2372 - }
2373 - else
2374 - {
2375 - error = sprites[1].surface->Blt(NULL, sprites[0].surface, NULL, DDBLT_WAIT, NULL);
 2377+ ddsrender->GetSurfaceDesc(&ddsd);
 2378+ ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
 2379+ ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
 2380+ if (destformat > 0)
 2381+ {
 2382+ ddsd.dwFlags |= DDSD_PIXELFORMAT;
 2383+ ddsd.ddpfPixelFormat = surfaceformats[destformat];
 2384+ }
 2385+ error = ddinterface->CreateSurface(&ddsd, &sprites[1].surface, NULL);
23762386 if (error)
23772387 {
2378 - errorlocation = 6;
 2388+ errorlocation = 4;
23792389 errornumber = error;
23802390 bltfx.dwSize = sizeof(DDBLTFX);
23812391 bltfx.dwFillColor = 0;
23822392 ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
 2393+ sprites[0].surface->Release();
 2394+ sprites[0].surface = NULL;
23832395 }
23842396 else
23852397 {
2386 - error = ddsrender->Blt(NULL, sprites[1].surface, NULL, DDBLT_WAIT, NULL);
 2398+ error = sprites[1].surface->Blt(NULL, sprites[0].surface, NULL, DDBLT_WAIT, NULL);
23872399 if (error)
23882400 {
2389 - errorlocation = 7;
 2401+ errorlocation = 6;
23902402 errornumber = error;
23912403 bltfx.dwSize = sizeof(DDBLTFX);
23922404 bltfx.dwFillColor = 0;
23932405 ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
23942406 }
 2407+ else
 2408+ {
 2409+ error = ddsrender->Blt(NULL, sprites[1].surface, NULL, DDBLT_WAIT, NULL);
 2410+ if (error)
 2411+ {
 2412+ errorlocation = 7;
 2413+ errornumber = error;
 2414+ bltfx.dwSize = sizeof(DDBLTFX);
 2415+ bltfx.dwFillColor = 0;
 2416+ ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
 2417+ }
 2418+ }
 2419+ sprites[0].surface->Release();
 2420+ sprites[0].surface = NULL;
 2421+ sprites[1].surface->Release();
 2422+ sprites[1].surface = NULL;
23952423 }
 2424+ }
 2425+ else
 2426+ {
 2427+ error = ddsrender->Blt(NULL, sprites[0].surface, NULL, DDBLT_WAIT, NULL);
 2428+ if (error)
 2429+ {
 2430+ errorlocation = 5;
 2431+ errornumber = error;
 2432+ bltfx.dwSize = sizeof(DDBLTFX);
 2433+ bltfx.dwFillColor = 0;
 2434+ ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
 2435+ }
23962436 sprites[0].surface->Release();
23972437 sprites[0].surface = NULL;
2398 - sprites[1].surface->Release();
2399 - sprites[1].surface = NULL;
24002438 }
24012439 }
 2440+ }
 2441+ break;
 2442+ case 3:
 2443+ if (d3dfail)
 2444+ {
 2445+ errorlocation = 8;
 2446+ errornumber = 1;
 2447+ bltfx.dwSize = sizeof(DDBLTFX);
 2448+ bltfx.dwFillColor = 0;
 2449+ ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
 2450+ }
 2451+ else
 2452+ {
 2453+ ZeroMemory(&vertices, 4 * sizeof(D3DVERTEX));
 2454+ vertices[0].sx = 0.0f; vertices[0].sy = 0.0f; vertices[0].sz = 0.0f; vertices[0].rhw = 1.0f;
 2455+ vertices[1].sx = 0.0f; vertices[1].sy = (float)ddsd.dwHeight; vertices[1].sz = 0.0f; vertices[1].rhw = 1.0f;
 2456+ vertices[2].sx = (float)ddsd.dwWidth; vertices[2].sy = 0.0f; vertices[2].sz = 0.0f; vertices[2].rhw = 1.0f;
 2457+ vertices[3].sx = (float)ddsd.dwWidth; vertices[3].sy = (float)ddsd.dwHeight; vertices[3].sz = 0.0f; vertices[3].rhw = 1.0f;
 2458+ vertices[0].tu = 0.0f; vertices[0].tv = 0.0f;
 2459+ vertices[1].tu = 0.0f; vertices[1].tv = 1.0f;
 2460+ vertices[2].tu = 1.0f; vertices[2].tv = 0.0f;
 2461+ vertices[3].tu = 1.0f; vertices[3].tv = 1.0f;
 2462+ vertices[0].dcColor = vertices[1].dcColor = vertices[2].dcColor = vertices[3].dcColor = 0xFFFFFFFF;
 2463+ viewport.dwWidth = ddsd.dwWidth; viewport.dwHeight = ddsd.dwHeight;
 2464+ viewport.dwX = 0; viewport.dwY = 0;
 2465+ viewport.dvMinZ = 0.0f; viewport.dvMaxZ = 1.0f;
 2466+ ZeroMemory(&ddsdTexture, sizeof(DDSURFACEDESC2));
 2467+ ddsdTexture.dwSize = sizeof(DDSURFACEDESC2);
 2468+ ddsdTexture.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_TEXTURESTAGE;
 2469+ if (srcformat > 0)
 2470+ {
 2471+ ddsdTexture.dwFlags |= DDSD_PIXELFORMAT;
 2472+ ddsdTexture.ddpfPixelFormat = surfaceformats[srcformat];
 2473+ }
 2474+ ddsdTexture.ddsCaps.dwCaps = DDSCAPS_TEXTURE;
 2475+ ddsdTexture.ddsCaps.dwCaps2 = DDSCAPS2_TEXTUREMANAGE;
 2476+ d3d7dev->GetCaps(&d3ddevdesc);
 2477+ if (d3ddevdesc.dwMaxTextureWidth >= 512) texwidth = 512;
 2478+ else texwidth = d3ddevdesc.dwMaxTextureWidth;
 2479+ if (d3ddevdesc.dwMaxTextureHeight >= 512) texheight = 512;
 2480+ else texheight = d3ddevdesc.dwMaxTextureHeight;
 2481+ ddsdTexture.dwWidth = texwidth;
 2482+ ddsdTexture.dwHeight = texheight;
 2483+ error = ddinterface->CreateSurface(&ddsdTexture, &sprites[0].surface, NULL);
 2484+ if (error)
 2485+ {
 2486+ errorlocation = 1;
 2487+ errornumber = error;
 2488+ bltfx.dwSize = sizeof(DDBLTFX);
 2489+ bltfx.dwFillColor = 0;
 2490+ ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
 2491+ }
24022492 else
24032493 {
2404 - error = ddsrender->Blt(NULL, sprites[0].surface, NULL, DDBLT_WAIT, NULL);
 2494+ // FIXME: Select pattern
 2495+ error = sprites[0].surface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL);
24052496 if (error)
24062497 {
2407 - errorlocation = 5;
 2498+ errorlocation = 2;
24082499 errornumber = error;
24092500 bltfx.dwSize = sizeof(DDBLTFX);
24102501 bltfx.dwFillColor = 0;
24112502 ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
 2503+ sprites[0].surface->Release();
 2504+ sprites[0].surface = NULL;
24122505 }
2413 - sprites[0].surface->Release();
2414 - sprites[0].surface = NULL;
 2506+ else
 2507+ {
 2508+ DrawPalette(ddsd, (unsigned char*)ddsd.lpSurface);
 2509+ error = sprites[0].surface->Unlock(NULL);
 2510+ if (destformat != -1)
 2511+ {
 2512+ ddsrender->GetSurfaceDesc(&ddsd);
 2513+ ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
 2514+ ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;
 2515+ if (destformat > 0)
 2516+ {
 2517+ ddsd.dwFlags |= DDSD_PIXELFORMAT;
 2518+ ddsd.ddpfPixelFormat = surfaceformats[destformat];
 2519+ }
 2520+ error = ddinterface->CreateSurface(&ddsd, &sprites[1].surface, NULL);
 2521+ if (error)
 2522+ {
 2523+ errorlocation = 4;
 2524+ errornumber = error;
 2525+ bltfx.dwSize = sizeof(DDBLTFX);
 2526+ bltfx.dwFillColor = 0;
 2527+ ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
 2528+ sprites[0].surface->Release();
 2529+ sprites[0].surface = NULL;
 2530+ }
 2531+ else
 2532+ {
 2533+ error = 0;
 2534+ d3d7dev->SetRenderTarget((LPDIRECTDRAWSURFACE7)sprites[1].surface->GetSurface(), 0);
 2535+ d3d7dev->SetViewport(&viewport);
 2536+ d3d7dev->SetRenderState(D3DRENDERSTATE_DITHERENABLE, 1);
 2537+ d3d7dev->BeginScene();
 2538+ d3d7dev->SetTexture(0, (LPDIRECTDRAWSURFACE7)sprites[0].surface->GetSurface());
 2539+ d3d7dev->SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTFG_POINT);
 2540+ d3d7dev->SetTextureStageState(0, D3DTSS_MINFILTER, D3DTFN_POINT);
 2541+ d3d7dev->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, D3DFVF_TLVERTEX, vertices,
 2542+ 4, indices, 6, 0);
 2543+ d3d7dev->EndScene();
 2544+ if (error)
 2545+ {
 2546+ errorlocation = 6;
 2547+ errornumber = error;
 2548+ bltfx.dwSize = sizeof(DDBLTFX);
 2549+ bltfx.dwFillColor = 0;
 2550+ ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
 2551+ }
 2552+ else
 2553+ {
 2554+ error = ddsrender->Blt(NULL, sprites[1].surface, NULL, DDBLT_WAIT, NULL);
 2555+ if (error)
 2556+ {
 2557+ errorlocation = 7;
 2558+ errornumber = error;
 2559+ bltfx.dwSize = sizeof(DDBLTFX);
 2560+ bltfx.dwFillColor = 0;
 2561+ ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
 2562+ }
 2563+ }
 2564+ sprites[0].surface->Release();
 2565+ sprites[0].surface = NULL;
 2566+ sprites[1].surface->Release();
 2567+ sprites[1].surface = NULL;
 2568+ }
 2569+ }
 2570+ else
 2571+ {
 2572+ error = 0;
 2573+ d3d7dev->SetRenderTarget((LPDIRECTDRAWSURFACE7)ddsrender->GetSurface(), 0);
 2574+ d3d7dev->SetViewport(&viewport);
 2575+ d3d7dev->SetRenderState(D3DRENDERSTATE_DITHERENABLE, 1);
 2576+ d3d7dev->BeginScene();
 2577+ d3d7dev->SetTexture(0, (LPDIRECTDRAWSURFACE7)sprites[0].surface->GetSurface());
 2578+ d3d7dev->SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTFG_POINT);
 2579+ d3d7dev->SetTextureStageState(0, D3DTSS_MINFILTER, D3DTFN_POINT);
 2580+ d3d7dev->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, D3DFVF_TLVERTEX, vertices,
 2581+ 4, indices, 6, 0);
 2582+ d3d7dev->EndScene();
 2583+ if (error)
 2584+ {
 2585+ errorlocation = 5;
 2586+ errornumber = error;
 2587+ bltfx.dwSize = sizeof(DDBLTFX);
 2588+ bltfx.dwFillColor = 0;
 2589+ ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
 2590+ }
 2591+ sprites[0].surface->Release();
 2592+ sprites[0].surface = NULL;
 2593+ }
 2594+ }
24152595 }
24162596 }
 2597+ break;
 2598+ case 4:
 2599+ errorlocation = 9;
 2600+ errornumber = 1;
 2601+ bltfx.dwSize = sizeof(DDBLTFX);
 2602+ bltfx.dwFillColor = 0;
 2603+ ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
 2604+ break;
 2605+ default:
 2606+ break;
24172607 }
24182608 DrawFormatTestHUD(ddsrender, srcformat, destformat, showhud, testpattern,
24192609 testmethod, ddsd.dwWidth, ddsd.dwHeight, errorlocation, errornumber);
@@ -3841,10 +4031,3 @@
38424032 }
38434033 return TRUE;
38444034 }
3845 -
3846 -/*
3847 -void DDFlipTestWindow::OnQueryNewPalette(wxQueryNewPaletteEvent& event)
3848 -{
3849 - //if(bpp == 8) ddsurface->SetPalette
3850 -}
3851 -*/
\ No newline at end of file