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
4f8eb6a3
Commit
4f8eb6a3
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: Clamp material power to 128.0.
parent
c2cf60fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
1 deletion
+34
-1
d3d.c
dlls/ddraw/tests/d3d.c
+21
-0
state.c
dlls/wined3d/state.c
+13
-1
No files found.
dlls/ddraw/tests/d3d.c
View file @
4f8eb6a3
...
...
@@ -172,6 +172,7 @@ static void LightTest(void)
BOOL
bEnabled
=
FALSE
;
float
one
=
1
.
0
f
;
float
zero
=
0
.
0
f
;
D3DMATERIAL7
mat
;
/* Set a few lights with funky indices. */
memset
(
&
light
,
0
,
sizeof
(
light
));
...
...
@@ -315,6 +316,26 @@ static void LightTest(void)
light
.
dvAttenuation0
=
-
1
.
0
;
rc
=
IDirect3DDevice7_SetLight
(
lpD3DDevice
,
103
,
&
light
);
ok
(
rc
==
D3D_OK
,
"SetLight returned: %x
\n
"
,
rc
);
memset
(
&
mat
,
0
,
sizeof
(
mat
));
rc
=
IDirect3DDevice7_SetMaterial
(
lpD3DDevice
,
&
mat
);
ok
(
rc
==
D3D_OK
,
"IDirect3DDevice7_SetMaterial returned: %x
\n
"
,
rc
);
mat
.
power
=
129
.
0
;
rc
=
IDirect3DDevice7_SetMaterial
(
lpD3DDevice
,
&
mat
);
ok
(
rc
==
D3D_OK
,
"IDirect3DDevice7_SetMaterial(power = 129.0) returned: %x
\n
"
,
rc
);
memset
(
&
mat
,
0
,
sizeof
(
mat
));
rc
=
IDirect3DDevice7_GetMaterial
(
lpD3DDevice
,
&
mat
);
ok
(
rc
==
D3D_OK
,
"IDirect3DDevice7_GetMaterial returned: %x
\n
"
,
rc
);
ok
(
mat
.
power
==
129
,
"Returned power is %f
\n
"
,
mat
.
power
);
mat
.
power
=
-
1
.
0
;
rc
=
IDirect3DDevice7_SetMaterial
(
lpD3DDevice
,
&
mat
);
ok
(
rc
==
D3D_OK
,
"IDirect3DDevice7_SetMaterial(power = -1.0) returned: %x
\n
"
,
rc
);
memset
(
&
mat
,
0
,
sizeof
(
mat
));
rc
=
IDirect3DDevice7_GetMaterial
(
lpD3DDevice
,
&
mat
);
ok
(
rc
==
D3D_OK
,
"IDirect3DDevice7_GetMaterial returned: %x
\n
"
,
rc
);
ok
(
mat
.
power
==
-
1
,
"Returned power is %f
\n
"
,
mat
.
power
);
}
static
void
ProcessVerticesTest
(
void
)
...
...
dlls/wined3d/state.c
View file @
4f8eb6a3
...
...
@@ -509,8 +509,20 @@ state_specularenable(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCon
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
);
if
(
stateblock
->
material
.
Power
>
128
.
0
)
{
/* glMaterialf man page says that the material says that GL_SHININESS must be between 0.0
* and 128.0, although in d3d neither -1 nor 129 produce an error. For values > 128 clamp
* them, since 128 results in a hardly visible specular highlight, so it should be safe to
* to clamp to 128
*/
WARN
(
"Material power > 128
\n
"
);
glMaterialf
(
GL_FRONT_AND_BACK
,
GL_SHININESS
,
128
.
0
);
}
else
{
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
{
...
...
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