-Sanity checks from snowglobe. ...

-Null terminated a string buffer.
-Mutex locks are expensive.
-Realloc is my friend.
-But leaks are not.
-Nor are unused variables.
-And buffer overruns should get lost.
-bindManual shouldnt return failure if texture's already bound.
-Pulled windlight and classic clouds apart into unique rendertypes.
-'Client or Account' savedsettings stuff is now moar bettar. (and efficient)
-Replaced LLSavedSettingsGlue with something that supports gSavedSettings, gSavedPerAccountSettings, and gCOASavedSettings

-Added 'Enable Classic Clouds' checkbox to ascet performance settings panel
-New cards added to gpu table.
-General cleaning...
-How2spell 'dimensions'?
This commit is contained in:
unknown
2010-10-01 00:35:39 -05:00
parent 7b409eb7ab
commit 3e8a7172db
36 changed files with 361 additions and 244 deletions

View File

@@ -250,11 +250,14 @@ BOOL LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask)
head_rot_local = nlerp(head_slerp_amt, mLastHeadRot, head_rot_local);
mLastHeadRot = head_rot_local;
// Set the head rotation.
LLQuaternion torsoRotLocal = mNeckState->getJoint()->getParent()->getWorldRotation() * currentInvRootRotWorld;
head_rot_local = head_rot_local * ~torsoRotLocal;
mNeckState->setRotation( nlerp(NECK_LAG, LLQuaternion::DEFAULT, head_rot_local) );
mHeadState->setRotation( nlerp(1.f - NECK_LAG, LLQuaternion::DEFAULT, head_rot_local));
if(mNeckState->getJoint() && mNeckState->getJoint()->getParent()) //Guess this has crashed? Taken from snowglobe -Shyotl
{
// Set the head rotation.
LLQuaternion torsoRotLocal = mNeckState->getJoint()->getParent()->getWorldRotation() * currentInvRootRotWorld;
head_rot_local = head_rot_local * ~torsoRotLocal;
mNeckState->setRotation( nlerp(NECK_LAG, LLQuaternion::DEFAULT, head_rot_local) );
mHeadState->setRotation( nlerp(1.f - NECK_LAG, LLQuaternion::DEFAULT, head_rot_local));
}
return TRUE;
}

View File

@@ -48,5 +48,6 @@ std::string llformat(const char *fmt, ...)
vsnprintf(tstr, 1024, fmt, va); /* Flawfinder: ignore */
#endif
va_end(va);
tstr[1023] = '\0';
return std::string(tstr);
}

View File

@@ -435,17 +435,16 @@ S32 LLQueuedThread::processNextRequest()
{
lockData();
req->setStatus(STATUS_COMPLETE);
unlockData();
req->finishRequest(true);
if ((req->getFlags() & FLAG_AUTO_COMPLETE))
{
lockData();
mRequestHash.erase(req);
req->deleteRequest();
unlockData();
}
unlockData();
}
else
{

View File

@@ -582,10 +582,16 @@ std::string utf8str_removeCRLF(const std::string& utf8str)
}
const char CR = 13;
S32 i = utf8str.find(CR);
if(i == std::string::npos)
return utf8str; //Save us from a reserve call.
std::string out;
out.reserve(utf8str.length());
const S32 len = (S32)utf8str.length();
for( S32 i = 0; i < len; i++ )
if(i)
out.assign(utf8str,0,i); //Copy previous text to buffer
for( ++i; i < len; i++ )
{
if( utf8str[i] != CR )
{

View File

@@ -139,7 +139,8 @@ BOOL LLImageBase::sSizeOverride = FALSE;
// virtual
void LLImageBase::deleteData()
{
delete[] mData;
if(mData)
free(mData);//delete[] mData;
mData = NULL;
mDataSize = 0;
}
@@ -166,14 +167,17 @@ U8* LLImageBase::allocateData(S32 size)
{
deleteData(); // virtual
mBadBufferAllocation = FALSE ;
mData = new U8[size];
if (!mData)
U8 *data = (U8 *)realloc(mData,sizeof(U8)*size);//new U8[size];
if (!data)
{
if(mData)
free(mData);
llwarns << "allocate image data: " << size << llendl;
size = 0 ;
mWidth = mHeight = 0 ;
mBadBufferAllocation = TRUE ;
}
mData = data;
mDataSize = size;
}
@@ -184,21 +188,16 @@ U8* LLImageBase::allocateData(S32 size)
U8* LLImageBase::reallocateData(S32 size)
{
LLMemType mt1((LLMemType::EMemType)mMemType);
U8 *new_datap = new U8[size];
if (!new_datap)
U8 *data = (U8 *)realloc(mData,sizeof(U8)*size);
if(data)
{
mData = data;
mDataSize = size;
}
else
llwarns << "Out of memory in LLImageBase::reallocateData" << llendl;
return 0;
}
if (mData)
{
S32 bytes = llmin(mDataSize, size);
memcpy(new_datap, mData, bytes); /* Flawfinder: ignore */
delete[] mData;
}
mData = new_datap;
mDataSize = size;
return mData;
return data;
}
const U8* LLImageBase::getData() const
@@ -1507,6 +1506,7 @@ void LLImageFormatted::appendData(U8 *data, S32 size)
S32 newsize = cursize + size;
reallocateData(newsize);
memcpy(getData() + cursize, data, size);
delete[] data; //Fixing leak from CommentCacheReadResponder
}
}
}

View File

@@ -42,17 +42,12 @@
// LLImagePNG
// ---------------------------------------------------------------------------
LLImagePNG::LLImagePNG()
: LLImageFormatted(IMG_CODEC_PNG),
mTmpWriteBuffer(NULL)
: LLImageFormatted(IMG_CODEC_PNG)
{
}
LLImagePNG::~LLImagePNG()
{
if (mTmpWriteBuffer)
{
delete[] mTmpWriteBuffer;
}
}
// Virtual
@@ -121,14 +116,34 @@ BOOL LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time)
// Image logical size
setSize(raw_image->getWidth(), raw_image->getHeight(), raw_image->getComponents());
// Temporary buffer to hold the encoded image. Note: the final image
// size should be much smaller due to compression.
if (mTmpWriteBuffer)
{
delete[] mTmpWriteBuffer;
}
U32 bufferSize = getWidth() * getHeight() * getComponents() + 1024;
U8* mTmpWriteBuffer = new U8[ bufferSize ];
//New implementation
allocateData(bufferSize); //Set to largest possible size.
if(isBufferInvalid()) //Checking
{
setLastError("LLImagePNG::encode failed allocateData");
return FALSE;
}
// Delegate actual encoding work to wrapper
LLPngWrapper pngWrapper;
if (! pngWrapper.writePng(raw_image, getData()))
{
setLastError(pngWrapper.getErrorMessage());
return FALSE;
}
// Resize internal buffer.
if(!reallocateData(pngWrapper.getFinalSize())) //Shrink. Returns NULL on failure.
{
setLastError("LLImagePNG::encode failed reallocateData");
return FALSE;
}
return TRUE;
/*U8* mTmpWriteBuffer = new U8[ bufferSize ];
// Delegate actual encoding work to wrapper
LLPngWrapper pngWrapper;
@@ -146,6 +161,6 @@ BOOL LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time)
delete[] mTmpWriteBuffer;
return TRUE;
return TRUE;*/
}

View File

@@ -47,9 +47,6 @@ public:
/*virtual*/ BOOL updateData();
/*virtual*/ BOOL decode(LLImageRaw* raw_image, F32 decode_time);
/*virtual*/ BOOL encode(const LLImageRaw* raw_image, F32 encode_time);
private:
U8* mTmpWriteBuffer;
};
#endif

View File

@@ -99,7 +99,6 @@ void info_callback(const char* msg, void*)
LLImageJ2COJ::LLImageJ2COJ() : LLImageJ2CImpl()
{
mRawImagep=NULL;
}
@@ -331,7 +330,7 @@ BOOL LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con
OPJ_COLOR_SPACE color_space = CLRSPC_SRGB;
opj_image_cmptparm_t cmptparm[MAX_COMPS];
opj_image_t * image = NULL;
S32 numcomps = raw_image.getComponents();
S32 numcomps = min(raw_image.getComponents(),MAX_COMPS); //Clamp avoid overrunning buffer -Shyotl
S32 width = raw_image.getWidth();
S32 height = raw_image.getHeight();

