瀏覽代碼

fix build break

David Rose 24 年之前
父節點
當前提交
b5bf1088dd
共有 2 個文件被更改,包括 21 次插入1 次删除
  1. 19 0
      panda/src/pgraph/cullBinManager.I
  2. 2 1
      panda/src/pgraph/cullBinManager.h

+ 19 - 0
panda/src/pgraph/cullBinManager.I

@@ -123,3 +123,22 @@ get_bin_sort(int bin_index) const {
   nassertr(_bin_definitions[bin_index]._in_use, 0);
   nassertr(_bin_definitions[bin_index]._in_use, 0);
   return _bin_definitions[bin_index]._sort;
   return _bin_definitions[bin_index]._sort;
 }
 }
+
+////////////////////////////////////////////////////////////////////
+//     Function: CullBinManager::set_bin_sort
+//       Access: Published
+//  Description: Changes the sort order of the bin with the indicated
+//               bin_index (where bin_index was retrieved by get_bin()
+//               or find_bin()).
+//
+//               The bins are rendered in increasing order by their
+//               sort order; this number may be changed from time to
+//               time to reorder the bins.
+////////////////////////////////////////////////////////////////////
+INLINE void CullBinManager::
+set_bin_sort(int bin_index, int sort) {
+  nassertv(bin_index >= 0 && bin_index < (int)_bin_definitions.size());
+  nassertv(_bin_definitions[bin_index]._in_use);
+  _bin_definitions[bin_index]._sort = sort;
+  _bins_are_sorted = false;
+}

+ 2 - 1
panda/src/pgraph/cullBinManager.h

@@ -24,6 +24,7 @@
 #include "pointerTo.h"
 #include "pointerTo.h"
 #include "pvector.h"
 #include "pvector.h"
 #include "pmap.h"
 #include "pmap.h"
+#include "vector_int.h"
 
 
 class CullResult;
 class CullResult;
 class GraphicsStateGuardianBase;
 class GraphicsStateGuardianBase;
@@ -91,7 +92,7 @@ private:
   typedef pmap<string, int> BinsByName;
   typedef pmap<string, int> BinsByName;
   BinsByName _bins_by_name;
   BinsByName _bins_by_name;
 
 
-  typedef pvector<int> SortedBins;
+  typedef vector_int SortedBins;
   SortedBins _sorted_bins;
   SortedBins _sorted_bins;
   bool _bins_are_sorted;
   bool _bins_are_sorted;
   bool _unused_bin_index;
   bool _unused_bin_index;