diff --git a/doc/contributions.txt b/doc/contributions.txt index 1838405ee1..6f7fd5d272 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -103,6 +103,7 @@ Aleric Inglewood STORM-864 STORM-955 STORM-960 + STORM-1793 Ales Beaumont VWR-9352 SNOW-240 @@ -610,6 +611,7 @@ Jonathan Yap STORM-1788 STORM-1799 STORM-1796 + STORM-1793 Kadah Coba STORM-1060 Jondan Lundquist @@ -1239,6 +1241,8 @@ WolfPup Lowenhar VWR-20741 VWR-20933 Wundur Primbee +Xellessanova Zenith + STORM-1793 Xiki Luik xstorm Radek YongYong Francois diff --git a/indra/lscript/lscript_library/lscript_library.cpp b/indra/lscript/lscript_library/lscript_library.cpp index 7ffe53a307..9f699a5d73 100644 --- a/indra/lscript/lscript_library/lscript_library.cpp +++ b/indra/lscript/lscript_library/lscript_library.cpp @@ -469,6 +469,47 @@ void LLScriptLibrary::init() // IF YOU ADD NEW SCRIPT CALLS, YOU MUST PUT THEM AT THE END OF THIS LIST. // Otherwise the bytecode numbers for each call will be wrong, and all // existing scripts will crash. + + // According to Kelly Linden we don't need to obey the function ID order in the viewer! + // Server v11.08.10.238207 new functions: + addFunction(10.f, 0.f, dummy_func, "llSetMemoryLimit", "i", "i"); + addFunction(10.f, 0.f, dummy_func, "llGetMemoryLimit", "i", NULL); + addFunction(10.f, 0.f, dummy_func, "llSetLinkMedia", "i", "iil"); + addFunction(10.f, 0.f, dummy_func, "llGetLinkMedia", "l", "iil"); + addFunction(10.f, 0.f, dummy_func, "llClearLinkMedia", "i", "ii"); + addFunction(10.f, 0.f, dummy_func, "llSetLinkCamera", NULL, "ivv"); + addFunction(10.f, 0.f, dummy_func, "llSetContentType", NULL, "ki"); + addFunction(10.f, 0.f, dummy_func, "llLinkSitTarget", NULL, "ivq"); + addFunction(10.f, 0.f, dummy_func, "llAvatarOnLinkSitTarget", "k", "i"); + addFunction(10.f, 0.f, dummy_func, "llSetVelocity", NULL, "vi"); + + // Server v11.09.09.240509 new functions: + addFunction(10.f, 0.f, dummy_func, "llCastRay", "l", "vvl"); + addFunction(10.f, 0.f, dummy_func, "llGetMassMKS", "f", NULL); + addFunction(10.f, 0.f, dummy_func, "llSetPhysicsMaterial", NULL, "iffff"); + addFunction(10.f, 0.f, dummy_func, "llGetPhysicsMaterial", "l", NULL); + + // Server v11.10.18.243270 new functions: + addFunction(10.f, 0.f, dummy_func, "llManageEstateAccess", "i", "ik"); + + // Server RC magnum v11.10.31.244254 new function: + addFunction(10.f, 0.f, dummy_func, "llSetKeyframedMotion", NULL, "ll"); + + // Server RC Le Tigre v11.10.30.245889 new function: + addFunction(10.f, 0.f, dummy_func, "llTransferLindenDollars", "k", "ki"); + + // Server new function 2011-12-13: + addFunction(10.f, 0.f, dummy_func, "llGetParcelMusicURL", "s", NULL); + + // Missing script functions as of 2011-12-13 + addFunction(10.f, 0.f, dummy_func, "llScriptProfiler", NULL, "i"); + addFunction(10.f, 0.f, dummy_func, "llGetSPMaxMemory", "i", NULL); + addFunction(10.f, 0.f, dummy_func, "llGetUsedMemory", "i", NULL); + addFunction(10.f, 0.f, dummy_func, "llSetAngularVelocity", NULL, "vi"); + + // Server 12.01.24.248357 new functions + addFunction(0.f, 0.f, dummy_func, "llSetRegionPos", "i", "v"); + // According to Kelly Linden we don't need to obey the function ID order in the viewer! } LLScriptLibraryFunction::LLScriptLibraryFunction(F32 eu, F32 st, void (*exec_func)(LLScriptLibData *, LLScriptLibData *, const LLUUID &), const char *name, const char *ret_type, const char *args, BOOL god_only) diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index dfe072d468..a034127d6b 100644 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -52,6 +52,9 @@ remote_data remote_data(integer event_type, key channel, key message_id, str http_response http_response(key request_id, integer status, list metadata, string body):Triggered when task receives a response to one of its llHTTPRequests http_request http_request(key id, string method, string body):Triggered when task receives an http request against a public URL +# Added manually +transaction_result transaction_result(key id, integer success, string data): Triggered when L$ is given to task + # integer constants [word .1, .1, .5] TRUE Integer constant for Boolean operations @@ -588,6 +591,64 @@ STATUS_NOT_SUPPORTED Feature not supported STATUS_INTERNAL_ERROR An internal error occurred STATUS_WHITELIST_FAILED URL failed to pass whitelist +# Manually added constants +KFM_COMMAND Option for llSetKeyframedMotion(), followed by one of KFM_CMD_STOP, KFM_CMD_PLAY, KFM_CMD_PAUSE. Note that KFM_COMMAND must be the only option in the list, and cannot be specified in the same function call that sets the keyframes list. +KFM_MODE Option for llSetKeyframedMotion(), used to specify the playback mode, followed by one of KFM_FORWARD, KFM_LOOP, KFM_PING_PONG or KFM_REVERSE. +KFM_DATA Option for llSetKeyframedMotion(), followed by a bitwise combination of KFM_TRANSLATION and KFM_ROTATION. If you specify one or the other, you should only include translations or rotations in your keyframe list. +KFM_FORWARD Option for llSetKeyframedMotion(), used after KFM_MODE to specify the forward playback mode. +KFM_LOOP Option for llSetKeyframedMotion(), used after KFM_MODE to specify the loop playback mode. +KFM_PING_PONG Option for llSetKeyframedMotion(), used after KFM_MODE to specify the ping pong playback mode. +KFM_REVERSE Option for llSetKeyframedMotion(), used after KFM_MODE to specify the reverse playback mode. +KFM_ROTATION Option for llSetKeyframedMotion(), used after KFM_DATA, possibly as a bitwise combination with KFM_TRANSLATION. +KFM_TRANSLATION Option for llSetKeyframedMotion(), used after KFM_DATA, possibly as a bitwise combination with KFM_ROTATION. +KFM_CMD_PLAY Option for llSetKeyframedMotion(), used after KFM_COMMAND to play the motion. +KFM_CMD_STOP Option for llSetKeyframedMotion(), used after KFM_COMMAND to stop the motion. +KFM_CMD_PAUSE Option for llSetKeyframedMotion(), used after KFM_COMMAND to pause the motion. + +ESTATE_ACCESS_ALLOWED_AGENT_ADD Used with llManageEstateAccess to add an agent to this estate's allowed residents list. +ESTATE_ACCESS_ALLOWED_AGENT_REMOVE Used with llManageEstateAccess to remove an agent from this estate's allowed residents list. +ESTATE_ACCESS_ALLOWED_GROUP_ADD Used with llManageEstateAccess to add a group to this estate's allowed groups list. +ESTATE_ACCESS_ALLOWED_GROUP_REMOVE Used with llManageEstateAccess to remove a group from this estate's allowed groups list. +ESTATE_ACCESS_BANNED_AGENT_ADD Used with llManageEstateAccess to add an agent to this estate's banned residents list. +ESTATE_ACCESS_BANNED_AGENT_REMOVE Used with llManageEstateAccess to remove an agent from this estate's banned residents list. + +OBJECT_PHYSICS_COST Used with llGetObjectDetails to get the physics cost. +OBJECT_PRIM_EQUIVALENCE Used with llGetObjectDetails to get the prim equivalence. +OBJECT_SERVER_COST Used with llGetObjectDetails to get the server cost. +OBJECT_STREAMING_COST Used with llGetObjectDetails to get the streaming (download) cost. + +PRIM_PHYSICS_SHAPE_TYPE For primitive physics shape type. Followed with either PRIM_PHYSICS_SHAPE_PRIM, PRIM_PHYSICS_SHAPE_NONE or PRIM_PHYSICS_SHAPE_CONVEX. +PRIM_PHYSICS_SHAPE_PRIM Use the normal prim shape for physics (this is the default for all non-mesh objects) +PRIM_PHYSICS_SHAPE_NONE Use the convex hull of the prim shape for physics (this is the default for mesh objects) +PRIM_PHYSICS_SHAPE_CONVEX Ignore this prim in the physics shape. This cannot be applied to the root prim. + +DENSITY For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the density. +FRICTION For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the friction. +RESTITUTION For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the restitution. +GRAVITY_MULTIPLIER For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the gravity multiplier. + +PROFILE_SCRIPT_NONE Disables memory profiling when passed to llScriptProfiler() +PROFILE_SCRIPT_MEMORY Enables memory profiling when passed to llScriptProfiler() + +RCERR_UNKNOWN Returned by llCastRay() when the raycast failed for an unspecified reason. +RCERR_SIM_PERF_LOW Returned by llCastRay() when the raycast failed because simulator performance is low. +RCERR_CAST_TIME_EXCEEDED Returned by llCastRay() when the raycast failed because the parcel or agent has exceeded the maximum time allowed for raycasting. + +RC_REJECT_TYPES Option for llCastRay() used to ignore specific types of objects, followed with a bitwise combination of RC_REJECT_AGENTS, RC_REJECT_PHYSICAL, RC_REJECT_NONPHYSICAL and RC_REJECT_LAND. +RC_DETECT_PHANTOM Option for llCastRay() followed with TRUE to detect phantom AND volume detect objects, FASLE otherwise. +RC_DATA_FLAGS Option for llCastRay() followed with a bitwise combination of RC_GET_NORMAL, RC_GET_ROOT_KEY and RC_GET_LINK_NUM. +RC_MAX_HITS Option for llCastRay() followed with an integer specifying the maximum number of hits to return (must be <= 256). + +RC_REJECT_AGENTS Flag used in the RC_REJECT_TYPES mask to reject agents in llCastRay(). +RC_REJECT_PHYSICAL Flag used in the RC_REJECT_TYPES mask to reject physical objects in llCastRay(). +RC_REJECT_NONPHYSICAL Flag used in the RC_REJECT_TYPES mask to reject non-physical objects in llCastRay(). +RC_REJECT_LAND Flag used in the RC_REJECT_TYPES mask to reject land in llCastRay(). + +RC_GET_NORMAL Flag used in the RC_DATA_FLAGS mask to get hit normals in llCastRay() results. +RC_GET_ROOT_KEY Flag used in the RC_DATA_FLAGS mask to get root keys in llCastRay() results. +RC_GET_LINK_NUM Flag used in the RC_DATA_FLAGS mask to get link numbers in llCastRay() results. +# Manually added constants + # string constants [word .1, .3, .5] NULL_KEY Indicates an empty key diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 503d03e748..ddeaa6e3d7 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3661,6 +3661,15 @@ void LLAppViewer::requestQuit() { sendLogoutRequest(); } + else if(LLStartUp::getStartupState() == STATE_STARTED) // LO: Fix for FIRE-2613: sidebar tabs and floaters not remembering being open/torn off + { + if (gFloaterView) + { + // application is quitting + gFloaterView->closeAllChildren(true); + } + + } // ~LO // Quit immediately forceQuit(); @@ -4154,6 +4163,12 @@ bool finish_disconnect(const LLSD& notification, const LLSD& response) if (1 == option) { + if (gFloaterView) + { + // application is quitting + gFloaterView->closeAllChildren(true); + } + LLAppViewer::instance()->forceQuit(); } return false; @@ -4162,6 +4177,12 @@ bool finish_disconnect(const LLSD& notification, const LLSD& response) // Callback from an early disconnect dialog, force an exit bool finish_forced_disconnect(const LLSD& notification, const LLSD& response) { + if (gFloaterView) + { + // application is quitting + gFloaterView->closeAllChildren(true); + } + LLAppViewer::instance()->forceQuit(); return false; } diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 79478647d6..672b36719e 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1093,17 +1093,19 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat bool LLMeshRepoThread::lodReceived(const LLVolumeParams& mesh_params, S32 lod, U8* data, S32 data_size) { - LLVolume* volume = new LLVolume(mesh_params, LLVolumeLODGroup::getVolumeScaleFromDetail(lod)); + LLPointer volume = new LLVolume(mesh_params, LLVolumeLODGroup::getVolumeScaleFromDetail(lod)); std::string mesh_string((char*) data, data_size); std::istringstream stream(mesh_string); if (volume->unpackVolumeFaces(stream, data_size)) { - LoadedMesh mesh(volume, mesh_params, lod); if (volume->getNumFaces() > 0) { - LLMutexLock lock(mMutex); - mLoadedQ.push(mesh); + LoadedMesh mesh(volume, mesh_params, lod); + { + LLMutexLock lock(mMutex); + mLoadedQ.push(mesh); + } return true; } } diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 5ef39cb641..2eea4afca6 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -90,6 +90,8 @@ const F32 DOT_SCALE = 0.75f; const F32 MIN_PICK_SCALE = 2.f; const S32 MOUSE_DRAG_SLOP = 2; // How far the mouse needs to move before we think it's a drag +const F64 COARSEUPDATE_MAX_Z = 1020.0f; + const F32 WIDTH_PIXELS = 2.f; const S32 CIRCLE_STEPS = 100; @@ -342,7 +344,8 @@ void LLNetMap::draw() } LLVector3 map_center_agent = gAgent.getPosAgentFromGlobal(mObjectImageCenterGlobal); - map_center_agent -= gAgentCamera.getCameraPositionAgent(); + LLVector3 camera_position = gAgentCamera.getCameraPositionAgent(); + map_center_agent -= camera_position; map_center_agent.mV[VX] *= mScale/region_width; map_center_agent.mV[VY] *= mScale/region_width; @@ -363,9 +366,6 @@ void LLNetMap::draw() gGL.popMatrix(); - LLVector3d pos_global; - LLVector3 pos_map; - // Mouse pointer in local coordinates S32 local_mouse_x; S32 local_mouse_y; @@ -375,143 +375,109 @@ void LLNetMap::draw() F32 closest_dist_squared = F32_MAX; // value will be overridden in the loop F32 min_pick_dist_squared = (mDotRadius * MIN_PICK_SCALE) * (mDotRadius * MIN_PICK_SCALE); + LLVector3 pos_map; + uuid_vec_t avatar_ids; + std::vector positions; + bool unknown_relative_z; + + LLWorld::getInstance()->getAvatars(&avatar_ids, &positions, gAgentCamera.getCameraPositionGlobal()); + // Draw avatars - for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); - iter != LLWorld::getInstance()->getRegionList().end(); ++iter) + for (U32 i = 0; i < avatar_ids.size(); i++) { - LLViewerRegion* regionp = *iter; - const LLVector3d& origin_global = regionp->getOriginGlobal(); + //pos_map = globalPosToView(positions[i]); // Do this later after advanced height check + LLUUID uuid = avatar_ids[i]; - S32 count = regionp->mMapAvatars.count(); - S32 i; - LLVector3 pos_local; - U32 compact_local; - U8 bits; - // TODO: it'd be very cool to draw these in sorted order from lowest Z to highest. - // just be careful to sort the avatar IDs along with the positions. -MG - for (i = 0; i < count; i++) - { - compact_local = regionp->mMapAvatars.get(i); - - bits = compact_local & 0xFF; - pos_local.mV[VZ] = F32(bits) * 4.f; - compact_local >>= 8; - - bits = compact_local & 0xFF; - pos_local.mV[VY] = (F32)bits; - compact_local >>= 8; - - bits = compact_local & 0xFF; - pos_local.mV[VX] = (F32)bits; - - // Ansariel: Moved further down - //pos_global.setVec( pos_local ); - //pos_global += origin_global; - - //pos_map = globalPosToView(pos_global); - // END Ansariel: Moved further down - - LLUUID uuid(NULL); - BOOL show_as_friend = FALSE; - if( i < regionp->mMapAvatarIDs.count()) - { - uuid = regionp->mMapAvatarIDs.get(i); -// show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL); +// bool show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL); // [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f - show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL) && - (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); + bool show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL) && + (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); // [/RLVa:KB] - } - LLColor4 color = show_as_friend ? map_avatar_friend_color : map_avatar_color; + LLColor4 color = show_as_friend ? map_avatar_friend_color : map_avatar_color; - // Ansariel: Colorize and make use of avatar viewer objects - // for improved height indication - bool isHeightUnknown = (pos_local.mV[VZ] == 0.f); - if (uuid.notNull()) + // Also check for legacy unknown height reported as height = 0m + //unknown_relative_z = positions[i].mdV[VZ] == COARSEUPDATE_MAX_Z && + // camera_position.mV[VZ] >= COARSEUPDATE_MAX_Z; + unknown_relative_z = (positions[i].mdV[VZ] == COARSEUPDATE_MAX_Z && + camera_position.mV[VZ] >= COARSEUPDATE_MAX_Z) || (positions[i].mdV[VZ] == 0.f); + // + + // Colorize muted avatars and Lindens + std::string fullName; + LLMuteList* muteListInstance = LLMuteList::getInstance(); + + if (muteListInstance->isMuted(uuid)) color = map_avatar_muted_color; + else if (gCacheName->getFullName(uuid, fullName) && muteListInstance->isLinden(fullName)) color = map_avatar_linden_color; + + // Try to workaround 1020m bug by using + // the viewer object for the avatar. + if (unknown_relative_z) + { + LLViewerObject* viewerObject = gObjectList.findObject(uuid); + if (viewerObject) { - // Colorize muted avatars and Lindens - std::string fullName; - LLMuteList* muteListInstance = LLMuteList::getInstance(); + positions[i].mdV[VZ] = viewerObject->getPositionGlobal().mdV[VZ]; + unknown_relative_z = false; + } + } + pos_map = globalPosToView(positions[i]); - if (muteListInstance->isMuted(uuid)) color = map_avatar_muted_color; - else if (gCacheName->getFullName(uuid, fullName) && muteListInstance->isLinden(fullName)) color = map_avatar_linden_color; - - // Try to workaround 1020m bug by using - // the viewer object for the avatar. - if (isHeightUnknown) - { - LLViewerObject* viewerObject = gObjectList.findObject(uuid); - if (viewerObject) - { - pos_local.mV[VZ] = viewerObject->getPositionGlobal().mdV[VZ]; - isHeightUnknown = false; - } - } - - // Mark Avatars with special colors - Ansariel - if (LLNetMap::sAvatarMarksMap.find(uuid) != LLNetMap::sAvatarMarksMap.end()) - { - color = LLNetMap::sAvatarMarksMap[uuid]; - } + // Mark Avatars with special colors - Ansariel + if (LLNetMap::sAvatarMarksMap.find(uuid) != LLNetMap::sAvatarMarksMap.end()) + { + color = LLNetMap::sAvatarMarksMap[uuid]; + } - //color based on contact sets prefs - if(LGGContactSets::getInstance()->hasFriendColorThatShouldShow(uuid,FALSE,FALSE,FALSE,TRUE)) - { - color = LGGContactSets::getInstance()->getFriendColor(uuid); - } - } + //color based on contact sets prefs + if(LGGContactSets::getInstance()->hasFriendColorThatShouldShow(uuid,FALSE,FALSE,FALSE,TRUE)) + { + color = LGGContactSets::getInstance()->getFriendColor(uuid); + } - // Ansariel: Moved down here so we can take precise - // height data into account - pos_global.setVec( pos_local ); - pos_global += origin_global; - pos_map = globalPosToView(pos_global); + LLWorldMapView::drawAvatar( + pos_map.mV[VX], pos_map.mV[VY], + color, + pos_map.mV[VZ], mDotRadius, + unknown_relative_z); - LLWorldMapView::drawAvatar( - pos_map.mV[VX], pos_map.mV[VY], - color, - pos_map.mV[VZ], mDotRadius, - isHeightUnknown); - - if(uuid.notNull()) + if(uuid.notNull()) + { + bool selected = false; + uuid_vec_t::iterator sel_iter = gmSelected.begin(); + for (; sel_iter != gmSelected.end(); sel_iter++) { - bool selected = false; - uuid_vec_t::iterator sel_iter = gmSelected.begin(); - for (; sel_iter != gmSelected.end(); sel_iter++) + if(*sel_iter == uuid) { - if(*sel_iter == uuid) - { - selected = true; - break; - } - } - if(selected) - { - if( (pos_map.mV[VX] < 0) || - (pos_map.mV[VY] < 0) || - (pos_map.mV[VX] >= getRect().getWidth()) || - (pos_map.mV[VY] >= getRect().getHeight()) ) - { - S32 x = llround( pos_map.mV[VX] ); - S32 y = llround( pos_map.mV[VY] ); - LLWorldMapView::drawTrackingCircle( getRect(), x, y, color, 1, 10); - } else - { - LLWorldMapView::drawTrackingDot(pos_map.mV[VX],pos_map.mV[VY],color,0.f); - } + selected = true; + break; } } - - F32 dist_to_cursor_squared = dist_vec_squared(LLVector2(pos_map.mV[VX], pos_map.mV[VY]), - LLVector2(local_mouse_x,local_mouse_y)); - if(dist_to_cursor_squared < min_pick_dist_squared && dist_to_cursor_squared < closest_dist_squared) + if(selected) { - closest_dist_squared = dist_to_cursor_squared; - mClosestAgentToCursor = regionp->mMapAvatarIDs.get(i); - mClosestAgentPosition = pos_global; + if( (pos_map.mV[VX] < 0) || + (pos_map.mV[VY] < 0) || + (pos_map.mV[VX] >= getRect().getWidth()) || + (pos_map.mV[VY] >= getRect().getHeight()) ) + { + S32 x = llround( pos_map.mV[VX] ); + S32 y = llround( pos_map.mV[VY] ); + LLWorldMapView::drawTrackingCircle( getRect(), x, y, color, 1, 10); + } else + { + LLWorldMapView::drawTrackingDot(pos_map.mV[VX],pos_map.mV[VY],color,0.f); + } } } + + F32 dist_to_cursor_squared = dist_vec_squared(LLVector2(pos_map.mV[VX], pos_map.mV[VY]), + LLVector2(local_mouse_x,local_mouse_y)); + if(dist_to_cursor_squared < min_pick_dist_squared && dist_to_cursor_squared < closest_dist_squared) + { + closest_dist_squared = dist_to_cursor_squared; + mClosestAgentToCursor = uuid; + mClosestAgentPosition = positions[i]; + } } // Draw dot for autopilot target @@ -534,7 +500,7 @@ void LLNetMap::draw() } // Draw dot for self avatar position - pos_global = gAgent.getPositionGlobal(); + LLVector3d pos_global = gAgent.getPositionGlobal(); pos_map = globalPosToView(pos_global); S32 dot_width = llround(mDotRadius * 2.f); LLUIImagePtr you = LLWorldMapView::sAvatarYouLargeImage; @@ -617,9 +583,11 @@ void LLNetMap::reshape(S32 width, S32 height, BOOL called_from_parent) createObjectImage(); } -LLVector3 LLNetMap::globalPosToView( const LLVector3d& global_pos ) +LLVector3 LLNetMap::globalPosToView(const LLVector3d& global_pos) { - LLVector3d relative_pos_global = global_pos - gAgentCamera.getCameraPositionGlobal(); + LLVector3d camera_position = gAgentCamera.getCameraPositionGlobal(); + + LLVector3d relative_pos_global = global_pos - camera_position; LLVector3 pos_local; pos_local.setVec(relative_pos_global); // convert to floats from doubles @@ -657,7 +625,7 @@ void LLNetMap::drawRing(const F32 radius, const LLVector3 pos_map, const LLUICol void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color, BOOL draw_arrow ) { - LLVector3 pos_local = globalPosToView( pos_global ); + LLVector3 pos_local = globalPosToView(pos_global); if( (pos_local.mV[VX] < 0) || (pos_local.mV[VY] < 0) || (pos_local.mV[VX] >= getRect().getWidth()) || @@ -815,8 +783,8 @@ BOOL LLNetMap::handleToolTipAgent(const LLUUID& avatar_id) LLVector3d delta = otherPosition - myPosition; F32 distance = (F32)delta.magVec(); - // If avatar is >1020, the value for Z is returned as 0 - bool isHigher1020mBug = (otherPosition[VZ] == 0.0); + // If avatar is >1020, the value for Z is returned as 0 (legacy) or 1020 (new) + bool isHigher1020mBug = (otherPosition[VZ] == COARSEUPDATE_MAX_Z || otherPosition[VZ] == 0.0); // Ansariel: Try to get distance from the nearby people panel // aka radar. This usually contains better data, @@ -827,11 +795,13 @@ BOOL LLNetMap::handleToolTipAgent(const LLUUID& avatar_id) LLAvatarListItem* avatar_list_item = ((LLPanelPeople*)panel_people)->getNearbyList()->getAvatarListItem(avatar_id); if (avatar_list_item != NULL) { - distance = avatar_list_item->getRange(); + F32 radar_distance = avatar_list_item->getRange(); - // If avatar is >1020m and no viewer object exists, - // it is beyond far clip, so the distance value is wrong! - isHigher1020mBug = (isHigher1020mBug && gObjectList.findObject(avatar_id) == NULL); + if (isHigher1020mBug && radar_distance > -1.f) + { + distance = radar_distance; + isHigher1020mBug = false; + } } } diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index d967ae3411..7b24705d83 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -983,7 +983,7 @@ void LLPanelPeople::updateNearbyList() av->setAvatarName(avName); // maintain compatibility with underlying list, deprecated U32 lastZOffsetTime = av->getLastZOffsetTime(); F32 avZOffset = av->getZOffset(); - if (avPos[VZ] < 0.1) // if our official z position is 0.0, we need a correction. + if (avPos[VZ] < 0.1 || avPos[VZ] == 1020.f) // if our official z position is 0.0 (legacy) or 1020 (new), we need a correction. { // set correction if we have it if (avZOffset > 0.1) diff --git a/indra/newview/llsidetraytab.h b/indra/newview/llsidetraytab.h index 0a92f75946..d2e03f6f5e 100644 --- a/indra/newview/llsidetraytab.h +++ b/indra/newview/llsidetraytab.h @@ -66,7 +66,7 @@ public: protected: LLSideTrayTab(const Params& params); - void dock(LLFloater* floater_tab); + void dock(bool app_quitting, LLFloater* floater_tab); // LO: Fix for FIRE-2613: sidebar tabs and floaters not remembering being open/torn off void undock(LLFloater* floater_tab); LLSideTray* getSideTray(); @@ -87,7 +87,7 @@ public: const std::string& getTabTitle() const { return mTabTitle;} void onOpen (const LLSD& key); - void toggleTabDocked(bool toggle_floater = true); + void toggleTabDocked(bool app_quitting = false, bool toggle_floater = true); // LO: Fix for FIRE-2613: sidebar tabs and floaters not remembering being open/torn off void setDocked(bool dock); bool isDocked() const; void minimizeTab(); diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 0c506f16a3..4a1c9756ca 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -1210,34 +1210,13 @@ void send_agent_resume() LLVector3d unpackLocalToGlobalPosition(U32 compact_local, const LLVector3d& region_origin) // [/SL:KB] { - // Ansariel: The old way of unpacking does not work properly and - // sometimes wrong values. - /* - LLVector3d pos_global; - LLVector3 pos_local; - U8 bits; + LLVector3d pos_local; - bits = compact_local & 0xFF; - pos_local.mV[VZ] = F32(bits) * 4.f; - compact_local >>= 8; + pos_local.mdV[VZ] = (compact_local & 0xFFU) * 4; + pos_local.mdV[VY] = (compact_local >> 8) & 0xFFU; + pos_local.mdV[VX] = (compact_local >> 16) & 0xFFU; - bits = compact_local & 0xFF; - pos_local.mV[VY] = (F32)bits; - compact_local >>= 8; - - bits = compact_local & 0xFF; - pos_local.mV[VX] = (F32)bits; - - pos_global.setVec( pos_local ); - pos_global += region_origin; - return pos_global; - */ - - LLVector3d pos_global(region_origin); - pos_global.mdV[VZ] += F64(compact_local & 0xFF) * 4.f; - pos_global.mdV[VY] += F64((compact_local >> 8) & 0xFF); - pos_global.mdV[VX] += F64((compact_local >> 16) & 0xFF); - return pos_global; + return region_origin + pos_local; } void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector* positions, const LLVector3d& relative_to, F32 radius) const @@ -1258,24 +1237,17 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector* positi iter != LLCharacter::sInstances.end(); ++iter) { LLVOAvatar* pVOAvatar = (LLVOAvatar*) *iter; - if(!pVOAvatar->isDead() && !pVOAvatar->isSelf()) + LLVector3d pos_global = pVOAvatar->getPositionGlobal(); + LLUUID uuid = pVOAvatar->getID(); + if( !pVOAvatar->isDead() && + !pVOAvatar->isSelf() && + !uuid.isNull() && + dist_vec_squared(pos_global, relative_to) <= radius_squared && + positions != NULL && + avatar_ids != NULL) { - LLUUID uuid = pVOAvatar->getID(); - if(!uuid.isNull()) - { - LLVector3d pos_global = pVOAvatar->getPositionGlobal(); - if(dist_vec_squared(pos_global, relative_to) <= radius_squared) - { - if(positions != NULL) - { - positions->push_back(pos_global); - } - if(avatar_ids !=NULL) - { - avatar_ids->push_back(uuid); - } - } - } + positions->push_back(pos_global); + avatar_ids->push_back(uuid); } } // region avatars added for situations where radius is greater than RenderFarClip @@ -1292,13 +1264,13 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector* positi { LLUUID uuid = regionp->mMapAvatarIDs.get(i); // if this avatar doesn't already exist in the list, add it - if(uuid.notNull() && avatar_ids!=NULL && std::find(avatar_ids->begin(), avatar_ids->end(), uuid) == avatar_ids->end()) + if(uuid.notNull() && avatar_ids != NULL && std::find(avatar_ids->begin(), avatar_ids->end(), uuid) == avatar_ids->end()) { if(positions != NULL) { positions->push_back(pos_global); + avatar_ids->push_back(uuid); } - avatar_ids->push_back(uuid); } } } diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index c3f9c19291..9b50d76e44 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -80,7 +80,7 @@ LLUIImagePtr LLWorldMapView::sAvatarYouLargeImage = NULL; LLUIImagePtr LLWorldMapView::sAvatarLevelImage = NULL; LLUIImagePtr LLWorldMapView::sAvatarAboveImage = NULL; LLUIImagePtr LLWorldMapView::sAvatarBelowImage = NULL; -LLUIImagePtr LLWorldMapView::sAvatarHeightUnknownImage = NULL; +LLUIImagePtr LLWorldMapView::sAvatarUnknownImage = NULL; LLUIImagePtr LLWorldMapView::sTelehubImage = NULL; LLUIImagePtr LLWorldMapView::sInfohubImage = NULL; @@ -125,7 +125,9 @@ void LLWorldMapView::initClass() sAvatarLevelImage = LLUI::getUIImage("map_avatar_32.tga"); sAvatarAboveImage = LLUI::getUIImage("map_avatar_above_32.tga"); sAvatarBelowImage = LLUI::getUIImage("map_avatar_below_32.tga"); - sAvatarHeightUnknownImage = LLUI::getUIImage("map_avatar_unknown.tga"); + // Use our own, established indicator + //sAvatarUnknownImage = LLUI::getUIImage("map_avatar_unknown_32.tga"); + sAvatarUnknownImage = LLUI::getUIImage("map_avatar_unknown.tga"); sHomeImage = LLUI::getUIImage("map_home.tga"); sTelehubImage = LLUI::getUIImage("map_telehub.tga"); @@ -158,7 +160,7 @@ void LLWorldMapView::cleanupClass() sAvatarLevelImage = NULL; sAvatarAboveImage = NULL; sAvatarBelowImage = NULL; - sAvatarHeightUnknownImage = NULL; + sAvatarUnknownImage = NULL; sTelehubImage = NULL; sInfohubImage = NULL; @@ -1215,23 +1217,26 @@ void LLWorldMapView::drawAvatar(F32 x_pixels, const LLColor4& color, F32 relative_z, F32 dot_radius, - bool heightUnknown) // Ansariel: For drawing unknown height indicator + bool unknown_relative_z) { const F32 HEIGHT_THRESHOLD = 7.f; LLUIImagePtr dot_image = sAvatarLevelImage; // Ansariel: If height is unknown, draw our special icon - if (heightUnknown) + if (unknown_relative_z) { - dot_image = sAvatarHeightUnknownImage; + dot_image = sAvatarUnknownImage; } - else if(relative_z < -HEIGHT_THRESHOLD) + else { - dot_image = sAvatarBelowImage; - } - else if(relative_z > HEIGHT_THRESHOLD) - { - dot_image = sAvatarAboveImage; + if(relative_z < -HEIGHT_THRESHOLD) + { + dot_image = sAvatarBelowImage; + } + else if(relative_z > HEIGHT_THRESHOLD) + { + dot_image = sAvatarAboveImage; + } } S32 dot_width = llround(dot_radius * 2.f); dot_image->draw(llround(x_pixels - dot_radius), diff --git a/indra/newview/llworldmapview.h b/indra/newview/llworldmapview.h index a10b8b42d2..a2a6dc53fb 100644 --- a/indra/newview/llworldmapview.h +++ b/indra/newview/llworldmapview.h @@ -113,7 +113,7 @@ public: const LLColor4& color, F32 relative_z = 0.f, F32 dot_radius = 3.f, - bool heightUnknown = false); // Ansariel: For drawing unknown height indicator + bool reached_max_z = false); static void drawIconName(F32 x_pixels, F32 y_pixels, const LLColor4& color, @@ -139,7 +139,7 @@ public: static LLUIImagePtr sAvatarLevelImage; static LLUIImagePtr sAvatarAboveImage; static LLUIImagePtr sAvatarBelowImage; - static LLUIImagePtr sAvatarHeightUnknownImage; + static LLUIImagePtr sAvatarUnknownImage; static LLUIImagePtr sTelehubImage; static LLUIImagePtr sInfohubImage; diff --git a/indra/newview/particleeditor.cpp b/indra/newview/particleeditor.cpp index ae46351466..ec715a1435 100644 --- a/indra/newview/particleeditor.cpp +++ b/indra/newview/particleeditor.cpp @@ -240,7 +240,8 @@ void ParticleEditor::onParameterChange() if(mTexture->getID()==IMG_DEFAULT || mTexture->getID().isNull()) mTexture=mDefaultParticleTexture; - mParticles.mBurstRate=mBurstRateSpinner->getValueF32(); + // limit burst rate to 0.01 to avoid internal freeze, script still gets the real value + mParticles.mBurstRate=llmax(0.01f,mBurstRateSpinner->getValueF32()); mParticles.mBurstPartCount=mBurstCountSpinner->getValue().asInteger(); mParticles.mBurstRadius=mBurstRadiusSpinner->getValueF32(); mParticles.mInnerAngle=mAngleBeginSpinner->getValueF32(); diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 34367b058d..37c4e5e28f 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -1955,6 +1955,135 @@ llGetEnv(string name) Returns a string with the requested data about the region + + +integer llSetMemoryLimit(integer limit) +Request limit bytes to be reserved for this script. +Returns a success/failure flag (STATUS_OK when sucessful, another of the STATUS_* flags on failure) for whether the memory limit was set. +Only relevant for Mono-compiled scripts. + + +integer llGetUsedMemory() +Get the maximum memory a script can use. +Returns the integer amount of memory the script can use in bytes. + + +integer llSetLinkMedia(integer link, integer face, list params) +Set the media params for a particular face on the 'link'ed prim without a delay. +Returns an integer that is flag (STATUS_OK when sucessful, another of the STATUS_* flags on failure) which details the success/failure of the operation(s). +Takes the same parameters as llSetPrimMediaParams() + + +list llGetLinkMedia(integer link, integer face, list params) +Get the media params for a particular face on a 'link'ed prim(s), given the desired list of named params. +Returns a list of values in the order requested (empty list if no media exists on the face). +Takes the same parameters as llGetPrimMediaParams() + + +integer llClearLinkMedia(integer link, integer face) +Clears (deletes) the media and all params from the given face on the linked prim(s). +Returns an integer that is flag (STATUS_OK when sucessful, another of the STATUS_* flags on failure) which details the success/failure of the operation(s). + + +llSetLinkCamera(integer link, vector eye, vector at) +Sets the camera eye offset, and the offset that camera is looking at, for avatars that sit on the linked prim. +The two vector parameters are offsets relative to the object's center and expressed in local coordinates. + + +llSetContentType(key request_id, integer content_type) +Set the Internet media type of an LSL HTTP server response. +content_type may be one of CONTENT_TYPE_TEXT (default) "text/plain", or CONTENT_TYPE_HTML "text/html", only valid for embedded browsers on content owned by the person viewing. Falls back to "text/plain" otherwise. + + +llLinkSitTarget(integer link, vector offset, rotation rot) +Set the sit location for the 'link'ed prim(s). The sit location is relative to the prim's position and rotation. +Equivalent to calling llSitTarget on link prim(s) in the link set. + + +key llAvatarOnLinkSitTarget(integer link) +Returns a key that is the UUID of the user seated on the 'link'ed prim. +Equivalent to calling llAvatarOnSitTarget on link prim in the link set. + + +llSetVelocity(vector force, integer local) +Applies velocity with 'force' to object and 'local' a boolean (if TRUE, force is treated as a local directional vector instead of region directional vector). + + +llSetAngularVelocity(vector force, integer local) +Applies rotational velocity with 'force' to object and 'local' a boolean (if TRUE uses local axis, if FALSE uses region axis). + + +list llCastRay(vector start, vector end, list options) +Cast a ray from start to end and report collision data for intersections with objects. + + +float llGetMassMKS() +Returns a float that is the mass in kilograms of the object the script is attached to. + + +llSetPhysicsMaterial(integer material_bits, float gravity_multiplier, float restitution, float friction, float density) +Sets the physics properties of the object the script is attached to. +material_bits is a bitwise combination of DENSITY, FRICTION, RESTITUTION and GRAVITY_MULTIPLIER, specifying which floats to actually apply. + + +list llGetPhysicsMaterial() +Returns a list of the object physics properties: [ float gravity_multiplier, float restitution, float friction, float density ] + + +integer llManageEstateAccess(integer action, key id) +To add or remove agents from the estate's agent access or ban lists or groups from the estate's group access list. +Only works for objects owned by the Estate Owner or an Estate Manager. +Returns TRUE if successful and FALSE if throttled, on invalid action, on invalid or null id, or if object owner is not allowed to manage the estate. +'action' can be any of: ESTATE_ACCESS_ALLOWED_[AGENT/GROUP]_[ADD/REMOVE] or ESTATE_ACCESS_BANNED_AGENT_[ADD/REMOVE] + + +llSetKeyframedMotion(list keyframes, list options) +Specify a list of times, positions, and orientations to be followed by an object. +The object will be smoothly moved between keyframes by the simulator. +list keyframes: strided keyframe list of the form: +- vector position (optional via KFM_TRANSLATION and KFM_DATA) +- rotation orientation (optional via KFM_ROTATION and KFM_DATA) +- float time +list options: modifiers among: +- KFM_COMMAND followed by one of KFM_CMD_PLAY, KFM_CMD_STOP, KFM_CMD_PAUSE. +- KFM_MODE followed by one of KFM_FORWARD, KFM_LOOP, KFM_PING_PONG, KFM_REVERSE. +- KFM_DATA followed by KFM_ROTATION or KFM_TRANSLATION. +Note that if KFM_COMMAND is provided in the options list, it must be the only option in the list, and cannot be specified in the same function call that sets the keyframes list. + + +key llTransferLindenDollars(key id, integer amount) +Attempt to transfer amount of L$ from the owner of the object to 'id'. Requires PERMISSION_DEBIT. +Returns a key used in a matching transaction_result() event for the success or failure of the transfer. + + +string llGetParcelMusicURL() +Returns the music URL of the object's current parcel if the script owner also owns the parcel. + + +llScriptProfiler(integer flags) +Enables or disables the scripts profiling state. +Flags can be either of PROFILE_SCRIPT_NONE or PROFILE_SCRIPT_MEMORY. +Applies to Mono-compiled scripts only. + + +integer llGetSPMaxMemory() +Returns the integer of the most bytes used while llScriptProfiler() was last active. +Only relevant for Mono-compiled scripts. + + +integer llGetUsedMemory() +Returns the integer of the number of bytes of memory currently in use by the script. +Only relevant for Mono-compiled scripts. + + +llSetAngularVelocity(vector force, integer local) +Applies rotational velocity to object. + + +integer llSetRegionPos(vector position) +Tries to moves the entire object so that the root prim is within 0.1m of position. + + Not Away