From 615202da702deb8b3d206bda098f4543153398d6 Mon Sep 17 00:00:00 2001 From: Hazim Gazov Date: Sat, 17 Apr 2010 19:14:57 -0300 Subject: [PATCH] added code to disable llwind --- .gitignore | 10 +++++----- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llstartup.cpp | 5 +++++ indra/newview/llvotree.cpp | 9 ++++++--- indra/newview/llwind.cpp | 23 ++++++++++++++++++++--- indra/newview/llwind.h | 2 ++ indra/newview/viewer_manifest.py | 12 +++++++----- 7 files changed, 56 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 9fd44fbab..ae897cbcd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -installed.xml -bin/ -indra/viewer-* -vivox-runtime/ -libraries/ +/installed.xml +/bin/ +/indra/viewer-* +/indra/newview/vivox-runtime/ +/libraries/ diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index aced9c35d..48fa43fa7 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -12692,5 +12692,16 @@ Value 0 + WindEnabled + + Comment + Enable the use of wind (affects trees and flexis, among other things) + Persist + 1 + Type + Boolean + Value + 0 + diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 34853a8e4..8aaef351d 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -173,6 +173,7 @@ #include "llvoavatar.h" #include "llvoclouds.h" #include "llweb.h" +#include "llwind.h" #include "llworld.h" #include "llworldmapmessage.h" #include "llxfermanager.h" @@ -212,6 +213,7 @@ std::string SCREEN_LAST_FILENAME = "screen_last.bmp"; // extern S32 gStartImageWidth; extern S32 gStartImageHeight; +extern bool gLLWindEnabled; // // local globals @@ -2434,6 +2436,9 @@ bool idle_startup() //--------------------------------------------------------------------- if (STATE_WORLD_INIT == LLStartUp::getStartupState()) { + //first of all, let's check if wind should be used + gLLWindEnabled = gSavedSettings.getBOOL("WindEnabled"); + set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); display_startup(); // We should have an agent id by this point. diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index df75280d3..cc582de8e 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -30,6 +30,8 @@ * $/LicenseInfo$ */ +//a lot of code in here is pretty bad, tagging it for a rewrite + #include "llviewerprecompiledheaders.h" #include "llvotree.h" @@ -347,7 +349,8 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) return TRUE; } - if (gSavedSettings.getBOOL("RenderAnimateTrees")) + //it's cheaper to check if wind is enabled first + if (gLLWindEnabled && gSavedSettings.getBOOL("RenderAnimateTrees")) { F32 mass_inv; @@ -390,7 +393,7 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) } } - if (!gSavedSettings.getBOOL("RenderAnimateTrees")) + if (!gLLWindEnabled || !gSavedSettings.getBOOL("RenderAnimateTrees")) { if (mReferenceBuffer.isNull()) { @@ -840,7 +843,7 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable) llassert(index_count == max_indices); } - if (gSavedSettings.getBOOL("RenderAnimateTrees")) + if (gLLWindEnabled || gSavedSettings.getBOOL("RenderAnimateTrees")) { mDrawable->getFace(0)->mVertexBuffer = mReferenceBuffer; } diff --git a/indra/newview/llwind.cpp b/indra/newview/llwind.cpp index ae98bead9..267fcbc8f 100644 --- a/indra/newview/llwind.cpp +++ b/indra/newview/llwind.cpp @@ -52,7 +52,7 @@ #include "llagent.h" #include "llworld.h" - +bool gLLWindEnabled = true; const F32 CLOUD_DIVERGENCE_COEF = 0.5f; @@ -84,6 +84,7 @@ LLWind::~LLWind() void LLWind::init() { + // Let's leave this enabled for now, I don't want to muck stuff up in case wind is re-enabled // Initialize vector data mVelX = new F32[mSize*mSize]; mVelY = new F32[mSize*mSize]; @@ -104,7 +105,7 @@ void LLWind::init() void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp) { - if (!mCloudDensityp) + if (!mCloudDensityp || !gLLWindEnabled) { return; } @@ -181,6 +182,10 @@ void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp) LLVector3 LLWind::getAverage() { + if(!gLLWindEnabled) + { + return LLVector3(0.f, 0.f, 0.f); + } // Returns in average_wind the average wind velocity LLVector3 average(0.0f, 0.0f, 0.0f); S32 i, grid_count; @@ -198,6 +203,10 @@ LLVector3 LLWind::getAverage() LLVector3 LLWind::getVelocityNoisy(const LLVector3 &pos_region, const F32 dim) { + if(!gLLWindEnabled) + { + return LLVector3(0.f, 0.f, 0.f); + } // Resolve a value, using fractal summing to perturb the returned value LLVector3 r_val(0,0,0); F32 norm = 1.0f; @@ -228,6 +237,10 @@ LLVector3 LLWind::getVelocityNoisy(const LLVector3 &pos_region, const F32 dim) LLVector3 LLWind::getVelocity(const LLVector3 &pos_region) { + if(!gLLWindEnabled) + { + return LLVector3(0.f, 0.f, 0.f); + } llassert(mSize == 16); // Resolves value of wind at a location relative to SW corner of region // @@ -290,6 +303,10 @@ LLVector3 LLWind::getVelocity(const LLVector3 &pos_region) LLVector3 LLWind::getCloudVelocity(const LLVector3 &pos_region) { + if(!gLLWindEnabled) + { + return LLVector3(0.f, 0.f, 0.f); + } llassert(mSize == 16); // Resolves value of wind at a location relative to SW corner of region // @@ -349,7 +366,7 @@ LLVector3 LLWind::getCloudVelocity(const LLVector3 &pos_region) return r_val * WIND_SCALE_HACK; } - +//keep the setters for now, in case wind is re-enabled during runtime void LLWind::setCloudDensityPointer(F32 *densityp) { mCloudDensityp = densityp; diff --git a/indra/newview/llwind.h b/indra/newview/llwind.h index 7a4582d9d..fb887a1fc 100644 --- a/indra/newview/llwind.h +++ b/indra/newview/llwind.h @@ -42,6 +42,8 @@ class LLVector3; class LLBitPack; class LLGroupHeader; +extern bool gLLWindEnabled; + class LLWind { diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index c6892dd47..52d980300 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -740,11 +740,13 @@ class LinuxManifest(ViewerManifest): try: # --numeric-owner hides the username of the builder for # security etc. - self.run_command("tar -C '%(dir)s' --numeric-owner -cjf " - "'%(inst_path)s.tar.bz2' %(inst_name)s" % { - 'dir': self.get_build_prefix(), - 'inst_name': installer_name, - 'inst_path':self.build_path_of(installer_name)}) + # I'm leaving this disabled for speed + #self.run_command("tar -C '%(dir)s' --numeric-owner -cjf " + # "'%(inst_path)s.tar.bz2' %(inst_name)s" % { + # 'dir': self.get_build_prefix(), + # 'inst_name': installer_name, + # 'inst_path':self.build_path_of(installer_name)}) + print '' finally: self.run_command("mv '%(inst)s' '%(dst)s'" % { 'dst': self.get_dst_prefix(),