--- a/m3g/m3gcore11/src/m3g_fog.c Tue Feb 02 01:47:50 2010 +0200
+++ b/m3g/m3gcore11/src/m3g_fog.c Fri Apr 16 16:21:04 2010 +0300
@@ -197,9 +197,10 @@
M3G_ASSERT_GL;
}
+#ifdef M3G_USE_NGL_API
/*!
* \internal
- * \brief Applies fog to OpenGL. This is used for
+ * \brief Applies fog to NGL. This is used for
* Sprite3D objects only.
*
* \param self Fog object
@@ -232,12 +233,9 @@
glEnable(GL_FOG);
glFogf(GL_FOG_MODE, GL_LINEAR);
-#ifdef M3G_USE_NGL_API
+
/* NGL works differently in fog calculation */
glFogf(GL_FOG_START, -m3gDiv(finalZ, fogValue));
-#else
- glFogf(GL_FOG_START, m3gAbs(m3gDiv(finalZ, fogValue)));
-#endif
glFogf(GL_FOG_END, 0.f);
glFogxv(GL_FOG_COLOR, temp);
}
@@ -245,7 +243,7 @@
glDisable(GL_FOG);
}
}
-
+#endif
/*----------------------------------------------------------------------
* Virtual function table
*--------------------------------------------------------------------*/