View File

@@ -51,9 +51,6 @@ protected:
// Divide a by b to the power of 2 and round upwards.
return (a + (1 << b) - 1) >> b;
}
// Temporary variables for in-progress decodes...
LLImageRaw *mRawImagep;
};
#endif

View File

@@ -1563,49 +1563,46 @@ void LLImageGL::setNoDelete()
//----------------------------------------------------------------------------
void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in)
{
if (mFormatType != GL_UNSIGNED_BYTE ||
mFormatPrimary != GL_RGBA)
{
//cannot generate a pick mask for this texture
delete [] mPickMask;
mPickMask = NULL;
mPickMaskSize = 0;
return;
}
U32 pick_width = width/2;
U32 pick_height = height/2;
mPickMaskSize = llmax(pick_width, (U32) 1) * llmax(pick_height, (U32) 1);
mPickMaskSize = mPickMaskSize/8 + 1;
delete[] mPickMask;
mPickMask = new U8[mPickMaskSize];
memset(mPickMask, 0, sizeof(U8) * mPickMaskSize);
U32 pick_bit = 0;
delete [] mPickMask; //Always happens regardless.
mPickMask = NULL;
mPickMaskSize = 0;
for (S32 y = 0; y < height; y += 2)
if (!(mFormatType != GL_UNSIGNED_BYTE ||
mFormatPrimary != GL_RGBA)) //can only generate a pick mask for this sort of texture
{
for (S32 x = 0; x < width; x += 2)
U32 pick_width = width/2;
U32 pick_height = height/2;
mPickMaskSize = llmax(pick_width, (U32) 1) * llmax(pick_height, (U32) 1);
mPickMaskSize = mPickMaskSize/8 + 1;
mPickMask = new U8[mPickMaskSize];
memset(mPickMask, 0, sizeof(U8) * mPickMaskSize);
U32 pick_bit = 0;
for (S32 y = 0; y < height; y += 2)
{
U8 alpha = data_in[(y*width+x)*4+3];
if (alpha > 32)
for (S32 x = 0; x < width; x += 2)
{
U32 pick_idx = pick_bit/8;
U32 pick_offset = pick_bit%8;
if (pick_idx >= mPickMaskSize)
{
llerrs << "WTF?" << llendl;
}
U8 alpha = data_in[(y*width+x)*4+3];
mPickMask[pick_idx] |= 1 << pick_offset;
}
if (alpha > 32)
{
U32 pick_idx = pick_bit/8;
U32 pick_offset = pick_bit%8;
if (pick_idx >= mPickMaskSize)
{
llerrs << "WTF?" << llendl;
}
mPickMask[pick_idx] |= 1 << pick_offset;
}
++pick_bit;
++pick_bit;
}
}
}
}

View File

@@ -293,15 +293,18 @@ bool LLTexUnit::bind(LLRenderTarget* renderTarget, bool bindDepth)
bool LLTexUnit::bindManual(eTextureType type, U32 texture, bool hasMips)
{
if (mIndex < 0 || mCurrTexture == texture) return false;
if (mIndex < 0) return false;
gGL.flush();
activate();
enable(type);
mCurrTexture = texture;
glBindTexture(sGLTextureType[type], texture);
mHasMipMaps = hasMips;
if(mCurrTexture != texture)
{
gGL.flush();
activate();
enable(type);
mCurrTexture = texture;
glBindTexture(sGLTextureType[type], texture);
mHasMipMaps = hasMips;
}
return true;
}

View File

@@ -217,7 +217,7 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi
llerrs << "Wrong vertex buffer bound." << llendl;
}
if (mode > LLRender::NUM_MODES)
if (mode >= LLRender::NUM_MODES)
{
llerrs << "Invalid draw mode: " << mode << llendl;
return;
@@ -247,7 +247,7 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
llerrs << "Wrong vertex buffer bound." << llendl;
}
if (mode > LLRender::NUM_MODES)
if (mode >= LLRender::NUM_MODES)
{
llerrs << "Invalid draw mode: " << mode << llendl;
return;
@@ -272,7 +272,7 @@ void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const
llerrs << "Wrong vertex buffer bound." << llendl;
}
if (mode > LLRender::NUM_MODES)
if (mode >= LLRender::NUM_MODES)
{
llerrs << "Invalid draw mode: " << mode << llendl;
return;

View File

@@ -517,7 +517,7 @@ void LLScriptExecuteLSL2::callNextQueuedEventHandler(U64 event_register, const L
}
else
{
llwarns << "Shit, somehow got an event that we're not registered for!" << llendl;
llwarns << "Somehow got an event that we're not registered for!" << llendl;
}
delete eventdata;
}

View File

@@ -93,6 +93,7 @@ private:
BOOL mFetchInventoryOnLogin;
BOOL mEnableLLWind;
BOOL mEnableClouds;
BOOL mEnableClassicClouds;
BOOL mSpeedRez;
U32 mSpeedRezInterval;
//Command Line ------------------------------------------------------------------------
@@ -115,7 +116,7 @@ LLPrefsAscentSysImpl::LLPrefsAscentSysImpl()
childSetCommitCallback("system_folder_check", onCommitCheckBox, this);
childSetCommitCallback("show_look_at_check", onCommitCheckBox, this);
childSetCommitCallback("enable_clouds", onCommitCheckBox, this);
mEnableClouds = gSavedSettings.getBOOL("CloudsEnabled");
refreshValues();
refresh();
}
@@ -150,6 +151,11 @@ void LLPrefsAscentSysImpl::onCommitCheckBox(LLUICtrl* ctrl, void* user_data)
bool enabled = self->childGetValue("system_folder_check").asBoolean();
self->childSetEnabled("temp_in_system_check", enabled);
}
else if (ctrl->getName() == "enable_clouds")
{
bool enabled = self->childGetValue("enable_clouds").asBoolean();
self->childSetEnabled("enable_classic_clouds", enabled);
}
}
void LLPrefsAscentSysImpl::refreshValues()
@@ -181,11 +187,10 @@ void LLPrefsAscentSysImpl::refreshValues()
//Performance -------------------------------------------------------------------------
mFetchInventoryOnLogin = gSavedSettings.getBOOL("FetchInventoryOnLogin");
mEnableLLWind = gSavedSettings.getBOOL("WindEnabled");
if(mEnableClouds != gSavedSettings.getBOOL("CloudsEnabled"))
{
mEnableClouds = gSavedSettings.getBOOL("CloudsEnabled");
LLPipeline::toggleRenderTypeControl((void*)LLPipeline::RENDER_TYPE_CLOUDS);
}
mEnableClouds = gSavedSettings.getBOOL("CloudsEnabled");
mEnableClassicClouds = gSavedSettings.getBOOL("SkyUseClassicClouds");
mSpeedRez = gSavedSettings.getBOOL("SpeedRez");
mSpeedRezInterval = gSavedSettings.getU32("SpeedRezInterval");
@@ -290,6 +295,7 @@ void LLPrefsAscentSysImpl::refresh()
childSetValue("fetch_inventory_on_login_check", mFetchInventoryOnLogin);
childSetValue("enable_wind", mEnableLLWind);
childSetValue("enable_clouds", mEnableClouds);
childSetValue("enable_classic_clouds", mEnableClassicClouds);
gLLWindEnabled = mEnableLLWind;
childSetValue("speed_rez_check", mSpeedRez);
childSetEnabled("speed_rez_interval", mSpeedRez);
@@ -329,6 +335,7 @@ void LLPrefsAscentSysImpl::cancel()
childSetValue("fetch_inventory_on_login_check", mFetchInventoryOnLogin);
childSetValue("enable_wind", mEnableLLWind);
childSetValue("enable_clouds", mEnableClouds);
childSetValue("enable_classic_clouds", mEnableClassicClouds);
childSetValue("speed_rez_check", mSpeedRez);
if (mSpeedRez)
{
@@ -348,11 +355,9 @@ void LLPrefsAscentSysImpl::cancel()
childSetValue("private_look_at_check", mPrivateLookAt);
childSetValue("revoke_perms_on_stand_up_check", mRevokePermsOnStandUp);
if(mEnableClouds != gSavedSettings.getBOOL("CloudsEnabled"))
{
gSavedSettings.setBOOL("CloudsEnabled", mEnableClouds);
LLPipeline::toggleRenderTypeControl((void*)LLPipeline::RENDER_TYPE_CLOUDS);
}
childSetValue("enable_clouds", mEnableClouds);
childSetValue("enable_classic_clouds", mEnableClassicClouds);
gLLWindEnabled = mEnableLLWind;
}
@@ -460,6 +465,7 @@ void LLPrefsAscentSysImpl::apply()
gSavedSettings.setBOOL("FetchInventoryOnLogin", childGetValue("fetch_inventory_on_login_check"));
gSavedSettings.setBOOL("WindEnabled", childGetValue("enable_wind"));
gSavedSettings.setBOOL("CloudsEnabled", childGetValue("enable_clouds"));
gSavedSettings.setBOOL("SkyUseClassicClouds", childGetValue("enable_classic_clouds"));
gSavedSettings.setBOOL("SpeedRez", childGetValue("speed_rez_check"));
gSavedSettings.setU32("SpeedRezInterval", childGetValue("speed_rez_interval").asReal());

