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
81a1dce0
Commit
81a1dce0
authored
Dec 10, 2006
by
Stefan Dösinger
Committed by
Alexandre Julliard
Dec 11, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move WINED3DRS_COLORVERTEX to the state table.
parent
0c305a34
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
45 deletions
+45
-45
device.c
dlls/wined3d/device.c
+1
-40
state.c
dlls/wined3d/state.c
+44
-5
No files found.
dlls/wined3d/device.c
View file @
81a1dce0
...
...
@@ -3384,51 +3384,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
case
WINED3DRS_VERTEXBLEND
:
case
WINED3DRS_TWEENFACTOR
:
case
WINED3DRS_INDEXEDVERTEXBLENDENABLE
:
StateTable
[
STATE_RENDER
(
State
)].
apply
(
STATE_RENDER
(
State
),
This
->
stateBlock
);
break
;
case
WINED3DRS_COLORVERTEX
:
case
WINED3DRS_DIFFUSEMATERIALSOURCE
:
case
WINED3DRS_SPECULARMATERIALSOURCE
:
case
WINED3DRS_AMBIENTMATERIALSOURCE
:
case
WINED3DRS_EMISSIVEMATERIALSOURCE
:
{
GLenum
Parm
=
GL_AMBIENT_AND_DIFFUSE
;
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_COLORVERTEX
])
{
TRACE
(
"diff %d, amb %d, emis %d, spec %d
\n
"
,
This
->
stateBlock
->
renderState
[
WINED3DRS_DIFFUSEMATERIALSOURCE
],
This
->
stateBlock
->
renderState
[
WINED3DRS_AMBIENTMATERIALSOURCE
],
This
->
stateBlock
->
renderState
[
WINED3DRS_EMISSIVEMATERIALSOURCE
],
This
->
stateBlock
->
renderState
[
WINED3DRS_SPECULARMATERIALSOURCE
]);
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_DIFFUSEMATERIALSOURCE
]
==
WINED3DMCS_COLOR1
)
{
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_AMBIENTMATERIALSOURCE
]
==
WINED3DMCS_COLOR1
)
{
Parm
=
GL_AMBIENT_AND_DIFFUSE
;
}
else
{
Parm
=
GL_DIFFUSE
;
}
}
else
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_AMBIENTMATERIALSOURCE
]
==
WINED3DMCS_COLOR1
)
{
Parm
=
GL_AMBIENT
;
}
else
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_EMISSIVEMATERIALSOURCE
]
==
WINED3DMCS_COLOR1
)
{
Parm
=
GL_EMISSION
;
}
else
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_SPECULARMATERIALSOURCE
]
==
WINED3DMCS_COLOR1
)
{
Parm
=
GL_SPECULAR
;
}
else
{
Parm
=
-
1
;
}
if
(
Parm
==
-
1
)
{
if
(
This
->
tracking_color
!=
DISABLED_TRACKING
)
This
->
tracking_color
=
NEEDS_DISABLE
;
}
else
{
This
->
tracking_color
=
NEEDS_TRACKING
;
This
->
tracking_parm
=
Parm
;
}
}
else
{
if
(
This
->
tracking_color
!=
DISABLED_TRACKING
)
This
->
tracking_color
=
NEEDS_DISABLE
;
}
}
StateTable
[
STATE_RENDER
(
State
)].
apply
(
STATE_RENDER
(
State
),
This
->
stateBlock
);
break
;
case
WINED3DRS_LINEPATTERN
:
...
...
dlls/wined3d/state.c
View file @
81a1dce0
...
...
@@ -810,6 +810,45 @@ static void state_fogdensity(DWORD state, IWineD3DStateBlockImpl *stateblock) {
checkGLcall
(
"glFogf(GL_FOG_DENSITY, (float) Value)"
);
}
/* TODO: Merge with primitive type + init_materials()!! */
static
void
state_colormat
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
)
{
GLenum
Parm
=
GL_AMBIENT_AND_DIFFUSE
;
if
(
stateblock
->
renderState
[
WINED3DRS_COLORVERTEX
])
{
TRACE
(
"diff %d, amb %d, emis %d, spec %d
\n
"
,
stateblock
->
renderState
[
WINED3DRS_DIFFUSEMATERIALSOURCE
],
stateblock
->
renderState
[
WINED3DRS_AMBIENTMATERIALSOURCE
],
stateblock
->
renderState
[
WINED3DRS_EMISSIVEMATERIALSOURCE
],
stateblock
->
renderState
[
WINED3DRS_SPECULARMATERIALSOURCE
]);
if
(
stateblock
->
renderState
[
WINED3DRS_DIFFUSEMATERIALSOURCE
]
==
D3DMCS_COLOR1
)
{
if
(
stateblock
->
renderState
[
WINED3DRS_AMBIENTMATERIALSOURCE
]
==
D3DMCS_COLOR1
)
{
Parm
=
GL_AMBIENT_AND_DIFFUSE
;
}
else
{
Parm
=
GL_DIFFUSE
;
}
}
else
if
(
stateblock
->
renderState
[
WINED3DRS_AMBIENTMATERIALSOURCE
]
==
D3DMCS_COLOR1
)
{
Parm
=
GL_AMBIENT
;
}
else
if
(
stateblock
->
renderState
[
WINED3DRS_EMISSIVEMATERIALSOURCE
]
==
D3DMCS_COLOR1
)
{
Parm
=
GL_EMISSION
;
}
else
if
(
stateblock
->
renderState
[
WINED3DRS_SPECULARMATERIALSOURCE
]
==
D3DMCS_COLOR1
)
{
Parm
=
GL_SPECULAR
;
}
else
{
Parm
=
-
1
;
}
if
(
Parm
==
-
1
)
{
if
(
stateblock
->
wineD3DDevice
->
tracking_color
!=
DISABLED_TRACKING
)
stateblock
->
wineD3DDevice
->
tracking_color
=
NEEDS_DISABLE
;
}
else
{
stateblock
->
wineD3DDevice
->
tracking_color
=
NEEDS_TRACKING
;
stateblock
->
wineD3DDevice
->
tracking_parm
=
Parm
;
}
}
else
{
if
(
stateblock
->
wineD3DDevice
->
tracking_color
!=
DISABLED_TRACKING
)
stateblock
->
wineD3DDevice
->
tracking_color
=
NEEDS_DISABLE
;
}
}
const
struct
StateEntry
StateTable
[]
=
{
/* State name representative, apply function */
...
...
@@ -956,14 +995,14 @@ const struct StateEntry StateTable[] =
{
/*138, WINED3DRS_EXTENTS */
STATE_RENDER
(
WINED3DRS_EXTENTS
),
state_unknown
},
{
/*139, WINED3DRS_AMBIENT */
STATE_RENDER
(
WINED3DRS_AMBIENT
),
state_ambient
},
{
/*140, WINED3DRS_FOGVERTEXMODE */
STATE_RENDER
(
WINED3DRS_FOGENABLE
),
state_fog
},
{
/*141, WINED3DRS_COLORVERTEX */
STATE_RENDER
(
WINED3DRS_COLORVERTEX
),
state_
unknown
},
{
/*141, WINED3DRS_COLORVERTEX */
STATE_RENDER
(
WINED3DRS_COLORVERTEX
),
state_
colormat
},
{
/*142, WINED3DRS_LOCALVIEWER */
STATE_RENDER
(
WINED3DRS_LOCALVIEWER
),
state_unknown
},
{
/*143, WINED3DRS_NORMALIZENORMALS */
STATE_RENDER
(
WINED3DRS_NORMALIZENORMALS
),
state_unknown
},
{
/*144, WINED3DRS_COLORKEYBLENDENABLE */
STATE_RENDER
(
WINED3DRS_COLORKEYBLENDENABLE
),
state_unknown
},
{
/*145, WINED3DRS_DIFFUSEMATERIALSOURCE */
STATE_RENDER
(
WINED3DRS_COLORVERTEX
),
state_
unknown
},
{
/*146, WINED3DRS_SPECULARMATERIALSOURCE */
STATE_RENDER
(
WINED3DRS_COLORVERTEX
),
state_
unknown
},
{
/*147, WINED3DRS_AMBIENTMATERIALSOURCE */
STATE_RENDER
(
WINED3DRS_COLORVERTEX
),
state_
unknown
},
{
/*148, WINED3DRS_EMISSIVEMATERIALSOURCE */
STATE_RENDER
(
WINED3DRS_COLORVERTEX
),
state_
unknown
},
{
/*145, WINED3DRS_DIFFUSEMATERIALSOURCE */
STATE_RENDER
(
WINED3DRS_COLORVERTEX
),
state_
colormat
},
{
/*146, WINED3DRS_SPECULARMATERIALSOURCE */
STATE_RENDER
(
WINED3DRS_COLORVERTEX
),
state_
colormat
},
{
/*147, WINED3DRS_AMBIENTMATERIALSOURCE */
STATE_RENDER
(
WINED3DRS_COLORVERTEX
),
state_
colormat
},
{
/*148, WINED3DRS_EMISSIVEMATERIALSOURCE */
STATE_RENDER
(
WINED3DRS_COLORVERTEX
),
state_
colormat
},
{
/*149, Undefined */
0
,
state_undefined
},
{
/*150, Undefined */
0
,
state_undefined
},
{
/*151, WINED3DRS_VERTEXBLEND */
0
,
state_nogl
},
...
...
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