Index: ddraw/glTexture.cpp |
— | — | @@ -69,7 +69,7 @@ |
70 | 70 | static const int START_TEXFORMATS = __LINE__;
|
71 | 71 | const DDPIXELFORMAT texformats[] =
|
72 | 72 | { // Size Flags FOURCC bits R/Ymask G/U/Zmask B/V/STmask A/Zmask
|
73 | | - {sizeof(DDPIXELFORMAT), DDPF_PALETTEINDEXED8, 0, 8, 0, 0, 0, 0}, // 8-bit paletted
|
| 73 | + {sizeof(DDPIXELFORMAT), DDPF_RGB|DDPF_PALETTEINDEXED8, 0, 8, 0, 0, 0, 0}, // 8-bit paletted
|
74 | 74 | {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 8, 0xE0, 0x1C, 0x3, 0}, // 8 bit 332
|
75 | 75 | {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 16, 0x7C00, 0x3E0, 0x1F, 0}, // 15 bit 555
|
76 | 76 | {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 16, 0xF800, 0x7E0, 0x1F, 0}, // 16 bit 565
|
Index: dxglcfg/surfacegen.cpp |
— | — | @@ -1703,10 +1703,10 @@ |
1704 | 1704 | const DDPIXELFORMAT surfaceformats[] =
|
1705 | 1705 | {
|
1706 | 1706 | {0, 0, 0, 0, 0, 0, 0, 0}, // reserved
|
1707 | | - {sizeof(DDPIXELFORMAT), DDPF_PALETTEINDEXED1, 0, 1, 0, 0, 0, 0}, // 8-bit paletted
|
1708 | | - {sizeof(DDPIXELFORMAT), DDPF_PALETTEINDEXED2, 0, 2, 0, 0, 0, 0}, // 8-bit paletted
|
1709 | | - {sizeof(DDPIXELFORMAT), DDPF_PALETTEINDEXED4, 0, 4, 0, 0, 0, 0}, // 8-bit paletted
|
1710 | | - {sizeof(DDPIXELFORMAT), DDPF_PALETTEINDEXED8, 0, 8, 0, 0, 0, 0}, // 8-bit paletted
|
| 1707 | + {sizeof(DDPIXELFORMAT), DDPF_RGB|DDPF_PALETTEINDEXED1, 0, 1, 0, 0, 0, 0}, // 8-bit paletted
|
| 1708 | + {sizeof(DDPIXELFORMAT), DDPF_RGB|DDPF_PALETTEINDEXED2, 0, 2, 0, 0, 0, 0}, // 8-bit paletted
|
| 1709 | + {sizeof(DDPIXELFORMAT), DDPF_RGB|DDPF_PALETTEINDEXED4, 0, 4, 0, 0, 0, 0}, // 8-bit paletted
|
| 1710 | + {sizeof(DDPIXELFORMAT), DDPF_RGB|DDPF_PALETTEINDEXED8, 0, 8, 0, 0, 0, 0}, // 8-bit paletted
|
1711 | 1711 | {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 8, 0xE0, 0x1C, 0x3, 0}, // 8 bit 332
|
1712 | 1712 | {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 16, 0x7C00, 0x3E0, 0x1F, 0}, // 15 bit 555
|
1713 | 1713 | {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 16, 0xF800, 0x7E0, 0x1F, 0}, // 16 bit 565
|
Index: dxglcfg/tests.cpp |
— | — | @@ -28,6 +28,7 @@ |
29 | 29 | void InitTest(int test);
|
30 | 30 | void RunTestTimed(int test);
|
31 | 31 | void RunTestLooped(int test);
|
| 32 | +void RunSurfaceFormatTest();
|
32 | 33 |
|
33 | 34 |
|
34 | 35 | static MultiDirectDraw *ddinterface;
|
— | — | @@ -57,7 +58,7 @@ |
58 | 59 | static BOOL d3dfail = FALSE;
|
59 | 60 | static int errorlocation;
|
60 | 61 | static int errornumber;
|
61 | | -void RunSurfaceFormatTest();
|
| 62 | +static BOOL softd3d;
|
62 | 63 |
|
63 | 64 | #define FVF_COLORVERTEX (D3DFVF_VERTEX | D3DFVF_DIFFUSE | D3DFVF_SPECULAR)
|
64 | 65 | struct COLORVERTEX
|
— | — | @@ -454,6 +455,7 @@ |
455 | 456 | ::height = height;
|
456 | 457 | ::bpp = bpp;
|
457 | 458 | ::refresh = refresh;
|
| 459 | + ::softd3d = softd3d;
|
458 | 460 | if(fullscreen)::backbuffers = backbuffers;
|
459 | 461 | else ::backbuffers = backbuffers = 0;
|
460 | 462 | ::fps = fps;
|
— | — | @@ -561,6 +563,8 @@ |
562 | 564 | {
|
563 | 565 | error = d3d7->CreateDevice(IID_IDirect3DRefDevice, (LPDIRECTDRAWSURFACE7)ddsrender->GetSurface(), &d3d7dev);
|
564 | 566 | if(error != D3D_OK)
|
| 567 | + error = d3d7->CreateDevice(IID_IDirect3DRGBDevice, (LPDIRECTDRAWSURFACE7)ddsrender->GetSurface(), &d3d7dev);
|
| 568 | + if(error == D3D_OK)
|
565 | 569 | error = d3d7->EnumZBufferFormats(IID_IDirect3DRGBDevice, zcallback, &ddpfz);
|
566 | 570 | }
|
567 | 571 | else error = d3d7->EnumZBufferFormats(IID_IDirect3DHALDevice, zcallback, &ddpfz);
|
— | — | @@ -587,7 +591,10 @@ |
588 | 592 | {
|
589 | 593 | error = d3d7->CreateDevice(IID_IDirect3DRefDevice, (LPDIRECTDRAWSURFACE7)ddsrender->GetSurface(), &d3d7dev);
|
590 | 594 | if(error != D3D_OK)
|
| 595 | + {
|
| 596 | + ::softd3d = TRUE;
|
591 | 597 | error = d3d7->CreateDevice(IID_IDirect3DRGBDevice, (LPDIRECTDRAWSURFACE7)ddsrender->GetSurface(), &d3d7dev);
|
| 598 | + }
|
592 | 599 | if (error != D3D_OK)
|
593 | 600 | {
|
594 | 601 | d3dfail = TRUE;
|
— | — | @@ -2535,6 +2542,8 @@ |
2536 | 2543 | ddsrender->GetSurfaceDesc(&ddsd);
|
2537 | 2544 | ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
|
2538 | 2545 | ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;
|
| 2546 | + if(softd3d) ddsd.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY;
|
| 2547 | + else ddsd.ddsCaps.dwCaps2 = DDSCAPS2_TEXTUREMANAGE;
|
2539 | 2548 | if (destformat > 0)
|
2540 | 2549 | {
|
2541 | 2550 | ddsd.dwFlags |= DDSD_PIXELFORMAT;
|