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
d429ff5b
Commit
d429ff5b
authored
Jan 17, 2007
by
H. Verbeet
Committed by
Alexandre Julliard
Jan 18, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: When switching color material, apply the material we were previously tracking.
This fixes a regression introduced by
329670c7
.
parent
612a74a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
2 deletions
+45
-2
state.c
dlls/wined3d/state.c
+45
-2
No files found.
dlls/wined3d/state.c
View file @
d429ff5b
...
...
@@ -812,14 +812,15 @@ static void state_fogdensity(DWORD state, IWineD3DStateBlockImpl *stateblock) {
/* TODO: Merge with primitive type + init_materials()!! */
static
void
state_colormat
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
)
{
IWineD3DDeviceImpl
*
device
=
(
IWineD3DDeviceImpl
*
)
stateblock
->
wineD3DDevice
;
GLenum
Parm
=
0
;
WineDirect3DStridedData
*
diffuse
=
&
stateblock
->
wineD3DD
evice
->
strided_streams
.
u
.
s
.
diffuse
;
WineDirect3DStridedData
*
diffuse
=
&
d
evice
->
strided_streams
.
u
.
s
.
diffuse
;
BOOL
isDiffuseSupplied
;
/* Depends on the decoded vertex declaration to read the existance of diffuse data.
* The vertex declaration will call this function if the fixed function pipeline is used.
*/
if
(
isStateDirty
(
stateblock
->
wineD3DD
evice
,
STATE_VDECL
))
{
if
(
isStateDirty
(
d
evice
,
STATE_VDECL
))
{
return
;
}
...
...
@@ -847,6 +848,9 @@ static void state_colormat(DWORD state, IWineD3DStateBlockImpl *stateblock) {
}
}
/* Nothing changed, return. */
if
(
Parm
==
device
->
tracking_parm
)
return
;
if
(
!
Parm
)
{
glDisable
(
GL_COLOR_MATERIAL
);
checkGLcall
(
"glDisable GL_COLOR_MATERIAL"
);
...
...
@@ -856,6 +860,45 @@ static void state_colormat(DWORD state, IWineD3DStateBlockImpl *stateblock) {
glEnable
(
GL_COLOR_MATERIAL
);
checkGLcall
(
"glEnable(GL_COLOR_MATERIAL)"
);
}
/* Apparently calls to glMaterialfv are ignored for properties we're
* tracking with glColorMaterial, so apply those here. */
switch
(
device
->
tracking_parm
)
{
case
GL_AMBIENT_AND_DIFFUSE
:
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_AMBIENT
,
(
float
*
)
&
device
->
updateStateBlock
->
material
.
Ambient
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_DIFFUSE
,
(
float
*
)
&
device
->
updateStateBlock
->
material
.
Diffuse
);
checkGLcall
(
"glMaterialfv"
);
break
;
case
GL_DIFFUSE
:
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_DIFFUSE
,
(
float
*
)
&
device
->
updateStateBlock
->
material
.
Diffuse
);
checkGLcall
(
"glMaterialfv"
);
break
;
case
GL_AMBIENT
:
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_AMBIENT
,
(
float
*
)
&
device
->
updateStateBlock
->
material
.
Ambient
);
checkGLcall
(
"glMaterialfv"
);
break
;
case
GL_EMISSION
:
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_EMISSION
,
(
float
*
)
&
device
->
updateStateBlock
->
material
.
Emissive
);
checkGLcall
(
"glMaterialfv"
);
break
;
case
GL_SPECULAR
:
/* Only change material color if specular is enabled, otherwise it is set to black */
if
(
device
->
stateBlock
->
renderState
[
WINED3DRS_SPECULARENABLE
])
{
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_SPECULAR
,
(
float
*
)
&
device
->
updateStateBlock
->
material
.
Specular
);
checkGLcall
(
"glMaterialfv"
);
}
else
{
float
black
[
4
]
=
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
};
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_SPECULAR
,
&
black
[
0
]);
checkGLcall
(
"glMaterialfv"
);
}
break
;
}
device
->
tracking_parm
=
Parm
;
}
static
void
state_linepattern
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
)
{
...
...
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