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
f0339d22
Commit
f0339d22
authored
Jun 13, 2003
by
Lionel Ulmer
Committed by
Alexandre Julliard
Jun 13, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the BLT COLOR_FILL case.
parent
b2844d2c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
11 deletions
+81
-11
mesa.c
dlls/ddraw/d3ddevice/mesa.c
+81
-11
No files found.
dlls/ddraw/d3ddevice/mesa.c
View file @
f0339d22
...
...
@@ -1213,7 +1213,7 @@ static void draw_primitive_strided(IDirect3DDeviceImpl *This,
}
for
(
tex_stage
=
0
;
tex_stage
<
num_active_stages
;
tex_stage
++
)
{
int
tex_index
=
This
->
state_block
.
texture_stage_state
[
tex_stage
][
D3DTSS_TEXCOORDINDEX
-
1
]
&
0xFFFF000
;
int
tex_index
=
This
->
state_block
.
texture_stage_state
[
tex_stage
][
D3DTSS_TEXCOORDINDEX
-
1
]
&
0xFFFF000
0
;
if
(
tex_index
>=
num_tex_index
)
{
handle_textures
((
D3DVALUE
*
)
no_index
,
tex_stage
);
}
else
{
...
...
@@ -2479,19 +2479,89 @@ d3ddevice_blt(IDirectDrawSurfaceImpl *This, LPRECT rdst,
{
if
(
dwFlags
&
DDBLT_COLORFILL
)
{
/* This is easy to handle for the D3D Device... */
DWORD
color
=
lpbltfx
->
u5
.
dwFillColor
;
D3DRECT
rect
;
DWORD
color
;
D3DRECT
rect
;
GLenum
prev_draw
;
BOOL
is_front
;
/* First check if we BLT to the backbuffer... */
if
((
This
->
surface_desc
.
ddsCaps
.
dwCaps
&
(
DDSCAPS_BACKBUFFER
))
!=
0
)
{
is_front
=
FALSE
;
}
else
if
((
This
->
surface_desc
.
ddsCaps
.
dwCaps
&
(
DDSCAPS_FRONTBUFFER
|
DDSCAPS_PRIMARYSURFACE
))
!=
0
)
{
is_front
=
TRUE
;
}
else
{
ERR
(
"Only BLT override to front or back-buffer is supported for now !
\n
"
);
return
DDERR_INVALIDPARAMS
;
}
/* The color as given in the Blt function is in the format of the frame-buffer...
* 'clear' expect it in ARGB format => we need to do some conversion :-)
*/
if
(
This
->
surface_desc
.
u4
.
ddpfPixelFormat
.
dwFlags
&
DDPF_PALETTEINDEXED8
)
{
if
(
This
->
palette
)
{
color
=
((
0xFF000000
)
|
(
This
->
palette
->
palents
[
lpbltfx
->
u5
.
dwFillColor
].
peRed
<<
16
)
|
(
This
->
palette
->
palents
[
lpbltfx
->
u5
.
dwFillColor
].
peGreen
<<
8
)
|
(
This
->
palette
->
palents
[
lpbltfx
->
u5
.
dwFillColor
].
peBlue
));
}
else
{
color
=
0xFF000000
;
}
}
else
if
((
This
->
surface_desc
.
u4
.
ddpfPixelFormat
.
dwFlags
&
DDPF_RGB
)
&&
(((
This
->
surface_desc
.
u4
.
ddpfPixelFormat
.
dwFlags
&
DDPF_ALPHAPIXELS
)
==
0
)
||
(
This
->
surface_desc
.
u4
.
ddpfPixelFormat
.
u5
.
dwRGBAlphaBitMask
==
0x00000000
)))
{
if
((
This
->
surface_desc
.
u4
.
ddpfPixelFormat
.
u1
.
dwRGBBitCount
==
16
)
&&
(
This
->
surface_desc
.
u4
.
ddpfPixelFormat
.
u2
.
dwRBitMask
==
0xF800
)
&&
(
This
->
surface_desc
.
u4
.
ddpfPixelFormat
.
u3
.
dwGBitMask
==
0x07E0
)
&&
(
This
->
surface_desc
.
u4
.
ddpfPixelFormat
.
u4
.
dwBBitMask
==
0x001F
))
{
if
(
lpbltfx
->
u5
.
dwFillColor
==
0xFFFF
)
{
color
=
0xFFFFFFFF
;
}
else
{
color
=
((
0xFF000000
)
|
((
lpbltfx
->
u5
.
dwFillColor
&
0xF800
)
<<
8
)
|
((
lpbltfx
->
u5
.
dwFillColor
&
0x07E0
)
<<
5
)
|
((
lpbltfx
->
u5
.
dwFillColor
&
0x001F
)
<<
3
));
}
}
else
if
(((
This
->
surface_desc
.
u4
.
ddpfPixelFormat
.
u1
.
dwRGBBitCount
==
32
)
||
(
This
->
surface_desc
.
u4
.
ddpfPixelFormat
.
u1
.
dwRGBBitCount
==
24
))
&&
(
This
->
surface_desc
.
u4
.
ddpfPixelFormat
.
u2
.
dwRBitMask
==
0x00FF0000
)
&&
(
This
->
surface_desc
.
u4
.
ddpfPixelFormat
.
u3
.
dwGBitMask
==
0x0000FF00
)
&&
(
This
->
surface_desc
.
u4
.
ddpfPixelFormat
.
u4
.
dwBBitMask
==
0x000000FF
))
{
color
=
0xFF000000
|
lpbltfx
->
u5
.
dwFillColor
;
}
else
{
ERR
(
"Wrong surface type for BLT override (unknown RGB format) !
\n
"
);
return
DDERR_INVALIDPARAMS
;
}
}
else
{
ERR
(
"Wrong surface type for BLT override !
\n
"
);
return
DDERR_INVALIDPARAMS
;
}
TRACE
(
" executing D3D Device override.
\n
"
);
if
(
rdst
)
{
rect
.
u1
.
x1
=
rdst
->
left
;
rect
.
u2
.
y1
=
rdst
->
top
;
rect
.
u3
.
x2
=
rdst
->
right
;
rect
.
u4
.
y2
=
rdst
->
bottom
;
}
ENTER_GL
();
if
(
rdst
)
{
rect
.
u1
.
x1
=
rdst
->
left
;
rect
.
u2
.
y1
=
rdst
->
top
;
rect
.
u3
.
x2
=
rdst
->
right
;
rect
.
u4
.
y2
=
rdst
->
bottom
;
}
d3ddevice_clear
(
This
->
d3ddevice
,
rdst
!=
NULL
?
1
:
0
,
&
rect
,
D3DCLEAR_TARGET
,
color
,
0
.
0
,
0x00000000
);
return
DD_OK
;
glGetIntegerv
(
GL_DRAW_BUFFER
,
&
prev_draw
);
if
(
is_front
)
glDrawBuffer
(
GL_FRONT
);
else
glDrawBuffer
(
GL_BACK
);
d3ddevice_clear
(
This
->
d3ddevice
,
rdst
!=
NULL
?
1
:
0
,
&
rect
,
D3DCLEAR_TARGET
,
color
,
0
.
0
,
0x00000000
);
if
(((
is_front
)
&&
(
prev_draw
==
GL_BACK
))
||
((
!
is_front
)
&&
(
prev_draw
==
GL_FRONT
)))
glDrawBuffer
(
prev_draw
);
LEAVE_GL
();
return
DD_OK
;
}
return
DDERR_INVALIDPARAMS
;
}
...
...
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