Browse Source

a bit more debugging

David Rose 23 years ago
parent
commit
0c6e867d50

+ 12 - 0
panda/src/display/graphicsStateGuardian.I

@@ -74,6 +74,12 @@ get_scene() const {
 ////////////////////////////////////////////////////////////////////
 INLINE void GraphicsStateGuardian::
 modify_state(const RenderState *state) {
+#ifndef NDEBUG
+  if (gsg_cat.is_spam()) {
+    gsg_cat.spam() << "Modifying GSG state with:\n";
+    state->write(gsg_cat.spam(false), 2);
+  }
+#endif
   _state = _state->issue_delta_modify(state, this);
 }
 
@@ -91,6 +97,12 @@ modify_state(const RenderState *state) {
 ////////////////////////////////////////////////////////////////////
 INLINE void GraphicsStateGuardian::
 set_state(const RenderState *state) {
+#ifndef NDEBUG
+  if (gsg_cat.is_spam()) {
+    gsg_cat.spam() << "Setting GSG state to:\n";
+    state->write(gsg_cat.spam(false), 2);
+  }
+#endif
   _state = _state->issue_delta_set(state, this);
 }
 

+ 3 - 3
panda/src/display/graphicsStateGuardian.cxx

@@ -859,7 +859,7 @@ issue_light(const LightAttrib *attrib) {
         light->bind(this, cur_light_id);
 
       } else if (cur_light_id == -1) {
-        display_cat.warning()
+        gsg_cat.warning()
           << "Failed to bind " << *light << " to id.\n";
       }
     }
@@ -1358,11 +1358,11 @@ read_priorities(void) {
       ConfigString type_name = (*i).Val();
       TypeHandle type = TypeRegistry::ptr()->find_type(type_name);
       if (type == TypeHandle::none()) {
-        display_cat.warning()
+        gsg_cat.warning()
           << "Unknown type requested for GSG preference: " << type_name
           << "\n";
       } else {
-        display_cat.debug()
+        gsg_cat.debug()
           << "Specifying type " << type << " for GSG preference.\n";
         factory.add_preferred(type);
       }

+ 1 - 0
panda/src/display/graphicsStateGuardian.h

@@ -38,6 +38,7 @@
 #include "colorWriteAttrib.h"
 #include "colorBlendAttrib.h"
 #include "transparencyAttrib.h"
+#include "config_display.h"
 
 #include "notify.h"
 #include "pvector.h"