View File

@@ -45,7 +45,6 @@
#include "v4color.h"
#include "lluictrlfactory.h"
#include "llcombobox.h"
#include "llsavedsettingsglue.h"
#include "llwind.h"
#include "llviewernetwork.h"
#include "pipeline.h"
@@ -124,8 +123,8 @@ void LLPrefsAscentVanImpl::onCommitColor(LLUICtrl* ctrl, void* user_data)
{
llinfos << "Recreating color message for tag update." << llendl;
LLSavedSettingsGlue::setCOAString("AscentCustomTagLabel", self->childGetValue("custom_tag_label_box"));
LLSavedSettingsGlue::setCOAColor4("AscentCustomTagColor", self->childGetValue("custom_tag_color_swatch"));
gCOASavedSettings->setString("AscentCustomTagLabel", self->childGetValue("custom_tag_label_box"));
gCOASavedSettings->setColor4("AscentCustomTagColor", self->childGetValue("custom_tag_color_swatch"));
gAgent.sendAgentSetAppearance();
gAgent.resetClientTag();
}
@@ -182,7 +181,7 @@ void LLPrefsAscentVanImpl::onCommitCheckBox(LLUICtrl* ctrl, void* user_data)
}
BOOL showCustomOptions;
showCustomOptions = LLSavedSettingsGlue::getCOABOOL("AscentUseCustomTag");
showCustomOptions = gCOASavedSettings->getBOOL("AscentUseCustomTag");
self->childSetValue("customize_own_tag_check", showCustomOptions);
self->childSetEnabled("custom_tag_label_text", showCustomOptions);
self->childSetEnabled("custom_tag_label_box", showCustomOptions);
@@ -203,27 +202,23 @@ void LLPrefsAscentVanImpl::refreshValues()
//Colors
mShowSelfClientTag = gSavedSettings.getBOOL("AscentShowSelfTag");
mShowSelfClientTagColor = gSavedSettings.getBOOL("AscentShowSelfTagColor");
mCustomTagOn = gSavedSettings.getBOOL("AscentUseCustomTag");
mSelectedClient = LLSavedSettingsGlue::getCOAU32("AscentReportClientIndex");
mEffectColor = LLSavedSettingsGlue::getCOAColor4("EffectColor");
BOOL use_custom = LLSavedSettingsGlue::getCOABOOL("AscentUseCustomTag");
mCustomTagOn = gCOASavedSettings->getBOOL("AscentUseCustomTag");
mSelectedClient = gCOASavedSettings->getU32("AscentReportClientIndex");
mEffectColor = gCOASavedSettings->getColor4("EffectColor");
childSetEnabled("custom_tag_label_text", mCustomTagOn);
childSetEnabled("custom_tag_label_box", mCustomTagOn);
childSetEnabled("custom_tag_color_text", mCustomTagOn);
childSetEnabled("custom_tag_color_swatch", mCustomTagOn);
childSetEnabled("custom_tag_label_text", use_custom);
childSetEnabled("custom_tag_label_box", use_custom);
childSetEnabled("custom_tag_color_text", use_custom);
childSetEnabled("custom_tag_color_swatch", use_custom);
mCustomTagLabel = LLSavedSettingsGlue::getCOAString("AscentCustomTagLabel");
mCustomTagColor = LLSavedSettingsGlue::getCOAColor4("AscentCustomTagColor");
mFriendColor = LLSavedSettingsGlue::getCOAColor4("AscentFriendColor");
mLindenColor = LLSavedSettingsGlue::getCOAColor4("AscentLindenColor");
mMutedColor = LLSavedSettingsGlue::getCOAColor4("AscentMutedColor");
mEMColor = LLSavedSettingsGlue::getCOAColor4("AscentEstateOwnerColor");
mCustomColor = LLSavedSettingsGlue::getCOAColor4("MoyMiniMapCustomColor");
mCustomTagLabel = gCOASavedSettings->getString("AscentCustomTagLabel");
mCustomTagColor = gCOASavedSettings->getColor4("AscentCustomTagColor");
mFriendColor = gCOASavedSettings->getColor4("AscentFriendColor");
mLindenColor = gCOASavedSettings->getColor4("AscentLindenColor");
mMutedColor = gCOASavedSettings->getColor4("AscentMutedColor");
mEMColor = gCOASavedSettings->getColor4("AscentEstateOwnerColor");
mCustomColor = gCOASavedSettings->getColor4("MoyMiniMapCustomColor");
}
void LLPrefsAscentVanImpl::refresh()
@@ -251,23 +246,23 @@ void LLPrefsAscentVanImpl::refresh()
getChild<LLColorSwatchCtrl>("muted_color_swatch")->set(mMutedColor);
getChild<LLColorSwatchCtrl>("em_color_swatch")->set(mEMColor);
getChild<LLColorSwatchCtrl>("custom_color_swatch")->set(mCustomColor);
LLSavedSettingsGlue::setCOAColor4("EffectColor", LLColor4::white);
LLSavedSettingsGlue::setCOAColor4("EffectColor", mEffectColor);
gCOASavedSettings->setColor4("EffectColor", LLColor4::white);
gCOASavedSettings->setColor4("EffectColor", mEffectColor);
LLSavedSettingsGlue::setCOAColor4("AscentFriendColor", LLColor4::white);
LLSavedSettingsGlue::setCOAColor4("AscentFriendColor", mFriendColor);
gCOASavedSettings->setColor4("AscentFriendColor", LLColor4::white);
gCOASavedSettings->setColor4("AscentFriendColor", mFriendColor);
LLSavedSettingsGlue::setCOAColor4("AscentLindenColor", LLColor4::white);
LLSavedSettingsGlue::setCOAColor4("AscentLindenColor", mLindenColor);
gCOASavedSettings->setColor4("AscentLindenColor", LLColor4::white);
gCOASavedSettings->setColor4("AscentLindenColor", mLindenColor);
LLSavedSettingsGlue::setCOAColor4("AscentMutedColor", LLColor4::white);
LLSavedSettingsGlue::setCOAColor4("AscentMutedColor", mMutedColor);
gCOASavedSettings->setColor4("AscentMutedColor", LLColor4::white);
gCOASavedSettings->setColor4("AscentMutedColor", mMutedColor);
LLSavedSettingsGlue::setCOAColor4("AscentEstateOwnerColor", LLColor4::white);
LLSavedSettingsGlue::setCOAColor4("AscentEstateOwnerColor", mEMColor);
gCOASavedSettings->setColor4("AscentEstateOwnerColor", LLColor4::white);
gCOASavedSettings->setColor4("AscentEstateOwnerColor", mEMColor);
LLSavedSettingsGlue::setCOAColor4("MoyMiniMapCustomColor", LLColor4::white);
LLSavedSettingsGlue::setCOAColor4("MoyMiniMapCustomColor", mCustomColor);
gCOASavedSettings->setColor4("MoyMiniMapCustomColor", LLColor4::white);
gCOASavedSettings->setColor4("MoyMiniMapCustomColor", mCustomColor);
gAgent.resetClientTag();
}
@@ -279,18 +274,18 @@ void LLPrefsAscentVanImpl::cancel()
childSetValue("tp_sound_check", mPlayTPSound);
childSetValue("disable_logout_screen_check", mShowLogScreens);
LLSavedSettingsGlue::setCOAColor4("EffectColor", LLColor4::white);
LLSavedSettingsGlue::setCOAColor4("EffectColor", mEffectColor);
LLSavedSettingsGlue::setCOAColor4("AscentFriendColor", LLColor4::yellow);
LLSavedSettingsGlue::setCOAColor4("AscentFriendColor", mFriendColor);
LLSavedSettingsGlue::setCOAColor4("AscentLindenColor", LLColor4::yellow);
LLSavedSettingsGlue::setCOAColor4("AscentLindenColor", mLindenColor);
LLSavedSettingsGlue::setCOAColor4("AscentMutedColor", LLColor4::yellow);
LLSavedSettingsGlue::setCOAColor4("AscentMutedColor", mMutedColor);
LLSavedSettingsGlue::setCOAColor4("AscentEstateOwnerColor", LLColor4::yellow);
LLSavedSettingsGlue::setCOAColor4("AscentEstateOwnerColor", mEMColor);
LLSavedSettingsGlue::setCOAColor4("MoyMiniMapCustomColor", LLColor4::yellow);
LLSavedSettingsGlue::setCOAColor4("MoyMiniMapCustomColor", mCustomColor);
gCOASavedSettings->setColor4("EffectColor", LLColor4::white);
gCOASavedSettings->setColor4("EffectColor", mEffectColor);
gCOASavedSettings->setColor4("AscentFriendColor", LLColor4::yellow);
gCOASavedSettings->setColor4("AscentFriendColor", mFriendColor);
gCOASavedSettings->setColor4("AscentLindenColor", LLColor4::yellow);
gCOASavedSettings->setColor4("AscentLindenColor", mLindenColor);
gCOASavedSettings->setColor4("AscentMutedColor", LLColor4::yellow);
gCOASavedSettings->setColor4("AscentMutedColor", mMutedColor);
gCOASavedSettings->setColor4("AscentEstateOwnerColor", LLColor4::yellow);
gCOASavedSettings->setColor4("AscentEstateOwnerColor", mEMColor);
gCOASavedSettings->setColor4("MoyMiniMapCustomColor", LLColor4::yellow);
gCOASavedSettings->setColor4("MoyMiniMapCustomColor", mCustomColor);
}
void LLPrefsAscentVanImpl::apply()
@@ -311,8 +306,8 @@ void LLPrefsAscentVanImpl::apply()
if (client_index != mSelectedClient)
{
client_uuid = combo->getSelectedValue().asString();
LLSavedSettingsGlue::setCOAString("AscentReportClientUUID", client_uuid);
LLSavedSettingsGlue::setCOAU32("AscentReportClientIndex", client_index);
gCOASavedSettings->setString("AscentReportClientUUID", client_uuid);
gCOASavedSettings->setU32("AscentReportClientIndex", client_index);
LLVOAvatar* avatar = gAgent.getAvatarObject();
if (!avatar) return;
@@ -324,15 +319,15 @@ void LLPrefsAscentVanImpl::apply()
gSavedSettings.setBOOL("AscentShowSelfTag", childGetValue("show_self_tag_check"));
gSavedSettings.setBOOL("AscentShowSelfTagColor", childGetValue("show_self_tag_color_check"));
LLSavedSettingsGlue::setCOAColor4("EffectColor", childGetValue("effect_color_swatch"));
LLSavedSettingsGlue::setCOAColor4("AscentFriendColor", childGetValue("friend_color_swatch"));
LLSavedSettingsGlue::setCOAColor4("AscentLindenColor", childGetValue("linden_color_swatch"));
LLSavedSettingsGlue::setCOAColor4("AscentMutedColor", childGetValue("muted_color_swatch"));
LLSavedSettingsGlue::setCOAColor4("AscentEstateOwnerColor", childGetValue("em_color_swatch"));
LLSavedSettingsGlue::setCOAColor4("MoyMiniMapCustomColor", childGetValue("custom_color_swatch"));
LLSavedSettingsGlue::setCOABOOL("AscentUseCustomTag", childGetValue("customize_own_tag_check"));
LLSavedSettingsGlue::setCOAString("AscentCustomTagLabel", childGetValue("custom_tag_label_box"));
LLSavedSettingsGlue::setCOAColor4("AscentCustomTagColor", childGetValue("custom_tag_color_swatch"));
gCOASavedSettings->setColor4("EffectColor", childGetValue("effect_color_swatch"));
gCOASavedSettings->setColor4("AscentFriendColor", childGetValue("friend_color_swatch"));
gCOASavedSettings->setColor4("AscentLindenColor", childGetValue("linden_color_swatch"));
gCOASavedSettings->setColor4("AscentMutedColor", childGetValue("muted_color_swatch"));
gCOASavedSettings->setColor4("AscentEstateOwnerColor", childGetValue("em_color_swatch"));
gCOASavedSettings->setColor4("MoyMiniMapCustomColor", childGetValue("custom_color_swatch"));
gCOASavedSettings->setBOOL("AscentUseCustomTag", childGetValue("customize_own_tag_check"));
gCOASavedSettings->setString("AscentCustomTagLabel", childGetValue("custom_tag_label_box"));
gCOASavedSettings->setColor4("AscentCustomTagColor", childGetValue("custom_tag_color_swatch"));
refreshValues();
}

