Stefan Dösinger : wined3d: No color keying on surfaces with an alpha channel.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Oct 6 06:27:47 CDT 2006
Module: wine
Branch: master
Commit: 49deec6139eb07e29dd9e6f70236aa1787fb7738
URL: http://source.winehq.org/git/wine.git/?a=commit;h=49deec6139eb07e29dd9e6f70236aa1787fb7738
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Thu Oct 5 21:31:50 2006 +0200
wined3d: No color keying on surfaces with an alpha channel.
---
dlls/wined3d/surface.c | 65 +-----------------------------------------------
1 files changed, 2 insertions(+), 63 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index dbdfb10..fba597f 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1562,34 +1562,7 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceI
*type = GL_UNSIGNED_INT_8_8_8_8;
}
break;
-#if 0
- /* Not sure if we should do color keying on Alpha-Enabled surfaces */
- case WINED3DFMT_A4R4G4B4:
- if (colorkey_active)
- {
- *convert = CONVERT_CK_4444_ARGB;
- *format = GL_RGBA;
- *internal = GL_RGBA;
- *type = GL_UNSIGNED_SHORT_4_4_4_4;
- }
- break;
- case WINED3DFMT_A1R5G5B5:
- if (colorkey_active)
- {
- *convert = CONVERT_CK_1555;
- }
-
- case WINED3DFMT_A8R8G8B8:
- if (colorkey_active)
- {
- *convert = CONVERT_CK_8888_ARGB;
- *format = GL_RGBA;
- *internal = GL_RGBA;
- *type = GL_UNSIGNED_INT_8_8_8_8;
- }
- break;
-#endif
default:
break;
}
@@ -1677,8 +1650,8 @@ HRESULT d3dfmt_convert_surface(BYTE *src
prevent 'color bleeding'. This will be done later on if ever it is
too visible.
- Note2: when using color-keying + alpha, are the alpha bits part of the
- color-space or not ?
+ Note2: Nvidia documents say that their driver does not support alpha + color keying
+ on the same surface and disables color keying in such a case
*/
unsigned int x;
WORD *Source = (WORD *) src;
@@ -1698,40 +1671,6 @@ HRESULT d3dfmt_convert_surface(BYTE *src
}
break;
- case CONVERT_CK_1555:
- {
- unsigned int x;
- WORD *Source = (WORD *) src;
- WORD *Dest = (WORD *) dst;
-
- for (x = 0; x < len * sizeof(WORD); x+=sizeof(WORD)) {
- WORD color = *Source++;
- *Dest = (color & 0x7FFF);
- if ((color < surf->SrcBltCKey.dwColorSpaceLowValue) ||
- (color > surf->SrcBltCKey.dwColorSpaceHighValue))
- *Dest |= (color & 0x8000);
- Dest++;
- }
- }
- break;
-
- case CONVERT_CK_4444_ARGB:
- {
- /* Move the four Alpha bits... */
- unsigned int x;
- WORD *Source = (WORD *) src;
- WORD *Dest = (WORD *) dst;
-
- for (x = 0; x < len; x++) {
- WORD color = *Source++;
- *dst = (color & 0x0FFF) << 4;
- if ((color < surf->SrcBltCKey.dwColorSpaceLowValue) ||
- (color > surf->SrcBltCKey.dwColorSpaceHighValue))
- *Dest |= (color & 0xF000) >> 12;
- Dest++;
- }
- } break;
-
default:
ERR("Unsupported conversation type %d\n", convert);
}
More information about the wine-cvs
mailing list