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
f5fafab6
Commit
f5fafab6
authored
Jan 02, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jan 02, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move WINED3DTS_MODELVIEW to the state table.
parent
197ec1c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
40 deletions
+41
-40
device.c
dlls/wined3d/device.c
+2
-39
state.c
dlls/wined3d/state.c
+39
-1
No files found.
dlls/wined3d/device.c
View file @
f5fafab6
...
...
@@ -2372,53 +2372,16 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTransform(IWineD3DDevice *iface, W
return
WINED3D_OK
;
}
/* Now we really are going to have to change a matrix */
ENTER_GL
();
if
(
d3dts
>=
WINED3DTS_TEXTURE0
&&
d3dts
<=
WINED3DTS_TEXTURE7
)
{
/* handle texture matrices */
/* This is now set with the texture unit states, it may be a good idea to flag the change though! */
}
else
if
(
d3dts
==
WINED3DTS_VIEW
)
{
/* handle the VIEW matrice */
unsigned
int
k
;
/* If we are changing the View matrix, reset the light and clipping planes to the new view
* NOTE: We have to reset the positions even if the light/plane is not currently
* enabled, since the call to enable it will not reset the position.
* NOTE2: Apparently texture transforms do NOT need reapplying
*/
PLIGHTINFOEL
*
lightChain
=
NULL
;
This
->
modelview_valid
=
FALSE
;
This
->
view_ident
=
!
memcmp
(
lpmatrix
,
identity
,
16
*
sizeof
(
float
));
glMatrixMode
(
GL_MODELVIEW
);
checkGLcall
(
"glMatrixMode(GL_MODELVIEW)"
);
glPushMatrix
();
glLoadMatrixf
((
const
float
*
)
lpmatrix
);
checkGLcall
(
"glLoadMatrixf(...)"
);
/* Reset lights */
lightChain
=
This
->
stateBlock
->
lights
;
while
(
lightChain
&&
lightChain
->
glIndex
!=
-
1
)
{
glLightfv
(
GL_LIGHT0
+
lightChain
->
glIndex
,
GL_POSITION
,
lightChain
->
lightPosn
);
checkGLcall
(
"glLightfv posn"
);
glLightfv
(
GL_LIGHT0
+
lightChain
->
glIndex
,
GL_SPOT_DIRECTION
,
lightChain
->
lightDirn
);
checkGLcall
(
"glLightfv dirn"
);
lightChain
=
lightChain
->
next
;
}
/* Reset Clipping Planes if clipping is enabled */
for
(
k
=
0
;
k
<
GL_LIMITS
(
clipplanes
);
k
++
)
{
glClipPlane
(
GL_CLIP_PLANE0
+
k
,
This
->
stateBlock
->
clipplane
[
k
]);
checkGLcall
(
"glClipPlane"
);
}
glPopMatrix
();
/* Handled by the state manager */
}
else
{
/* What was requested!?? */
WARN
(
"invalid matrix specified: %i
\n
"
,
d3dts
);
}
/* Release lock, all done */
LEAVE_GL
();
IWineD3DDeviceImpl_MarkStateDirty
(
This
,
STATE_TRANSFORM
(
d3dts
));
return
WINED3D_OK
;
}
...
...
dlls/wined3d/state.c
View file @
f5fafab6
...
...
@@ -1805,6 +1805,44 @@ static void pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock) {
}
}
static
void
transform_view
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
)
{
unsigned
int
k
;
/* If we are changing the View matrix, reset the light and clipping planes to the new view
* NOTE: We have to reset the positions even if the light/plane is not currently
* enabled, since the call to enable it will not reset the position.
* NOTE2: Apparently texture transforms do NOT need reapplying
*/
PLIGHTINFOEL
*
lightChain
=
NULL
;
stateblock
->
wineD3DDevice
->
modelview_valid
=
FALSE
;
glMatrixMode
(
GL_MODELVIEW
);
checkGLcall
(
"glMatrixMode(GL_MODELVIEW)"
);
glPushMatrix
();
checkGLcall
(
"glPushMatrix()"
);
glLoadMatrixf
((
float
*
)(
float
*
)
&
stateblock
->
transforms
[
WINED3DTS_VIEW
].
u
.
m
[
0
][
0
]);
checkGLcall
(
"glLoadMatrixf(...)"
);
/* Reset lights. TODO: Call light apply func */
lightChain
=
stateblock
->
lights
;
while
(
lightChain
&&
lightChain
->
glIndex
!=
-
1
)
{
glLightfv
(
GL_LIGHT0
+
lightChain
->
glIndex
,
GL_POSITION
,
lightChain
->
lightPosn
);
checkGLcall
(
"glLightfv posn"
);
glLightfv
(
GL_LIGHT0
+
lightChain
->
glIndex
,
GL_SPOT_DIRECTION
,
lightChain
->
lightDirn
);
checkGLcall
(
"glLightfv dirn"
);
lightChain
=
lightChain
->
next
;
}
/* Reset Clipping Planes if clipping is enabled. TODO: Call clipplane apply func */
for
(
k
=
0
;
k
<
GL_LIMITS
(
clipplanes
);
k
++
)
{
glClipPlane
(
GL_CLIP_PLANE0
+
k
,
stateblock
->
clipplane
[
k
]);
checkGLcall
(
"glClipPlane"
);
}
glPopMatrix
();
checkGLcall
(
"glPopMatrix()"
);
}
const
struct
StateEntry
StateTable
[]
=
{
/* State name representative, apply function */
...
...
@@ -2306,7 +2344,7 @@ const struct StateEntry StateTable[] =
{
/* , Pixel Shader */
STATE_PIXELSHADER
,
pixelshader
},
/* Transform states follow */
{
/* 1, undefined */
0
,
state_undefined
},
{
/* 2, WINED3DTS_VIEW */
STATE_TRANSFORM
(
WINED3DTS_VIEW
),
state_undefined
},
{
/* 2, WINED3DTS_VIEW */
STATE_TRANSFORM
(
WINED3DTS_VIEW
),
transform_view
},
{
/* 3, WINED3DTS_PROJECTION */
STATE_TRANSFORM
(
WINED3DTS_PROJECTION
),
state_undefined
},
{
/* 4, undefined */
0
,
state_undefined
},
{
/* 5, undefined */
0
,
state_undefined
},
...
...
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