Browse Source

expose get_draw_order, etc.

David Rose 22 years ago
parent
commit
b4751ec36b
2 changed files with 28 additions and 25 deletions
  1. 23 23
      panda/src/pgraph/renderState.I
  2. 5 2
      panda/src/pgraph/renderState.h

+ 23 - 23
panda/src/pgraph/renderState.I

@@ -182,28 +182,9 @@ get_override(int n) const {
   return _attributes[n]._override;
   return _attributes[n]._override;
 }
 }
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: RenderState::get_bin_index
-//       Access: Public
-//  Description: Returns the bin index indicated by the CullBinAttrib,
-//               if any, associated by this state (or the default bin
-//               index if there is no CullBinAttrib).  This function
-//               is provided as an optimization for determining this
-//               at render time.
-////////////////////////////////////////////////////////////////////
-INLINE int RenderState::
-get_bin_index() const {
-  if ((_flags & F_checked_bin_index) == 0) {
-    // We pretend this function is const, even though it transparently
-    // modifies the internal bin_index cache.
-    ((RenderState *)this)->determine_bin_index();
-  }
-  return _bin_index;
-}
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: RenderState::get_draw_order
 //     Function: RenderState::get_draw_order
-//       Access: Public
+//       Access: Published
 //  Description: Returns the draw order indicated by the
 //  Description: Returns the draw order indicated by the
 //               CullBinAttrib, if any, associated by this state (or 0
 //               CullBinAttrib, if any, associated by this state (or 0
 //               if there is no CullBinAttrib).  See get_bin_index().
 //               if there is no CullBinAttrib).  See get_bin_index().
@@ -220,7 +201,7 @@ get_draw_order() const {
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: RenderState::get_fog
 //     Function: RenderState::get_fog
-//       Access: Public
+//       Access: Published
 //  Description: This function is provided as an optimization, to
 //  Description: This function is provided as an optimization, to
 //               speed up the render-time checking for the existance
 //               speed up the render-time checking for the existance
 //               of a FogAttrib on this state.  It returns a
 //               of a FogAttrib on this state.  It returns a
@@ -239,7 +220,7 @@ get_fog() const {
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: RenderState::get_bin
 //     Function: RenderState::get_bin
-//       Access: Public
+//       Access: Published
 //  Description: This function is provided as an optimization, to
 //  Description: This function is provided as an optimization, to
 //               speed up the render-time checking for the existance
 //               speed up the render-time checking for the existance
 //               of a BinAttrib on this state.  It returns a
 //               of a BinAttrib on this state.  It returns a
@@ -258,7 +239,7 @@ get_bin() const {
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: RenderState::get_transparency
 //     Function: RenderState::get_transparency
-//       Access: Public
+//       Access: Published
 //  Description: This function is provided as an optimization, to
 //  Description: This function is provided as an optimization, to
 //               speed up the render-time checking for the existance
 //               speed up the render-time checking for the existance
 //               of a TransparencyAttrib on this state.  It returns a
 //               of a TransparencyAttrib on this state.  It returns a
@@ -275,6 +256,25 @@ get_transparency() const {
   return _transparency;
   return _transparency;
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: RenderState::get_bin_index
+//       Access: Published
+//  Description: Returns the bin index indicated by the CullBinAttrib,
+//               if any, associated by this state (or the default bin
+//               index if there is no CullBinAttrib).  This function
+//               is provided as an optimization for determining this
+//               at render time.
+////////////////////////////////////////////////////////////////////
+INLINE int RenderState::
+get_bin_index() const {
+  if ((_flags & F_checked_bin_index) == 0) {
+    // We pretend this function is const, even though it transparently
+    // modifies the internal bin_index cache.
+    ((RenderState *)this)->determine_bin_index();
+  }
+  return _bin_index;
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: RenderState::set_destructing
 //     Function: RenderState::set_destructing
 //       Access: Private
 //       Access: Private

+ 5 - 2
panda/src/pgraph/renderState.h

@@ -99,13 +99,16 @@ PUBLISHED:
   static int get_num_unused_states();
   static int get_num_unused_states();
   static int clear_cache();
   static int clear_cache();
 
 
-public:
-  INLINE int get_bin_index() const;
+PUBLISHED:
+  // These methods are intended for use by low-level code, but they're
+  // also handy enough to expose to high-level users.
   INLINE int get_draw_order() const;
   INLINE int get_draw_order() const;
   INLINE const FogAttrib *get_fog() const;
   INLINE const FogAttrib *get_fog() const;
   INLINE const CullBinAttrib *get_bin() const;
   INLINE const CullBinAttrib *get_bin() const;
   INLINE const TransparencyAttrib *get_transparency() const;
   INLINE const TransparencyAttrib *get_transparency() const;
+  INLINE int get_bin_index() const;
 
 
+public:
   CPT(RenderState) issue_delta_modify(const RenderState *other, 
   CPT(RenderState) issue_delta_modify(const RenderState *other, 
                                       GraphicsStateGuardianBase *gsg) const;
                                       GraphicsStateGuardianBase *gsg) const;
   CPT(RenderState) issue_delta_set(const RenderState *other, 
   CPT(RenderState) issue_delta_set(const RenderState *other,