Update of /cvsroot/plib/plib/src/ssgAux
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28083/plib/src/ssgAux
Modified Files:
ssgaFire.cxx
Log Message:
pwWindows.cxx had an error that cause the window position to be interpreted
as the position of the rendered area - not the position of the window decorations.
ssgaFire had a dependancy on the scale of the model. If you treat an OpenGL unit as 1meter, you got good results - but if you treat an OpenGL unit as an inch or a mile, the fire looks crap.
Minor tweaks to exposer and the mod-player demo.
Index: ssgaFire.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaFire.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- ssgaFire.cxx 29 Dec 2004 07:19:40 -0000 1.6
+++ ssgaFire.cxx 1 Feb 2005 01:14:13 -0000 1.7
@@ -123,10 +123,14 @@
static ssgSimpleState *fireState = NULL ;
static ssgTexture *fireTexture = NULL ;
-
+static bool isfogged = true ;
static int preFireDraw ( ssgEntity * )
{
- glDisable ( GL_FOG ) ;
+ isfogged = glIsEnabled ( GL_FOG ) ;
+
+ if ( isfogged )
+ glDisable ( GL_FOG ) ;
+
glBlendFunc ( GL_ONE, GL_ONE ) ;
return TRUE ;
}
@@ -135,7 +139,10 @@
static int postFireDraw ( ssgEntity * )
{
glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
- glEnable ( GL_FOG ) ;
+
+ if ( isfogged )
+ glEnable ( GL_FOG ) ;
+
return TRUE ;
}
@@ -186,6 +193,7 @@
setState ( fireState ) ;
setCallback ( SSG_CALLBACK_PREDRAW , preFireDraw ) ;
setCallback ( SSG_CALLBACK_POSTDRAW, postFireDraw ) ;
+ update ( 2.0f * max_ttl / (float)(getNumParticles()) ) ;
}
void ssgaFire::update ( float t )
|