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
cb8a8182
Commit
cb8a8182
authored
May 22, 2007
by
Kolbjoern Fredheim
Committed by
Alexandre Julliard
May 22, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implemented converting X1R5G5B5 format to R5G5B5A1 to emulate color-keying.
parent
071ea06a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
surface.c
dlls/wined3d/surface.c
+35
-0
No files found.
dlls/wined3d/surface.c
View file @
cb8a8182
...
...
@@ -1532,6 +1532,15 @@ static HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BO
}
break
;
case
WINED3DFMT_X1R5G5B5
:
if
(
colorkey_active
)
{
*
convert
=
CONVERT_CK_5551
;
*
format
=
GL_BGRA
;
*
internal
=
GL_RGBA
;
*
type
=
GL_UNSIGNED_SHORT_1_5_5_5_REV
;
}
break
;
case
WINED3DFMT_R8G8B8
:
if
(
colorkey_active
)
{
*
convert
=
CONVERT_CK_RGB24
;
...
...
@@ -1720,6 +1729,32 @@ HRESULT d3dfmt_convert_surface(BYTE *src, BYTE *dst, UINT pitch, UINT width, UIN
}
break
;
case
CONVERT_CK_5551
:
{
/* Converting X1R5G5B5 format to R5G5B5A1 to emulate color-keying. */
unsigned
int
x
,
y
;
WORD
*
Source
;
WORD
*
Dest
;
TRACE
(
"Color keyed 5551
\n
"
);
for
(
y
=
0
;
y
<
height
;
y
++
)
{
Source
=
(
WORD
*
)
(
src
+
y
*
pitch
);
Dest
=
(
WORD
*
)
(
dst
+
y
*
outpitch
);
for
(
x
=
0
;
x
<
width
;
x
++
)
{
WORD
color
=
*
Source
++
;
*
Dest
=
color
;
if
((
color
<
surf
->
SrcBltCKey
.
dwColorSpaceLowValue
)
||
(
color
>
surf
->
SrcBltCKey
.
dwColorSpaceHighValue
))
{
*
Dest
|=
(
1
<<
15
);
}
else
{
*
Dest
&=
~
(
1
<<
15
);
}
Dest
++
;
}
}
}
break
;
case
CONVERT_V8U8
:
{
unsigned
int
x
,
y
;
...
...
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