View File

@@ -164,11 +164,15 @@ Matrox .*Matrox.* 0 0
Mesa .*Mesa.* 0 0
NVIDIA GT 120 .*NVIDIA.*GeForce.*GT.*12.* 2 1
NVIDIA GT 130 .*NVIDIA.*GeForce.*GT.*13.* 3 1
NVIDIA GT 220 .*NVIDIA.*GeForce.*GT.*22.* 3 1
NVIDIA GTS 250 .*NVIDIA.*GeForce.*GTS.*25.* 3 1
NVIDIA GTX 260 .*NVIDIA.*GeForce.*GTX.*26.* 3 1
NVIDIA GTX 270 .*NVIDIA.*GeForce.*GTX.*27.* 3 1
NVIDIA GTX 280 .*NVIDIA.*GeForce.*GTX.*28.* 3 1
NVIDIA GTX 290 .*NVIDIA.*GeForce.*GTX.*29.* 3 1
NVIDIA GTX 460 .*NVIDIA.*GeForce.*GTX.*46.* 3 1
NVIDIA GTX 470 .*NVIDIA.*GeForce.*GTX.*47.* 3 1
NVIDIA GTX 480 .*NVIDIA.*GeForce.*GTX.*48.* 3 1
NVIDIA C51 .*NVIDIA.*C51.* 0 1
NVIDIA G72 .*NVIDIA.*G72.* 1 1
NVIDIA G73 .*NVIDIA.*G73.* 1 1

View File

