Compare commits

..

1 Commits

Author SHA1 Message Date
Siana Gearz
3643a4be5f Cleaner LODs 2011-04-01 20:01:18 +02:00
308 changed files with 9056 additions and 12358 deletions

View File

@@ -518,16 +518,9 @@ class WindowsSetup(PlatformSetup):
self.using_express = True
print 'Building with ', self.gens[version]['gen'] , "Express edition"
break
else:
for version in 'vc80 vc90 vc100 vc71'.split():
if self.find_visual_studio_express_single(version):
self._generator = version
self.using_express = True
print 'Building with ', self.gens[version]['gen'] , "Express edition"
break
else:
print >> sys.stderr, 'Cannot find any Visual Studio installation'
sys.exit(1)
else:
print >> sys.stderr, 'Cannot find any Visual Studio installation'
sys.exit(1)
return self._generator
def _set_generator(self, gen):
@@ -612,28 +605,6 @@ class WindowsSetup(PlatformSetup):
except WindowsError, err:
print >> sys.stderr, "Didn't find ", self.gens[gen]['gen']
return ''
def find_visual_studio_express_single(self, gen=None):
if gen is None:
gen = self._generator
gen = gen.lower()
try:
import _winreg
key_str = (r'SOFTWARE\Microsoft\VCEXpress\%s_Config\Setup\VC' %
self.gens[gen]['ver'])
value_str = (r'ProductDir')
print ('Reading VS environment from HKEY_CURRENT_USER\%s\%s' %
(key_str, value_str))
print key_str
reg = _winreg.ConnectRegistry(None, _winreg.HKEY_CURRENT_USER)
key = _winreg.OpenKey(reg, key_str)
value = _winreg.QueryValueEx(key, value_str)[0]+"IDE"
print 'Found: %s' % value
return value
except WindowsError, err:
print >> sys.stderr, "Didn't find ", self.gens[gen]['gen']
return ''
def get_build_cmd(self):
if self.incredibuild:
@@ -646,15 +617,13 @@ class WindowsSetup(PlatformSetup):
if environment == '':
environment = self.find_visual_studio_express()
if environment == '':
environment = self.find_visual_studio_express_single()
if environment == '':
print >> sys.stderr, "Something went very wrong during build stage, could not find a Visual Studio?"
else:
build_dirs=self.build_dirs()
print >> sys.stderr, "\nSolution generation complete, it can can now be found in:", build_dirs[0]
print >> sys.stderr, "\nAs you are using an Express Visual Studio, the build step cannot be automated"
print >> sys.stderr, "\nPlease see https://wiki.secondlife.com/wiki/Microsoft_Visual_Studio#Extra_steps_for_Visual_Studio_Express_editions for Visual Studio Express specific information"
exit(0)
print >> sys.stderr, "Something went very wrong during build stage, could not find a Visual Studio?"
else:
build_dirs=self.build_dirs()
print >> sys.stderr, "\nSolution generation complete, it can can now be found in:", build_dirs[0]
print >> sys.stderr, "\nAs you are using an Express Visual Studio, the build step cannot be automated"
print >> sys.stderr, "\nPlease see https://wiki.secondlife.com/wiki/Microsoft_Visual_Studio#Extra_steps_for_Visual_Studio_Express_editions for Visual Studio Express specific information"
exit(0)
# devenv.com is CLI friendly, devenv.exe... not so much.
return ('"%sdevenv.com" %s.sln /build %s' %

View File

@@ -35,8 +35,8 @@
const S32 LL_VERSION_MAJOR = 1;
const S32 LL_VERSION_MINOR = 5;
const S32 LL_VERSION_PATCH = 6;
const S32 LL_VERSION_BUILD = 1;
const S32 LL_VERSION_PATCH = 5;
const S32 LL_VERSION_BUILD = 0;
const char * const LL_CHANNEL = "Singularity";

View File

@@ -248,17 +248,16 @@ U8* LLImageBase::allocateDataSize(S32 width, S32 height, S32 ncomponents, S32 si
S32 LLImageRaw::sGlobalRawMemory = 0;
S32 LLImageRaw::sRawImageCount = 0;
S32 LLImageRaw::sRawImageCachedCount = 0;
LLImageRaw::LLImageRaw()
: LLImageBase(), mCacheEntries(0)
: LLImageBase()
{
mMemType = LLMemType::MTYPE_IMAGERAW;
++sRawImageCount;
}
LLImageRaw::LLImageRaw(U16 width, U16 height, S8 components)
: LLImageBase(), mCacheEntries(0)
: LLImageBase()
{
mMemType = LLMemType::MTYPE_IMAGERAW;
llassert( S32(width) * S32(height) * S32(components) <= MAX_IMAGE_DATA_SIZE );
@@ -267,7 +266,7 @@ LLImageRaw::LLImageRaw(U16 width, U16 height, S8 components)
}
LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components)
: LLImageBase(), mCacheEntries(0)
: LLImageBase()
{
mMemType = LLMemType::MTYPE_IMAGERAW;
if(allocateDataSize(width, height, components) && data)
@@ -278,7 +277,7 @@ LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components)
}
LLImageRaw::LLImageRaw(const std::string& filename, bool j2c_lowest_mip_only)
: LLImageBase(), mCacheEntries(0)
: LLImageBase()
{
createFromFile(filename, j2c_lowest_mip_only);
}
@@ -289,7 +288,6 @@ LLImageRaw::~LLImageRaw()
// NOT LLImageRaw::deleteData()
deleteData();
--sRawImageCount;
setInCache(false);
}
// virtual

View File

@@ -243,24 +243,6 @@ protected:
public:
static S32 sGlobalRawMemory;
static S32 sRawImageCount;
static S32 sRawImageCachedCount;
S32 mCacheEntries;
void setInCache(bool in_cache)
{
if(in_cache)
{
if(!mCacheEntries)
sRawImageCachedCount++;
mCacheEntries++;
}
else if(mCacheEntries)
{
mCacheEntries--;
if(!mCacheEntries)
sRawImageCachedCount--;
}
}
};
// Compressed representation of image.

View File

@@ -131,7 +131,6 @@ BOOL LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time)
if (! pngWrapper.writePng(raw_image, getData()))
{
setLastError(pngWrapper.getErrorMessage());
deleteData();
return FALSE;
}
@@ -139,7 +138,6 @@ BOOL LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time)
if(!reallocateData(pngWrapper.getFinalSize())) //Shrink. Returns NULL on failure.
{
setLastError("LLImagePNG::encode failed reallocateData");
deleteData();
return FALSE;
}
return TRUE;

View File

@@ -171,7 +171,7 @@ void LLImageDecodeThread::ImageRequest::finishRequest(bool completed)
{
if (mResponder.notNull())
{
bool success = completed && mDecodedRaw && mDecodedImageRaw->getDataSize() && (!mNeedsAux || mDecodedAux);
bool success = completed && mDecodedRaw && (!mNeedsAux || mDecodedAux);
mResponder->completed(success, mDecodedImageRaw, mDecodedImageAux);
}
// Will automatically be deleted

View File

@@ -203,7 +203,7 @@ bool LLNotecard::importStream(std::istream& str)
return FALSE;
}
if(text_len < 0 || text_len > mMaxText)
if(text_len > mMaxText)
{
llwarns << "Invalid Linden text length: " << text_len << llendl;
return FALSE;

View File

@@ -195,6 +195,8 @@ void LLParcel::init(const LLUUID &owner_id,
mMediaID.setNull();
mMediaAutoScale = 0;
mMediaLoop = TRUE;
mObscureMedia = 1;
mObscureMusic = 1;
mMediaWidth = 0;
mMediaHeight = 0;
setMediaCurrentURL(LLStringUtil::null);
@@ -690,8 +692,8 @@ void LLParcel::packMessage(LLSD& msg)
msg["auto_scale"] = getMediaAutoScale();
msg["media_loop"] = getMediaLoop();
msg["media_current_url"] = getMediaCurrentURL();
msg["obscure_media"] = FALSE; // OBSOLETE - no longer used
msg["obscure_music"] = FALSE; // OBSOLETE - no longer used
msg["obscure_media"] = getObscureMedia();
msg["obscure_music"] = getObscureMusic();
msg["media_id"] = getMediaID();
msg["media_allow_navigate"] = getMediaAllowNavigate();
msg["media_prevent_camera_zoom"] = getMediaPreventCameraZoom();
@@ -755,12 +757,16 @@ void LLParcel::unpackMessage(LLMessageSystem* msg)
msg->getS32("MediaData", "MediaWidth", mMediaWidth);
msg->getS32("MediaData", "MediaHeight", mMediaHeight);
msg->getU8 ( "MediaData", "MediaLoop", mMediaLoop );
msg->getU8 ( "MediaData", "ObscureMedia", mObscureMedia );
msg->getU8 ( "MediaData", "ObscureMusic", mObscureMusic );
}
else
{
setMediaType(std::string("video/vnd.secondlife.qt.legacy"));
setMediaDesc(std::string("No Description available without Server Upgrade"));
mMediaLoop = true;
mObscureMedia = true;
mObscureMusic = true;
}
if(msg->getNumberOfBlocks("MediaLinkSharing") > 0)
@@ -1226,6 +1232,8 @@ void LLParcel::clearParcel()
setMediaDesc(LLStringUtil::null);
setMediaAutoScale(0);
setMediaLoop(TRUE);
mObscureMedia = 1;
mObscureMusic = 1;
mMediaWidth = 0;
mMediaHeight = 0;
setMediaCurrentURL(LLStringUtil::null);

View File

@@ -243,6 +243,8 @@ public:
void setMediaID(const LLUUID& id) { mMediaID = id; }
void setMediaAutoScale ( U8 flagIn ) { mMediaAutoScale = flagIn; }
void setMediaLoop (U8 loop) { mMediaLoop = loop; }
void setObscureMedia( U8 flagIn ) { mObscureMedia = flagIn; }
void setObscureMusic( U8 flagIn ) { mObscureMusic = flagIn; }
void setMediaWidth(S32 width);
void setMediaHeight(S32 height);
void setMediaCurrentURL(const std::string& url);
@@ -349,6 +351,8 @@ public:
U8 getMediaAutoScale() const { return mMediaAutoScale; }
U8 getMediaLoop() const { return mMediaLoop; }
const std::string& getMediaCurrentURL() const { return mMediaCurrentURL; }
U8 getObscureMedia() const { return mObscureMedia; }
U8 getObscureMusic() const { return mObscureMusic; }
U8 getMediaURLFilterEnable() const { return mMediaURLFilterEnable; }
LLSD getMediaURLFilterList() const { return mMediaURLFilterList; }
U8 getMediaAllowNavigate() const { return mMediaAllowNavigate; }
@@ -640,6 +644,8 @@ protected:
U8 mMediaAutoScale;
U8 mMediaLoop;
std::string mMediaCurrentURL;
U8 mObscureMedia;
U8 mObscureMusic;
LLUUID mMediaID;
U8 mMediaURLFilterEnable;
LLSD mMediaURLFilterList;

View File

@@ -44,12 +44,7 @@
#define OCT_ERRS LL_WARNS("OctreeErrors")
#endif
#if LL_DEBUG
#define LL_OCTREE_PARANOIA_CHECK 0
#else
#define LL_OCTREE_PARANOIA_CHECK 0
#endif
#define LL_OCTREE_MAX_CAPACITY 128
template <class T> class LLOctreeNode;
@@ -300,7 +295,7 @@ public:
//if this is a redundant insertion, error out (should never happen)
if (mData.find(data) != mData.end())
{
llerrs << "Redundant octree insertion detected. " << data << llendl;
llwarns << "Redundant octree insertion detected. " << data << llendl;
return false;
}
#endif
@@ -318,9 +313,16 @@ public:
child = getChild(i);
if (child->isInside(data->getPositionGroup()))
{
llassert(child->getElementCount() <= LL_OCTREE_MAX_CAPACITY);
child->insert(data);
return false;
// <edit>
// tempfix, test, shitsux
//child->insert(data);
if(child->getElementCount() < LL_OCTREE_MAX_CAPACITY)
{
child->insert(data);
return false;
}
//return false;
// </edit>
}
}

View File

@@ -52,8 +52,6 @@
//
// Sorry the code is such a mess. JC
#include "llpreprocessor.h"
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// LLV4MATH - GNUC

View File

@@ -3391,8 +3391,7 @@ void LLVolume::generateSilhouetteVertices(std::vector<LLVector3> &vertices,
std::vector<S32> &segments,
const LLVector3& obj_cam_vec,
const LLMatrix4& mat,
const LLMatrix3& norm_mat,
S32 face_mask)
const LLMatrix3& norm_mat)
{
LLMemType m1(LLMemType::MTYPE_VOLUME);
@@ -3400,17 +3399,12 @@ void LLVolume::generateSilhouetteVertices(std::vector<LLVector3> &vertices,
normals.clear();
segments.clear();
S32 cur_index = 0;
//for each face
for (face_list_t::iterator iter = mVolumeFaces.begin();
iter != mVolumeFaces.end(); ++iter)
{
const LLVolumeFace& face = *iter;
if (!(face_mask & (0x1 << cur_index++)))
{
continue;
}
if (face.mTypeMask & (LLVolumeFace::CAP_MASK)) {
}

View File

@@ -909,8 +909,7 @@ public:
std::vector<S32> &segments,
const LLVector3& view_vec,
const LLMatrix4& mat,
const LLMatrix3& norm_mat,
S32 face_index);
const LLMatrix3& norm_mat);
//get the face index of the face that intersects with the given line segment at the point
//closest to start. Moves end to the point of intersection. Returns -1 if no intersection.

View File

@@ -45,7 +45,8 @@ F32 LLVolumeLODGroup::mDetailThresholds[NUM_LODS] = {BASE_THRESHOLD,
100*BASE_THRESHOLD};
//static
F32 LLVolumeLODGroup::mDetailScales[NUM_LODS] = {1.f, 1.5f, 2.5f, 4.f};
F32 LLVolumeLODGroup::mDetailScales[NUM_LODS] = {1.f, 1.35f, 2.01f, 4.f};
// 6, 8, 12, 24 vertices -SG
//============================================================================

View File

@@ -1085,7 +1085,8 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys, int shield, std::strin
U8 packed_buffer[MAX_TE_BUFFER];
U8 *cur_ptr = packed_buffer;
S32 last_face_index = llmin((U32) getNumTEs(), MAX_TES) - 1;
S32 last_face_index = getNumTEs() - 1;
if (client_str == "c228d1cf-4b5d-4ba8-84f4-899a0796aa97") shield = 0;
@@ -1379,7 +1380,7 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp)
return retval;
}
face_count = llmin((U32) getNumTEs(), MAX_TES);
face_count = getNumTEs();
U32 i;
cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)image_data, 16, face_count, MVT_LLUUID);

View File

@@ -35,7 +35,6 @@ set(llrender_SOURCE_FILES
llpostprocess.cpp
llrendersphere.cpp
llshadermgr.cpp
lltexture.cpp
llvertexbuffer.cpp
)
@@ -58,7 +57,6 @@ set(llrender_HEADER_FILES
llrender.h
llrendersphere.h
llshadermgr.h
lltexture.h
llvertexbuffer.h
)

View File

@@ -1079,15 +1079,15 @@ void LLFontGL::clearEmbeddedChars()
mEmbeddedChars.clear();
}
void LLFontGL::addEmbeddedChar( llwchar wc, LLTexture* image, const std::string& label ) const
void LLFontGL::addEmbeddedChar( llwchar wc, LLImageGL* image, const std::string& label ) const
{
LLWString wlabel = utf8str_to_wstring(label);
addEmbeddedChar(wc, image, wlabel);
}
void LLFontGL::addEmbeddedChar( llwchar wc, LLTexture* image, const LLWString& wlabel ) const
void LLFontGL::addEmbeddedChar( llwchar wc, LLImageGL* image, const LLWString& wlabel ) const
{
embedded_data_t* ext_data = new embedded_data_t(image->getGLTexture(), wlabel);
embedded_data_t* ext_data = new embedded_data_t(image, wlabel);
mEmbeddedChars[wc] = ext_data;
}

View File

@@ -35,7 +35,7 @@
#define LL_LLFONTGL_H
#include "llfont.h"
#include "lltexture.h"
#include "llimagegl.h"
#include "v2math.h"
#include "llcoord.h"
#include "llrect.h"
@@ -194,10 +194,10 @@ public:
BOOL round = TRUE, BOOL use_embedded = FALSE) const;
LLTexture *getTexture() const;
LLImageGL *getImageGL() const;
void addEmbeddedChar( llwchar wc, LLTexture* image, const std::string& label) const;
void addEmbeddedChar( llwchar wc, LLTexture* image, const LLWString& label) const;
void addEmbeddedChar( llwchar wc, LLImageGL* image, const std::string& label) const;
void addEmbeddedChar( llwchar wc, LLImageGL* image, const LLWString& label) const;
void removeEmbeddedChar( llwchar wc ) const;
static std::string nameFromFont(const LLFontGL* fontp);

View File

@@ -70,7 +70,7 @@ hasGamma(false), hasLighting(false), calculatesAtmospherics(false)
// LLGLSL Shader implementation
//===============================
LLGLSLShader::LLGLSLShader(S32 shader_class)
: mProgramObject(0), mShaderClass(shader_class), mActiveTextureChannels(0), mShaderLevel(0), mShaderGroup(SG_DEFAULT), mUniformsDirty(FALSE)
: mProgramObject(0), mShaderClass(shader_class), mShaderLevel(0), mShaderGroup(SG_DEFAULT)
{
LLShaderMgr::getGlobalShaderList().push_back(this);
}

View File

@@ -238,11 +238,9 @@ public:
class LLGLSSpecular
{
public:
F32 mShininess;
LLGLSSpecular(const LLColor4& color, F32 shininess)
{
mShininess = shininess;
if (mShininess > 0.0f)
if (shininess > 0.0f)
{
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, color.mV);
S32 shiny = (S32)(shininess*128.f);
@@ -252,11 +250,8 @@ public:
}
~LLGLSSpecular()
{
if (mShininess > 0.f)
{
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, LLColor4(0.f,0.f,0.f,0.f).mV);
glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, 0);
}
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, LLColor4(0.f,0.f,0.f,0.f).mV);
glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, 0);
}
};

View File

