diff options
author | Dave Parks <davep@lindenlab.com> | 2011-02-01 02:33:32 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-02-01 02:33:32 -0600 |
commit | 16f038661060480d78cdedee8f1717b333fe7d54 (patch) | |
tree | b5e300856bb375e1171d4ca19c4fa8b4445dca71 /indra/newview | |
parent | b2b4370e34bf752eea60ff954ff85375f07d27d0 (diff) | |
parent | 1a51db5b53b3783b002bfa870fa45244df8fafdc (diff) |
merge
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llmeshrepository.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llmeshrepository.h | 2 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 3 |
3 files changed, 17 insertions, 4 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index b772999ee2..edcf249a21 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2160,7 +2160,7 @@ S32 LLMeshRepository::update() return size ; } -S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_params, S32 detail) +S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_params, S32 detail, S32 last_lod) { if (detail < 0 || detail > 4) { @@ -2201,7 +2201,19 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para if (group) { - //first see what the next lowest LOD available might be + //first, see if last_lod is available (don't transition down to avoid funny popping a la SH-641) + if (last_lod >= 0) + { + LLVolume* lod = group->refLOD(last_lod); + if (lod && !lod->isTetrahedron() && lod->getNumVolumeFaces() > 0) + { + group->derefLOD(lod); + return last_lod; + } + group->derefLOD(lod); + } + + //next, see what the next lowest LOD available might be for (S32 i = detail-1; i >= 0; --i) { LLVolume* lod = group->refLOD(i); diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index eccb82b661..b642a89192 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -456,7 +456,7 @@ public: S32 update() ; //mesh management functions - S32 loadMesh(LLVOVolume* volume, const LLVolumeParams& mesh_params, S32 detail = 0); + S32 loadMesh(LLVOVolume* volume, const LLVolumeParams& mesh_params, S32 detail = 0, S32 last_lod = -1); void notifyLoadedMeshes(); void notifyMeshLoaded(const LLVolumeParams& mesh_params, LLVolume* volume); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 3dc82f5368..b296d21b2b 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -936,6 +936,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo {
LLVolumeParams volume_params = params_in;
+ S32 last_lod = mVolumep.notNull() ? LLVolumeLODGroup::getVolumeDetailFromScale(mVolumep->getDetail()) : -1;
S32 lod = mLOD;
BOOL is404 = FALSE;
@@ -1014,7 +1015,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo {
//load request not yet issued, request pipeline load this mesh
LLUUID asset_id = volume_params.getSculptID();
- S32 available_lod = gMeshRepo.loadMesh(this, volume_params, lod);
+ S32 available_lod = gMeshRepo.loadMesh(this, volume_params, lod, last_lod);
if (available_lod != lod)
{
LLPrimitive::setVolume(volume_params, available_lod);
|