@@ -95,7 +95,6 @@
#include "llnotify.h"
#include "llprimitive.h" //For new client id method -HgB
#include "llquantize.h"
#include "llsavedsettingsglue.h" //For Client-Or-Account settings
#include "llsdutil.h"
#include "llselectmgr.h"
#include "llsky.h"
@@ -475,7 +474,7 @@ void LLAgent::init()
// LLDebugVarMessageBox::show("Camera Lag", &CAMERA_FOCUS_HALF_LIFE, 0.5f, 0.01f);
mEffectColor = LLSavedSettingsGlue::getCOAColor4("EffectColor");
mEffectColor = gCOASavedSettings->getColor4("EffectColor");
mInitialized = TRUE;
}
@@ -7537,7 +7536,7 @@ void LLAgent::sendAgentSetAppearance()
LLColor4 color;
if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount"))
{
color = LLSavedSettingsGlue::setCOAColor4("AscentCustomTagColor");
color = gCOASavedSettings->setColor4("AscentCustomTagColor");
}
else
{

View File

@@ -192,7 +192,7 @@ void LLDrawPoolWLSky::renderStars(void) const
void LLDrawPoolWLSky::renderSkyClouds(F32 camHeightLocal) const
{
if (gPipeline.canUseWindLightShaders() && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS))
if (gPipeline.canUseWindLightShaders() && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_WL_CLOUDS))
{
LLGLSLShader* shader =
LLPipeline::sUnderWaterRender ?

View File

@@ -45,7 +45,6 @@
#include "llagent.h"
#include "llcombobox.h"
#include "llnotify.h"
#include "llsavedsettingsglue.h"
#include "llviewerimagelist.h"
#include "llviewerparcelmgr.h"
#include "llviewerregion.h"
@@ -81,7 +80,7 @@ LLFloaterAuction::LLFloaterAuction() :
childSetValue("fence_check",
LLSD( gSavedSettings.getBOOL("AuctionShowFence") ) );
childSetCommitCallback("fence_check",
LLSavedSettingsGlue::setBOOL, (void*)"AuctionShowFence");
onCommitControlSetting(gSavedSettings), (void*)"AuctionShowFence");
childSetAction("snapshot_btn", onClickSnapshot, this);
childSetAction("ok_btn", onClickOK, this);

View File

@@ -31,7 +31,6 @@
#include "llregionflags.h"
#include "llfloaterreporter.h"
#include "llagent.h"
#include "llsavedsettingsglue.h"
#include "llviewerregion.h"
#include "lltracker.h"
#include "llviewerstats.h"
@@ -708,22 +707,22 @@ void LLFloaterAvatarList::refreshAvatarList()
//Lindens are always more Linden than your friend, make that take precedence
if(LLMuteList::getInstance()->isLinden(av_name))
{
element["columns"][LIST_AVATAR_NAME]["color"] = LLSavedSettingsGlue::getCOAColor4("AscentLindenColor").getValue();
element["columns"][LIST_AVATAR_NAME]["color"] = gCOASavedSettings->getColor4("AscentLindenColor").getValue();
}
//check if they are an estate owner at their current position
else if(estate_owner.notNull() && av_id == estate_owner)
{
element["columns"][LIST_AVATAR_NAME]["color"] = LLSavedSettingsGlue::getCOAColor4("AscentEstateOwnerColor").getValue();
element["columns"][LIST_AVATAR_NAME]["color"] = gCOASavedSettings->getColor4("AscentEstateOwnerColor").getValue();
}
//without these dots, SL would suck.
else if(is_agent_friend(av_id))
{
element["columns"][LIST_AVATAR_NAME]["color"] = LLSavedSettingsGlue::getCOAColor4("AscentFriendColor").getValue();
element["columns"][LIST_AVATAR_NAME]["color"] = gCOASavedSettings->getColor4("AscentFriendColor").getValue();
}
//big fat jerkface who is probably a jerk, display them as such.
else if(LLMuteList::getInstance()->isMuted(av_id))
{
element["columns"][LIST_AVATAR_NAME]["color"] = LLSavedSettingsGlue::getCOAColor4("AscentMutedColor").getValue();
element["columns"][LIST_AVATAR_NAME]["color"] = gCOASavedSettings->getColor4("AscentMutedColor").getValue();
}

View File

@@ -54,7 +54,6 @@
#include "llviewerdisplay.h"
#include "llviewercontrol.h"
#include "llviewerwindow.h"
#include "llsavedsettingsglue.h"
#include "llwaterparamset.h"
#include "llwaterparammanager.h"

View File

@@ -53,7 +53,6 @@
#include "llviewerdisplay.h"
#include "llviewercontrol.h"
#include "llviewerwindow.h"
#include "llsavedsettingsglue.h"
#include "llwlparamset.h"
#include "llwlparammanager.h"
@@ -210,7 +209,7 @@ void LLFloaterWindLight::initCallbacks(void) {
childSetCommitCallback("WLCloudScrollX", onCloudScrollXMoved, NULL);
childSetCommitCallback("WLCloudScrollY", onCloudScrollYMoved, NULL);
childSetCommitCallback("WLDistanceMult", onFloatControlMoved, &param_mgr->mDistanceMult);
childSetCommitCallback("DrawClassicClouds", LLSavedSettingsGlue::setBOOL, (void*)"SkyUseClassicClouds");
childSetCommitCallback("DrawClassicClouds", onCommitControlSetting(gSavedSettings), (void*)"SkyUseClassicClouds");
// WL Top
childSetAction("WLDayCycleMenuButton", onOpenDayCycle, NULL);

View File

@@ -1663,7 +1663,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
glClipPlane(GL_CLIP_PLANE0, plane);
BOOL particles = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES);
BOOL clouds = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS);
BOOL clouds = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS);
if (particles)
{
@@ -1671,7 +1671,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
}
if (clouds)
{
LLPipeline::toggleRenderType(LLPipeline::RENDER_TYPE_CLOUDS);
LLPipeline::toggleRenderType(LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS);
}
//stencil in volumes
@@ -1695,7 +1695,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
}
if (clouds)
{
LLPipeline::toggleRenderType(LLPipeline::RENDER_TYPE_CLOUDS);
LLPipeline::toggleRenderType(LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS);
}
gGL.setColorMask(true, false);

View File

@@ -52,7 +52,6 @@
#include "llframetimer.h"
#include "lltracker.h"
#include "llmenugl.h"
#include "llsavedsettingsglue.h"
#include "llsurface.h"
#include "lltextbox.h"
#include "lluictrlfactory.h"
@@ -361,10 +360,10 @@ void LLNetMap::draw()
// LLColor4 mapcolor = gAvatarMapColor;
LLColor4 standard_color = gColors.getColor( "MapAvatar" );
LLColor4 friend_color = LLSavedSettingsGlue::getCOAColor4("AscentFriendColor");
LLColor4 em_color = LLSavedSettingsGlue::getCOAColor4("AscentEstateOwnerColor");
LLColor4 linden_color = LLSavedSettingsGlue::getCOAColor4("AscentLindenColor");
LLColor4 muted_color = LLSavedSettingsGlue::getCOAColor4("AscentMutedColor");
LLColor4 friend_color = gCOASavedSettings->getColor4("AscentFriendColor");
LLColor4 em_color = gCOASavedSettings->getColor4("AscentEstateOwnerColor");
LLColor4 linden_color = gCOASavedSettings->getColor4("AscentLindenColor");
LLColor4 muted_color = gCOASavedSettings->getColor4("AscentMutedColor");
std::vector<LLUUID> avatar_ids;
std::vector<LLVector3d> positions;

View File