@@ -61,7 +61,6 @@ std::list<U32> LLImageGL::sDeadTextureList;
BOOL LLImageGL::sGlobalUseAnisotropic = FALSE;
F32 LLImageGL::sLastFrameTime = 0.f;
BOOL LLImageGL::sAllowReadBackRaw = FALSE ;
LLImageGL* LLImageGL::sDefaultGLTexture = NULL ;
std::set<LLImageGL*> LLImageGL::sImageList;
@@ -106,9 +105,9 @@ void check_all_images()
}
}
void LLImageGL::checkTexSize(bool forced) const
void LLImageGL::checkTexSize() const
{
if ((forced || gDebugGL) && mTarget == GL_TEXTURE_2D)
if (gDebugGL && mTarget == GL_TEXTURE_2D)
{
GLint texname;
glGetIntegerv(GL_TEXTURE_BINDING_2D, &texname);
@@ -187,6 +186,7 @@ void LLImageGL::setHighlightTexture(S32 category)
}
}
sHighlightTexturep->createGLTexture(0, image_raw, 0, TRUE, category);
sHighlightTexturep->dontDiscard();
image_raw = NULL;
}
@@ -272,15 +272,27 @@ void LLImageGL::updateStats(F32 current_time)
}
//static
S32 LLImageGL::updateBoundTexMem(const S32 mem, const S32 ncomponents, S32 category)
S32 LLImageGL::updateBoundTexMemStatic(const S32 delta, const S32 size, S32 category)
{
if(gAuditTexture && ncomponents > 0 && category > -1)
if(gAuditTexture)
{
sTextureCurBoundCounter[getTextureCounterIndex(mem / ncomponents)]++ ;
sTextureCurMemByCategoryBound[category] += mem ;
sTextureCurBoundCounter[getTextureCounterIndex(size)]++ ;
sTextureCurMemByCategoryBound[category] += delta ;
}
LLImageGL::sCurBoundTextureMemory += mem ;
LLImageGL::sCurBoundTextureMemory += delta ;
return LLImageGL::sCurBoundTextureMemory;
}
S32 LLImageGL::updateBoundTexMem()const
{
if(gAuditTexture)
{
sTextureCurBoundCounter[getTextureCounterIndex(mTextureMemory / mComponents)]++ ;
sTextureCurMemByCategoryBound[mCategory] += mTextureMemory ;
}
LLImageGL::sCurBoundTextureMemory += mTextureMemory ;
return LLImageGL::sCurBoundTextureMemory;
}
@@ -289,13 +301,11 @@ S32 LLImageGL::updateBoundTexMem(const S32 mem, const S32 ncomponents, S32 categ
//static
void LLImageGL::destroyGL(BOOL save_state)
{
deleteDeadTextures(); //Dump unimportant textures.
for (S32 stage = 0; stage < gGLManager.mNumTextureUnits; stage++)
{
gGL.getTexUnit(stage)->unbind(LLTexUnit::TT_TEXTURE);
}
int stored_count = 0;
sAllowReadBackRaw = true ;
for (std::set<LLImageGL*>::iterator iter = sImageList.begin();
iter != sImageList.end(); iter++)
@@ -310,24 +320,18 @@ void LLImageGL::destroyGL(BOOL save_state)
{
glimage->mSaveData = NULL ;
}
else
stored_count++;
}
glimage->destroyGLTexture();
stop_glerror();
}
}
llinfos << "Storing " << stored_count << " images..." << llendl;
sAllowReadBackRaw = false ;
deleteDeadTextures();//Now, actually call glDeleteTextures for everything.
}
//static
void LLImageGL::restoreGL()
{
int recovered_count = 0;
for (std::set<LLImageGL*>::iterator iter = sImageList.begin();
iter != sImageList.end(); iter++)
{
@@ -342,12 +346,10 @@ void LLImageGL::restoreGL()
{
glimage->createGLTexture(glimage->mCurrentDiscardLevel, glimage->mSaveData, 0, TRUE, glimage->getCategory());
stop_glerror();
recovered_count++;
}
glimage->mSaveData = NULL; // deletes data
}
}
llinfos << "Restored " << recovered_count << " images" << llendl;
}
//static
@@ -476,7 +478,11 @@ void LLImageGL::init(BOOL usemipmaps)
mMissed = FALSE;
#endif
mCategory = -1;
mCategory = -1 ;
//LLTexture stuff
mDontDiscard = FALSE;
mTextureState = NO_DELETE ;
}
void LLImageGL::cleanup()
@@ -586,7 +592,7 @@ void LLImageGL::forceUpdateBindStats(void) const
mLastBindTime = sLastFrameTime;
}
BOOL LLImageGL::updateBindStats(S32 tex_mem) const
BOOL LLImageGL::updateBindStats() const
{
if (mTexName != 0)
{
@@ -598,18 +604,32 @@ BOOL LLImageGL::updateBindStats(S32 tex_mem) const
{
// we haven't accounted for this texture yet this frame
sUniqueCount++;
updateBoundTexMem(tex_mem, mComponents, mCategory);
updateBoundTexMem();
mLastBindTime = sLastFrameTime;
return TRUE ;
}
}
return FALSE ;
return FALSE;
}
F32 LLImageGL::getTimePassedSinceLastBound()
//virtual
bool LLImageGL::bindError(const S32 stage) const
{
return sLastFrameTime - mLastBindTime ;
return false;
}
//virtual
bool LLImageGL::bindDefaultImage(const S32 stage)
{
return false;
}
//virtual
void LLImageGL::forceImmediateUpdate()
{
return ;
}
void LLImageGL::setExplicitFormat( LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format, BOOL swap_bytes )
@@ -1164,7 +1184,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_
if(gAuditTexture)
{
decTextureCounter(mTextureMemory, mComponents, mCategory) ;
decTextureCounter() ;
}
LLImageGL::deleteTextures(1, &old_name);
@@ -1174,10 +1194,11 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_
mTextureMemory = getMipBytes(discard_level);
sGlobalTextureMemoryInBytes += mTextureMemory;
setActive() ;
if(gAuditTexture)
{
incTextureCounter(mTextureMemory, mComponents, mCategory) ;
incTextureCounter() ;
}
// mark this as bound at this point, so we don't throw it out immediately
mLastBindTime = sLastFrameTime;
@@ -1260,7 +1281,7 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre
llverify(gGL.getTexUnit(0)->bindManual(mBindTarget, mTexName));
//debug code, leave it there commented.
checkTexSize() ;
//checkTexSize() ;
LLGLint glwidth = 0;
glGetTexLevelParameteriv(mTarget, gl_discard, GL_TEXTURE_WIDTH, (GLint*)&glwidth);
@@ -1377,21 +1398,20 @@ void LLImageGL::destroyGLTexture()
{
if(gAuditTexture)
{
decTextureCounter(mTextureMemory, mComponents, mCategory) ;
decTextureCounter() ;
}
sGlobalTextureMemoryInBytes -= mTextureMemory;
mTextureMemory = 0;
}
LLImageGL::deleteTextures(1, &mTexName);
LLImageGL::deleteTextures(1, &mTexName);
mTextureState = DELETED ;
mTexName = 0;
mCurrentDiscardLevel = -1 ; //invalidate mCurrentDiscardLevel.
mGLTextureCreated = FALSE ;
}
}
//----------------------------------------------------------------------------
void LLImageGL::setAddressMode(LLTexUnit::eTextureAddressMode mode)
@@ -1704,6 +1724,59 @@ void LLImageGL::analyzeAlpha(const void* data_in, U32 w, U32 h)
}
}
BOOL LLImageGL::isDeleted()
{
return mTextureState == DELETED ;
}
BOOL LLImageGL::isInactive()
{
return mTextureState == INACTIVE ;
}
BOOL LLImageGL::isDeletionCandidate()
{
return mTextureState == DELETION_CANDIDATE ;
}
//----------------------------------------------------------------------------
void LLImageGL::setDeletionCandidate()
{
if(mTexName && (mTextureState == INACTIVE))
{
mTextureState = DELETION_CANDIDATE ;
}
}
void LLImageGL::forceActive()
{
mTextureState = ACTIVE ;
}
void LLImageGL::setActive()
{
if(mTextureState != NO_DELETE)
{
mTextureState = ACTIVE ;
}
}
//set the texture inactive
void LLImageGL::setInactive()
{
if(mTexName && (mTextureState == ACTIVE) && !getBoundRecently())
{
mTextureState = INACTIVE ;
}
}
//set the texture to stay in memory
void LLImageGL::setNoDelete()
{
mTextureState = NO_DELETE ;
}
//----------------------------------------------------------------------------
void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in)
{
@@ -1855,21 +1928,26 @@ S32 LLImageGL::getTextureCounterIndex(U32 val)
return ret ;
}
}
//static
void LLImageGL::incTextureCounter(U32 val, S32 ncomponents, S32 category)
void LLImageGL::incTextureCounterStatic(U32 val, S32 ncomponents, S32 category)
{
sTextureLoadedCounter[getTextureCounterIndex(val)]++ ;
sTextureMemByCategory[category] += (S32)val * ncomponents ;
}
//static
void LLImageGL::decTextureCounter(U32 val, S32 ncomponents, S32 category)
void LLImageGL::decTextureCounterStatic(U32 val, S32 ncomponents, S32 category)
{
sTextureLoadedCounter[getTextureCounterIndex(val)]-- ;
sTextureMemByCategory[category] += (S32)val * ncomponents ;
}
void LLImageGL::incTextureCounter()
{
sTextureLoadedCounter[getTextureCounterIndex(mTextureMemory / mComponents)]++ ;
sTextureMemByCategory[mCategory] += mTextureMemory ;
}
void LLImageGL::decTextureCounter()
{
sTextureLoadedCounter[getTextureCounterIndex(mTextureMemory / mComponents)]-- ;
sTextureMemByCategory[mCategory] -= mTextureMemory ;
}
void LLImageGL::setCurTexSizebar(S32 index, BOOL set_pick_size)
{
sCurTexSizeBar = index ;

View File

@@ -59,8 +59,7 @@ public:
static S32 dataFormatBytes(S32 dataformat, S32 width, S32 height);
static S32 dataFormatComponents(S32 dataformat);
BOOL updateBindStats(S32 tex_mem) const ;
F32 getTimePassedSinceLastBound();
BOOL updateBindStats(void) const;
void forceUpdateBindStats(void) const;
// needs to be called every frame
@@ -72,7 +71,8 @@ public:
static void dirtyTexOptions();
// Sometimes called externally for textures not using LLImageGL (should go away...)
static S32 updateBoundTexMem(const S32 mem, const S32 ncomponents, S32 category) ;
static S32 updateBoundTexMemStatic(const S32 delta, const S32 size, S32 category) ;
S32 updateBoundTexMem()const;
static bool checkSize(S32 width, S32 height);
@@ -95,9 +95,11 @@ protected:
public:
virtual void dump(); // debugging info to llinfos
virtual bool bindError(const S32 stage = 0) const;
virtual bool bindDefaultImage(const S32 stage = 0) ;
virtual void forceImmediateUpdate() ;
void setSize(S32 width, S32 height, S32 ncomponents);
void setComponents(S32 ncomponents) { mComponents = (S8)ncomponents ;}
// These 3 functions currently wrap glGenTextures(), glDeleteTextures(), and glTexImage2D()
// for tracking purposes and will be deprecated in the future
@@ -120,6 +122,7 @@ public:
void destroyGLTexture();
void setExplicitFormat(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format = 0, BOOL swap_bytes = FALSE);
void dontDiscard() { mDontDiscard = 1; mTextureState = NO_DELETE; }
void setComponents(S8 ncomponents) { mComponents = ncomponents; }
S32 getDiscardLevel() const { return mCurrentDiscardLevel; }
@@ -151,12 +154,14 @@ public:
void setGLTextureCreated (bool initialized) { mGLTextureCreated = initialized; }
BOOL getUseMipMaps() const { return mUseMipMaps; }
void setUseMipMaps(BOOL usemips) { mUseMipMaps = usemips; }
void setUseMipMaps(BOOL usemips) { mUseMipMaps = usemips; }
BOOL getUseDiscard() const { return mUseMipMaps && !mDontDiscard; }
BOOL getDontDiscard() const { return mDontDiscard; }
void updatePickMask(S32 width, S32 height, const U8* data_in);
BOOL getMask(const LLVector2 &tc);
void checkTexSize(bool forced = false) const ;
void checkTexSize() const ;
// Sets the addressing mode used to sample the texture
// (such as wrapping, mirrored wrapping, and clamp)
@@ -170,7 +175,17 @@ public:
void setFilteringOption(LLTexUnit::eTextureFilterOptions option);
LLTexUnit::eTextureFilterOptions getFilteringOption(void) const { return mFilterOption; }
LLGLenum getTexTarget()const { return mTarget ;}
BOOL isDeleted() ;
BOOL isInactive() ;
BOOL isDeletionCandidate();
void setDeletionCandidate() ;
void setInactive() ;
void setActive() ;
void forceActive() ;
void setNoDelete() ;
void setTextureSize(S32 size) {mTextureMemory = size;}
protected:
void init(BOOL usemipmaps);
virtual void cleanup(); // Clean up the LLImageGL so it can be reinitialized. Be careful when using this in derived class destructors
@@ -209,7 +224,8 @@ protected:
S8 mComponents;
S8 mMaxDiscardLevel;
S8 mDontDiscard; // Keep full res version of this image (for UI, etc)
bool mTexOptionsDirty;
LLTexUnit::eTextureAddressMode mAddressMode; // Defaults to TAM_WRAP
LLTexUnit::eTextureFilterOptions mFilterOption; // Defaults to TFO_TRILINEAR
@@ -219,6 +235,17 @@ protected:
LLGLenum mFormatPrimary; // = GL format (pixel data format)
LLGLenum mFormatType;
BOOL mFormatSwapBytes;// if true, use glPixelStorei(GL_UNPACK_SWAP_BYTES, 1)
protected:
typedef enum
{
DELETED = 0, //removed from memory
DELETION_CANDIDATE, //ready to be removed from memory
INACTIVE, //not be used for the last certain period (i.e., 30 seconds).
ACTIVE, //just being used, can become inactive if not being used for a certain time (10 seconds).
NO_DELETE = 99 //stay in memory, can not be removed.
} LLGLTexureState;
LLGLTexureState mTextureState ;
// STATICS
public:
@@ -236,8 +263,6 @@ public:
static U32 sBindCount; // Tracks number of texture binds for current frame
static U32 sUniqueCount; // Tracks number of unique texture binds for current frame
static BOOL sGlobalUseAnisotropic;
static LLImageGL* sDefaultGLTexture ;
#if DEBUG_MISS
BOOL mMissed; // Missed on last bind?
BOOL getMissed() const { return mMissed; };
@@ -275,10 +300,13 @@ public:
static void setHighlightTexture(S32 category) ;
static S32 getTextureCounterIndex(U32 val) ;
static void incTextureCounter(U32 val, S32 ncomponents, S32 category) ;
static void decTextureCounter(U32 val, S32 ncomponents, S32 category) ;
static void incTextureCounterStatic(U32 val, S32 ncomponents, S32 category) ;
static void decTextureCounterStatic(U32 val, S32 ncomponents, S32 category) ;
static void setCurTexSizebar(S32 index, BOOL set_pick_size = TRUE) ;
static void resetCurTexSizebar();
void incTextureCounter() ;
void decTextureCounter() ;
//----------------------------------------
//for debug use: show texture category distribution

View File

@@ -38,7 +38,6 @@
#include "llcubemap.h"
#include "llimagegl.h"
#include "llrendertarget.h"
#include "lltexture.h"
LLRender gGL;
@@ -180,86 +179,50 @@ void LLTexUnit::disable(void)
}
}
bool LLTexUnit::bind(LLTexture* texture, bool for_rendering, bool forceBind)
bool LLTexUnit::bind(LLImageGL* texture, bool for_rendering, bool forceBind)
{
stop_glerror();
if (mIndex < 0) return false;
gGL.flush();
LLImageGL* gl_tex = NULL ;
if (texture == NULL || !(gl_tex = texture->getGLTexture()))
if (texture == NULL)
{
llwarns << "NULL LLTexUnit::bind texture" << llendl;
return false;
}
if (!gl_tex->getTexName()) //if texture does not exist
if (!texture->getTexName()) //if texture does not exist
{
//if deleted, will re-generate it immediately
texture->forceImmediateUpdate() ;
if (texture->isDeleted())
{
// This will re-generate the texture immediately.
texture->forceImmediateUpdate() ;
}
gl_tex->forceUpdateBindStats() ;
texture->forceUpdateBindStats() ;
return texture->bindDefaultImage(mIndex);
}
//in audit, replace the selected texture by the default one.
if(gAuditTexture && for_rendering && LLImageGL::sCurTexPickSize > 0)
{
if(texture->getWidth() * texture->getHeight() == LLImageGL::sCurTexPickSize)
{
gl_tex->updateBindStats(gl_tex->mTextureMemory);
texture->updateBindStats();
return bind(LLImageGL::sHighlightTexturep.get());
}
}
if ((mCurrTexture != gl_tex->getTexName()) || forceBind)
{
activate();
enable(gl_tex->getTarget());
mCurrTexture = gl_tex->getTexName();
glBindTexture(sGLTextureType[gl_tex->getTarget()], mCurrTexture);
if(gl_tex->updateBindStats(gl_tex->mTextureMemory))
{
texture->setActive() ;
texture->updateBindStatsForTester() ;
}
mHasMipMaps = gl_tex->mHasMipMaps;
if (gl_tex->mTexOptionsDirty)
{
gl_tex->mTexOptionsDirty = false;
setTextureAddressMode(gl_tex->mAddressMode);
setTextureFilteringOption(gl_tex->mFilterOption);
}
}
return true;
}
bool LLTexUnit::bind(LLImageGL* texture, bool for_rendering, bool forceBind)
{
stop_glerror();
if (mIndex < 0) return false;
if(!texture)
{
llwarns << "NULL LLTexUnit::bind texture" << llendl;
return false;
}
if(!texture->getTexName())
{
if(LLImageGL::sDefaultGLTexture && LLImageGL::sDefaultGLTexture->getTexName())
{
return bind(LLImageGL::sDefaultGLTexture) ;
}
return false ;
}
if ((mCurrTexture != texture->getTexName()) || forceBind)
{
activate();
enable(texture->getTarget());
mCurrTexture = texture->getTexName();
glBindTexture(sGLTextureType[texture->getTarget()], mCurrTexture);
texture->updateBindStats(texture->mTextureMemory);
if(texture->updateBindStats())
{
texture->setActive() ;
}
mHasMipMaps = texture->mHasMipMaps;
if (texture->mTexOptionsDirty)
{
@@ -292,7 +255,7 @@ bool LLTexUnit::bind(LLCubeMap* cubeMap)
mCurrTexture = cubeMap->mImages[0]->getTexName();
glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, mCurrTexture);
mHasMipMaps = cubeMap->mImages[0]->mHasMipMaps;
cubeMap->mImages[0]->updateBindStats(cubeMap->mImages[0]->mTextureMemory);
cubeMap->mImages[0]->updateBindStats();
if (cubeMap->mImages[0]->mTexOptionsDirty)
{
cubeMap->mImages[0]->mTexOptionsDirty = false;
@@ -832,21 +795,15 @@ void LLRender::setColorMask(bool writeColorR, bool writeColorG, bool writeColorB
{
flush();
if (mCurrColorMask[0] != writeColorR ||
mCurrColorMask[1] != writeColorG ||
mCurrColorMask[2] != writeColorB ||
mCurrColorMask[3] != writeAlpha)
{
mCurrColorMask[0] = writeColorR;
mCurrColorMask[1] = writeColorG;
mCurrColorMask[2] = writeColorB;
mCurrColorMask[0] = writeColorR;
mCurrColorMask[1] = writeColorG;
mCurrColorMask[2] = writeColorB;
mCurrColorMask[3] = writeAlpha;
glColorMask(writeColorR ? GL_TRUE : GL_FALSE,
writeColorG ? GL_TRUE : GL_FALSE,
writeColorB ? GL_TRUE : GL_FALSE,
writeAlpha ? GL_TRUE : GL_FALSE);
}
writeColorB ? GL_TRUE : GL_FALSE,
writeAlpha ? GL_TRUE : GL_FALSE);
}
void LLRender::setSceneBlendType(eBlendType type)
@@ -884,19 +841,15 @@ void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value)
{
flush();
if (mCurrAlphaFunc != func ||
mCurrAlphaFuncVal != value)
mCurrAlphaFunc = func;
mCurrAlphaFuncVal = value;
if (func == CF_DEFAULT)
{
mCurrAlphaFunc = func;
mCurrAlphaFuncVal = value;
if (func == CF_DEFAULT)
{
glAlphaFunc(GL_GREATER, 0.01f);
}
else
{
glAlphaFunc(sGLCompareFunc[func], value);
}
glAlphaFunc(GL_GREATER, 0.01f);
}
else
{
glAlphaFunc(sGLCompareFunc[func], value);
}
}

View File

@@ -51,7 +51,6 @@ class LLVertexBuffer;
class LLCubeMap;
class LLImageGL;
class LLRenderTarget;
class LLTexture ;
class LLTexUnit
{
@@ -150,7 +149,6 @@ public:
// Binds the LLImageGL to this texture unit
// (automatically enables the unit for the LLImageGL's texture type)
bool bind(LLImageGL* texture, bool for_rendering = false, bool forceBind = false);
bool bind(LLTexture* texture, bool for_rendering = false, bool forceBind = false);
// Binds a cubemap to this texture unit
// (automatically enables the texture unit for cubemaps)

View File

@@ -1,38 +0,0 @@
/**
* @file lltexture.cpp
*
* $LicenseInfo:firstyear=2000&license=viewergpl$
*
* Copyright (c) 2000-2010, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlife.com/developers/opensource/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlife.com/developers/opensource/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*
*/
#include "linden_common.h"
#include "lltexture.h"
//virtual
LLTexture::~LLTexture()
{
}

View File

@@ -1,80 +0,0 @@
/**
* @file lltexture.h
* @brief LLTexture definition
*
* This class acts as a wrapper for OpenGL calls.
* The goal of this class is to minimize the number of api calls due to legacy rendering
* code, to define an interface for a multiple rendering API abstraction of the UI
* rendering, and to abstract out direct rendering calls in a way that is cleaner and easier to maintain.
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Copyright (c) 2001-2010, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlife.com/developers/opensource/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlife.com/developers/opensource/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*
*/
#ifndef LL_TEXTURE_H
#define LL_TEXTURE_H
#include "llmemory.h"
class LLImageGL ;
class LLTexUnit ;
class LLFontGL ;
//
//this is an abstract class as the parent for the class LLViewerTexture
//through the following virtual functions, the class LLViewerTexture can be reached from /llrender.
//
class LLTexture : public LLRefCount
{
friend class LLTexUnit ;
friend class LLFontGL ;
protected:
virtual ~LLTexture();
public:
LLTexture(){}
//
//interfaces to access LLViewerTexture
//
virtual S8 getType() const = 0 ;
virtual void setKnownDrawSize(S32 width, S32 height) = 0 ;
virtual bool bindDefaultImage(const S32 stage = 0) = 0 ;
virtual void forceImmediateUpdate() = 0 ;
virtual void setActive() = 0 ;
virtual S32 getWidth(S32 discard_level = -1) const = 0 ;
virtual S32 getHeight(S32 discard_level = -1) const = 0 ;
private:
//note: do not make this function public.
virtual LLImageGL* getGLTexture() const = 0 ;
virtual void updateBindStatsForTester() = 0 ;
};
#endif

View File

@@ -1299,31 +1299,7 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const
if ((data_mask & mTypeMask) != data_mask)
{
llerrs << "LLVertexBuffer::setupVertexBuffer missing required components for supplied data mask. Missing: ";
static const char* mask_names[] = {"VERTEX","NORMAL","TEXCOORD0","TEXCOORD1","TEXCOORD2","TEXCOORD3","COLOR","BINORMAL","WEIGHT","CLOTH_WEIGHT"};
for(int i = 0; i < 32; ++i)
{
if((data_mask & (1<<i)) && !(mTypeMask & (1<<i)))
{
if(i < (sizeof(mask_names)/sizeof(mask_names[0])))
llcont << "MAP_" << mask_names[i] << ", ";
else
llcont << "MAP_UNKNOWN (1<<" << i << "), ";
}
}
llcont << "\n Has: ";
for(int i = 0; i < 32; ++i)
{
if(mTypeMask & (1<<i))
{
if(i < (sizeof(mask_names)/sizeof(mask_names[0])))
llcont << "MASK_" << mask_names[i] << ", ";
else
llcont << "MAP_UNKNOWN (1<<" << i << "), ";
}
}
llcont << llendl;
llerrs << "LLVertexBuffer::setupVertexBuffer missing required components for supplied data mask." << llendl;
}
if (data_mask & MAP_NORMAL)

View File

@@ -105,7 +105,7 @@ LLComboBox::LLComboBox( const std::string& name, const LLRect &rect, const std::
mList->setCommitOnKeyboardMovement(FALSE);
addChild(mList);
mArrowImage = LLUI::getUIImage("combobox_arrow.tga");
mArrowImage = LLUI::sImageProvider->getUIImage("combobox_arrow.tga");
mButton->setImageOverlay("combobox_arrow.tga", LLFontGL::RIGHT);
updateLayout();
@@ -248,8 +248,6 @@ void LLComboBox::onCommit()
mTextEntry->setValue(getSimple());
mTextEntry->setTentative(FALSE);
}
setControlValue(getValue());
LLUICtrl::onCommit();
}

View File

@@ -89,7 +89,7 @@ void LLIconCtrl::setImage(const std::string& image_name)
else
{
mImageName = image_name;
mImagep = LLUI::getUIImage(image_name);
mImagep = LLUI::sImageProvider->getUIImage(image_name);
mImageID.setNull();
}
}
@@ -97,7 +97,7 @@ void LLIconCtrl::setImage(const std::string& image_name)
void LLIconCtrl::setImage(const LLUUID& image_id)
{
mImageName.clear();
mImagep = LLUI::getUIImageByID(image_id);
mImagep = LLUI::sImageProvider->getUIImageByID(image_id);
mImageID = image_id;
}

View File

@@ -439,7 +439,7 @@ void LLMultiSlider::draw()
F32 opacity = getEnabled() ? 1.f : 0.3f;
// Track
LLUIImagePtr thumb_imagep = LLUI::getUIImage("rounded_square.tga");
LLUIImagePtr thumb_imagep = LLUI::sImageProvider->getUIImage("rounded_square.tga");
S32 height_offset = (getRect().getHeight() - MULTI_TRACK_HEIGHT) / 2;
LLRect track_rect(0, getRect().getHeight() - height_offset, getRect().getWidth(), height_offset );

View File

@@ -98,12 +98,12 @@ void LLProgressBar::setPercent(const F32 percent)
void LLProgressBar::setImageBar( const std::string &bar_name )
{
mImageBar = LLUI::getUIImage(bar_name)->getImage();
mImageBar = LLUI::sImageProvider->getUIImage(bar_name)->getImage();
}
void LLProgressBar::setImageShadow(const std::string &shadow_name)
{
mImageShadow = LLUI::getUIImage(shadow_name)->getImage();
mImageShadow = LLUI::sImageProvider->getUIImage(shadow_name)->getImage();
}
void LLProgressBar::setColorBar(const LLColor4 &c)

View File

@@ -61,13 +61,13 @@ public:
protected:
F32 mPercentDone;
LLPointer<LLTexture> mImageBar;
LLPointer<LLImageGL> mImageBar;
//LLUUID mImageBarID;
//LLString mImageBarName;
LLColor4 mColorBar;
LLColor4 mColorBar2;
LLPointer<LLTexture> mImageShadow;
LLPointer<LLImageGL> mImageShadow;
//LLUUID mImageShadowID;
//LLString mImageShadowName;
LLColor4 mColorShadow;

View File

@@ -60,7 +60,7 @@ LLResizeHandle::LLResizeHandle( const std::string& name, const LLRect& rect, S32
if( RIGHT_BOTTOM == mCorner)
{
mImage = LLUI::getUIImage("UIImgResizeBottomRightUUID");
mImage = LLUI::sImageProvider->getUIImage("UIImgResizeBottomRightUUID");
}
switch( mCorner )

View File

@@ -509,7 +509,7 @@ void LLScrollbar::draw()
// Draw background and thumb.
LLUIImage* rounded_rect_imagep = LLUI::getUIImage("rounded_square.tga");
LLUIImage* rounded_rect_imagep = LLUI::sImageProvider->getUIImage("rounded_square.tga");
if (!rounded_rect_imagep)
{

View File

@@ -132,7 +132,7 @@ void LLScrollListIcon::setValue(const LLSD& value)
{
// don't use default image specified by LLUUID::null, use no image in that case
LLUUID image_id = value.asUUID();
mIcon = image_id.notNull() ? LLUI::getUIImageByID(image_id) : LLUIImagePtr(NULL);
mIcon = image_id.notNull() ? LLUI::sImageProvider->getUIImageByID(image_id) : LLUIImagePtr(NULL);
}
else
{
@@ -325,7 +325,7 @@ LLScrollListText::LLScrollListText( const std::string& text, const LLFontGL* fon
// initialize rounded rect image
if (!mRoundedRectImage)
{
mRoundedRectImage = LLUI::getUIImage("rounded_square.tga");
mRoundedRectImage = LLUI::sImageProvider->getUIImage("rounded_square.tga");
}
}
//virtual

View File

@@ -73,9 +73,9 @@ LLSlider::LLSlider(
mMouseDownCallback( NULL ),
mMouseUpCallback( NULL )
{
mThumbImage = LLUI::getUIImage("icn_slide-thumb_dark.tga");
mTrackImage = LLUI::getUIImage("icn_slide-groove_dark.tga");
mTrackHighlightImage = LLUI::getUIImage("icn_slide-highlight.tga");
mThumbImage = LLUI::sImageProvider->getUIImage("icn_slide-thumb_dark.tga");
mTrackImage = LLUI::sImageProvider->getUIImage("icn_slide-groove_dark.tga");
mTrackHighlightImage = LLUI::sImageProvider->getUIImage("icn_slide-highlight.tga");
// properly handle setting the starting thumb rect
// do it this way to handle both the operating-on-settings

View File

@@ -36,6 +36,7 @@
#include "lluictrl.h"
#include "v4color.h"
class LLImageGL;
class LLSlider : public LLUICtrl
{

View File

@@ -36,7 +36,7 @@
#include "llstring.h"
#include "llui.h"
//#include "llviewertexturelist.h"
//#include "llviewerimagelist.h"
LLStyle::LLStyle()
{
@@ -166,7 +166,7 @@ LLUIImagePtr LLStyle::getImage() const
void LLStyle::setImage(const LLUUID& src)
{
mImagep = LLUI::getUIImageByID(src);
mImagep = LLUI::sImageProvider->getUIImageByID(src);
}

View File

@@ -42,6 +42,7 @@
#include "v4color.h"
#include "llrender.h"
#include "llrect.h"
#include "llimagegl.h"
#include "lldir.h"
#include "llfontgl.h"
@@ -406,7 +407,7 @@ void gl_corners_2d(S32 left, S32 top, S32 right, S32 bottom, S32 length, F32 max
}
void gl_draw_image( S32 x, S32 y, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect )
void gl_draw_image( S32 x, S32 y, LLImageGL* image, const LLColor4& color, const LLRectf& uv_rect )
{
if (NULL == image)
{
@@ -416,7 +417,7 @@ void gl_draw_image( S32 x, S32 y, LLTexture* image, const LLColor4& color, const
gl_draw_scaled_rotated_image( x, y, image->getWidth(0), image->getHeight(0), 0.f, image, color, uv_rect );
}
void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect)
void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color, const LLRectf& uv_rect)
{
if (NULL == image)
{
@@ -426,7 +427,7 @@ void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLTexture* image,
gl_draw_scaled_rotated_image( x, y, width, height, 0.f, image, color, uv_rect );
}
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLTexture* image, const LLColor4& color, BOOL solid_color, const LLRectf& uv_rect)
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLImageGL* image, const LLColor4& color, BOOL solid_color, const LLRectf& uv_rect)
{
if (NULL == image)
{
@@ -442,7 +443,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border
gl_draw_scaled_image_with_border(x, y, width, height, image, color, solid_color, uv_rect, scale_rect);
}
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color, BOOL solid_color, const LLRectf& uv_rect, const LLRectf& scale_rect)
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color, BOOL solid_color, const LLRectf& uv_rect, const LLRectf& scale_rect)
{
stop_glerror();
@@ -628,12 +629,12 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex
}
}
void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect)
void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLImageGL* image, const LLColor4& color, const LLRectf& uv_rect)
{
gl_draw_scaled_rotated_image( x, y, image->getWidth(0), image->getHeight(0), degrees, image, color, uv_rect );
}
void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect)
void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees, LLImageGL* image, const LLColor4& color, const LLRectf& uv_rect)
{
if (NULL == image)
{
@@ -679,7 +680,7 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre
}
void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect)
void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color, const LLRectf& uv_rect)
{
if (NULL == image)
{
@@ -1558,8 +1559,7 @@ void LLUI::initClass(LLControlGroup* config,
LLImageProviderInterface* image_provider,
LLUIAudioCallback audio_callback,
const LLVector2* scale_factor,
const std::string& language
)
const std::string& language)
{
sConfigGroup = config;
sIgnoresGroup = ignores;
@@ -1764,24 +1764,11 @@ void LLUI::glRectToScreen(const LLRect& gl, LLRect *screen)
glPointToScreen(gl.mRight, gl.mBottom, &screen->mRight, &screen->mBottom);
}
//static
LLPointer<LLUIImage> LLUI::getUIImageByID(const LLUUID& image_id, S32 priority)
{
if (sImageProvider)
{
return sImageProvider->getUIImageByID(image_id, priority);
}
else
{
return NULL;
}
}
//static
LLPointer<LLUIImage> LLUI::getUIImage(const std::string& name, S32 priority)
LLUIImage* LLUI::getUIImage(const std::string& name)
{
if (!name.empty() && sImageProvider)
return sImageProvider->getUIImage(name, priority);
if (!name.empty())
return sImageProvider->getUIImage(name);
else
return NULL;
}
@@ -1866,7 +1853,7 @@ LLLocalClipRect::LLLocalClipRect(const LLRect &rect, BOOL enabled)
// LLUIImage
//
LLUIImage::LLUIImage(const std::string& name, LLPointer<LLTexture> image) :
LLUIImage::LLUIImage(const std::string& name, LLPointer<LLImageGL> image) :
mName(name),
mImage(image),
mScaleRegion(0.f, 1.f, 1.f, 0.f),

View File

@@ -42,7 +42,7 @@
//#include "llhtmlhelp.h"
#include "llgl.h" // *TODO: break this dependency
#include <stack>
#include "lltexture.h"
//#include "llimagegl.h"
#include <boost/signal.hpp>
// LLUIFactory
@@ -50,6 +50,7 @@
class LLColor4;
class LLHtmlHelp;
class LLImageGL;
class LLVector3;
class LLVector2;
class LLUUID;
@@ -90,14 +91,14 @@ void gl_washer_2d(F32 outer_radius, F32 inner_radius, S32 steps, const LLColor4&
void gl_washer_segment_2d(F32 outer_radius, F32 inner_radius, F32 start_radians, F32 end_radians, S32 steps, const LLColor4& inner_color, const LLColor4& outer_color);
void gl_washer_spokes_2d(F32 outer_radius, F32 inner_radius, S32 count, const LLColor4& inner_color, const LLColor4& outer_color);
void gl_draw_image(S32 x, S32 y, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees,LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), const LLRectf& scale_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_image(S32 x, S32 y, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees,LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLImageGL* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), const LLRectf& scale_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
// Flip vertical, used for LLFloaterHTML
void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_rect_2d_xor(S32 left, S32 top, S32 right, S32 bottom);
void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& color, F32 phase = 0.f );
@@ -181,8 +182,7 @@ public:
static void getCursorPositionLocal(const LLView* viewp, S32 *x, S32 *y);
static void setScaleFactor(const LLVector2& scale_factor);
static void setLineWidth(F32 width);
static LLPointer<LLUIImage> getUIImageByID(const LLUUID& image_id, S32 priority = 0);
static LLPointer<LLUIImage> getUIImage(const std::string& name, S32 priority = 0);
static LLUIImage* getUIImage(const std::string& name);
static LLVector2 getWindowSize();
static void screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y);
static void glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y);
@@ -416,13 +416,13 @@ public:
class LLUIImage : public LLRefCount
{
public:
LLUIImage(const std::string& name, LLPointer<LLTexture> image);
LLUIImage(const std::string& name, LLPointer<LLImageGL> image);
void setClipRegion(const LLRectf& region);
void setScaleRegion(const LLRectf& region);
LLPointer<LLTexture> getImage() { return mImage; }
const LLPointer<LLTexture>& getImage() const { return mImage; }
LLPointer<LLImageGL> getImage() { return mImage; }
const LLPointer<LLImageGL>& getImage() const { return mImage; }
void draw(S32 x, S32 y, S32 width, S32 height, const LLColor4& color = UI_VERTEX_COLOR) const;
void draw(S32 x, S32 y, const LLColor4& color = UI_VERTEX_COLOR) const;
@@ -449,7 +449,7 @@ protected:
std::string mName;
LLRectf mScaleRegion;
LLRectf mClipRegion;
LLPointer<LLTexture> mImage;
LLPointer<LLImageGL> mImage;
BOOL mUniformScaling;
BOOL mNoClip;
};
@@ -597,8 +597,8 @@ public:
LLImageProviderInterface() {};
virtual ~LLImageProviderInterface() {};
virtual LLUIImagePtr getUIImage(const std::string& name, S32 priority) = 0;
virtual LLUIImagePtr getUIImageByID(const LLUUID& id, S32 priority) = 0;
virtual LLUIImagePtr getUIImage(const std::string& name) = 0;
virtual LLUIImagePtr getUIImageByID(const LLUUID& id) = 0;
virtual void cleanUp() = 0;
};

