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
2f4b9e42
Commit
2f4b9e42
authored
Jun 15, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jun 25, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move material applying to the state table.
parent
e84158f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
34 deletions
+25
-34
device.c
dlls/wined3d/device.c
+1
-31
state.c
dlls/wined3d/state.c
+21
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-1
No files found.
dlls/wined3d/device.c
View file @
2f4b9e42
...
...
@@ -2697,37 +2697,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetMaterial(IWineD3DDevice *iface, CONS
return
WINED3D_OK
;
}
ENTER_GL
();
TRACE
(
"(%p) : Diffuse (%f,%f,%f,%f)
\n
"
,
This
,
pMaterial
->
Diffuse
.
r
,
pMaterial
->
Diffuse
.
g
,
pMaterial
->
Diffuse
.
b
,
pMaterial
->
Diffuse
.
a
);
TRACE
(
"(%p) : Ambient (%f,%f,%f,%f)
\n
"
,
This
,
pMaterial
->
Ambient
.
r
,
pMaterial
->
Ambient
.
g
,
pMaterial
->
Ambient
.
b
,
pMaterial
->
Ambient
.
a
);
TRACE
(
"(%p) : Specular (%f,%f,%f,%f)
\n
"
,
This
,
pMaterial
->
Specular
.
r
,
pMaterial
->
Specular
.
g
,
pMaterial
->
Specular
.
b
,
pMaterial
->
Specular
.
a
);
TRACE
(
"(%p) : Emissive (%f,%f,%f,%f)
\n
"
,
This
,
pMaterial
->
Emissive
.
r
,
pMaterial
->
Emissive
.
g
,
pMaterial
->
Emissive
.
b
,
pMaterial
->
Emissive
.
a
);
TRACE
(
"(%p) : Power (%f)
\n
"
,
This
,
pMaterial
->
Power
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_AMBIENT
,
(
float
*
)
&
This
->
updateStateBlock
->
material
.
Ambient
);
checkGLcall
(
"glMaterialfv(GL_AMBIENT)"
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_DIFFUSE
,
(
float
*
)
&
This
->
updateStateBlock
->
material
.
Diffuse
);
checkGLcall
(
"glMaterialfv(GL_DIFFUSE)"
);
/* Only change material color if specular is enabled, otherwise it is set to black */
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_SPECULARENABLE
])
{
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_SPECULAR
,
(
float
*
)
&
This
->
updateStateBlock
->
material
.
Specular
);
checkGLcall
(
"glMaterialfv(GL_SPECULAR"
);
}
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(GL_SPECULAR"
);
}
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_EMISSION
,
(
float
*
)
&
This
->
updateStateBlock
->
material
.
Emissive
);
checkGLcall
(
"glMaterialfv(GL_EMISSION)"
);
glMaterialf
(
GL_FRONT_AND_BACK
,
GL_SHININESS
,
This
->
updateStateBlock
->
material
.
Power
);
checkGLcall
(
"glMaterialf(GL_SHININESS"
);
LEAVE_GL
();
IWineD3DDeviceImpl_MarkStateDirty
(
This
,
STATE_MATERIAL
);
return
WINED3D_OK
;
}
...
...
dlls/wined3d/state.c
View file @
2f4b9e42
...
...
@@ -505,11 +505,12 @@ state_specularenable(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCon
* whether WINED3DRS_SPECULARENABLE is enabled or not.
*/
TRACE
(
"Setting specular enable state
\n
"
);
/* TODO: Add to the material setting functions */
TRACE
(
"Setting specular enable state and materials
\n
"
);
if
(
stateblock
->
renderState
[
WINED3DRS_SPECULARENABLE
])
{
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_SPECULAR
,
(
float
*
)
&
stateblock
->
material
.
Specular
);
checkGLcall
(
"glMaterialfv"
);
glMaterialf
(
GL_FRONT_AND_BACK
,
GL_SHININESS
,
stateblock
->
material
.
Power
);
checkGLcall
(
"glMaterialf(GL_SHININESS"
);
if
(
GL_SUPPORT
(
EXT_SECONDARY_COLOR
))
{
glEnable
(
GL_COLOR_SUM_EXT
);
}
else
{
...
...
@@ -541,6 +542,22 @@ state_specularenable(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCon
checkGLcall
(
"glFinalCombinerInputNV()"
);
}
}
TRACE
(
"(%p) : Diffuse (%f,%f,%f,%f)
\n
"
,
stateblock
->
wineD3DDevice
,
stateblock
->
material
.
Diffuse
.
r
,
stateblock
->
material
.
Diffuse
.
g
,
stateblock
->
material
.
Diffuse
.
b
,
stateblock
->
material
.
Diffuse
.
a
);
TRACE
(
"(%p) : Ambient (%f,%f,%f,%f)
\n
"
,
stateblock
->
wineD3DDevice
,
stateblock
->
material
.
Ambient
.
r
,
stateblock
->
material
.
Ambient
.
g
,
stateblock
->
material
.
Ambient
.
b
,
stateblock
->
material
.
Ambient
.
a
);
TRACE
(
"(%p) : Specular (%f,%f,%f,%f)
\n
"
,
stateblock
->
wineD3DDevice
,
stateblock
->
material
.
Specular
.
r
,
stateblock
->
material
.
Specular
.
g
,
stateblock
->
material
.
Specular
.
b
,
stateblock
->
material
.
Specular
.
a
);
TRACE
(
"(%p) : Emissive (%f,%f,%f,%f)
\n
"
,
stateblock
->
wineD3DDevice
,
stateblock
->
material
.
Emissive
.
r
,
stateblock
->
material
.
Emissive
.
g
,
stateblock
->
material
.
Emissive
.
b
,
stateblock
->
material
.
Emissive
.
a
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_AMBIENT
,
(
float
*
)
&
stateblock
->
material
.
Ambient
);
checkGLcall
(
"glMaterialfv(GL_AMBIENT)"
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_DIFFUSE
,
(
float
*
)
&
stateblock
->
material
.
Diffuse
);
checkGLcall
(
"glMaterialfv(GL_DIFFUSE)"
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_EMISSION
,
(
float
*
)
&
stateblock
->
material
.
Emissive
);
checkGLcall
(
"glMaterialfv(GL_EMISSION)"
);
}
static
void
state_texfactor
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
WineD3DContext
*
context
)
{
...
...
@@ -4517,4 +4534,6 @@ const struct StateEntry StateTable[] =
{
/* STATE_CLIPPLANE(29) */
STATE_CLIPPLANE
(
29
),
clipplane
},
{
/* STATE_CLIPPLANE(30) */
STATE_CLIPPLANE
(
30
),
clipplane
},
{
/* STATE_CLIPPLANE(31) */
STATE_CLIPPLANE
(
31
),
clipplane
},
{
/* STATE_MATERIAL */
STATE_RENDER
(
WINED3DRS_SPECULARENABLE
),
state_specularenable
},
};
dlls/wined3d/wined3d_private.h
View file @
2f4b9e42
...
...
@@ -473,7 +473,9 @@ typedef void (*APPLYSTATEFUNC)(DWORD state, IWineD3DStateBlockImpl *stateblock,
#define STATE_CLIPPLANE(a) (STATE_SCISSORRECT + 1 + (a))
#define STATE_IS_CLIPPLANE(a) ((a) >= STATE_CLIPPLANE(0) && (a) <= STATE_CLIPPLANE(MAX_CLIPPLANES - 1))
#define STATE_HIGHEST (STATE_CLIPPLANE(MAX_CLIPPLANES - 1))
#define STATE_MATERIAL (STATE_CLIPPLANE(MAX_CLIPPLANES))
#define STATE_HIGHEST (STATE_MATERIAL)
struct
StateEntry
{
...
...
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