Alexandre Julliard : Revert "wined3d: Where possible, avoid using D3DCOLORTOGLFLOAT4."

Alexandre Julliard julliard at wine.codeweavers.com
Fri Dec 29 06:47:13 CST 2006


Module: wine
Branch: master
Commit: bbfe120036fb1dcbcb8d8ef6f1ec5a9f7a2736dc
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=bbfe120036fb1dcbcb8d8ef6f1ec5a9f7a2736dc

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Dec 29 11:35:57 2006 +0100

Revert "wined3d: Where possible, avoid using D3DCOLORTOGLFLOAT4."

This reverts commit 045975b1f439049da9405a8defbad82a39710f49.

---

 dlls/wined3d/basetexture.c     |    6 +++---
 dlls/wined3d/device.c          |    6 +++---
 dlls/wined3d/state.c           |   22 +++++++++++-----------
 dlls/wined3d/wined3d_private.h |    6 ------
 4 files changed, 17 insertions(+), 23 deletions(-)

diff --git a/dlls/wined3d/basetexture.c b/dlls/wined3d/basetexture.c
index 4b6b0d5..9b9b5d7 100644
--- a/dlls/wined3d/basetexture.c
+++ b/dlls/wined3d/basetexture.c
@@ -363,11 +363,11 @@ void WINAPI IWineD3DBaseTextureImpl_Appl
             break;
             case WINED3DSAMP_BORDERCOLOR:
             {
-                GLint col[4];
+                float col[4];
                 *state = samplerStates[textureObjectSamplerStates[i].state];
-                D3DCOLORTOGLINT4(*state, col);
+                D3DCOLORTOGLFLOAT4(*state, col);
                 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, ...)");
             }
             break;
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 4ebca23..63f84f8 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -321,7 +321,7 @@ static void delete_glsl_shader_list(IWin
 /* Apply the current values to the specified texture stage */
 static void WINAPI IWineD3DDeviceImpl_SetupTextureStates(IWineD3DDevice *iface, DWORD Sampler, DWORD texture_idx, DWORD Flags) {
     IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
-    GLint col[4];
+    float col[4];
 
     union {
         float f;
@@ -386,8 +386,8 @@ static void WINAPI IWineD3DDeviceImpl_Se
         checkGLcall("glTexEnvi GL_TEXTURE_LOD_BIAS_EXT ...");
     }
 
-    D3DCOLORTOGLINT4(This->stateBlock->renderState[WINED3DRS_TEXTUREFACTOR], col);
-    glTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, &col[0]);
+    D3DCOLORTOGLFLOAT4(This->stateBlock->renderState[WINED3DRS_TEXTUREFACTOR], col);
+    glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, &col[0]);
     checkGLcall("glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, color);");
 
     /* TODO: NV_POINT_SPRITE */
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index a842a6f..27fd9f4 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -197,11 +197,11 @@ static void state_zfunc(DWORD state, IWi
 }
 
 static void state_ambient(DWORD state, IWineD3DStateBlockImpl *stateblock) {
-    GLint col[4];
-    D3DCOLORTOGLINT4(stateblock->renderState[WINED3DRS_AMBIENT], col);
+    float col[4];
+    D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_AMBIENT], col);
 
-    TRACE("Setting ambient to (%d,%d,%d,%d)\n", col[0], col[1], col[2], col[3]);
-    glLightModeliv(GL_LIGHT_MODEL_AMBIENT, col);
+    TRACE("Setting ambient to (%f,%f,%f,%f)\n", col[0], col[1], col[2], col[3]);
+    glLightModelfv(GL_LIGHT_MODEL_AMBIENT, col);
     checkGLcall("glLightModel for MODEL_AMBIENT");
 }
 
@@ -499,8 +499,8 @@ static void state_texfactor(DWORD state,
     /* Note the texture color applies to all textures whereas
      * GL_TEXTURE_ENV_COLOR applies to active only
      */
-    GLint col[4];
-    D3DCOLORTOGLINT4(stateblock->renderState[WINED3DRS_TEXTUREFACTOR], col);
+    float col[4];
+    D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_TEXTUREFACTOR], col);
 
     if (!GL_SUPPORT(NV_REGISTER_COMBINERS)) {
         /* And now the default texture color as well */
@@ -515,11 +515,11 @@ static void state_texfactor(DWORD state,
                 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);");
         }
     } 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, IWine
 }
 
 static void state_fogcolor(DWORD state, IWineD3DStateBlockImpl *stateblock) {
-    GLint col[4];
-    D3DCOLORTOGLINT4(stateblock->renderState[WINED3DRS_FOGCOLOR], col);
+    float col[4];
+    D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_FOGCOLOR], col);
     /* Set the default alpha blend color */
-    glFogiv(GL_FOG_COLOR, &col[0]);
+    glFogfv(GL_FOG_COLOR, &col[0]);
     checkGLcall("glFog GL_FOG_COLOR");
 }
 
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 14d1b0e..67ccfcb 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -228,12 +228,6 @@ extern int num_lock;
   (vec)[2] = D3DCOLOR_B(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 */
 /* --------------------- */
 #define MAX_LEVELS  256  /* Maximum number of mipmap levels. Guessed at 256 */




More information about the wine-cvs mailing list