summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r--indra/newview/llviewermessage.cpp83
1 files changed, 42 insertions, 41 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 0bfcfe1720..1901c6e959 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -51,6 +51,7 @@
#include "mean_collision_data.h"
#include "llagent.h"
+#include "llagentcamera.h"
#include "llcallingcard.h"
//#include "llfirstuse.h"
#include "llfloaterbuycurrency.h"
@@ -869,9 +870,9 @@ bool check_offer_throttle(const std::string& from_name, bool check_only)
}
}
-void open_inventory_offer(const std::vector<LLUUID>& items, const std::string& from_name)
+void open_inventory_offer(const uuid_vec_t& items, const std::string& from_name)
{
- for (std::vector<LLUUID>::const_iterator item_iter = items.begin();
+ for (uuid_vec_t::const_iterator item_iter = items.begin();
item_iter != items.end();
++item_iter)
{
@@ -1262,8 +1263,8 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
// Disabled logging to old chat floater to fix crash in group notices - EXT-4149
// LLFloaterChat::addChatHistory(chat);
- LLInventoryFetchComboObserver::folder_ref_t folders;
- LLInventoryFetchComboObserver::item_ref_t items;
+ uuid_vec_t folders;
+ uuid_vec_t items;
items.push_back(mObjectID);
LLDiscardAgentOffer* discard_agent_offer;
discard_agent_offer = new LLDiscardAgentOffer(mFolderID, mObjectID);
@@ -2843,8 +2844,8 @@ public:
LLInventoryModel::cat_array_t land_cats;
LLInventoryModel::item_array_t land_items;
- folder_ref_t::iterator it = mCompleteFolders.begin();
- folder_ref_t::iterator end = mCompleteFolders.end();
+ uuid_vec_t::iterator it = mCompleteFolders.begin();
+ uuid_vec_t::iterator end = mCompleteFolders.end();
for(; it != end; ++it)
{
gInventory.collectDescendentsIf(
@@ -2905,7 +2906,7 @@ BOOL LLPostTeleportNotifiers::tick()
if ( gAgent.getTeleportState() == LLAgent::TELEPORT_NONE )
{
// get callingcards and landmarks available to the user arriving.
- LLInventoryFetchDescendentsObserver::folder_ref_t folders;
+ uuid_vec_t folders;
const LLUUID callingcard_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD);
if(callingcard_id.notNull())
folders.push_back(callingcard_id);
@@ -2945,6 +2946,9 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
LL_WARNS("Messaging") << "Got teleport notification for wrong agent!" << LL_ENDL;
return;
}
+
+ // Teleport is finished; it can't be cancelled now.
+ gViewerWindow->setProgressCancelButtonVisible(FALSE);
// Do teleport effect for where you're leaving
// VEFFECT: TeleportStart
@@ -2990,18 +2994,18 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
/*
// send camera update to new region
- gAgent.updateCamera();
+ gAgentCamera.updateCamera();
// likewise make sure the camera is behind the avatar
- gAgent.resetView(TRUE);
+ gAgentCamera.resetView(TRUE);
LLVector3 shift_vector = regionp->getPosRegionFromGlobal(gAgent.getRegion()->getOriginGlobal());
gAgent.setRegion(regionp);
gObjectList.shiftObjects(shift_vector);
- if (gAgent.getAvatarObject())
+ if (isAgentAvatarValid())
{
- gAgent.getAvatarObject()->clearChatText();
- gAgent.slamLookAt(look_at);
+ gAgentAvatarp->clearChatText();
+ gAgentCamera.slamLookAt(look_at);
}
gAgent.setPositionAgent(pos);
gAssetStorage->setUpstream(sim);
@@ -3080,8 +3084,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
std::string version_channel;
msg->getString("SimData", "ChannelVersion", version_channel);
- LLVOAvatar* avatarp = gAgent.getAvatarObject();
- if (!avatarp)
+ if (!isAgentAvatarValid())
{
// Could happen if you were immediately god-teleported away on login,
// maybe other cases. Continue, but warn.
@@ -3125,9 +3128,9 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
if( is_teleport )
{
// Force the camera back onto the agent, don't animate.
- gAgent.setFocusOnAvatar(TRUE, FALSE);
- gAgent.slamLookAt(look_at);
- gAgent.updateCamera();
+ gAgentCamera.setFocusOnAvatar(TRUE, FALSE);
+ gAgentCamera.slamLookAt(look_at);
+ gAgentCamera.updateCamera();
gAgent.setTeleportState( LLAgent::TELEPORT_START_ARRIVAL );
@@ -3135,7 +3138,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
// know what you look like.
gAgent.sendAgentSetAppearance();
- if (avatarp)
+ if (isAgentAvatarValid())
{
// Chat the "back" SLURL. (DEV-4907)
@@ -3148,9 +3151,9 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
LLNotificationsUtil::add("SystemMessageTip", args);
// Set the new position
- avatarp->setPositionAgent(agent_pos);
- avatarp->clearChat();
- avatarp->slamPosition();
+ gAgentAvatarp->setPositionAgent(agent_pos);
+ gAgentAvatarp->clearChat();
+ gAgentAvatarp->slamPosition();
}
}
else
@@ -3176,7 +3179,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
global_agent_pos[1] += y;
look_at = (LLVector3)beacon_pos - global_agent_pos;
look_at.normVec();
- gAgent.slamLookAt(look_at);
+ gAgentCamera.slamLookAt(look_at);
}
}
@@ -3210,9 +3213,9 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
gAgent.clearBusy();
}
- if (avatarp)
+ if (isAgentAvatarValid())
{
- avatarp->mFootPlane.clearVec();
+ gAgentAvatarp->mFootPlane.clearVec();
}
// send walk-vs-run status
@@ -3354,7 +3357,7 @@ void send_agent_update(BOOL force_send, BOOL send_reliable)
LLQuaternion body_rotation = gAgent.getFrameAgent().getQuaternion();
LLQuaternion head_rotation = gAgent.getHeadRotation();
- camera_pos_agent = gAgent.getCameraPositionAgent();
+ camera_pos_agent = gAgentCamera.getCameraPositionAgent();
render_state = gAgent.getRenderState();
@@ -3478,7 +3481,7 @@ void send_agent_update(BOOL force_send, BOOL send_reliable)
msg->addVector3Fast(_PREHASH_CameraAtAxis, LLViewerCamera::getInstance()->getAtAxis());
msg->addVector3Fast(_PREHASH_CameraLeftAxis, LLViewerCamera::getInstance()->getLeftAxis());
msg->addVector3Fast(_PREHASH_CameraUpAxis, LLViewerCamera::getInstance()->getUpAxis());
- msg->addF32Fast(_PREHASH_Far, gAgent.mDrawDistance);
+ msg->addF32Fast(_PREHASH_Far, gAgentCamera.mDrawDistance);
msg->addU32Fast(_PREHASH_ControlFlags, control_flags);
@@ -4029,7 +4032,7 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data)
//clear animation flags
avatarp = (LLVOAvatar *)gObjectList.findObject(uuid);
- if (!avatarp)
+ if (!isAgentAvatarValid())
{
// no agent by this ID...error?
LL_WARNS("Messaging") << "Received animation state for unknown avatar" << uuid << LL_ENDL;
@@ -4115,7 +4118,7 @@ void process_avatar_appearance(LLMessageSystem *mesgsys, void **user_data)
mesgsys->getUUIDFast(_PREHASH_Sender, _PREHASH_ID, uuid);
LLVOAvatar* avatarp = (LLVOAvatar *)gObjectList.findObject(uuid);
- if( avatarp )
+ if (avatarp)
{
avatarp->processAvatarAppearance( mesgsys );
}
@@ -4130,7 +4133,7 @@ void process_camera_constraint(LLMessageSystem *mesgsys, void **user_data)
LLVector4 cameraCollidePlane;
mesgsys->getVector4Fast(_PREHASH_CameraCollidePlane, _PREHASH_Plane, cameraCollidePlane);
- gAgent.setCameraCollidePlane(cameraCollidePlane);
+ gAgentCamera.setCameraCollidePlane(cameraCollidePlane);
}
void near_sit_object(BOOL success, void *data)
@@ -4163,20 +4166,18 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data)
BOOL force_mouselook;
mesgsys->getBOOLFast(_PREHASH_SitTransform, _PREHASH_ForceMouselook, force_mouselook);
- LLVOAvatar* avatar = gAgent.getAvatarObject();
-
- if (avatar && dist_vec_squared(camera_eye, camera_at) > 0.0001f)
+ if (isAgentAvatarValid() && dist_vec_squared(camera_eye, camera_at) > 0.0001f)
{
- gAgent.setSitCamera(sitObjectID, camera_eye, camera_at);
+ gAgentCamera.setSitCamera(sitObjectID, camera_eye, camera_at);
}
- gAgent.setForceMouselook(force_mouselook);
+ gAgentCamera.setForceMouselook(force_mouselook);
LLViewerObject* object = gObjectList.findObject(sitObjectID);
if (object)
{
LLVector3 sit_spot = object->getPositionAgent() + (sitPosition * object->getRotation());
- if (!use_autopilot || (avatar && avatar->isSitting() && avatar->getRoot() == object->getRoot()))
+ if (!use_autopilot || isAgentAvatarValid() && gAgentAvatarp->isSitting() && gAgentAvatarp->getRoot() == object->getRoot())
{
//we're already sitting on this object, so don't autopilot
}
@@ -5221,9 +5222,9 @@ void container_inventory_arrived(LLViewerObject* object,
void* data)
{
LL_DEBUGS("Messaging") << "container_inventory_arrived()" << LL_ENDL;
- if( gAgent.cameraMouselook() )
+ if( gAgentCamera.cameraMouselook() )
{
- gAgent.changeCameraToDefault();
+ gAgentCamera.changeCameraToDefault();
}
LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel();
@@ -5448,13 +5449,13 @@ void process_teleport_local(LLMessageSystem *msg,void**)
}
gAgent.setPositionAgent(pos);
- gAgent.slamLookAt(look_at);
+ gAgentCamera.slamLookAt(look_at);
// likewise make sure the camera is behind the avatar
- gAgent.resetView(TRUE, TRUE);
+ gAgentCamera.resetView(TRUE, TRUE);
// send camera update to new region
- gAgent.updateCamera();
+ gAgentCamera.updateCamera();
send_agent_update(TRUE, TRUE);
@@ -5588,7 +5589,7 @@ void handle_lure(const LLUUID& invitee)
}
// Prompt for a message to the invited user.
-void handle_lure(const std::vector<LLUUID>& ids)
+void handle_lure(const uuid_vec_t& ids)
{
LLSD edit_args;
edit_args["REGION"] = gAgent.getRegion()->getName();