Browse Source

reset_if_new should return true or false

David Rose 22 years ago
parent
commit
99b64bdfc6

+ 5 - 2
panda/src/display/graphicsStateGuardian.I

@@ -128,13 +128,16 @@ clear(DisplayRegion *dr) {
 //     Function: GraphicsStateGuardian::reset_if_new
 //     Function: GraphicsStateGuardian::reset_if_new
 //       Access: Public
 //       Access: Public
 //  Description: Calls reset() to initialize the GSG, but only if it
 //  Description: Calls reset() to initialize the GSG, but only if it
-//               hasn't been called yet.
+//               hasn't been called yet.  Returns true if the GSG was
+//               new, false otherwise.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-INLINE void GraphicsStateGuardian::
+INLINE bool GraphicsStateGuardian::
 reset_if_new() {
 reset_if_new() {
   if (_needs_reset) {
   if (_needs_reset) {
     reset();
     reset();
+    return true;
   }
   }
+  return false;
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

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

@@ -126,7 +126,7 @@ public:
   virtual CPT(RenderState) begin_decal_base_second();
   virtual CPT(RenderState) begin_decal_base_second();
   virtual void finish_decal();
   virtual void finish_decal();
 
 
-  INLINE void reset_if_new();
+  INLINE bool reset_if_new();
   virtual void reset();
   virtual void reset();
 
 
   INLINE void modify_state(const RenderState *state);
   INLINE void modify_state(const RenderState *state);