Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
7f53bb8f
Commit
7f53bb8f
authored
May 22, 2003
by
Jason Edmeades
Committed by
Alexandre Julliard
May 22, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid setting and resetting the same values when there are many
rectangles.
parent
f644c787
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
42 deletions
+46
-42
device.c
dlls/d3d8/device.c
+46
-42
No files found.
dlls/d3d8/device.c
View file @
7f53bb8f
...
@@ -2184,6 +2184,35 @@ HRESULT WINAPI IDirect3DDevice8Impl_Clear(LPDIRECT3DDEVICE8 iface, DWORD Count
...
@@ -2184,6 +2184,35 @@ HRESULT WINAPI IDirect3DDevice8Impl_Clear(LPDIRECT3DDEVICE8 iface, DWORD Count
curRect
=
NULL
;
curRect
=
NULL
;
}
}
/* Only set the values up once, as they are not changing */
if
(
Flags
&
D3DCLEAR_STENCIL
)
{
glGetIntegerv
(
GL_STENCIL_CLEAR_VALUE
,
&
old_stencil_clear_value
);
glClearStencil
(
Stencil
);
checkGLcall
(
"glClearStencil"
);
glMask
=
glMask
|
GL_STENCIL_BUFFER_BIT
;
}
if
(
Flags
&
D3DCLEAR_ZBUFFER
)
{
glGetBooleanv
(
GL_DEPTH_WRITEMASK
,
&
old_ztest
);
glDepthMask
(
GL_TRUE
);
glGetFloatv
(
GL_DEPTH_CLEAR_VALUE
,
&
old_z_clear_value
);
glClearDepth
(
Z
);
checkGLcall
(
"glClearDepth"
);
glMask
=
glMask
|
GL_DEPTH_BUFFER_BIT
;
}
if
(
Flags
&
D3DCLEAR_TARGET
)
{
TRACE
(
"Clearing screen with glClear to color %lx
\n
"
,
Color
);
glGetFloatv
(
GL_COLOR_CLEAR_VALUE
,
old_color_clear_value
);
glClearColor
(((
Color
>>
16
)
&
0xFF
)
/
255
.
0
,
((
Color
>>
8
)
&
0xFF
)
/
255
.
0
,
((
Color
>>
0
)
&
0xFF
)
/
255
.
0
,
((
Color
>>
24
)
&
0xFF
)
/
255
.
0
);
checkGLcall
(
"glClearColor"
);
glMask
=
glMask
|
GL_COLOR_BUFFER_BIT
;
}
/* Now process each rect in turn */
for
(
i
=
0
;
i
<
Count
||
i
==
0
;
i
++
)
{
for
(
i
=
0
;
i
<
Count
||
i
==
0
;
i
++
)
{
if
(
curRect
)
{
if
(
curRect
)
{
...
@@ -2197,54 +2226,29 @@ HRESULT WINAPI IDirect3DDevice8Impl_Clear(LPDIRECT3DDEVICE8 iface, DWORD Count
...
@@ -2197,54 +2226,29 @@ HRESULT WINAPI IDirect3DDevice8Impl_Clear(LPDIRECT3DDEVICE8 iface, DWORD Count
checkGLcall
(
"glScissor"
);
checkGLcall
(
"glScissor"
);
}
}
/* Clear the whole screen */
/* Clear the selected rectangle (or full screen) */
if
(
Flags
&
D3DCLEAR_STENCIL
)
{
glGetIntegerv
(
GL_STENCIL_CLEAR_VALUE
,
&
old_stencil_clear_value
);
glClearStencil
(
Stencil
);
checkGLcall
(
"glClearStencil"
);
glMask
=
glMask
|
GL_STENCIL_BUFFER_BIT
;
}
if
(
Flags
&
D3DCLEAR_ZBUFFER
)
{
glGetBooleanv
(
GL_DEPTH_WRITEMASK
,
&
old_ztest
);
glDepthMask
(
GL_TRUE
);
glGetFloatv
(
GL_DEPTH_CLEAR_VALUE
,
&
old_z_clear_value
);
glClearDepth
(
Z
);
checkGLcall
(
"glClearDepth"
);
glMask
=
glMask
|
GL_DEPTH_BUFFER_BIT
;
}
if
(
Flags
&
D3DCLEAR_TARGET
)
{
TRACE
(
"Clearing screen with glClear to color %lx
\n
"
,
Color
);
glGetFloatv
(
GL_COLOR_CLEAR_VALUE
,
old_color_clear_value
);
glClearColor
(((
Color
>>
16
)
&
0xFF
)
/
255
.
0
,
((
Color
>>
8
)
&
0xFF
)
/
255
.
0
,
((
Color
>>
0
)
&
0xFF
)
/
255
.
0
,
((
Color
>>
24
)
&
0xFF
)
/
255
.
0
);
checkGLcall
(
"glClearColor"
);
glMask
=
glMask
|
GL_COLOR_BUFFER_BIT
;
}
glClear
(
glMask
);
glClear
(
glMask
);
checkGLcall
(
"glClear"
);
checkGLcall
(
"glClear"
);
if
(
Flags
&
D3DCLEAR_STENCIL
)
{
/* Step to the next rectangle */
glClearStencil
(
old_stencil_clear_value
);
}
if
(
Flags
&
D3DCLEAR_ZBUFFER
)
{
glDepthMask
(
old_ztest
);
glClearDepth
(
old_z_clear_value
);
}
if
(
Flags
&
D3DCLEAR_TARGET
)
{
glClearColor
(
old_color_clear_value
[
0
],
old_color_clear_value
[
1
],
old_color_clear_value
[
2
],
old_color_clear_value
[
3
]);
}
if
(
curRect
)
curRect
=
curRect
+
sizeof
(
D3DRECT
);
if
(
curRect
)
curRect
=
curRect
+
sizeof
(
D3DRECT
);
}
}
/* Restore the old values (why..?) */
if
(
Flags
&
D3DCLEAR_STENCIL
)
{
glClearStencil
(
old_stencil_clear_value
);
}
if
(
Flags
&
D3DCLEAR_ZBUFFER
)
{
glDepthMask
(
old_ztest
);
glClearDepth
(
old_z_clear_value
);
}
if
(
Flags
&
D3DCLEAR_TARGET
)
{
glClearColor
(
old_color_clear_value
[
0
],
old_color_clear_value
[
1
],
old_color_clear_value
[
2
],
old_color_clear_value
[
3
]);
}
if
(
Count
>
0
&&
pRects
)
{
if
(
Count
>
0
&&
pRects
)
{
glDisable
(
GL_SCISSOR_TEST
);
glDisable
(
GL_SCISSOR_TEST
);
checkGLcall
(
"glDisable"
);
checkGLcall
(
"glDisable"
);
...
...
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