@@ -38,7 +38,7 @@
#include "lluictrl.h"
#include "llviewercontrol.h"
/*
void LLSavedSettingsGlue::setBOOL(LLUICtrl* ctrl, void* data)
{
const char* name = (const char*)data;
@@ -73,12 +73,20 @@ void LLSavedSettingsGlue::setString(LLUICtrl* ctrl, void* data)
LLSD value = ctrl->getValue();
gSavedSettings.setString(name, value.asString());
}
*/
/*
//Begin Ascent SavedSettings/PerAccountSettings handling
//Get
BOOL LLSavedSettingsGlue::getCOABOOL(std::string name)
LLControlVariable *gCOASavedSettings->getControl(const std::string &name)
{
if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount"))
return gSavedSettings.getControl(name);
else
return gSavedPerAccountSettings.getControl(name);
}
BOOL gCOASavedSettings->getBOOL(const std::string &name)
{
if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount"))
return gSavedSettings.getBOOL(name);
@@ -86,7 +94,7 @@ BOOL LLSavedSettingsGlue::getCOABOOL(std::string name)
return gSavedPerAccountSettings.getBOOL(name);
}
S32 LLSavedSettingsGlue::getCOAS32(std::string name)
S32 gCOASavedSettings->getS32(const std::string &name)
{
if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount"))
return gSavedSettings.getS32(name);
@@ -94,7 +102,7 @@ S32 LLSavedSettingsGlue::getCOAS32(std::string name)
return gSavedPerAccountSettings.getS32(name);
}
F32 LLSavedSettingsGlue::getCOAF32(std::string name)
F32 gCOASavedSettings->getF32(const std::string &name)
{
if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount"))
return gSavedSettings.getF32(name);
@@ -102,7 +110,7 @@ F32 LLSavedSettingsGlue::getCOAF32(std::string name)
return gSavedPerAccountSettings.getF32(name);
}
U32 LLSavedSettingsGlue::getCOAU32(std::string name)
U32 gCOASavedSettings->getU32(const std::string &name)
{
if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount"))
return gSavedSettings.getU32(name);
@@ -110,7 +118,7 @@ U32 LLSavedSettingsGlue::getCOAU32(std::string name)
return gSavedPerAccountSettings.getU32(name);
}
std::string LLSavedSettingsGlue::getCOAString(std::string name)
std::string gCOASavedSettings->getString(const std::string &name)
{
if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount"))
return gSavedSettings.getString(name);
@@ -118,7 +126,7 @@ std::string LLSavedSettingsGlue::getCOAString(std::string name)
return gSavedPerAccountSettings.getString(name);
}
LLColor4 LLSavedSettingsGlue::getCOAColor4(std::string name)
LLColor4 gCOASavedSettings->getColor4(const std::string &name)
{
if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount"))
return gSavedSettings.getColor4(name);
@@ -128,7 +136,7 @@ LLColor4 LLSavedSettingsGlue::getCOAColor4(std::string name)
//Set
void LLSavedSettingsGlue::setCOABOOL(std::string name, BOOL value)
void gCOASavedSettings->setBOOL(const std::string &name, BOOL value)
{
if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount"))
gSavedSettings.setBOOL(name, value);
@@ -136,7 +144,7 @@ void LLSavedSettingsGlue::setCOABOOL(std::string name, BOOL value)
gSavedPerAccountSettings.setBOOL(name, value);
}
void LLSavedSettingsGlue::setCOAS32(std::string name, S32 value)
void gCOASavedSettings->setS32(const std::string &name, S32 value)
{
if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount"))
gSavedSettings.setS32(name, value);
@@ -144,7 +152,7 @@ void LLSavedSettingsGlue::setCOAS32(std::string name, S32 value)
gSavedPerAccountSettings.setS32(name, value);
}
void LLSavedSettingsGlue::setCOAF32(std::string name, F32 value)
void gCOASavedSettings->setF32(const std::string &name, F32 value)
{
if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount"))
gSavedSettings.setF32(name, value);
@@ -152,7 +160,7 @@ void LLSavedSettingsGlue::setCOAF32(std::string name, F32 value)
gSavedPerAccountSettings.setF32(name, value);
}
void LLSavedSettingsGlue::setCOAU32(std::string name, U32 value)
void gCOASavedSettings->setU32(const std::string &name, U32 value)
{
if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount"))
gSavedSettings.setU32(name, value);
@@ -160,7 +168,7 @@ void LLSavedSettingsGlue::setCOAU32(std::string name, U32 value)
gSavedPerAccountSettings.setU32(name, value);
}
void LLSavedSettingsGlue::setCOAString(std::string name, std::string value)
void gCOASavedSettings->setString(const std::string &name, std::string value)
{
if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount"))
gSavedSettings.setString(name, value);
@@ -168,10 +176,10 @@ void LLSavedSettingsGlue::setCOAString(std::string name, std::string value)
gSavedPerAccountSettings.setString(name, value);
}
void LLSavedSettingsGlue::setCOAColor4(std::string name, LLColor4 value)
void gCOASavedSettings->setColor4(const std::string &name, LLColor4 value)
{
if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount"))
gSavedSettings.setColor4(name, value);
else
gSavedPerAccountSettings.setColor4(name, value);
}
}*/

View File

@@ -42,6 +42,7 @@ class LLUICtrl;
class LLSavedSettingsGlue
{
public:
/*
static void setBOOL(LLUICtrl* ctrl, void* name);
static void setS32(LLUICtrl* ctrl, void* name);
static void setF32(LLUICtrl* ctrl, void* name);
@@ -49,20 +50,21 @@ public:
static void setString(LLUICtrl* ctrl, void* name);
//Ascent Client-Or-Account Settings Get
static BOOL getCOABOOL(std::string name);
static S32 getCOAS32(std::string name);
static F32 getCOAF32(std::string name);
static U32 getCOAU32(std::string name);
static std::string getCOAString(std::string name);
static LLColor4 getCOAColor4(std::string name);
static LLControlVariable *gCOASavedSettings->getControl(const std::string &name);
static BOOL getCOABOOL(const std::string &name);
static S32 getCOAS32(const std::string &name);
static F32 getCOAF32(const std::string &name);
static U32 getCOAU32(const std::string &name);
static std::string getCOAString(const std::string &name);
static LLColor4 getCOAColor4(const std::string &name);
//Ascent Client-Or-Account Settings Set
static void setCOABOOL(std::string name, BOOL value);
static void setCOAS32(std::string name, S32 value);
static void setCOAF32(std::string name, F32 value);
static void setCOAU32(std::string name, U32 value);
static void setCOAString(std::string name, std::string value);
static void setCOAColor4(std::string name, LLColor4 value);
static void setCOABOOL(const std::string &name, BOOL value);
static void setCOAS32(const std::string &name, S32 value);
static void setCOAF32(const std::string &name, F32 value);
static void setCOAU32(const std::string &name, U32 value);
static void setCOAString(const std::string &name, std::string value);
static void setCOAColor4(const std::string &name, LLColor4 value);*/
};
#endif

View File

