From b7ce7b7dab9e7f5fad1be4012dd924d8fbc392e7 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 14 Oct 2012 18:09:27 -0400 Subject: [PATCH] Tiny LLWorld silliness fix up --- indra/newview/llworld.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 959f07f0e..c195b2777 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -181,8 +181,8 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host) U32 iindex = 0; U32 jindex = 0; from_region_handle(region_handle, &iindex, &jindex); - S32 x = (S32)(iindex/mWidth); - S32 y = (S32)(jindex/mWidth); + S32 x = (S32)(iindex/mWidth); + S32 y = (S32)(jindex/mWidth); llinfos << "Adding new region (" << x << ":" << y << ")" << llendl; llinfos << "Host: " << host << llendl; @@ -606,13 +606,13 @@ void LLWorld::updateVisibilities() { F32 cur_far_clip = LLViewerCamera::getInstance()->getFar(); - // Go through the culled list and check for visible regions + // Go through the culled list and check for visible regions (region is visible if land is visible) for (region_list_t::iterator iter = mCulledRegionList.begin(); iter != mCulledRegionList.end(); ) { region_list_t::iterator curiter = iter++; LLViewerRegion* regionp = *curiter; - + LLSpatialPartition* part = regionp->getSpatialPartition(LLViewerRegion::PARTITION_TERRAIN); if (part) { @@ -623,8 +623,8 @@ void LLWorld::updateVisibilities() mVisibleRegionList.push_back(regionp); } } - } - + } + // Update all of the visible regions for (region_list_t::iterator iter = mVisibleRegionList.begin(); iter != mVisibleRegionList.end(); ) @@ -636,7 +636,7 @@ void LLWorld::updateVisibilities() continue; } - LLSpatialPartition* part = regionp->getSpatialPartition(LLViewerRegion::PARTITION_TERRAIN); + LLSpatialPartition* part = regionp->getSpatialPartition(LLViewerRegion::PARTITION_TERRAIN); if (part) { LLSpatialGroup* group = (LLSpatialGroup*) part->mOctree->getListener(0); @@ -1417,15 +1417,13 @@ void send_agent_resume() static LLVector3d unpackLocalToGlobalPosition(U32 compact_local, const LLVector3d& region_origin) { - LLVector3d pos_global(region_origin); - LLVector3d pos_local; + LLVector3d pos_local; - pos_local.mdV[VZ] = (compact_local & 0xFFU) * 4; - pos_local.mdV[VY] = (compact_local >> 8) & 0xFFU; - pos_local.mdV[VX] = (compact_local >> 16) & 0xFFU; + pos_local.mdV[VZ] = (compact_local & 0xFFU) * 4; + pos_local.mdV[VY] = (compact_local >> 8) & 0xFFU; + pos_local.mdV[VX] = (compact_local >> 16) & 0xFFU; - pos_global += pos_local; - return pos_global; + return region_origin + pos_local; } void LLWorld::getAvatars(std::vector* avatar_ids, std::vector* positions, const LLVector3d& relative_to, F32 radius) const @@ -1480,7 +1478,7 @@ void LLWorld::getAvatars(std::vector* avatar_ids, std::vectormMapAvatarIDs.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) {