Add support for drop-in cloud noise image replacements (8-bit grayscale targa w/ power of 2 size ONLY)

Move clouds2.tga to clouds/Default.tga
meow-7.2.2
Cinders 2013-01-21 22:30:09 -07:00
parent ad3d3f7f9f
commit e855f32b6a
6 changed files with 63 additions and 2 deletions

View File

@ -19780,5 +19780,16 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Backup</key>
<integer>0</integer>
</map>
<key>FSCloudTexture</key>
<map>
<key>Comment</key>
<string>Windlight cloud texture (don't edit by hand)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>Default.tga</string>
</map>
</map>
</llsd>

View File

@ -12,6 +12,7 @@
#include "llvoavatar.h"
#include "llvoavatarself.h"
#include "llspinctrl.h"
#include "lldiriterator.h" // <FS:CR> for populating the cloud combo
static LLRegisterPanelClassWrapper<PanelPreferenceFirestorm> t_pref_fs("panel_preference_firestorm");
@ -45,6 +46,7 @@ BOOL PanelPreferenceFirestorm::postBuild()
getChild<LLUICtrl>("UseEnvironmentFromRegionAlways")->setCommitCallback(boost::bind(&PanelPreferenceFirestorm::onUseEnvironmentFromRegionAlways, this));
// init the enable state of the related wl prefs
onUseEnvironmentFromRegionAlways();
populateCloudCombo();
return LLPanelPreference::postBuild();
}
@ -252,3 +254,25 @@ void PanelPreferenceFirestorm::applyTagCombos()
if(change) LLVOAvatar::invalidateNameTags();
}
void PanelPreferenceFirestorm::populateCloudCombo()
{
LLComboBox* cloud_combo = getChild<LLComboBox>("cloud_combo");
if(cloud_combo)
{
const std::string cloudDir(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight" + gDirUtilp->getDirDelimiter() + "clouds"));
LLDirIterator dir_iter(cloudDir, "*.tga");
while (1)
{
std::string file;
if (!dir_iter.next(file))
{
break; // no more files
}
cloud_combo->add(file);
}
cloud_combo->setSimple(gSavedSettings.getString("FSCloudTexture"));
}
}

View File

@ -23,6 +23,7 @@ public:
void refreshTagCombos();
void applyTagCombos();
void populateCloudCombo();
protected:
LLComboBox* m_UseLegacyClienttags;

View File

@ -41,6 +41,7 @@
#include "llviewerregion.h"
#include "llface.h"
#include "llrender.h"
#include "llviewercontrol.h" // <FS:CR> Cloud noise selection
LLPointer<LLViewerTexture> LLDrawPoolWLSky::sCloudNoiseTexture = NULL;
@ -53,7 +54,11 @@ static LLGLSLShader* sky_shader = NULL;
LLDrawPoolWLSky::LLDrawPoolWLSky(void) :
LLDrawPool(POOL_WL_SKY)
{
const std::string cloudNoiseFilename(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", "clouds2.tga"));
// <FS:CR> Cloud noise selection
//const std::string cloudNoiseFilename(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", "clouds2.tga"));
static LLCachedControl<std::string> cloud_texture(gSavedSettings, "FSCloudTexture", "Default.tga");
const std::string cloudNoiseFilename(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight" + gDirUtilp->getDirDelimiter() + "clouds", cloud_texture));
// </FS:CR>
llinfos << "loading WindLight cloud noise from " << cloudNoiseFilename << llendl;
LLPointer<LLImageFormatted> cloudNoiseFile(LLImageFormatted::createFromExtension(cloudNoiseFilename));

View File

@ -1352,7 +1352,27 @@
name="FSWindlightInterpolateTime"
width="50"
tool_tip="The duration for crossfading from one preset to another [Default: 3]"/>
<text
top_pad="10"
type="string"
length="1"
follows="left|top"
height="15"
layout="topleft"
left="10"
name="could_texture_text"
width="220">
Cloud texture (restart recommended):
</text>
<combo_box
allow_text_entry="false"
left_pad="5"
follows="left|top"
height="20"
name="cloud_combo"
width="130"
control_name="FSCloudTexture"
tool_tip="Select the cloud texture you would like to use."/>
</panel>
<!--Build-->