diff options
Diffstat (limited to 'indra/newview/lltoolplacer.cpp')
-rw-r--r-- | indra/newview/lltoolplacer.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/indra/newview/lltoolplacer.cpp b/indra/newview/lltoolplacer.cpp index 2519c57e86..b15bb5efd5 100644 --- a/indra/newview/lltoolplacer.cpp +++ b/indra/newview/lltoolplacer.cpp @@ -74,14 +74,14 @@ LLToolPlacer::LLToolPlacer() { } -BOOL LLToolPlacer::raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj, S32* hit_face, - BOOL* b_hit_land, LLVector3* ray_start_region, LLVector3* ray_end_region, LLViewerRegion** region ) +bool LLToolPlacer::raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj, S32* hit_face, + bool* b_hit_land, LLVector3* ray_start_region, LLVector3* ray_end_region, LLViewerRegion** region ) { F32 max_dist_from_camera = gSavedSettings.getF32( "MaxSelectDistance" ) - 1.f; // Viewer-side pick to find the right sim to create the object on. // First find the surface the object will be created on. - LLPickInfo pick = gViewerWindow->pickImmediate(x, y, FALSE, FALSE); + LLPickInfo pick = gViewerWindow->pickImmediate(x, y, false, false); // Note: use the frontmost non-flora version because (a) plants usually have lots of alpha and (b) pants' Havok // representations (if any) are NOT the same as their viewer representation. @@ -99,12 +99,12 @@ BOOL LLToolPlacer::raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj, LLVector3d land_pos_global = pick.mPosGlobal; // Make sure there's a surface to place the new object on. - BOOL bypass_sim_raycast = FALSE; + bool bypass_sim_raycast = false; LLVector3d surface_pos_global; if (*b_hit_land) { surface_pos_global = land_pos_global; - bypass_sim_raycast = TRUE; + bypass_sim_raycast = true; } else if (*hit_obj) @@ -113,7 +113,7 @@ BOOL LLToolPlacer::raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj, } else { - return FALSE; + return false; } // Make sure the surface isn't too far away. @@ -121,7 +121,7 @@ BOOL LLToolPlacer::raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj, F32 dist_to_surface_sq = (F32)((surface_pos_global - ray_start_global).magVecSquared()); if( dist_to_surface_sq > (max_dist_from_camera * max_dist_from_camera) ) { - return FALSE; + return false; } // Find the sim where the surface lives. @@ -129,7 +129,7 @@ BOOL LLToolPlacer::raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj, if (!regionp) { LL_WARNS() << "Trying to add object outside of all known regions!" << LL_ENDL; - return FALSE; + return false; } // Find the simulator-side ray that will be used to place the object accurately @@ -152,35 +152,35 @@ BOOL LLToolPlacer::raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj, *ray_end_region = regionp->getPosRegionFromGlobal( ray_end_global ); } - return TRUE; + return true; } -BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics ) +bool LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics ) { LLVector3 ray_start_region; LLVector3 ray_end_region; LLViewerRegion* regionp = NULL; - BOOL b_hit_land = FALSE; + bool b_hit_land = false; S32 hit_face = -1; LLViewerObject* hit_obj = NULL; U8 state = 0; - BOOL success = raycastForNewObjPos( x, y, &hit_obj, &hit_face, &b_hit_land, &ray_start_region, &ray_end_region, ®ionp ); + bool success = raycastForNewObjPos( x, y, &hit_obj, &hit_face, &b_hit_land, &ray_start_region, &ray_end_region, ®ionp ); if( !success ) { - return FALSE; + return false; } if( hit_obj && (hit_obj->isAvatar() || hit_obj->isAttachment()) ) { // Can't create objects on avatars or attachments - return FALSE; + return false; } if (NULL == regionp) { LL_WARNS() << "regionp was NULL; aborting function." << LL_ENDL; - return FALSE; + return false; } if (regionp->getRegionFlag(REGION_FLAGS_SANDBOX)) @@ -192,7 +192,7 @@ BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics ) LLQuaternion rotation; LLVector3 scale = DEFAULT_OBJECT_SCALE; U8 material = LL_MCODE_WOOD; - BOOL create_selected = FALSE; + bool create_selected = false; LLVolumeParams volume_params; switch (pcode) @@ -217,7 +217,7 @@ BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics ) case LLViewerObject::LL_VO_SQUARE_TORUS: case LLViewerObject::LL_VO_TRIANGLE_TORUS: default: - create_selected = TRUE; + create_selected = true; break; } @@ -401,7 +401,7 @@ BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics ) gMessageSystem->addVector3Fast(_PREHASH_RayStart, ray_start_region ); gMessageSystem->addVector3Fast(_PREHASH_RayEnd, ray_end_region ); gMessageSystem->addU8Fast(_PREHASH_BypassRaycast, (U8)b_hit_land ); - gMessageSystem->addU8Fast(_PREHASH_RayEndIsIntersection, (U8)FALSE ); + gMessageSystem->addU8Fast(_PREHASH_RayEndIsIntersection, (U8)false ); gMessageSystem->addU8Fast(_PREHASH_State, state); // Limit raycast to a single object. @@ -429,7 +429,7 @@ BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics ) } // VEFFECT: AddObject - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, true); effectp->setSourceObject((LLViewerObject*)gAgentAvatarp); effectp->setPositionGlobal(regionp->getPosGlobalFromRegion(ray_end_region)); effectp->setDuration(LL_HUD_DUR_SHORT); @@ -437,30 +437,30 @@ BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics ) add(LLStatViewer::OBJECT_CREATE, 1); - return TRUE; + return true; } // Used by the placer tool to add copies of the current selection. // Inspired by add_object(). JC -BOOL LLToolPlacer::addDuplicate(S32 x, S32 y) +bool LLToolPlacer::addDuplicate(S32 x, S32 y) { LLVector3 ray_start_region; LLVector3 ray_end_region; LLViewerRegion* regionp = NULL; - BOOL b_hit_land = FALSE; + bool b_hit_land = false; S32 hit_face = -1; LLViewerObject* hit_obj = NULL; - BOOL success = raycastForNewObjPos( x, y, &hit_obj, &hit_face, &b_hit_land, &ray_start_region, &ray_end_region, ®ionp ); + bool success = raycastForNewObjPos( x, y, &hit_obj, &hit_face, &b_hit_land, &ray_start_region, &ray_end_region, ®ionp ); if( !success ) { make_ui_sound("UISndInvalidOp"); - return FALSE; + return false; } if( hit_obj && (hit_obj->isAvatar() || hit_obj->isAttachment()) ) { // Can't create objects on avatars or attachments make_ui_sound("UISndInvalidOp"); - return FALSE; + return false; } @@ -480,11 +480,11 @@ BOOL LLToolPlacer::addDuplicate(S32 x, S32 y) LLSelectMgr::getInstance()->selectDuplicateOnRay(ray_start_region, ray_end_region, b_hit_land, // suppress raycast - FALSE, // intersection + false, // intersection ray_target_id, gSavedSettings.getBOOL("CreateToolCopyCenters"), gSavedSettings.getBOOL("CreateToolCopyRotates"), - FALSE); // select copy + false); // select copy if (regionp && (regionp->getRegionFlag(REGION_FLAGS_SANDBOX))) @@ -492,13 +492,13 @@ BOOL LLToolPlacer::addDuplicate(S32 x, S32 y) //LLFirstUse::useSandbox(); } - return TRUE; + return true; } -BOOL LLToolPlacer::placeObject(S32 x, S32 y, MASK mask) +bool LLToolPlacer::placeObject(S32 x, S32 y, MASK mask) { - BOOL added = TRUE; + bool added = true; if (gSavedSettings.getBOOL("CreateToolCopySelection")) { @@ -506,7 +506,7 @@ BOOL LLToolPlacer::placeObject(S32 x, S32 y, MASK mask) } else { - added = addObject( sObjectType, x, y, FALSE ); + added = addObject( sObjectType, x, y, false ); } // ...and go back to the default tool @@ -518,11 +518,11 @@ BOOL LLToolPlacer::placeObject(S32 x, S32 y, MASK mask) return added; } -BOOL LLToolPlacer::handleHover(S32 x, S32 y, MASK mask) +bool LLToolPlacer::handleHover(S32 x, S32 y, MASK mask) { LL_DEBUGS("UserInput") << "hover handled by LLToolPlacer" << LL_ENDL; gViewerWindow->setCursor(UI_CURSOR_TOOLCREATE); - return TRUE; + return true; } void LLToolPlacer::handleSelect() |