Revert "wined3d: Where possible, avoid using D3DCOLORTOGLFLOAT4."
This reverts commit 045975b1f4
.
This commit is contained in:
parent
c723ba1b47
commit
bbfe120036
|
@ -363,11 +363,11 @@ void WINAPI IWineD3DBaseTextureImpl_ApplyStateChanges(IWineD3DBaseTexture *iface
|
||||||
break;
|
break;
|
||||||
case WINED3DSAMP_BORDERCOLOR:
|
case WINED3DSAMP_BORDERCOLOR:
|
||||||
{
|
{
|
||||||
GLint col[4];
|
float col[4];
|
||||||
*state = samplerStates[textureObjectSamplerStates[i].state];
|
*state = samplerStates[textureObjectSamplerStates[i].state];
|
||||||
D3DCOLORTOGLINT4(*state, col);
|
D3DCOLORTOGLFLOAT4(*state, col);
|
||||||
TRACE("Setting border color for %u to %x\n", textureDimensions, *state);
|
TRACE("Setting border color for %u to %x\n", textureDimensions, *state);
|
||||||
glTexParameteriv(textureDimensions, GL_TEXTURE_BORDER_COLOR, &col[0]);
|
glTexParameterfv(textureDimensions, GL_TEXTURE_BORDER_COLOR, &col[0]);
|
||||||
checkGLcall("glTexParameteri(..., GL_TEXTURE_BORDER_COLOR, ...)");
|
checkGLcall("glTexParameteri(..., GL_TEXTURE_BORDER_COLOR, ...)");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -321,7 +321,7 @@ static void delete_glsl_shader_list(IWineD3DDevice* iface) {
|
||||||
/* Apply the current values to the specified texture stage */
|
/* Apply the current values to the specified texture stage */
|
||||||
static void WINAPI IWineD3DDeviceImpl_SetupTextureStates(IWineD3DDevice *iface, DWORD Sampler, DWORD texture_idx, DWORD Flags) {
|
static void WINAPI IWineD3DDeviceImpl_SetupTextureStates(IWineD3DDevice *iface, DWORD Sampler, DWORD texture_idx, DWORD Flags) {
|
||||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||||
GLint col[4];
|
float col[4];
|
||||||
|
|
||||||
union {
|
union {
|
||||||
float f;
|
float f;
|
||||||
|
@ -386,8 +386,8 @@ static void WINAPI IWineD3DDeviceImpl_SetupTextureStates(IWineD3DDevice *iface,
|
||||||
checkGLcall("glTexEnvi GL_TEXTURE_LOD_BIAS_EXT ...");
|
checkGLcall("glTexEnvi GL_TEXTURE_LOD_BIAS_EXT ...");
|
||||||
}
|
}
|
||||||
|
|
||||||
D3DCOLORTOGLINT4(This->stateBlock->renderState[WINED3DRS_TEXTUREFACTOR], col);
|
D3DCOLORTOGLFLOAT4(This->stateBlock->renderState[WINED3DRS_TEXTUREFACTOR], col);
|
||||||
glTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, &col[0]);
|
glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, &col[0]);
|
||||||
checkGLcall("glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, color);");
|
checkGLcall("glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, color);");
|
||||||
|
|
||||||
/* TODO: NV_POINT_SPRITE */
|
/* TODO: NV_POINT_SPRITE */
|
||||||
|
|
|
@ -197,11 +197,11 @@ static void state_zfunc(DWORD state, IWineD3DStateBlockImpl *stateblock) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_ambient(DWORD state, IWineD3DStateBlockImpl *stateblock) {
|
static void state_ambient(DWORD state, IWineD3DStateBlockImpl *stateblock) {
|
||||||
GLint col[4];
|
float col[4];
|
||||||
D3DCOLORTOGLINT4(stateblock->renderState[WINED3DRS_AMBIENT], col);
|
D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_AMBIENT], col);
|
||||||
|
|
||||||
TRACE("Setting ambient to (%d,%d,%d,%d)\n", col[0], col[1], col[2], col[3]);
|
TRACE("Setting ambient to (%f,%f,%f,%f)\n", col[0], col[1], col[2], col[3]);
|
||||||
glLightModeliv(GL_LIGHT_MODEL_AMBIENT, col);
|
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, col);
|
||||||
checkGLcall("glLightModel for MODEL_AMBIENT");
|
checkGLcall("glLightModel for MODEL_AMBIENT");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -499,8 +499,8 @@ static void state_texfactor(DWORD state, IWineD3DStateBlockImpl *stateblock) {
|
||||||
/* Note the texture color applies to all textures whereas
|
/* Note the texture color applies to all textures whereas
|
||||||
* GL_TEXTURE_ENV_COLOR applies to active only
|
* GL_TEXTURE_ENV_COLOR applies to active only
|
||||||
*/
|
*/
|
||||||
GLint col[4];
|
float col[4];
|
||||||
D3DCOLORTOGLINT4(stateblock->renderState[WINED3DRS_TEXTUREFACTOR], col);
|
D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_TEXTUREFACTOR], col);
|
||||||
|
|
||||||
if (!GL_SUPPORT(NV_REGISTER_COMBINERS)) {
|
if (!GL_SUPPORT(NV_REGISTER_COMBINERS)) {
|
||||||
/* And now the default texture color as well */
|
/* And now the default texture color as well */
|
||||||
|
@ -515,11 +515,11 @@ static void state_texfactor(DWORD state, IWineD3DStateBlockImpl *stateblock) {
|
||||||
FIXME("Program using multiple concurrent textures which this opengl implementation doesn't support\n");
|
FIXME("Program using multiple concurrent textures which this opengl implementation doesn't support\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
glTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, &col[0]);
|
glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, &col[0]);
|
||||||
checkGLcall("glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, color);");
|
checkGLcall("glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, color);");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
GL_EXTCALL(glCombinerParameterivNV(GL_CONSTANT_COLOR0_NV, &col[0]));
|
GL_EXTCALL(glCombinerParameterfvNV(GL_CONSTANT_COLOR0_NV, &col[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -786,10 +786,10 @@ static void state_fog(DWORD state, IWineD3DStateBlockImpl *stateblock) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_fogcolor(DWORD state, IWineD3DStateBlockImpl *stateblock) {
|
static void state_fogcolor(DWORD state, IWineD3DStateBlockImpl *stateblock) {
|
||||||
GLint col[4];
|
float col[4];
|
||||||
D3DCOLORTOGLINT4(stateblock->renderState[WINED3DRS_FOGCOLOR], col);
|
D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_FOGCOLOR], col);
|
||||||
/* Set the default alpha blend color */
|
/* Set the default alpha blend color */
|
||||||
glFogiv(GL_FOG_COLOR, &col[0]);
|
glFogfv(GL_FOG_COLOR, &col[0]);
|
||||||
checkGLcall("glFog GL_FOG_COLOR");
|
checkGLcall("glFog GL_FOG_COLOR");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -228,12 +228,6 @@ extern int num_lock;
|
||||||
(vec)[2] = D3DCOLOR_B(dw); \
|
(vec)[2] = D3DCOLOR_B(dw); \
|
||||||
(vec)[3] = D3DCOLOR_A(dw);
|
(vec)[3] = D3DCOLOR_A(dw);
|
||||||
|
|
||||||
#define D3DCOLORTOGLINT4(src, dst) \
|
|
||||||
(dst)[0] = D3DCOLOR_B_R(src); \
|
|
||||||
(dst)[1] = D3DCOLOR_B_G(src); \
|
|
||||||
(dst)[2] = D3DCOLOR_B_B(src); \
|
|
||||||
(dst)[3] = D3DCOLOR_B_A(src);
|
|
||||||
|
|
||||||
/* DirectX Device Limits */
|
/* DirectX Device Limits */
|
||||||
/* --------------------- */
|
/* --------------------- */
|
||||||
#define MAX_LEVELS 256 /* Maximum number of mipmap levels. Guessed at 256 */
|
#define MAX_LEVELS 256 /* Maximum number of mipmap levels. Guessed at 256 */
|
||||||
|
|
Loading…
Reference in New Issue