From 36e6946c9610d330525a2f2afd46d29bd126389a Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 20 Jan 2013 23:22:53 -0500 Subject: [PATCH] AuroraSim: More tiny bits to help life be normal on the grid. --- indra/llcharacter/llkeyframewalkmotion.cpp | 2 +- indra/newview/llfloaterworldmap.cpp | 6 ++++-- indra/newview/llnetmap.cpp | 1 + indra/newview/llpanelobject.cpp | 5 +++-- indra/newview/llworldmap.cpp | 10 ++++++++-- indra/newview/llworldmap.h | 1 + 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp index 9983be4f5..8de793229 100644 --- a/indra/llcharacter/llkeyframewalkmotion.cpp +++ b/indra/llcharacter/llkeyframewalkmotion.cpp @@ -287,7 +287,7 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask) avatar_movement_dir.normalize(); // planted foot speed is avatar velocity - foot slip amount along avatar movement direction - F32 foot_speed = speed - ((foot_slip_vector * avatar_movement_dir) / delta_time); + F32 foot_speed = llmax(0.f, speed - ((foot_slip_vector * avatar_movement_dir) / delta_time)); // multiply animation playback rate so that foot speed matches avatar speed F32 min_speed_multiplier = clamp_rescale(speed, 0.f, 1.f, 0.f, 0.1f); diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 0cd3906fb..d1c7b39d8 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -645,8 +645,10 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) } std::string sim_name = sim_info->getName(); - F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS ); - F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); + U32 locX, locY; + from_region_handle(sim_info->getHandle(), &locX, &locY); + F32 region_x = pos_global.mdV[VX] - locX; + F32 region_y = pos_global.mdV[VY] - locY; std::string full_name = llformat("%s (%d, %d, %d)", // sim_name.c_str(), // [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-07-04 (RLVa-1.0.0a) diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index be47072d5..12fb45e9a 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -539,6 +539,7 @@ LLVector3 LLNetMap::globalPosToView(const LLVector3d& global_pos, BOOL rotated) LLVector3 pos_local; pos_local.setVec(relative_pos_global); // convert to floats from doubles + mPixelsPerMeter = mScale / REGION_WIDTH_METERS; pos_local.mV[VX] *= mPixelsPerMeter; pos_local.mV[VY] *= mPixelsPerMeter; // leave Z component in meters diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index eb690720e..52ad8fced 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -2656,8 +2656,9 @@ void LLPanelObject::onPastePosClip(void* user_data) std::string stringVec = wstring_to_utf8str(temp_string); if(!getvectorfromclip(stringVec, &mClipboardPos)) return; - mClipboardPos.mV[VX] = llclamp(mClipboardPos.mV[VX], -3.5f, 256.f); - mClipboardPos.mV[VY] = llclamp(mClipboardPos.mV[VY], -3.5f, 256.f); + float region_width = gAgent.getRegion()->getWidth(); + mClipboardPos.mV[VX] = llclamp(mClipboardPos.mV[VX], -3.5f, region_width); + mClipboardPos.mV[VY] = llclamp(mClipboardPos.mV[VY], -3.5f, region_width); mClipboardPos.mV[VZ] = llclamp(mClipboardPos.mV[VZ], -3.5f, 4096.f); self->mCtrlPosX->set( mClipboardPos.mV[VX] ); diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index e4b3c722e..094ccb1b0 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -43,6 +43,7 @@ #include "llmapresponders.h" #include "llviewercontrol.h" #include "llfloaterworldmap.h" +#include "lltexturecache.h" #include "lltracker.h" #include "llviewertexturelist.h" #include "llviewerregion.h" @@ -91,12 +92,17 @@ LLSimInfo::LLSimInfo(U64 handle) void LLSimInfo::setLandForSaleImage (LLUUID image_id) { + const bool is_aurora = gHippoGridManager->getConnectedGrid()->isAurora(); + if (is_aurora && mMapImageID[SIM_LAYER_OVERLAY].isNull() && image_id.notNull() && gTextureList.findImage(image_id)) + LLAppViewer::getTextureCache()->removeFromCache(image_id); + mMapImageID[SIM_LAYER_OVERLAY] = image_id; // Fetch the image if (mMapImageID[SIM_LAYER_OVERLAY].notNull()) { mLayerImage[SIM_LAYER_OVERLAY] = LLViewerTextureManager::getFetchedTexture(mMapImageID[SIM_LAYER_OVERLAY], MIPMAP_TRUE, LLViewerTexture::BOOST_MAP, LLViewerTexture::LOD_TEXTURE); + if (is_aurora) mLayerImage[SIM_LAYER_OVERLAY]->forceImmediateUpdate(); mLayerImage[SIM_LAYER_OVERLAY]->setAddressMode(LLTexUnit::TAM_CLAMP); } else @@ -526,8 +532,8 @@ void LLWorldMap::processMapLayerReply(LLMessageSystem* msg, void**) bool LLWorldMap::useWebMapTiles() { static const LLCachedControl use_web_map_tiles("UseWebMapTiles",false); - return use_web_map_tiles && - (( gHippoGridManager->getConnectedGrid()->isSecondLife() || sGotMapURL)); + return use_web_map_tiles && !gHippoGridManager->getConnectedGrid()->isAurora() && + ((gHippoGridManager->getConnectedGrid()->isSecondLife() || sGotMapURL)); } void LLWorldMap::reloadItems(bool force) diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h index c34dc0f21..5e1757906 100644 --- a/indra/newview/llworldmap.h +++ b/indra/newview/llworldmap.h @@ -151,6 +151,7 @@ public: void setMapImageID (const LLUUID& id, const U8 &layer) { mMapImageID[layer] = id; } // Accessors + U64 getHandle() const { return mHandle; } std::string getName() const { return mName; } const std::string getFlagsString() const { return LLViewerRegion::regionFlagsToString(mRegionFlags); } const U32 getRegionFlags() const { return mRegionFlags; }