Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9c257586
Commit
9c257586
authored
Feb 28, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Support color keyed WINED3DFMT_B8G8R8A8_UNORM surfaces.
Color keying and alpha channels aren't mutually exclusive.
parent
07f58347
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
6 deletions
+30
-6
state.c
dlls/wined3d/state.c
+1
-6
surface.c
dlls/wined3d/surface.c
+28
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/state.c
View file @
9c257586
...
@@ -538,12 +538,7 @@ static void state_alpha(struct wined3d_context *context, const struct wined3d_st
...
@@ -538,12 +538,7 @@ static void state_alpha(struct wined3d_context *context, const struct wined3d_st
struct
wined3d_surface
*
surf
=
surface_from_resource
(
texture
->
sub_resources
[
0
]);
struct
wined3d_surface
*
surf
=
surface_from_resource
(
texture
->
sub_resources
[
0
]);
if
(
surf
->
CKeyFlags
&
WINEDDSD_CKSRCBLT
)
if
(
surf
->
CKeyFlags
&
WINEDDSD_CKSRCBLT
)
{
enable_ckey
=
TRUE
;
/* The surface conversion does not do color keying conversion for surfaces that have an alpha
* channel on their own. Likewise, the alpha test shouldn't be set up for color keying if the
* surface has alpha bits */
if
(
!
surf
->
resource
.
format
->
alpha_mask
)
enable_ckey
=
TRUE
;
}
}
}
}
}
...
...
dlls/wined3d/surface.c
View file @
9c257586
...
@@ -4554,6 +4554,14 @@ HRESULT d3dfmt_get_conv(const struct wined3d_surface *surface, BOOL need_alpha_c
...
@@ -4554,6 +4554,14 @@ HRESULT d3dfmt_get_conv(const struct wined3d_surface *surface, BOOL need_alpha_c
}
}
break
;
break
;
case
WINED3DFMT_B8G8R8A8_UNORM
:
if
(
colorkey_active
)
{
*
conversion_type
=
WINED3D_CT_CK_ARGB32
;
format
->
conv_byte_count
=
4
;
}
break
;
default:
default:
break
;
break
;
}
}
...
@@ -4765,6 +4773,26 @@ static HRESULT d3dfmt_convert_surface(const BYTE *src, BYTE *dst, UINT pitch, UI
...
@@ -4765,6 +4773,26 @@ static HRESULT d3dfmt_convert_surface(const BYTE *src, BYTE *dst, UINT pitch, UI
}
}
break
;
break
;
case
WINED3D_CT_CK_ARGB32
:
{
unsigned
int
x
,
y
;
for
(
y
=
0
;
y
<
height
;
++
y
)
{
source
=
src
+
pitch
*
y
;
dest
=
dst
+
outpitch
*
y
;
for
(
x
=
0
;
x
<
width
;
++
x
)
{
DWORD
color
=
*
(
const
DWORD
*
)
source
;
if
(
color_in_range
(
&
surface
->
src_blt_color_key
,
color
))
color
&=
~
0xff000000
;
*
(
DWORD
*
)
dest
=
color
;
source
+=
4
;
dest
+=
4
;
}
}
}
break
;
default:
default:
ERR
(
"Unsupported conversion type %#x.
\n
"
,
conversion_type
);
ERR
(
"Unsupported conversion type %#x.
\n
"
,
conversion_type
);
}
}
...
...
dlls/wined3d/wined3d_private.h
View file @
9c257586
...
@@ -2192,6 +2192,7 @@ enum wined3d_conversion_type
...
@@ -2192,6 +2192,7 @@ enum wined3d_conversion_type
WINED3D_CT_CK_5551
,
WINED3D_CT_CK_5551
,
WINED3D_CT_CK_RGB24
,
WINED3D_CT_CK_RGB24
,
WINED3D_CT_RGB32_888
,
WINED3D_CT_RGB32_888
,
WINED3D_CT_CK_ARGB32
,
};
};
HRESULT
d3dfmt_get_conv
(
const
struct
wined3d_surface
*
surface
,
BOOL
need_alpha_ck
,
BOOL
use_texturing
,
HRESULT
d3dfmt_get_conv
(
const
struct
wined3d_surface
*
surface
,
BOOL
need_alpha_ck
,
BOOL
use_texturing
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment