diff options
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r-- | indra/newview/llvovolume.cpp | 481 |
1 files changed, 248 insertions, 233 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e3f2afadc5..2bb543f132 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -94,7 +94,7 @@ const F32 FORCE_SIMPLE_RENDER_AREA = 512.f; const F32 FORCE_CULL_AREA = 8.f; U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG = 1; -BOOL gAnimateTextures = TRUE; +bool gAnimateTextures = true; F32 LLVOVolume::sLODFactor = 1.f; F32 LLVOVolume::sLODSlopDistanceFactor = 0.5f; //Changing this to zero, effectively disables the LOD transition slop @@ -105,7 +105,7 @@ S32 LLVOVolume::mRenderComplexity_current = 0; LLPointer<LLObjectMediaDataClient> LLVOVolume::sObjectMediaClient = NULL; LLPointer<LLObjectMediaNavigateClient> LLVOVolume::sObjectMediaNavigateClient = NULL; -extern BOOL gCubeSnapshot; +extern bool gCubeSnapshot; // Implementation class of LLMediaDataClientObject. See llmediadataclient.h class LLMediaDataClientObjectImpl : public LLMediaDataClientObject @@ -216,18 +216,18 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re mRelativeXform.setIdentity(); mRelativeXformInvTrans.setIdentity(); - mFaceMappingChanged = FALSE; + mFaceMappingChanged = false; mLOD = MIN_LOD; mLODDistance = 0.0f; mLODAdjustedDistance = 0.0f; mLODRadius = 0.0f; mTextureAnimp = NULL; - mVolumeChanged = FALSE; + mVolumeChanged = false; mVObjRadius = LLVector3(1,1,0.5f).length(); mNumFaces = 0; - mLODChanged = FALSE; - mSculptChanged = FALSE; - mColorChanged = FALSE; + mLODChanged = false; + mSculptChanged = false; + mColorChanged = false; mSpotLightPriority = 0.f; mSkinInfoUnavaliable = false; @@ -296,6 +296,11 @@ void LLVOVolume::markDead() { mLightTexture->removeVolume(LLRender::LIGHT_TEX, this); } + + if (mIsHeroProbe) + { + gPipeline.mHeroProbeManager.unregisterViewerObject(this); + } } LLViewerObject::markDead(); @@ -400,7 +405,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, } gPipeline.markTextured(mDrawable); - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; mTexAnimMode = 0; } } @@ -434,7 +439,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, if (update_type != OUT_TERSE_IMPROVED) { LLVolumeParams volume_params; - BOOL res = LLVolumeMessage::unpackVolumeParams(&volume_params, *dp); + bool res = LLVolumeMessage::unpackVolumeParams(&volume_params, *dp); if (!res) { LL_WARNS() << "Bogus volume parameters in object " << getID() << LL_ENDL; @@ -504,7 +509,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, } gPipeline.markTextured(mDrawable); - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; mTexAnimMode = 0; } @@ -595,7 +600,7 @@ void LLVOVolume::animateTextures() { if (!mTexAnimMode) { - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; gPipeline.markTextured(mDrawable); } mTexAnimMode = result | mTextureAnimp->mMode; @@ -691,7 +696,7 @@ void LLVOVolume::animateTextures() } gPipeline.markTextured(mDrawable); - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; mTexAnimMode = 0; } } @@ -704,11 +709,11 @@ void LLVOVolume::updateTextures() updateTextureVirtualSize(); } -BOOL LLVOVolume::isVisible() const +bool LLVOVolume::isVisible() const { if(mDrawable.notNull() && mDrawable->isVisible()) { - return TRUE ; + return true ; } if(isAttachment()) @@ -722,7 +727,7 @@ BOOL LLVOVolume::isVisible() const return objp && objp->mDrawable.notNull() && objp->mDrawable->isVisible() ; } - return FALSE ; + return false ; } void LLVOVolume::updateTextureVirtualSize(bool forced) @@ -854,7 +859,7 @@ void LLVOVolume::updateTextureVirtualSize(bool forced) S32 lod = llmin(mLOD, 3); F32 lodf = ((F32)(lod + 1.0f)/4.f); F32 tex_size = lodf * LLViewerTexture::sMaxSculptRez ; - mSculptTexture->addTextureStats(2.f * tex_size * tex_size, FALSE); + mSculptTexture->addTextureStats(2.f * tex_size * tex_size, false); } S32 texture_discard = mSculptTexture->getCachedRawImageLevel(); //try to match the texture @@ -865,7 +870,7 @@ void LLVOVolume::updateTextureVirtualSize(bool forced) current_discard < 0)) //no previous rebuild { gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME); - mSculptChanged = TRUE; + mSculptChanged = true; } if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SCULPTED)) @@ -882,7 +887,7 @@ void LLVOVolume::updateTextureVirtualSize(bool forced) { LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); LLUUID id = params->getLightTexture(); - mLightTexture = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE); + mLightTexture = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE); if (mLightTexture.notNull()) { F32 rad = getLightRadius(); @@ -912,14 +917,14 @@ void LLVOVolume::updateTextureVirtualSize(bool forced) } } -BOOL LLVOVolume::isActive() const +bool LLVOVolume::isActive() const { return !mStatic; } -BOOL LLVOVolume::setMaterial(const U8 material) +bool LLVOVolume::setMaterial(const U8 material) { - BOOL res = LLViewerObject::setMaterial(material); + bool res = LLViewerObject::setMaterial(material); return res; } @@ -930,7 +935,7 @@ void LLVOVolume::setTexture(const S32 face) gGL.getTexUnit(0)->bind(getTEImage(face)); } -void LLVOVolume::setScale(const LLVector3 &scale, BOOL damped) +void LLVOVolume::setScale(const LLVector3 &scale, bool damped) { if (scale != getScale()) { @@ -989,14 +994,14 @@ LLDrawable *LLVOVolume::createDrawable(LLPipeline *pipeline) if (getIsLight()) { // Add it to the pipeline mLightSet - gPipeline.setLight(mDrawable, TRUE); + gPipeline.setLight(mDrawable, true); } if (isReflectionProbe()) { updateReflectionProbePtr(); } - + updateRadius(); bool force_update = true; // avoid non-alpha mDistance update being optimized away mDrawable->updateDistance(*LLViewerCamera::getInstance(), force_update); @@ -1004,7 +1009,7 @@ LLDrawable *LLVOVolume::createDrawable(LLPipeline *pipeline) return mDrawable; } -BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bool unique_volume) +bool LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bool unique_volume) { LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME; LLVolumeParams volume_params = params_in; @@ -1012,7 +1017,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo S32 last_lod = mVolumep.notNull() ? LLVolumeLODGroup::getVolumeDetailFromScale(mVolumep->getDetail()) : -1; S32 lod = mLOD; - BOOL is404 = FALSE; + bool is404 = false; if (isSculpted()) { @@ -1024,7 +1029,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo lod = gMeshRepo.getActualMeshLOD(volume_params, lod); if (lod == -1) { - is404 = TRUE; + is404 = true; lod = 0; } } @@ -1035,7 +1040,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo bool is_flexible = (volume_params.getPathParams().getCurveType() == LL_PCODE_PATH_FLEXIBLE); if (is_flexible) { - setParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE, TRUE, false); + setParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE, true, false); if (!mVolumeImpl) { LLFlexibleObjectData* data = (LLFlexibleObjectData*)getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE); @@ -1045,7 +1050,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo else { // Mark the parameter not in use - setParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE, FALSE, false); + setParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE, false, false); if (mVolumeImpl) { delete mVolumeImpl; @@ -1053,14 +1058,14 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo if (mDrawable.notNull()) { // Undo the damage we did to this matrix - mDrawable->updateXform(FALSE); + mDrawable->updateXform(false); } } } if (is404) { - setIcon(LLViewerTextureManager::getFetchedTextureFromFile("icons/Inv_Mesh.png", FTT_LOCAL_FILE, TRUE, LLGLTexture::BOOST_UI)); + setIcon(LLViewerTextureManager::getFetchedTextureFromFile("icons/Inv_Mesh.png", FTT_LOCAL_FILE, true, LLGLTexture::BOOST_UI)); //render prim proxy when mesh loading attempts give up volume_params.setSculptID(LLUUID::null, LL_SCULPT_TYPE_NONE); @@ -1068,7 +1073,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo if ((LLPrimitive::setVolume(volume_params, lod, (mVolumeImpl && mVolumeImpl->isVolumeUnique()))) || mSculptChanged) { - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; if (mVolumeImpl) { @@ -1128,14 +1133,14 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo } } - return TRUE; + return true; } else if (NO_LOD == lod) { LLSculptIDSize::instance().resetSizeSum(volume_params.getSculptID()); } - return FALSE; + return false; } void LLVOVolume::updateSculptTexture() @@ -1148,7 +1153,7 @@ void LLVOVolume::updateSculptTexture() LLUUID id = sculpt_params->getSculptTexture(); if (id.notNull()) { - mSculptTexture = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + mSculptTexture = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); } mSkinInfoUnavaliable = false; @@ -1189,7 +1194,7 @@ void LLVOVolume::updateVisualComplexity() void LLVOVolume::notifyMeshLoaded() { - mSculptChanged = TRUE; + mSculptChanged = true; gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY); if (!mSkinInfo && !mSkinInfoUnavaliable) @@ -1311,11 +1316,13 @@ void LLVOVolume::sculpt() } } else - { + { + LLImageDataSharedLock lock(raw_image); + sculpt_height = raw_image->getHeight(); sculpt_width = raw_image->getWidth(); sculpt_components = raw_image->getComponents(); - + sculpt_data = raw_image->getData(); if(LLViewerTextureManager::sTesterp) @@ -1393,11 +1400,11 @@ std::string get_debug_object_lod_text(LLVOVolume *rootp) return result; } -BOOL LLVOVolume::calcLOD() +bool LLVOVolume::calcLOD() { if (mDrawable.isNull()) { - return FALSE; + return false; } S32 cur_detail = 0; @@ -1413,7 +1420,7 @@ BOOL LLVOVolume::calcLOD() // Not sure how this can really happen, but alas it does. Better exit here than crashing. if( !avatar || !avatar->mDrawable ) { - return FALSE; + return false; } distance = avatar->mDrawable->mDistanceWRTCamera; @@ -1441,7 +1448,7 @@ BOOL LLVOVolume::calcLOD() if (distance <= 0.f || radius <= 0.f) { LL_DEBUGS("DynamicBox","CalcLOD") << "avatar distance/radius uninitialized, skipping" << LL_ENDL; - return FALSE; + return false; } } else @@ -1451,7 +1458,7 @@ BOOL LLVOVolume::calcLOD() if (distance <= 0.f || radius <= 0.f) { LL_DEBUGS("DynamicBox","CalcLOD") << "non-avatar distance/radius uninitialized, skipping" << LL_ENDL; - return FALSE; + return false; } } @@ -1541,22 +1548,22 @@ BOOL LLVOVolume::calcLOD() mAppAngle = ll_round((F32) atan2( mDrawable->getRadius(), mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f); mLOD = cur_detail; - return TRUE; + return true; } - return FALSE; + return false; } -BOOL LLVOVolume::updateLOD() +bool LLVOVolume::updateLOD() { if (mDrawable.isNull()) { - return FALSE; + return false; } LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME; - BOOL lod_changed = FALSE; + bool lod_changed = false; if (!LLSculptIDSize::instance().isUnloaded(getVolume()->getParams().getSculptID())) { @@ -1564,13 +1571,13 @@ BOOL LLVOVolume::updateLOD() } else { - return FALSE; + return false; } if (lod_changed) { gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME); - mLODChanged = TRUE; + mLODChanged = true; } else { @@ -1587,12 +1594,12 @@ BOOL LLVOVolume::updateLOD() return lod_changed; } -BOOL LLVOVolume::setDrawableParent(LLDrawable* parentp) +bool LLVOVolume::setDrawableParent(LLDrawable* parentp) { if (!LLViewerObject::setDrawableParent(parentp)) { // no change in drawable parent - return FALSE; + return false; } if (!mDrawable->isRoot()) @@ -1610,7 +1617,7 @@ BOOL LLVOVolume::setDrawableParent(LLDrawable* parentp) } } - return TRUE; + return true; } void LLVOVolume::updateFaceFlags() @@ -1621,7 +1628,7 @@ void LLVOVolume::updateFaceFlags() LLFace *face = mDrawable->getFace(i); if (face) { - BOOL fullbright = getTE(i)->getFullbright(); + bool fullbright = getTE(i)->getFullbright(); face->clearState(LLFace::FULLBRIGHT | LLFace::HUD_RENDER | LLFace::LIGHT); if (fullbright || (mMaterial == LL_MCODE_LIGHT)) @@ -1640,9 +1647,9 @@ void LLVOVolume::updateFaceFlags() } } -BOOL LLVOVolume::setParent(LLViewerObject* parent) +bool LLVOVolume::setParent(LLViewerObject* parent) { - BOOL ret = FALSE ; + bool ret = false ; LLViewerObject *old_parent = (LLViewerObject*) getParent(); if (parent != old_parent) { @@ -1663,7 +1670,7 @@ void LLVOVolume::regenFaces() { LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME; // remove existing faces - BOOL count_changed = mNumFaces != getNumTEs(); + bool count_changed = mNumFaces != getNumTEs(); if (count_changed) { @@ -1707,17 +1714,17 @@ void LLVOVolume::regenFaces() } } -BOOL LLVOVolume::genBBoxes(BOOL force_global, BOOL should_update_octree_bounds) +bool LLVOVolume::genBBoxes(bool force_global, bool should_update_octree_bounds) { LL_PROFILE_ZONE_SCOPED; - BOOL res = TRUE; + bool res = true; LLVector4a min, max; min.clear(); max.clear(); - BOOL rebuild = mDrawable->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION | LLDrawable::REBUILD_RIGGED); + bool rebuild = mDrawable->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION | LLDrawable::REBUILD_RIGGED); if (getRiggedVolume()) { @@ -1753,7 +1760,7 @@ BOOL LLVOVolume::genBBoxes(BOOL force_global, BOOL should_update_octree_bounds) continue; } - BOOL face_res = face->genVolumeBBoxes(*volume, i, + bool face_res = face->genVolumeBBoxes(*volume, i, mRelativeXform, (mVolumeImpl && mVolumeImpl->isVolumeGlobal()) || force_global); res &= face_res; // note that this result is never used @@ -1947,7 +1954,7 @@ void LLVOVolume::updateRelativeXform(bool force_identity) } } -bool LLVOVolume::lodOrSculptChanged(LLDrawable *drawable, BOOL &compiled, BOOL &should_update_octree_bounds) +bool LLVOVolume::lodOrSculptChanged(LLDrawable *drawable, bool &compiled, bool &should_update_octree_bounds) { LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME; bool regen_faces = false; @@ -1978,7 +1985,7 @@ bool LLVOVolume::lodOrSculptChanged(LLDrawable *drawable, BOOL &compiled, BOOL & updateVisualComplexity(); } - compiled = TRUE; + compiled = true; // new_lod > old_lod breaks a feedback loop between LOD updates and // bounding box updates. should_update_octree_bounds = should_update_octree_bounds || mSculptChanged || new_lod > old_lod; @@ -2014,20 +2021,20 @@ bool LLVOVolume::lodOrSculptChanged(LLDrawable *drawable, BOOL &compiled, BOOL & return regen_faces; } -BOOL LLVOVolume::updateGeometry(LLDrawable *drawable) +bool LLVOVolume::updateGeometry(LLDrawable *drawable) { LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME; if (mDrawable->isState(LLDrawable::REBUILD_RIGGED)) { updateRiggedVolume(false); - genBBoxes(FALSE); + genBBoxes(false); mDrawable->clearState(LLDrawable::REBUILD_RIGGED); } if (mVolumeImpl != NULL) { - BOOL res; + bool res; { res = mVolumeImpl->doUpdateGeometry(drawable); } @@ -2045,13 +2052,13 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable) if (mDrawable.isNull()) // Not sure why this is happening, but it is... { - return TRUE; // No update to complete + return true; // No update to complete } - BOOL compiled = FALSE; + bool compiled = false; // This should be true in most cases, unless we're sure no octree update is // needed. - BOOL should_update_octree_bounds = bool(getRiggedVolume()) || mDrawable->isState(LLDrawable::REBUILD_POSITION) || !mDrawable->getSpatialExtents()->isFinite3(); + bool should_update_octree_bounds = bool(getRiggedVolume()) || mDrawable->isState(LLDrawable::REBUILD_POSITION) || !mDrawable->getSpatialExtents()->isFinite3(); if (mVolumeChanged || mFaceMappingChanged) { @@ -2067,7 +2074,7 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable) } else if (mSculptChanged || mLODChanged || mColorChanged) { - compiled = TRUE; + compiled = true; was_regen_faces = lodOrSculptChanged(drawable, compiled, should_update_octree_bounds); } @@ -2078,7 +2085,7 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable) else if (mLODChanged || mSculptChanged || mColorChanged) { dirtySpatialGroup(); - compiled = TRUE; + compiled = true; lodOrSculptChanged(drawable, compiled, should_update_octree_bounds); if(drawable->isState(LLDrawable::REBUILD_RIGGED | LLDrawable::RIGGED)) @@ -2089,13 +2096,13 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable) // it has its own drawable (it's moved) or it has changed UVs or it has changed xforms from global<->local else { - compiled = TRUE; + compiled = true; // All it did was move or we changed the texture coordinate offset } // Generate bounding boxes if needed, and update the object's size in the // octree - genBBoxes(FALSE, should_update_octree_bounds); + genBBoxes(false, should_update_octree_bounds); // Update face flags updateFaceFlags(); @@ -2105,11 +2112,11 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable) LLPipeline::sCompiles++; } - mVolumeChanged = FALSE; - mLODChanged = FALSE; - mSculptChanged = FALSE; - mFaceMappingChanged = FALSE; - mColorChanged = FALSE; + mVolumeChanged = false; + mLODChanged = false; + mSculptChanged = false; + mFaceMappingChanged = false; + mColorChanged = false; return LLViewerObject::updateGeometry(drawable); } @@ -2138,13 +2145,13 @@ void LLVOVolume::updateFaceSize(S32 idx) } } -BOOL LLVOVolume::isRootEdit() const +bool LLVOVolume::isRootEdit() const { if (mParent && !((LLViewerObject*)mParent)->isAvatar()) { - return FALSE; + return false; } - return TRUE; + return true; } //virtual @@ -2165,7 +2172,7 @@ void LLVOVolume::setNumTEs(const U8 num_tes) setTE(i, *te) ; mMediaImplList[i] = mMediaImplList[old_num_tes -1] ; } - mMediaImplList[old_num_tes -1]->setUpdated(TRUE) ; + mMediaImplList[old_num_tes -1]->setUpdated(true) ; } } else if(old_num_tes > num_tes && mMediaImplList.size() > num_tes) //old faces removed @@ -2191,23 +2198,23 @@ void LLVOVolume::setNumTEs(const U8 num_tes) //virtual void LLVOVolume::changeTEImage(S32 index, LLViewerTexture* imagep) { - BOOL changed = (mTEImages[index] != imagep); + bool changed = (mTEImages[index] != imagep); LLViewerObject::changeTEImage(index, imagep); if (changed) { gPipeline.markTextured(mDrawable); - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; } } void LLVOVolume::setTEImage(const U8 te, LLViewerTexture *imagep) { - BOOL changed = (mTEImages[te] != imagep); + bool changed = (mTEImages[te] != imagep); LLViewerObject::setTEImage(te, imagep); if (changed) { gPipeline.markTextured(mDrawable); - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; } } @@ -2222,7 +2229,7 @@ S32 LLVOVolume::setTETexture(const U8 te, const LLUUID &uuid) shrinkWrap(); gPipeline.markTextured(mDrawable); } - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; } return res; } @@ -2247,14 +2254,14 @@ S32 LLVOVolume::setTEColor(const U8 te, const LLColor4& color) { gPipeline.markTextured(mDrawable); //treat this alpha change as an LoD update since render batches may need to get rebuilt - mLODChanged = TRUE; + mLODChanged = true; gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME); } retval = LLPrimitive::setTEColor(te, color); if (mDrawable.notNull() && retval) { // These should only happen on updates which are not the initial update. - mColorChanged = TRUE; + mColorChanged = true; mDrawable->setState(LLDrawable::REBUILD_COLOR); shrinkWrap(); dirtyMesh(); @@ -2270,7 +2277,7 @@ S32 LLVOVolume::setTEBumpmap(const U8 te, const U8 bumpmap) if (res) { gPipeline.markTextured(mDrawable); - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; } return res; } @@ -2281,7 +2288,7 @@ S32 LLVOVolume::setTETexGen(const U8 te, const U8 texgen) if (res) { gPipeline.markTextured(mDrawable); - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; } return res; } @@ -2292,7 +2299,7 @@ S32 LLVOVolume::setTEMediaTexGen(const U8 te, const U8 media) if (res) { gPipeline.markTextured(mDrawable); - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; } return res; } @@ -2303,7 +2310,7 @@ S32 LLVOVolume::setTEShiny(const U8 te, const U8 shiny) if (res) { gPipeline.markTextured(mDrawable); - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; } return res; } @@ -2314,7 +2321,7 @@ S32 LLVOVolume::setTEFullbright(const U8 te, const U8 fullbright) if (res) { gPipeline.markTextured(mDrawable); - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; } return res; } @@ -2325,7 +2332,7 @@ S32 LLVOVolume::setTEBumpShinyFullbright(const U8 te, const U8 bump) if (res) { gPipeline.markTextured(mDrawable); - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; } return res; } @@ -2336,7 +2343,7 @@ S32 LLVOVolume::setTEMediaFlags(const U8 te, const U8 media_flags) if (res) { gPipeline.markTextured(mDrawable); - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; } return res; } @@ -2351,7 +2358,7 @@ S32 LLVOVolume::setTEGlow(const U8 te, const F32 glow) gPipeline.markTextured(mDrawable); shrinkWrap(); } - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; } return res; } @@ -2391,7 +2398,7 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID) gPipeline.markTextured(mDrawable); gPipeline.markRebuild(mDrawable,LLDrawable::REBUILD_ALL); } - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; } return res; } @@ -2409,7 +2416,7 @@ S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialPa gPipeline.markTextured(mDrawable); gPipeline.markRebuild(mDrawable,LLDrawable::REBUILD_ALL); } - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; return TEM_CHANGE_TEXTURE; } @@ -2424,7 +2431,7 @@ S32 LLVOVolume::setTEGLTFMaterialOverride(U8 te, LLGLTFMaterial* mat) gPipeline.markTextured(mDrawable); gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL); } - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; } return retval; @@ -2437,7 +2444,7 @@ S32 LLVOVolume::setTEScale(const U8 te, const F32 s, const F32 t) if (res) { gPipeline.markTextured(mDrawable); - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; } return res; } @@ -2448,7 +2455,7 @@ S32 LLVOVolume::setTEScaleS(const U8 te, const F32 s) if (res) { gPipeline.markTextured(mDrawable); - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; } return res; } @@ -2459,7 +2466,7 @@ S32 LLVOVolume::setTEScaleT(const U8 te, const F32 t) if (res) { gPipeline.markTextured(mDrawable); - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; } return res; } @@ -2918,7 +2925,7 @@ void LLVOVolume::addMediaImpl(LLViewerMediaImpl* media_impl, S32 texture_index) } else //the face is not available now, start media on this face later. { - media_impl->setUpdated(TRUE) ; + media_impl->setUpdated(true) ; } } return ; @@ -2983,7 +2990,7 @@ void LLVOVolume::setLightTextureID(LLUUID id) { if (!hasLightTexture()) { - setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE, TRUE, true); + setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE, true, true); } else if (old_texturep) { @@ -3011,7 +3018,7 @@ void LLVOVolume::setLightTextureID(LLUUID id) { old_texturep->removeVolume(LLRender::LIGHT_TEX, this); } - setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE, FALSE, true); + setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE, false, true); parameterChanged(LLNetworkData::PARAMS_LIGHT_IMAGE, true); mLightTexture = NULL; } @@ -3027,29 +3034,29 @@ void LLVOVolume::setSpotLightParams(LLVector3 params) } } -void LLVOVolume::setIsLight(BOOL is_light) +void LLVOVolume::setIsLight(bool is_light) { - BOOL was_light = getIsLight(); + bool was_light = getIsLight(); if (is_light != was_light) { if (is_light) { - setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT, TRUE, true); + setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT, true, true); } else { - setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT, FALSE, true); + setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT, false, true); } if (is_light) { // Add it to the pipeline mLightSet - gPipeline.setLight(mDrawable, TRUE); + gPipeline.setLight(mDrawable, true); } else { // Not a light. Remove it from the pipeline's light set. - gPipeline.setLight(mDrawable, FALSE); + gPipeline.setLight(mDrawable, false); } } } @@ -3069,7 +3076,7 @@ void LLVOVolume::setLightLinearColor(const LLColor3& color) param_block->setLinearColor(LLColor4(color, param_block->getLinearColor().mV[3])); parameterChanged(LLNetworkData::PARAMS_LIGHT, true); gPipeline.markTextured(mDrawable); - mFaceMappingChanged = TRUE; + mFaceMappingChanged = true; } } } @@ -3128,7 +3135,7 @@ void LLVOVolume::setLightCutoff(F32 cutoff) //---------------------------------------------------------------------------- -BOOL LLVOVolume::getIsLight() const +bool LLVOVolume::getIsLight() const { mIsLight = getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT); return mIsLight; @@ -3256,7 +3263,7 @@ LLViewerTexture* LLVOVolume::getLightTexture() { if (mLightTexture.isNull() || id != mLightTexture->getID()) { - mLightTexture = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE); + mLightTexture = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE); } } else @@ -3319,23 +3326,23 @@ F32 LLVOVolume::getLightCutoff() const } } -BOOL LLVOVolume::isReflectionProbe() const +bool LLVOVolume::isReflectionProbe() const { return getParameterEntryInUse(LLNetworkData::PARAMS_REFLECTION_PROBE); } -bool LLVOVolume::setIsReflectionProbe(BOOL is_probe) +bool LLVOVolume::setIsReflectionProbe(bool is_probe) { - BOOL was_probe = isReflectionProbe(); + bool was_probe = isReflectionProbe(); if (is_probe != was_probe) { if (is_probe) { - setParameterEntryInUse(LLNetworkData::PARAMS_REFLECTION_PROBE, TRUE, true); + setParameterEntryInUse(LLNetworkData::PARAMS_REFLECTION_PROBE, true, true); } else { - setParameterEntryInUse(LLNetworkData::PARAMS_REFLECTION_PROBE, FALSE, true); + setParameterEntryInUse(LLNetworkData::PARAMS_REFLECTION_PROBE, false, true); } } @@ -3408,6 +3415,22 @@ bool LLVOVolume::setReflectionProbeIsDynamic(bool is_dynamic) return false; } +bool LLVOVolume::setReflectionProbeIsMirror(bool is_mirror) +{ + LLReflectionProbeParams *param_block = (LLReflectionProbeParams *) getParameterEntry(LLNetworkData::PARAMS_REFLECTION_PROBE); + if (param_block) + { + if (param_block->getIsMirror() != is_mirror) + { + param_block->setIsMirror(is_mirror); + parameterChanged(LLNetworkData::PARAMS_REFLECTION_PROBE, true); + return true; + } + } + + return false; +} + F32 LLVOVolume::getReflectionProbeAmbiance() const { const LLReflectionProbeParams* param_block = (const LLReflectionProbeParams*)getParameterEntry(LLNetworkData::PARAMS_REFLECTION_PROBE); @@ -3456,6 +3479,18 @@ bool LLVOVolume::getReflectionProbeIsDynamic() const return false; } +bool LLVOVolume::getReflectionProbeIsMirror() const +{ + const LLReflectionProbeParams *param_block = + (const LLReflectionProbeParams *) getParameterEntry(LLNetworkData::PARAMS_REFLECTION_PROBE); + if (param_block) + { + return param_block->getIsMirror(); + } + + return false; +} + U32 LLVOVolume::getVolumeInterfaceID() const { if (mVolumeImpl) @@ -3466,7 +3501,7 @@ U32 LLVOVolume::getVolumeInterfaceID() const return 0; } -BOOL LLVOVolume::isFlexible() const +bool LLVOVolume::isFlexible() const { if (getParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE)) { @@ -3477,25 +3512,25 @@ BOOL LLVOVolume::isFlexible() const U8 profile_and_hole = volume_params.getProfileParams().getCurveType(); volume_params.setType(profile_and_hole, LL_PCODE_PATH_FLEXIBLE); } - return TRUE; + return true; } else { - return FALSE; + return false; } } -BOOL LLVOVolume::isSculpted() const +bool LLVOVolume::isSculpted() const { if (getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT)) { - return TRUE; + return true; } - return FALSE; + return false; } -BOOL LLVOVolume::isMesh() const +bool LLVOVolume::isMesh() const { if (isSculpted()) { @@ -3505,21 +3540,21 @@ BOOL LLVOVolume::isMesh() const if ((sculpt_type & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH) // mesh is a mesh { - return TRUE; + return true; } } - return FALSE; + return false; } -BOOL LLVOVolume::hasLightTexture() const +bool LLVOVolume::hasLightTexture() const { if (getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE)) { - return TRUE; + return true; } - return FALSE; + return false; } bool LLVOVolume::isFlexibleFast() const @@ -3547,30 +3582,30 @@ bool LLVOVolume::isAnimatedObjectFast() const return mIsAnimatedObject; } -BOOL LLVOVolume::isVolumeGlobal() const +bool LLVOVolume::isVolumeGlobal() const { if (mVolumeImpl) { - return mVolumeImpl->isVolumeGlobal() ? TRUE : FALSE; + return mVolumeImpl->isVolumeGlobal() ? true : false; } else if (mRiggedVolume.notNull()) { - return TRUE; + return true; } - return FALSE; + return false; } -BOOL LLVOVolume::canBeFlexible() const +bool LLVOVolume::canBeFlexible() const { U8 path = getVolume()->getParams().getPathParams().getCurveType(); return (path == LL_PCODE_PATH_FLEXIBLE || path == LL_PCODE_PATH_LINE); } -BOOL LLVOVolume::setIsFlexible(BOOL is_flexible) +bool LLVOVolume::setIsFlexible(bool is_flexible) { - BOOL res = FALSE; - BOOL was_flexible = isFlexible(); + bool res = false; + bool was_flexible = isFlexible(); LLVolumeParams volume_params; if (is_flexible) { @@ -3579,10 +3614,10 @@ BOOL LLVOVolume::setIsFlexible(BOOL is_flexible) volume_params = getVolume()->getParams(); U8 profile_and_hole = volume_params.getProfileParams().getCurveType(); volume_params.setType(profile_and_hole, LL_PCODE_PATH_FLEXIBLE); - res = TRUE; - setFlags(FLAGS_USE_PHYSICS, FALSE); - setFlags(FLAGS_PHANTOM, TRUE); - setParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE, TRUE, true); + res = true; + setFlags(FLAGS_USE_PHYSICS, false); + setFlags(FLAGS_PHANTOM, true); + setParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE, true, true); if (mDrawable) { mDrawable->makeActive(); @@ -3596,9 +3631,9 @@ BOOL LLVOVolume::setIsFlexible(BOOL is_flexible) volume_params = getVolume()->getParams(); U8 profile_and_hole = volume_params.getProfileParams().getCurveType(); volume_params.setType(profile_and_hole, LL_PCODE_PATH_LINE); - res = TRUE; - setFlags(FLAGS_PHANTOM, FALSE); - setParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE, FALSE, true); + res = true; + setFlags(FLAGS_PHANTOM, false); + setParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE, false, true); } } if (res) @@ -3625,7 +3660,7 @@ const LLMeshSkinInfo* LLVOVolume::getSkinInfo() const } // virtual -BOOL LLVOVolume::isRiggedMesh() const +bool LLVOVolume::isRiggedMesh() const { return isMesh() && getSkinInfo(); } @@ -3844,7 +3879,7 @@ void LLVOVolume::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_p volume->generateSilhouetteVertices(nodep->mSilhouetteVertices, nodep->mSilhouetteNormals, view_vector, trans_mat, mRelativeXformInvTrans, nodep->getTESelectMask()); - nodep->mSilhouetteExists = TRUE; + nodep->mSilhouetteExists = true; } } @@ -3871,12 +3906,12 @@ void LLVOVolume::updateRadius() } -BOOL LLVOVolume::isAttachment() const +bool LLVOVolume::isAttachment() const { return mAttachmentState != 0 ; } -BOOL LLVOVolume::isHUDAttachment() const +bool LLVOVolume::isHUDAttachment() const { // *NOTE: we assume hud attachment points are in defined range // since this range is constant for backwards compatibility @@ -4337,7 +4372,7 @@ void LLVOVolume::parameterChanged(U16 param_type, bool local_origin) LLViewerObject::parameterChanged(param_type, local_origin); } -void LLVOVolume::parameterChanged(U16 param_type, LLNetworkData* data, BOOL in_use, bool local_origin) +void LLVOVolume::parameterChanged(U16 param_type, LLNetworkData* data, bool in_use, bool local_origin) { LLViewerObject::parameterChanged(param_type, data, in_use, local_origin); if (mVolumeImpl) @@ -4361,7 +4396,7 @@ void LLVOVolume::parameterChanged(U16 param_type, LLNetworkData* data, BOOL in_u } if (mDrawable.notNull()) { - BOOL is_light = getIsLight(); + bool is_light = getIsLight(); if (is_light != mDrawable->isState(LLDrawable::LIGHT)) { gPipeline.setLight(mDrawable, is_light); @@ -4375,18 +4410,34 @@ void LLVOVolume::updateReflectionProbePtr() { if (isReflectionProbe()) { - if (mReflectionProbe.isNull()) + if (mReflectionProbe.isNull() && !getReflectionProbeIsMirror()) { mReflectionProbe = gPipeline.mReflectionMapManager.registerViewerObject(this); } + else if (mReflectionProbe.isNull() && getReflectionProbeIsMirror()) + { + // Geenz: This is a special case - what we want here is a hero probe. + // What we want to do here is instantiate a hero probe from the hero probe manager. + + if (!mIsHeroProbe) + mIsHeroProbe = gPipeline.mHeroProbeManager.registerViewerObject(this); + } } - else if (mReflectionProbe.notNull()) + else if (mReflectionProbe.notNull() || getReflectionProbeIsMirror()) { - mReflectionProbe = nullptr; + if (mReflectionProbe.notNull()) + { + mReflectionProbe = nullptr; + } + + if (getReflectionProbeIsMirror()) + { + gPipeline.mHeroProbeManager.unregisterViewerObject(this); + } } } -void LLVOVolume::setSelected(BOOL sel) +void LLVOVolume::setSelected(bool sel) { LLViewerObject::setSelected(sel); if (isAnimatedObject()) @@ -4422,7 +4473,7 @@ F32 LLVOVolume::getBinRadius() //const LLVector4a* ext = mDrawable->getSpatialExtents(); bool shrink_wrap = mShouldShrinkWrap || mDrawable->isAnimating(); - bool alpha_wrap = FALSE; + bool alpha_wrap = false; if (!isHUDAttachment() && mDrawable->mDistanceWRTCamera < alpha_distance_factor[2]) { @@ -4433,14 +4484,14 @@ F32 LLVOVolume::getBinRadius() if (face->isInAlphaPool() && !face->canRenderAsMask()) { - alpha_wrap = TRUE; + alpha_wrap = true; break; } } } else { - shrink_wrap = FALSE; + shrink_wrap = false; } if (alpha_wrap) @@ -4502,7 +4553,7 @@ void LLVOVolume::markForUpdate() } LLViewerObject::markForUpdate(); - mVolumeChanged = TRUE; + mVolumeChanged = true; } LLVector3 LLVOVolume::agentPositionToVolume(const LLVector3& pos) const @@ -4556,7 +4607,7 @@ LLVector3 LLVOVolume::volumeDirectionToAgent(const LLVector3& dir) const } -BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, S32 face, BOOL pick_transparent, BOOL pick_rigged, BOOL pick_unselectable, S32 *face_hitp, +bool LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, S32 face, bool pick_transparent, bool pick_rigged, bool pick_unselectable, S32 *face_hitp, LLVector4a* intersection,LLVector2* tex_coord, LLVector4a* normal, LLVector4a* tangent) { @@ -4564,23 +4615,23 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& || mDrawable->isDead() || !gPipeline.hasRenderType(mDrawable->getRenderType())) { - return FALSE; + return false; } if (!pick_unselectable) { - if (!LLSelectMgr::instance().canSelectObject(this, TRUE)) + if (!LLSelectMgr::instance().canSelectObject(this, true)) { - return FALSE; + return false; } } if (getClickAction() == CLICK_ACTION_IGNORE && !LLFloater::isVisible(gFloaterTools)) { - return FALSE; + return false; } - BOOL ret = FALSE; + bool ret = false; LLVolume* volume = getVolume(); @@ -4596,7 +4647,7 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& } else { //cannot pick rigged attachments on other avatars or when not in build mode - return FALSE; + return false; } } @@ -4699,8 +4750,8 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& } } - BOOL no_texture = !face->getTexture() || !face->getTexture()->hasGLTexture(); - BOOL mask = no_texture ? FALSE : face->getTexture()->getMask(face->surfaceToTexture(tc, p, n)); + bool no_texture = !face->getTexture() || !face->getTexture()->hasGLTexture(); + bool mask = no_texture ? false : face->getTexture()->getMask(face->surfaceToTexture(tc, p, n)); if (face && (ignore_alpha || pick_transparent || no_texture || mask)) { @@ -4765,12 +4816,12 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& *tex_coord = tc; } - ret = TRUE; + ret = true; } } } } - + return ret; } @@ -5023,21 +5074,21 @@ U32 LLVOVolume::getPartitionType() const } LLVolumePartition::LLVolumePartition(LLViewerRegion* regionp) -: LLSpatialPartition(LLVOVolume::VERTEX_DATA_MASK, TRUE, regionp), +: LLSpatialPartition(LLVOVolume::VERTEX_DATA_MASK, true, regionp), LLVolumeGeometryManager() { mLODPeriod = 32; - mDepthMask = FALSE; + mDepthMask = false; mDrawableType = LLPipeline::RENDER_TYPE_VOLUME; mPartitionType = LLViewerRegion::PARTITION_VOLUME; mSlopRatio = 0.25f; } LLVolumeBridge::LLVolumeBridge(LLDrawable* drawablep, LLViewerRegion* regionp) -: LLSpatialBridge(drawablep, TRUE, LLVOVolume::VERTEX_DATA_MASK, regionp), +: LLSpatialBridge(drawablep, true, LLVOVolume::VERTEX_DATA_MASK, regionp), LLVolumeGeometryManager() { - mDepthMask = FALSE; + mDepthMask = false; mLODPeriod = 32; mDrawableType = LLPipeline::RENDER_TYPE_VOLUME; mPartitionType = LLViewerRegion::PARTITION_BRIDGE; @@ -5059,30 +5110,6 @@ LLControlAVBridge::LLControlAVBridge(LLDrawable* drawablep, LLViewerRegion* regi mPartitionType = LLViewerRegion::PARTITION_CONTROL_AV; } -void LLControlAVBridge::updateSpatialExtents() -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE - - LLSpatialGroup* root = (LLSpatialGroup*)mOctree->getListener(0); - - bool rootWasDirty = root->isDirty(); - - super::updateSpatialExtents(); // root becomes non-dirty here - - // SL-18251 "On-screen animesh characters using pelvis offset animations - // disappear when root goes off-screen" - // - // Expand extents to include Control Avatar placed outside of the bounds - LLControlAvatar* controlAvatar = getVObj() ? getVObj()->getControlAvatar() : NULL; - if (controlAvatar - && controlAvatar->mDrawable - && controlAvatar->mDrawable->getEntry() - && (rootWasDirty || controlAvatar->mPlaying)) - { - root->expandExtents(controlAvatar->mDrawable->getSpatialExtents(), *mDrawable->getXform()); - } -} - bool can_batch_texture(LLFace* facep) { if (facep->getTextureEntry()->getBumpmap()) @@ -5304,7 +5331,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, if (mat) { - BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) || (te->getColor().mV[3] < 0.999f) ? TRUE : FALSE; + bool is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) || (te->getColor().mV[3] < 0.999f) ? true : false; if (type == LLRenderPass::PASS_ALPHA) { shader_mask = mat->getShaderMask(LLMaterial::DIFFUSE_ALPHA_MODE_BLEND, is_alpha); @@ -5769,7 +5796,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } } - BOOL force_simple = (facep->getPixelArea() < FORCE_SIMPLE_RENDER_AREA); + bool force_simple = (facep->getPixelArea() < FORCE_SIMPLE_RENDER_AREA); U32 type = gPipeline.getPoolTypeFromTE(te, tex); if (is_pbr && gltf_mat && gltf_mat->mAlphaMode != LLGLTFMaterial::ALPHA_MODE_BLEND) { @@ -5955,7 +5982,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) pbr_mask = pbr_mask | LLVertexBuffer::MAP_EMISSIVE; } - BOOL batch_textures = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_OBJECT) > 1; + bool batch_textures = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_OBJECT) > 1; // add extra vertex data for deferred rendering (not necessarily for batching textures) if (batch_textures) @@ -5972,22 +5999,22 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) // generate render batches for static geometry U32 extra_mask = LLVertexBuffer::MAP_TEXTURE_INDEX; - BOOL alpha_sort = TRUE; - BOOL rigged = FALSE; + bool alpha_sort = true; + bool rigged = false; for (int i = 0; i < 2; ++i) //two sets, static and rigged) { - geometryBytes += genDrawInfo(group, simple_mask | extra_mask, sSimpleFaces[i], simple_count[i], FALSE, batch_textures, rigged); - geometryBytes += genDrawInfo(group, fullbright_mask | extra_mask, sFullbrightFaces[i], fullbright_count[i], FALSE, batch_textures, rigged); + geometryBytes += genDrawInfo(group, simple_mask | extra_mask, sSimpleFaces[i], simple_count[i], false, batch_textures, rigged); + geometryBytes += genDrawInfo(group, fullbright_mask | extra_mask, sFullbrightFaces[i], fullbright_count[i], false, batch_textures, rigged); geometryBytes += genDrawInfo(group, alpha_mask | extra_mask, sAlphaFaces[i], alpha_count[i], alpha_sort, batch_textures, rigged); - geometryBytes += genDrawInfo(group, bump_mask | extra_mask, sBumpFaces[i], bump_count[i], FALSE, FALSE, rigged); - geometryBytes += genDrawInfo(group, norm_mask | extra_mask, sNormFaces[i], norm_count[i], FALSE, FALSE, rigged); - geometryBytes += genDrawInfo(group, spec_mask | extra_mask, sSpecFaces[i], spec_count[i], FALSE, FALSE, rigged); - geometryBytes += genDrawInfo(group, normspec_mask | extra_mask, sNormSpecFaces[i], normspec_count[i], FALSE, FALSE, rigged); - geometryBytes += genDrawInfo(group, pbr_mask | extra_mask, sPbrFaces[i], pbr_count[i], FALSE, FALSE, rigged); + geometryBytes += genDrawInfo(group, bump_mask | extra_mask, sBumpFaces[i], bump_count[i], false, false, rigged); + geometryBytes += genDrawInfo(group, norm_mask | extra_mask, sNormFaces[i], norm_count[i], false, false, rigged); + geometryBytes += genDrawInfo(group, spec_mask | extra_mask, sSpecFaces[i], spec_count[i], false, false, rigged); + geometryBytes += genDrawInfo(group, normspec_mask | extra_mask, sNormSpecFaces[i], normspec_count[i], false, false, rigged); + geometryBytes += genDrawInfo(group, pbr_mask | extra_mask, sPbrFaces[i], pbr_count[i], false, false, rigged); // for rigged set, add weights and disable alpha sorting (rigged items use depth buffer) extra_mask |= LLVertexBuffer::MAP_WEIGHT4; - rigged = TRUE; + rigged = true; } group->mGeometryBytes = geometryBytes; @@ -6157,7 +6184,7 @@ struct CompareBatchBreakerRigged } }; -U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace** faces, U32 face_count, BOOL distance_sort, BOOL batch_textures, BOOL rigged) +U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace** faces, U32 face_count, bool distance_sort, bool batch_textures, bool rigged) { LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME; @@ -6199,19 +6226,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace LLViewerTexture* last_tex = NULL; - S32 texture_index_channels = 1; - - if (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 30) - { - texture_index_channels = LLGLSLShader::sIndexedTextureChannels-1; //always reserve one for shiny for now just for simplicity; - } - - if (distance_sort) - { - texture_index_channels = gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels; - } - - texture_index_channels = LLGLSLShader::sIndexedTextureChannels; + S32 texture_index_channels = LLGLSLShader::sIndexedTextureChannels; bool flexi = false; @@ -6449,11 +6464,11 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace //append face to appropriate render batch - BOOL force_simple = facep->getPixelArea() < FORCE_SIMPLE_RENDER_AREA; - BOOL fullbright = facep->isState(LLFace::FULLBRIGHT); + bool force_simple = facep->getPixelArea() < FORCE_SIMPLE_RENDER_AREA; + bool fullbright = facep->isState(LLFace::FULLBRIGHT); if ((mask & LLVertexBuffer::MAP_NORMAL) == 0) { //paranoia check to make sure GL doesn't try to read non-existant normals - fullbright = TRUE; + fullbright = true; } const LLTextureEntry* te = facep->getTextureEntry(); @@ -6461,12 +6476,12 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace if (hud_group && gltf_mat == nullptr) { //all hud attachments are fullbright - fullbright = TRUE; + fullbright = true; } tex = facep->getTexture(); - BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? TRUE : FALSE; + bool is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? true : false; LLMaterial* mat = nullptr; bool can_be_shiny = false; @@ -6492,7 +6507,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace if (!gltf_mat) { - is_alpha = (is_alpha || blinn_phong_transparent) ? TRUE : FALSE; + is_alpha = (is_alpha || blinn_phong_transparent) ? true : false; } if (gltf_mat || (mat && !hud_group)) |