Index: ddraw/glDirect3DDevice.cpp |
— | — | @@ -653,29 +653,15 @@ |
654 | 654 | ERR(DDERR_GENERIC);
|
655 | 655 | }
|
656 | 656 |
|
657 | | -// Use EXACTLY one line per entry. Don't change layout of the list.
|
658 | | -const int TEXFMT_START = __LINE__;
|
659 | | -const DDPIXELFORMAT texpixelformats[] =
|
660 | | -{
|
661 | | - {sizeof(DDPIXELFORMAT),DDPF_RGB|DDPF_ALPHAPIXELS,0,16,0xF00,0xF0,0xF,0xF000},
|
662 | | - {sizeof(DDPIXELFORMAT),DDPF_RGB|DDPF_ALPHAPIXELS,0,16,0x7C00,0x3E0,0x1F,0x8000},
|
663 | | - {sizeof(DDPIXELFORMAT),DDPF_RGB,0,16,0x7C00,0x3E0,0x1F,0},
|
664 | | - {sizeof(DDPIXELFORMAT),DDPF_RGB,0,16,0xF800,0x7E0,0x1F,0},
|
665 | | - {sizeof(DDPIXELFORMAT),DDPF_RGB|DDPF_ALPHAPIXELS,0,32,0xFF0000,0xFF00,0xFF,0xFF000000},
|
666 | | - {sizeof(DDPIXELFORMAT),DDPF_RGB,0,32,0xFF0000,0xFF00,0xFF,0},
|
667 | | - {sizeof(DDPIXELFORMAT),DDPF_RGB,0,24,0xFF0000,0xFF00,0xFF,0}
|
668 | | -};
|
669 | | -const int TEXFMT_END = __LINE__ - 4;
|
670 | | -const int numtexfmt = TEXFMT_END-TEXFMT_START;
|
671 | | -
|
672 | 657 | HRESULT WINAPI glDirect3DDevice7::EnumTextureFormats(LPD3DENUMPIXELFORMATSCALLBACK lpd3dEnumPixelProc, LPVOID lpArg)
|
673 | 658 | {
|
674 | 659 | if(!this) return DDERR_INVALIDOBJECT;
|
675 | 660 | HRESULT result;
|
676 | 661 | DDPIXELFORMAT fmt;
|
677 | | - for(int i = 0; i < numtexfmt; i++)
|
| 662 | + for(int i = 0; i < numtexformats; i++)
|
678 | 663 | {
|
679 | | - memcpy(&fmt,&texpixelformats[i],sizeof(DDPIXELFORMAT));
|
| 664 | + if(::texformats[i].dwFlags & DDPF_ZBUFFER) continue;
|
| 665 | + memcpy(&fmt,&::texformats[i],sizeof(DDPIXELFORMAT));
|
680 | 666 | result = lpd3dEnumPixelProc(&fmt,lpArg);
|
681 | 667 | if(result != D3DENUMRET_OK) return D3D_OK;
|
682 | 668 | }
|
Index: ddraw/texture.cpp |
— | — | @@ -19,6 +19,7 @@ |
20 | 20 | #include "texture.h"
|
21 | 21 | #include "glRenderer.h"
|
22 | 22 |
|
| 23 | +// Use EXACTLY one line per entry. Don't change layout of the list.
|
23 | 24 | const int START_TEXFORMATS = __LINE__;
|
24 | 25 | const DDPIXELFORMAT texformats[] =
|
25 | 26 | { // Size Flags FOURCC bits R/Ymask G/U/Zmask B/V/STmask A/Zmask
|
Index: ddraw/texture.h |
— | — | @@ -45,6 +45,7 @@ |
46 | 46 | extern void (*_DeleteTexture)(TEXTURE *texture);
|
47 | 47 | extern void (*_UploadTexture)(TEXTURE *texture, int level, const void *data, int width, int height);
|
48 | 48 | extern void (*_DownloadTexture)(TEXTURE *texture, int level, void *data);
|
| 49 | +extern const DDPIXELFORMAT texformats[];
|
| 50 | +extern const int numtexformats;
|
49 | 51 |
|
50 | | -
|
51 | 52 | #endif //_TEXTURE_H |
\ No newline at end of file |