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
e0a0d611
Commit
e0a0d611
authored
Nov 15, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass a wined3d_color struct to wined3d_device_clear().
parent
7459180a
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
29 deletions
+43
-29
device.c
dlls/d3d8/device.c
+11
-4
device.c
dlls/d3d9/device.c
+11
-5
device.c
dlls/ddraw/device.c
+11
-10
device.c
dlls/wined3d/device.c
+6
-6
swapchain.c
dlls/wined3d/swapchain.c
+3
-1
wined3d.h
include/wine/wined3d.h
+1
-3
No files found.
dlls/d3d8/device.c
View file @
e0a0d611
...
@@ -1200,17 +1200,24 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice8Impl_EndScene(IDirect3DD
...
@@ -1200,17 +1200,24 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice8Impl_EndScene(IDirect3DD
return
hr
;
return
hr
;
}
}
static
HRESULT
WINAPI
IDirect3DDevice8Impl_Clear
(
IDirect3DDevice8
*
iface
,
DWORD
C
ount
,
static
HRESULT
WINAPI
IDirect3DDevice8Impl_Clear
(
IDirect3DDevice8
*
iface
,
DWORD
rect_c
ount
,
const
D3DRECT
*
pRects
,
DWORD
Flags
,
D3DCOLOR
Color
,
float
Z
,
DWORD
S
tencil
)
const
D3DRECT
*
rects
,
DWORD
flags
,
D3DCOLOR
color
,
float
z
,
DWORD
s
tencil
)
{
{
const
struct
wined3d_color
c
=
{
((
color
>>
16
)
&
0xff
)
/
255
.
0
f
,
((
color
>>
8
)
&
0xff
)
/
255
.
0
f
,
(
color
&
0xff
)
/
255
.
0
f
,
((
color
>>
24
)
&
0xff
)
/
255
.
0
f
,
};
IDirect3DDevice8Impl
*
This
=
impl_from_IDirect3DDevice8
(
iface
);
IDirect3DDevice8Impl
*
This
=
impl_from_IDirect3DDevice8
(
iface
);
HRESULT
hr
;
HRESULT
hr
;
TRACE
(
"iface %p, rect_count %u, rects %p, flags %#x, color 0x%08x, z %.8e, stencil %u.
\n
"
,
TRACE
(
"iface %p, rect_count %u, rects %p, flags %#x, color 0x%08x, z %.8e, stencil %u.
\n
"
,
iface
,
Count
,
pRects
,
Flags
,
Color
,
Z
,
S
tencil
);
iface
,
rect_count
,
rects
,
flags
,
color
,
z
,
s
tencil
);
wined3d_mutex_lock
();
wined3d_mutex_lock
();
hr
=
wined3d_device_clear
(
This
->
wined3d_device
,
Count
,
(
const
RECT
*
)
pRects
,
Flags
,
Color
,
Z
,
S
tencil
);
hr
=
wined3d_device_clear
(
This
->
wined3d_device
,
rect_count
,
(
const
RECT
*
)
rects
,
flags
,
&
c
,
z
,
s
tencil
);
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
return
hr
;
return
hr
;
...
...
dlls/d3d9/device.c
View file @
e0a0d611
...
@@ -1218,18 +1218,24 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_EndScene(IDirect3DD
...
@@ -1218,18 +1218,24 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_EndScene(IDirect3DD
return
hr
;
return
hr
;
}
}
static
HRESULT
WINAPI
IDirect3DDevice9Impl_Clear
(
IDirect3DDevice9Ex
*
iface
,
DWORD
C
ount
,
static
HRESULT
WINAPI
IDirect3DDevice9Impl_Clear
(
IDirect3DDevice9Ex
*
iface
,
DWORD
rect_c
ount
,
const
D3DRECT
*
pRects
,
DWORD
Flags
,
D3DCOLOR
Color
,
float
Z
,
DWORD
S
tencil
)
const
D3DRECT
*
rects
,
DWORD
flags
,
D3DCOLOR
color
,
float
z
,
DWORD
s
tencil
)
{
{
const
struct
wined3d_color
c
=
{
((
color
>>
16
)
&
0xff
)
/
255
.
0
f
,
((
color
>>
8
)
&
0xff
)
/
255
.
0
f
,
(
color
&
0xff
)
/
255
.
0
f
,
((
color
>>
24
)
&
0xff
)
/
255
.
0
f
,
};
IDirect3DDevice9Impl
*
This
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DDevice9Impl
*
This
=
impl_from_IDirect3DDevice9Ex
(
iface
);
HRESULT
hr
;
HRESULT
hr
;
TRACE
(
"iface %p, rect_count %u, rects %p, flags %#x, color 0x%08x, z %.8e, stencil %u.
\n
"
,
TRACE
(
"iface %p, rect_count %u, rects %p, flags %#x, color 0x%08x, z %.8e, stencil %u.
\n
"
,
iface
,
Count
,
pRects
,
Flags
,
Color
,
Z
,
S
tencil
);
iface
,
rect_count
,
rects
,
flags
,
color
,
z
,
s
tencil
);
/* Note: D3DRECT is compatible with WINED3DRECT */
wined3d_mutex_lock
();
wined3d_mutex_lock
();
hr
=
wined3d_device_clear
(
This
->
wined3d_device
,
Count
,
(
const
RECT
*
)
pRects
,
Flags
,
Color
,
Z
,
S
tencil
);
hr
=
wined3d_device_clear
(
This
->
wined3d_device
,
rect_count
,
(
const
RECT
*
)
rects
,
flags
,
&
c
,
z
,
s
tencil
);
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
return
hr
;
return
hr
;
...
...
dlls/ddraw/device.c
View file @
e0a0d611
...
@@ -5065,23 +5065,24 @@ static HRESULT WINAPI IDirect3DDeviceImpl_3_ValidateDevice(IDirect3DDevice3 *ifa
...
@@ -5065,23 +5065,24 @@ static HRESULT WINAPI IDirect3DDeviceImpl_3_ValidateDevice(IDirect3DDevice3 *ifa
* For details, see IWineD3DDevice::Clear
* For details, see IWineD3DDevice::Clear
*
*
*****************************************************************************/
*****************************************************************************/
static
HRESULT
static
HRESULT
IDirect3DDeviceImpl_7_Clear
(
IDirect3DDevice7
*
iface
,
DWORD
count
,
IDirect3DDeviceImpl_7_Clear
(
IDirect3DDevice7
*
iface
,
D3DRECT
*
rects
,
DWORD
flags
,
D3DCOLOR
color
,
D3DVALUE
z
,
DWORD
stencil
)
DWORD
Count
,
D3DRECT
*
Rects
,
DWORD
Flags
,
D3DCOLOR
Color
,
D3DVALUE
Z
,
DWORD
Stencil
)
{
{
const
struct
wined3d_color
c
=
{
((
color
>>
16
)
&
0xff
)
/
255
.
0
f
,
((
color
>>
8
)
&
0xff
)
/
255
.
0
f
,
(
color
&
0xff
)
/
255
.
0
f
,
((
color
>>
24
)
&
0xff
)
/
255
.
0
f
,
};
IDirect3DDeviceImpl
*
This
=
impl_from_IDirect3DDevice7
(
iface
);
IDirect3DDeviceImpl
*
This
=
impl_from_IDirect3DDevice7
(
iface
);
HRESULT
hr
;
HRESULT
hr
;
TRACE
(
"iface %p, count %u, rects %p, flags %#x, color 0x%08x, z %.8e, stencil %#x.
\n
"
,
TRACE
(
"iface %p, count %u, rects %p, flags %#x, color 0x%08x, z %.8e, stencil %#x.
\n
"
,
iface
,
Count
,
Rects
,
Flags
,
Color
,
Z
,
S
tencil
);
iface
,
count
,
rects
,
flags
,
color
,
z
,
s
tencil
);
wined3d_mutex_lock
();
wined3d_mutex_lock
();
hr
=
wined3d_device_clear
(
This
->
wined3d_device
,
Count
,
(
RECT
*
)
Rects
,
Flags
,
Color
,
Z
,
S
tencil
);
hr
=
wined3d_device_clear
(
This
->
wined3d_device
,
count
,
(
RECT
*
)
rects
,
flags
,
&
c
,
z
,
s
tencil
);
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
return
hr
;
return
hr
;
...
...
dlls/wined3d/device.c
View file @
e0a0d611
...
@@ -1199,6 +1199,7 @@ void CDECL wined3d_device_release_focus_window(struct wined3d_device *device)
...
@@ -1199,6 +1199,7 @@ void CDECL wined3d_device_release_focus_window(struct wined3d_device *device)
HRESULT
CDECL
wined3d_device_init_3d
(
struct
wined3d_device
*
device
,
HRESULT
CDECL
wined3d_device_init_3d
(
struct
wined3d_device
*
device
,
WINED3DPRESENT_PARAMETERS
*
present_parameters
)
WINED3DPRESENT_PARAMETERS
*
present_parameters
)
{
{
static
const
struct
wined3d_color
black
=
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
};
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
struct
wined3d_swapchain
*
swapchain
=
NULL
;
struct
wined3d_swapchain
*
swapchain
=
NULL
;
struct
wined3d_context
*
context
;
struct
wined3d_context
*
context
;
...
@@ -1345,7 +1346,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
...
@@ -1345,7 +1346,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
/* Clear the screen */
/* Clear the screen */
wined3d_device_clear
(
device
,
0
,
NULL
,
WINED3DCLEAR_TARGET
wined3d_device_clear
(
device
,
0
,
NULL
,
WINED3DCLEAR_TARGET
|
(
present_parameters
->
EnableAutoDepthStencil
?
WINED3DCLEAR_ZBUFFER
|
WINED3DCLEAR_STENCIL
:
0
),
|
(
present_parameters
->
EnableAutoDepthStencil
?
WINED3DCLEAR_ZBUFFER
|
WINED3DCLEAR_STENCIL
:
0
),
0x00
,
1
.
0
f
,
0
);
&
black
,
1
.
0
f
,
0
);
device
->
d3d_initialized
=
TRUE
;
device
->
d3d_initialized
=
TRUE
;
...
@@ -4025,13 +4026,12 @@ HRESULT CDECL wined3d_device_present(const struct wined3d_device *device, const
...
@@ -4025,13 +4026,12 @@ HRESULT CDECL wined3d_device_present(const struct wined3d_device *device, const
/* Do not call while under the GL lock. */
/* Do not call while under the GL lock. */
HRESULT
CDECL
wined3d_device_clear
(
struct
wined3d_device
*
device
,
DWORD
rect_count
,
HRESULT
CDECL
wined3d_device_clear
(
struct
wined3d_device
*
device
,
DWORD
rect_count
,
const
RECT
*
rects
,
DWORD
flags
,
WINED3DCOLOR
color
,
float
depth
,
DWORD
stencil
)
const
RECT
*
rects
,
DWORD
flags
,
const
struct
wined3d_color
*
color
,
float
depth
,
DWORD
stencil
)
{
{
const
struct
wined3d_color
c
=
{
D3DCOLOR_R
(
color
),
D3DCOLOR_G
(
color
),
D3DCOLOR_B
(
color
),
D3DCOLOR_A
(
color
)};
RECT
draw_rect
;
RECT
draw_rect
;
TRACE
(
"device %p, rect_count %u, rects %p, flags %#x, color
0x%08x
, depth %.8e, stencil %u.
\n
"
,
TRACE
(
"device %p, rect_count %u, rects %p, flags %#x, color
{%.8e, %.8e, %.8e, %.8e}
, depth %.8e, stencil %u.
\n
"
,
device
,
rect_count
,
rects
,
flags
,
color
,
depth
,
stencil
);
device
,
rect_count
,
rects
,
flags
,
color
->
r
,
color
->
g
,
color
->
b
,
color
->
a
,
depth
,
stencil
);
if
(
flags
&
(
WINED3DCLEAR_ZBUFFER
|
WINED3DCLEAR_STENCIL
))
if
(
flags
&
(
WINED3DCLEAR_ZBUFFER
|
WINED3DCLEAR_STENCIL
))
{
{
...
@@ -4057,7 +4057,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
...
@@ -4057,7 +4057,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
return
device_clear_render_targets
(
device
,
device
->
adapter
->
gl_info
.
limits
.
buffers
,
return
device_clear_render_targets
(
device
,
device
->
adapter
->
gl_info
.
limits
.
buffers
,
&
device
->
fb
,
rect_count
,
rects
,
&
device
->
fb
,
rect_count
,
rects
,
&
draw_rect
,
flags
,
&
c
,
depth
,
stencil
);
&
draw_rect
,
flags
,
color
,
depth
,
stencil
);
}
}
void
CDECL
wined3d_device_set_primitive_type
(
struct
wined3d_device
*
device
,
void
CDECL
wined3d_device_set_primitive_type
(
struct
wined3d_device
*
device
,
...
...
dlls/wined3d/swapchain.c
View file @
e0a0d611
...
@@ -591,10 +591,12 @@ static HRESULT swapchain_gl_present(struct wined3d_swapchain *swapchain, const R
...
@@ -591,10 +591,12 @@ static HRESULT swapchain_gl_present(struct wined3d_swapchain *swapchain, const R
* (The Max Payne bug has been confirmed on Windows with the debug runtime) */
* (The Max Payne bug has been confirmed on Windows with the debug runtime) */
if
(
FALSE
&&
swapchain
->
presentParms
.
SwapEffect
==
WINED3DSWAPEFFECT_DISCARD
)
if
(
FALSE
&&
swapchain
->
presentParms
.
SwapEffect
==
WINED3DSWAPEFFECT_DISCARD
)
{
{
static
const
struct
wined3d_color
cyan
=
{
0
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
};
TRACE
(
"Clearing the color buffer with cyan color
\n
"
);
TRACE
(
"Clearing the color buffer with cyan color
\n
"
);
wined3d_device_clear
(
swapchain
->
device
,
0
,
NULL
,
wined3d_device_clear
(
swapchain
->
device
,
0
,
NULL
,
WINED3DCLEAR_TARGET
,
0xff00ffff
,
1
.
0
f
,
0
);
WINED3DCLEAR_TARGET
,
&
cyan
,
1
.
0
f
,
0
);
}
}
if
(
!
swapchain
->
render_to_fbo
&&
((
swapchain
->
front_buffer
->
flags
&
SFLAG_INSYSMEM
)
if
(
!
swapchain
->
render_to_fbo
&&
((
swapchain
->
front_buffer
->
flags
&
SFLAG_INSYSMEM
)
...
...
include/wine/wined3d.h
View file @
e0a0d611
...
@@ -65,8 +65,6 @@
...
@@ -65,8 +65,6 @@
#define WINEDDERR_NOCLIPLIST MAKE_WINED3DHRESULT(205)
#define WINEDDERR_NOCLIPLIST MAKE_WINED3DHRESULT(205)
#define WINEDDERR_OVERLAYNOTVISIBLE MAKE_WINED3DHRESULT(577)
#define WINEDDERR_OVERLAYNOTVISIBLE MAKE_WINED3DHRESULT(577)
typedef
DWORD
WINED3DCOLOR
;
typedef
enum
_WINED3DLIGHTTYPE
typedef
enum
_WINED3DLIGHTTYPE
{
{
WINED3DLIGHT_POINT
=
1
,
WINED3DLIGHT_POINT
=
1
,
...
@@ -2168,7 +2166,7 @@ HRESULT __cdecl wined3d_device_acquire_focus_window(struct wined3d_device *devic
...
@@ -2168,7 +2166,7 @@ HRESULT __cdecl wined3d_device_acquire_focus_window(struct wined3d_device *devic
HRESULT
__cdecl
wined3d_device_begin_scene
(
struct
wined3d_device
*
device
);
HRESULT
__cdecl
wined3d_device_begin_scene
(
struct
wined3d_device
*
device
);
HRESULT
__cdecl
wined3d_device_begin_stateblock
(
struct
wined3d_device
*
device
);
HRESULT
__cdecl
wined3d_device_begin_stateblock
(
struct
wined3d_device
*
device
);
HRESULT
__cdecl
wined3d_device_clear
(
struct
wined3d_device
*
device
,
DWORD
rect_count
,
const
RECT
*
rects
,
DWORD
flags
,
HRESULT
__cdecl
wined3d_device_clear
(
struct
wined3d_device
*
device
,
DWORD
rect_count
,
const
RECT
*
rects
,
DWORD
flags
,
WINED3DCOLOR
color
,
float
z
,
DWORD
stencil
);
const
struct
wined3d_color
*
color
,
float
z
,
DWORD
stencil
);
void
__cdecl
wined3d_device_clear_rendertarget_view
(
struct
wined3d_device
*
device
,
void
__cdecl
wined3d_device_clear_rendertarget_view
(
struct
wined3d_device
*
device
,
struct
wined3d_rendertarget_view
*
rendertarget_view
,
const
struct
wined3d_color
*
color
);
struct
wined3d_rendertarget_view
*
rendertarget_view
,
const
struct
wined3d_color
*
color
);
HRESULT
__cdecl
wined3d_device_color_fill
(
struct
wined3d_device
*
device
,
struct
wined3d_surface
*
surface
,
HRESULT
__cdecl
wined3d_device_color_fill
(
struct
wined3d_device
*
device
,
struct
wined3d_surface
*
surface
,
...
...
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