@@ -2641,13 +2641,11 @@ bool idle_startup()
LLFloaterBeacons::showInstance(); DIE
}*/
if (!gSavedSettings.getBOOL("CloudsEnabled") && !gNoRender)
{
LLPipeline::toggleRenderTypeControl((void*)LLPipeline::RENDER_TYPE_CLOUDS);
}
if (!gNoRender)
{
//Set up cloud rendertypes. Passed argument is unused.
handleCloudSettingsChanged(LLSD());
// Move the progress view in front of the UI
gViewerWindow->moveProgressViewToFront();

View File

@@ -1419,7 +1419,7 @@ bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, con
}
else if (w*h*c > 0)
{
// If the requester knows the dimentions of the image,
// If the requester knows the dimensions of the image,
// this will calculate how much data we need without having to parse the header
desired_size = LLImageJ2C::calcDataSizeJ2C(w, h, c, desired_discard);

View File

@@ -71,6 +71,7 @@
#include "llvowlsky.h"
#include "llrender.h"
#include "llfloaterchat.h"
#include "llviewerobjectlist.h"
#include "emeraldboobutils.h"
#ifdef TOGGLE_HACKED_GODLIKE_VIEWER
@@ -81,6 +82,7 @@ BOOL gHackGodmode = FALSE;
std::map<std::string, LLControlGroup*> gSettings;
LLControlGroup gSavedSettings; // saved at end of session
LLControlGroup gSavedPerAccountSettings; // saved at end of session
LLControlGroup *gCOASavedSettings = &gSavedSettings; //Ascent Client-Or-Account
LLControlGroup gColors; // read-only
LLControlGroup gCrashSettings; // saved at end of session
@@ -485,7 +487,40 @@ bool handleTranslateChatPrefsChanged(const LLSD& newvalue)
return true;
}
bool handleCloudSettingsChanged(const LLSD& newvalue)
{
bool bCloudsEnabled = gSavedSettings.getBOOL("CloudsEnabled");
if((bool)LLPipeline::hasRenderTypeControl((void*)LLPipeline::RENDER_TYPE_WL_CLOUDS)!=bCloudsEnabled)
LLPipeline::toggleRenderTypeControl((void*)LLPipeline::RENDER_TYPE_WL_CLOUDS);
if( !gSavedSettings.getBOOL("SkyUseClassicClouds") ) bCloudsEnabled = false;
if((bool)LLPipeline::hasRenderTypeControl((void*)LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS)!=bCloudsEnabled )
LLPipeline::toggleRenderTypeControl((void*)LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS);
return true;
}
bool handleAscentCOAChange(const LLSD& newvalue)
{
gCOASavedSettings = newvalue.asBoolean() ? &gSavedPerAccountSettings : &gSavedSettings;
return true;
}
bool handleAscentSelfTag(const LLSD& newvalue)
{
if(gAgent.getAvatarObject())
gAgent.getAvatarObject()->mClientTag = "";
return true;
}
bool handleAscentGlobalTag(const LLSD& newvalue)
{
S32 object_count = gObjectList.getNumObjects();
for (S32 i = 0; i < object_count; i++)
{
LLViewerObject *objectp = gObjectList.getObject(i);
if (objectp && objectp->isAvatar())
((LLVOAvatar*)objectp)->mClientTag = "";
}
return true;
}
////////////////////////////////////////////////////////////////////////////
void settings_setup_listeners()
@@ -624,7 +659,23 @@ void settings_setup_listeners()
gSavedSettings.getControl("VoiceOutputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
gSavedSettings.getControl("AudioLevelMic")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
gSavedSettings.getControl("TranslateChat")->getSignal()->connect(boost::bind(&handleTranslateChatPrefsChanged, _1));
gSavedSettings.getControl("TranslateChat")->getSignal()->connect(boost::bind(&handleTranslateChatPrefsChanged, _1));
gSavedSettings.getControl("CloudsEnabled")->getSignal()->connect(boost::bind(&handleCloudSettingsChanged, _1));
gSavedSettings.getControl("SkyUseClassicClouds")->getSignal()->connect(boost::bind(&handleCloudSettingsChanged, _1));
gSavedSettings.getControl("AscentStoreSettingsPerAccount")->getSignal()->connect(boost::bind(&handleAscentCOAChange,_1));
gSavedSettings.getControl("AscentShowSelfTag")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1));
gSavedSettings.getControl("AscentShowSelfTagColor")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1));
gSavedSettings.getControl("AscentUseTag")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1));
gCOASavedSettings->getControl("AscentUseCustomTag")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1));
gCOASavedSettings->getControl("AscentCustomTagColor")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1));
gCOASavedSettings->getControl("AscentCustomTagLabel")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1));
gCOASavedSettings->getControl("AscentReportClientUUID")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1));
gSavedSettings.getControl("AscentShowFriendsTag")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1));
gSavedSettings.getControl("AscentShowOthersTag")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1));
gSavedSettings.getControl("AscentShowOthersTagColor")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1));
gSavedSettings.getControl("AscentUseStatusColors")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1));
}
template <> eControlType get_control_type<U32>(const U32& in, LLSD& out)
@@ -706,7 +757,6 @@ template <> eControlType get_control_type<LLSD>(const LLSD& in, LLSD& out)
return TYPE_LLSD;
}
#if TEST_CACHED_CONTROL
#define DECL_LLCC(T, V) static LLCachedControl<T> mySetting_##T("TestCachedControl"#T, V)

View File

@@ -35,6 +35,7 @@
#include <map>
#include "llcontrol.h"
#include "lluictrl.h"
// Enabled this definition to compile a 'hacked' viewer that
// allows a hacked godmode to be toggled on and off.
@@ -54,6 +55,7 @@ void create_graphics_group(LLControlGroup& group);
// saved at end of session
extern LLControlGroup gSavedSettings;
extern LLControlGroup *gCOASavedSettings;
extern LLControlGroup gSavedPerAccountSettings;
// Read-only
@@ -74,6 +76,8 @@ eControlType get_control_type(const T& in, LLSD& out)
return TYPE_COUNT;
}
bool handleCloudSettingsChanged(const LLSD& newvalue);
//! Publish/Subscribe object to interact with LLControlGroups.
//! An LLCachedControl instance to connect to a LLControlVariable
@@ -171,6 +175,12 @@ template <> eControlType get_control_type<LLColor3>(const LLColor3& in, LLSD& ou
template <> eControlType get_control_type<LLColor4U>(const LLColor4U& in, LLSD& out);
template <> eControlType get_control_type<LLSD>(const LLSD& in, LLSD& out);
//A template would be a little awkward to use here.. so.. a preprocessor macro. Alas. onCommitControlSetting(gSavedSettings) etc.
inline void onCommitControlSetting_gSavedSettings(LLUICtrl* ctrl, void* name) {gSavedSettings.setValue((const char*)name,ctrl->getValue());}
inline void onCommitControlSetting_gSavedPerAccountSettings(LLUICtrl* ctrl, void* name) {gSavedPerAccountSettings.setValue((const char*)name,ctrl->getValue());}
inline void onCommitControlSetting_gCOASavedSettings(LLUICtrl* ctrl, void* name) {gCOASavedSettings->setValue((const char*)name,ctrl->getValue());}
#define onCommitControlSetting(controlgroup) onCommitControlSetting_##controlgroup
//#define TEST_CACHED_CONTROL 1
#ifdef TEST_CACHED_CONTROL
void test_cached_control();

View File

@@ -1299,10 +1299,10 @@ void init_debug_rendering_menu(LLMenuGL* menu)
&LLPipeline::toggleRenderTypeControl, NULL,
&LLPipeline::hasRenderTypeControl,
(void*)LLPipeline::RENDER_TYPE_GRASS, '0', MASK_CONTROL|MASK_ALT|MASK_SHIFT));
sub_menu->append(new LLMenuItemCheckGL("Clouds",
&LLPipeline::toggleRenderTypeControl, NULL,
&LLPipeline::hasRenderTypeControl,
(void*)LLPipeline::RENDER_TYPE_CLOUDS, '-', MASK_CONTROL|MASK_ALT| MASK_SHIFT));
sub_menu->append(new LLMenuItemCheckGL("Clouds", //This clobbers skyuseclassicclouds, but.. big deal.
&LLPipeline::toggleRenderPairedTypeControl, NULL,
&LLPipeline::hasRenderPairedTypeControl,
(void*)(1<<LLPipeline::RENDER_TYPE_WL_CLOUDS | 1<<LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS), '-', MASK_CONTROL|MASK_ALT| MASK_SHIFT));
sub_menu->append(new LLMenuItemCheckGL("Particles",
&LLPipeline::toggleRenderTypeControl, NULL,
&LLPipeline::hasRenderTypeControl,

View File

@@ -88,7 +88,7 @@
#include "llvoicevisualizer.h" // Ventrella
#include "llsdserialize.h" //For the client definitions
#include "llsavedsettingsglue.h" //For optionally per-account settings
// <edit>
#include "llfloaterexploreanimations.h"
#include "llao.h"
@@ -3332,7 +3332,7 @@ void LLVOAvatar::getClientInfo(std::string& client, LLColor4& color, BOOL useCom
std::string uuid_str = getTE(TEX_HEAD_BODYPAINT)->getID().asString(); //UUID of the head texture
if (mIsSelf)
{
BOOL showCustomTag = LLSavedSettingsGlue::getCOABOOL("AscentUseCustomTag");
BOOL showCustomTag = gCOASavedSettings->getBOOL("AscentUseCustomTag");
if (!gSavedSettings.getBOOL("AscentShowSelfTagColor"))
{
color = gColors.getColor( "AvatarNameColor" );
@@ -3340,12 +3340,12 @@ void LLVOAvatar::getClientInfo(std::string& client, LLColor4& color, BOOL useCom
}
else if (showCustomTag)
{
color = LLSavedSettingsGlue::getCOAColor4("AscentCustomTagColor");
client = LLSavedSettingsGlue::getCOAString("AscentCustomTagLabel");
color = gCOASavedSettings->getColor4("AscentCustomTagColor");
client = gCOASavedSettings->getString("AscentCustomTagLabel");
return;
}
else if (gSavedSettings.getBOOL("AscentUseTag"))
uuid_str = LLSavedSettingsGlue::getCOAString("AscentReportClientUUID");
uuid_str = gCOASavedSettings->getString("AscentReportClientUUID");
}
if(getTEImage(TEX_HEAD_BODYPAINT)->getID() == IMG_DEFAULT_AVATAR)
{
@@ -3587,6 +3587,8 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
llinfos << "Using Emerald-style client identifier." << llendl;
//The old client identification. Used only if the new method doesn't exist, so that it isn't automatically overwritten. -HgB
getClientInfo(mClientTag,mClientColor);
if(mClientTag == "")
client = "?"; //prevent console spam..
}
}
@@ -3617,22 +3619,22 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
//Lindens are always more Linden than your friend, make that take precedence
if(LLMuteList::getInstance()->isLinden(name))
{
mClientColor = LLSavedSettingsGlue::getCOAColor4("AscentLindenColor").getValue();
mClientColor = gCOASavedSettings->getColor4("AscentLindenColor").getValue();
}
//check if they are an estate owner at their current position
else if(estate_owner.notNull() && this->getID() == estate_owner)
{
mClientColor = LLSavedSettingsGlue::getCOAColor4("AscentEstateOwnerColor").getValue();
mClientColor = gCOASavedSettings->getColor4("AscentEstateOwnerColor").getValue();
}
//without these dots, SL would suck.
else if (LLAvatarTracker::instance().getBuddyInfo(this->getID()) != NULL)
{
mClientColor = LLSavedSettingsGlue::getCOAColor4("AscentFriendColor");
mClientColor = gCOASavedSettings->getColor4("AscentFriendColor");
}
//big fat jerkface who is probably a jerk, display them as such.
else if(LLMuteList::getInstance()->isMuted(this->getID()))
{
mClientColor = LLSavedSettingsGlue::getCOAColor4("AscentMutedColor").getValue();
mClientColor = gCOASavedSettings->getColor4("AscentMutedColor").getValue();
}
}

View File

@@ -80,7 +80,7 @@ BOOL LLVOClouds::isActive() const
BOOL LLVOClouds::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
{
if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS)))
if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS)))
{
return TRUE;
}
@@ -110,7 +110,7 @@ LLDrawable* LLVOClouds::createDrawable(LLPipeline *pipeline)
{
pipeline->allocDrawable(this);
mDrawable->setLit(FALSE);
mDrawable->setRenderType(LLPipeline::RENDER_TYPE_CLOUDS);
mDrawable->setRenderType(LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS);
return mDrawable;
}
@@ -118,7 +118,7 @@ LLDrawable* LLVOClouds::createDrawable(LLPipeline *pipeline)
BOOL LLVOClouds::updateGeometry(LLDrawable *drawable)
{
LLFastTimer ftm(LLFastTimer::FTM_UPDATE_CLOUDS);
if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS)))
if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS)))
{
return TRUE;
}
@@ -286,7 +286,7 @@ void LLVOClouds::updateDrawable(BOOL force_damped)
LLCloudPartition::LLCloudPartition()
{
mDrawableType = LLPipeline::RENDER_TYPE_CLOUDS;
mDrawableType = LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS;
mPartitionType = LLViewerRegion::PARTITION_CLOUD;
}

