소스 검색

reset_if_new should return true or false

David Rose 22 년 전
부모
커밋
99b64bdfc6
2개의 변경된 파일6개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 2
      panda/src/display/graphicsStateGuardian.I
  2. 1 1
      panda/src/display/graphicsStateGuardian.h

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

@@ -128,13 +128,16 @@ clear(DisplayRegion *dr) {
 //     Function: GraphicsStateGuardian::reset_if_new
 //       Access: Public
 //  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() {
   if (_needs_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 void finish_decal();
 
-  INLINE void reset_if_new();
+  INLINE bool reset_if_new();
   virtual void reset();
 
   INLINE void modify_state(const RenderState *state);