summaryrefslogtreecommitdiff
path: root/indra/newview/llvosky.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvosky.h')
-rw-r--r--indra/newview/llvosky.h23
1 files changed, 11 insertions, 12 deletions
diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h
index 39e42bbb24..5941ab6e3b 100644
--- a/indra/newview/llvosky.h
+++ b/indra/newview/llvosky.h
@@ -43,6 +43,9 @@ const F32 HEAVENLY_BODY_DIST = HORIZON_DIST - 20.f;
const F32 HEAVENLY_BODY_FACTOR = 0.1f;
const F32 HEAVENLY_BODY_SCALE = HEAVENLY_BODY_DIST * HEAVENLY_BODY_FACTOR;
+const F32 SKYTEX_COMPONENTS = 4;
+const F32 SKYTEX_RESOLUTION = 64;
+
class LLFace;
class LLHaze;
@@ -50,8 +53,6 @@ class LLSkyTex
{
friend class LLVOSky;
private:
- static S32 sResolution;
- static S32 sComponents;
LLPointer<LLViewerTexture> mTexture[2];
LLPointer<LLImageRaw> mImageRaw[2];
LLColor4 *mSkyData;
@@ -82,25 +83,25 @@ protected:
void setDir(const LLVector3 &dir, const S32 i, const S32 j)
{
- S32 offset = i * sResolution + j;
+ S32 offset = i * SKYTEX_RESOLUTION + j;
mSkyDirs[offset] = dir;
}
const LLVector3 &getDir(const S32 i, const S32 j) const
{
- S32 offset = i * sResolution + j;
+ S32 offset = i * SKYTEX_RESOLUTION + j;
return mSkyDirs[offset];
}
void setPixel(const LLColor4 &col, const S32 i, const S32 j)
{
- S32 offset = i * sResolution + j;
+ S32 offset = i * SKYTEX_RESOLUTION + j;
mSkyData[offset] = col;
}
void setPixel(const LLColor4U &col, const S32 i, const S32 j)
{
- S32 offset = (i * sResolution + j) * sComponents;
+ S32 offset = (i * SKYTEX_RESOLUTION + j) * SKYTEX_COMPONENTS;
U32* pix = (U32*) &(mImageRaw[sCurrent]->getData()[offset]);
*pix = col.asRGBA();
}
@@ -108,7 +109,7 @@ protected:
LLColor4U getPixel(const S32 i, const S32 j)
{
LLColor4U col;
- S32 offset = (i * sResolution + j) * sComponents;
+ S32 offset = (i * SKYTEX_RESOLUTION + j) * SKYTEX_COMPONENTS;
U32* pix = (U32*) &(mImageRaw[sCurrent]->getData()[offset]);
col.fromRGBA( *pix );
return col;
@@ -214,12 +215,12 @@ public:
// Initialize/delete data that's only inited once per class.
void init();
void initCubeMap();
- void initEmpty();
void cleanupGL();
void restoreGL();
void calc();
+ void cacheEnvironment(LLSettingsSky::ptr_t psky, AtmosphericsVars& atmosphericsVars);
/*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time);
bool updateSky();
@@ -253,8 +254,6 @@ public:
LLColor4 getSkyFogColor() const { return m_legacyAtmospherics.getFogColor(); }
LLColor4 getGLFogColor() const { return m_legacyAtmospherics.getGLFogColor(); }
- LLColor4U getFadeColor() const;
-
void setCloudDensity(F32 cloud_density) { mCloudDensity = cloud_density; }
void setWind ( const LLVector3& wind ) { mWind = wind.length(); }
@@ -299,10 +298,10 @@ public:
protected:
~LLVOSky();
- void updateDirections(void);
+ void updateDirections(LLSettingsSky::ptr_t psky);
void initSkyTextureDirs(const S32 side, const S32 tile);
- void createSkyTexture(AtmosphericsVars& vars, const S32 side, const S32 tile);
+ void createSkyTexture(const LLSettingsSky::ptr_t &psky, AtmosphericsVars& vars, const S32 side, const S32 tile);
LLPointer<LLViewerFetchedTexture> mSunTexturep[2];
LLPointer<LLViewerFetchedTexture> mMoonTexturep[2];