diff options
Diffstat (limited to 'linden/indra/newview/llviewerparceloverlay.h')
-rw-r--r-- | linden/indra/newview/llviewerparceloverlay.h | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/linden/indra/newview/llviewerparceloverlay.h b/linden/indra/newview/llviewerparceloverlay.h new file mode 100644 index 0000000..98cc19a --- /dev/null +++ b/linden/indra/newview/llviewerparceloverlay.h | |||
@@ -0,0 +1,116 @@ | |||
1 | /** | ||
2 | * @file llviewerparceloverlay.h | ||
3 | * @brief LLViewerParcelOverlay class header file | ||
4 | * | ||
5 | * Copyright (c) 2002-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | #ifndef LL_LLVIEWERPARCELOVERLAY_H | ||
29 | #define LL_LLVIEWERPARCELOVERLAY_H | ||
30 | |||
31 | // The ownership data for land parcels. | ||
32 | // One of these structures per region. | ||
33 | |||
34 | #include "lldarray.h" | ||
35 | #include "llframetimer.h" | ||
36 | #include "lluuid.h" | ||
37 | #include "llviewerimage.h" | ||
38 | |||
39 | class LLViewerRegion; | ||
40 | class LLVector3; | ||
41 | class LLColor4U; | ||
42 | class LLVector2; | ||
43 | |||
44 | class LLViewerParcelOverlay | ||
45 | { | ||
46 | public: | ||
47 | LLViewerParcelOverlay(LLViewerRegion* region, F32 region_width_meters); | ||
48 | ~LLViewerParcelOverlay(); | ||
49 | |||
50 | // ACCESS | ||
51 | LLImageGL* getTexture() const { return mTexture; } | ||
52 | |||
53 | BOOL isOwned(const LLVector3& pos) const; | ||
54 | BOOL isOwnedSelf(const LLVector3& pos) const; | ||
55 | BOOL isOwnedGroup(const LLVector3& pos) const; | ||
56 | BOOL isOwnedOther(const LLVector3& pos) const; | ||
57 | BOOL isSoundLocal(const LLVector3& pos) const; | ||
58 | |||
59 | BOOL isBuildCameraAllowed(const LLVector3& pos) const; | ||
60 | F32 getOwnedRatio() const; | ||
61 | |||
62 | // Returns the number of vertices drawn | ||
63 | S32 renderPropertyLines(); | ||
64 | |||
65 | U8 ownership( const LLVector3& pos) const; | ||
66 | |||
67 | // MANIPULATE | ||
68 | void uncompressLandOverlay(S32 chunk, U8 *compressed_overlay); | ||
69 | |||
70 | // Indicate property lines and overlay texture need to be rebuilt. | ||
71 | void setDirty(); | ||
72 | |||
73 | void idleUpdate(bool update_now = false); | ||
74 | |||
75 | private: | ||
76 | // This is in parcel rows and columns, not grid rows and columns | ||
77 | // Stored in bottom three bits. | ||
78 | U8 ownership(S32 row, S32 col) const | ||
79 | { return 0x7 & mOwnership[row * mParcelGridsPerEdge + col]; } | ||
80 | |||
81 | void addPropertyLine(LLDynamicArray<LLVector3, 256>& vertex_array, | ||
82 | LLDynamicArray<LLColor4U, 256>& color_array, | ||
83 | LLDynamicArray<LLVector2, 256>& coord_array, | ||
84 | const F32 start_x, const F32 start_y, | ||
85 | const U32 edge, | ||
86 | const LLColor4U& color); | ||
87 | |||
88 | void updateOverlayTexture(); | ||
89 | void updatePropertyLines(); | ||
90 | |||
91 | private: | ||
92 | // Back pointer to the region that owns this structure. | ||
93 | LLViewerRegion* mRegion; | ||
94 | |||
95 | S32 mParcelGridsPerEdge; | ||
96 | |||
97 | LLPointer<LLImageGL> mTexture; | ||
98 | LLPointer<LLImageRaw> mImageRaw; | ||
99 | |||
100 | // Size: mParcelGridsPerEdge * mParcelGridsPerEdge | ||
101 | // Each value is 0-3, PARCEL_AVAIL to PARCEL_SELF in the two low bits | ||
102 | // and other flags in the upper bits. | ||
103 | U8 *mOwnership; | ||
104 | |||
105 | // Update propery lines and overlay texture | ||
106 | BOOL mDirty; | ||
107 | LLFrameTimer mTimeSinceLastUpdate; | ||
108 | S32 mOverlayTextureIdx; | ||
109 | |||
110 | LLUUID mLineImageID; | ||
111 | S32 mVertexCount; | ||
112 | F32* mVertexArray; | ||
113 | U8* mColorArray; | ||
114 | }; | ||
115 | |||
116 | #endif | ||