mirror of
https://github.com/FirestormViewer/phoenix-firestorm.git
synced 2026-08-14 00:48:30 +00:00
More constexpr improvements and cleanup of includes of a deleted header file
This commit is contained in:
committed by
Andrey Kleshchev
parent
85b88f5682
commit
ea96f7ac5e
@@ -37,98 +37,98 @@
|
||||
#include "llsettingsdaycycle.h"
|
||||
|
||||
// Grid out of which parcels taken is stepped every 4 meters.
|
||||
const F32 PARCEL_GRID_STEP_METERS = 4.f;
|
||||
constexpr F32 PARCEL_GRID_STEP_METERS = 4.f;
|
||||
|
||||
// Area of one "square" of parcel
|
||||
const S32 PARCEL_UNIT_AREA = 16;
|
||||
constexpr S32 PARCEL_UNIT_AREA = 16;
|
||||
|
||||
// Height _above_ground_ that parcel boundary ends
|
||||
const F32 PARCEL_HEIGHT = 50.f;
|
||||
constexpr F32 PARCEL_HEIGHT = 50.f;
|
||||
|
||||
//Height above ground which parcel boundries exist for explicitly banned avatars
|
||||
const F32 BAN_HEIGHT = 5000.f;
|
||||
constexpr F32 BAN_HEIGHT = 5000.f;
|
||||
|
||||
// Maximum number of entries in an access list
|
||||
const S32 PARCEL_MAX_ACCESS_LIST = 300;
|
||||
constexpr S32 PARCEL_MAX_ACCESS_LIST = 300;
|
||||
//Maximum number of entires in an update packet
|
||||
//for access/ban lists.
|
||||
const F32 PARCEL_MAX_ENTRIES_PER_PACKET = 48.f;
|
||||
constexpr F32 PARCEL_MAX_ENTRIES_PER_PACKET = 48.f;
|
||||
|
||||
// Maximum number of experiences
|
||||
const S32 PARCEL_MAX_EXPERIENCE_LIST = 24;
|
||||
constexpr S32 PARCEL_MAX_EXPERIENCE_LIST = 24;
|
||||
|
||||
// Weekly charge for listing a parcel in the directory
|
||||
const S32 PARCEL_DIRECTORY_FEE = 30;
|
||||
constexpr S32 PARCEL_DIRECTORY_FEE = 30;
|
||||
|
||||
const S32 PARCEL_PASS_PRICE_DEFAULT = 10;
|
||||
const F32 PARCEL_PASS_HOURS_DEFAULT = 1.f;
|
||||
constexpr S32 PARCEL_PASS_PRICE_DEFAULT = 10;
|
||||
constexpr F32 PARCEL_PASS_HOURS_DEFAULT = 1.f;
|
||||
|
||||
// Number of "chunks" in which parcel overlay data is sent
|
||||
// Chunk 0 = southern rows, entire width
|
||||
const S32 PARCEL_OVERLAY_CHUNKS = 4;
|
||||
constexpr S32 PARCEL_OVERLAY_CHUNKS = 4;
|
||||
|
||||
// Bottom three bits are a color index for the land overlay
|
||||
const U8 PARCEL_COLOR_MASK = 0x07;
|
||||
const U8 PARCEL_PUBLIC = 0x00;
|
||||
const U8 PARCEL_OWNED = 0x01;
|
||||
const U8 PARCEL_GROUP = 0x02;
|
||||
const U8 PARCEL_SELF = 0x03;
|
||||
const U8 PARCEL_FOR_SALE = 0x04;
|
||||
const U8 PARCEL_AUCTION = 0x05;
|
||||
constexpr U8 PARCEL_COLOR_MASK = 0x07;
|
||||
constexpr U8 PARCEL_PUBLIC = 0x00;
|
||||
constexpr U8 PARCEL_OWNED = 0x01;
|
||||
constexpr U8 PARCEL_GROUP = 0x02;
|
||||
constexpr U8 PARCEL_SELF = 0x03;
|
||||
constexpr U8 PARCEL_FOR_SALE = 0x04;
|
||||
constexpr U8 PARCEL_AUCTION = 0x05;
|
||||
// unused 0x06
|
||||
// unused 0x07
|
||||
// flag, unused 0x08
|
||||
const U8 PARCEL_HIDDENAVS = 0x10; // avatars not visible outside of parcel. Used for 'see avs' feature, but must be off for compatibility
|
||||
const U8 PARCEL_SOUND_LOCAL = 0x20;
|
||||
const U8 PARCEL_WEST_LINE = 0x40; // flag, property line on west edge
|
||||
const U8 PARCEL_SOUTH_LINE = 0x80; // flag, property line on south edge
|
||||
constexpr U8 PARCEL_HIDDENAVS = 0x10; // avatars not visible outside of parcel. Used for 'see avs' feature, but must be off for compatibility
|
||||
constexpr U8 PARCEL_SOUND_LOCAL = 0x20;
|
||||
constexpr U8 PARCEL_WEST_LINE = 0x40; // flag, property line on west edge
|
||||
constexpr U8 PARCEL_SOUTH_LINE = 0x80; // flag, property line on south edge
|
||||
|
||||
// Transmission results for parcel properties
|
||||
const S32 PARCEL_RESULT_NO_DATA = -1;
|
||||
const S32 PARCEL_RESULT_SUCCESS = 0; // got exactly one parcel
|
||||
const S32 PARCEL_RESULT_MULTIPLE = 1; // got multiple parcels
|
||||
constexpr S32 PARCEL_RESULT_NO_DATA = -1;
|
||||
constexpr S32 PARCEL_RESULT_SUCCESS = 0; // got exactly one parcel
|
||||
constexpr S32 PARCEL_RESULT_MULTIPLE = 1; // got multiple parcels
|
||||
|
||||
const S32 SELECTED_PARCEL_SEQ_ID = -10000;
|
||||
const S32 COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID = -20000;
|
||||
const S32 COLLISION_BANNED_PARCEL_SEQ_ID = -30000;
|
||||
const S32 COLLISION_NOT_ON_LIST_PARCEL_SEQ_ID = -40000;
|
||||
const S32 HOVERED_PARCEL_SEQ_ID = -50000;
|
||||
constexpr S32 SELECTED_PARCEL_SEQ_ID = -10000;
|
||||
constexpr S32 COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID = -20000;
|
||||
constexpr S32 COLLISION_BANNED_PARCEL_SEQ_ID = -30000;
|
||||
constexpr S32 COLLISION_NOT_ON_LIST_PARCEL_SEQ_ID = -40000;
|
||||
constexpr S32 HOVERED_PARCEL_SEQ_ID = -50000;
|
||||
|
||||
const U32 RT_NONE = 0x1 << 0;
|
||||
const U32 RT_OWNER = 0x1 << 1;
|
||||
const U32 RT_GROUP = 0x1 << 2;
|
||||
const U32 RT_OTHER = 0x1 << 3;
|
||||
const U32 RT_LIST = 0x1 << 4;
|
||||
const U32 RT_SELL = 0x1 << 5;
|
||||
constexpr U32 RT_NONE = 0x1 << 0;
|
||||
constexpr U32 RT_OWNER = 0x1 << 1;
|
||||
constexpr U32 RT_GROUP = 0x1 << 2;
|
||||
constexpr U32 RT_OTHER = 0x1 << 3;
|
||||
constexpr U32 RT_LIST = 0x1 << 4;
|
||||
constexpr U32 RT_SELL = 0x1 << 5;
|
||||
|
||||
const S32 INVALID_PARCEL_ID = -1;
|
||||
constexpr S32 INVALID_PARCEL_ID = -1;
|
||||
|
||||
const S32 INVALID_PARCEL_ENVIRONMENT_VERSION = -2;
|
||||
constexpr S32 INVALID_PARCEL_ENVIRONMENT_VERSION = -2;
|
||||
// if Region settings are used, parcel env. version is -1
|
||||
const S32 UNSET_PARCEL_ENVIRONMENT_VERSION = -1;
|
||||
constexpr S32 UNSET_PARCEL_ENVIRONMENT_VERSION = -1;
|
||||
|
||||
// Timeouts for parcels
|
||||
// default is 21 days * 24h/d * 60m/h * 60s/m *1000000 usec/s = 1814400000000
|
||||
const U64 DEFAULT_USEC_CONVERSION_TIMEOUT = U64L(1814400000000);
|
||||
constexpr U64 DEFAULT_USEC_CONVERSION_TIMEOUT = U64L(1814400000000);
|
||||
// ***** TESTING is 10 minutes
|
||||
//const U64 DEFAULT_USEC_CONVERSION_TIMEOUT = U64L(600000000);
|
||||
|
||||
// group is 60 days * 24h/d * 60m/h * 60s/m *1000000 usec/s = 5184000000000
|
||||
const U64 GROUP_USEC_CONVERSION_TIMEOUT = U64L(5184000000000);
|
||||
constexpr U64 GROUP_USEC_CONVERSION_TIMEOUT = U64L(5184000000000);
|
||||
// ***** TESTING is 10 minutes
|
||||
//const U64 GROUP_USEC_CONVERSION_TIMEOUT = U64L(600000000);
|
||||
|
||||
// default sale timeout is 2 days -> 172800000000
|
||||
const U64 DEFAULT_USEC_SALE_TIMEOUT = U64L(172800000000);
|
||||
constexpr U64 DEFAULT_USEC_SALE_TIMEOUT = U64L(172800000000);
|
||||
// ***** TESTING is 10 minutes
|
||||
//const U64 DEFAULT_USEC_SALE_TIMEOUT = U64L(600000000);
|
||||
|
||||
// more grace period extensions.
|
||||
const U64 SEVEN_DAYS_IN_USEC = U64L(604800000000);
|
||||
constexpr U64 SEVEN_DAYS_IN_USEC = U64L(604800000000);
|
||||
|
||||
// if more than 100,000s before sale revert, and no extra extension
|
||||
// has been given, go ahead and extend it more. That's about 1.2 days.
|
||||
const S32 EXTEND_GRACE_IF_MORE_THAN_SEC = 100000;
|
||||
constexpr S32 EXTEND_GRACE_IF_MORE_THAN_SEC = 100000;
|
||||
|
||||
|
||||
|
||||
@@ -250,9 +250,9 @@ public:
|
||||
void setMediaURL(const std::string& url);
|
||||
void setMediaType(const std::string& type);
|
||||
void setMediaDesc(const std::string& desc);
|
||||
void setMediaID(const LLUUID& id) { mMediaID = id; }
|
||||
void setMediaAutoScale ( U8 flagIn ) { mMediaAutoScale = flagIn; }
|
||||
void setMediaLoop (U8 loop) { mMediaLoop = loop; }
|
||||
void setMediaID(const LLUUID& id) { mMediaID = id; }
|
||||
void setMediaAutoScale ( U8 flagIn ) { mMediaAutoScale = flagIn; }
|
||||
void setMediaLoop(U8 loop) { mMediaLoop = loop; }
|
||||
void setMediaWidth(S32 width);
|
||||
void setMediaHeight(S32 height);
|
||||
void setMediaCurrentURL(const std::string& url);
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "math.h"
|
||||
//#include "vmath.h"
|
||||
#include "v3math.h"
|
||||
#include "llquaternion.h"
|
||||
#include "m3math.h"
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "llmath.h"
|
||||
//#include "vmath.h"
|
||||
#include "v3math.h"
|
||||
#include "patch_dct.h"
|
||||
#include "patch_code.h"
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "llmath.h"
|
||||
//#include "vmath.h"
|
||||
#include "v3math.h"
|
||||
#include "patch_dct.h"
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "llmath.h"
|
||||
//#include "vmath.h"
|
||||
#include "v3math.h"
|
||||
#include "patch_dct.h"
|
||||
|
||||
|
||||
@@ -1988,16 +1988,6 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(bool *hit_limit)
|
||||
isConstrained = true;
|
||||
}
|
||||
}
|
||||
|
||||
// JC - Could constrain camera based on parcel stuff here.
|
||||
// LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(camera_position_global);
|
||||
//
|
||||
// if (regionp && !regionp->mParcelOverlay->isBuildCameraAllowed(regionp->getPosRegionFromGlobal(camera_position_global)))
|
||||
// {
|
||||
// camera_position_global = last_position_global;
|
||||
//
|
||||
// isConstrained = true;
|
||||
// }
|
||||
}
|
||||
|
||||
// Don't let camera go underground
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#define LL_LLSKY_H
|
||||
|
||||
#include "llmath.h"
|
||||
//#include "vmath.h"
|
||||
#include "v3math.h"
|
||||
#include "v4math.h"
|
||||
#include "v4color.h"
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
#ifndef LL_LLSPRITE_H
|
||||
#define LL_LLSPRITE_H
|
||||
|
||||
////#include "vmath.h"
|
||||
//#include "llmath.h"
|
||||
#include "v3math.h"
|
||||
#include "v4math.h"
|
||||
#include "v4color.h"
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#ifndef LL_LLSURFACE_H
|
||||
#define LL_LLSURFACE_H
|
||||
|
||||
//#include "vmath.h"
|
||||
#include "v3math.h"
|
||||
#include "v3dmath.h"
|
||||
#include "v4math.h"
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "llfloaterreg.h"
|
||||
#include "llgl.h"
|
||||
#include "llrender.h"
|
||||
#include "lluicolor.h"
|
||||
#include "v4color.h"
|
||||
#include "v2math.h"
|
||||
|
||||
@@ -50,8 +51,8 @@
|
||||
#include "pipeline.h"
|
||||
|
||||
|
||||
static const U8 OVERLAY_IMG_COMPONENTS = 4;
|
||||
static const F32 LINE_WIDTH = 0.0625f;
|
||||
static constexpr U8 OVERLAY_IMG_COMPONENTS = 4;
|
||||
static constexpr F32 LINE_WIDTH = 0.0625f;
|
||||
|
||||
bool LLViewerParcelOverlay::sColorSetInitialized = false;
|
||||
LLUIColor LLViewerParcelOverlay::sAvailColor;
|
||||
@@ -91,7 +92,7 @@ LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_
|
||||
// Initialize the GL texture with empty data.
|
||||
//
|
||||
// Create the base texture.
|
||||
U8 *raw = mImageRaw->getData();
|
||||
U8* raw = mImageRaw->getData();
|
||||
const S32 COUNT = mParcelGridsPerEdge * mParcelGridsPerEdge * OVERLAY_IMG_COMPONENTS;
|
||||
for (S32 i = 0; i < COUNT; i++)
|
||||
{
|
||||
@@ -158,10 +159,10 @@ bool LLViewerParcelOverlay::encroachesOwned(const std::vector<LLBBox>& boxes) co
|
||||
LLVector3 min = boxes[i].getMinAgent();
|
||||
LLVector3 max = boxes[i].getMaxAgent();
|
||||
|
||||
S32 left = S32(llclamp((min.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
|
||||
S32 right = S32(llclamp((max.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
|
||||
S32 top = S32(llclamp((min.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
|
||||
S32 bottom = S32(llclamp((max.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
|
||||
S32 left = S32(llclamp((min.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
|
||||
S32 right = S32(llclamp((max.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
|
||||
S32 top = S32(llclamp((min.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
|
||||
S32 bottom = S32(llclamp((max.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
|
||||
|
||||
for (S32 row = top; row <= bottom; row++)
|
||||
{
|
||||
@@ -186,10 +187,10 @@ bool LLViewerParcelOverlay::encroachesOnUnowned(const std::vector<LLBBox>& boxes
|
||||
LLVector3 min = boxes[i].getMinAgent();
|
||||
LLVector3 max = boxes[i].getMaxAgent();
|
||||
|
||||
S32 left = S32(llclamp((min.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
|
||||
S32 right = S32(llclamp((max.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
|
||||
S32 top = S32(llclamp((min.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
|
||||
S32 bottom = S32(llclamp((max.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
|
||||
S32 left = S32(llclamp((min.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
|
||||
S32 right = S32(llclamp((max.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
|
||||
S32 top = S32(llclamp((min.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
|
||||
S32 bottom = S32(llclamp((max.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
|
||||
|
||||
for (S32 row = top; row <= bottom; row++)
|
||||
{
|
||||
@@ -223,10 +224,10 @@ bool LLViewerParcelOverlay::encroachesOnNearbyParcel(const std::vector<LLBBox>&
|
||||
return true;
|
||||
}
|
||||
|
||||
S32 left = S32(llclamp((min.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
|
||||
S32 right = S32(llclamp((max.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
|
||||
S32 bottom = S32(llclamp((min.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
|
||||
S32 top = S32(llclamp((max.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
|
||||
S32 left = S32(llclamp((min.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
|
||||
S32 right = S32(llclamp((max.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
|
||||
S32 bottom = S32(llclamp((min.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
|
||||
S32 top = S32(llclamp((max.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
|
||||
|
||||
const S32 GRIDS_PER_EDGE = mParcelGridsPerEdge;
|
||||
|
||||
@@ -348,11 +349,11 @@ void LLViewerParcelOverlay::updateOverlayTexture()
|
||||
const LLColor4U auction = sAuctionColor.get();
|
||||
|
||||
// Create the base texture.
|
||||
U8 *raw = mImageRaw->getData();
|
||||
U8* raw = mImageRaw->getData();
|
||||
const S32 COUNT = mParcelGridsPerEdge * mParcelGridsPerEdge;
|
||||
S32 max = mOverlayTextureIdx + mParcelGridsPerEdge;
|
||||
if (max > COUNT) max = COUNT;
|
||||
S32 pixel_index = mOverlayTextureIdx*OVERLAY_IMG_COMPONENTS;
|
||||
S32 pixel_index = mOverlayTextureIdx * OVERLAY_IMG_COMPONENTS;
|
||||
S32 i;
|
||||
for (i = mOverlayTextureIdx; i < max; i++)
|
||||
{
|
||||
@@ -361,7 +362,7 @@ void LLViewerParcelOverlay::updateOverlayTexture()
|
||||
U8 r,g,b,a;
|
||||
|
||||
// Color stored in low three bits
|
||||
switch( ownership & 0x7 )
|
||||
switch (ownership & 0x7)
|
||||
{
|
||||
case PARCEL_PUBLIC:
|
||||
r = avail.mV[VRED];
|
||||
@@ -407,10 +408,10 @@ void LLViewerParcelOverlay::updateOverlayTexture()
|
||||
break;
|
||||
}
|
||||
|
||||
raw[pixel_index + 0] = (U8)r;
|
||||
raw[pixel_index + 1] = (U8)g;
|
||||
raw[pixel_index + 2] = (U8)b;
|
||||
raw[pixel_index + 3] = (U8)a;
|
||||
raw[pixel_index + VRED] = (U8)r;
|
||||
raw[pixel_index + VGREEN] = (U8)g;
|
||||
raw[pixel_index + VBLUE] = (U8)b;
|
||||
raw[pixel_index + VALPHA] = (U8)a;
|
||||
|
||||
pixel_index += OVERLAY_IMG_COMPONENTS;
|
||||
}
|
||||
@@ -431,11 +432,10 @@ void LLViewerParcelOverlay::updateOverlayTexture()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LLViewerParcelOverlay::uncompressLandOverlay(S32 chunk, U8 *packed_overlay)
|
||||
void LLViewerParcelOverlay::uncompressLandOverlay(S32 chunk, U8* packed_overlay)
|
||||
{
|
||||
// Unpack the message data into the ownership array
|
||||
S32 size = mParcelGridsPerEdge * mParcelGridsPerEdge;
|
||||
S32 size = mParcelGridsPerEdge * mParcelGridsPerEdge;
|
||||
S32 chunk_size = size / PARCEL_OVERLAY_CHUNKS;
|
||||
|
||||
memcpy(mOwnership + chunk*chunk_size, packed_overlay, chunk_size); /*Flawfinder: ignore*/
|
||||
@@ -460,7 +460,7 @@ void LLViewerParcelOverlay::updatePropertyLines()
|
||||
|
||||
mEdges.clear();
|
||||
|
||||
const F32 GRID_STEP = PARCEL_GRID_STEP_METERS;
|
||||
constexpr F32 GRID_STEP = PARCEL_GRID_STEP_METERS;
|
||||
const S32 GRIDS_PER_EDGE = mParcelGridsPerEdge;
|
||||
|
||||
for (S32 row = 0; row < GRIDS_PER_EDGE; row++)
|
||||
@@ -537,16 +537,16 @@ void LLViewerParcelOverlay::addPropertyLine(F32 start_x, F32 start_y, F32 dx, F3
|
||||
|
||||
auto split = [&](const LLVector3& start, F32 x, F32 y, F32 z, F32 part)
|
||||
{
|
||||
F32 new_x = start.mV[0] + (x - start.mV[0]) * part;
|
||||
F32 new_y = start.mV[1] + (y - start.mV[1]) * part;
|
||||
F32 new_z = start.mV[2] + (z - start.mV[2]) * part;
|
||||
F32 new_x = start.mV[VX] + (x - start.mV[VX]) * part;
|
||||
F32 new_y = start.mV[VY] + (y - start.mV[VY]) * part;
|
||||
F32 new_z = start.mV[VZ] + (z - start.mV[VZ]) * part;
|
||||
edge.vertices.emplace_back(new_x, new_y, new_z);
|
||||
};
|
||||
|
||||
auto checkForSplit = [&]()
|
||||
{
|
||||
const LLVector3& last_outside = edge.vertices.back();
|
||||
F32 z0 = last_outside.mV[2];
|
||||
F32 z0 = last_outside.mV[VZ];
|
||||
F32 z1 = outside_z;
|
||||
if ((z0 >= water_z && z1 >= water_z) || (z0 < water_z && z1 < water_z))
|
||||
return;
|
||||
@@ -581,7 +581,7 @@ void LLViewerParcelOverlay::addPropertyLine(F32 start_x, F32 start_y, F32 dx, F3
|
||||
outside_y += dy * (dy - LINE_WIDTH);
|
||||
|
||||
// Middle part, full width
|
||||
const S32 GRID_STEP = (S32)PARCEL_GRID_STEP_METERS;
|
||||
constexpr S32 GRID_STEP = (S32)PARCEL_GRID_STEP_METERS;
|
||||
for (S32 i = 1; i < GRID_STEP; i++)
|
||||
{
|
||||
inside_z = land.resolveHeightRegion( inside_x, inside_y );
|
||||
@@ -711,7 +711,7 @@ void LLViewerParcelOverlay::renderPropertyLines()
|
||||
|
||||
bool render_hidden = LLSelectMgr::sRenderHiddenSelections && LLFloaterReg::instanceVisible("build");
|
||||
|
||||
const F32 PROPERTY_LINE_CLIP_DIST_SQUARED = 256.f * 256.f;
|
||||
constexpr F32 PROPERTY_LINE_CLIP_DIST_SQUARED = 256.f * 256.f;
|
||||
|
||||
for (const Edge& edge : mEdges)
|
||||
{
|
||||
@@ -744,7 +744,7 @@ void LLViewerParcelOverlay::renderPropertyLines()
|
||||
else
|
||||
{
|
||||
LLVector3 visible = vertex;
|
||||
visible.mV[2] = water_z;
|
||||
visible.mV[VZ] = water_z;
|
||||
gGL.vertex3fv(visible.mV);
|
||||
}
|
||||
}
|
||||
@@ -758,7 +758,7 @@ void LLViewerParcelOverlay::renderPropertyLines()
|
||||
gGL.begin(LLRender::TRIANGLE_STRIP);
|
||||
|
||||
LLColor4U color = edge.color;
|
||||
color.mV[3] /= 4;
|
||||
color.mV[VALPHA] /= 4;
|
||||
gGL.color4ubv(color.mV);
|
||||
|
||||
for (const LLVector3& vertex : edge.vertices)
|
||||
@@ -792,7 +792,7 @@ void grid_2d_part_lines(const F32 left, const F32 top, const F32 right, const F3
|
||||
gGL.end();
|
||||
}
|
||||
|
||||
void LLViewerParcelOverlay::renderPropertyLinesOnMinimap(F32 scale_pixels_per_meter, const F32 *parcel_outline_color)
|
||||
void LLViewerParcelOverlay::renderPropertyLinesOnMinimap(F32 scale_pixels_per_meter, const F32* parcel_outline_color)
|
||||
{
|
||||
static LLCachedControl<bool> show(gSavedSettings, "MiniMapShowPropertyLines");
|
||||
|
||||
@@ -803,8 +803,8 @@ void LLViewerParcelOverlay::renderPropertyLinesOnMinimap(F32 scale_pixels_per_me
|
||||
|
||||
LLVector3 origin_agent = mRegion->getOriginAgent();
|
||||
LLVector3 rel_region_pos = origin_agent - gAgentCamera.getCameraPositionAgent();
|
||||
F32 region_left = rel_region_pos.mV[0] * scale_pixels_per_meter;
|
||||
F32 region_bottom = rel_region_pos.mV[1] * scale_pixels_per_meter;
|
||||
F32 region_left = rel_region_pos.mV[VX] * scale_pixels_per_meter;
|
||||
F32 region_bottom = rel_region_pos.mV[VY] * scale_pixels_per_meter;
|
||||
F32 map_parcel_width = PARCEL_GRID_STEP_METERS * scale_pixels_per_meter;
|
||||
const S32 GRIDS_PER_EDGE = mParcelGridsPerEdge;
|
||||
|
||||
|
||||
@@ -34,12 +34,11 @@
|
||||
#include "llframetimer.h"
|
||||
#include "lluuid.h"
|
||||
#include "llviewertexture.h"
|
||||
#include "llgl.h"
|
||||
#include "lluicolor.h"
|
||||
|
||||
class LLViewerRegion;
|
||||
class LLVector3;
|
||||
class LLColor4U;
|
||||
class LLUIColor;
|
||||
class LLVector2;
|
||||
|
||||
class LLViewerParcelOverlay : public LLGLUpdate
|
||||
@@ -65,19 +64,18 @@ public:
|
||||
|
||||
bool isSoundLocal(const LLVector3& pos) const;
|
||||
|
||||
bool isBuildCameraAllowed(const LLVector3& pos) const;
|
||||
F32 getOwnedRatio() const;
|
||||
|
||||
// Returns the number of vertices drawn
|
||||
void renderPropertyLines();
|
||||
void renderPropertyLinesOnMinimap(F32 scale_pixels_per_meter, const F32* parcel_outline_color);
|
||||
|
||||
U8 ownership( const LLVector3& pos) const;
|
||||
U8 parcelLineFlags( const LLVector3& pos) const;
|
||||
U8 ownership(const LLVector3& pos) const;
|
||||
U8 parcelLineFlags(const LLVector3& pos) const;
|
||||
U8 parcelLineFlags(S32 row, S32 col) const;
|
||||
|
||||
// MANIPULATE
|
||||
void uncompressLandOverlay(S32 chunk, U8 *compressed_overlay);
|
||||
void uncompressLandOverlay(S32 chunk, U8* compressed_overlay);
|
||||
|
||||
// Indicate property lines and overlay texture need to be rebuilt.
|
||||
void setDirty();
|
||||
@@ -88,8 +86,7 @@ public:
|
||||
private:
|
||||
// This is in parcel rows and columns, not grid rows and columns
|
||||
// Stored in bottom three bits.
|
||||
U8 ownership(S32 row, S32 col) const
|
||||
{ return parcelFlags(row, col, (U8)0x7); }
|
||||
U8 ownership(S32 row, S32 col) const { return parcelFlags(row, col, (U8)0x7); }
|
||||
|
||||
U8 parcelFlags(S32 row, S32 col, U8 flags) const;
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#include "llregionhandle.h"
|
||||
#include "llsurface.h"
|
||||
#include "message.h"
|
||||
//#include "vmath.h"
|
||||
#include "v3math.h"
|
||||
#include "v4math.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user