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
e0d2fb67
Commit
e0d2fb67
authored
Apr 21, 2003
by
Jason Edmeades
Committed by
Alexandre Julliard
Apr 21, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only reapply the world, view or projection transform changes if we
really have to.
parent
9fdc759b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
1 deletion
+38
-1
d3d8_private.h
dlls/d3d8/d3d8_private.h
+6
-0
device.c
dlls/d3d8/device.c
+32
-1
No files found.
dlls/d3d8/d3d8_private.h
View file @
e0d2fb67
...
...
@@ -258,6 +258,12 @@ struct IDirect3DDevice8Impl
float
lightPosn
[
MAX_ACTIVE_LIGHTS
][
4
];
float
lightDirn
[
MAX_ACTIVE_LIGHTS
][
4
];
/* Optimization */
D3DMATRIX
lastProj
;
D3DMATRIX
lastView
;
D3DMATRIX
lastWorld0
;
/* OpenGL related */
GLXContext
glCtx
;
XVisualInfo
*
visInfo
;
...
...
dlls/d3d8/device.c
View file @
e0d2fb67
...
...
@@ -1700,6 +1700,7 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetTransform(LPDIRECT3DDEVICE8 iface, D3DT
D3DMATRIX
m
;
int
k
;
float
f
;
BOOL
viewChanged
=
TRUE
;
/* Most of this routine, comments included copied from ddraw tree initially: */
TRACE
(
"(%p) : State=%d
\n
"
,
This
,
d3dts
);
...
...
@@ -1784,18 +1785,27 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetTransform(LPDIRECT3DDEVICE8 iface, D3DT
/*
* Move the GL operation to outside of switch to make it work
* regardless of transform set order.
Optimize later.
* regardless of transform set order.
*/
ENTER_GL
();
if
(
memcmp
(
&
This
->
lastProj
,
&
This
->
StateBlock
->
transforms
[
D3DTS_PROJECTION
].
u
.
m
[
0
][
0
],
sizeof
(
D3DMATRIX
)))
{
glMatrixMode
(
GL_PROJECTION
);
checkGLcall
(
"glMatrixMode"
);
glLoadMatrixf
((
float
*
)
&
This
->
StateBlock
->
transforms
[
D3DTS_PROJECTION
].
u
.
m
[
0
][
0
]);
checkGLcall
(
"glLoadMatrixf"
);
memcpy
(
&
This
->
lastProj
,
&
This
->
StateBlock
->
transforms
[
D3DTS_PROJECTION
].
u
.
m
[
0
][
0
],
sizeof
(
D3DMATRIX
));
}
else
{
TRACE
(
"Skipping as projection already correct
\n
"
);
}
glMatrixMode
(
GL_MODELVIEW
);
checkGLcall
(
"glMatrixMode"
);
viewChanged
=
FALSE
;
if
(
memcmp
(
&
This
->
lastView
,
&
This
->
StateBlock
->
transforms
[
D3DTS_VIEW
].
u
.
m
[
0
][
0
],
sizeof
(
D3DMATRIX
)))
{
glLoadMatrixf
((
float
*
)
&
This
->
StateBlock
->
transforms
[
D3DTS_VIEW
].
u
.
m
[
0
][
0
]);
checkGLcall
(
"glLoadMatrixf"
);
memcpy
(
&
This
->
lastView
,
&
This
->
StateBlock
->
transforms
[
D3DTS_VIEW
].
u
.
m
[
0
][
0
],
sizeof
(
D3DMATRIX
));
viewChanged
=
TRUE
;
/* If we are changing the View matrix, reset the light and clipping planes to the new view */
if
(
d3dts
==
D3DTS_VIEW
)
{
...
...
@@ -1818,6 +1828,9 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetTransform(LPDIRECT3DDEVICE8 iface, D3DT
}
}
}
else
{
TRACE
(
"Skipping view setup as view already correct
\n
"
);
}
/**
* Vertex Blending as described
...
...
@@ -1826,8 +1839,18 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetTransform(LPDIRECT3DDEVICE8 iface, D3DT
switch
(
This
->
UpdateStateBlock
->
vertex_blend
)
{
case
D3DVBF_DISABLE
:
{
if
(
viewChanged
==
TRUE
||
(
memcmp
(
&
This
->
lastWorld0
,
&
This
->
StateBlock
->
transforms
[
D3DTS_WORLDMATRIX
(
0
)].
u
.
m
[
0
][
0
],
sizeof
(
D3DMATRIX
))))
{
memcpy
(
&
This
->
lastWorld0
,
&
This
->
StateBlock
->
transforms
[
D3DTS_WORLDMATRIX
(
0
)].
u
.
m
[
0
][
0
],
sizeof
(
D3DMATRIX
));
if
(
viewChanged
==
FALSE
)
{
glLoadMatrixf
((
float
*
)
&
This
->
StateBlock
->
transforms
[
D3DTS_VIEW
].
u
.
m
[
0
][
0
]);
checkGLcall
(
"glLoadMatrixf"
);
}
glMultMatrixf
((
float
*
)
&
This
->
StateBlock
->
transforms
[
D3DTS_WORLDMATRIX
(
0
)].
u
.
m
[
0
][
0
]);
checkGLcall
(
"glMultMatrixf"
);
}
else
{
TRACE
(
"Skipping as world already correct
\n
"
);
}
}
break
;
case
D3DVBF_1WEIGHTS
:
...
...
@@ -1853,6 +1876,10 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetTransform(LPDIRECT3DDEVICE8 iface, D3DT
m
.
u
.
s
.
_21
=
f
;
m
.
u
.
s
.
_22
=
f
;
m
.
u
.
s
.
_23
=
f
;
m
.
u
.
s
.
_24
=
f
;
m
.
u
.
s
.
_31
=
f
;
m
.
u
.
s
.
_32
=
f
;
m
.
u
.
s
.
_33
=
f
;
m
.
u
.
s
.
_34
=
f
;
m
.
u
.
s
.
_41
=
f
;
m
.
u
.
s
.
_42
=
f
;
m
.
u
.
s
.
_43
=
f
;
m
.
u
.
s
.
_44
=
f
;
if
(
viewChanged
==
FALSE
)
{
glLoadMatrixf
((
float
*
)
&
This
->
StateBlock
->
transforms
[
D3DTS_VIEW
].
u
.
m
[
0
][
0
]);
checkGLcall
(
"glLoadMatrixf"
);
}
glMultMatrixf
((
float
*
)
&
m
.
u
.
m
[
0
][
0
]);
checkGLcall
(
"glMultMatrixf"
);
}
...
...
@@ -1865,6 +1892,10 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetTransform(LPDIRECT3DDEVICE8 iface, D3DT
m
.
u
.
s
.
_21
=
1
.
0
f
;
m
.
u
.
s
.
_22
=
1
.
0
f
;
m
.
u
.
s
.
_23
=
1
.
0
f
;
m
.
u
.
s
.
_24
=
1
.
0
f
;
m
.
u
.
s
.
_31
=
1
.
0
f
;
m
.
u
.
s
.
_32
=
1
.
0
f
;
m
.
u
.
s
.
_33
=
1
.
0
f
;
m
.
u
.
s
.
_34
=
1
.
0
f
;
m
.
u
.
s
.
_41
=
1
.
0
f
;
m
.
u
.
s
.
_42
=
1
.
0
f
;
m
.
u
.
s
.
_43
=
1
.
0
f
;
m
.
u
.
s
.
_44
=
1
.
0
f
;
if
(
viewChanged
==
FALSE
)
{
glLoadMatrixf
((
float
*
)
&
This
->
StateBlock
->
transforms
[
D3DTS_VIEW
].
u
.
m
[
0
][
0
]);
checkGLcall
(
"glLoadMatrixf"
);
}
glMultMatrixf
((
float
*
)
&
m
.
u
.
m
[
0
][
0
]);
checkGLcall
(
"glMultMatrixf"
);
}
...
...
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