Index: dxglcfg/surfacegen.cpp |
— | — | @@ -1651,7 +1651,8 @@ |
1652 | 1652 | static const LPTSTR StrFormatTestMethods[] =
|
1653 | 1653 | {
|
1654 | 1654 | _T("Unknown"),
|
1655 | | - _T("DDraw Blt"),
|
| 1655 | + _T("Blt Vidmem"),
|
| 1656 | + _T("Blt Sysmem"),
|
1656 | 1657 | _T("D3D Quad"),
|
1657 | 1658 | _T("Overlay")
|
1658 | 1659 | };
|
Index: dxglcfg/tests.cpp |
— | — | @@ -1515,13 +1515,13 @@ |
1516 | 1516 | srcformat = 0;
|
1517 | 1517 | destformat = -1;
|
1518 | 1518 | showhud = 1;
|
1519 | | - testpattern = 0;
|
1520 | | - testmethod = 0;
|
| 1519 | + testpattern = 1;
|
| 1520 | + testmethod = 1;
|
1521 | 1521 | error = sprites[0].surface->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL);
|
1522 | 1522 | DrawPalette(ddsd, (unsigned char*)ddsd.lpSurface);
|
1523 | 1523 | error = sprites[0].surface->Unlock(NULL);
|
1524 | 1524 | ddsrender->Blt(NULL, sprites[0].surface, NULL, DDBLT_WAIT, NULL);
|
1525 | | - DrawFormatTestHUD(ddsrender, 0, -1, 1, 0, 0, ddsd.dwWidth, ddsd.dwHeight, 0, DD_OK);
|
| 1525 | + DrawFormatTestHUD(ddsrender, 0, -1, 1, 1, 1, ddsd.dwWidth, ddsd.dwHeight, 0, DD_OK);
|
1526 | 1526 | default:
|
1527 | 1527 | break;
|
1528 | 1528 | }
|
— | — | @@ -2322,13 +2322,13 @@ |
2323 | 2323 | ddsd.ddpfPixelFormat = surfaceformats[srcformat];
|
2324 | 2324 | }
|
2325 | 2325 | error = ddinterface->CreateSurface(&ddsd, &sprites[0].surface, NULL);
|
2326 | | - if(error)
|
| 2326 | + if (error)
|
2327 | 2327 | {
|
2328 | 2328 | errorlocation = 1;
|
2329 | 2329 | errornumber = error;
|
2330 | 2330 | bltfx.dwSize = sizeof(DDBLTFX);
|
2331 | 2331 | bltfx.dwFillColor = 0;
|
2332 | | - ddsrender->Blt(NULL,NULL,NULL,DDBLT_WAIT|DDBLT_COLORFILL,&bltfx);
|
| 2332 | + ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
|
2333 | 2333 | }
|
2334 | 2334 | else
|
2335 | 2335 | {
|
— | — | @@ -2348,15 +2348,67 @@ |
2349 | 2349 | {
|
2350 | 2350 | DrawPalette(ddsd, (unsigned char*)ddsd.lpSurface);
|
2351 | 2351 | error = sprites[0].surface->Unlock(NULL);
|
2352 | | - // FIXME: Get dest surface type
|
2353 | | - error = ddsrender->Blt(NULL, sprites[0].surface, NULL, DDBLT_WAIT, NULL);
|
2354 | | - if(error)
|
| 2352 | + if (destformat != -1)
|
2355 | 2353 | {
|
2356 | | - errorlocation = 5;
|
2357 | | - errornumber = error;
|
2358 | | - bltfx.dwSize = sizeof(DDBLTFX);
|
2359 | | - bltfx.dwFillColor = 0;
|
2360 | | - ddsrender->Blt(NULL,NULL,NULL,DDBLT_WAIT|DDBLT_COLORFILL,&bltfx);
|
| 2354 | + ddsrender->GetSurfaceDesc(&ddsd);
|
| 2355 | + ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
|
| 2356 | + ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
|
| 2357 | + if (destformat > 0)
|
| 2358 | + {
|
| 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);
|
| 2376 | + if (error)
|
| 2377 | + {
|
| 2378 | + errorlocation = 6;
|
| 2379 | + errornumber = error;
|
| 2380 | + bltfx.dwSize = sizeof(DDBLTFX);
|
| 2381 | + bltfx.dwFillColor = 0;
|
| 2382 | + ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
|
| 2383 | + }
|
| 2384 | + else
|
| 2385 | + {
|
| 2386 | + error = ddsrender->Blt(NULL, sprites[1].surface, NULL, DDBLT_WAIT, NULL);
|
| 2387 | + if (error)
|
| 2388 | + {
|
| 2389 | + errorlocation = 7;
|
| 2390 | + errornumber = error;
|
| 2391 | + bltfx.dwSize = sizeof(DDBLTFX);
|
| 2392 | + bltfx.dwFillColor = 0;
|
| 2393 | + ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
|
| 2394 | + }
|
| 2395 | + }
|
| 2396 | + sprites[0].surface->Release();
|
| 2397 | + sprites[0].surface = NULL;
|
| 2398 | + sprites[1].surface->Release();
|
| 2399 | + sprites[1].surface = NULL;
|
| 2400 | + }
|
| 2401 | + }
|
| 2402 | + else
|
| 2403 | + {
|
| 2404 | + error = ddsrender->Blt(NULL, sprites[0].surface, NULL, DDBLT_WAIT, NULL);
|
| 2405 | + if (error)
|
| 2406 | + {
|
| 2407 | + errorlocation = 5;
|
| 2408 | + errornumber = error;
|
| 2409 | + bltfx.dwSize = sizeof(DDBLTFX);
|
| 2410 | + bltfx.dwFillColor = 0;
|
| 2411 | + ddsrender->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &bltfx);
|
| 2412 | + }
|
2361 | 2413 | sprites[0].surface->Release();
|
2362 | 2414 | sprites[0].surface = NULL;
|
2363 | 2415 | }
|