Browse Source

sync with glgsg

Dave Schuyler 24 years ago
parent
commit
091b08b97f

+ 0 - 1
panda/src/crgsg/crGeomNodeContext.h

@@ -37,7 +37,6 @@
 #include "cr_glwrapper.h"
 #include "cr_applications.h"
 #include "cr_spu.h"
-///////#include "cr_glstate.h"
 extern SPUDispatchTable chromium;
 
 #include <geomNodeContext.h>

+ 3 - 19
panda/src/crgsg/crGraphicsStateGuardian.I

@@ -1037,23 +1037,7 @@ get_current_alpha_scale() const {
 ////////////////////////////////////////////////////////////////////
 INLINE GLenum CRGraphicsStateGuardian::get_light_id(int index) const
 {
-    switch( index )
-    {
-        case 0: return GL_LIGHT0;
-        case 1: return GL_LIGHT1;
-        case 2: return GL_LIGHT2;
-        case 3: return GL_LIGHT3;
-        case 4: return GL_LIGHT4;
-        case 5: return GL_LIGHT5;
-        case 6: return GL_LIGHT6;
-        case 7: return GL_LIGHT7;
-        default:
-            crgsg_cat.error()
-              << "get_light_id() - we don't currently support ids "
-              << "> 8" << endl;
-            break;
-    }
-    return GL_LIGHT0;
+  return GL_LIGHT0 + index;
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -1088,9 +1072,9 @@ get_clip_plane_id(int index) const {
 ////////////////////////////////////////////////////////////////////
 INLINE void CRGraphicsStateGuardian::
 issue_scene_graph_color() {
-  if (_issued_color_stale) {
+  if (_scene_graph_color_stale) {
     issue_transformed_color(_scene_graph_color);
-    _issued_color_stale = false;
+    _scene_graph_color_stale = false;
   }
 }
 

+ 5 - 5
panda/src/crgsg/crGraphicsStateGuardian.cxx

@@ -2507,7 +2507,7 @@ issue_color_transform(const ColorMatrixTransition *attrib) {
     _color_transform_enabled = true;
   }
 
-  _issued_color_stale = _has_scene_graph_color;
+  _scene_graph_color_stale = _has_scene_graph_color;
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -2526,7 +2526,7 @@ issue_alpha_transform(const AlphaTransformTransition *attrib) {
     _alpha_transform_enabled = true;
   }
 
-  _issued_color_stale = _has_scene_graph_color;
+  _scene_graph_color_stale = _has_scene_graph_color;
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -2560,21 +2560,21 @@ issue_color(const ColorTransition *attrib) {
       _scene_graph_color = attrib->get_color();
       _has_scene_graph_color = true;
       _vertex_colors_enabled = false;
-      _issued_color_stale = true;
+      _scene_graph_color_stale = true;
 
     } else {
       // The color attribute is "on" but not "real": it specifies that
       // no scene graph color is in effect, but vertex color is not
       // important either.
       _has_scene_graph_color = false;
-      _issued_color_stale = false;
+      _scene_graph_color_stale = false;
       _vertex_colors_enabled = false;
     }
   } else {
     // The color attribute is "off": it specifies that vertex color
     // should be revealed.
     _has_scene_graph_color = false;
-    _issued_color_stale = false;
+    _scene_graph_color_stale = false;
     _vertex_colors_enabled = true;
   }
 }

+ 1 - 2
panda/src/crgsg/crGraphicsStateGuardian.h

@@ -53,7 +53,6 @@
 #include "cr_glwrapper.h"
 #include "cr_applications.h"
 #include "cr_spu.h"
-///////#include "cr_glstate.h"
 extern SPUDispatchTable chromium;
 
 
@@ -61,7 +60,7 @@ extern SPUDispatchTable chromium;
 class PlaneNode;
 class Light;
 
-#ifdef GSG_VERBOSE
+#if !defined(WIN32) && defined(GSG_VERBOSE)
 ostream &output_cr_enum(ostream &out, GLenum v);
 INLINE ostream &operator << (ostream &out, GLenum v) {
   return output_cr_enum(out, v);

+ 0 - 1
panda/src/crgsg/crTextureContext.h

@@ -37,7 +37,6 @@
 #include "cr_glwrapper.h"
 #include "cr_applications.h"
 #include "cr_spu.h"
-///////#include "cr_glstate.h"
 extern SPUDispatchTable chromium;
 
 #include <textureContext.h>

+ 0 - 1
panda/src/crgsg/create_crgsg.py

@@ -40,7 +40,6 @@ conversion=(
 #include "cr_glwrapper.h"
 #include "cr_applications.h"
 #include "cr_spu.h"
-///////#include "cr_glstate.h"
 extern SPUDispatchTable chromium;
 """),
     ("(TypeHandle CRGraphicsStateGuardian::_type_handle;)", "\\1\nSPUDispatchTable chromium;"),