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
0772bb49
Commit
0772bb49
authored
Dec 08, 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_SPECULARENABLE to the state table.
parent
287c6247
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
70 deletions
+72
-70
device.c
dlls/wined3d/device.c
+1
-69
state.c
dlls/wined3d/state.c
+71
-1
No files found.
dlls/wined3d/device.c
View file @
0772bb49
...
...
@@ -3461,76 +3461,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
case
WINED3DRS_CLIPPING
:
case
WINED3DRS_BLENDOP
:
case
WINED3DRS_TEXTUREFACTOR
:
StateTable
[
STATE_RENDER
(
State
)].
apply
(
STATE_RENDER
(
State
),
This
->
stateBlock
);
break
;
case
WINED3DRS_SPECULARENABLE
:
{
/* Originally this used glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL,GL_SEPARATE_SPECULAR_COLOR)
and (GL_LIGHT_MODEL_COLOR_CONTROL,GL_SINGLE_COLOR) to swap between enabled/disabled
specular color. This is wrong:
Separate specular color means the specular colour is maintained separately, whereas
single color means it is merged in. However in both cases they are being used to
some extent.
To disable specular color, set it explicitly to black and turn off GL_COLOR_SUM_EXT
NOTE: If not supported don't give FIXMEs the impact is really minimal and very few people are
running 1.4 yet!
*/
/*
* If register combiners are enabled, enabling / disabling GL_COLOR_SUM has no effect.
* Instead, we need to setup the FinalCombiner properly.
*
* The default setup for the FinalCombiner is:
*
* <variable> <input> <mapping> <usage>
* GL_VARIABLE_A_NV GL_FOG, GL_UNSIGNED_IDENTITY_NV GL_ALPHA
* GL_VARIABLE_B_NV GL_SPARE0_PLUS_SECONDARY_COLOR_NV GL_UNSIGNED_IDENTITY_NV GL_RGB
* GL_VARIABLE_C_NV GL_FOG GL_UNSIGNED_IDENTITY_NV GL_RGB
* GL_VARIABLE_D_NV GL_ZERO GL_UNSIGNED_IDENTITY_NV GL_RGB
* GL_VARIABLE_E_NV GL_ZERO GL_UNSIGNED_IDENTITY_NV GL_RGB
* GL_VARIABLE_F_NV GL_ZERO GL_UNSIGNED_IDENTITY_NV GL_RGB
* GL_VARIABLE_G_NV GL_SPARE0_NV GL_UNSIGNED_IDENTITY_NV GL_ALPHA
*
* That's pretty much fine as it is, except for variable B, which needs to take
* either GL_SPARE0_PLUS_SECONDARY_COLOR_NV or GL_SPARE0_NV, depending on
* whether WINED3DRS_SPECULARENABLE is enabled or not.
*/
if
(
Value
)
{
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_SPECULAR
,
(
float
*
)
&
This
->
updateStateBlock
->
material
.
Specular
);
checkGLcall
(
"glMaterialfv"
);
if
(
GL_SUPPORT
(
EXT_SECONDARY_COLOR
))
{
glEnable
(
GL_COLOR_SUM_EXT
);
}
else
{
TRACE
(
"Specular colors cannot be enabled in this version of opengl
\n
"
);
}
checkGLcall
(
"glEnable(GL_COLOR_SUM)"
);
if
(
GL_SUPPORT
(
NV_REGISTER_COMBINERS
))
{
GL_EXTCALL
(
glFinalCombinerInputNV
(
GL_VARIABLE_B_NV
,
GL_SPARE0_PLUS_SECONDARY_COLOR_NV
,
GL_UNSIGNED_IDENTITY_NV
,
GL_RGB
));
checkGLcall
(
"glFinalCombinerInputNV()"
);
}
}
else
{
float
black
[
4
]
=
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
};
/* for the case of enabled lighting: */
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_SPECULAR
,
&
black
[
0
]);
checkGLcall
(
"glMaterialfv"
);
/* for the case of disabled lighting: */
if
(
GL_SUPPORT
(
EXT_SECONDARY_COLOR
))
{
glDisable
(
GL_COLOR_SUM_EXT
);
}
else
{
TRACE
(
"Specular colors cannot be disabled in this version of opengl
\n
"
);
}
checkGLcall
(
"glDisable(GL_COLOR_SUM)"
);
if
(
GL_SUPPORT
(
NV_REGISTER_COMBINERS
))
{
GL_EXTCALL
(
glFinalCombinerInputNV
(
GL_VARIABLE_B_NV
,
GL_SPARE0_NV
,
GL_UNSIGNED_IDENTITY_NV
,
GL_RGB
));
checkGLcall
(
"glFinalCombinerInputNV()"
);
}
}
}
StateTable
[
STATE_RENDER
(
State
)].
apply
(
STATE_RENDER
(
State
),
This
->
stateBlock
);
break
;
case
WINED3DRS_STENCILENABLE
:
...
...
dlls/wined3d/state.c
View file @
0772bb49
...
...
@@ -432,6 +432,76 @@ static void state_blendop(DWORD state, IWineD3DStateBlockImpl *stateblock) {
checkGLcall
(
"glBlendEquation"
);
}
static
void
state_specularenable
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
)
{
/* Originally this used glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL,GL_SEPARATE_SPECULAR_COLOR)
* and (GL_LIGHT_MODEL_COLOR_CONTROL,GL_SINGLE_COLOR) to swap between enabled/disabled
* specular color. This is wrong:
* Separate specular color means the specular colour is maintained separately, whereas
* single color means it is merged in. However in both cases they are being used to
* some extent.
* To disable specular color, set it explicitly to black and turn off GL_COLOR_SUM_EXT
* NOTE: If not supported don't give FIXMEs the impact is really minimal and very few people are
* running 1.4 yet!
*
*
* If register combiners are enabled, enabling / disabling GL_COLOR_SUM has no effect.
* Instead, we need to setup the FinalCombiner properly.
*
* The default setup for the FinalCombiner is:
*
* <variable> <input> <mapping> <usage>
* GL_VARIABLE_A_NV GL_FOG, GL_UNSIGNED_IDENTITY_NV GL_ALPHA
* GL_VARIABLE_B_NV GL_SPARE0_PLUS_SECONDARY_COLOR_NV GL_UNSIGNED_IDENTITY_NV GL_RGB
* GL_VARIABLE_C_NV GL_FOG GL_UNSIGNED_IDENTITY_NV GL_RGB
* GL_VARIABLE_D_NV GL_ZERO GL_UNSIGNED_IDENTITY_NV GL_RGB
* GL_VARIABLE_E_NV GL_ZERO GL_UNSIGNED_IDENTITY_NV GL_RGB
* GL_VARIABLE_F_NV GL_ZERO GL_UNSIGNED_IDENTITY_NV GL_RGB
* GL_VARIABLE_G_NV GL_SPARE0_NV GL_UNSIGNED_IDENTITY_NV GL_ALPHA
*
* That's pretty much fine as it is, except for variable B, which needs to take
* either GL_SPARE0_PLUS_SECONDARY_COLOR_NV or GL_SPARE0_NV, depending on
* whether WINED3DRS_SPECULARENABLE is enabled or not.
*/
TRACE
(
"Setting specular enable state
\n
"
);
/* TODO: Add to the material setting functions */
if
(
stateblock
->
renderState
[
WINED3DRS_SPECULARENABLE
])
{
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_SPECULAR
,
(
float
*
)
&
stateblock
->
material
.
Specular
);
checkGLcall
(
"glMaterialfv"
);
if
(
GL_SUPPORT
(
EXT_SECONDARY_COLOR
))
{
glEnable
(
GL_COLOR_SUM_EXT
);
}
else
{
TRACE
(
"Specular colors cannot be enabled in this version of opengl
\n
"
);
}
checkGLcall
(
"glEnable(GL_COLOR_SUM)"
);
if
(
GL_SUPPORT
(
NV_REGISTER_COMBINERS
))
{
GL_EXTCALL
(
glFinalCombinerInputNV
(
GL_VARIABLE_B_NV
,
GL_SPARE0_PLUS_SECONDARY_COLOR_NV
,
GL_UNSIGNED_IDENTITY_NV
,
GL_RGB
));
checkGLcall
(
"glFinalCombinerInputNV()"
);
}
}
else
{
float
black
[
4
]
=
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
};
/* for the case of enabled lighting: */
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_SPECULAR
,
&
black
[
0
]);
checkGLcall
(
"glMaterialfv"
);
/* for the case of disabled lighting: */
if
(
GL_SUPPORT
(
EXT_SECONDARY_COLOR
))
{
glDisable
(
GL_COLOR_SUM_EXT
);
}
else
{
TRACE
(
"Specular colors cannot be disabled in this version of opengl
\n
"
);
}
checkGLcall
(
"glDisable(GL_COLOR_SUM)"
);
if
(
GL_SUPPORT
(
NV_REGISTER_COMBINERS
))
{
GL_EXTCALL
(
glFinalCombinerInputNV
(
GL_VARIABLE_B_NV
,
GL_SPARE0_NV
,
GL_UNSIGNED_IDENTITY_NV
,
GL_RGB
));
checkGLcall
(
"glFinalCombinerInputNV()"
);
}
}
}
static
void
state_texfactor
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
)
{
unsigned
int
i
;
...
...
@@ -492,7 +562,7 @@ const struct StateEntry StateTable[] =
{
/* 26, WINED3DRS_DITHERENABLE */
STATE_RENDER
(
WINED3DRS_DITHERENABLE
),
state_ditherenable
},
{
/* 27, WINED3DRS_ALPHABLENDENABLE */
STATE_RENDER
(
WINED3DRS_ALPHABLENDENABLE
),
state_blend
},
{
/* 28, WINED3DRS_FOGENABLE */
STATE_RENDER
(
WINED3DRS_FOGENABLE
),
state_unknown
},
{
/* 29, WINED3DRS_SPECULARENABLE */
STATE_RENDER
(
WINED3DRS_SPECULARENABLE
),
state_
unknown
},
{
/* 29, WINED3DRS_SPECULARENABLE */
STATE_RENDER
(
WINED3DRS_SPECULARENABLE
),
state_
specularenable
},
{
/* 30, WINED3DRS_ZVISIBLE */
0
/* Not supported according to the msdn */
,
state_nogl
},
{
/* 31, WINED3DRS_SUBPIXEL */
STATE_RENDER
(
WINED3DRS_SUBPIXEL
),
state_unknown
},
{
/* 32, WINED3DRS_SUBPIXELX */
STATE_RENDER
(
WINED3DRS_SUBPIXELX
),
state_unknown
},
...
...
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