From e51b0070883f4fae46861d6e10b72a609431e88a Mon Sep 17 00:00:00 2001 From: Lionel Ulmer Date: Fri, 3 Jan 2003 21:09:25 +0000 Subject: [PATCH] Fix order of texture enumeration to fix yet another set of dumb games. --- dlls/ddraw/d3ddevice/mesa.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/dlls/ddraw/d3ddevice/mesa.c b/dlls/ddraw/d3ddevice/mesa.c index 55bffc29d19..67ee1162909 100644 --- a/dlls/ddraw/d3ddevice/mesa.c +++ b/dlls/ddraw/d3ddevice/mesa.c @@ -403,16 +403,8 @@ static HRESULT enum_texture_format_OpenGL(LPD3DENUMTEXTUREFORMATSCALLBACK cb_1, if (cb_1) if (cb_1(&sdesc , context) == 0) return DD_OK; if (cb_2) if (cb_2(pformat, context) == 0) return DD_OK; - TRACE("Enumerating GL_RGBA packed GL_UNSIGNED_SHORT_5_5_5_1 (16)\n"); - pformat->dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS; - pformat->u1.dwRGBBitCount = 16; - pformat->u2.dwRBitMask = 0x0000F800; - pformat->u3.dwGBitMask = 0x000007C0; - pformat->u4.dwBBitMask = 0x0000003E; - pformat->u5.dwRGBAlphaBitMask = 0x00000001; - if (cb_1) if (cb_1(&sdesc , context) == 0) return DD_OK; - if (cb_2) if (cb_2(pformat, context) == 0) return DD_OK; - + /* Note : even if this is an 'emulated' texture format, it needs to be first + as some dumb applications seem to rely on that. */ TRACE("Enumerating GL_RGBA packed GL_UNSIGNED_SHORT_1_5_5_5 (ARGB) (16)\n"); pformat->dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS; pformat->u1.dwRGBBitCount = 16; @@ -423,13 +415,13 @@ static HRESULT enum_texture_format_OpenGL(LPD3DENUMTEXTUREFORMATSCALLBACK cb_1, if (cb_1) if (cb_1(&sdesc , context) == 0) return DD_OK; if (cb_2) if (cb_2(pformat, context) == 0) return DD_OK; - TRACE("Enumerating GL_RGBA packed GL_UNSIGNED_SHORT_4_4_4_4 (16)\n"); + TRACE("Enumerating GL_RGBA packed GL_UNSIGNED_SHORT_5_5_5_1 (16)\n"); pformat->dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS; pformat->u1.dwRGBBitCount = 16; - pformat->u2.dwRBitMask = 0x0000F000; - pformat->u3.dwGBitMask = 0x00000F00; - pformat->u4.dwBBitMask = 0x000000F0; - pformat->u5.dwRGBAlphaBitMask = 0x0000000F; + pformat->u2.dwRBitMask = 0x0000F800; + pformat->u3.dwGBitMask = 0x000007C0; + pformat->u4.dwBBitMask = 0x0000003E; + pformat->u5.dwRGBAlphaBitMask = 0x00000001; if (cb_1) if (cb_1(&sdesc , context) == 0) return DD_OK; if (cb_2) if (cb_2(pformat, context) == 0) return DD_OK; @@ -443,6 +435,16 @@ static HRESULT enum_texture_format_OpenGL(LPD3DENUMTEXTUREFORMATSCALLBACK cb_1, if (cb_1) if (cb_1(&sdesc , context) == 0) return DD_OK; if (cb_2) if (cb_2(pformat, context) == 0) return DD_OK; + TRACE("Enumerating GL_RGBA packed GL_UNSIGNED_SHORT_4_4_4_4 (16)\n"); + pformat->dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS; + pformat->u1.dwRGBBitCount = 16; + pformat->u2.dwRBitMask = 0x0000F000; + pformat->u3.dwGBitMask = 0x00000F00; + pformat->u4.dwBBitMask = 0x000000F0; + pformat->u5.dwRGBAlphaBitMask = 0x0000000F; + if (cb_1) if (cb_1(&sdesc , context) == 0) return DD_OK; + if (cb_2) if (cb_2(pformat, context) == 0) return DD_OK; + TRACE("Enumerating GL_RGB packed GL_UNSIGNED_BYTE_3_3_2 (8)\n"); pformat->dwFlags = DDPF_RGB; pformat->u1.dwRGBBitCount = 8; -- 2.11.4.GIT