Commit ca06f960 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Use the same flags for wined3d_texture_set_color_key() and the…

wined3d: Use the same flags for wined3d_texture_set_color_key() and the "color_key_flags" field it sets. This fixes a regression introduced by commit a8ab5694.
parent 6b462300
...@@ -616,7 +616,7 @@ static void device_load_logo(struct wined3d_device *device, const char *filename ...@@ -616,7 +616,7 @@ static void device_load_logo(struct wined3d_device *device, const char *filename
color_key.color_space_low_value = 0; color_key.color_space_low_value = 0;
color_key.color_space_high_value = 0; color_key.color_space_high_value = 0;
wined3d_texture_set_color_key(device->logo_texture, WINEDDCKEY_SRCBLT, &color_key); wined3d_texture_set_color_key(device->logo_texture, WINED3D_CKEY_SRC_BLT, &color_key);
} }
else else
{ {
......
...@@ -535,7 +535,7 @@ static void state_alpha(struct wined3d_context *context, const struct wined3d_st ...@@ -535,7 +535,7 @@ static void state_alpha(struct wined3d_context *context, const struct wined3d_st
* WINED3D_RS_COLORKEYENABLE state(which is d3d <= 3 only). The texture * WINED3D_RS_COLORKEYENABLE state(which is d3d <= 3 only). The texture
* function will call alpha in case it finds some texture + colorkeyenable * function will call alpha in case it finds some texture + colorkeyenable
* combination which needs extra care. */ * combination which needs extra care. */
if (state->textures[0] && (state->textures[0]->color_key_flags & WINEDDSD_CKSRCBLT)) if (state->textures[0] && (state->textures[0]->color_key_flags & WINED3D_CKEY_SRC_BLT))
enable_ckey = TRUE; enable_ckey = TRUE;
if (enable_ckey || context->last_was_ckey) if (enable_ckey || context->last_was_ckey)
...@@ -3214,7 +3214,7 @@ void tex_alphaop(struct wined3d_context *context, const struct wined3d_state *st ...@@ -3214,7 +3214,7 @@ void tex_alphaop(struct wined3d_context *context, const struct wined3d_state *st
if (texture_dimensions == GL_TEXTURE_2D || texture_dimensions == GL_TEXTURE_RECTANGLE_ARB) if (texture_dimensions == GL_TEXTURE_2D || texture_dimensions == GL_TEXTURE_RECTANGLE_ARB)
{ {
if (texture->color_key_flags & WINEDDSD_CKSRCBLT && !texture->resource.format->alpha_size) if (texture->color_key_flags & WINED3D_CKEY_SRC_BLT && !texture->resource.format->alpha_size)
{ {
/* Color keying needs to pass alpha values from the texture through to have the alpha test work /* Color keying needs to pass alpha values from the texture through to have the alpha test work
* properly. On the other hand applications can still use texture combiners apparently. This code * properly. On the other hand applications can still use texture combiners apparently. This code
......
...@@ -1821,11 +1821,11 @@ void surface_load(struct wined3d_surface *surface, BOOL srgb) ...@@ -1821,11 +1821,11 @@ void surface_load(struct wined3d_surface *surface, BOOL srgb)
if (surface->resource.pool == WINED3D_POOL_SCRATCH) if (surface->resource.pool == WINED3D_POOL_SCRATCH)
ERR("Not supported on scratch surfaces.\n"); ERR("Not supported on scratch surfaces.\n");
ck_changed = !(surface->flags & SFLAG_GLCKEY) != !(surface->container->color_key_flags & WINEDDSD_CKSRCBLT); ck_changed = !(surface->flags & SFLAG_GLCKEY) != !(surface->container->color_key_flags & WINED3D_CKEY_SRC_BLT);
/* Reload if either the texture and sysmem have different ideas about the /* Reload if either the texture and sysmem have different ideas about the
* color key, or the actual key values changed. */ * color key, or the actual key values changed. */
if (ck_changed || ((surface->container->color_key_flags & WINEDDSD_CKSRCBLT) if (ck_changed || ((surface->container->color_key_flags & WINED3D_CKEY_SRC_BLT)
&& (surface->gl_color_key.color_space_low_value && (surface->gl_color_key.color_space_low_value
!= surface->container->src_blt_color_key.color_space_low_value != surface->container->src_blt_color_key.color_space_low_value
|| surface->gl_color_key.color_space_high_value || surface->gl_color_key.color_space_high_value
...@@ -3685,12 +3685,12 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE ...@@ -3685,12 +3685,12 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
else if (flags & WINEDDBLT_KEYSRCOVERRIDE) else if (flags & WINEDDBLT_KEYSRCOVERRIDE)
{ {
/* Use color key from DDBltFx */ /* Use color key from DDBltFx */
wined3d_texture_set_color_key(src_surface->container, WINEDDSD_CKSRCBLT, &DDBltFx->ddckSrcColorkey); wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, &DDBltFx->ddckSrcColorkey);
} }
else else
{ {
/* Do not use color key */ /* Do not use color key */
wined3d_texture_set_color_key(src_surface->container, WINEDDSD_CKSRCBLT, NULL); wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, NULL);
} }
surface_blt_to_drawable(device, filter, surface_blt_to_drawable(device, filter,
...@@ -3698,8 +3698,8 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE ...@@ -3698,8 +3698,8 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
src_surface, src_rect, dst_surface, dst_rect); src_surface, src_rect, dst_surface, dst_rect);
/* Restore the color key parameters */ /* Restore the color key parameters */
wined3d_texture_set_color_key(src_surface->container, WINEDDSD_CKSRCBLT, wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT,
(old_color_key_flags & WINEDDSD_CKSRCBLT) ? &old_blt_key : NULL); (old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL);
surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding);
surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding);
...@@ -4178,7 +4178,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface, ...@@ -4178,7 +4178,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
wined3d_texture_prepare_texture(texture, context, srgb); wined3d_texture_prepare_texture(texture, context, srgb);
wined3d_texture_bind_and_dirtify(texture, context, srgb); wined3d_texture_bind_and_dirtify(texture, context, srgb);
if (texture->color_key_flags & WINEDDSD_CKSRCBLT) if (texture->color_key_flags & WINED3D_CKEY_SRC_BLT)
{ {
surface->flags |= SFLAG_GLCKEY; surface->flags |= SFLAG_GLCKEY;
surface->gl_color_key = texture->src_blt_color_key; surface->gl_color_key = texture->src_blt_color_key;
......
...@@ -557,7 +557,7 @@ HRESULT CDECL wined3d_texture_set_color_key(struct wined3d_texture *texture, ...@@ -557,7 +557,7 @@ HRESULT CDECL wined3d_texture_set_color_key(struct wined3d_texture *texture,
{ {
TRACE("texture %p, flags %#x, color_key %p.\n", texture, flags, color_key); TRACE("texture %p, flags %#x, color_key %p.\n", texture, flags, color_key);
if (flags & WINEDDCKEY_COLORSPACE) if (flags & WINED3D_CKEY_COLORSPACE)
{ {
FIXME("Unhandled flags %#x.\n", flags); FIXME("Unhandled flags %#x.\n", flags);
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
...@@ -565,47 +565,47 @@ HRESULT CDECL wined3d_texture_set_color_key(struct wined3d_texture *texture, ...@@ -565,47 +565,47 @@ HRESULT CDECL wined3d_texture_set_color_key(struct wined3d_texture *texture,
if (color_key) if (color_key)
{ {
switch (flags & ~WINEDDCKEY_COLORSPACE) switch (flags & ~WINED3D_CKEY_COLORSPACE)
{ {
case WINEDDCKEY_DESTBLT: case WINED3D_CKEY_DST_BLT:
texture->dst_blt_color_key = *color_key; texture->dst_blt_color_key = *color_key;
texture->color_key_flags |= WINEDDSD_CKDESTBLT; texture->color_key_flags |= WINED3D_CKEY_DST_BLT;
break; break;
case WINEDDCKEY_DESTOVERLAY: case WINED3D_CKEY_DST_OVERLAY:
texture->dst_overlay_color_key = *color_key; texture->dst_overlay_color_key = *color_key;
texture->color_key_flags |= WINEDDSD_CKDESTOVERLAY; texture->color_key_flags |= WINED3D_CKEY_DST_OVERLAY;
break; break;
case WINEDDCKEY_SRCOVERLAY: case WINED3D_CKEY_SRC_BLT:
texture->src_overlay_color_key = *color_key; texture->src_blt_color_key = *color_key;
texture->color_key_flags |= WINEDDSD_CKSRCOVERLAY; texture->color_key_flags |= WINED3D_CKEY_SRC_BLT;
break; break;
case WINEDDCKEY_SRCBLT: case WINED3D_CKEY_SRC_OVERLAY:
texture->src_blt_color_key = *color_key; texture->src_overlay_color_key = *color_key;
texture->color_key_flags |= WINEDDSD_CKSRCBLT; texture->color_key_flags |= WINED3D_CKEY_SRC_OVERLAY;
break; break;
} }
} }
else else
{ {
switch (flags & ~WINEDDCKEY_COLORSPACE) switch (flags & ~WINED3D_CKEY_COLORSPACE)
{ {
case WINEDDCKEY_DESTBLT: case WINED3D_CKEY_DST_BLT:
texture->color_key_flags &= ~WINEDDSD_CKDESTBLT; texture->color_key_flags &= ~WINED3D_CKEY_DST_BLT;
break; break;
case WINEDDCKEY_DESTOVERLAY: case WINED3D_CKEY_DST_OVERLAY:
texture->color_key_flags &= ~WINEDDSD_CKDESTOVERLAY; texture->color_key_flags &= ~WINED3D_CKEY_DST_OVERLAY;
break; break;
case WINEDDCKEY_SRCOVERLAY: case WINED3D_CKEY_SRC_BLT:
texture->color_key_flags &= ~WINEDDSD_CKSRCOVERLAY; texture->color_key_flags &= ~WINED3D_CKEY_SRC_BLT;
break; break;
case WINEDDCKEY_SRCBLT: case WINED3D_CKEY_SRC_OVERLAY:
texture->color_key_flags &= ~WINEDDSD_CKSRCBLT; texture->color_key_flags &= ~WINED3D_CKEY_SRC_OVERLAY;
break; break;
} }
} }
......
...@@ -795,7 +795,7 @@ const struct wined3d_color_key_conversion * wined3d_format_get_color_key_convers ...@@ -795,7 +795,7 @@ const struct wined3d_color_key_conversion * wined3d_format_get_color_key_convers
WINED3DFMT_B8G8R8A8_UNORM, convert_p8_uint_b8g8r8a8_unorm WINED3DFMT_B8G8R8A8_UNORM, convert_p8_uint_b8g8r8a8_unorm
}; };
if (need_alpha_ck && (texture->color_key_flags & WINEDDSD_CKSRCBLT)) if (need_alpha_ck && (texture->color_key_flags & WINED3D_CKEY_SRC_BLT))
{ {
for (i = 0; i < sizeof(color_key_info) / sizeof(*color_key_info); ++i) for (i = 0; i < sizeof(color_key_info) / sizeof(*color_key_info); ++i)
{ {
...@@ -3527,7 +3527,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d ...@@ -3527,7 +3527,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d
if (texture_dimensions == GL_TEXTURE_2D || texture_dimensions == GL_TEXTURE_RECTANGLE_ARB) if (texture_dimensions == GL_TEXTURE_2D || texture_dimensions == GL_TEXTURE_RECTANGLE_ARB)
{ {
if (texture->color_key_flags & WINEDDSD_CKSRCBLT && !texture->resource.format->alpha_size) if (texture->color_key_flags & WINED3D_CKEY_SRC_BLT && !texture->resource.format->alpha_size)
{ {
if (aop == WINED3D_TOP_DISABLE) if (aop == WINED3D_TOP_DISABLE)
{ {
......
...@@ -1246,6 +1246,12 @@ enum wined3d_display_rotation ...@@ -1246,6 +1246,12 @@ enum wined3d_display_rotation
#define WINED3D_RESZ_CODE 0x7fa05000 #define WINED3D_RESZ_CODE 0x7fa05000
#define WINED3D_CKEY_COLORSPACE 0x00000001
#define WINED3D_CKEY_DST_BLT 0x00000002
#define WINED3D_CKEY_DST_OVERLAY 0x00000004
#define WINED3D_CKEY_SRC_BLT 0x00000008
#define WINED3D_CKEY_SRC_OVERLAY 0x00000010
/* dwDDFX */ /* dwDDFX */
/* arithmetic stretching along y axis */ /* arithmetic stretching along y axis */
#define WINEDDBLTFX_ARITHSTRETCHY 0x00000001 #define WINEDDBLTFX_ARITHSTRETCHY 0x00000001
...@@ -1296,35 +1302,6 @@ enum wined3d_display_rotation ...@@ -1296,35 +1302,6 @@ enum wined3d_display_rotation
#define WINEDDBLT_DONOTWAIT 0x08000000 #define WINEDDBLT_DONOTWAIT 0x08000000
#define WINEDDBLT_ALPHATEST 0x80000000 #define WINEDDBLT_ALPHATEST 0x80000000
/* DDSURFACEDESC.dwFlags */
#define WINEDDSD_CAPS 0x00000001
#define WINEDDSD_HEIGHT 0x00000002
#define WINEDDSD_WIDTH 0x00000004
#define WINEDDSD_PITCH 0x00000008
#define WINEDDSD_BACKBUFFERCOUNT 0x00000020
#define WINEDDSD_ZBUFFERBITDEPTH 0x00000040
#define WINEDDSD_ALPHABITDEPTH 0x00000080
#define WINEDDSD_LPSURFACE 0x00000800
#define WINEDDSD_PIXELFORMAT 0x00001000
#define WINEDDSD_CKDESTOVERLAY 0x00002000
#define WINEDDSD_CKDESTBLT 0x00004000
#define WINEDDSD_CKSRCOVERLAY 0x00008000
#define WINEDDSD_CKSRCBLT 0x00010000
#define WINEDDSD_MIPMAPCOUNT 0x00020000
#define WINEDDSD_REFRESHRATE 0x00040000
#define WINEDDSD_LINEARSIZE 0x00080000
#define WINEDDSD_TEXTURESTAGE 0x00100000
#define WINEDDSD_FVF 0x00200000
#define WINEDDSD_SRCVBHANDLE 0x00400000
#define WINEDDSD_ALL 0x007ff9ee
/* Set/Get Colour Key Flags */
#define WINEDDCKEY_COLORSPACE 0x00000001 /* Struct is single colour space */
#define WINEDDCKEY_DESTBLT 0x00000002 /* To be used as dest for blt */
#define WINEDDCKEY_DESTOVERLAY 0x00000004 /* To be used as dest for CK overlays */
#define WINEDDCKEY_SRCBLT 0x00000008 /* To be used as src for blt */
#define WINEDDCKEY_SRCOVERLAY 0x00000010 /* To be used as src for CK overlays */
/* dwFlags for GetBltStatus */ /* dwFlags for GetBltStatus */
#define WINEDDGBS_CANBLT 0x00000001 #define WINEDDGBS_CANBLT 0x00000001
#define WINEDDGBS_ISBLTDONE 0x00000002 #define WINEDDGBS_ISBLTDONE 0x00000002
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment