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
8c9c0840
Commit
8c9c0840
authored
Aug 21, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Aug 30, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use 0/0/0 as normal if no normal is supplied.
parent
af66d215
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
drawprim.c
dlls/wined3d/drawprim.c
+1
-1
state.c
dlls/wined3d/state.c
+15
-3
No files found.
dlls/wined3d/drawprim.c
View file @
8c9c0840
...
@@ -350,7 +350,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
...
@@ -350,7 +350,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
/* Default settings for data that is not passed */
/* Default settings for data that is not passed */
if
(
sd
->
u
.
s
.
normal
.
lpData
==
NULL
)
{
if
(
sd
->
u
.
s
.
normal
.
lpData
==
NULL
)
{
glNormal3f
(
0
,
0
,
1
);
glNormal3f
(
0
,
0
,
0
);
}
}
if
(
sd
->
u
.
s
.
diffuse
.
lpData
==
NULL
)
{
if
(
sd
->
u
.
s
.
diffuse
.
lpData
==
NULL
)
{
glColor4f
(
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
);
glColor4f
(
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
);
...
...
dlls/wined3d/state.c
View file @
8c9c0840
...
@@ -1196,7 +1196,16 @@ static void state_zbias(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
...
@@ -1196,7 +1196,16 @@ static void state_zbias(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
static
void
state_normalize
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
WineD3DContext
*
context
)
{
static
void
state_normalize
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
WineD3DContext
*
context
)
{
if
(
stateblock
->
renderState
[
WINED3DRS_NORMALIZENORMALS
])
{
if
(
isStateDirty
(
context
,
STATE_VDECL
))
{
return
;
}
/* Without vertex normals, we set the current normal to 0/0/0 to remove the diffuse factor
* from the opengl lighting equation, as d3d does. Normalization of 0/0/0 can lead to a division
* by zero and is not properly defined in opengl, so avoid it
*/
if
(
stateblock
->
renderState
[
WINED3DRS_NORMALIZENORMALS
]
&&
(
stateblock
->
wineD3DDevice
->
strided_streams
.
u
.
s
.
normal
.
lpData
||
stateblock
->
wineD3DDevice
->
strided_streams
.
u
.
s
.
normal
.
VBO
))
{
glEnable
(
GL_NORMALIZE
);
glEnable
(
GL_NORMALIZE
);
checkGLcall
(
"glEnable(GL_NORMALIZE);"
);
checkGLcall
(
"glEnable(GL_NORMALIZE);"
);
}
else
{
}
else
{
...
@@ -3031,8 +3040,8 @@ static void loadVertexData(IWineD3DStateBlockImpl *stateblock, WineDirect3DVerte
...
@@ -3031,8 +3040,8 @@ static void loadVertexData(IWineD3DStateBlockImpl *stateblock, WineDirect3DVerte
checkGLcall
(
"glEnableClientState(GL_NORMAL_ARRAY)"
);
checkGLcall
(
"glEnableClientState(GL_NORMAL_ARRAY)"
);
}
else
{
}
else
{
glNormal3f
(
0
,
0
,
1
);
glNormal3f
(
0
,
0
,
0
);
checkGLcall
(
"glNormal3f(0, 0,
1
)"
);
checkGLcall
(
"glNormal3f(0, 0,
0
)"
);
}
}
/* Diffuse Colour --------------------------------------------*/
/* Diffuse Colour --------------------------------------------*/
...
@@ -3307,6 +3316,9 @@ static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, W
...
@@ -3307,6 +3316,9 @@ static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, W
if
(
context
->
last_was_vshader
&&
!
isStateDirty
(
context
,
STATE_RENDER
(
WINED3DRS_CLIPPLANEENABLE
)))
{
if
(
context
->
last_was_vshader
&&
!
isStateDirty
(
context
,
STATE_RENDER
(
WINED3DRS_CLIPPLANEENABLE
)))
{
state_clipping
(
STATE_RENDER
(
WINED3DRS_CLIPPLANEENABLE
),
stateblock
,
context
);
state_clipping
(
STATE_RENDER
(
WINED3DRS_CLIPPLANEENABLE
),
stateblock
,
context
);
}
}
if
(
!
isStateDirty
(
context
,
STATE_RENDER
(
WINED3DRS_NORMALIZENORMALS
)))
{
state_normalize
(
STATE_RENDER
(
WINED3DRS_NORMALIZENORMALS
),
stateblock
,
context
);
}
}
else
{
}
else
{
/* We compile the shader here because we need the vertex declaration
/* We compile the shader here because we need the vertex declaration
* in order to determine if we need to do any swizzling for D3DCOLOR
* in order to determine if we need to do any swizzling for D3DCOLOR
...
...
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