diff options
Diffstat (limited to 'indra/newview/lldrawable.cpp')
-rw-r--r-- | indra/newview/lldrawable.cpp | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 12a7a22e24..26fdf51485 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -232,7 +232,7 @@ const LLMatrix4& LLDrawable::getRenderMatrix() const return isRoot() ? getWorldMatrix() : getParent()->getWorldMatrix(); } -BOOL LLDrawable::isLight() const +bool LLDrawable::isLight() const { LLViewerObject* objectp = mVObjp; if ( objectp && (objectp->getPCode() == LL_PCODE_VOLUME) && !isDead()) @@ -241,7 +241,7 @@ BOOL LLDrawable::isLight() const } else { - return FALSE; + return false; } } @@ -339,7 +339,7 @@ LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep) face = new LLFace(this, mVObjp); - face->setTEOffset(mFaces.size()); + face->setTEOffset(static_cast<S32>(mFaces.size())); face->setTexture(texturep); face->setPoolType(gPipeline.getPoolTypeFromTE(te, texturep)); @@ -361,7 +361,7 @@ LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep, LLFace *face; face = new LLFace(this, mVObjp); - face->setTEOffset(mFaces.size()); + face->setTEOffset(static_cast<S32>(mFaces.size())); face->setTexture(texturep); face->setNormalMap(normalp); face->setPoolType(gPipeline.getPoolTypeFromTE(te, texturep)); @@ -384,7 +384,7 @@ LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep, LLFace *face; face = new LLFace(this, mVObjp); - face->setTEOffset(mFaces.size()); + face->setTEOffset(static_cast<S32>(mFaces.size())); face->setTexture(texturep); face->setNormalMap(normalp); face->setSpecularMap(specularp); @@ -417,7 +417,7 @@ void LLDrawable::setNumFaces(const S32 newFaces, LLFacePool *poolp, LLViewerText else // (newFaces > mFaces.size()) { mFaces.reserve(newFaces); - for (int i = mFaces.size(); i<newFaces; i++) + for (auto i = mFaces.size(); i<newFaces; i++) { addFace(poolp, texturep); } @@ -442,7 +442,7 @@ void LLDrawable::setNumFacesFast(const S32 newFaces, LLFacePool *poolp, LLViewer else // (newFaces > mFaces.size()) { mFaces.reserve(newFaces); - for (int i = mFaces.size(); i<newFaces; i++) + for (auto i = mFaces.size(); i<newFaces; i++) { addFace(poolp, texturep); } @@ -455,10 +455,10 @@ void LLDrawable::mergeFaces(LLDrawable* src) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE - U32 face_count = mFaces.size() + src->mFaces.size(); + auto face_count = mFaces.size() + src->mFaces.size(); mFaces.reserve(face_count); - for (U32 i = 0; i < src->mFaces.size(); i++) + for (size_t i = 0; i < src->mFaces.size(); i++) { LLFace* facep = src->mFaces[i]; facep->setDrawable(this); @@ -550,7 +550,7 @@ void LLDrawable::makeActive() } -void LLDrawable::makeStatic(BOOL warning_enabled) +void LLDrawable::makeStatic(bool warning_enabled) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE @@ -598,11 +598,11 @@ void LLDrawable::makeStatic(BOOL warning_enabled) } // Returns "distance" between target destination and resulting xfrom -F32 LLDrawable::updateXform(BOOL undamped) +F32 LLDrawable::updateXform(bool undamped) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE - BOOL damped = !undamped; + bool damped = !undamped; // Position const LLVector3 old_pos(mXform.getPosition()); @@ -721,7 +721,7 @@ F32 LLDrawable::updateXform(BOOL undamped) if (mSpatialBridge) { - gPipeline.markMoved(mSpatialBridge, FALSE); + gPipeline.markMoved(mSpatialBridge, false); } return dist_squared; } @@ -734,7 +734,7 @@ void LLDrawable::setRadius(F32 radius) } } -void LLDrawable::moveUpdatePipeline(BOOL moved) +void LLDrawable::moveUpdatePipeline(bool moved) { if (moved) { @@ -763,17 +763,17 @@ void LLDrawable::movePartition() } } -BOOL LLDrawable::updateMove() +bool LLDrawable::updateMove() { if (isDead()) { LL_WARNS() << "Update move on dead drawable!" << LL_ENDL; - return TRUE; + return true; } if (mVObjp.isNull()) { - return FALSE; + return false; } makeActive(); @@ -781,21 +781,21 @@ BOOL LLDrawable::updateMove() return isState(MOVE_UNDAMPED) ? updateMoveUndamped() : updateMoveDamped(); } -BOOL LLDrawable::updateMoveUndamped() +bool LLDrawable::updateMoveUndamped() { - F32 dist_squared = updateXform(TRUE); + F32 dist_squared = updateXform(true); mGeneration++; if (!isState(LLDrawable::INVISIBLE)) { - BOOL moved = (dist_squared > 0.001f && dist_squared < 255.99f); + bool moved = (dist_squared > 0.001f && dist_squared < 255.99f); moveUpdatePipeline(moved); mVObjp->updateText(); } mVObjp->clearChanged(LLXform::MOVED); - return TRUE; + return true; } void LLDrawable::updatePartition() @@ -808,7 +808,7 @@ void LLDrawable::updatePartition() } else if (mSpatialBridge) { - gPipeline.markMoved(mSpatialBridge, FALSE); + gPipeline.markMoved(mSpatialBridge, false); } else { @@ -817,22 +817,22 @@ void LLDrawable::updatePartition() } } -BOOL LLDrawable::updateMoveDamped() +bool LLDrawable::updateMoveDamped() { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE - F32 dist_squared = updateXform(FALSE); + F32 dist_squared = updateXform(false); mGeneration++; if (!isState(LLDrawable::INVISIBLE)) { - BOOL moved = (dist_squared > 0.001f && dist_squared < 128.0f); + bool moved = (dist_squared > 0.001f && dist_squared < 128.0f); moveUpdatePipeline(moved); mVObjp->updateText(); } - BOOL done_moving = (dist_squared == 0.0f) ? TRUE : FALSE; + bool done_moving = dist_squared == 0.0f; if (done_moving) { @@ -942,12 +942,12 @@ void LLDrawable::updateTexture() } } -BOOL LLDrawable::updateGeometry() +bool LLDrawable::updateGeometry() { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE llassert(mVObjp.notNull()); - BOOL res = mVObjp && mVObjp->updateGeometry(this); + bool res = mVObjp && mVObjp->updateGeometry(this); return res; } @@ -1054,7 +1054,7 @@ void LLDrawable::updateBinRadius() } } -void LLDrawable::updateSpecialHoverCursor(BOOL enabled) +void LLDrawable::updateSpecialHoverCursor(bool enabled) { // TODO: maintain a list of objects that have special // hover cursors, then use that list for per-frame @@ -1244,7 +1244,7 @@ LLSpatialPartition* LLDrawable::getSpatialPartition() // Spatial Partition Bridging Drawable //======================================= -LLSpatialBridge::LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 data_mask, LLViewerRegion* regionp) : +LLSpatialBridge::LLSpatialBridge(LLDrawable* root, bool render_by_group, U32 data_mask, LLViewerRegion* regionp) : LLDrawable(root->getVObj(), true), LLSpatialPartition(data_mask, render_by_group, regionp) { @@ -1409,7 +1409,7 @@ void LLSpatialBridge::transformExtents(const LLVector4a* src, LLVector4a* dst) } -void LLDrawable::setVisible(LLCamera& camera, std::vector<LLDrawable*>* results, BOOL for_select) +void LLDrawable::setVisible(LLCamera& camera, std::vector<LLDrawable*>* results, bool for_select) { LLViewerOctreeEntryData::setVisible(); @@ -1466,7 +1466,7 @@ public: } }; -void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* results, BOOL for_select) +void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* results, bool for_select) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE @@ -1489,8 +1489,8 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* av = objparent->mDrawable; LLSpatialGroup* group = av->getSpatialGroup(); - BOOL impostor = FALSE; - BOOL loaded = FALSE; + bool impostor = false; + bool loaded = false; if (objparent->isAvatar()) { LLVOAvatar* avatarp = (LLVOAvatar*) objparent; @@ -1624,13 +1624,13 @@ void LLSpatialBridge::makeActive() LL_ERRS() << "makeActive called on spatial bridge" << LL_ENDL; } -void LLSpatialBridge::move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL immediate) +void LLSpatialBridge::move(LLDrawable *drawablep, LLSpatialGroup *curp, bool immediate) { LLSpatialPartition::move(drawablep, curp, immediate); - gPipeline.markMoved(this, FALSE); + gPipeline.markMoved(this, false); } -BOOL LLSpatialBridge::updateMove() +bool LLSpatialBridge::updateMove() { llassert_always(mDrawable); llassert_always(mDrawable->mVObjp); @@ -1641,9 +1641,9 @@ BOOL LLSpatialBridge::updateMove() mOctree->balance(); if (part) { - part->move(this, getSpatialGroup(), TRUE); + part->move(this, getSpatialGroup(), true); } - return TRUE; + return true; } void LLSpatialBridge::shiftPos(const LLVector4a& vec) @@ -1703,33 +1703,33 @@ const LLVector3 LLDrawable::getPositionAgent() const } } -BOOL LLDrawable::isAnimating() const +bool LLDrawable::isAnimating() const { if (!getVObj()) { - return TRUE; + return true; } if (getScale() != mVObjp->getScale()) { - return TRUE; + return true; } if (mVObjp->getPCode() == LLViewerObject::LL_VO_PART_GROUP) { - return TRUE; + return true; } if (mVObjp->getPCode() == LLViewerObject::LL_VO_HUD_PART_GROUP) { - return TRUE; + return true; } /*if (!isRoot() && !mVObjp->getAngularVelocity().isExactlyZero()) { //target omega - return TRUE; + return true; }*/ - return FALSE; + return false; } void LLDrawable::updateFaceSize(S32 idx) |