From 512d7381eca7bc53bb31e9528e5a7c5df189e82d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 11 Jan 2013 15:45:20 -0800 Subject: SH-3406 WIP convert fast timers to lltrace system gcc 4.1 fixes --- indra/llcommon/llunit.h | 10 ++-------- indra/newview/llviewerstats.cpp | 2 +- indra/newview/llviewertexture.cpp | 10 +++++----- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/indra/llcommon/llunit.h b/indra/llcommon/llunit.h index c43ca2ba18..f43df3753a 100644 --- a/indra/llcommon/llunit.h +++ b/indra/llcommon/llunit.h @@ -76,8 +76,8 @@ struct LLUnit typedef STORAGE_TYPE storage_t; // default initialization - LLUnit() - : mValue(storage_t()) + LLUnit(storage_t value = storage_t()) + : mValue(value) {} // unit initialization and conversion @@ -85,12 +85,6 @@ struct LLUnit LLUnit(LLUnit other) : mValue(convert(other)) {} - - // value initialization - template - LLUnit(CONVERTABLE_TYPE value) - : mValue(value) - {} // value assignment self_t& operator = (storage_t value) diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 077c9f43a4..136a4d0a9e 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -394,7 +394,7 @@ void update_statistics() static LLFrameTimer texture_stats_timer; if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq) { - gTotalTextureData = LLTrace::Bytes(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT)).value(); + gTotalTextureData = LLTrace::Bytes(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT)); texture_stats_timer.reset(); } } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 1ffa83c529..7a142b481f 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -533,7 +533,7 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity sTotalTextureMemory >= sMaxTotalTextureMem) { //when texture memory overflows, lower down the threshold to release the textures more aggressively. - sMaxDesiredTextureMem = llmin(sMaxDesiredTextureMem * 0.75f, LLUnit(gMaxVideoRam)); + sMaxDesiredTextureMem = (S32)llmin(sMaxDesiredTextureMem * 0.75f, LLUnit(gMaxVideoRam)); // If we are using more texture memory than we should, // scale up the desired discard level @@ -549,8 +549,8 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity sEvaluationTimer.reset(); } else if (sDesiredDiscardBias > 0.0f && - sBoundTextureMemory < sMaxBoundTextureMem * texmem_lower_bound_scale && - sTotalTextureMemory < sMaxTotalTextureMem * texmem_lower_bound_scale) + sBoundTextureMemory < (S32)(sMaxBoundTextureMem * texmem_lower_bound_scale) && + sTotalTextureMemory < (S32)(sMaxTotalTextureMem * texmem_lower_bound_scale)) { // If we are using less texture memory than we should, // scale down the desired discard level @@ -568,8 +568,8 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity sCameraMovingBias = llmax(0.2f * camera_moving_speed, 2.0f * camera_angular_speed - 1); sCameraMovingDiscardBias = (S8)(sCameraMovingBias); - LLViewerTexture::sFreezeImageScalingDown = (sBoundTextureMemory < 0.75f * sMaxBoundTextureMem * texmem_middle_bound_scale) && - (sTotalTextureMemory < 0.75f * sMaxTotalTextureMem * texmem_middle_bound_scale) ; + LLViewerTexture::sFreezeImageScalingDown = (sBoundTextureMemory < (S32)(0.75f * sMaxBoundTextureMem * texmem_middle_bound_scale)) && + (sTotalTextureMemory < (S32)(0.75f * sMaxTotalTextureMem * texmem_middle_bound_scale)); } //end of static functions -- cgit v1.2.3