summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerparceloverlay.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerparceloverlay.cpp')
-rwxr-xr-xindra/newview/llviewerparceloverlay.cpp45
1 files changed, 32 insertions, 13 deletions
diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp
index 1f14aa4afc..2e9b5de72b 100755
--- a/indra/newview/llviewerparceloverlay.cpp
+++ b/indra/newview/llviewerparceloverlay.cpp
@@ -53,6 +53,14 @@
static const U8 OVERLAY_IMG_COMPONENTS = 4;
static const F32 LINE_WIDTH = 0.0625f;
+bool LLViewerParcelOverlay::sColorSetInitialized = false;
+LLUIColor LLViewerParcelOverlay::sAvailColor;
+LLUIColor LLViewerParcelOverlay::sOwnedColor;
+LLUIColor LLViewerParcelOverlay::sGroupColor;
+LLUIColor LLViewerParcelOverlay::sSelfColor;
+LLUIColor LLViewerParcelOverlay::sForSaleColor;
+LLUIColor LLViewerParcelOverlay::sAuctionColor;
+
LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_width_meters)
: mRegion( region ),
mParcelGridsPerEdge( S32( region_width_meters / PARCEL_GRID_STEP_METERS ) ),
@@ -60,6 +68,17 @@ LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_
mTimeSinceLastUpdate(),
mOverlayTextureIdx(-1)
{
+ if (!sColorSetInitialized)
+ {
+ sColorSetInitialized = true;
+ sAvailColor = LLUIColorTable::instance().getColor("PropertyColorAvail").get();
+ sOwnedColor = LLUIColorTable::instance().getColor("PropertyColorOther").get();
+ sGroupColor = LLUIColorTable::instance().getColor("PropertyColorGroup").get();
+ sSelfColor = LLUIColorTable::instance().getColor("PropertyColorSelf").get();
+ sForSaleColor = LLUIColorTable::instance().getColor("PropertyColorForSale").get();
+ sAuctionColor = LLUIColorTable::instance().getColor("PropertyColorAuction").get();
+ }
+
// Create a texture to hold color information.
// 4 components
// Use mipmaps = false, clamped, NEAREST filter, for sharp edges
@@ -321,12 +340,12 @@ void LLViewerParcelOverlay::updateOverlayTexture()
mOverlayTextureIdx = 0;
}
- const LLColor4U avail = LLUIColorTable::instance().getColor("PropertyColorAvail").get();
- const LLColor4U owned = LLUIColorTable::instance().getColor("PropertyColorOther").get();
- const LLColor4U group = LLUIColorTable::instance().getColor("PropertyColorGroup").get();
- const LLColor4U self = LLUIColorTable::instance().getColor("PropertyColorSelf").get();
- const LLColor4U for_sale = LLUIColorTable::instance().getColor("PropertyColorForSale").get();
- const LLColor4U auction = LLUIColorTable::instance().getColor("PropertyColorAuction").get();
+ const LLColor4U avail = sAvailColor.get();
+ const LLColor4U owned = sOwnedColor.get();
+ const LLColor4U group = sGroupColor.get();
+ const LLColor4U self = sSelfColor.get();
+ const LLColor4U for_sale = sForSaleColor.get();
+ const LLColor4U auction = sAuctionColor.get();
// Create the base texture.
U8 *raw = mImageRaw->getData();
@@ -339,7 +358,7 @@ void LLViewerParcelOverlay::updateOverlayTexture()
{
U8 ownership = mOwnership[i];
- F32 r,g,b,a;
+ U8 r,g,b,a;
// Color stored in low three bits
switch( ownership & 0x7 )
@@ -433,11 +452,11 @@ void LLViewerParcelOverlay::updatePropertyLines()
return;
LLColor4U colors[PARCEL_COLOR_MASK + 1];
- colors[PARCEL_SELF] = LLUIColorTable::instance().getColor("PropertyColorSelf").get();
- colors[PARCEL_OWNED] = LLUIColorTable::instance().getColor("PropertyColorOther").get();
- colors[PARCEL_GROUP] = LLUIColorTable::instance().getColor("PropertyColorGroup").get();
- colors[PARCEL_FOR_SALE] = LLUIColorTable::instance().getColor("PropertyColorForSale").get();
- colors[PARCEL_AUCTION] = LLUIColorTable::instance().getColor("PropertyColorAuction").get();
+ colors[PARCEL_SELF] = sSelfColor.get();
+ colors[PARCEL_OWNED] = sOwnedColor.get();
+ colors[PARCEL_GROUP] = sGroupColor.get();
+ colors[PARCEL_FOR_SALE] = sForSaleColor.get();
+ colors[PARCEL_AUCTION] = sAuctionColor.get();
mEdges.clear();
@@ -611,7 +630,7 @@ void LLViewerParcelOverlay::setDirty()
void LLViewerParcelOverlay::updateGL()
{
- LL_PROFILE_ZONE_SCOPED
+ LL_PROFILE_ZONE_SCOPED;
updateOverlayTexture();
}