[D3D 89] Misc fixes and clean-up.

Christian Costa titan.costa at wanadoo.fr
Fri Jan 31 14:48:06 CST 2003


Changelog :
Fix comment in ZfromZproj.
Fix missing path in lighting code.
Move some OpenGL fog init to the right place.

Christian Costa   titan.costa at wanadoo.fr


-------------- next part --------------
Index: d3ddevice/mesa.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/d3ddevice/mesa.c,v
retrieving revision 1.83
diff -u -r1.83 mesa.c
--- d3ddevice/mesa.c	23 Jan 2003 01:21:50 -0000	1.83
+++ d3ddevice/mesa.c	31 Jan 2003 20:21:00 -0000
@@ -683,7 +683,7 @@
     c = This->proj_mat->_43;
     d = This->proj_mat->_44;
     /* We have in homogenous coordinates Z' = a * Z + c and W' = b * Z + d
-     * So in non homogenous coordinates we have Zproj = (a * Z + b) / (c * Z + d)
+     * So in non homogenous coordinates we have Zproj = (a * Z + c) / (b * Z + d)
      * And finally Z = (d * Zproj - c) / (a - b * Zproj)
      */
     return (d*Zproj - c) / (a - b*Zproj);
@@ -710,7 +710,7 @@
         glThis->transform_state = GL_TRANSFORM_ORTHO;
 	d3ddevice_set_ortho(This);
     }
-    if (This->state_block.render_state[D3DRENDERSTATE_FOGENABLE - 1] == TRUE) {glHint(GL_FOG_HINT,GL_NICEST);
+    if (This->state_block.render_state[D3DRENDERSTATE_FOGENABLE - 1] == TRUE) {
         if (This->state_block.render_state[D3DRENDERSTATE_FOGTABLEMODE - 1] != D3DFOG_NONE) {
             switch (This->state_block.render_state[D3DRENDERSTATE_FOGTABLEMODE - 1]) {
                 case D3DFOG_LINEAR: glFogi(GL_FOG_MODE,GL_LINEAR); break; 
@@ -734,10 +734,10 @@
 	glDisable(GL_FOG);
 
     /* Handle the 'no-normal' case */
-    if (vertex_lit == TRUE)
-        glDisable(GL_LIGHTING);
-    else if (This->state_block.render_state[D3DRENDERSTATE_LIGHTING - 1] == TRUE)
+    if ((vertex_lit == FALSE) && (This->state_block.render_state[D3DRENDERSTATE_LIGHTING - 1] == TRUE))
         glEnable(GL_LIGHTING);
+    else 
+	glDisable(GL_LIGHTING);
 
     /* Handle the code for pre-vertex material properties */
     if (vertex_transformed == FALSE) {
@@ -2266,6 +2266,7 @@
     ENTER_GL();
     TRACE(" current context set\n");
 
+    glHint(GL_FOG_HINT,GL_NICEST);
     glClearColor(0.0, 0.0, 0.0, 0.0);
     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
     glDrawBuffer(buffer);


More information about the wine-patches mailing list