From d5fee73c42f9aa9827ac1936cf08ff56cc64b8b0 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Thu, 18 Nov 2010 20:22:11 +0100 Subject: [PATCH] Thickbrick's fixes --- indra/newview/llappviewer.cpp | 9 ++------- indra/newview/lltexturecache.cpp | 5 +++-- indra/newview/llviewerimage.cpp | 4 ++++ indra/newview/llvoavatar.cpp | 14 +++++++------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index cd7fd7365..08f321760 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1052,9 +1052,7 @@ bool LLAppViewer::mainLoop() } - const F64 min_frame_time = 0.0; //(.0333 - .0010); // max video frame rate = 30 fps - const F64 min_idle_time = 0.0; //(.0010); // min idle time = 1 ms - const F64 max_idle_time = run_multiple_threads ? min_idle_time : llmin(.005*10.0*gFrameTimeSeconds, 0.005); // 5 ms a second + const F64 max_idle_time = run_multiple_threads ? 0.0 : llmin(.005*10.0*gFrameIntervalSeconds, 0.005); // 50ms/second, no more than 5ms/frame idleTimer.reset(); while(1) { @@ -1070,11 +1068,8 @@ bool LLAppViewer::mainLoop() ms_sleep(llmin(io_pending/100,100)); // give the vfs some time to catch up } - F64 frame_time = frameTimer.getElapsedTimeF64(); F64 idle_time = idleTimer.getElapsedTimeF64(); - if (frame_time >= min_frame_time && - idle_time >= min_idle_time && - (!work_pending || idle_time >= max_idle_time)) + if (!work_pending || idle_time >= max_idle_time) { break; } diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 5744fe54f..d9763ed84 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -372,9 +372,10 @@ bool LLTextureCacheRemoteWorker::doRead() if (!done && (mState == LOCAL)) { llassert(local_size != 0); // we're assuming there is a non empty local file here... - if (!mDataSize || mDataSize > local_size) + llassert(mReadData == NULL); + if (!mDataSize || mDataSize > (local_size - mOffset)) { - mDataSize = local_size; + mDataSize = local_size - mOffset; } // Allocate read buffer mReadData = new U8[mDataSize]; diff --git a/indra/newview/llviewerimage.cpp b/indra/newview/llviewerimage.cpp index 0ce2be0f9..2a6b2a028 100644 --- a/indra/newview/llviewerimage.cpp +++ b/indra/newview/llviewerimage.cpp @@ -322,6 +322,10 @@ LLViewerImage::LLViewerImage(const LLUUID& id, const LLHost& host, BOOL usemipma { init(true); sImageCount++; + if (host != LLHost::invalid) + { + mCanUseHTTP = false; // this is a baked texture + } } LLViewerImage::LLViewerImage(const std::string& url, const LLUUID& id, BOOL usemipmaps) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 8a12a27fd..8c7447517 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5184,12 +5184,6 @@ void LLVOAvatar::updateTextures() if (texture_dict->mIsLocalTexture) { addLocalTextureStats((ETextureIndex)index, imagep, texel_area_ratio, render_avatar, layer_baked[baked_index]); - // SNOW-8 : temporary snowglobe1.0 fix for baked textures - if (render_avatar && !gGLManager.mIsDisabled ) - { - // bind the texture so that its boost level won't be slammed - gGL.getTexUnit(0)->bind(imagep); - } } else if (texture_dict->mIsBakedTexture) { @@ -5226,8 +5220,14 @@ void LLVOAvatar::addLocalTextureStats( ETextureIndex idx, LLViewerImage* imagep, F32 desired_pixels; if( mIsSelf ) { - desired_pixels = llmin(mPixelArea, (F32)TEX_IMAGE_AREA_SELF ); + desired_pixels = llmax(mPixelArea, (F32)TEX_IMAGE_AREA_SELF ); imagep->setBoostLevel(LLViewerImageBoostLevel::BOOST_AVATAR_SELF); + // SNOW-8 : temporary snowglobe1.0 fix for baked textures + if (render_avatar && !gGLManager.mIsDisabled ) + { + // bind the texture so that its boost level won't be slammed + gGL.getTexUnit(0)->bind(imagep); + } } else {