added code to disable llwind

This commit is contained in:
Hazim Gazov
2010-04-17 19:14:57 -03:00
parent 22b9bd1c2e
commit 615202da70
7 changed files with 56 additions and 16 deletions

10
.gitignore vendored
View File

@@ -1,5 +1,5 @@
installed.xml /installed.xml
bin/ /bin/
indra/viewer-* /indra/viewer-*
vivox-runtime/ /indra/newview/vivox-runtime/
libraries/ /libraries/

View File

@@ -12692,5 +12692,16 @@
<key>Value</key> <key>Value</key>
<integer>0</integer> <integer>0</integer>
</map> </map>
<key>WindEnabled</key>
<map>
<key>Comment</key>
<string>Enable the use of wind (affects trees and flexis, among other things)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
</map> </map>
</llsd> </llsd>

View File

@@ -173,6 +173,7 @@
#include "llvoavatar.h" #include "llvoavatar.h"
#include "llvoclouds.h" #include "llvoclouds.h"
#include "llweb.h" #include "llweb.h"
#include "llwind.h"
#include "llworld.h" #include "llworld.h"
#include "llworldmapmessage.h" #include "llworldmapmessage.h"
#include "llxfermanager.h" #include "llxfermanager.h"
@@ -212,6 +213,7 @@ std::string SCREEN_LAST_FILENAME = "screen_last.bmp";
// //
extern S32 gStartImageWidth; extern S32 gStartImageWidth;
extern S32 gStartImageHeight; extern S32 gStartImageHeight;
extern bool gLLWindEnabled;
// //
// local globals // local globals
@@ -2434,6 +2436,9 @@ bool idle_startup()
//--------------------------------------------------------------------- //---------------------------------------------------------------------
if (STATE_WORLD_INIT == LLStartUp::getStartupState()) 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); set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD);
display_startup(); display_startup();
// We should have an agent id by this point. // We should have an agent id by this point.

View File

@@ -30,6 +30,8 @@
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
//a lot of code in here is pretty bad, tagging it for a rewrite
#include "llviewerprecompiledheaders.h" #include "llviewerprecompiledheaders.h"
#include "llvotree.h" #include "llvotree.h"
@@ -347,7 +349,8 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
return TRUE; return TRUE;
} }
if (gSavedSettings.getBOOL("RenderAnimateTrees")) //it's cheaper to check if wind is enabled first
if (gLLWindEnabled && gSavedSettings.getBOOL("RenderAnimateTrees"))
{ {
F32 mass_inv; 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()) if (mReferenceBuffer.isNull())
{ {
@@ -840,7 +843,7 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
llassert(index_count == max_indices); llassert(index_count == max_indices);
} }
if (gSavedSettings.getBOOL("RenderAnimateTrees")) if (gLLWindEnabled || gSavedSettings.getBOOL("RenderAnimateTrees"))
{ {
mDrawable->getFace(0)->mVertexBuffer = mReferenceBuffer; mDrawable->getFace(0)->mVertexBuffer = mReferenceBuffer;
} }

View File

@@ -52,7 +52,7 @@
#include "llagent.h" #include "llagent.h"
#include "llworld.h" #include "llworld.h"
bool gLLWindEnabled = true;
const F32 CLOUD_DIVERGENCE_COEF = 0.5f; const F32 CLOUD_DIVERGENCE_COEF = 0.5f;
@@ -84,6 +84,7 @@ LLWind::~LLWind()
void LLWind::init() 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 // Initialize vector data
mVelX = new F32[mSize*mSize]; mVelX = new F32[mSize*mSize];
mVelY = new F32[mSize*mSize]; mVelY = new F32[mSize*mSize];
@@ -104,7 +105,7 @@ void LLWind::init()
void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp) void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp)
{ {
if (!mCloudDensityp) if (!mCloudDensityp || !gLLWindEnabled)
{ {
return; return;
} }
@@ -181,6 +182,10 @@ void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp)
LLVector3 LLWind::getAverage() LLVector3 LLWind::getAverage()
{ {
if(!gLLWindEnabled)
{
return LLVector3(0.f, 0.f, 0.f);
}
// Returns in average_wind the average wind velocity // Returns in average_wind the average wind velocity
LLVector3 average(0.0f, 0.0f, 0.0f); LLVector3 average(0.0f, 0.0f, 0.0f);
S32 i, grid_count; S32 i, grid_count;
@@ -198,6 +203,10 @@ LLVector3 LLWind::getAverage()
LLVector3 LLWind::getVelocityNoisy(const LLVector3 &pos_region, const F32 dim) 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 // Resolve a value, using fractal summing to perturb the returned value
LLVector3 r_val(0,0,0); LLVector3 r_val(0,0,0);
F32 norm = 1.0f; 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) LLVector3 LLWind::getVelocity(const LLVector3 &pos_region)
{ {
if(!gLLWindEnabled)
{
return LLVector3(0.f, 0.f, 0.f);
}
llassert(mSize == 16); llassert(mSize == 16);
// Resolves value of wind at a location relative to SW corner of region // 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) LLVector3 LLWind::getCloudVelocity(const LLVector3 &pos_region)
{ {
if(!gLLWindEnabled)
{
return LLVector3(0.f, 0.f, 0.f);
}
llassert(mSize == 16); llassert(mSize == 16);
// Resolves value of wind at a location relative to SW corner of region // 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; return r_val * WIND_SCALE_HACK;
} }
//keep the setters for now, in case wind is re-enabled during runtime
void LLWind::setCloudDensityPointer(F32 *densityp) void LLWind::setCloudDensityPointer(F32 *densityp)
{ {
mCloudDensityp = densityp; mCloudDensityp = densityp;

View File

@@ -42,6 +42,8 @@ class LLVector3;
class LLBitPack; class LLBitPack;
class LLGroupHeader; class LLGroupHeader;
extern bool gLLWindEnabled;
class LLWind class LLWind
{ {

View File

@@ -740,11 +740,13 @@ class LinuxManifest(ViewerManifest):
try: try:
# --numeric-owner hides the username of the builder for # --numeric-owner hides the username of the builder for
# security etc. # security etc.
self.run_command("tar -C '%(dir)s' --numeric-owner -cjf " # I'm leaving this disabled for speed
"'%(inst_path)s.tar.bz2' %(inst_name)s" % { #self.run_command("tar -C '%(dir)s' --numeric-owner -cjf "
'dir': self.get_build_prefix(), # "'%(inst_path)s.tar.bz2' %(inst_name)s" % {
'inst_name': installer_name, # 'dir': self.get_build_prefix(),
'inst_path':self.build_path_of(installer_name)}) # 'inst_name': installer_name,
# 'inst_path':self.build_path_of(installer_name)})
print ''
finally: finally:
self.run_command("mv '%(inst)s' '%(dst)s'" % { self.run_command("mv '%(inst)s' '%(dst)s'" % {
'dst': self.get_dst_prefix(), 'dst': self.get_dst_prefix(),