diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llspatialpartition.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/linden/indra/newview/llspatialpartition.h b/linden/indra/newview/llspatialpartition.h index 3046b73..31ec040 100644 --- a/linden/indra/newview/llspatialpartition.h +++ b/linden/indra/newview/llspatialpartition.h | |||
@@ -46,13 +46,17 @@ | |||
46 | class LLSpatialPartition; | 46 | class LLSpatialPartition; |
47 | class LLSpatialBridge; | 47 | class LLSpatialBridge; |
48 | 48 | ||
49 | class LLDrawInfo | 49 | class LLDrawInfo : public LLRefCount |
50 | { | 50 | { |
51 | protected: | ||
52 | ~LLDrawInfo(); | ||
53 | |||
51 | public: | 54 | public: |
52 | LLDrawInfo(U32 start, U32 end, U32 count, U32 offset, | 55 | LLDrawInfo(U32 start, U32 end, U32 count, U32 offset, |
53 | LLViewerImage* image, LLVertexBuffer* buffer, | 56 | LLViewerImage* image, LLVertexBuffer* buffer, |
54 | BOOL fullbright = FALSE, U8 bump = 0, BOOL particle = FALSE, F32 part_size = 0); | 57 | BOOL fullbright = FALSE, U8 bump = 0, BOOL particle = FALSE, F32 part_size = 0); |
55 | 58 | ||
59 | |||
56 | LLPointer<LLVertexBuffer> mVertexBuffer; | 60 | LLPointer<LLVertexBuffer> mVertexBuffer; |
57 | LLPointer<LLViewerImage> mTexture; | 61 | LLPointer<LLViewerImage> mTexture; |
58 | LLPointer<LLCubeMap> mReflectionMap; | 62 | LLPointer<LLCubeMap> mReflectionMap; |
@@ -78,18 +82,21 @@ public: | |||
78 | 82 | ||
79 | struct CompareTexturePtr | 83 | struct CompareTexturePtr |
80 | { | 84 | { |
81 | bool operator()(const LLDrawInfo* const& lhs, const LLDrawInfo* const& rhs) | 85 | bool operator()(const LLPointer<LLDrawInfo>& lhs, const LLPointer<LLDrawInfo>& rhs) |
82 | { | 86 | { |
83 | 87 | // sort by pointer, sort NULL down to the end | |
84 | return lhs == NULL || rhs == NULL || lhs->mTexture > rhs->mTexture; | 88 | return lhs.get() != rhs.get() |
89 | && (lhs.isNull() || (rhs.notNull() && lhs->mTexture.get() > rhs->mTexture.get())); | ||
85 | } | 90 | } |
86 | }; | 91 | }; |
87 | 92 | ||
88 | struct CompareBump | 93 | struct CompareBump |
89 | { | 94 | { |
90 | bool operator()(const LLDrawInfo* const& lhs, const LLDrawInfo* const& rhs) | 95 | bool operator()(const LLPointer<LLDrawInfo>& lhs, const LLPointer<LLDrawInfo>& rhs) |
91 | { | 96 | { |
92 | return lhs == NULL || rhs == NULL || lhs->mBump > rhs->mBump; | 97 | // sort by mBump value, sort NULL down to the end |
98 | return lhs.get() != rhs.get() | ||
99 | && (lhs.isNull() || (rhs.notNull() && lhs->mBump > rhs->mBump)); | ||
93 | } | 100 | } |
94 | }; | 101 | }; |
95 | }; | 102 | }; |
@@ -102,7 +109,8 @@ public: | |||
102 | typedef std::vector<LLPointer<LLSpatialGroup> > sg_vector_t; | 109 | typedef std::vector<LLPointer<LLSpatialGroup> > sg_vector_t; |
103 | typedef std::set<LLPointer<LLSpatialGroup> > sg_set_t; | 110 | typedef std::set<LLPointer<LLSpatialGroup> > sg_set_t; |
104 | typedef std::vector<LLPointer<LLSpatialBridge> > bridge_list_t; | 111 | typedef std::vector<LLPointer<LLSpatialBridge> > bridge_list_t; |
105 | typedef std::map<U32, std::vector<LLDrawInfo*> > draw_map_t; | 112 | typedef std::vector<LLPointer<LLDrawInfo> > drawmap_elem_t; |
113 | typedef std::map<U32, drawmap_elem_t > draw_map_t; | ||
106 | typedef std::map<LLPointer<LLViewerImage>, LLPointer<LLVertexBuffer> > buffer_map_t; | 114 | typedef std::map<LLPointer<LLViewerImage>, LLPointer<LLVertexBuffer> > buffer_map_t; |
107 | 115 | ||
108 | typedef LLOctreeListener<LLDrawable> BaseType; | 116 | typedef LLOctreeListener<LLDrawable> BaseType; |