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
2c5a41b0
Commit
2c5a41b0
authored
Jul 16, 2002
by
Tony Lambregts
Committed by
Alexandre Julliard
Jul 16, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support DDBLT_DDFX flag in DirectDrawSurface_Blt.
parent
65b845b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
138 additions
and
44 deletions
+138
-44
dib.c
dlls/ddraw/dsurface/dib.c
+138
-44
No files found.
dlls/ddraw/dsurface/dib.c
View file @
2c5a41b0
...
...
@@ -570,50 +570,144 @@ DIB_DirectDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst,
last_sy
=
sy
;
}
}
}
else
if
(
dwFlags
&
(
DDBLT_KEYSRC
|
DDBLT_KEYDEST
|
DDBLT_KEYSRCOVERRIDE
|
DDBLT_KEYDESTOVERRIDE
))
{
DWORD
keylow
,
keyhigh
;
if
(
dwFlags
&
DDBLT_KEYSRC
)
{
keylow
=
sdesc
.
ddckCKSrcBlt
.
dwColorSpaceLowValue
;
keyhigh
=
sdesc
.
ddckCKSrcBlt
.
dwColorSpaceHighValue
;
}
else
if
(
dwFlags
&
DDBLT_KEYDEST
){
/* I'm not sure if this is correct */
FIXME
(
"DDBLT_KEYDEST not fully supported yet.
\n
"
);
keylow
=
ddesc
.
ddckCKDestBlt
.
dwColorSpaceLowValue
;
keyhigh
=
ddesc
.
ddckCKDestBlt
.
dwColorSpaceHighValue
;
}
else
if
(
dwFlags
&
DDBLT_KEYSRCOVERRIDE
)
{
keylow
=
lpbltfx
->
ddckSrcColorkey
.
dwColorSpaceLowValue
;
keyhigh
=
lpbltfx
->
ddckSrcColorkey
.
dwColorSpaceHighValue
;
}
else
{
keylow
=
lpbltfx
->
ddckDestColorkey
.
dwColorSpaceLowValue
;
keyhigh
=
lpbltfx
->
ddckDestColorkey
.
dwColorSpaceHighValue
;
}
for
(
y
=
sy
=
0
;
y
<
dstheight
;
y
++
,
sy
+=
yinc
)
{
sbuf
=
sbase
+
(
sy
>>
16
)
*
sdesc
.
u1
.
lPitch
;
#define COPYROW_COLORKEY(type) { \
type *s = (type *) sbuf, *d = (type *) dbuf, tmp; \
for (x = sx = 0; x < dstwidth; x++, sx += xinc) { \
tmp = s[sx >> 16]; \
if (tmp < keylow || tmp > keyhigh) d[x] = tmp; \
} \
break; }
switch
(
bpp
)
{
case
1
:
COPYROW_COLORKEY
(
BYTE
)
case
2
:
COPYROW_COLORKEY
(
WORD
)
case
4
:
COPYROW_COLORKEY
(
DWORD
)
default:
FIXME
(
"%s color-keyed blit not implemented for bpp %d!
\n
"
,
(
dwFlags
&
DDBLT_KEYSRC
)
?
"Source"
:
"Destination"
,
bpp
*
8
);
ret
=
DDERR_UNSUPPORTED
;
goto
error
;
}
dbuf
+=
ddesc
.
u1
.
lPitch
;
}
#undef COPYROW_COLORKEY
dwFlags
&=
~
(
DDBLT_KEYSRC
|
DDBLT_KEYDEST
|
DDBLT_KEYSRCOVERRIDE
|
DDBLT_KEYDESTOVERRIDE
);
}
else
{
LONG
dstyinc
=
ddesc
.
u1
.
lPitch
,
dstxinc
=
bpp
;
DWORD
keylow
=
0
,
keyhigh
=
0
;
if
(
dwFlags
&
(
DDBLT_KEYSRC
|
DDBLT_KEYDEST
|
DDBLT_KEYSRCOVERRIDE
|
DDBLT_KEYDESTOVERRIDE
))
{
if
(
dwFlags
&
DDBLT_KEYSRC
)
{
keylow
=
sdesc
.
ddckCKSrcBlt
.
dwColorSpaceLowValue
;
keyhigh
=
sdesc
.
ddckCKSrcBlt
.
dwColorSpaceHighValue
;
}
else
if
(
dwFlags
&
DDBLT_KEYDEST
){
keylow
=
ddesc
.
ddckCKDestBlt
.
dwColorSpaceLowValue
;
keyhigh
=
ddesc
.
ddckCKDestBlt
.
dwColorSpaceHighValue
;
}
else
if
(
dwFlags
&
DDBLT_KEYSRCOVERRIDE
)
{
keylow
=
lpbltfx
->
ddckSrcColorkey
.
dwColorSpaceLowValue
;
keyhigh
=
lpbltfx
->
ddckSrcColorkey
.
dwColorSpaceHighValue
;
}
else
{
keylow
=
lpbltfx
->
ddckDestColorkey
.
dwColorSpaceLowValue
;
keyhigh
=
lpbltfx
->
ddckDestColorkey
.
dwColorSpaceHighValue
;
}
dwFlags
&=
~
(
DDBLT_KEYSRC
|
DDBLT_KEYDEST
|
DDBLT_KEYSRCOVERRIDE
|
DDBLT_KEYDESTOVERRIDE
);
}
if
(
dwFlags
&
DDBLT_DDFX
)
{
LPBYTE
dTopLeft
,
dTopRight
,
dBottomLeft
,
dBottomRight
,
tmp
;
LONG
tmpxy
;
dTopLeft
=
dbuf
;
dTopRight
=
dbuf
+
((
dstwidth
-
1
)
*
bpp
);
dBottomLeft
=
dTopLeft
+
((
dstheight
-
1
)
*
ddesc
.
u1
.
lPitch
);
dBottomRight
=
dBottomLeft
+
((
dstwidth
-
1
)
*
bpp
);
if
(
lpbltfx
->
dwDDFX
&
DDBLTFX_ARITHSTRETCHY
){
/* I don't think we need to do anything about this flag */
WARN
(
"dwflags=DDBLT_DDFX nothing done for DDBLTFX_ARITHSTRETCHY
\n
"
);
}
if
(
lpbltfx
->
dwDDFX
&
DDBLTFX_MIRRORLEFTRIGHT
)
{
tmp
=
dTopRight
;
dTopRight
=
dTopLeft
;
dTopLeft
=
tmp
;
tmp
=
dBottomRight
;
dBottomRight
=
dBottomLeft
;
dBottomLeft
=
tmp
;
dstxinc
=
dstxinc
*-
1
;
}
if
(
lpbltfx
->
dwDDFX
&
DDBLTFX_MIRRORUPDOWN
)
{
tmp
=
dTopLeft
;
dTopLeft
=
dBottomLeft
;
dBottomLeft
=
tmp
;
tmp
=
dTopRight
;
dTopRight
=
dBottomRight
;
dBottomRight
=
tmp
;
dstyinc
=
dstyinc
*-
1
;
}
if
(
lpbltfx
->
dwDDFX
&
DDBLTFX_NOTEARING
)
{
/* I don't think we need to do anything about this flag */
WARN
(
"dwflags=DDBLT_DDFX nothing done for DDBLTFX_NOTEARING
\n
"
);
}
if
(
lpbltfx
->
dwDDFX
&
DDBLTFX_ROTATE180
)
{
tmp
=
dBottomRight
;
dBottomRight
=
dTopLeft
;
dTopLeft
=
tmp
;
tmp
=
dBottomLeft
;
dBottomLeft
=
dTopRight
;
dTopRight
=
tmp
;
dstxinc
=
dstxinc
*
-
1
;
dstyinc
=
dstyinc
*
-
1
;
}
if
(
lpbltfx
->
dwDDFX
&
DDBLTFX_ROTATE270
)
{
tmp
=
dTopLeft
;
dTopLeft
=
dBottomLeft
;
dBottomLeft
=
dBottomRight
;
dBottomRight
=
dTopRight
;
dTopRight
=
tmp
;
tmpxy
=
dstxinc
;
dstxinc
=
dstyinc
;
dstyinc
=
tmpxy
;
dstxinc
=
dstxinc
*
-
1
;
}
if
(
lpbltfx
->
dwDDFX
&
DDBLTFX_ROTATE90
)
{
tmp
=
dTopLeft
;
dTopLeft
=
dTopRight
;
dTopRight
=
dBottomRight
;
dBottomRight
=
dBottomLeft
;
dBottomLeft
=
tmp
;
tmpxy
=
dstxinc
;
dstxinc
=
dstyinc
;
dstyinc
=
tmpxy
;
dstyinc
=
dstyinc
*
-
1
;
}
if
(
lpbltfx
->
dwDDFX
&
DDBLTFX_ZBUFFERBASEDEST
)
{
/* I don't think we need to do anything about this flag */
WARN
(
"dwflags=DDBLT_DDFX nothing done for DDBLTFX_ZBUFFERBASEDEST
\n
"
);
}
dbuf
=
dTopLeft
;
dwFlags
&=
~
(
DDBLT_DDFX
);
}
#define COPY_COLORKEY_FX(type) { \
type *s = (type *) sbuf, *d = (type *) dbuf, *dx, tmp; \
for (y = sy = 0; y < dstheight; y++, sy += yinc) { \
(LPBYTE)s = sbase + (sy >> 16) * sdesc.u1.lPitch; \
(LPBYTE)dx = d; \
for (x = sx = 0; x < dstwidth; x++, sx += xinc) { \
tmp = s[sx >> 16]; \
if (tmp < keylow || tmp > keyhigh) dx[0] = tmp; \
(LPBYTE)dx += dstxinc; \
} \
(LPBYTE)d += dstyinc; \
} \
break; }
switch
(
bpp
)
{
case
1
:
COPY_COLORKEY_FX
(
BYTE
)
case
2
:
COPY_COLORKEY_FX
(
WORD
)
case
4
:
COPY_COLORKEY_FX
(
DWORD
)
case
3
:
{
LPBYTE
s
,
d
=
dbuf
,
dx
;
for
(
y
=
sy
=
0
;
y
<
dstheight
;
y
++
,
sy
+=
yinc
)
{
sbuf
=
sbase
+
(
sy
>>
16
)
*
sdesc
.
u1
.
lPitch
;
dx
=
d
;
for
(
x
=
sx
=
0
;
x
<
dstwidth
;
x
++
,
sx
+=
xinc
)
{
DWORD
pixel
;
s
=
sbuf
+
3
*
(
sx
>>
16
);
pixel
=
(
s
[
0
]
<<
16
)
|
(
s
[
1
]
<<
8
)
|
s
[
2
];
if
(
pixel
<
keylow
||
pixel
>
keyhigh
){
dx
[
0
]
=
(
pixel
>>
16
)
&
0xff
;
dx
[
1
]
=
(
pixel
>>
8
)
&
0xff
;
dx
[
2
]
=
(
pixel
)
&
0xff
;
}
dx
+=
dstxinc
;
}
d
+=
dstyinc
;
}
break
;}
default:
FIXME
(
"%s color-keyed blit not implemented for bpp %d!
\n
"
,
(
dwFlags
&
DDBLT_KEYSRC
)
?
"Source"
:
"Destination"
,
bpp
*
8
);
ret
=
DDERR_UNSUPPORTED
;
goto
error
;
#undef COPY_COLORKEY_FX
}
}
}
...
...
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