diff options
Diffstat (limited to 'indra/newview/llpanelvolume.cpp')
-rw-r--r-- | indra/newview/llpanelvolume.cpp | 112 |
1 files changed, 55 insertions, 57 deletions
diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 701882ac57..16c38bf1f0 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -90,7 +90,7 @@ const F32 DEFAULT_GRAVITY_MULTIPLIER = 1.f; const F32 DEFAULT_DENSITY = 1000.f; // "Features" Tab -BOOL LLPanelVolume::postBuild() +bool LLPanelVolume::postBuild() { // Flexible Objects Parameters { @@ -213,14 +213,14 @@ BOOL LLPanelVolume::postBuild() // Start with everyone disabled clearCtrls(); - return TRUE; + return true; } LLPanelVolume::LLPanelVolume() : LLPanel(), mComboMaterialItemCount(0) { - setMouseOpaque(FALSE); + setMouseOpaque(false); mCommitCallbackRegistrar.add("PanelVolume.menuDoToSelected", boost::bind(&LLPanelVolume::menuDoToSelected, this, _2)); mEnableCallbackRegistrar.add("PanelVolume.menuEnable", boost::bind(&LLPanelVolume::menuEnableItem, this, _2)); @@ -285,10 +285,10 @@ void LLPanelVolume::getState( ) LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name); // BUG? Check for all objects being editable? - BOOL editable = root_objectp->permModify() && !root_objectp->isPermanentEnforced(); - BOOL single_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ) + bool editable = root_objectp->permModify() && !root_objectp->isPermanentEnforced(); + bool single_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ) && LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1; - BOOL single_root_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ) && + bool single_root_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ) && LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() == 1; // Select Single Message @@ -306,26 +306,26 @@ void LLPanelVolume::getState( ) } // Light properties - BOOL is_light = volobjp && volobjp->getIsLight(); + bool is_light = volobjp && volobjp->getIsLight(); getChild<LLUICtrl>("Light Checkbox Ctrl")->setValue(is_light); getChildView("Light Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp); if (is_light && editable && single_volume) { - //mLabelColor ->setEnabled( TRUE ); + //mLabelColor ->setEnabled( true ); LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); if(LightColorSwatch) { - LightColorSwatch->setEnabled( TRUE ); - LightColorSwatch->setValid( TRUE ); + LightColorSwatch->setEnabled( true ); + LightColorSwatch->setValid( true ); LightColorSwatch->set(volobjp->getLightSRGBBaseColor()); } LLTextureCtrl* LightTextureCtrl = getChild<LLTextureCtrl>("light texture control"); if (LightTextureCtrl) { - LightTextureCtrl->setEnabled(TRUE); - LightTextureCtrl->setValid(TRUE); + LightTextureCtrl->setEnabled(true); + LightTextureCtrl->setValid(true); LightTextureCtrl->setImageAssetID(volobjp->getLightTextureID()); } @@ -357,14 +357,14 @@ void LLPanelVolume::getState( ) LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); if(LightColorSwatch) { - LightColorSwatch->setEnabled( FALSE ); - LightColorSwatch->setValid( FALSE ); + LightColorSwatch->setEnabled( false ); + LightColorSwatch->setValid( false ); } LLTextureCtrl* LightTextureCtrl = getChild<LLTextureCtrl>("light texture control"); if (LightTextureCtrl) { - LightTextureCtrl->setEnabled(FALSE); - LightTextureCtrl->setValid(FALSE); + LightTextureCtrl->setEnabled(false); + LightTextureCtrl->setValid(false); if (objectp->isAttachment()) { @@ -386,7 +386,7 @@ void LLPanelVolume::getState( ) } // Reflection Probe - BOOL is_probe = volobjp && volobjp->isReflectionProbe(); + bool is_probe = volobjp && volobjp->isReflectionProbe(); bool is_mirror = volobjp && volobjp->getReflectionProbeIsMirror(); getChild<LLUICtrl>("Reflection Probe")->setValue(is_probe); getChildView("Reflection Probe")->setEnabled(editable && single_volume && volobjp && !volobjp->isMesh()); @@ -442,9 +442,6 @@ void LLPanelVolume::getState( ) update_type = "Dynamic Mirror"; } - getChildView("Probe Ambiance")->setEnabled(!is_mirror); - getChildView("Probe Near Clip")->setEnabled(!is_mirror); - getChild<LLComboBox>("Probe Volume Type", true)->setValue(volume_type); getChild<LLSpinCtrl>("Probe Ambiance", true)->setValue(volobjp->getReflectionProbeAmbiance()); getChild<LLSpinCtrl>("Probe Near Clip", true)->setValue(volobjp->getReflectionProbeNearClip()); @@ -452,9 +449,9 @@ void LLPanelVolume::getState( ) } // Animated Mesh - BOOL is_animated_mesh = single_root_volume && root_volobjp && root_volobjp->isAnimatedObject(); + bool is_animated_mesh = single_root_volume && root_volobjp && root_volobjp->isAnimatedObject(); getChild<LLUICtrl>("Animated Mesh Checkbox Ctrl")->setValue(is_animated_mesh); - BOOL enabled_animated_object_box = FALSE; + bool enabled_animated_object_box = false; if (root_volobjp && root_volobjp == volobjp) { enabled_animated_object_box = single_root_volume && root_volobjp && root_volobjp->canBeAnimatedObject() && editable; @@ -502,7 +499,7 @@ void LLPanelVolume::getState( ) } // Flexible properties - BOOL is_flexible = volobjp && volobjp->isFlexible(); + bool is_flexible = volobjp && volobjp->isFlexible(); getChild<LLUICtrl>("Flexible1D Checkbox Ctrl")->setValue(is_flexible); if (is_flexible || (volobjp && volobjp->canBeFlexible())) { @@ -580,7 +577,7 @@ void LLPanelVolume::getState( ) std::string LEGACY_FULLBRIGHT_DESC = LLTrans::getString("Fullbright"); if (editable && single_volume && material_same) { - mComboMaterial->setEnabled( TRUE ); + mComboMaterial->setEnabled( true ); if (material_code == LL_MCODE_LIGHT) { if (mComboMaterial->getItemCount() == mComboMaterialItemCount) @@ -601,7 +598,7 @@ void LLPanelVolume::getState( ) } else { - mComboMaterial->setEnabled( FALSE ); + mComboMaterial->setEnabled( false ); } // Physics properties @@ -622,7 +619,7 @@ void LLPanelVolume::getState( ) mComboPhysicsShapeType->removeall(); mComboPhysicsShapeType->add(getString("None"), LLSD(1)); - BOOL isMesh = FALSE; + bool isMesh = false; LLSculptParams *sculpt_params = (LLSculptParams *)objectp->getParameterEntry(LLNetworkData::PARAMS_SCULPT); if (sculpt_params) { @@ -663,7 +660,7 @@ void LLPanelVolume::getState( ) bool LLPanelVolume::precommitValidate( const LLSD& data ) { // TODO: Richard will fill this in later. - return TRUE; // FALSE means that validation failed and new value should not be commited. + return true; // false means that validation failed and new value should not be commited. } @@ -719,14 +716,14 @@ void LLPanelVolume::clearCtrls() LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); if(LightColorSwatch) { - LightColorSwatch->setEnabled( FALSE ); - LightColorSwatch->setValid( FALSE ); + LightColorSwatch->setEnabled( false ); + LightColorSwatch->setValid( false ); } LLTextureCtrl* LightTextureCtrl = getChild<LLTextureCtrl>("light texture control"); if(LightTextureCtrl) { - LightTextureCtrl->setEnabled( FALSE ); - LightTextureCtrl->setValid( FALSE ); + LightTextureCtrl->setEnabled( false ); + LightTextureCtrl->setValid( false ); } getChildView("Light Intensity")->setEnabled(false); @@ -749,12 +746,12 @@ void LLPanelVolume::clearCtrls() getChildView("FlexForceY")->setEnabled(false); getChildView("FlexForceZ")->setEnabled(false); - mSpinPhysicsGravity->setEnabled(FALSE); - mSpinPhysicsFriction->setEnabled(FALSE); - mSpinPhysicsDensity->setEnabled(FALSE); - mSpinPhysicsRestitution->setEnabled(FALSE); + mSpinPhysicsGravity->setEnabled(false); + mSpinPhysicsFriction->setEnabled(false); + mSpinPhysicsDensity->setEnabled(false); + mSpinPhysicsRestitution->setEnabled(false); - mComboMaterial->setEnabled( FALSE ); + mComboMaterial->setEnabled( false ); } // @@ -770,7 +767,7 @@ void LLPanelVolume::sendIsLight() } LLVOVolume *volobjp = (LLVOVolume *)objectp; - BOOL value = getChild<LLUICtrl>("Light Checkbox Ctrl")->getValue(); + bool value = getChild<LLUICtrl>("Light Checkbox Ctrl")->getValue(); volobjp->setIsLight(value); LL_INFOS() << "update light sent" << LL_ENDL; } @@ -792,8 +789,8 @@ void LLPanelVolume::sendIsReflectionProbe() } LLVOVolume* volobjp = (LLVOVolume*)objectp; - BOOL value = getChild<LLUICtrl>("Reflection Probe")->getValue(); - BOOL old_value = volobjp->isReflectionProbe(); + bool value = getChild<LLUICtrl>("Reflection Probe")->getValue(); + bool old_value = volobjp->isReflectionProbe(); if (value && value != old_value) { // defer to notification util as to whether or not we *really* make this object a reflection probe @@ -812,7 +809,7 @@ void LLPanelVolume::sendIsReflectionProbe() if (in_linkeset) { // In linkset with a phantom flag - objectp->setFlags(FLAGS_PHANTOM, FALSE); + objectp->setFlags(FLAGS_PHANTOM, false); } } volobjp->setIsReflectionProbe(value); @@ -865,8 +862,8 @@ void LLPanelVolume::sendIsFlexible() } LLVOVolume *volobjp = (LLVOVolume *)objectp; - BOOL is_flexible = getChild<LLUICtrl>("Flexible1D Checkbox Ctrl")->getValue(); - //BOOL is_flexible = mCheckFlexible1D->get(); + bool is_flexible = getChild<LLUICtrl>("Flexible1D Checkbox Ctrl")->getValue(); + //bool is_flexible = mCheckFlexible1D->get(); if (is_flexible) { @@ -1084,10 +1081,10 @@ void LLPanelVolume::onPasteFeatures() bool is_root = objectp->isRoot(); // Not sure if phantom should go under physics, but doesn't fit elsewhere - BOOL is_phantom = clipboard["is_phantom"].asBoolean() && is_root; + bool is_phantom = clipboard["is_phantom"].asBoolean() && is_root; LLSelectMgr::getInstance()->selectionUpdatePhantom(is_phantom); - BOOL is_physical = clipboard["is_physical"].asBoolean() && is_root; + bool is_physical = clipboard["is_physical"].asBoolean() && is_root; LLSelectMgr::getInstance()->selectionUpdatePhysics(is_physical); if (clipboard.has("physics")) @@ -1102,7 +1099,7 @@ void LLPanelVolume::onPasteFeatures() objectp->setPhysicsFriction(clipboard["physics"]["friction"].asReal()); objectp->setPhysicsDensity(clipboard["physics"]["density"].asReal()); objectp->setPhysicsRestitution(clipboard["physics"]["restitution"].asReal()); - objectp->updateFlags(TRUE); + objectp->updateFlags(true); } // Flexible @@ -1110,7 +1107,7 @@ void LLPanelVolume::onPasteFeatures() if (is_flexible && volobjp->canBeFlexible()) { LLVOVolume *volobjp = (LLVOVolume *)objectp; - BOOL update_shape = FALSE; + bool update_shape = false; // do before setParameterEntry or it will think that it is already flexi update_shape = volobjp->setIsFlexible(is_flexible); @@ -1230,7 +1227,7 @@ void LLPanelVolume::onPasteLight() { if (clipboard.has("light")) { - volobjp->setIsLight(TRUE); + volobjp->setIsLight(true); volobjp->setLightIntensity((F32)clipboard["light"]["intensity"].asReal()); volobjp->setLightRadius((F32)clipboard["light"]["radius"].asReal()); volobjp->setLightFalloff((F32)clipboard["light"]["falloff"].asReal()); @@ -1241,7 +1238,7 @@ void LLPanelVolume::onPasteLight() } else { - volobjp->setIsLight(FALSE); + volobjp->setIsLight(false); } if (clipboard.has("spot")) @@ -1256,7 +1253,7 @@ void LLPanelVolume::onPasteLight() if (clipboard.has("reflection_probe")) { - volobjp->setIsReflectionProbe(TRUE); + volobjp->setIsReflectionProbe(true); volobjp->setReflectionProbeIsBox(clipboard["reflection_probe"]["is_box"].asBoolean()); volobjp->setReflectionProbeAmbiance((F32)clipboard["reflection_probe"]["ambiance"].asReal()); volobjp->setReflectionProbeNearClip((F32)clipboard["reflection_probe"]["near_clip"].asReal()); @@ -1272,7 +1269,7 @@ void LLPanelVolume::onPasteLight() if (in_linkeset) { // In linkset with a phantom flag - objectp->setFlags(FLAGS_PHANTOM, FALSE); + objectp->setFlags(FLAGS_PHANTOM, false); } } @@ -1408,9 +1405,9 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) else if (volobjp->isLightSpotlight()) { //no longer a spot light setLightTextureID(id, item_id, volobjp); - //self->getChildView("Light FOV")->setEnabled(FALSE); - //self->getChildView("Light Focus")->setEnabled(FALSE); - //self->getChildView("Light Ambiance")->setEnabled(FALSE); + //self->getChildView("Light FOV")->setEnabled(false); + //self->getChildView("Light Focus")->setEnabled(false); + //self->getChildView("Light Ambiance")->setEnabled(false); } } @@ -1464,7 +1461,7 @@ void LLPanelVolume::onCommitProbe(LLUICtrl* ctrl, void* userdata) path = LL_PCODE_PATH_CIRCLE; F32 scale = volobjp->getScale().mV[0]; - volobjp->setScale(LLVector3(scale, scale, scale), FALSE); + volobjp->setScale(LLVector3(scale, scale, scale), false); LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_ROTATION | UPD_POSITION | UPD_SCALE); } else @@ -1498,7 +1495,7 @@ void LLPanelVolume::setLightTextureID(const LLUUID &asset_id, const LLUUID &item if (item && volobjp->isAttachment()) { const LLPermissions& perm = item->getPermissions(); - BOOL unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? TRUE : FALSE; + bool unrestricted = (perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED; if (!unrestricted) { // Attachments are in world and in inventory simultaneously, @@ -1511,6 +1508,7 @@ void LLPanelVolume::setLightTextureID(const LLUUID &asset_id, const LLUUID &item { LLToolDragAndDrop::handleDropMaterialProtections(volobjp, item, LLToolDragAndDrop::SOURCE_AGENT, LLUUID::null); } + volobjp->setLightTextureID(asset_id); } } @@ -1568,7 +1566,7 @@ void LLPanelVolume::onCommitAnimatedMeshCheckbox(LLUICtrl *, void*) return; } LLVOVolume *volobjp = (LLVOVolume *)objectp; - BOOL animated_mesh = getChild<LLUICtrl>("Animated Mesh Checkbox Ctrl")->getValue(); + bool animated_mesh = getChild<LLUICtrl>("Animated Mesh Checkbox Ctrl")->getValue(); U32 flags = volobjp->getExtendedMeshFlags(); U32 new_flags = flags; if (animated_mesh) @@ -1627,6 +1625,6 @@ void LLPanelVolume::handleResponseChangeToFlexible(const LLSD &pNotification, co } else { - getChild<LLUICtrl>("Flexible1D Checkbox Ctrl")->setValue(FALSE); + getChild<LLUICtrl>("Flexible1D Checkbox Ctrl")->setValue(false); } } |