summaryrefslogtreecommitdiff
path: root/indra/newview/llspatialpartition.cpp
diff options
context:
space:
mode:
authorAnsariel <ansariel.hiller@phoenixviewer.com>2024-02-21 21:05:14 +0100
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-02-21 23:14:31 +0200
commit60d3dd98a44230c21803c1606552ee098ed9fa7c (patch)
treeaf0aa11c458ca86f786560e0875f7e018e1a16b9 /indra/newview/llspatialpartition.cpp
parent855eea7ddf9e1de9226036ca94ccb03ac0e311b9 (diff)
Convert remaining BOOL to bool
Diffstat (limited to 'indra/newview/llspatialpartition.cpp')
-rw-r--r--indra/newview/llspatialpartition.cpp120
1 files changed, 60 insertions, 60 deletions
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 931880a475..4d6c57391c 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -69,7 +69,7 @@ static F32 sCurMaxTexPriority = 1.f;
//static counter for frame to switch LOD on
-void sg_assert(BOOL expr)
+void sg_assert(bool expr)
{
#if LL_OCTREE_PARANOIA_CHECK
if (!expr)
@@ -135,7 +135,7 @@ void LLSpatialGroup::clearDrawMap()
mDrawMap.clear();
}
-BOOL LLSpatialGroup::isHUDGroup()
+bool LLSpatialGroup::isHUDGroup()
{
return getSpatialPartition() && getSpatialPartition()->isHUDPartition() ;
}
@@ -217,7 +217,7 @@ void LLSpatialGroup::validateDrawMap()
#endif
}
-BOOL LLSpatialGroup::updateInGroup(LLDrawable *drawablep, BOOL immediate)
+bool LLSpatialGroup::updateInGroup(LLDrawable *drawablep, bool immediate)
{
LL_PROFILE_ZONE_SCOPED;
drawablep->updateSpatialExtents();
@@ -232,10 +232,10 @@ BOOL LLSpatialGroup::updateInGroup(LLDrawable *drawablep, BOOL immediate)
unbound();
setState(OBJECT_DIRTY);
//setState(GEOM_DIRTY);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void LLSpatialGroup::expandExtents(const LLVector4a* addingExtents, const LLXformMatrix& currentTransform)
@@ -292,11 +292,11 @@ void LLSpatialGroup::expandExtents(const LLVector4a* addingExtents, const LLXfor
mBounds[1].mul(0.5f);
}
-BOOL LLSpatialGroup::addObject(LLDrawable *drawablep)
+bool LLSpatialGroup::addObject(LLDrawable *drawablep)
{
if(!drawablep)
{
- return FALSE;
+ return false;
}
{
drawablep->setGroup(this);
@@ -313,7 +313,7 @@ BOOL LLSpatialGroup::addObject(LLDrawable *drawablep)
}
}
- return TRUE;
+ return true;
}
void LLSpatialGroup::rebuildGeom()
@@ -406,13 +406,13 @@ LLSpatialGroup* LLSpatialGroup::getParent()
return (LLSpatialGroup*)LLViewerOctreeGroup::getParent();
}
-BOOL LLSpatialGroup::removeObject(LLDrawable *drawablep, BOOL from_octree)
+bool LLSpatialGroup::removeObject(LLDrawable *drawablep, bool from_octree)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL
if(!drawablep)
{
- return FALSE;
+ return false;
}
unbound();
@@ -443,7 +443,7 @@ BOOL LLSpatialGroup::removeObject(LLDrawable *drawablep, BOOL from_octree)
clearDrawMap();
}
}
- return TRUE;
+ return true;
}
void LLSpatialGroup::shift(const LLVector4a &offset)
@@ -726,14 +726,14 @@ F32 LLSpatialGroup::getUpdateUrgency() const
}
}
-BOOL LLSpatialGroup::changeLOD()
+bool LLSpatialGroup::changeLOD()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL
if (hasState(ALPHA_DIRTY | OBJECT_DIRTY))
{
//a rebuild is going to happen, update distance and LoD
- return TRUE;
+ return true;
}
if (getSpatialPartition()->mSlopRatio > 0.f)
@@ -762,16 +762,16 @@ BOOL LLSpatialGroup::changeLOD()
<< " fab ratio " << fabsf(ratio)
<< " slop " << getSpatialPartition()->mSlopRatio << LL_ENDL;
- return TRUE;
+ return true;
}
}
if (needsUpdate())
{
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void LLSpatialGroup::handleInsertion(const TreeNode* node, LLViewerOctreeEntry* entry)
@@ -783,7 +783,7 @@ void LLSpatialGroup::handleInsertion(const TreeNode* node, LLViewerOctreeEntry*
void LLSpatialGroup::handleRemoval(const TreeNode* node, LLViewerOctreeEntry* entry)
{
- removeObject((LLDrawable*)entry->getDrawable(), TRUE);
+ removeObject((LLDrawable*)entry->getDrawable(), true);
LLViewerOctreeGroup::handleRemoval(node, entry);
}
@@ -911,15 +911,15 @@ void LLSpatialGroup::destroyGLState(bool keep_occlusion)
//==============================================
-LLSpatialPartition::LLSpatialPartition(U32 data_mask, BOOL render_by_group, LLViewerRegion* regionp)
+LLSpatialPartition::LLSpatialPartition(U32 data_mask, bool render_by_group, LLViewerRegion* regionp)
: mRenderByGroup(render_by_group), mBridge(NULL)
{
mRegionp = regionp;
mPartitionType = LLViewerRegion::PARTITION_NONE;
mVertexDataMask = data_mask;
- mDepthMask = FALSE;
+ mDepthMask = false;
mSlopRatio = 0.25f;
- mInfiniteFarClip = FALSE;
+ mInfiniteFarClip = false;
new LLSpatialGroup(mOctree, this);
}
@@ -930,7 +930,7 @@ LLSpatialPartition::~LLSpatialPartition()
cleanup();
}
-LLSpatialGroup *LLSpatialPartition::put(LLDrawable *drawablep, BOOL was_visible)
+LLSpatialGroup *LLSpatialPartition::put(LLDrawable *drawablep, bool was_visible)
{
LL_PROFILE_ZONE_SCOPED;
drawablep->updateSpatialExtents();
@@ -956,7 +956,7 @@ LLSpatialGroup *LLSpatialPartition::put(LLDrawable *drawablep, BOOL was_visible)
return group;
}
-BOOL LLSpatialPartition::remove(LLDrawable *drawablep, LLSpatialGroup *curp)
+bool LLSpatialPartition::remove(LLDrawable *drawablep, LLSpatialGroup *curp)
{
LL_PROFILE_ZONE_SCOPED;
if (!curp->removeObject(drawablep))
@@ -970,10 +970,10 @@ BOOL LLSpatialPartition::remove(LLDrawable *drawablep, LLSpatialGroup *curp)
assert_octree_valid(mOctree);
- return TRUE;
+ return true;
}
-void LLSpatialPartition::move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL immediate)
+void LLSpatialPartition::move(LLDrawable *drawablep, LLSpatialGroup *curp, bool immediate)
{
LL_PROFILE_ZONE_SCOPED;
// sanity check submitted by open source user bushing Spatula
@@ -984,7 +984,7 @@ void LLSpatialPartition::move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL
return;
}
- BOOL was_visible = curp ? curp->isVisible() : FALSE;
+ bool was_visible = curp ? curp->isVisible() : false;
if (curp && curp->getSpatialPartition() != this)
{
@@ -1133,7 +1133,7 @@ class LLOctreeCullVisExtents: public LLOctreeCullShadow
{
public:
LLOctreeCullVisExtents(LLCamera* camera, LLVector4a& min, LLVector4a& max)
- : LLOctreeCullShadow(camera), mMin(min), mMax(max), mEmpty(TRUE) { }
+ : LLOctreeCullShadow(camera), mMin(min), mMax(max), mEmpty(true) { }
virtual bool earlyFail(LLViewerOctreeGroup* base_group)
{
@@ -1186,7 +1186,7 @@ public:
{
if (AABBInFrustumObjectBounds(group) > 0)
{
- mEmpty = FALSE;
+ mEmpty = false;
const LLVector4a* exts = group->getObjectExtents();
update_min_max(mMin, mMax, exts[0]);
update_min_max(mMin, mMax, exts[1]);
@@ -1194,14 +1194,14 @@ public:
}
else
{
- mEmpty = FALSE;
+ mEmpty = false;
const LLVector4a* exts = group->getExtents();
update_min_max(mMin, mMax, exts[0]);
update_min_max(mMin, mMax, exts[1]);
}
}
- BOOL mEmpty;
+ bool mEmpty;
LLVector4a& mMin;
LLVector4a& mMax;
};
@@ -1210,7 +1210,7 @@ class LLOctreeCullDetectVisible: public LLOctreeCullShadow
{
public:
LLOctreeCullDetectVisible(LLCamera* camera)
- : LLOctreeCullShadow(camera), mResult(FALSE) { }
+ : LLOctreeCullShadow(camera), mResult(false) { }
virtual bool earlyFail(LLViewerOctreeGroup* base_group)
{
@@ -1231,11 +1231,11 @@ public:
{
if (base_group->isVisible())
{
- mResult = TRUE;
+ mResult = true;
}
}
- BOOL mResult;
+ bool mResult;
};
class LLOctreeSelect : public LLOctreeCull
@@ -1263,7 +1263,7 @@ public:
{
if (drawable->isSpatialBridge())
{
- drawable->setVisible(*mCamera, mResults, TRUE);
+ drawable->setVisible(*mCamera, mResults, true);
}
else
{
@@ -1388,7 +1388,7 @@ void LLSpatialPartition::restoreGL()
{
}
-BOOL LLSpatialPartition::getVisibleExtents(LLCamera& camera, LLVector3& visMin, LLVector3& visMax)
+bool LLSpatialPartition::getVisibleExtents(LLCamera& camera, LLVector3& visMin, LLVector3& visMax)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL;
LLVector4a visMina, visMaxa;
@@ -1408,14 +1408,14 @@ BOOL LLSpatialPartition::getVisibleExtents(LLCamera& camera, LLVector3& visMin,
return vis.mEmpty;
}
-BOOL LLSpatialPartition::visibleObjectsInFrustum(LLCamera& camera)
+bool LLSpatialPartition::visibleObjectsInFrustum(LLCamera& camera)
{
LLOctreeCullDetectVisible vis(&camera);
vis.traverse(mOctree);
return vis.mResult;
}
-S32 LLSpatialPartition::cull(LLCamera &camera, std::vector<LLDrawable *>* results, BOOL for_select)
+S32 LLSpatialPartition::cull(LLCamera &camera, std::vector<LLDrawable *>* results, bool for_select)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL;
#if LL_OCTREE_PARANOIA_CHECK
@@ -1436,7 +1436,7 @@ S32 LLSpatialPartition::cull(LLCamera &camera, std::vector<LLDrawable *>* result
return 0;
}
-extern BOOL gCubeSnapshot;
+extern bool gCubeSnapshot;
S32 LLSpatialPartition::cull(LLCamera &camera, bool do_occlusion)
{
@@ -1663,7 +1663,7 @@ void renderOctree(LLSpatialGroup* group)
col.setVec(0.1f,0.1f,1,0.1f);
{
- LLGLDepthTest gl_depth(FALSE, FALSE);
+ LLGLDepthTest gl_depth(false, false);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
gGL.diffuseColor4f(1,0,0,group->mBuilt);
@@ -1793,7 +1793,7 @@ std::set<LLSpatialGroup*> visible_selected_groups;
void renderXRay(LLSpatialGroup* group, LLCamera* camera)
{
- BOOL render_objects = (!LLPipeline::sUseOcclusion || !group->isOcclusionState(LLSpatialGroup::OCCLUDED)) && group->isVisible() &&
+ bool render_objects = (!LLPipeline::sUseOcclusion || !group->isOcclusionState(LLSpatialGroup::OCCLUDED)) && group->isVisible() &&
!group->isEmpty();
if (render_objects)
@@ -1885,7 +1885,7 @@ void renderUpdateType(LLDrawable* drawablep)
}
}
-void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE)
+void renderBoundingBox(LLDrawable* drawable, bool set_color = true)
{
if (set_color)
{
@@ -2692,7 +2692,7 @@ void renderTexelDensity(LLDrawable* drawable)
checkerboard_matrix.initScale(LLVector3(texturep->getWidth(discard_level) / 8, texturep->getHeight(discard_level) / 8, 1.f));
- gGL.getTexUnit(0)->bind(LLViewerTexture::sCheckerBoardImagep, TRUE);
+ gGL.getTexUnit(0)->bind(LLViewerTexture::sCheckerBoardImagep, true);
gGL.matrixMode(LLRender::MM_TEXTURE);
gGL.loadMatrix((GLfloat*)&checkerboard_matrix.mMatrix);
@@ -2745,7 +2745,7 @@ void renderTexelDensity(LLDrawable* drawable)
// //gGL.matrixMode(LLRender::MM_TEXTURE);
// glLoadMatrixf((GLfloat*) checkboard_matrix.mMatrix);
- // gGL.getTexUnit(i)->bind(LLViewerTexture::sCheckerBoardImagep, TRUE);
+ // gGL.getTexUnit(i)->bind(LLViewerTexture::sCheckerBoardImagep, true);
// pushVerts(params, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_NORMAL );
@@ -3384,7 +3384,7 @@ public:
{
continue;
}
- renderBoundingBox(drawable, FALSE);
+ renderBoundingBox(drawable, false);
}
}
};
@@ -3573,14 +3573,14 @@ bool LLSpatialPartition::isHUDPartition()
return mPartitionType == LLViewerRegion::PARTITION_HUD ;
}
-BOOL LLSpatialPartition::isVisible(const LLVector3& v)
+bool LLSpatialPartition::isVisible(const LLVector3& v)
{
if (!LLViewerCamera::getInstance()->sphereInFrustum(v, 4.0f))
{
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
LL_ALIGN_PREFIX(16)
@@ -3596,12 +3596,12 @@ public:
LLVector4a *mNormal;
LLVector4a *mTangent;
LLDrawable* mHit;
- BOOL mPickTransparent;
- BOOL mPickRigged;
- BOOL mPickUnselectable;
- BOOL mPickReflectionProbe;
+ bool mPickTransparent;
+ bool mPickRigged;
+ bool mPickUnselectable;
+ bool mPickReflectionProbe;
- LLOctreeIntersect(const LLVector4a& start, const LLVector4a& end, BOOL pick_transparent, BOOL pick_rigged, BOOL pick_unselectable, BOOL pick_reflection_probe,
+ LLOctreeIntersect(const LLVector4a& start, const LLVector4a& end, bool pick_transparent, bool pick_rigged, bool pick_unselectable, bool pick_reflection_probe,
S32* face_hit, LLVector4a* intersection, LLVector2* tex_coord, LLVector4a* normal, LLVector4a* tangent)
: mStart(start),
mEnd(end),
@@ -3722,7 +3722,7 @@ public:
}
if (!skip_check && vobj->lineSegmentIntersect(mStart, mEnd, -1,
- (mPickReflectionProbe && vobj->isReflectionProbe()) ? TRUE : mPickTransparent, // always pick transparent when picking selection probe
+ (mPickReflectionProbe && vobj->isReflectionProbe()) ? true : mPickTransparent, // always pick transparent when picking selection probe
mPickRigged, mPickUnselectable, mFaceHit, &intersection, mTexCoord, mNormal, mTangent))
{
mEnd = intersection; // shorten ray so we only find CLOSER hits
@@ -3741,10 +3741,10 @@ public:
} LL_ALIGN_POSTFIX(16);
LLDrawable* LLSpatialPartition::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end,
- BOOL pick_transparent,
- BOOL pick_rigged,
- BOOL pick_unselectable,
- BOOL pick_reflection_probe,
+ bool pick_transparent,
+ bool pick_rigged,
+ bool pick_unselectable,
+ bool pick_reflection_probe,
S32* face_hit, // return the face hit
LLVector4a* intersection, // return the intersection point
LLVector2* tex_coord, // return the texture coordinates of the intersection point
@@ -3760,10 +3760,10 @@ LLDrawable* LLSpatialPartition::lineSegmentIntersect(const LLVector4a& start, co
}
LLDrawable* LLSpatialGroup::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end,
- BOOL pick_transparent,
- BOOL pick_rigged,
- BOOL pick_unselectable,
- BOOL pick_reflection_probe,
+ bool pick_transparent,
+ bool pick_rigged,
+ bool pick_unselectable,
+ bool pick_reflection_probe,
S32* face_hit, // return the face hit
LLVector4a* intersection, // return the intersection point
LLVector2* tex_coord, // return the texture coordinates of the intersection point