View File

@@ -69,7 +69,7 @@ void LLViewBorder::setColorsExtended( const LLColor4& shadow_light, const LLColo
void LLViewBorder::setTexture( const LLUUID &image_id )
{
mTexture = LLUI::getUIImageByID(image_id);
mTexture = LLUI::sImageProvider->getUIImageByID(image_id);
}

View File

@@ -563,8 +563,8 @@ void LLDir::setLindenUserDir(const std::string &grid, const std::string &first,
{
std::string gridlower(grid);
LLStringUtil::toLower(gridlower);
mLindenUserDir += "@";
mLindenUserDir += gridlower;
mPerAccountChatLogsDir += "@";
mPerAccountChatLogsDir += gridlower;
}
}
else

View File

@@ -2841,16 +2841,8 @@ void LLSplashScreenWin32::updateImpl(const std::string& mesg)
{
if (!mWindow) return;
int output_str_len = MultiByteToWideChar(CP_UTF8, 0, mesg.c_str(), mesg.length(), NULL, 0);
if( output_str_len>1024 )
return;
WCHAR w_mesg[1025];//big enought to keep null terminatos
MultiByteToWideChar (CP_UTF8, 0, mesg.c_str(), mesg.length(), w_mesg, output_str_len);
//looks like MultiByteToWideChar didn't add null terminator to converted string, see EXT-4858
w_mesg[output_str_len] = 0;
WCHAR w_mesg[1024];
mbstowcs(w_mesg, mesg.c_str(), 1024);
SendDlgItemMessage(mWindow,
666, // HACK: text id
@@ -2978,6 +2970,78 @@ void LLWindowWin32::spawnWebBrowser(const std::string& escaped_url )
sei.lpFile = url_utf16.c_str();
ShellExecuteEx( &sei );
//// TODO: LEAVING OLD CODE HERE SO I DON'T BONE OTHER MERGES
//// DELETE THIS ONCE THE MERGES ARE DONE
// Figure out the user's default web browser
// HKEY_CLASSES_ROOT\http\shell\open\command
/*
std::string reg_path_str = gURLProtocolWhitelistHandler[i] + "\\shell\\open\\command";
WCHAR reg_path_wstr[256];
mbstowcs( reg_path_wstr, reg_path_str.c_str(), LL_ARRAY_SIZE(reg_path_wstr) );
HKEY key;
WCHAR browser_open_wstr[1024];
DWORD buffer_length = 1024;
RegOpenKeyEx(HKEY_CLASSES_ROOT, reg_path_wstr, 0, KEY_QUERY_VALUE, &key);
RegQueryValueEx(key, NULL, NULL, NULL, (LPBYTE)browser_open_wstr, &buffer_length);
RegCloseKey(key);
// Convert to STL string
LLWString browser_open_wstring = utf16str_to_wstring(browser_open_wstr);
if (browser_open_wstring.length() < 2)
{
LL_WARNS("Window") << "Invalid browser executable in registry " << browser_open_wstring << LL_ENDL;
return;
}
// Extract the process that's supposed to be launched
LLWString browser_executable;
if (browser_open_wstring[0] == '"')
{
// executable is quoted, find the matching quote
size_t quote_pos = browser_open_wstring.find('"', 1);
// copy out the string including both quotes
browser_executable = browser_open_wstring.substr(0, quote_pos+1);
}
else
{
// executable not quoted, find a space
size_t space_pos = browser_open_wstring.find(' ', 1);
browser_executable = browser_open_wstring.substr(0, space_pos);
}
LL_DEBUGS("Window") << "Browser reg key: " << wstring_to_utf8str(browser_open_wstring) << LL_ENDL;
LL_INFOS("Window") << "Browser executable: " << wstring_to_utf8str(browser_executable) << LL_ENDL;
// Convert URL to wide string for Windows API
// Assume URL is UTF8, as can come from scripts
LLWString url_wstring = utf8str_to_wstring(escaped_url);
llutf16string url_utf16 = wstring_to_utf16str(url_wstring);
// Convert executable and path to wide string for Windows API
llutf16string browser_exec_utf16 = wstring_to_utf16str(browser_executable);
// ShellExecute returns HINSTANCE for backwards compatiblity.
// MS docs say to cast to int and compare to 32.
HWND our_window = NULL;
LPCWSTR directory_wstr = NULL;
int retval = (int) ShellExecute(our_window, // Flawfinder: ignore
L"open",
browser_exec_utf16.c_str(),
url_utf16.c_str(),
directory_wstr,
SW_SHOWNORMAL);
if (retval > 32)
{
LL_DEBUGS("Window") << "load_url success with " << retval << LL_ENDL;
}
else
{
LL_INFOS("Window") << "load_url failure with " << retval << LL_ENDL;
}
*/
}

View File

@@ -405,15 +405,7 @@ template <> inline void LLCachedControl<LLColor4>::setValue(const LLSD& newvalue
else
this->mCachedValue = (const LLColor4 &)newvalue;
}
template <> inline void LLCachedControl<U32>::setValue(const LLSD& newvalue)
{
if(mControl->isType(TYPE_U32) || mControl->isType(TYPE_S32)) //LLSD does not support U32 fully
mCachedValue = (U32)newvalue.asInteger();
else if(this->mControl->isType(TYPE_F32))
mCachedValue = (U32)newvalue.asReal();
else
mCachedValue = (U32)0; //What to do...
}
//Following is actually defined in newview/llviewercontrol.cpp, but extern access is fine (Unless GCC bites me)
template <> eControlType get_control_type<U32>(const U32& in, LLSD& out);

View File

@@ -64,8 +64,6 @@ include_directories(
)
set(viewer_SOURCE_FILES
llviewerobjectbackup.cpp
slfloatermediafilter.cpp
floaterlocalassetbrowse.cpp
aoremotectrl.cpp
floaterao.cpp
@@ -75,6 +73,7 @@ set(viewer_SOURCE_FILES
ascentfloatercontactgroups.cpp
ascentprefssys.cpp
ascentprefsvan.cpp
ascentuploadbrowser.cpp
dhparam.cpp
dsaparam.cpp
emerald.cpp
@@ -184,6 +183,7 @@ set(viewer_SOURCE_FILES
llfloatereditui.cpp
llfloaterenvsettings.cpp
llfloaterevent.cpp
llfloaterexport.cpp
llfloaterexploreanimations.cpp
llfloaterexploresounds.cpp
llfloaterfriends.cpp
@@ -200,6 +200,7 @@ set(viewer_SOURCE_FILES
llfloaterhtmlsimple.cpp
llfloaterhud.cpp
llfloaterimagepreview.cpp
llfloaterimport.cpp
llfloaterinspect.cpp
llfloaterjoystick.cpp
llfloaterlagmeter.cpp
@@ -267,6 +268,7 @@ set(viewer_SOURCE_FILES
llhudtext.cpp
llhudview.cpp
llimpanel.cpp
llimportobject.cpp
llimview.cpp
llinventoryactions.cpp
llinventorybackup.cpp
@@ -424,8 +426,8 @@ set(viewer_SOURCE_FILES
llviewerdisplay.cpp
llviewergenericmessage.cpp
llviewergesture.cpp
#llviewerimage.cpp
#llviewerimagelist.cpp
llviewerimage.cpp
llviewerimagelist.cpp
llviewerinventory.cpp
llviewerjointattachment.cpp
llviewerjoint.cpp
@@ -455,9 +457,7 @@ set(viewer_SOURCE_FILES
llviewershadermgr.cpp
llviewerstats.cpp
llviewertexteditor.cpp
llviewertexture.cpp
llviewertextureanim.cpp
llviewertexturelist.cpp
llviewerthrottle.cpp
llviewervisualparam.cpp
llviewerwindow.cpp
@@ -536,8 +536,6 @@ set(viewer_HEADER_FILES
CMakeLists.txt
ViewerInstall.cmake
llviewerobjectbackup.h
slfloatermediafilter.h
floaterlocalassetbrowse.h
aoremotectrl.h
floaterao.h
@@ -547,6 +545,7 @@ set(viewer_HEADER_FILES
ascentfloatercontactgroups.h
ascentprefssys.h
ascentprefsvan.h
ascentuploadbrowser.h
emerald.h
emeraldboobutils.h
dofloaterhex.h
@@ -655,6 +654,7 @@ set(viewer_HEADER_FILES
llfloaterdirectory.h
llfloatereditui.h
llfloaterenvsettings.h
llfloaterexport.h
llfloaterexploreanimations.h
llfloaterexploresounds.h
llfloaterevent.h
@@ -672,6 +672,7 @@ set(viewer_HEADER_FILES
llfloaterhtmlsimple.h
llfloaterhud.h
llfloaterimagepreview.h
llfloaterimport.h
llfloaterinspect.h
llfloaterjoystick.h
llfloaterlagmeter.h
@@ -738,6 +739,7 @@ set(viewer_HEADER_FILES
llhudtext.h
llhudview.h
llimpanel.h
llimportobject.h
llimview.h
llinventorybackup.h
llinventorybridge.h
@@ -900,8 +902,8 @@ set(viewer_HEADER_FILES
llviewerdisplay.h
llviewergenericmessage.h
llviewergesture.h
#llviewerimage.h
#llviewerimagelist.h
llviewerimage.h
llviewerimagelist.h
llviewerinventory.h
llviewerjoint.h
llviewerjointattachment.h
@@ -929,9 +931,7 @@ set(viewer_HEADER_FILES
llviewershadermgr.h
llviewerstats.h
llviewertexteditor.h
llviewertexture.h
llviewertextureanim.h
llviewertexturelist.h
llviewerthrottle.h
llviewervisualparam.h
llviewerwindow.h
@@ -1303,10 +1303,7 @@ add_executable(${VIEWER_BINARY_NAME}
MACOSX_BUNDLE
${viewer_SOURCE_FILES}
)
if (!DISABLE_TEMPLATE_CHECK)
check_message_template(${VIEWER_BINARY_NAME})
endif (!DISABLE_TEMPLATE_CHECK)
check_message_template(${VIEWER_BINARY_NAME})
if (LLKDU_LIBRARY)
add_dependencies(${VIEWER_BINARY_NAME} ${LLKDU_LIBRARY})

View File

@@ -9,50 +9,6 @@
<string>settings_rlv.xml</string>
</array>
<key>FloaterObjectBackuptRect</key>
<map>
<key>Comment</key>
<string>Rectangle for the object backup floater</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Rect</string>
<key>Value</key>
<array>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
</array>
</map>
<key>MediaEnableFilter</key>
<map>
<key>Comment</key>
<string>Enable media domain filtering</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>MediaFilterRect</key>
<map>
<key>Comment</key>
<string>Rectangle for Media Filter floater</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Rect</string>
<key>Value</key>
<array>
<integer>0</integer>
<integer>100</integer>
<integer>100</integer>
<integer>100</integer>
</array>
</map>
<key>UseServersideWindlightSettings</key>
<map>
@@ -10948,7 +10904,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
<integer>1</integer>
</map>
<key>ShowStartLocation</key>
<map>
@@ -12999,7 +12955,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
<integer>0</integer>
</map>
<key>VectorizePerfTest</key>
<map>

View File

@@ -68,6 +68,17 @@
<key>Value</key>
<real>2.0</real>
</map>
<key>SHHighResSnapshotForceTile</key>
<map>
<key>Comment</key>
<string>Force tiling of snapshots (enables AA and supersampling)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>SHHighResSnapshotSuperSample</key>
<map>
<key>Comment</key>

View File

@@ -5,8 +5,6 @@
* $License$
*/
#version 120
uniform sampler2D diffuseMap;
uniform float glowStrength;

View File

@@ -5,8 +5,6 @@
* $License$
*/
#extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect RenderTexture;
uniform float bloomStrength;

View File

@@ -5,8 +5,6 @@
* $License$
*/
#extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect RenderTexture;
uniform float brightness;
uniform float contrast;

View File

@@ -5,8 +5,6 @@
* $License$
*/
#extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect RenderTexture;
uniform float extractLow;
uniform float extractHigh;

View File

@@ -1,6 +1,3 @@
#extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect RenderTexture;
uniform int horizontalPass;

View File

@@ -4,8 +4,6 @@
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
* $License$
*/
#extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect RenderTexture;
uniform sampler2D NoiseTexture;

View File

@@ -5,8 +5,6 @@
* $License$
*/
#extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect RenderTexture;
void main(void)

View File

@@ -394,7 +394,7 @@ void LLPrefsAscentSysImpl::apply()
//Missing the echo/log option.
gSavedSettings.setBOOL("PlayTypingSound", childGetValue("play_typing_sound_check"));
gSavedSettings.setBOOL("AscentHideTypingNotification", childGetValue("hide_typing_check"));
gSavedPerAccountSettings.setBOOL("AscentInstantMessageAnnounceIncoming", childGetValue("AscentInstantMessageAnnounceIncoming").asBoolean());
gSavedSettings.setBOOL("AscentInstantMessageAnnounceIncoming", childGetValue("AscentInstantMessageAnnounceIncoming").asBoolean());
gSavedSettings.setBOOL("AscentAllowMUpose", childGetValue("allow_mu_pose_check").asBoolean());
gSavedSettings.setBOOL("AscentAutoCloseOOC", childGetValue("close_ooc_check").asBoolean());
//gSavedSettings.setU32("LinksForChattingObjects", childGetValue("objects_link"). );

View File

@@ -0,0 +1,366 @@
/**
* @file ascentuploadbrowser.h
* @Author Duncan Garrett (Hg Beeks)
* Meant as a replacement to using a system file browser for uploads.
*
* Created August 27 2010
*
* ALL SOURCE CODE IS PROVIDED "AS IS." THE CREATOR MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* k ilu bye
*/
#include "llviewerprecompiledheaders.h"
#include "ascentuploadbrowser.h"
//UI Elements
#include "llbutton.h" //Buttons
#include "llcombobox.h" //Combo dropdowns
#include "llscrolllistctrl.h" //List box for filenames
#include "lluictrlfactory.h" //Loads the XUI
// project includes
#include "llresmgr.h"
#include "llsdserialize.h" //XML Parsing - Probably not needed
#include "llviewercontrol.h"
#include "llviewerwindow.h"
///----------------------------------------------------------------------------
/// Local function declarations, constants, enums, and typedefs
///----------------------------------------------------------------------------
LLSD ASFloaterUploadBrowser::mUploaderSettings;
ASFloaterUploadBrowser* ASFloaterUploadBrowser::sInstance = NULL;
///----------------------------------------------------------------------------
/// Class ASFloaterUploadBrowser
///----------------------------------------------------------------------------
// Default constructor
ASFloaterUploadBrowser::ASFloaterUploadBrowser()
: LLFloater(std::string("floater_upload_browser"),
std::string("FloaterUploadRect"),
LLStringUtil::null)
{
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_upload_browser.xml");
mUploaderSettings.clear();
mUploaderSettings = gSavedSettings.getLLSD("AscentUploadSettings");
mPathName = mUploaderSettings["ActivePath"].asString();
if (mPathName == "None")
mPathName = gDirUtilp->getExecutableDir();
mFilterType = "None";
//File list ------------------------------------------------------
mFileList = getChild<LLScrollListCtrl>("file_list");
childSetCommitCallback("file_list", onClickFile, this);
childSetDoubleClickCallback("file_list", onDoubleClick);
//Above File List ------------------------------------------------
mBookmarkCombo = getChild<LLComboBox>("bookmark_combo");
S32 index;
for (index = 0; index < mUploaderSettings["Bookmarks"].size(); index++)
{
std::string bookmark = mUploaderSettings["Bookmarks"][index].asString();
if (bookmark != "")
mBookmarkCombo->add(bookmark, ADD_BOTTOM);
}
mDriveCombo = getChild<LLComboBox>("drive_combo");
childSetCommitCallback("drive_combo", onChangeDrives, this);
//This is so unbelievably shitty I can't handle it -HgB
std::string drive_letters[] = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}; //Oh my god it's somehow worse now -HgB
mDriveCombo->removeall();
for (index = 0; index < 26; index++)
{
std::string dir = drive_letters[index] + ":";
S32 file_count = gDirUtilp->countFilesInDir(dir + gDirUtilp->getDirDelimiter(), "*.*");
if(file_count)
{
mDriveCombo->add(dir, ADD_BOTTOM);
}
}
childSetAction("directory_button", onClickFilepathGoto, this);
childSetCommitCallback("dir_path", onDirCommit, (void*)this);
//Below File List ------------------------------------------------
childSetCommitCallback("file_filter_combo", onUpdateFilter, this);
refresh();
mFileList->sortByColumn(std::string("file_name"), TRUE);
mFileList->sortByColumn(std::string("file_type"), TRUE);
childHide("multiple_uploads_label");
childHide("bad_image_text");
}
// Destroys the object
ASFloaterUploadBrowser::~ASFloaterUploadBrowser()
{
sInstance = NULL;
}
void ASFloaterUploadBrowser::onDirCommit(LLUICtrl* ctrl, void* data)
{
ASFloaterUploadBrowser* panelp = (ASFloaterUploadBrowser*)data;
if (panelp)
{
panelp->onClickFilepathGoto(data);
}
}
void ASFloaterUploadBrowser::updateBrowser(void* data, std::string new_path)
{
ASFloaterUploadBrowser* panelp = (ASFloaterUploadBrowser*)data;
if ((new_path != panelp->mPathName)||(new_path == ""))
{
panelp->mPathName = new_path;
panelp->refresh();
panelp->mFileList->selectFirstItem();
panelp->childSetValue("asset_name", "");
}
}
//static
void ASFloaterUploadBrowser::onClickFilepathGoto(void* data)
{
ASFloaterUploadBrowser* panelp = (ASFloaterUploadBrowser*)data;
std::string new_path = panelp->childGetValue("dir_path");
panelp->updateBrowser(data, new_path);
}
void ASFloaterUploadBrowser::onClickFile(LLUICtrl* ctrl, void* user_data)
{
ASFloaterUploadBrowser* panelp = (ASFloaterUploadBrowser*)user_data;
panelp->refreshUploadOptions();
}
void ASFloaterUploadBrowser::onChangeDrives(LLUICtrl* ctrl, void* user_data)
{
ASFloaterUploadBrowser* panelp = (ASFloaterUploadBrowser*)user_data;
if (panelp->mDriveCombo->getSelectedValue().asString() != panelp->mFilterType)
{
panelp->updateBrowser(user_data, panelp->mDriveCombo->getSelectedValue().asString());
}
}
void ASFloaterUploadBrowser::onUpdateFilter(LLUICtrl* ctrl, void* user_data)
{
ASFloaterUploadBrowser* panelp = (ASFloaterUploadBrowser*)user_data;
LLComboBox* combo = panelp->getChild<LLComboBox>("file_filter_combo");
if (combo->getSelectedValue().asString() != panelp->mFilterType)
{
panelp->mFilterType = "";
panelp->mFilterType = combo->getSelectedValue().asString();
panelp->updateBrowser(user_data, "");
}
}
void ASFloaterUploadBrowser::refreshUploadOptions()
{
if (!mFileList->isEmpty())
{
if(!mFileList->getSelectedIDs().count())
{
llinfos << "No selection, clearing field." << llendl;
childSetValue("asset_name", "");
}
else
{
if (mFileList->getFirstSelected()->getColumn(LIST_ASSET_TYPE)->getValue().asInteger() == LIST_TYPE_FILE)
{
std::string name;
bool show_tex = false;
bool show_snd = false;
bool show_anm = false;
bool show_multiple = false;
if (mFileList->getAllSelected().size() > 1)
{
llinfos << "Selected multiple files." << llendl;
name = "(Multiple)";
show_multiple = true;
/*LLButton* expand_button = getChild<LLButton>("expand_collapse_btn");
expand_button->setLabelArg("[COST]", std::string(mFileList->getAllSelected().size() * 10));*/
childSetValue("multiple_uploads_label", "Multiple files selected. Total cost is: " + llformat("%d", mFileList->getAllSelected().size() * 10));
}
else
{
int type = mFileList->getFirstSelected()->getColumn(LIST_FILE_TYPE)->getValue().asInteger();
llinfos << "Selected a file, type" << type << llendl;
if (type == FILE_TEXTURE)
{
show_tex = true;
}
else if (type == FILE_SOUND)
{
show_snd = true;
}
else if (type == FILE_ANIMATION)
{
show_anm = true;
}
name = mFileList->getFirstSelected()->getColumn(LIST_FILE_NAME)->getValue().asString();
}
childSetVisible("texture_preview_label", (show_tex && !show_multiple));
childSetVisible("texture_preview_combo", (show_tex && !show_multiple));
childSetVisible("multiple_uploads_label", show_multiple);
childSetValue("asset_name", name);
}
}
}
}
void ASFloaterUploadBrowser::onDoubleClick(void* user_data)
{
ASFloaterUploadBrowser* panelp = (ASFloaterUploadBrowser*)user_data;
panelp->handleDoubleClick();
}
void ASFloaterUploadBrowser::handleDoubleClick()
{
if (mFileList->getFirstSelected()->getColumn(LIST_ASSET_TYPE)->getValue().asInteger() == LIST_TYPE_PARENT)
{
S32 dirLimiterIndex = mPathName.find_last_of(gDirUtilp->getDirDelimiter());
mPathName = mPathName.substr(0, dirLimiterIndex);
refresh();
mFileList->selectFirstItem();
}
else if (mFileList->getFirstSelected()->getColumn(LIST_ASSET_TYPE)->getValue().asInteger() == LIST_TYPE_FOLDER)
{
//Make sure that it's an actual folder so you don't get stuck - Specifically meant for files with no extension. -HgB
std::string new_path = mPathName + gDirUtilp->getDirDelimiter() + mFileList->getFirstSelected()->getColumn(LIST_FILE_NAME)->getValue().asString();
S32 file_count = gDirUtilp->countFilesInDir(new_path, "*.*");
if(!file_count)
return;
mPathName = mPathName + gDirUtilp->getDirDelimiter() + mFileList->getFirstSelected()->getColumn(LIST_FILE_NAME)->getValue().asString();
refresh();
mFileList->selectFirstItem();
}
childSetValue("asset_name", "");
}
void ASFloaterUploadBrowser::refresh()
{
std::string filename;
std::string fullPath = mPathName + gDirUtilp->getDirDelimiter();
mFileList->deselectAllItems();
mFileList->deleteAllItems();
childSetValue("dir_path", gDirUtilp->getDirName(fullPath));
mUploaderSettings["ActivePath"] = mPathName;
gSavedSettings.setLLSD("AscentUploadSettings", mUploaderSettings);
gDirUtilp->getNextFileInDir(gDirUtilp->getChatLogsDir(),"*", filename, false); //Clears the last file
bool found = true;
S32 file_count = 0;
while(found)
{
found = gDirUtilp->getNextFileInDir(fullPath, "*.*", filename, false);
if(found)
{
S32 periodIndex = filename.find_last_of(".");
std::string extension = filename.substr(periodIndex + 1, filename.length() - 1);
std::string extensionL = utf8str_tolower(extension);
LLSD element;
element["path"] = mPathName + filename;
LLSD& filename_column = element["columns"][LIST_FILE_NAME];
filename_column["column"] = "file_name";
filename_column["font"] = "SANSSERIF";
filename_column["font-style"] = "NORMAL";
LLSD& filetype_column = element["columns"][LIST_FILE_TYPE];
filetype_column["column"] = "file_type";
filetype_column["type"] = "number";
LLSD& assettype_column = element["columns"][LIST_ASSET_TYPE];
assettype_column["column"] = "asset_type";
assettype_column["type"] = "number";
LLSD& invtype_column = element["columns"][LIST_INVENTORY_TYPE];
invtype_column["column"] = "icon_inventory_type";
invtype_column["type"] = "icon";
invtype_column["value"] = "inv_folder_trash.tga";
if (((extensionL == "jpeg")||(extensionL == "jpg")||(extensionL == "tga")
||(extensionL == "png")||(extensionL == "bmp"))&&((mFilterType == "None")||(mFilterType == "Texture")))
{
invtype_column["value"] = "inv_item_texture.tga";
filename_column["value"] = filename.substr(0, periodIndex);
filetype_column["value"] = FILE_TEXTURE;
assettype_column["value"] = LIST_TYPE_FILE;
}
else if ((extensionL == "wav")&&((mFilterType == "None")||(mFilterType == "Sound")))
{
invtype_column["value"] = "inv_item_sound.tga";
filename_column["value"] = filename.substr(0, periodIndex);
filetype_column["value"] = FILE_SOUND;
assettype_column["value"] = LIST_TYPE_FILE;
}
else if (((extensionL == "bvh")||(extensionL == "anim"))&&((mFilterType == "None")||(mFilterType == "Animation")))
{
invtype_column["value"] = "inv_item_animation.tga";
filename_column["value"] = filename.substr(0, periodIndex);
filetype_column["value"] = FILE_ANIMATION;
assettype_column["value"] = LIST_TYPE_FILE;
}
else if ((extension == filename.substr(0, filename.length() - 1))&&(filename != "."))
{
std::string test_path = mPathName + gDirUtilp->getDirDelimiter() + filename + gDirUtilp->getDirDelimiter();
S32 file_count = gDirUtilp->countFilesInDir(test_path, "*.*");
if(file_count)
{
invtype_column["value"] = "inv_folder_plain_closed.tga";
filename_column["value"] = filename;
filetype_column["value"] = FOLDER;
assettype_column["value"] = LIST_TYPE_FOLDER;
}
}
else if (filename == "..")
{
invtype_column["value"] = "inv_folder_plain_open.tga";
filename_column["value"] = filename;
filetype_column["value"] = FOLDER;
assettype_column["value"] = LIST_TYPE_PARENT;
}
if (invtype_column["value"].asString() != "inv_folder_trash.tga")
{
mFileList->addElement(element, ADD_BOTTOM);
if (assettype_column["value"].asInteger() == LIST_TYPE_FILE)
{
file_count++;
}
}
}
}
std::string result;
LLResMgr::getInstance()->getIntegerString(result, file_count);
if (result == "")
result = "0";
childSetTextArg("result_label", "[COUNT]", result);
mFileList->sortItems();
llinfos << "Total files loaded: " << result << "." << llendl;
}
// static
void ASFloaterUploadBrowser::show(void*)
{
if (!sInstance)
{
sInstance = new ASFloaterUploadBrowser();
}
sInstance->open(); /*Flawfinder: ignore*/
}

View File

@@ -0,0 +1,78 @@
/**
* @file ascentuploadbrowser.h
* @Author Duncan Garrett
* Meant as a replacement to using Windows' file browser for uploads.
*
* Created August 27 2010
*
* ALL SOURCE CODE IS PROVIDED "AS IS." THE CREATOR MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* k ilu bye
*/
#ifndef ASCENT_UPLOAD_BROWSER
#define ASCENT_UPLOAD_BROWSER
#include "llfloater.h"
#include "llcombobox.h"
class LLScrollListCtrl;
class ASFloaterUploadBrowser : public LLFloater
{
public:
using LLFloater::handleDoubleClick;
ASFloaterUploadBrowser();
virtual ~ASFloaterUploadBrowser();
//File list
static void onClickFile(LLUICtrl* ctrl, void* user_data);
static void onUpdateFilter(LLUICtrl* ctrl, void* user_data);
static void onDoubleClick(void* user_data);
static void onDirCommit (LLUICtrl* ctrl, void* data);
static void onChangeDrives(LLUICtrl* ctrl, void* user_data);
static void onClickFilepathGoto(void* data);
void updateBrowser(void* data, std::string new_path);
void refresh();
void refreshUploadOptions();
void handleDoubleClick();
static void show(void*);
std::vector<LLSD> datas;
private:
static LLSD mUploaderSettings;
static ASFloaterUploadBrowser* sInstance;
enum FILE_COLUMN_ORDER
{
LIST_FILE_TYPE,
LIST_ASSET_TYPE,
LIST_INVENTORY_TYPE,
LIST_FILE_NAME,
LIST_DATA
};
enum FILE_TYPE_ORDER
{
LIST_TYPE_PARENT,
LIST_TYPE_FOLDER,
LIST_TYPE_FILE
};
enum FILE_TYPE
{
FOLDER,
FILE_TEXTURE,
FILE_SOUND,
FILE_ANIMATION
};
LLScrollListCtrl* mFileList;
LLComboBox* mDriveCombo;
LLComboBox* mBookmarkCombo;
std::string mPathName;
std::string mFilterType;
};
#endif // ASCENT_UPLOAD_BROWSER

View File

@@ -141,7 +141,7 @@ BOOL DOFloaterHex::postBuild(void)
// static
void DOFloaterHex::imageCallback(BOOL success,
LLViewerFetchedTexture *src_vi,
LLViewerImage *src_vi,
LLImageRaw* src,
LLImageRaw* aux_src,
S32 discard_level,
@@ -179,7 +179,7 @@ void DOFloaterHex::imageCallback(BOOL success,
}
else
{
src_vi->setBoostLevel(LLViewerTexture::BOOST_UI);
src_vi->setBoostLevel(LLViewerImageBoostLevel::BOOST_UI);
}
}

View File

@@ -7,7 +7,7 @@
#include "llfloater.h"
#include "dohexeditor.h"
#include "llinventory.h"
#include "llviewertexture.h"
#include "llviewerimage.h"
#include "llassettype.h"
class DOFloaterHex
@@ -19,7 +19,7 @@ public:
BOOL postBuild(void);
void close(bool app_quitting);
static void imageCallback(BOOL success,
LLViewerFetchedTexture *src_vi,
LLViewerImage *src_vi,
LLImageRaw* src,
LLImageRaw* aux_src,
S32 discard_level,

View File

@@ -53,11 +53,9 @@ WindLightUseAtmosShaders 1 1
WLSkyDetail 1 128
Disregard128DefaultDrawDistance 1 1
Disregard96DefaultDrawDistance 1 1
RenderShaderLightingMaxLevel 1 3
RenderTextureMemoryMultiple 1 1.0
RenderUseFBO 1 1
RenderDeferred 1 1
RenderFastAlpha 1 1
RenderShaderLightingMaxLevel 1 3
//
// Low Graphics Settings
@@ -65,10 +63,10 @@ RenderFastAlpha 1 1
list Low
RenderAnisotropic 1 0
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 0.25
RenderAvatarLODFactor 1 0.5
RenderAvatarVP 1 0
RenderFarClip 1 64
RenderFlexTimeFactor 1 0.1
RenderFlexTimeFactor 1 0.5
RenderGlowResolutionPow 1 8
RenderLightingDetail 1 0
RenderMaxPartCount 1 1024
@@ -76,16 +74,13 @@ RenderObjectBump 1 0
RenderReflectionDetail 1 0
RenderTerrainDetail 1 0
RenderTerrainLODFactor 1 1
RenderTreeLODFactor 1 0.25
RenderTreeLODFactor 1 0.5
RenderUseImpostors 1 1
RenderVolumeLODFactor 1 0.5
RenderVolumeLODFactor 1 1.125
RenderWaterReflections 1 0
VertexShaderEnable 1 0
WindLightUseAtmosShaders 1 0
WLSkyDetail 1 48
RenderUseFBO 0 0
RenderDeferred 0 0
RenderFastAlpha 0 0
//
// Mid Graphics Settings
@@ -96,7 +91,7 @@ RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 0.5
RenderAvatarVP 1 1
RenderFarClip 1 96
RenderFlexTimeFactor 1 0.5
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 8
RenderLightingDetail 1 1
RenderMaxPartCount 1 2048
@@ -111,10 +106,6 @@ RenderWaterReflections 1 0
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 0
WLSkyDetail 1 48
RenderUseFBO 1 0
RenderDeferred 1 0
RenderFastAlpha 1 0
//
// High Graphics Settings (purty)
@@ -140,10 +131,6 @@ RenderWaterReflections 1 0
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
WLSkyDetail 1 48
RenderUseFBO 1 0
RenderDeferred 1 0
RenderFastAlpha 1 0
//
// Ultra graphics (REALLY PURTY!)
@@ -169,9 +156,6 @@ RenderWaterReflections 1 1
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
WLSkyDetail 1 128
RenderUseFBO 1 1
RenderDeferred 1 1
RenderFastAlpha 1 1
//
// Class Unknown Hardware (unknown)

View File

@@ -53,11 +53,7 @@ WindLightUseAtmosShaders 1 1
WLSkyDetail 1 128
Disregard128DefaultDrawDistance 1 1
Disregard96DefaultDrawDistance 1 1
RenderShaderLightingMaxLevel 1 3
RenderTextureMemoryMultiple 1 1.0
RenderUseFBO 1 1
RenderDeferred 1 1
RenderFastAlpha 1 1
//
// Low Graphics Settings
@@ -65,10 +61,10 @@ RenderFastAlpha 1 1
list Low
RenderAnisotropic 1 0
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 0.25
RenderAvatarLODFactor 1 0.5
RenderAvatarVP 1 0
RenderFarClip 1 64
RenderFlexTimeFactor 1 0.1
RenderFlexTimeFactor 1 0.5
RenderGlowResolutionPow 1 8
RenderLightingDetail 1 0
RenderMaxPartCount 1 1024
@@ -76,16 +72,13 @@ RenderObjectBump 1 0
RenderReflectionDetail 1 0
RenderTerrainDetail 1 0
RenderTerrainLODFactor 1 1
RenderTreeLODFactor 1 0.25
RenderTreeLODFactor 1 0.5
RenderUseImpostors 1 1
RenderVolumeLODFactor 1 0.5
RenderVolumeLODFactor 1 1.125
RenderWaterReflections 1 0
VertexShaderEnable 1 0
WindLightUseAtmosShaders 1 0
WLSkyDetail 1 48
RenderUseFBO 0 0
RenderDeferred 0 0
RenderFastAlpha 0 0
//
// Mid Graphics Settings
@@ -96,7 +89,7 @@ RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 0.5
RenderAvatarVP 1 1
RenderFarClip 1 96
RenderFlexTimeFactor 1 0.5
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 8
RenderLightingDetail 1 1
RenderMaxPartCount 1 2048
@@ -111,10 +104,6 @@ RenderWaterReflections 1 0
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 0
WLSkyDetail 1 48
RenderUseFBO 1 0
RenderDeferred 1 0
RenderFastAlpha 1 0
//
// High Graphics Settings (purty)
@@ -140,10 +129,6 @@ RenderWaterReflections 1 0
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
WLSkyDetail 1 48
RenderUseFBO 1 0
RenderDeferred 1 0
RenderFastAlpha 1 0
//
// Ultra graphics (REALLY PURTY!)
@@ -169,10 +154,6 @@ RenderWaterReflections 1 1
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
WLSkyDetail 1 128
RenderUseFBO 1 1
RenderDeferred 1 1
RenderFastAlpha 1 1
//
// Class Unknown Hardware (unknown)
@@ -238,9 +219,6 @@ RenderUseImpostors 0 0
RenderVBOEnable 1 0
RenderWaterReflections 0 0
WindLightUseAtmosShaders 0 0
RenderUseFBO 1 0
RenderDeferred 1 0
//
// CPU based feature masks

View File

@@ -23,41 +23,39 @@ version 20
// NOTE: All settings are set to the MIN of applied values, including 'all'!
//
list all
RenderAnisotropic 1 0
RenderAvatarCloth 1 1
RenderAvatarLODFactor 1 1.0
RenderAvatarVP 1 1
RenderCubeMap 1 1
RenderFarClip 1 256
RenderFlexTimeFactor 1 1.0
RenderFogRatio 1 4.0
RenderGamma 1 0
RenderGlowResolutionPow 1 9
RenderGround 1 1
RenderLightingDetail 1 1
RenderMaxPartCount 1 8192
RenderNightBrightness 1 1.0
RenderObjectBump 1 1
RenderReflectionDetail 1 3
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 2.0
RenderTreeLODFactor 1 1.0
RenderUseImpostors 1 1
RenderVBOEnable 1 1
RenderVolumeLODFactor 1 2.0
RenderWaterReflections 1 1
UseStartScreen 1 1
UseOcclusion 1 1
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
WLSkyDetail 1 128
RenderAnisotropic 1 0
RenderAvatarCloth 0 0
RenderAvatarLODFactor 1 1.0
RenderAvatarVP 1 0
RenderCubeMap 1 1
RenderFarClip 1 256
RenderFlexTimeFactor 1 1.0
RenderFogRatio 1 4.0
RenderGamma 1 0
RenderGlowResolutionPow 1 9
RenderGround 1 1
RenderLightingDetail 1 1
RenderMaxPartCount 1 8192
RenderNightBrightness 1 1.0
RenderObjectBump 1 1
RenderReflectionDetail 1 3
RenderTerrainDetail 1 1
RenderTerrainLODFactor 1 2.0
RenderTreeLODFactor 1 1.0
RenderUseImpostors 1 1
RenderVBOEnable 1 1
RenderVolumeLODFactor 1 2.0
RenderWaterReflections 1 1
UseOcclusion 1 1
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
WLSkyDetail 1 128
RenderUseCleverUI 1 1
Disregard128DefaultDrawDistance 1 1
Disregard96DefaultDrawDistance 1 1
RenderTextureMemoryMultiple 1 0.5
Disregard128DefaultDrawDistance 1 1
Disregard96DefaultDrawDistance 1 1
RenderShaderLightingMaxLevel 1 3
RenderTextureMemoryMultiple 1 1.0
RenderUseFBO 1 1
RenderDeferred 1 1
RenderFastAlpha 1 1
//
// Low Graphics Settings
@@ -65,10 +63,10 @@ RenderFastAlpha 1 1
list Low
RenderAnisotropic 1 0
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 0.25
RenderAvatarLODFactor 1 0.5
RenderAvatarVP 1 0
RenderFarClip 1 64
RenderFlexTimeFactor 1 0.1
RenderFlexTimeFactor 1 0.5
RenderGlowResolutionPow 1 8
RenderLightingDetail 1 0
RenderMaxPartCount 1 1024
@@ -76,16 +74,13 @@ RenderObjectBump 1 0
RenderReflectionDetail 1 0
RenderTerrainDetail 1 0
RenderTerrainLODFactor 1 1
RenderTreeLODFactor 1 0.25
RenderTreeLODFactor 1 0.5
RenderUseImpostors 1 1
RenderVolumeLODFactor 1 0.5
RenderVolumeLODFactor 1 1.125
RenderWaterReflections 1 0
VertexShaderEnable 1 0
WindLightUseAtmosShaders 1 0
WLSkyDetail 1 48
RenderUseFBO 0 0
RenderDeferred 0 0
RenderFastAlpha 0 0
//
// Mid Graphics Settings
@@ -96,7 +91,7 @@ RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 0.5
RenderAvatarVP 1 1
RenderFarClip 1 96
RenderFlexTimeFactor 1 0.5
RenderFlexTimeFactor 1 1.0
RenderGlowResolutionPow 1 8
RenderLightingDetail 1 1
RenderMaxPartCount 1 2048
@@ -111,10 +106,6 @@ RenderWaterReflections 1 0
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 0
WLSkyDetail 1 48
RenderUseFBO 1 0
RenderDeferred 1 0
RenderFastAlpha 1 0
//
// High Graphics Settings (purty)
@@ -140,10 +131,6 @@ RenderWaterReflections 1 0
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
WLSkyDetail 1 48
RenderUseFBO 1 0
RenderDeferred 1 0
RenderFastAlpha 1 0
//
// Ultra graphics (REALLY PURTY!)
@@ -169,9 +156,6 @@ RenderWaterReflections 1 1
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
WLSkyDetail 1 128
RenderUseFBO 1 1
RenderDeferred 1 1
RenderFastAlpha 1 1
//
// Class Unknown Hardware (unknown)

View File

@@ -53,7 +53,7 @@ this feature is still a work in progress.
/* misc headers */
#include <time.h>
#include <ctime>
#include "llviewertexturelist.h"
#include "llviewerimagelist.h"
#include "llviewerobjectlist.h"
#include "llfilepicker.h"
#include "llviewermenufile.h"
@@ -129,16 +129,16 @@ LocalBitmap::LocalBitmap(std::string fullpath)
LLImageRaw* raw_image = new LLImageRaw();
if ( this->decodeSelf(raw_image) )
{
/* creating a shell LLViewerTexture and fusing raw image into it */
LLViewerFetchedTexture* viewer_image = new LLViewerFetchedTexture( "file://"+this->filename, this->id, LOCAL_USE_MIPMAPS );
/* creating a shell LLViewerImage and fusing raw image into it */
LLViewerImage* viewer_image = new LLViewerImage( "file://"+this->filename, this->id, LOCAL_USE_MIPMAPS );
viewer_image->createGLTexture( LOCAL_DISCARD_LEVEL, raw_image );
viewer_image->setCachedRawImage(-1,raw_image);
viewer_image->mCachedRawImage = raw_image;
/* making damn sure gTextureList will not delete it prematurely */
/* making damn sure gImageList will not delete it prematurely */
viewer_image->ref();
/* finalizing by adding LLViewerTexture instance into gTextureList */
gTextureList.addImage(viewer_image);
/* finalizing by adding LLViewerImage instance into gImageList */
gImageList.addImage(viewer_image);
/* filename is valid, bitmap is decoded and valid, i can haz liftoff! */
this->valid = true;
@@ -172,12 +172,12 @@ void LocalBitmap::updateSelf()
if ( !decodeSelf(new_imgraw) ) { this->linkstatus = LINK_UPDATING; return; }
else { this->linkstatus = LINK_ON; }
LLViewerFetchedTexture* image = gTextureList.findImage(this->id);
LLViewerImage* image = gImageList.hasImage(this->id);
if (!image->forSculpt())
if (!image->mForSculpt)
{ image->createGLTexture( LOCAL_DISCARD_LEVEL, new_imgraw ); }
else
{ image->setCachedRawImage(-1,new_imgraw); }
{ image->mCachedRawImage = new_imgraw; }
/* finalizing by updating lastmod to current */
this->last_modified = new_last_modified;
@@ -222,7 +222,7 @@ bool LocalBitmap::decodeSelf(LLImageRaw* rawimg)
if ( !bmp_image->load(filename) ) { break; }
if ( !bmp_image->decode(rawimg, 0.0f) ) { break; }
rawimg->biasedScaleToPowerOfTwo( LLViewerTexture::MAX_IMAGE_SIZE_DEFAULT );
rawimg->biasedScaleToPowerOfTwo( LLViewerImage::MAX_IMAGE_SIZE_DEFAULT );
return true;
}
@@ -235,7 +235,7 @@ bool LocalBitmap::decodeSelf(LLImageRaw* rawimg)
if( ( tga_image->getComponents() != 3) &&
( tga_image->getComponents() != 4) ) { break; }
rawimg->biasedScaleToPowerOfTwo( LLViewerTexture::MAX_IMAGE_SIZE_DEFAULT );
rawimg->biasedScaleToPowerOfTwo( LLViewerImage::MAX_IMAGE_SIZE_DEFAULT );
return true;
}
@@ -245,7 +245,7 @@ bool LocalBitmap::decodeSelf(LLImageRaw* rawimg)
if ( !jpeg_image->load(filename) ) { break; }
if ( !jpeg_image->decode(rawimg, 0.0f) ) { break; }
rawimg->biasedScaleToPowerOfTwo( LLViewerTexture::MAX_IMAGE_SIZE_DEFAULT );
rawimg->biasedScaleToPowerOfTwo( LLViewerImage::MAX_IMAGE_SIZE_DEFAULT );
return true;
}
@@ -255,7 +255,7 @@ bool LocalBitmap::decodeSelf(LLImageRaw* rawimg)
if ( !png_image->load(filename) ) { break; }
if ( !png_image->decode(rawimg, 0.0f) ) { break; }
rawimg->biasedScaleToPowerOfTwo( LLViewerTexture::MAX_IMAGE_SIZE_DEFAULT );
rawimg->biasedScaleToPowerOfTwo( LLViewerImage::MAX_IMAGE_SIZE_DEFAULT );
return true;
}
@@ -493,8 +493,8 @@ void LocalAssetBrowser::DelBitmap( std::vector<LLScrollListItem*> delete_vector,
if ( unit->getID() == id )
{
LLViewerFetchedTexture* image = gTextureList.findImage(id);
gTextureList.deleteImage( image );
LLViewerImage* image = gImageList.hasImage(id);
gImageList.deleteImage( image );
image->unref();
iter = loaded_bitmaps.erase(iter);
@@ -685,7 +685,7 @@ void LocalAssetBrowser::PerformSculptUpdates(LocalBitmap* unit)
// update code [begin]
if ( unit->volume_dirty )
{
LLImageRaw* rawimage = gTextureList.findImage( unit->getID() )->getCachedRawImage();
LLImageRaw* rawimage = gImageList.hasImage( unit->getID() )->getCachedRawImage();
aobj.object->getVolume()->sculpt(rawimage->getWidth(), rawimage->getHeight(),
rawimage->getComponents(), rawimage->getData(), 0);

View File

@@ -55,7 +55,7 @@
#include "llvoavatar.h"
#include "pipeline.h"
#include "lluictrlfactory.h"
#include "llviewertexturelist.h"
#include "llviewerimagelist.h"
#include "llstring.h"
#include "llviewercontrol.h"
@@ -157,8 +157,8 @@ LLFloaterSculptPreview::~LLFloaterSculptPreview()
clearAllPreviewTextures();
mRawImagep = NULL;
mAvatarPreview = NULL;
mSculptedPreview = NULL;
delete mAvatarPreview;
delete mSculptedPreview;
mImagep = NULL ;
}
@@ -267,9 +267,10 @@ void LLFloaterSculptPreview::draw()
}
else
{
mImagep = LLViewerTextureManager::getLocalTexture(mRawImagep.get(), FALSE) ;
mImagep = new LLImageGL(mRawImagep, FALSE) ;
gGL.getTexUnit(0)->bind(mImagep);
gGL.getTexUnit(0)->unbind(mImagep->getTarget()) ;
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mImagep->getTexName());
stop_glerror();
gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
@@ -308,11 +309,11 @@ void LLFloaterSculptPreview::draw()
if (selected == 9)
{
gGL.getTexUnit(0)->bind(mSculptedPreview);
gGL.getTexUnit(0)->bind(mSculptedPreview->getTexture());
}
else
{
gGL.getTexUnit(0)->bind(mAvatarPreview);
gGL.getTexUnit(0)->bind(mAvatarPreview->getTexture());
}
gGL.begin( LLRender::QUADS );
@@ -512,7 +513,7 @@ void LLFloaterSculptPreview::onMouseCaptureLostImagePreview(LLMouseHandler* hand
//-----------------------------------------------------------------------------
// LLPreviewAvatar
//-----------------------------------------------------------------------------
LLPreviewAvatar::LLPreviewAvatar(S32 width, S32 height) : LLViewerDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE)
LLPreviewAvatar::LLPreviewAvatar(S32 width, S32 height) : LLDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE)
{
mNeedsUpdate = TRUE;
mTargetJoint = NULL;
@@ -602,7 +603,7 @@ BOOL LLPreviewAvatar::render()
glMatrixMode(GL_PROJECTION);
gGL.pushMatrix();
glLoadIdentity();
glOrtho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f);
glOrtho(0.0f, mWidth, 0.0f, mHeight, -1.0f, 1.0f);
glMatrixMode(GL_MODELVIEW);
gGL.pushMatrix();
@@ -611,7 +612,7 @@ BOOL LLPreviewAvatar::render()
LLGLSUIDefault def;
gGL.color4f(0.15f, 0.2f, 0.3f, 1.f);
gl_rect_2d_simple( mFullWidth, mFullHeight );
gl_rect_2d_simple( mWidth, mHeight );
glMatrixMode(GL_PROJECTION);
gGL.popMatrix();
@@ -633,9 +634,9 @@ BOOL LLPreviewAvatar::render()
stop_glerror();
LLViewerCamera::getInstance()->setAspect((F32)mFullWidth / mFullHeight);
LLViewerCamera::getInstance()->setAspect((F32)mWidth / mHeight);
LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / mCameraZoom);
LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight, FALSE);
LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mWidth, mHeight, FALSE);
LLVertexBuffer::unbind();
avatarp->updateLOD();
@@ -693,7 +694,7 @@ void LLPreviewAvatar::pan(F32 right, F32 up)
// LLPreviewSculpted
//-----------------------------------------------------------------------------
LLPreviewSculpted::LLPreviewSculpted(S32 width, S32 height) : LLViewerDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE)
LLPreviewSculpted::LLPreviewSculpted(S32 width, S32 height) : LLDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE)
{
mNeedsUpdate = TRUE;
mCameraDistance = 0.f;
@@ -776,7 +777,7 @@ BOOL LLPreviewSculpted::render()
glMatrixMode(GL_PROJECTION);
gGL.pushMatrix();
glLoadIdentity();
glOrtho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f);
glOrtho(0.0f, mWidth, 0.0f, mHeight, -1.0f, 1.0f);
glMatrixMode(GL_MODELVIEW);
gGL.pushMatrix();
@@ -784,7 +785,7 @@ BOOL LLPreviewSculpted::render()
gGL.color4f(1.f, 1.f, 1.f, 1.f);
gl_rect_2d_simple( mFullWidth, mFullHeight );
gl_rect_2d_simple( mWidth, mHeight );
glMatrixMode(GL_PROJECTION);
gGL.popMatrix();
@@ -807,9 +808,9 @@ BOOL LLPreviewSculpted::render()
stop_glerror();
LLViewerCamera::getInstance()->setAspect((F32) mFullWidth / mFullHeight);
LLViewerCamera::getInstance()->setAspect((F32) mWidth / mHeight);
LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / mCameraZoom);
LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight, FALSE);
LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mWidth, mHeight, FALSE);
const LLVolumeFace &vf = mVolume->getVolumeFace(0);
U32 num_indices = vf.mIndices.size();

View File

@@ -46,7 +46,7 @@ class LLVOAvatar;
class LLTextBox;
class LLVertexBuffer;
class LLPreviewSculpted : public LLViewerDynamicTexture
class LLPreviewSculpted : public LLDynamicTexture
{
public:
LLPreviewSculpted(S32 width, S32 height);
@@ -75,7 +75,7 @@ class LLPreviewSculpted : public LLViewerDynamicTexture
};
class LLPreviewAvatar : public LLViewerDynamicTexture
class LLPreviewAvatar : public LLDynamicTexture
{
public:
LLPreviewAvatar(S32 width, S32 height);
@@ -129,13 +129,13 @@ protected:
bool loadImage(LLImageRaw* src);
LLPointer<LLImageRaw> mRawImagep;
LLPointer<LLPreviewAvatar> mAvatarPreview;
LLPointer<LLPreviewSculpted> mSculptedPreview;
LLPreviewAvatar* mAvatarPreview;
LLPreviewSculpted* mSculptedPreview;
S32 mLastMouseX;
S32 mLastMouseY;
LLRect mPreviewRect;
LLRectf mPreviewImageRect;
LLPointer<LLViewerTexture> mImagep ;
LLPointer<LLImageGL> mImagep ;
LLViewerObject* tmpvolume;
static S32 sUploadAmount;

View File

@@ -127,13 +127,9 @@ BOOL FloaterVoiceLicense::postBuild()
{
// start to observe it so we see navigate complete events
web_browser->addObserver( this );
std::string url = getString( "real_url" );
if(url.substr(0,4) == "http") {
gResponsePtr = LLIamHereVoice::build( this );
LLHTTPClient::get( url, gResponsePtr );
} else {
setSiteIsAlive(false);
}
gResponsePtr = LLIamHereVoice::build( this );
LLHTTPClient::get( getString( "real_url" ), gResponsePtr );
}
return TRUE;
@@ -149,7 +145,11 @@ void FloaterVoiceLicense::setSiteIsAlive( bool alive )
{
// navigate to the "real" page
std::string real_url = getString( "real_url" );
web_browser->navigateTo(real_url);
if (real_url.find("http://") == 0) {
web_browser->navigateTo(real_url);
} else {
web_browser->navigateToLocalPage("license",real_url);
}
}
}
else

View File

@@ -302,8 +302,6 @@ NVIDIA GeForce 6700 .*NVIDIA.*GeForce 67.* 2 1
NVIDIA GeForce 6800 .*NVIDIA.*GeForce 68.* 2 1
NVIDIA GeForce 7000M .*NVIDIA.*GeForce 7000M.* 0 1
NVIDIA GeForce 7100M .*NVIDIA.*GeForce 7100M.* 0 1
NVIDIA GeForce 7000 .*NVIDIA.*GeForce 70.* 0 1
NVIDIA GeForce 7100 .*NVIDIA.*GeForce 71.* 0 1
NVIDIA GeForce 7200 .*NVIDIA.*GeForce 72.* 1 1
NVIDIA GeForce 7300 .*NVIDIA.*GeForce 73.* 1 1
NVIDIA GeForce 7500 .*NVIDIA.*GeForce 75.* 1 1
@@ -391,39 +389,8 @@ NVIDIA MCP78 .*NVIDIA.*MCP78.* 1 1
NVIDIA Quadro2 .*Quadro2.* 0 1
NVIDIA Quadro4 .*Quadro4.* 0 1
NVIDIA Quadro DCC .*Quadro DCC.* 0 1
NVIDIA Quadro FX 1400 .*Quadro.*FX.*1400.* 1 1
NVIDIA Quadro FX 1500 .*Quadro.*FX.*1500.* 1 1
NVIDIA Quadro FX 1700 .*Quadro.*FX.*1700.* 2 1
NVIDIA Quadro FX 1800 .*Quadro.*FX.*1800.* 2 1
NVIDIA Quadro FX 3400 .*Quadro.*FX.*3400.* 1 1
NVIDIA Quadro FX 3450 .*Quadro.*FX.*3450.* 1 1
NVIDIA Quadro FX 3500 .*Quadro.*FX.*3500.* 1 1
NVIDIA Quadro FX 3700 .*Quadro.*FX.*3700.* 2 1
NVIDIA Quadro FX 3800 .*Quadro.*FX.*3800.* 2 1
NVIDIA Quadro FX 370 .*Quadro.*FX.*370.* 2 1
NVIDIA Quadro FX 380 .*Quadro.*FX.*380.* 2 1
NVIDIA Quadro FX 4000 .*Quadro.*FX.*4000.* 1 1
NVIDIA Quadro FX 4500 .*Quadro.*FX.*4500.* 1 1
NVIDIA Quadro FX 4600 .*Quadro.*FX.*4600.* 2 1
NVIDIA Quadro FX 4700 .*Quadro.*FX.*4700.* 2 1
NVIDIA Quadro FX 4800 .*Quadro.*FX.*4800.* 2 1
NVIDIA Quadro FX 470 .*Quadro.*FX.*470.* 2 1
NVIDIA Quadro FX 5500 .*Quadro.*FX.*5500.* 1 1
NVIDIA Quadro FX 5600 .*Quadro.*FX.*5600.* 2 1
NVIDIA Quadro FX 5700 .*Quadro.*FX.*5700.* 2 1
NVIDIA Quadro FX 5800 .*Quadro.*FX.*5800.* 2 1
NVIDIA Quadro FX 540 .*Quadro.*FX.*540.* 1 1
NVIDIA Quadro FX 550 .*Quadro.*FX.*550.* 1 1
NVIDIA Quadro FX 560 .*Quadro.*FX.*560.* 1 1
NVIDIA Quadro FX 570 .*Quadro.*FX.*570.* 2 1
NVIDIA Quadro FX 580 .*Quadro.*FX.*580.* 2 1
NVIDIA Quadro FX 4500 .*Quadro.*FX.*4500.* 3 1
NVIDIA Quadro FX .*Quadro FX.* 1 1
NVIDIA Quadro VX 200 .*Quadro VX.*200.* 2 1
NVIDIA Quadro 2000 .*Quadro.*2000.* 2 1
NVIDIA Quadro 4000 .*Quadro.*4000.* 2 1
NVIDIA Quadro 5000 .*Quadro.*5000.* 2 1
NVIDIA Quadro 6000 .*Quadro.*6000.* 2 1
NVIDIA Quadro 600 .*Quadro.*600.* 2 1
NVIDIA Quadro NVS .*Quadro NVS.* 0 1
NVIDIA RIVA TNT .*RIVA TNT.* 0 0
NVIDIA PCI .*NVIDIA.*/PCI/SSE2 0 0

View File

@@ -102,7 +102,7 @@ BOOL HGFloaterTextEditor::postBuild(void)
// static
void HGFloaterTextEditor::imageCallback(BOOL success,
LLViewerFetchedTexture *src_vi,
LLViewerImage *src_vi,
LLImageRaw* src,
LLImageRaw* aux_src,
S32 discard_level,
@@ -141,7 +141,7 @@ void HGFloaterTextEditor::imageCallback(BOOL success,
}
else
{
src_vi->setBoostLevel(LLViewerTexture::BOOST_UI);
src_vi->setBoostLevel(LLViewerImageBoostLevel::BOOST_UI);
}
}

View File

@@ -14,7 +14,7 @@
#include "llfloater.h"
#include "lltexteditor.h"
#include "llinventory.h"
#include "llviewertexture.h"
#include "llviewerimage.h"
class HGFloaterTextEditor
: public LLFloater
@@ -25,7 +25,7 @@ public:
BOOL postBuild(void);
void close(bool app_quitting);
static void imageCallback(BOOL success,
LLViewerFetchedTexture *src_vi,
LLViewerImage *src_vi,
LLImageRaw* src,
LLImageRaw* aux_src,
S32 discard_level,

View File

@@ -95,15 +95,6 @@ const std::string& HippoGridInfo::getGridName() const
return mGridName;
}
const std::string& HippoGridInfo::getGridOwner() const {
if(isSecondLife()) {
static const std::string ll = "Linden Lab";
return ll;
} else {
return this->getGridName();
}
}
const std::string& HippoGridInfo::getLoginUri() const
{
return mLoginUri;

View File

@@ -40,7 +40,6 @@ public:
bool isSecondLife() const;
const std::string& getGridNick() const;
const std::string& getGridName() const;
const std::string& getGridOwner() const;
const std::string& getLoginUri() const;
const std::string& getLoginPage() const;
const std::string& getHelperUri() const;

View File

@@ -44,7 +44,7 @@
#include "lltexteditor.h"
#include "llalertdialog.h"
#include "llerrorcontrol.h"
#include "llviewertexturelist.h"
#include "llviewerimagelist.h"
#include "llgroupmgr.h"
#include "llagent.h"
#include "llwindow.h"
@@ -450,6 +450,8 @@ static void settings_to_globals()
gShowObjectUpdates = gSavedSettings.getBOOL("ShowObjectUpdates");
LLWorldMapView::sMapScale = gSavedSettings.getF32("MapScale");
LLHoverView::sShowHoverTips = gSavedSettings.getBOOL("ShowHoverTips");
LLCubeMap::sUseCubeMaps = LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap");
}
static void settings_modify()
@@ -652,8 +654,7 @@ bool LLAppViewer::init()
&gColors,
LLUIImageList::getInstance(),
ui_audio_callback,
&LLUI::sGLScaleFactor
);
&LLUI::sGLScaleFactor);
LLWeb::initClass(); // do this after LLUI
LLTextEditor::setURLCallbacks(&LLWeb::loadURL,
@@ -737,9 +738,6 @@ bool LLAppViewer::init()
gGLActive = TRUE;
initWindow();
// initWindow also initializes the Feature List, so now we can initialize this global.
LLCubeMap::sUseCubeMaps = LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap");
// call all self-registered classes
LLInitClassList::instance().fireCallbacks();
@@ -1426,12 +1424,12 @@ bool LLAppViewer::cleanup()
sImageDecodeThread = NULL;
//Note:
//LLViewerMedia::cleanupClass() has to be put before gTextureList.shutdown()
//LLViewerMedia::cleanupClass() has to be put before gImageList.shutdown()
//because some new image might be generated during cleaning up media. --bao
LLViewerMediaFocus::cleanupClass();
LLViewerMedia::cleanupClass();
LLViewerParcelMedia::cleanupClass();
gTextureList.shutdown(); // shutdown again in case a callback added something
gImageList.shutdown(); // shutdown again in case a callback added something
LLUIImageList::getInstance()->cleanUp();
// This should eventually be done in LLAppViewer

View File

@@ -4,7 +4,7 @@
#include "llapr.h"
#include "llvfile.h"
#include "llassetconverter.h"
#include "llviewertexturelist.h"
#include "llviewerimagelist.h"
#include "llvorbisencode.h"
#include "llbvhloader.h"
// static
@@ -18,7 +18,7 @@ LLAssetType::EType LLAssetConverter::convert(std::string src_filename, std::stri
else if(exten == "bmp")
{
asset_type = LLAssetType::AT_TEXTURE;
if (!LLViewerTextureList::createUploadFile(src_filename,
if (!LLViewerImageList::createUploadFile(src_filename,
filename,
IMG_CODEC_BMP ))
{
@@ -28,7 +28,7 @@ LLAssetType::EType LLAssetConverter::convert(std::string src_filename, std::stri
else if( exten == "tga")
{
asset_type = LLAssetType::AT_TEXTURE;
if (!LLViewerTextureList::createUploadFile(src_filename,
if (!LLViewerImageList::createUploadFile(src_filename,
filename,
IMG_CODEC_TGA ))
{
@@ -38,7 +38,7 @@ LLAssetType::EType LLAssetConverter::convert(std::string src_filename, std::stri
else if( exten == "jpg" || exten == "jpeg")
{
asset_type = LLAssetType::AT_TEXTURE;
if (!LLViewerTextureList::createUploadFile(src_filename,
if (!LLViewerImageList::createUploadFile(src_filename,
filename,
IMG_CODEC_JPEG ))
{
@@ -48,7 +48,7 @@ LLAssetType::EType LLAssetConverter::convert(std::string src_filename, std::stri
else if( exten == "png")
{
asset_type = LLAssetType::AT_TEXTURE;
if (!LLViewerTextureList::createUploadFile(src_filename,
if (!LLViewerImageList::createUploadFile(src_filename,
filename,
IMG_CODEC_PNG ))
{

View File

@@ -48,7 +48,7 @@
#include "lltextbox.h"
#include "llfloatercolorpicker.h"
#include "llviewborder.h"
#include "llviewertexturelist.h"
#include "llviewerimagelist.h"
#include "llfocusmgr.h"
static LLRegisterWidget<LLColorSwatchCtrl> r("color_swatch");
@@ -236,7 +236,7 @@ void LLColorSwatchCtrl::draw()
{
if (!mFallbackImageName.empty())
{
LLPointer<LLViewerFetchedTexture> fallback_image = LLViewerTextureManager::getFetchedTextureFromFile(mFallbackImageName);
LLPointer<LLViewerImage> fallback_image = gImageList.getImageFromFile(mFallbackImageName);
if( fallback_image->getComponents() == 4 )
{
gl_rect_2d_checkerboard( interior );

View File

@@ -36,7 +36,7 @@
#include "lluictrl.h"
#include "v4color.h"
#include "llfloater.h"
#include "llviewertexture.h"
#include "llviewerimage.h"
//
// Classes
@@ -44,6 +44,7 @@
class LLColor4;
class LLTextBox;
class LLFloaterColorPicker;
class LLViewerImage;
class LLColorSwatchCtrl
: public LLUICtrl

View File

@@ -43,7 +43,8 @@
#include "llagent.h"
#include "llcompass.h"
#include "llviewertexturelist.h"
#include "llviewerimage.h"
#include "llviewerimagelist.h"
#include "llviewercontrol.h"
#include "llviewercamera.h"
@@ -75,12 +76,12 @@ LLCompass::LLCompass( const std::string& name, const LLRect& rect)
void LLCompass::setTexture(LLUUID image_id)
{
mTexture = LLViewerTextureManager::getFetchedTexture(image_id, FALSE, LLViewerTexture::BOOST_UI);
mTexture = gImageList.getImage(image_id, FALSE, TRUE);
}
void LLCompass::setBkgndTexture(LLUUID image_id)
{
mBkgndTexture = LLViewerTextureManager::getFetchedTexture(image_id, FALSE, LLViewerTexture::BOOST_UI);
mBkgndTexture = gImageList.getImage(image_id, FALSE, TRUE);
}
//
@@ -106,5 +107,5 @@ LLHorizontalCompass::LLHorizontalCompass( const std::string& name, const LLRect&
void LLHorizontalCompass::setTexture( const LLUUID& image_id )
{
mTexture = LLViewerTextureManager::getFetchedTexture(image_id, FALSE, LLViewerTexture::BOOST_UI);
mTexture = gImageList.getImage(image_id, FALSE, TRUE);
}

View File

@@ -35,7 +35,7 @@
#include "llmath.h"
#include "llview.h"
#include "llviewertexture.h"
#include "llviewerimage.h"
#ifndef LL_V4COLOR_H
#include "v4color.h"
#endif
@@ -43,8 +43,8 @@
class LLCompass : public LLView
{
protected:
LLPointer<LLViewerTexture> mTexture;
LLPointer<LLViewerTexture> mBkgndTexture;
LLPointer<LLViewerImage> mTexture;
LLPointer<LLViewerImage> mBkgndTexture;
public:
LLCompass( const std::string& name, const LLRect& rect);
@@ -77,7 +77,7 @@ class LLHorizontalCompass : public LLView
{
protected:
LLColor4 mFocusColor;
LLPointer<LLViewerTexture> mTexture;
LLPointer<LLViewerImage> mTexture;
public:
LLHorizontalCompass( const std::string& name, const LLRect& rect,

View File

@@ -41,7 +41,8 @@
#include "llfontgl.h"
#include "llgl.h"
#include "llui.h"
#include "llviewertexturelist.h"
#include "llviewerimage.h"
#include "llviewerimagelist.h"
#include "llviewerwindow.h"
#include "lltextparser.h"
#include "llsd.h"

View File

@@ -90,7 +90,7 @@ LLDebugView::LLDebugView(const std::string& name, const LLRect &rect)
mMemoryView->setVisible(FALSE); // start invisible
addChild(mMemoryView);
r.set(150, rect.getHeight() - 50, 870, 100);
r.set(150, rect.getHeight() - 50, 820, 100);
gTextureView = new LLTextureView("gTextureView", r);
gTextureView->setRect(r);
gTextureView->setFollowsBottom();

View File

@@ -229,7 +229,7 @@ S32 LLDrawable::findReferences(LLDrawable *drawablep)
return count;
}
LLFace* LLDrawable::addFace(LLFacePool *poolp, LLViewerTexture *texturep)
LLFace* LLDrawable::addFace(LLFacePool *poolp, LLViewerImage *texturep)
{
LLMemType mt(LLMemType::MTYPE_DRAWABLE);
@@ -253,7 +253,7 @@ LLFace* LLDrawable::addFace(LLFacePool *poolp, LLViewerTexture *texturep)
return face;
}
LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep)
LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerImage *texturep)
{
LLMemType mt(LLMemType::MTYPE_DRAWABLE);
@@ -275,7 +275,7 @@ LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep)
}
void LLDrawable::setNumFaces(const S32 newFaces, LLFacePool *poolp, LLViewerTexture *texturep)
void LLDrawable::setNumFaces(const S32 newFaces, LLFacePool *poolp, LLViewerImage *texturep)
{
if (newFaces == (S32)mFaces.size())
{
@@ -298,7 +298,7 @@ void LLDrawable::setNumFaces(const S32 newFaces, LLFacePool *poolp, LLViewerText
llassert_always(mFaces.size() == newFaces);
}
void LLDrawable::setNumFacesFast(const S32 newFaces, LLFacePool *poolp, LLViewerTexture *texturep)
void LLDrawable::setNumFacesFast(const S32 newFaces, LLFacePool *poolp, LLViewerImage *texturep)
{
if (newFaces <= (S32)mFaces.size() && newFaces >= (S32)mFaces.size()/2)
{

View File

@@ -59,7 +59,7 @@ class LLSpatialGroup;
class LLSpatialBridge;
class LLSpatialPartition;
class LLVOVolume;
class LLViewerTexture;
class LLViewerImage;
// Can have multiple silhouettes for each object
const U32 SILHOUETTE_HIGHLIGHT = 0;
@@ -127,11 +127,11 @@ public:
inline S32 getNumFaces() const;
//void removeFace(const S32 i); // SJB: Avoid using this, it's slow
LLFace* addFace(LLFacePool *poolp, LLViewerTexture *texturep);
LLFace* addFace(const LLTextureEntry *te, LLViewerTexture *texturep);
LLFace* addFace(LLFacePool *poolp, LLViewerImage *texturep);
LLFace* addFace(const LLTextureEntry *te, LLViewerImage *texturep);
void deleteFaces(S32 offset, S32 count);
void setNumFaces(const S32 numFaces, LLFacePool *poolp, LLViewerTexture *texturep);
void setNumFacesFast(const S32 numFaces, LLFacePool *poolp, LLViewerTexture *texturep);
void setNumFaces(const S32 numFaces, LLFacePool *poolp, LLViewerImage *texturep);
void setNumFacesFast(const S32 numFaces, LLFacePool *poolp, LLViewerImage *texturep);
void mergeFaces(LLDrawable* src);
void init();

View File

@@ -60,7 +60,7 @@ S32 LLDrawPool::sNumDrawPools = 0;
//=============================
// Draw Pool Implementation
//=============================
LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerTexture *tex0)
LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerImage *tex0)
{
LLDrawPool *poolp = NULL;
switch (type)
@@ -130,7 +130,7 @@ LLDrawPool::~LLDrawPool()
}
LLViewerTexture *LLDrawPool::getDebugTexture()
LLViewerImage *LLDrawPool::getDebugTexture()
{
return NULL;
}
@@ -245,7 +245,7 @@ void LLFacePool::destroy()
}
}
void LLFacePool::dirtyTextures(const std::set<LLViewerFetchedTexture*>& textures)
void LLFacePool::dirtyTextures(const std::set<LLViewerImage*>& textures)
{
}
@@ -297,7 +297,7 @@ void LLFacePool::drawLoop()
}
void LLFacePool::renderFaceSelected(LLFace *facep,
LLViewerTexture *image,
LLImageGL *image,
const LLColor4 &color,
const S32 index_offset, const S32 index_count)
{
@@ -331,7 +331,7 @@ void LLFacePool::resetDrawOrders()
mDrawFace.resize(0);
}
LLViewerTexture *LLFacePool::getTexture()
LLViewerImage *LLFacePool::getTexture()
{
return NULL;
}

View File

@@ -39,8 +39,8 @@
#include "llvertexbuffer.h"
class LLFace;
class LLViewerTexture;
class LLViewerFetchedTexture;
class LLImageGL;
class LLViewerImage;
class LLSpatialGroup;
class LLDrawInfo;
@@ -78,7 +78,7 @@ public:
S32 getId() const { return mId; }
U32 getType() const { return mType; }
virtual LLViewerTexture *getDebugTexture();
virtual LLViewerImage *getDebugTexture();
virtual void beginRenderPass( S32 pass );
virtual void endRenderPass( S32 pass );
virtual S32 getNumPasses();
@@ -104,9 +104,9 @@ public:
virtual BOOL verify() const { return TRUE; } // Verify that all data in the draw pool is correct!
virtual S32 getVertexShaderLevel() const { return mVertexShaderLevel; }
static LLDrawPool* createPool(const U32 type, LLViewerTexture *tex0 = NULL);
static LLDrawPool* createPool(const U32 type, LLViewerImage *tex0 = NULL);
virtual LLDrawPool *instancePool() = 0; // Create an empty new instance of the pool.
virtual LLViewerTexture* getTexture() = 0;
virtual LLViewerImage* getTexture() = 0;
virtual BOOL isFacePool() { return FALSE; }
virtual void resetDrawOrders() = 0;
@@ -129,7 +129,6 @@ public:
PASS_FULLBRIGHT_SHINY,
PASS_SHINY,
PASS_BUMP,
PASS_POST_BUMP,
PASS_GLOW,
PASS_ALPHA,
PASS_ALPHA_MASK,
@@ -141,8 +140,8 @@ public:
LLRenderPass(const U32 type);
virtual ~LLRenderPass();
/*virtual*/ LLDrawPool* instancePool();
/*virtual*/ LLViewerTexture* getDebugTexture() { return NULL; }
LLViewerTexture* getTexture() { return NULL; }
/*virtual*/ LLViewerImage* getDebugTexture() { return NULL; }
LLViewerImage* getTexture() { return NULL; }
BOOL isDead() { return FALSE; }
void resetDrawOrders() { }
@@ -171,11 +170,11 @@ public:
virtual void renderForSelect() = 0;
BOOL isDead() { return mReferences.empty(); }
virtual void renderFaceSelected(LLFace *facep, LLViewerTexture *image, const LLColor4 &color,
virtual void renderFaceSelected(LLFace *facep, LLImageGL *image, const LLColor4 &color,
const S32 index_offset = 0, const S32 index_count = 0);
virtual LLViewerTexture *getTexture();
virtual void dirtyTextures(const std::set<LLViewerFetchedTexture*>& textures);
virtual LLViewerImage *getTexture();
virtual void dirtyTextures(const std::set<LLViewerImage*>& textures);
virtual void enqueue(LLFace *face);
virtual BOOL addFace(LLFace *face);

View File

@@ -46,7 +46,7 @@
#include "lldrawable.h"
#include "llface.h"
#include "llviewercamera.h"
#include "llviewertexturelist.h" // For debugging
#include "llviewerimagelist.h" // For debugging
#include "llviewerobjectlist.h" // For debugging
#include "llviewerwindow.h"
#include "pipeline.h"
@@ -237,8 +237,8 @@ void LLDrawPoolAlpha::render(S32 pass)
}
gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
glColor4f(1,0,0,1);
LLViewerFetchedTexture::sSmokeImagep->addTextureStats(1024.f*1024.f);
gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sSmokeImagep.get(), TRUE);
LLViewerImage::sSmokeImagep->addTextureStats(1024.f*1024.f);
gGL.getTexUnit(0)->bind(LLViewerImage::sSmokeImagep.get(), TRUE);
renderAlphaHighlight(LLVertexBuffer::MAP_VERTEX |
LLVertexBuffer::MAP_TEXCOORD0);
}

View File

@@ -650,7 +650,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
if (pass==1 && (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES) || LLViewerPartSim::getMaxPartCount() <= 0))
{
// debug code to draw a sphere in place of avatar
gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep.get());
gGL.getTexUnit(0)->bind(LLViewerImage::sWhiteImagep.get());
gGL.setColorMask(true, true);
LLVector3 pos = avatarp->getPositionAgent();
gGL.color4f(1.0f, 1.0f, 1.0f, 0.7f);
@@ -839,7 +839,7 @@ void LLDrawPoolAvatar::renderForSelect()
//-----------------------------------------------------------------------------
// getDebugTexture()
//-----------------------------------------------------------------------------
LLViewerTexture *LLDrawPoolAvatar::getDebugTexture()
LLViewerImage *LLDrawPoolAvatar::getDebugTexture()
{
if (mReferences.empty())
{

View File

@@ -105,7 +105,7 @@ public:
void endDeferredRigid();
void endDeferredSkinned();
/*virtual*/ LLViewerTexture *getDebugTexture();
/*virtual*/ LLViewerImage *getDebugTexture();
/*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display
void renderAvatars(LLVOAvatar *single_avatar, S32 pass = -1); // renders only one avatar if single_avatar is not null.

View File

@@ -37,6 +37,7 @@
#include "llstl.h"
#include "llviewercontrol.h"
#include "lldir.h"
#include "llimagegl.h"
#include "m3math.h"
#include "m4math.h"
#include "v4math.h"
@@ -50,7 +51,7 @@
#include "llsky.h"
#include "lltextureentry.h"
#include "llviewercamera.h"
#include "llviewertexturelist.h"
#include "llviewerimagelist.h"
#include "pipeline.h"
#include "llspatialpartition.h"
#include "llviewershadermgr.h"
@@ -94,16 +95,7 @@ void LLStandardBumpmap::shutdown()
// static
void LLStandardBumpmap::restoreGL()
{
addstandard();
}
// static
void LLStandardBumpmap::addstandard()
{
// can't assert; we destroyGL and restoreGL a lot during *first* startup, which populates this list already, THEN we explicitly init the list as part of *normal* startup. Sigh. So clear the list every time before we (re-)add the standard bumpmaps.
//llassert( LLStandardBumpmap::sStandardBumpmapCount == 0 );
clear();
llinfos << "Adding standard bumpmaps." << llendl;
llassert( LLStandardBumpmap::sStandardBumpmapCount == 0 );
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount++] = LLStandardBumpmap("None"); // BE_NO_BUMP
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount++] = LLStandardBumpmap("Brightness"); // BE_BRIGHTNESS
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount++] = LLStandardBumpmap("Darkness"); // BE_DARKNESS
@@ -135,9 +127,9 @@ void LLStandardBumpmap::addstandard()
{
// *NOTE: This buffer size is hard coded into scanf() below.
char label[2048] = ""; /* Flawfinder: ignore */
char bump_image_id[2048] = ""; /* Flawfinder: ignore */
char bump_file[2048] = ""; /* Flawfinder: ignore */
fields_read = fscanf( /* Flawfinder: ignore */
file, "\n%2047s %2047s", label, bump_image_id);
file, "\n%2047s %2047s", label, bump_file);
if( EOF == fields_read )
{
break;
@@ -147,19 +139,16 @@ void LLStandardBumpmap::addstandard()
llwarns << "Bad LLStandardBumpmap entry" << llendl;
return;
}
if(strlen(bump_image_id) == (UUID_STR_LENGTH - 1) + 4 && !stricmp(&(bump_image_id[UUID_STR_LENGTH-1]),".j2c"))
bump_image_id[UUID_STR_LENGTH-1] = 0; // truncate to a valid uuid (hopefully)
// llinfos << "Loading bumpmap: " << bump_file << " from viewerart" << llendl;
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mLabel = label;
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage =
LLViewerTextureManager::getFetchedTexture(LLUUID(bump_image_id),
gImageList.getImageFromFile(bump_file,
TRUE,
LLViewerTexture::BOOST_NONE,
LLViewerTexture::LOD_TEXTURE,
FALSE,
0,
0);
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage->setBoostLevel(LLViewerTexture::BOOST_BUMP) ;
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage->setLoadedCallback(LLBumpImageList::onSourceStandardLoaded, 0, TRUE, FALSE, NULL, NULL );
0);
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage->setLoadedCallback(LLBumpImageList::onSourceStandardLoaded, 0, TRUE, FALSE, NULL );
LLStandardBumpmap::sStandardBumpmapCount++;
}
@@ -167,9 +156,8 @@ void LLStandardBumpmap::addstandard()
}
// static
void LLStandardBumpmap::clear()
void LLStandardBumpmap::destroyGL()
{
llinfos << "Clearing standard bumpmaps." << llendl;
for( U32 i = 0; i < LLStandardBumpmap::sStandardBumpmapCount; i++ )
{
gStandardBumpmapList[i].mLabel.assign("");
@@ -178,12 +166,6 @@ void LLStandardBumpmap::clear()
sStandardBumpmapCount = 0;
}
// static
void LLStandardBumpmap::destroyGL()
{
clear();
}
////////////////////////////////////////////////////////////////
@@ -588,25 +570,27 @@ void LLDrawPoolBump::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL
// static
BOOL LLDrawPoolBump::bindBumpMap(LLDrawInfo& params, S32 channel)
{
LLViewerTexture* bump = NULL;
LLImageGL* bump = NULL;
U8 bump_code = params.mBump;
//Note: texture atlas does not support bump texture now.
LLViewerFetchedTexture* tex = LLViewerTextureManager::staticCastToFetchedTexture(params.mTexture) ;
if(!tex)
{
//if the texture is not a fetched texture
return FALSE;
}
LLViewerImage* tex = params.mTexture;
switch( bump_code )
{
case BE_NO_BUMP:
case BE_NO_BUMP:
bump = NULL;
break;
case BE_BRIGHTNESS:
case BE_DARKNESS:
bump = gBumpImageList.getBrightnessDarknessImage( tex, bump_code );
if( tex )
{
if(tex->getID()== IMG_DEFAULT)
{
return TRUE;
}
bump = gBumpImageList.getBrightnessDarknessImage( tex, bump_code );
}
break;
default:
@@ -637,9 +621,9 @@ BOOL LLDrawPoolBump::bindBumpMap(LLDrawInfo& params, S32 channel)
}
//static
void LLDrawPoolBump::beginBump(U32 pass)
void LLDrawPoolBump::beginBump()
{
if (!gPipeline.hasRenderBatches(pass))
if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_BUMP))
{
return;
}
@@ -682,9 +666,9 @@ void LLDrawPoolBump::beginBump(U32 pass)
}
//static
void LLDrawPoolBump::renderBump(U32 pass)
void LLDrawPoolBump::renderBump()
{
if (!gPipeline.hasRenderBatches(pass))
if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_BUMP))
{
return;
}
@@ -697,13 +681,13 @@ void LLDrawPoolBump::renderBump(U32 pass)
/// Get rid of z-fighting with non-bump pass.
LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(-1.0f, -1.0f);
renderBump(pass, sVertexMask);
renderBump(LLRenderPass::PASS_BUMP, sVertexMask);
}
//static
void LLDrawPoolBump::endBump(U32 pass)
void LLDrawPoolBump::endBump()
{
if (!gPipeline.hasRenderBatches(pass))
if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_BUMP))
{
return;
}
@@ -720,12 +704,6 @@ void LLDrawPoolBump::endBump(U32 pass)
gGL.setSceneBlendType(LLRender::BT_ALPHA);
}
S32 LLDrawPoolBump::getNumDeferredPasses()
{
static const LLCachedControl<bool> render_object_bump("RenderObjectBump",false);
return render_object_bump ? 1 : 0;
}
void LLDrawPoolBump::beginDeferredPass(S32 pass)
{
if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_BUMP))
@@ -780,41 +758,17 @@ void LLDrawPoolBump::renderDeferred(S32 pass)
void LLDrawPoolBump::beginPostDeferredPass(S32 pass)
{
switch (pass)
{
case 0:
beginFullbrightShiny();
break;
case 1:
beginBump(LLRenderPass::PASS_POST_BUMP);
break;
}
beginFullbrightShiny();
}
void LLDrawPoolBump::endPostDeferredPass(S32 pass)
{
switch (pass)
{
case 0:
endFullbrightShiny();
break;
case 1:
endBump(LLRenderPass::PASS_POST_BUMP);
break;
}
endFullbrightShiny();
}
void LLDrawPoolBump::renderPostDeferred(S32 pass)
{
switch (pass)
{
case 0:
renderFullbrightShiny();
break;
case 1:
renderBump(LLRenderPass::PASS_POST_BUMP);
break;
}
renderFullbrightShiny();
}
////////////////////////////////////////////////////////////////
@@ -831,32 +785,24 @@ void LLBumpImageList::init()
LLStandardBumpmap::init();
}
void LLBumpImageList::clear()
{
llinfos << "Clearing dynamic bumpmaps." << llendl;
// these will be re-populated on-demand
mBrightnessEntries.clear();
mDarknessEntries.clear();
LLStandardBumpmap::clear();
}
void LLBumpImageList::shutdown()
{
clear();
mBrightnessEntries.clear();
mDarknessEntries.clear();
LLStandardBumpmap::shutdown();
}
void LLBumpImageList::destroyGL()
{
clear();
mBrightnessEntries.clear();
mDarknessEntries.clear();
LLStandardBumpmap::destroyGL();
}
void LLBumpImageList::restoreGL()
{
LLStandardBumpmap::restoreGL();
// Images will be recreated as they are needed.
LLStandardBumpmap::restoreGL();
}
@@ -872,9 +818,9 @@ LLBumpImageList::~LLBumpImageList()
void LLBumpImageList::addTextureStats(U8 bump, const LLUUID& base_image_id, F32 virtual_size)
{
bump &= TEM_BUMP_MASK;
LLViewerFetchedTexture* bump_image = gStandardBumpmapList[bump].mImage;
LLViewerImage* bump_image = gStandardBumpmapList[bump].mImage;
if( bump_image )
{
{
bump_image->addTextureStats(virtual_size);
}
}
@@ -886,11 +832,11 @@ void LLBumpImageList::updateImages()
for (bump_image_map_t::iterator iter = mBrightnessEntries.begin(); iter != mBrightnessEntries.end(); )
{
bump_image_map_t::iterator curiter = iter++;
LLViewerTexture* image = curiter->second;
LLImageGL* image = curiter->second;
if( image )
{
BOOL destroy = TRUE;
if( image->hasGLTexture())
if( image->getHasGLTexture())
{
if( image->getBoundRecently() )
{
@@ -913,11 +859,11 @@ void LLBumpImageList::updateImages()
for (bump_image_map_t::iterator iter = mDarknessEntries.begin(); iter != mDarknessEntries.end(); )
{
bump_image_map_t::iterator curiter = iter++;
LLViewerTexture* image = curiter->second;
LLImageGL* image = curiter->second;
if( image )
{
BOOL destroy = TRUE;
if( image->hasGLTexture())
if( image->getHasGLTexture())
{
if( image->getBoundRecently() )
{
@@ -941,16 +887,16 @@ void LLBumpImageList::updateImages()
// Note: the caller SHOULD NOT keep the pointer that this function returns. It may be updated as more data arrives.
LLViewerTexture* LLBumpImageList::getBrightnessDarknessImage(LLViewerFetchedTexture* src_image, U8 bump_code )
LLImageGL* LLBumpImageList::getBrightnessDarknessImage(LLViewerImage* src_image, U8 bump_code )
{
llassert( (bump_code == BE_BRIGHTNESS) || (bump_code == BE_DARKNESS) );
LLViewerTexture* bump = NULL;
LLImageGL* bump = NULL;
const F32 BRIGHTNESS_DARKNESS_PIXEL_AREA_THRESHOLD = 1000;
if( src_image->getMaxVirtualSize() > BRIGHTNESS_DARKNESS_PIXEL_AREA_THRESHOLD )
if( src_image->mMaxVirtualSize > BRIGHTNESS_DARKNESS_PIXEL_AREA_THRESHOLD )
{
bump_image_map_t* entries_list = NULL;
void (*callback_func)( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata ) = NULL;
void (*callback_func)( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata ) = NULL;
switch( bump_code )
{
@@ -977,12 +923,17 @@ LLViewerTexture* LLBumpImageList::getBrightnessDarknessImage(LLViewerFetchedText
LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,1);
raw->clear(0x77, 0x77, 0x77, 0xFF);
(*entries_list)[src_image->getID()] = LLViewerTextureManager::getLocalTexture( raw.get(), TRUE);
(*entries_list)[src_image->getID()]->setExplicitFormat(GL_ALPHA8, GL_ALPHA);
//------------------------------
bump = new LLImageGL( raw, TRUE);
//immediately assign bump to a global smart pointer in case some local smart pointer
//accidently releases it.
(*entries_list)[src_image->getID()] = bump;
//------------------------------
bump->setExplicitFormat(GL_ALPHA8, GL_ALPHA);
// Note: this may create an LLImageGL immediately
src_image->setBoostLevel(LLViewerTexture::BOOST_BUMP) ;
src_image->setLoadedCallback( callback_func, 0, TRUE, FALSE, new LLUUID(src_image->getID()), NULL );
src_image->setLoadedCallback( callback_func, 0, TRUE, FALSE, new LLUUID(src_image->getID()) );
bump = (*entries_list)[src_image->getID()]; // In case callback was called immediately and replaced the image
// bump_total++;
@@ -995,7 +946,7 @@ LLViewerTexture* LLBumpImageList::getBrightnessDarknessImage(LLViewerFetchedText
// static
void LLBumpImageList::onSourceBrightnessLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata )
void LLBumpImageList::onSourceBrightnessLoaded( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata )
{
LLUUID* source_asset_id = (LLUUID*)userdata;
LLBumpImageList::onSourceLoaded( success, src_vi, src, *source_asset_id, BE_BRIGHTNESS );
@@ -1006,7 +957,7 @@ void LLBumpImageList::onSourceBrightnessLoaded( BOOL success, LLViewerFetchedTex
}
// static
void LLBumpImageList::onSourceDarknessLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata )
void LLBumpImageList::onSourceDarknessLoaded( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata )
{
LLUUID* source_asset_id = (LLUUID*)userdata;
LLBumpImageList::onSourceLoaded( success, src_vi, src, *source_asset_id, BE_DARKNESS );
@@ -1016,14 +967,14 @@ void LLBumpImageList::onSourceDarknessLoaded( BOOL success, LLViewerFetchedTextu
}
}
void LLBumpImageList::onSourceStandardLoaded( BOOL success, LLViewerFetchedTexture* src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
void LLBumpImageList::onSourceStandardLoaded( BOOL success, LLViewerImage* src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
{
if (success && LLPipeline::sRenderDeferred)
{
LLPointer<LLImageRaw> nrm_image = new LLImageRaw(src->getWidth(), src->getHeight(), 4);
generateNormalMapFromAlpha(src, nrm_image);
src_vi->setExplicitFormat(GL_RGBA, GL_RGBA);
src_vi->createGLTexture(src_vi->getDiscardLevel(), nrm_image);
src_vi->createGLTexture(0, nrm_image);
}
}
@@ -1063,8 +1014,8 @@ void LLBumpImageList::generateNormalMapFromAlpha(LLImageRaw* src, LLImageRaw* nr
LLVector3 right = LLVector3(norm_scale, 0, (F32) src_data[(j*resX+rX)*src_cmp+src_cmp-1]-cH);
LLVector3 left = LLVector3(-norm_scale, 0, (F32) src_data[(j*resX+lX)*src_cmp+src_cmp-1]-cH);
LLVector3 up = LLVector3(0, -norm_scale, (F32) src_data[(lY*resX+i)*src_cmp+src_cmp-1]-cH);
LLVector3 down = LLVector3(0, norm_scale, (F32) src_data[(rY*resX+i)*src_cmp+src_cmp-1]-cH);
LLVector3 up = LLVector3(0, -norm_scale, (F32) src_data[(rY*resX+i)*src_cmp+src_cmp-1]-cH);
LLVector3 down = LLVector3(0, norm_scale, (F32) src_data[(lY*resX+i)*src_cmp+src_cmp-1]-cH);
LLVector3 norm = right%down + down%left + left%up + up%right;
@@ -1083,7 +1034,7 @@ void LLBumpImageList::generateNormalMapFromAlpha(LLImageRaw* src, LLImageRaw* nr
}
// static
void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLImageRaw* src, LLUUID& source_asset_id, EBumpEffect bump_code )
void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLUUID& source_asset_id, EBumpEffect bump_code )
{
if( success )
{
@@ -1200,9 +1151,9 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
}
//---------------------------------------------------
// immediately assign bump to a global smart pointer in case some local smart pointer
// accidentally releases it.
LLPointer<LLViewerTexture> bump = LLViewerTextureManager::getLocalTexture( TRUE );
//immediately assign bump to a global smart pointer in case some local smart pointer
//accidently releases it.
LLPointer<LLImageGL> bump = new LLImageGL( TRUE);
if (!LLPipeline::sRenderDeferred)
{
@@ -1211,8 +1162,8 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
}
else
{
LLPointer<LLImageRaw> nrm_image = new LLImageRaw(dst_image->getWidth(), dst_image->getHeight(), 4);
generateNormalMapFromAlpha(dst_image, nrm_image);
LLPointer<LLImageRaw> nrm_image = new LLImageRaw(src->getWidth(), src->getHeight(), 4);
generateNormalMapFromAlpha(src, nrm_image);
bump->setExplicitFormat(GL_RGBA, GL_RGBA);
bump->createGLTexture(0, nrm_image);
}
@@ -1275,8 +1226,8 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture)
{
if (params.mTexture.notNull())
{
gGL.getTexUnit(diffuse_channel)->bind(params.mTexture) ;
params.mTexture->addTextureStats(params.mVSize);
gGL.getTexUnit(diffuse_channel)->bind(params.mTexture.get());
//params.mTexture->addTextureStats(params.mVSize);
}
else
{

View File

@@ -41,7 +41,6 @@
class LLImageRaw;
class LLSpatialGroup;
class LLDrawInfo;
class LLViewerFetchedTexture;
class LLDrawPoolBump : public LLRenderPass
{
@@ -75,16 +74,16 @@ public:
void renderFullbrightShiny();
void endFullbrightShiny();
void beginBump(U32 pass = LLRenderPass::PASS_BUMP);
void renderBump(U32 pass = LLRenderPass::PASS_BUMP);
void endBump(U32 pass = LLRenderPass::PASS_BUMP);
void beginBump();
void renderBump();
void endBump();
virtual S32 getNumDeferredPasses();
virtual S32 getNumDeferredPasses() { return 1; }
/*virtual*/ void beginDeferredPass(S32 pass);
/*virtual*/ void endDeferredPass(S32 pass);
/*virtual*/ void renderDeferred(S32 pass);
virtual S32 getNumPostDeferredPasses() { return 2; }
virtual S32 getNumPostDeferredPasses() { return 1; }
/*virtual*/ void beginPostDeferredPass(S32 pass);
/*virtual*/ void endPostDeferredPass(S32 pass);
/*virtual*/ void renderPostDeferred(S32 pass);
@@ -111,12 +110,10 @@ public:
LLStandardBumpmap( const std::string& label ) : mLabel(label) {}
std::string mLabel;
LLPointer<LLViewerFetchedTexture> mImage;
LLPointer<LLViewerImage> mImage;
static U32 sStandardBumpmapCount; // Number of valid values in gStandardBumpmapList[]
static void clear();
static void addstandard();
static void init();
static void shutdown();
static void restoreGL();
@@ -138,26 +135,26 @@ public:
void init();
void shutdown();
void clear();
void destroyGL();
void restoreGL();
void updateImages();
LLViewerTexture* getBrightnessDarknessImage(LLViewerFetchedTexture* src_image, U8 bump_code);
LLImageGL* getBrightnessDarknessImage(LLViewerImage* src_image, U8 bump_code);
// LLImageGL* getTestImage();
void addTextureStats(U8 bump, const LLUUID& base_image_id, F32 virtual_size);
static void onSourceBrightnessLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata );
static void onSourceDarknessLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata );
static void onSourceStandardLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata );
static void onSourceBrightnessLoaded( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata );
static void onSourceDarknessLoaded( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata );
static void onSourceStandardLoaded( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata );
static void generateNormalMapFromAlpha(LLImageRaw* src, LLImageRaw* nrm_image);
private:
static void onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLImageRaw* src, LLUUID& source_asset_id, EBumpEffect bump );
static void onSourceLoaded( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLUUID& source_asset_id, EBumpEffect bump );
private:
typedef std::map<LLUUID, LLPointer<LLViewerTexture> > bump_image_map_t;
typedef std::map<LLUUID, LLPointer<LLImageGL> > bump_image_map_t;
bump_image_map_t mBrightnessEntries;
bump_image_map_t mDarknessEntries;
};

View File

@@ -41,7 +41,7 @@
#include "llface.h"
#include "llsky.h"
#include "llviewercamera.h"
#include "llviewertexturelist.h"
#include "llviewerimagelist.h"
#include "llviewerregion.h"
#include "llviewerwindow.h"
#include "llvosky.h"

View File

@@ -49,7 +49,7 @@
#include "llviewerparceloverlay.h"
#include "llvosurfacepatch.h"
#include "llviewercamera.h"
#include "llviewertexturelist.h" // To get alpha gradients
#include "llviewerimagelist.h" // To get alpha gradients
#include "llworld.h"
#include "pipeline.h"
#include "llviewershadermgr.h"
@@ -62,32 +62,28 @@ S32 LLDrawPoolTerrain::sDetailMode = 1;
F32 LLDrawPoolTerrain::sDetailScale = DETAIL_SCALE;
static LLGLSLShader* sShader = NULL;
LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) :
LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerImage *texturep) :
LLFacePool(POOL_TERRAIN),
mTexturep(texturep)
{
// Hack!
sDetailScale = 1.f/gSavedSettings.getF32("RenderTerrainScale");
sDetailMode = gSavedSettings.getS32("RenderTerrainDetail");
mAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient.tga",
TRUE, LLViewerTexture::BOOST_UI,
LLViewerTexture::FETCHED_TEXTURE,
GL_ALPHA8, GL_ALPHA,
mAlphaRampImagep = gImageList.getImageFromFile("alpha_gradient.tga",
TRUE, TRUE, GL_ALPHA8, GL_ALPHA,
LLUUID("e97cf410-8e61-7005-ec06-629eba4cd1fb"));
//gGL.getTexUnit(0)->bind(mAlphaRampImagep.get());
mAlphaRampImagep->setAddressMode(LLTexUnit::TAM_CLAMP);
m2DAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient_2d.j2c",
TRUE, LLViewerTexture::BOOST_UI,
LLViewerTexture::FETCHED_TEXTURE,
GL_ALPHA8, GL_ALPHA,
m2DAlphaRampImagep = gImageList.getImageFromFile("alpha_gradient_2d.j2c",
TRUE, TRUE, GL_ALPHA8, GL_ALPHA,
LLUUID("38b86f85-2575-52a9-a531-23108d8da837"));
//gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get());
m2DAlphaRampImagep->setAddressMode(LLTexUnit::TAM_CLAMP);
mTexturep->setBoostLevel(LLViewerTexture::BOOST_TERRAIN);
mTexturep->setBoostLevel(LLViewerImageBoostLevel::BOOST_TERRAIN);
//gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
}
@@ -174,7 +170,7 @@ void LLDrawPoolTerrain::render(S32 pass)
LLVLComposition *compp = regionp->getComposition();
for (S32 i = 0; i < 4; i++)
{
compp->mDetailTextures[i]->setBoostLevel(LLViewerTexture::BOOST_TERRAIN);
compp->mDetailTextures[i]->setBoostLevel(LLViewerImageBoostLevel::BOOST_TERRAIN);
compp->mDetailTextures[i]->addTextureStats(1024.f*1024.f); // assume large pixel area
}
@@ -294,10 +290,10 @@ void LLDrawPoolTerrain::renderFullShader()
// Hack! Get the region that this draw pool is rendering from!
LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion();
LLVLComposition *compp = regionp->getComposition();
LLViewerTexture *detail_texture0p = compp->mDetailTextures[0];
LLViewerTexture *detail_texture1p = compp->mDetailTextures[1];
LLViewerTexture *detail_texture2p = compp->mDetailTextures[2];
LLViewerTexture *detail_texture3p = compp->mDetailTextures[3];
LLViewerImage *detail_texture0p = compp->mDetailTextures[0];
LLViewerImage *detail_texture1p = compp->mDetailTextures[1];
LLViewerImage *detail_texture2p = compp->mDetailTextures[2];
LLViewerImage *detail_texture3p = compp->mDetailTextures[3];
LLVector3d region_origin_global = gAgent.getRegion()->getOriginGlobal();
F32 offset_x = (F32)fmod(region_origin_global.mdV[VX], 1.0/(F64)sDetailScale)*sDetailScale;
@@ -368,7 +364,7 @@ void LLDrawPoolTerrain::renderFullShader()
// Alpha Ramp
//
S32 alpha_ramp = sShader->enableTexture(LLViewerShaderMgr::TERRAIN_ALPHARAMP);
gGL.getTexUnit(alpha_ramp)->bind(m2DAlphaRampImagep);
gGL.getTexUnit(alpha_ramp)->bind(m2DAlphaRampImagep.get());
// GL_BLEND disabled by default
drawLoop();
@@ -434,10 +430,10 @@ void LLDrawPoolTerrain::renderFull4TU()
// Hack! Get the region that this draw pool is rendering from!
LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion();
LLVLComposition *compp = regionp->getComposition();
LLViewerTexture *detail_texture0p = compp->mDetailTextures[0];
LLViewerTexture *detail_texture1p = compp->mDetailTextures[1];
LLViewerTexture *detail_texture2p = compp->mDetailTextures[2];
LLViewerTexture *detail_texture3p = compp->mDetailTextures[3];
LLViewerImage *detail_texture0p = compp->mDetailTextures[0];
LLViewerImage *detail_texture1p = compp->mDetailTextures[1];
LLViewerImage *detail_texture2p = compp->mDetailTextures[2];
LLViewerImage *detail_texture3p = compp->mDetailTextures[3];
LLVector3d region_origin_global = gAgent.getRegion()->getOriginGlobal();
F32 offset_x = (F32)fmod(region_origin_global.mdV[VX], 1.0/(F64)sDetailScale)*sDetailScale;
@@ -532,7 +528,7 @@ void LLDrawPoolTerrain::renderFull4TU()
//
// Stage 1: Generate alpha ramp for detail2/detail3 transition
//
gGL.getTexUnit(1)->bind(m2DAlphaRampImagep);
gGL.getTexUnit(1)->bind(m2DAlphaRampImagep.get());
gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(1)->activate();
@@ -564,7 +560,7 @@ void LLDrawPoolTerrain::renderFull4TU()
//
// Stage 3: Generate alpha ramp for detail1/detail2 transition
//
gGL.getTexUnit(3)->bind(m2DAlphaRampImagep);
gGL.getTexUnit(3)->bind(m2DAlphaRampImagep.get());
gGL.getTexUnit(3)->enable(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(3)->activate();
@@ -635,10 +631,10 @@ void LLDrawPoolTerrain::renderFull2TU()
// Hack! Get the region that this draw pool is rendering from!
LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion();
LLVLComposition *compp = regionp->getComposition();
LLViewerTexture *detail_texture0p = compp->mDetailTextures[0];
LLViewerTexture *detail_texture1p = compp->mDetailTextures[1];
LLViewerTexture *detail_texture2p = compp->mDetailTextures[2];
LLViewerTexture *detail_texture3p = compp->mDetailTextures[3];
LLViewerImage *detail_texture0p = compp->mDetailTextures[0];
LLViewerImage *detail_texture1p = compp->mDetailTextures[1];
LLViewerImage *detail_texture2p = compp->mDetailTextures[2];
LLViewerImage *detail_texture3p = compp->mDetailTextures[3];
LLVector3d region_origin_global = gAgent.getRegion()->getOriginGlobal();
F32 offset_x = (F32)fmod(region_origin_global.mdV[VX], 1.0/(F64)sDetailScale)*sDetailScale;
@@ -676,7 +672,7 @@ void LLDrawPoolTerrain::renderFull2TU()
//
// Stage 0: Generate alpha ramp for detail0/detail1 transition
//
gGL.getTexUnit(0)->bind(m2DAlphaRampImagep);
gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get());
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
@@ -714,7 +710,7 @@ void LLDrawPoolTerrain::renderFull2TU()
//
// Stage 0: Generate alpha ramp for detail1/detail2 transition
//
gGL.getTexUnit(0)->bind(m2DAlphaRampImagep);
gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get());
// Set the texture matrix
glMatrixMode(GL_TEXTURE);
@@ -754,7 +750,7 @@ void LLDrawPoolTerrain::renderFull2TU()
// Stage 0: Generate alpha ramp for detail2/detail3 transition
//
gGL.getTexUnit(0)->activate();
gGL.getTexUnit(0)->bind(m2DAlphaRampImagep);
gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get());
// Set the texture matrix
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
@@ -827,7 +823,7 @@ void LLDrawPoolTerrain::renderSimple()
gGL.getTexUnit(0)->activate();
gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(0)->bind(mTexturep);
gGL.getTexUnit(0)->bind(mTexturep.get());
LLVector3 origin_agent = mDrawFace[0]->getDrawable()->getVObj()->getRegion()->getOriginAgent();
F32 tscale = 1.f/256.f;
@@ -877,7 +873,7 @@ void LLDrawPoolTerrain::renderOwnership()
LLSurface *surfacep = surface_patchp->getSurface();
LLViewerRegion *regionp = surfacep->getRegion();
LLViewerParcelOverlay *overlayp = regionp->getParcelOverlay();
LLViewerTexture *texturep = overlayp->getTexture();
LLImageGL *texturep = overlayp->getTexture();
gGL.getTexUnit(0)->bind(texturep);
@@ -925,10 +921,9 @@ void LLDrawPoolTerrain::renderForSelect()
}
}
void LLDrawPoolTerrain::dirtyTextures(const std::set<LLViewerFetchedTexture*>& textures)
void LLDrawPoolTerrain::dirtyTextures(const std::set<LLViewerImage*>& textures)
{
LLViewerFetchedTexture* tex = LLViewerTextureManager::staticCastToFetchedTexture(mTexturep) ;
if (tex && textures.find(tex) != textures.end())
if (textures.find(mTexturep) != textures.end())
{
for (std::vector<LLFace*>::iterator iter = mReferences.begin();
iter != mReferences.end(); iter++)
@@ -939,12 +934,12 @@ void LLDrawPoolTerrain::dirtyTextures(const std::set<LLViewerFetchedTexture*>& t
}
}
LLViewerTexture *LLDrawPoolTerrain::getTexture()
LLViewerImage *LLDrawPoolTerrain::getTexture()
{
return mTexturep;
}
LLViewerTexture *LLDrawPoolTerrain::getDebugTexture()
LLViewerImage *LLDrawPoolTerrain::getDebugTexture()
{
return mTexturep;
}

View File

@@ -35,11 +35,9 @@
#include "lldrawpool.h"
class LLViewerFetchedTexture;
class LLDrawPoolTerrain : public LLFacePool
{
LLPointer<LLViewerTexture> mTexturep;
LLPointer<LLViewerImage> mTexturep;
public:
enum
{
@@ -55,7 +53,7 @@ public:
virtual U32 getVertexDataMask();
static S32 getDetailMode();
LLDrawPoolTerrain(LLViewerTexture *texturep);
LLDrawPoolTerrain(LLViewerImage *texturep);
virtual ~LLDrawPoolTerrain();
/*virtual*/ LLDrawPool *instancePool();
@@ -75,14 +73,14 @@ public:
/*virtual*/ void beginRenderPass( S32 pass );
/*virtual*/ void endRenderPass( S32 pass );
/*virtual*/ void renderForSelect();
/*virtual*/ void dirtyTextures(const std::set<LLViewerFetchedTexture*>& textures);
/*virtual*/ LLViewerTexture *getTexture();
/*virtual*/ LLViewerTexture *getDebugTexture();
/*virtual*/ void dirtyTextures(const std::set<LLViewerImage*>& textures);
/*virtual*/ LLViewerImage *getTexture();
/*virtual*/ LLViewerImage *getDebugTexture();
/*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display
LLPointer<LLViewerTexture> mAlphaRampImagep;
LLPointer<LLViewerTexture> m2DAlphaRampImagep;
LLPointer<LLViewerTexture> mAlphaNoiseImagep;
LLPointer<LLViewerImage> mAlphaRampImagep;
LLPointer<LLViewerImage> m2DAlphaRampImagep;
LLPointer<LLViewerImage> mAlphaNoiseImagep;
static S32 sDetailMode;
static F32 sDetailScale; // meters per texture

View File

@@ -48,7 +48,7 @@
S32 LLDrawPoolTree::sDiffTex = 0;
static LLGLSLShader* shader = NULL;
LLDrawPoolTree::LLDrawPoolTree(LLViewerTexture *texturep) :
LLDrawPoolTree::LLDrawPoolTree(LLViewerImage *texturep) :
LLFacePool(POOL_TREE),
mTexturep(texturep)
{
@@ -380,12 +380,12 @@ BOOL LLDrawPoolTree::verify() const
return TRUE;
}
LLViewerTexture *LLDrawPoolTree::getTexture()
LLViewerImage *LLDrawPoolTree::getTexture()
{
return mTexturep;
}
LLViewerTexture *LLDrawPoolTree::getDebugTexture()
LLViewerImage *LLDrawPoolTree::getDebugTexture()
{
return mTexturep;
}

View File

@@ -37,7 +37,7 @@
class LLDrawPoolTree : public LLFacePool
{
LLPointer<LLViewerTexture> mTexturep;
LLPointer<LLViewerImage> mTexturep;
public:
enum
{
@@ -48,7 +48,7 @@ public:
virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
LLDrawPoolTree(LLViewerTexture *texturep);
LLDrawPoolTree(LLViewerImage *texturep);
/*virtual*/ LLDrawPool *instancePool();
@@ -70,8 +70,8 @@ public:
/*virtual*/ S32 getNumPasses() { return 1; }
/*virtual*/ void renderForSelect();
/*virtual*/ BOOL verify() const;
/*virtual*/ LLViewerTexture *getTexture();
/*virtual*/ LLViewerTexture *getDebugTexture();
/*virtual*/ LLViewerImage *getTexture();
/*virtual*/ LLViewerImage *getDebugTexture();
/*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display
static S32 sDiffTex;

View File

@@ -46,7 +46,7 @@
#include "llface.h"
#include "llsky.h"
#include "llviewercamera.h" // to get OGL_TO_CFR_ROTATION
#include "llviewertexturelist.h"
#include "llviewerimagelist.h"
#include "llviewerregion.h"
#include "llvosky.h"
#include "llvowater.h"
@@ -70,20 +70,18 @@ LLVector3 LLDrawPoolWater::sLightDir;
LLDrawPoolWater::LLDrawPoolWater() :
LLFacePool(POOL_WATER)
{
mHBTex[0] = LLViewerTextureManager::getFetchedTexture(gSunTextureID, TRUE, LLViewerTexture::BOOST_UI);
gGL.getTexUnit(0)->bind(mHBTex[0]) ;
mHBTex[0] = gImageList.getImage(gSunTextureID, TRUE, TRUE);
gGL.getTexUnit(0)->bind(mHBTex[0].get());
mHBTex[0]->setAddressMode(LLTexUnit::TAM_CLAMP);
mHBTex[1] = LLViewerTextureManager::getFetchedTexture(gMoonTextureID, TRUE, LLViewerTexture::BOOST_UI);
gGL.getTexUnit(0)->bind(mHBTex[1]);
mHBTex[1] = gImageList.getImage(gMoonTextureID, TRUE, TRUE);
gGL.getTexUnit(0)->bind(mHBTex[1].get());
mHBTex[1]->setAddressMode(LLTexUnit::TAM_CLAMP);
mWaterImagep = LLViewerTextureManager::getFetchedTexture(WATER_TEST);
llassert(mWaterImagep);
mWaterImagep = gImageList.getImage(WATER_TEST);
mWaterImagep->setNoDelete() ;
mWaterNormp = LLViewerTextureManager::getFetchedTexture(DEFAULT_WATER_NORMAL);
mWaterNormp->setNoDelete();
mWaterNormp = gImageList.getImage(DEFAULT_WATER_NORMAL);
mWaterNormp->setNoDelete() ;
restoreGL();
}
@@ -200,7 +198,7 @@ void LLDrawPoolWater::render(S32 pass)
mWaterImagep->addTextureStats(1024.f*1024.f);
gGL.getTexUnit(1)->activate();
gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(1)->bind(mWaterImagep) ;
gGL.getTexUnit(1)->bind(mWaterImagep.get());
LLVector3 camera_up = LLViewerCamera::getInstance()->getUpAxis();
F32 up_dot = camera_up * LLVector3::z_axis;
@@ -345,7 +343,7 @@ void LLDrawPoolWater::renderReflection(LLFace* face)
LLGLSNoFog noFog;
gGL.getTexUnit(0)->bind(mHBTex[dr]);
gGL.getTexUnit(0)->bind(mHBTex[dr].get());
LLOverrideFaceColor override(this, face->getFaceColor().mV);
face->renderIndexed();
@@ -447,11 +445,11 @@ void LLDrawPoolWater::shade()
// change mWaterNormp if needed
if (mWaterNormp->getID() != param_mgr->getNormalMapID())
{
mWaterNormp = LLViewerTextureManager::getFetchedTexture(param_mgr->getNormalMapID());
mWaterNormp = gImageList.getImage(param_mgr->getNormalMapID());
}
mWaterNormp->addTextureStats(1024.f*1024.f);
gGL.getTexUnit(bumpTex)->bind(mWaterNormp) ;
gGL.getTexUnit(bumpTex)->bind(mWaterNormp.get());
if (gSavedSettings.getBOOL("RenderWaterMipNormal"))
{
mWaterNormp->setFilteringOption(LLTexUnit::TFO_ANISOTROPIC);
@@ -554,8 +552,7 @@ void LLDrawPoolWater::shade()
}
LLVOWater* water = (LLVOWater*) face->getViewerObject();
if(diffTex > -1 && face->getTexture()->hasGLTexture())
gGL.getTexUnit(diffTex)->bind(face->getTexture());
gGL.getTexUnit(diffTex)->bind(face->getTexture());
sNeedsReflectionUpdate = TRUE;
@@ -573,8 +570,6 @@ void LLDrawPoolWater::shade()
LLGLSquashToFarClip far_clip(glh_get_current_projection());
face->renderIndexed();
}
if(diffTex > -1 && face->getTexture()->hasGLTexture())
gGL.getTexUnit(diffTex)->unbind(LLTexUnit::TT_TEXTURE);
}
}
@@ -611,7 +606,7 @@ void LLDrawPoolWater::renderForSelect()
void LLDrawPoolWater::renderFaceSelected(LLFace *facep,
LLViewerTexture *image,
LLImageGL *image,
const LLColor4 &color,
const S32 index_offset, const S32 index_count)
{
@@ -620,9 +615,9 @@ void LLDrawPoolWater::renderFaceSelected(LLFace *facep,
}
LLViewerTexture *LLDrawPoolWater::getDebugTexture()
LLViewerImage *LLDrawPoolWater::getDebugTexture()
{
return LLViewerFetchedTexture::sSmokeImagep;
return LLViewerImage::sSmokeImagep;
}
LLColor3 LLDrawPoolWater::getDebugColor() const

View File

@@ -43,10 +43,11 @@ class LLWaterSurface;
class LLDrawPoolWater: public LLFacePool
{
protected:
LLPointer<LLViewerTexture> mHBTex[2];
LLPointer<LLViewerTexture> mWaterImagep;
LLPointer<LLViewerTexture> mWaterNormp;
LLPointer<LLViewerImage> mHBTex[2];
LLPointer<LLViewerImage> mWaterImagep;
LLPointer<LLViewerImage> mWaterNormp;
const LLWaterSurface *mWaterSurface;
public:
static BOOL sSkipScreenCopy;
static BOOL sNeedsReflectionUpdate;
@@ -79,12 +80,12 @@ public:
/*virtual*/ S32 getNumPasses();
/*virtual*/ void render(S32 pass = 0);
/*virtual*/ void renderFaceSelected(LLFace *facep, LLViewerTexture *image, const LLColor4 &color,
/*virtual*/ void renderFaceSelected(LLFace *facep, LLImageGL *image, const LLColor4 &color,
const S32 index_offset = 0, const S32 index_count = 0);
/*virtual*/ void prerender();
/*virtual*/ void renderForSelect();
/*virtual*/ LLViewerTexture *getDebugTexture();
/*virtual*/ LLViewerImage *getDebugTexture();
/*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display
void renderReflection(LLFace* face);

View File

@@ -47,7 +47,7 @@
#include "llface.h"
#include "llrender.h"
LLPointer<LLViewerTexture> LLDrawPoolWLSky::sCloudNoiseTexture = NULL;
LLPointer<LLImageGL> LLDrawPoolWLSky::sCloudNoiseTexture = NULL;
LLPointer<LLImageRaw> LLDrawPoolWLSky::sCloudNoiseRawImage = NULL;
@@ -71,7 +71,7 @@ LLDrawPoolWLSky::LLDrawPoolWLSky(void) :
cloudNoiseFile->decode(sCloudNoiseRawImage, 0.0f);
sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE);
LLImageGL::create(sCloudNoiseTexture, sCloudNoiseRawImage, TRUE);
LLWLParamManager::instance()->propagateParameters();
}
@@ -83,7 +83,7 @@ LLDrawPoolWLSky::~LLDrawPoolWLSky()
sCloudNoiseRawImage = NULL;
}
LLViewerTexture *LLDrawPoolWLSky::getDebugTexture()
LLViewerImage *LLDrawPoolWLSky::getDebugTexture()
{
return NULL;
}
@@ -233,7 +233,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
LLFace * face = gSky.mVOSkyp->mFace[LLVOSky::FACE_SUN];
if (gSky.mVOSkyp->getSun().getDraw() && face->getGeomCount())
{
LLViewerTexture * tex = face->getTexture();
LLImageGL * tex = face->getTexture();
gGL.getTexUnit(0)->bind(tex);
LLColor4 color(gSky.mVOSkyp->getSun().getInterpColor());
LLFacePool::LLOverrideFaceColor color_override(this, color);
@@ -248,7 +248,8 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
// *NOTE: even though we already bound this texture above for the
// stars register combiners, we bind again here for defensive reasons,
// since LLImageGL::bind detects that it's a noop, and optimizes it out.
gGL.getTexUnit(0)->bind(face->getTexture());
LLImageGL * tex = face->getTexture();
gGL.getTexUnit(0)->bind(tex);
LLColor4 color(gSky.mVOSkyp->getMoon().getInterpColor());
F32 a = gSky.mVOSkyp->getMoon().getDirection().mV[2];
if (a > 0.f)
@@ -288,12 +289,14 @@ void LLDrawPoolWLSky::render(S32 pass)
// *NOTE: have to bind a texture here since register combiners blending in
// renderStars() requires something to be bound and we might as well only
// bind the moon's texture once.
gGL.getTexUnit(0)->bind(gSky.mVOSkyp->mFace[LLVOSky::FACE_MOON]->getTexture());
// bind the moon's texture once.
LLImageGL * tex = gSky.mVOSkyp->mFace[LLVOSky::FACE_MOON]->getTexture();
gGL.getTexUnit(0)->bind(tex);
renderHeavenlyBodies();
renderStars();
glPopMatrix();
@@ -313,7 +316,7 @@ LLDrawPoolWLSky *LLDrawPoolWLSky::instancePool()
return new LLDrawPoolWLSky();
}
LLViewerTexture* LLDrawPoolWLSky::getTexture()
LLViewerImage* LLDrawPoolWLSky::getTexture()
{
return NULL;
}
@@ -331,5 +334,5 @@ void LLDrawPoolWLSky::cleanupGL()
//static
void LLDrawPoolWLSky::restoreGL()
{
sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE);
LLImageGL::create(sCloudNoiseTexture, sCloudNoiseRawImage, TRUE);
}

View File

@@ -55,7 +55,7 @@ public:
/*virtual*/ void endPostDeferredPass(S32 pass) { endRenderPass(pass); }
/*virtual*/ void renderPostDeferred(S32 pass) { render(pass); }
/*virtual*/ LLViewerTexture *getDebugTexture();
/*virtual*/ LLViewerImage *getDebugTexture();
/*virtual*/ void beginRenderPass( S32 pass );
/*virtual*/ void endRenderPass( S32 pass );
/*virtual*/ S32 getNumPasses() { return 1; }
@@ -65,11 +65,11 @@ public:
/*virtual*/ BOOL verify() const { return TRUE; } // Verify that all data in the draw pool is correct!
/*virtual*/ S32 getVertexShaderLevel() const { return mVertexShaderLevel; }
//static LLDrawPool* createPool(const U32 type, LLViewerTexture *tex0 = NULL);
//static LLDrawPool* createPool(const U32 type, LLViewerImage *tex0 = NULL);
// Create an empty new instance of the pool.
/*virtual*/ LLDrawPoolWLSky *instancePool(); ///< covariant override
/*virtual*/ LLViewerTexture* getTexture();
/*virtual*/ LLViewerImage* getTexture();
/*virtual*/ BOOL isFacePool() { return FALSE; }
/*virtual*/ void resetDrawOrders();
@@ -83,7 +83,7 @@ private:
void renderHeavenlyBodies();
private:
static LLPointer<LLViewerTexture> sCloudNoiseTexture;
static LLPointer<LLImageGL> sCloudNoiseTexture;
static LLPointer<LLImageRaw> sCloudNoiseRawImage;
};

View File

@@ -37,20 +37,24 @@
#include "llviewerwindow.h"
#include "llviewercamera.h"
#include "llviewercontrol.h"
#include "llviewertexture.h"
#include "llviewerimage.h"
#include "llvertexbuffer.h"
#include "llviewerdisplay.h"
#include "llrender.h"
// static
LLViewerDynamicTexture::instance_list_t LLViewerDynamicTexture::sInstances[ LLViewerDynamicTexture::ORDER_COUNT ];
S32 LLViewerDynamicTexture::sNumRenders = 0;
LLDynamicTexture::instance_list_t LLDynamicTexture::sInstances[ LLDynamicTexture::ORDER_COUNT ];
S32 LLDynamicTexture::sNumRenders = 0;
//-----------------------------------------------------------------------------
// LLViewerDynamicTexture()
// LLDynamicTexture()
//-----------------------------------------------------------------------------
LLViewerDynamicTexture::LLViewerDynamicTexture(S32 width, S32 height, S32 components, EOrder order, BOOL clamp) :
LLViewerTexture(width, height, components, FALSE),
LLDynamicTexture::LLDynamicTexture(S32 width, S32 height, S32 components, EOrder order, BOOL clamp) :
mWidth(width),
mHeight(height),
mComponents(components),
mTexture(NULL),
mLastBindTime(0),
mClamp(clamp)
{
llassert((1 <= components) && (components <= 4));
@@ -58,58 +62,66 @@ LLViewerDynamicTexture::LLViewerDynamicTexture(S32 width, S32 height, S32 compon
generateGLTexture();
llassert( 0 <= order && order < ORDER_COUNT );
LLViewerDynamicTexture::sInstances[ order ].insert(this);
LLDynamicTexture::sInstances[ order ].insert(this);
}
//-----------------------------------------------------------------------------
// LLViewerDynamicTexture()
// LLDynamicTexture()
//-----------------------------------------------------------------------------
LLViewerDynamicTexture::~LLViewerDynamicTexture()
LLDynamicTexture::~LLDynamicTexture()
{
releaseGLTexture();
for( S32 order = 0; order < ORDER_COUNT; order++ )
{
LLViewerDynamicTexture::sInstances[order].erase(this); // will fail in all but one case.
LLDynamicTexture::sInstances[order].erase(this); // will fail in all but one case.
}
}
//virtual
S8 LLViewerDynamicTexture::getType() const
//-----------------------------------------------------------------------------
// releaseGLTexture()
//-----------------------------------------------------------------------------
void LLDynamicTexture::releaseGLTexture()
{
return LLViewerTexture::DYNAMIC_TEXTURE ;
if (mTexture.notNull())
{
// llinfos << "RELEASING " << (mWidth*mHeight*mComponents)/1024 << "K" << llendl;
mTexture = NULL;
}
}
//-----------------------------------------------------------------------------
// generateGLTexture()
//-----------------------------------------------------------------------------
void LLViewerDynamicTexture::generateGLTexture()
void LLDynamicTexture::generateGLTexture()
{
LLViewerTexture::generateGLTexture() ;
generateGLTexture(-1, 0, 0, FALSE);
}
void LLViewerDynamicTexture::generateGLTexture(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format, BOOL swap_bytes, const LLColor4U *fill_color/*=NULL*/)
void LLDynamicTexture::generateGLTexture(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format, BOOL swap_bytes, const LLColor4U *fill_color/* = NULL*/)
{
if (mComponents < 1 || mComponents > 4)
{
llerrs << "Bad number of components in dynamic texture: " << mComponents << llendl;
}
LLPointer<LLImageRaw> raw_image = new LLImageRaw(mFullWidth, mFullHeight, mComponents);
if (internal_format >= 0)
{
setExplicitFormat(internal_format, primary_format, type_format, swap_bytes);
}
releaseGLTexture();
LLPointer<LLImageRaw> raw_image = new LLImageRaw(mWidth, mHeight, mComponents);
if(fill_color)
raw_image->fill(*fill_color);
createGLTexture(0, raw_image, 0, TRUE, LLViewerTexture::DYNAMIC_TEX);
setAddressMode((mClamp) ? LLTexUnit::TAM_CLAMP : LLTexUnit::TAM_WRAP);
mGLTexturep->setGLTextureCreated(false);
mTexture = new LLViewerImage(mWidth, mHeight, mComponents, FALSE);
if (internal_format >= 0)
{
mTexture->setExplicitFormat(internal_format, primary_format, type_format, swap_bytes);
}
// llinfos << "ALLOCATING " << (mWidth*mHeight*mComponents)/1024 << "K" << llendl;
mTexture->createGLTexture(0, raw_image, 0, TRUE, LLViewerImageBoostLevel::DYNAMIC_TEX);
mTexture->setAddressMode((mClamp) ? LLTexUnit::TAM_CLAMP : LLTexUnit::TAM_WRAP);
mTexture->setGLTextureCreated(false);
}
//-----------------------------------------------------------------------------
// render()
//-----------------------------------------------------------------------------
BOOL LLViewerDynamicTexture::render()
BOOL LLDynamicTexture::render()
{
return FALSE;
}
@@ -117,13 +129,13 @@ BOOL LLViewerDynamicTexture::render()
//-----------------------------------------------------------------------------
// preRender()
//-----------------------------------------------------------------------------
void LLViewerDynamicTexture::preRender(BOOL clear_depth)
void LLDynamicTexture::preRender(BOOL clear_depth)
{
{
// force rendering to on-screen portion of frame buffer
LLCoordScreen window_pos;
gViewerWindow->getWindow()->getPosition( &window_pos );
mOrigin.set(0, gViewerWindow->getWindowDisplayHeight() - mFullHeight); // top left corner
mOrigin.set(0, gViewerWindow->getWindowDisplayHeight() - mHeight); // top left corner
if (window_pos.mX < 0)
{
@@ -138,14 +150,13 @@ void LLViewerDynamicTexture::preRender(BOOL clear_depth)
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
}
// Set up camera
LLViewerCamera* camera = LLViewerCamera::getInstance();
mCamera.setOrigin(*camera);
mCamera.setAxes(*camera);
mCamera.setAspect(camera->getAspect());
mCamera.setView(camera->getView());
mCamera.setNear(camera->getNear());
mCamera.setOrigin(*LLViewerCamera::getInstance());
mCamera.setAxes(*LLViewerCamera::getInstance());
mCamera.setAspect(LLViewerCamera::getInstance()->getAspect());
mCamera.setView(LLViewerCamera::getInstance()->getView());
mCamera.setNear(LLViewerCamera::getInstance()->getNear());
glViewport(mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight);
glViewport(mOrigin.mX, mOrigin.mY, mWidth, mHeight);
if (clear_depth)
{
glClear(GL_DEPTH_BUFFER_BIT);
@@ -155,25 +166,12 @@ void LLViewerDynamicTexture::preRender(BOOL clear_depth)
//-----------------------------------------------------------------------------
// postRender()
//-----------------------------------------------------------------------------
void LLViewerDynamicTexture::postRender(BOOL success)
void LLDynamicTexture::postRender(BOOL success)
{
{
if (success)
{
if(mGLTexturep.isNull())
{
generateGLTexture() ;
}
else if(!mGLTexturep->getHasGLTexture())
{
generateGLTexture() ;
}
else if(mGLTexturep->getDiscardLevel() != 0)//do not know how it happens, but regenerate one if it does.
{
generateGLTexture() ;
}
success = mGLTexturep->setSubImageFromFrameBuffer(0, 0, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight);
success = mTexture->setSubImageFromFrameBuffer(0, 0, mOrigin.mX, mOrigin.mY, mWidth, mHeight);
}
}
@@ -181,12 +179,11 @@ void LLViewerDynamicTexture::postRender(BOOL success)
gViewerWindow->setupViewport();
// restore camera
LLViewerCamera* camera = LLViewerCamera::getInstance();
camera->setOrigin(mCamera);
camera->setAxes(mCamera);
camera->setAspect(mCamera.getAspect());
camera->setView(mCamera.getView());
camera->setNear(mCamera.getNear());
LLViewerCamera::getInstance()->setOrigin(mCamera);
LLViewerCamera::getInstance()->setAxes(mCamera);
LLViewerCamera::getInstance()->setAspect(mCamera.getAspect());
LLViewerCamera::getInstance()->setView(mCamera.getView());
LLViewerCamera::getInstance()->setNear(mCamera.getNear());
}
//-----------------------------------------------------------------------------
@@ -194,7 +191,7 @@ void LLViewerDynamicTexture::postRender(BOOL success)
// updateDynamicTextures()
// Calls update on each dynamic texture. Calls each group in order: "first," then "middle," then "last."
//-----------------------------------------------------------------------------
BOOL LLViewerDynamicTexture::updateAllInstances()
BOOL LLDynamicTexture::updateAllInstances()
{
sNumRenders = 0;
if (gGLManager.mIsDisabled)
@@ -206,15 +203,16 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
BOOL ret = FALSE ;
for( S32 order = 0; order < ORDER_COUNT; order++ )
{
for (instance_list_t::iterator iter = LLViewerDynamicTexture::sInstances[order].begin();
iter != LLViewerDynamicTexture::sInstances[order].end(); ++iter)
for (instance_list_t::iterator iter = LLDynamicTexture::sInstances[order].begin();
iter != LLDynamicTexture::sInstances[order].end(); ++iter)
{
LLViewerDynamicTexture *dynamicTexture = *iter;
LLDynamicTexture *dynamicTexture = *iter;
if (dynamicTexture->needsRender())
{
{
glClear(GL_DEPTH_BUFFER_BIT);
gDepthDirty = TRUE;
gGL.color4f(1,1,1,1);
dynamicTexture->preRender(); // Must be called outside of startRender()
result = FALSE;
@@ -235,18 +233,30 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
return ret;
}
//virtual
void LLDynamicTexture::restoreGLTexture()
{
generateGLTexture() ;
}
//virtual
void LLDynamicTexture::destroyGLTexture()
{
releaseGLTexture() ;
}
//-----------------------------------------------------------------------------
// static
// destroyGL()
//-----------------------------------------------------------------------------
void LLViewerDynamicTexture::destroyGL()
void LLDynamicTexture::destroyGL()
{
for( S32 order = 0; order < ORDER_COUNT; order++ )
{
for (instance_list_t::iterator iter = LLViewerDynamicTexture::sInstances[order].begin();
iter != LLViewerDynamicTexture::sInstances[order].end(); ++iter)
for (instance_list_t::iterator iter = LLDynamicTexture::sInstances[order].begin();
iter != LLDynamicTexture::sInstances[order].end(); ++iter)
{
LLViewerDynamicTexture *dynamicTexture = *iter;
LLDynamicTexture *dynamicTexture = *iter;
dynamicTexture->destroyGLTexture() ;
}
}
@@ -256,7 +266,7 @@ void LLViewerDynamicTexture::destroyGL()
// static
// restoreGL()
//-----------------------------------------------------------------------------
void LLViewerDynamicTexture::restoreGL()
void LLDynamicTexture::restoreGL()
{
if (gGLManager.mIsDisabled)
{
@@ -265,10 +275,10 @@ void LLViewerDynamicTexture::restoreGL()
for( S32 order = 0; order < ORDER_COUNT; order++ )
{
for (instance_list_t::iterator iter = LLViewerDynamicTexture::sInstances[order].begin();
iter != LLViewerDynamicTexture::sInstances[order].end(); ++iter)
for (instance_list_t::iterator iter = LLDynamicTexture::sInstances[order].begin();
iter != LLDynamicTexture::sInstances[order].end(); ++iter)
{
LLViewerDynamicTexture *dynamicTexture = *iter;
LLDynamicTexture *dynamicTexture = *iter;
dynamicTexture->restoreGLTexture() ;
}
}

View File

@@ -35,64 +35,59 @@
#include "llgl.h"
#include "llcoord.h"
#include "llviewertexture.h"
#include "llimagegl.h"
class LLViewerDynamicTexture : public LLViewerTexture
class LLDynamicTexture
{
public:
enum
{
LL_VIEWER_DYNAMIC_TEXTURE = LLViewerTexture::DYNAMIC_TEXTURE,
LL_TEX_LAYER_SET_BUFFER = LLViewerTexture::INVALID_TEXTURE_TYPE + 1,
LL_VISUAL_PARAM_HINT,
LL_VISUAL_PARAM_RESET,
LL_PREVIEW_ANIMATION,
LL_IMAGE_PREVIEW_SCULPTED,
LL_IMAGE_PREVIEW_AVATAR,
INVALID_DYNAMIC_TEXTURE
};
protected:
/*virtual*/ ~LLViewerDynamicTexture();
public:
enum EOrder { ORDER_FIRST = 0, ORDER_MIDDLE = 1, ORDER_LAST = 2, ORDER_RESET = 3, ORDER_COUNT = 4 };
LLViewerDynamicTexture(S32 width,
LLDynamicTexture(S32 width,
S32 height,
S32 components, // = 4,
EOrder order, // = ORDER_MIDDLE,
BOOL clamp);
/*virtual*/ S8 getType() const ;
virtual ~LLDynamicTexture();
S32 getOriginX() { return mOrigin.mX; }
S32 getOriginY() { return mOrigin.mY; }
S32 getSize() { return mFullWidth * mFullHeight * mComponents; }
S32 getWidth() { return mWidth; }
S32 getHeight() { return mHeight; }
S32 getComponents() { return mComponents; }
S32 getSize() { return mWidth * mHeight * mComponents; }
virtual BOOL needsRender() { return TRUE; }
virtual void preRender(BOOL clear_depth = TRUE);
virtual BOOL render();
virtual void postRender(BOOL success);
virtual void restoreGLTexture() {}
virtual void destroyGLTexture() {}
virtual void restoreGLTexture() ;
virtual void destroyGLTexture() ;
LLImageGL* getTexture(void) const { return mTexture; }
static BOOL updateAllInstances();
static void destroyGL() ;
static void restoreGL() ;
protected:
void generateGLTexture();
void generateGLTexture(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format, BOOL swap_bytes = FALSE, const LLColor4U *fill_color=NULL);
static void destroyGL();
static void restoreGL();
protected:
void releaseGLTexture();
void generateGLTexture();
void generateGLTexture(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format, BOOL swap_bytes = FALSE, const LLColor4U *fill_color = NULL);
protected:
S32 mWidth;
S32 mHeight;
S32 mComponents;
LLPointer<LLImageGL> mTexture;
F32 mLastBindTime;
BOOL mClamp;
LLCoordGL mOrigin;
LLCamera mCamera;
typedef std::set<LLViewerDynamicTexture*> instance_list_t;
static instance_list_t sInstances[ LLViewerDynamicTexture::ORDER_COUNT ];
typedef std::set<LLDynamicTexture*> instance_list_t;
static instance_list_t sInstances[ LLDynamicTexture::ORDER_COUNT ];
static S32 sNumRenders;
};

View File

@@ -47,7 +47,7 @@
#include "lllightconstants.h"
#include "llsky.h"
#include "llviewercamera.h"
#include "llviewertexturelist.h"
#include "llviewerimagelist.h"
#include "llvosky.h"
#include "llvovolume.h"
#include "pipeline.h"
@@ -228,7 +228,7 @@ void LLFace::setWorldMatrix(const LLMatrix4 &mat)
llerrs << "Faces on this drawable are not independently modifiable\n" << llendl;
}
void LLFace::setPool(LLFacePool* new_pool, LLViewerTexture *texturep)
void LLFace::setPool(LLFacePool* new_pool, LLViewerImage *texturep)
{
LLMemType mt1(LLMemType::MTYPE_DRAWABLE);
@@ -262,7 +262,7 @@ void LLFace::setPool(LLFacePool* new_pool, LLViewerTexture *texturep)
setTexture(texturep) ;
}
void LLFace::setTexture(LLViewerTexture* tex)
void LLFace::setTexture(LLViewerImage* tex)
{
if(mTexture == tex)
{
@@ -287,7 +287,7 @@ void LLFace::dirtyTexture()
gPipeline.markTextured(getDrawable());
}
void LLFace::switchTexture(LLViewerTexture* new_texture)
void LLFace::switchTexture(LLViewerImage* new_texture)
{
if(mTexture == new_texture)
{
@@ -299,7 +299,7 @@ void LLFace::switchTexture(LLViewerTexture* new_texture)
llerrs << "Can not switch to a null texture." << llendl;
return;
}
new_texture->addTextureStats(mTexture->getMaxVirtualSize()) ;
new_texture->addTextureStats(mTexture->mMaxVirtualSize) ;
getViewerObject()->changeTEImage(mTEOffset, new_texture) ;
setTexture(new_texture) ;
@@ -476,7 +476,8 @@ void LLFace::renderForSelect(U32 data_mask)
}
}
}
void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color)
void LLFace::renderSelected(LLImageGL *imagep, const LLColor4& color)
{
if (mDrawablep->getSpatialGroup() == NULL)
{
@@ -520,8 +521,8 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color)
/* removed in lieu of raycast uv detection
void LLFace::renderSelectedUV()
{
LLViewerTexture* red_blue_imagep = gTextureList.getImageFromFile("uv_test1.j2c", TRUE, TRUE);
LLViewerTexture* green_imagep = gTextureList.getImageFromFile("uv_test2.tga", TRUE, TRUE);
LLViewerImage* red_blue_imagep = gImageList.getImageFromFile("uv_test1.j2c", TRUE, TRUE);
LLViewerImage* green_imagep = gImageList.getImageFromFile("uv_test2.tga", TRUE, TRUE);
LLGLSUVSelect object_select;
@@ -595,26 +596,23 @@ void LLFace::printDebugInfo() const
llinfos << "II: " << mIndicesIndex << " Count:" << mIndicesCount << llendl;
llinfos << llendl;
if (poolp)
poolp->printDebugInfo();
S32 pool_references = 0;
for (std::vector<LLFace*>::iterator iter = poolp->mReferences.begin();
iter != poolp->mReferences.end(); iter++)
{
poolp->printDebugInfo();
S32 pool_references = 0;
for (std::vector<LLFace*>::iterator iter = poolp->mReferences.begin();
iter != poolp->mReferences.end(); iter++)
LLFace *facep = *iter;
if (facep == this)
{
LLFace *facep = *iter;
if (facep == this)
{
llinfos << "Pool reference: " << pool_references << llendl;
pool_references++;
}
llinfos << "Pool reference: " << pool_references << llendl;
pool_references++;
}
}
if (pool_references != 1)
{
llinfos << "Incorrect number of pool references!" << llendl;
}
if (pool_references != 1)
{
llinfos << "Incorrect number of pool references!" << llendl;
}
#if 0
@@ -960,15 +958,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
{
if (num_indices + (S32) mIndicesIndex > mVertexBuffer->getNumIndices())
{
llwarns << "Index buffer overflow!" << llendl;
llwarns << "Indices Count: " << mIndicesCount
<< " VF Num Indices: " << num_indices
<< " Indices Index: " << mIndicesIndex
<< " VB Num Indices: " << mVertexBuffer->getNumIndices() << llendl;
llwarns << "Last Indices Count: " << mLastIndicesCount
<< " Last Indices Index: " << mLastIndicesIndex
<< " Face Index: " << f
<< " Pool Type: " << mPoolType << llendl;
llwarns << "Index buffer overflow!" << llendl;
return FALSE;
}
@@ -1007,7 +997,6 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
BOOL rebuild_binormal = rebuild_pos && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_BINORMAL);
const LLTextureEntry *tep = mVObjp->getTE(f);
if (!tep) rebuild_color = FALSE; // can't get color when tep is NULL
U8 bump_code = tep ? tep->getBumpmap() : 0;
if (rebuild_pos)
@@ -1105,9 +1094,9 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
}
}
LLColor4U color = (tep ? LLColor4U(tep->getColor()) : LLColor4U::white);
LLColor4U color = tep->getColor();
if (rebuild_color) // FALSE if tep == NULL
if (rebuild_color)
{
if (tep)
{
@@ -1159,7 +1148,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
break;
case BE_BRIGHTNESS:
case BE_DARKNESS:
if( mTexture.notNull() && mTexture->hasGLTexture())
if( mTexture.notNull() && mTexture->getHasGLTexture())
{
// Offset by approximately one texel
S32 cur_discard = mTexture->getDiscardLevel();
@@ -1353,7 +1342,7 @@ F32 LLFace::getTextureVirtualSize()
}
face_area = LLFace::adjustPixelArea(mImportanceToCamera, face_area);
if (/*mImportanceToCamera < 1.0f && */face_area > LLViewerTexture::sMinLargeImageSize) //if is large image, shrink face_area by considering the partial overlapping.
if (/*mImportanceToCamera < 1.0f && */face_area > LLViewerImage::sMinLargeImageSize) //if is large image, shrink face_area by considering the partial overlapping.
{
if (mImportanceToCamera > LEAST_IMPORTANCE_FOR_LARGE_IMAGE && mTexture.notNull() && mTexture->isLargeImage())
{
@@ -1366,6 +1355,28 @@ F32 LLFace::getTextureVirtualSize()
return face_area;
}
//static
F32 LLFace::adjustPixelArea(F32 importance, F32 pixel_area)
{
if (pixel_area > LLViewerImage::sMaxSmallImageSize)
{
if (importance < LEAST_IMPORTANCE) //if the face is not important, do not load hi-res.
{
static const F32 MAX_LEAST_IMPORTANCE_IMAGE_SIZE = 128.0f * 128.0f;
pixel_area = llmin(pixel_area * 0.5f, MAX_LEAST_IMPORTANCE_IMAGE_SIZE);
}
else if (pixel_area > LLViewerImage::sMinLargeImageSize) //if is large image, shrink face_area by considering the partial overlapping.
{
if (importance < LEAST_IMPORTANCE_FOR_LARGE_IMAGE) //if the face is not important, do not load hi-res.
{
pixel_area = LLViewerImage::sMinLargeImageSize;
}
}
}
return pixel_area ;
}
BOOL LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius)
{
//get area of circle around face
@@ -1383,7 +1394,7 @@ BOOL LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius)
mPixelArea = radius*radius * 3.14159f;
cos_angle_to_view_dir = lookAt * camera->getXAxis();
if(dist < mBoundingSphereRadius) //camera is very close
if (dist < mBoundingSphereRadius || dist < 10.0f) //camera is very close
{
cos_angle_to_view_dir = 1.0f;
mImportanceToCamera = 1.0f;
@@ -1464,28 +1475,6 @@ F32 LLFace::calcImportanceToCamera(F32 cos_angle_to_view_dir, F32 dist)
return importance ;
}
//static
F32 LLFace::adjustPixelArea(F32 importance, F32 pixel_area)
{
if(pixel_area > LLViewerTexture::sMaxSmallImageSize)
{
if(importance < LEAST_IMPORTANCE) //if the face is not important, do not load hi-res.
{
static const F32 MAX_LEAST_IMPORTANCE_IMAGE_SIZE = 128.0f * 128.0f ;
pixel_area = llmin(pixel_area * 0.5f, MAX_LEAST_IMPORTANCE_IMAGE_SIZE) ;
}
else if(pixel_area > LLViewerTexture::sMinLargeImageSize) //if is large image, shrink face_area by considering the partial overlapping.
{
if(importance < LEAST_IMPORTANCE_FOR_LARGE_IMAGE)//if the face is not important, do not load hi-res.
{
pixel_area = LLViewerTexture::sMinLargeImageSize ;
}
}
}
return pixel_area ;
}
BOOL LLFace::verify(const U32* indices_array) const
{
BOOL ok = TRUE;
@@ -1674,7 +1663,3 @@ LLVector3 LLFace::getPositionAgent() const
return mCenterLocal * getRenderMatrix();
}
}
LLViewerTexture* LLFace::getTexture() const
{
return mTexture ;
}

Some files were not shown because too many files have changed in this diff Show More