View File

@@ -4471,6 +4471,25 @@ BOOL LLPipeline::toggleRenderTypeControlNegated(void* data)
return !gPipeline.hasRenderType(type);
}
//static
BOOL LLPipeline::hasRenderPairedTypeControl(void* data)
{
U32 typeflags = (U32)(intptr_t)data;
return (gPipeline.mRenderTypeMask & typeflags);
}
//static
void LLPipeline::toggleRenderPairedTypeControl(void *data)
{
U32 typeflags = (U32)(intptr_t)data;
if(typeflags & RENDER_TYPE_WATER)
typeflags |= RENDER_TYPE_VOIDWATER;
if( gPipeline.mRenderTypeMask & typeflags)
gPipeline.mRenderTypeMask &= ~typeflags;
else
gPipeline.mRenderTypeMask |= typeflags;
}
//static
void LLPipeline::toggleRenderDebug(void* data)
{
@@ -5752,7 +5771,8 @@ void LLPipeline::renderDeferredLighting()
U32 render_mask = mRenderTypeMask;
mRenderTypeMask = mRenderTypeMask &
((1 << LLPipeline::RENDER_TYPE_SKY) |
(1 << LLPipeline::RENDER_TYPE_CLOUDS) |
(1 << LLPipeline::RENDER_TYPE_WL_CLOUDS) |
(1 << LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS) |
(1 << LLPipeline::RENDER_TYPE_WL_SKY) |
(1 << LLPipeline::RENDER_TYPE_ALPHA) |
(1 << LLPipeline::RENDER_TYPE_AVATAR) |
@@ -5909,7 +5929,8 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
updateCull(camera, result);
stateSort(camera, result);
mRenderTypeMask = tmp & ((1 << LLPipeline::RENDER_TYPE_SKY) |
(1 << LLPipeline::RENDER_TYPE_CLOUDS) |
(1 << LLPipeline::RENDER_TYPE_WL_CLOUDS) |
(1 << LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS) |
(1 << LLPipeline::RENDER_TYPE_WL_SKY));
renderGeom(camera, TRUE);
mRenderTypeMask = tmp;
@@ -5921,7 +5942,8 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
(1<<LLPipeline::RENDER_TYPE_VOIDWATER) |
(1<<LLPipeline::RENDER_TYPE_GROUND) |
(1<<LLPipeline::RENDER_TYPE_SKY) |
(1<<LLPipeline::RENDER_TYPE_CLOUDS));
(1<<LLPipeline::RENDER_TYPE_WL_CLOUDS) |
(1<<LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS));
if (gSavedSettings.getBOOL("RenderWaterReflections"))
{ //mask out selected geometry based on reflection detail
@@ -5974,7 +5996,8 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
{
mRenderTypeMask &= ~((1<<LLPipeline::RENDER_TYPE_GROUND) |
(1<<LLPipeline::RENDER_TYPE_SKY) |
(1<<LLPipeline::RENDER_TYPE_CLOUDS) |
(1<<LLPipeline::RENDER_TYPE_WL_CLOUDS) |
(1<<LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS) |
(1<<LLPipeline::RENDER_TYPE_WL_SKY));
}
LLViewerCamera::updateFrustumPlanes(camera);

View File

@@ -256,6 +256,8 @@ public:
static void toggleRenderDebugFeature(void* data);
static void toggleRenderTypeControl(void* data);
static BOOL toggleRenderTypeControlNegated(void* data);
static BOOL hasRenderPairedTypeControl(void* data);
static void toggleRenderPairedTypeControl(void* data);
static BOOL toggleRenderDebugControl(void* data);
static BOOL toggleRenderDebugFeatureControl(void* data);
@@ -323,7 +325,8 @@ public:
RENDER_TYPE_HUD = LLDrawPool::NUM_POOL_TYPES,
RENDER_TYPE_VOLUME,
RENDER_TYPE_PARTICLES,
RENDER_TYPE_CLOUDS,
RENDER_TYPE_WL_CLOUDS,
RENDER_TYPE_CLASSIC_CLOUDS,
RENDER_TYPE_HUD_PARTICLES
};

View File

@@ -311,7 +311,12 @@ Use #f for user's first name, #l for last name,
label="Enable Clouds" left="10"
mouse_opaque="true" name="enable_clouds" radio_style="false"
width="400" />
<check_box bottom_delta="-20" control_name="SpeedRez" enabled="true"
<check_box bottom_delta="-20" left_delta="10" control_name="SkyUseClassicClouds" enabled="true"
follows="left|top" font="SansSerifSmall" height="16" initial_value="true"
label="Enable Classic Clouds" left="10"
mouse_opaque="true" name="enable_classic_clouds" radio_style="false"
width="400" />
<check_box bottom_delta="-20" left_delta="-10" control_name="SpeedRez" enabled="true"
follows="left|top" font="SansSerifSmall" height="16" initial_value="false"
label="Enable speed-rezzing via draw distance stepping" left="10"
mouse_opaque="true" name="speed_rez_check" radio_style="false"