Update of /cvsroot/plib/plib/src/ssg
In directory sc8-pr-cvs1:/tmp/cvs-serv30418/ssg
Modified Files:
ssgLoadX.cxx
Log Message:
setting the values of the state after creating it (I am not 100% sure this is necessary)
Index: ssgLoadX.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadX.cxx,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- ssgLoadX.cxx 2 Sep 2002 06:05:48 -0000 1.20
+++ ssgLoadX.cxx 26 Jul 2003 09:33:18 -0000 1.21
@@ -574,7 +574,38 @@
//
if ( currentState == NULL )
- currentState = new ssgSimpleState();
+ { currentState = new ssgSimpleState();
+ currentState->setOpaque();
+ currentState->disable(GL_BLEND);
+ currentState->disable(GL_ALPHA_TEST);
+ currentState->disable(GL_TEXTURE_2D);
+ currentState->enable(GL_COLOR_MATERIAL);
+ currentState->enable(GL_LIGHTING);
+ currentState->setShadeModel(GL_SMOOTH);
+ currentState->setMaterial(GL_AMBIENT , 0.7f, 0.7f, 0.7f, 1.0f);
+ currentState->setMaterial(GL_DIFFUSE , 0.7f, 0.7f, 0.7f, 1.0f);
+ currentState->setMaterial(GL_SPECULAR, 1.0f, 1.0f, 1.0f, 1.0f);
+ currentState->setMaterial(GL_EMISSION, 0.0f, 0.0f, 0.0f, 1.0f);
+ currentState->setShininess(50);
+/*
+ currentState -> setMaterial ( GL_AMBIENT, 0.5, 0.5, 0.5);
+ currentState -> setMaterial ( GL_DIFFUSE, 0.7, 0.7, 0.7); // light grey
+ currentState -> setMaterial ( GL_SPECULAR, 1.0, 1.0, 1.0);
+ currentState -> setMaterial ( GL_EMISSION, 0.0, 0.0, 0.0);
+
+ currentState -> setShininess ( 3 ) ;
+
+ //currentState -> enable ( GL_COLOR_MATERIAL ) ;
+ //currentState -> setColourMaterial ( GL_AMBIENT_AND_DIFFUSE ) ;
+
+ currentState -> enable ( GL_LIGHTING ) ;
+ currentState -> setShadeModel ( GL_SMOOTH ) ;
+
+ currentState -> disable ( GL_BLEND ) ;
+ currentState -> setOpaque () ;
+ currentState -> disable( GL_TEXTURE_2D );
+ */
+ }
currentMesh.addToSSG(
currentState // Pfusch, kludge. NIV135
@@ -636,7 +667,8 @@
//int startLevel = parser.level;
token = parser.getNextToken(0);
while (! parser.eof )
- { if (firsttime)
+ {
+ if (firsttime)
{
if(!HeaderIsValid(token))
return FALSE;
@@ -657,6 +689,7 @@
ssgSetCurrentOptions ( (ssgLoaderOptions*)options ) ;
current_options = ssgGetCurrentOptions () ;
+ currentState = NULL;
top_branch = new ssgBranch ;
curr_branch_ = top_branch;
if ( !parser.openFile( fname, &parser_spec ))
|