merge release-QAR-499 Viewer 1.20 RC 3

merge release-QAR-508 Viewer 1.20 RC 4
merge Branch_1-20-Viewer -r 85278 : 85828 -> release
master
Steven Bennetts 2008-04-28 23:29:46 +00:00
parent 75ee8558ab
commit 16baf6c9d4
64 changed files with 948 additions and 1007 deletions

View File

@ -84,6 +84,9 @@ public:
MTYPE_REGIONS,
MTYPE_INVENTORY,
MTYPE_ANIMATION,
MTYPE_VOLUME,
MTYPE_PRIMITIVE,
MTYPE_NETWORK,
MTYPE_PHYSICS,
MTYPE_INTERESTLIST,

View File

@ -34,7 +34,7 @@
const S32 LL_VERSION_MAJOR = 1;
const S32 LL_VERSION_MINOR = 20;
const S32 LL_VERSION_PATCH = 2;
const S32 LL_VERSION_PATCH = 4;
const S32 LL_VERSION_BUILD = 0;
const char * const LL_CHANNEL = "Second Life Release";

View File

@ -768,8 +768,8 @@ void LLImageRaw::copyScaled( LLImageRaw* src )
LLMemType mt1((LLMemType::EMemType)mMemType);
LLImageRaw* dst = this; // Just for clarity.
llassert( (1 == src->getComponents()) || (3 == src->getComponents()) || (4 == src->getComponents()) );
llassert( src->getComponents() == dst->getComponents() );
llassert_always( (1 == src->getComponents()) || (3 == src->getComponents()) || (4 == src->getComponents()) );
llassert_always( src->getComponents() == dst->getComponents() );
if( (src->getWidth() == dst->getWidth()) && (src->getHeight() == dst->getHeight()) )
{
@ -779,6 +779,7 @@ void LLImageRaw::copyScaled( LLImageRaw* src )
// Vertical
S32 temp_data_size = src->getWidth() * dst->getHeight() * getComponents();
llassert_always(temp_data_size > 0);
U8* temp_buffer = new U8[ temp_data_size ];
for( S32 col = 0; col < src->getWidth(); col++ )
{

File diff suppressed because it is too large Load Diff

View File

@ -643,9 +643,8 @@ protected:
class LLProfile
{
public:
LLProfile(const LLProfileParams &params)
: mParams(params),
mOpen(FALSE),
LLProfile()
: mOpen(FALSE),
mConcave(FALSE),
mDirty(TRUE),
mTotalOut(0),
@ -657,15 +656,12 @@ public:
S32 getTotal() const { return mTotal; }
S32 getTotalOut() const { return mTotalOut; } // Total number of outside points
BOOL isHollow() const { return (mParams.getHollow() > 0); }
BOOL isFlat(S32 face) const { return (mFaces[face].mCount == 2); }
BOOL isOpen() const { return mOpen; }
void setDirty() { mDirty = TRUE; }
BOOL generate(BOOL path_open, F32 detail = 1.0f, S32 split = 0, BOOL is_sculpted = FALSE);
BOOL generate(const LLProfileParams& params, BOOL path_open, F32 detail = 1.0f, S32 split = 0, BOOL is_sculpted = FALSE);
BOOL isConcave() const { return mConcave; }
public:
const LLProfileParams &mParams;
struct Face
{
S32 mIndex;
@ -687,10 +683,10 @@ public:
friend std::ostream& operator<<(std::ostream &s, const LLProfile &profile);
protected:
void genNormals();
void genNGon(S32 sides, F32 offset=0.0f, F32 bevel = 0.0f, F32 ang_scale = 1.f, S32 split = 0);
void genNormals(const LLProfileParams& params);
void genNGon(const LLProfileParams& params, S32 sides, F32 offset=0.0f, F32 bevel = 0.0f, F32 ang_scale = 1.f, S32 split = 0);
Face* addHole(BOOL flat, F32 sides, F32 offset, F32 box_hollow, F32 ang_scale, S32 split = 0);
Face* addHole(const LLProfileParams& params, BOOL flat, F32 sides, F32 offset, F32 box_hollow, F32 ang_scale, S32 split = 0);
Face* addCap (S16 faceID);
Face* addFace(S32 index, S32 count, F32 scaleU, S16 faceID, BOOL flat);
@ -720,9 +716,8 @@ public:
};
public:
LLPath(const LLPathParams &params)
: mParams(params),
mOpen(FALSE),
LLPath()
: mOpen(FALSE),
mTotal(0),
mDirty(TRUE),
mStep(1)
@ -731,8 +726,8 @@ public:
virtual ~LLPath();
void genNGon(S32 sides, F32 offset=0.0f, F32 end_scale = 1.f, F32 twist_scale = 1.f);
virtual BOOL generate(F32 detail=1.0f, S32 split = 0, BOOL is_sculpted = FALSE);
void genNGon(const LLPathParams& params, S32 sides, F32 offset=0.0f, F32 end_scale = 1.f, F32 twist_scale = 1.f);
virtual BOOL generate(const LLPathParams& params, F32 detail=1.0f, S32 split = 0, BOOL is_sculpted = FALSE);
BOOL isOpen() const { return mOpen; }
F32 getStep() const { return mStep; }
@ -745,7 +740,6 @@ public:
friend std::ostream& operator<<(std::ostream &s, const LLPath &path);
public:
const LLPathParams &mParams;
std::vector<PathPt> mPath;
protected:
@ -758,8 +752,8 @@ protected:
class LLDynamicPath : public LLPath
{
public:
LLDynamicPath(const LLPathParams &params) : LLPath(params) { }
BOOL generate(F32 detail=1.0f, S32 split = 0, BOOL is_sculpted = FALSE);
LLDynamicPath() : LLPath() { }
/*virtual*/ BOOL generate(const LLPathParams& params, F32 detail=1.0f, S32 split = 0, BOOL is_sculpted = FALSE);
};
// Yet another "face" class - caches volume-specific, but not instance-specific data for faces)
@ -767,7 +761,7 @@ class LLVolumeFace
{
public:
LLVolumeFace();
BOOL create(BOOL partial_build = FALSE);
BOOL create(LLVolume* volume, BOOL partial_build = FALSE);
void createBinormals();
class VertexData
@ -811,16 +805,11 @@ public:
std::vector<VertexData> mVertices;
std::vector<U16> mIndices;
std::vector<S32> mEdge;
LLVolume *mVolumep; // Deliberately NOT reference counted - djs 11/20/03 - otherwise would make an annoying circular reference
// Shouldn't need num_old and num_new, really - djs
static BOOL updateColors(LLColor4U *old_colors, const S32 num_old, const LLVolumeFace &old_face,
LLStrider<LLColor4U> &new_colors, const S32 num_new, const LLVolumeFace &new_face);
protected:
BOOL createUnCutCubeCap(BOOL partial_build = FALSE);
BOOL createCap(BOOL partial_build = FALSE);
BOOL createSide(BOOL partial_build = FALSE);
private:
BOOL createUnCutCubeCap(LLVolume* volume, BOOL partial_build = FALSE);
BOOL createCap(LLVolume* volume, BOOL partial_build = FALSE);
BOOL createSide(LLVolume* volume, BOOL partial_build = FALSE);
};
class LLVolume : public LLRefCount
@ -848,12 +837,12 @@ public:
LLVolume(const LLVolumeParams &params, const F32 detail, const BOOL generate_single_face = FALSE, const BOOL is_unique = FALSE);
U8 getProfileType() const { return mProfilep->mParams.getCurveType(); }
U8 getPathType() const { return mPathp->mParams.getCurveType(); }
U8 getProfileType() const { return mParams.getProfileParams().getCurveType(); }
U8 getPathType() const { return mParams.getPathParams().getCurveType(); }
S32 getNumFaces() const { return (S32)mProfilep->mFaces.size(); }
S32 getNumVolumeFaces() const { return mNumVolumeFaces; }
F32 getDetail() const { return mDetail; }
const LLVolumeParams & getParams() const { return mParams; }
S32 getNumVolumeFaces() const { return mVolumeFaces.size(); }
F32 getDetail() const { return mDetail; }
const LLVolumeParams& getParams() const { return mParams; }
LLVolumeParams getCopyOfParams() const { return mParams; }
const LLProfile& getProfile() const { return *mProfilep; }
LLPath& getPath() const { return *mPathp; }
@ -932,8 +921,8 @@ protected:
std::vector<Point> mMesh;
BOOL mGenerateSingleFace;
S32 mNumVolumeFaces;
LLVolumeFace *mVolumeFaces;
typedef std::vector<LLVolumeFace> face_list_t;
face_list_t mVolumeFaces;
};
std::ostream& operator<<(std::ostream &s, const LLVolumeParams &volume_params);

View File

@ -31,13 +31,10 @@
#include "linden_common.h"
#include "llvolumemgr.h"
#include "llmemtype.h"
#include "llvolume.h"
//#define DEBUG_VOLUME
//LLVolumeMgr* gVolumeMgr = 0;
const F32 BASE_THRESHOLD = 0.03f;
//static
@ -70,11 +67,6 @@ LLVolumeMgr::~LLVolumeMgr()
BOOL LLVolumeMgr::cleanup()
{
#ifdef DEBUG_VOLUME
{
lldebugs << "LLVolumeMgr::cleanup()" << llendl;
}
#endif
BOOL no_refs = TRUE;
if (mDataMutex)
{
@ -85,14 +77,11 @@ BOOL LLVolumeMgr::cleanup()
iter != end; iter++)
{
LLVolumeLODGroup *volgroupp = iter->second;
if (volgroupp->getNumRefs() != 1)
if (volgroupp->cleanupRefs() == false)
{
llwarns << "Volume group " << volgroupp << " has "
<< volgroupp->getNumRefs() << " remaining refs" << llendl;
llwarns << volgroupp->getParams() << llendl;
no_refs = FALSE;
}
volgroupp->unref();// this );
delete volgroupp;
}
mVolumeLODGroups.clear();
if (mDataMutex)
@ -102,10 +91,11 @@ BOOL LLVolumeMgr::cleanup()
return no_refs;
}
// whatever calls getVolume() never owns the LLVolume* and
// cannot keep references for long since it may be deleted
// later. For best results hold it in an LLPointer<LLVolume>.
LLVolume *LLVolumeMgr::getVolume(const LLVolumeParams &volume_params, const S32 detail)
// Always only ever store the results of refVolume in a LLPointer
// Note however that LLVolumeLODGroup that contains the volume
// also holds a LLPointer so the volume will only go away after
// anything holding the volume and the LODGroup are destroyed
LLVolume* LLVolumeMgr::refVolume(const LLVolumeParams &volume_params, const S32 detail)
{
LLVolumeLODGroup* volgroupp;
if (mDataMutex)
@ -121,17 +111,11 @@ LLVolume *LLVolumeMgr::getVolume(const LLVolumeParams &volume_params, const S32
{
volgroupp = iter->second;
}
volgroupp->ref();
if (mDataMutex)
{
mDataMutex->unlock();
}
#ifdef DEBUG_VOLUME
{
lldebugs << "LLVolumeMgr::getVolume() " << (*this) << llendl;
}
#endif
return volgroupp->getLOD(detail);
return volgroupp->getLODVolume(detail);
}
// virtual
@ -154,15 +138,14 @@ LLVolumeLODGroup* LLVolumeMgr::getGroup( const LLVolumeParams& volume_params ) c
return volgroupp;
}
// virtual
void LLVolumeMgr::cleanupVolume(LLVolume *volumep)
void LLVolumeMgr::unrefVolume(LLVolume *volumep)
{
if (volumep->isUnique())
{
// TomY: Don't need to manage this volume. It is a unique instance.
return;
}
LLVolumeParams* params = (LLVolumeParams*) &(volumep->getParams());
const LLVolumeParams* params = &(volumep->getParams());
if (mDataMutex)
{
mDataMutex->lock();
@ -182,11 +165,10 @@ void LLVolumeMgr::cleanupVolume(LLVolume *volumep)
LLVolumeLODGroup* volgroupp = iter->second;
volgroupp->derefLOD(volumep);
volgroupp->unref();// this );
if (volgroupp->getNumRefs() == 1)
if (volgroupp->getNumRefs() == 0)
{
mVolumeLODGroups.erase(params);
volgroupp->unref();// this );
delete volgroupp;
}
}
if (mDataMutex)
@ -194,40 +176,21 @@ void LLVolumeMgr::cleanupVolume(LLVolume *volumep)
mDataMutex->unlock();
}
#ifdef DEBUG_VOLUME
{
lldebugs << "LLVolumeMgr::cleanupVolume() " << (*this) << llendl;
}
#endif
}
#ifdef DEBUG_VOLUME
S32 LLVolumeMgr::getTotalRefCount() const
// protected
void LLVolumeMgr::insertGroup(LLVolumeLODGroup* volgroup)
{
S32 total_ref_count = 0;
for ( volume_lod_group_map_t::const_iterator iter = mVolumeLODGroups.begin(),
end = mVolumeLODGroups.end();
iter != end; iter++)
{
total_ref_count += iter->second->getTotalVolumeRefCount();
}
return total_ref_count;
mVolumeLODGroups[volgroup->getVolumeParams()] = volgroup;
}
S32 LLVolumeMgr::getGroupCount() const
{
return mVolumeLODGroups.size();
}
#endif
// protected
LLVolumeLODGroup* LLVolumeMgr::createNewGroup(const LLVolumeParams& volume_params)
{
LLVolumeLODGroup* group = new LLVolumeLODGroup(volume_params);
const LLVolumeParams* params = &(group->getParams());
mVolumeLODGroups[params] = group;
group->ref(); // initial reference
return group;
LLMemType m1(LLMemType::MTYPE_VOLUME);
LLVolumeLODGroup* volgroup = new LLVolumeLODGroup(volume_params);
insertGroup(volgroup);
return volgroup;
}
// virtual
@ -272,9 +235,8 @@ std::ostream& operator<<(std::ostream& s, const LLVolumeMgr& volume_mgr)
volume_mgr.mDataMutex->lock();
}
LLVolumeMgr::volume_lod_group_map_iter iter = volume_mgr.mVolumeLODGroups.begin();
LLVolumeMgr::volume_lod_group_map_iter end = volume_mgr.mVolumeLODGroups.end();
for ( ; iter != end; ++iter)
for (LLVolumeMgr::volume_lod_group_map_t::const_iterator iter = volume_mgr.mVolumeLODGroups.begin();
iter != volume_mgr.mVolumeLODGroups.end(); ++iter)
{
LLVolumeLODGroup *volgroupp = iter->second;
total_refs += volgroupp->getNumRefs();
@ -291,72 +253,78 @@ std::ostream& operator<<(std::ostream& s, const LLVolumeMgr& volume_mgr)
}
LLVolumeLODGroup::LLVolumeLODGroup(const LLVolumeParams &params)
: mVolumeParams(params),
mRefs(0)
{
S32 i;
mParams = params;
for (i = 0; i < NUM_LODS; i++)
for (S32 i = 0; i < NUM_LODS; i++)
{
mLODRefs[i] = 0;
// no need to initialize mVolumeLODs, they are smart pointers
//mVolumeLODs[i] = NULL;
mAccessCount[i] = 0;
}
}
#ifdef DEBUG_VOLUME
S32 LLVolumeLODGroup::getTotalVolumeRefCount() const
{
S32 total_ref_count = 0;
for (S32 i = 0; i < NUM_LODS; i++)
{
total_ref_count += mLODRefs[i];
}
return total_ref_count;
}
#endif
// protected
LLVolumeLODGroup::~LLVolumeLODGroup()
{
destroy();
}
// protected
void LLVolumeLODGroup::destroy()
{
for (S32 i = 0; i < NUM_LODS; i++)
{
// remember that mVolumeLODs are smart pointers!
mVolumeLODs[i] = NULL;
llassert_always(mLODRefs[i] == 0);
}
}
LLVolume * LLVolumeLODGroup::getLOD(const S32 detail)
// Called from LLVolumeMgr::cleanup
bool LLVolumeLODGroup::cleanupRefs()
{
bool res = true;
if (mRefs != 0)
{
llwarns << "Volume group has remaining refs:" << getNumRefs() << llendl;
mRefs = 0;
for (S32 i = 0; i < NUM_LODS; i++)
{
if (mLODRefs[i] > 0)
{
llwarns << " LOD " << i << " refs = " << mLODRefs[i] << llendl;
mLODRefs[i] = 0;
mVolumeLODs[i] = NULL;
}
}
llwarns << *getVolumeParams() << llendl;
res = false;
}
return res;
}
LLVolume* LLVolumeLODGroup::getLODVolume(const S32 detail)
{
llassert(detail >=0 && detail < NUM_LODS);
mAccessCount[detail]++;
if (!mLODRefs[detail])
mRefs++;
if (mVolumeLODs[detail].isNull())
{
mVolumeLODs[detail] = new LLVolume(mParams, mDetailScales[detail]);
LLMemType m1(LLMemType::MTYPE_VOLUME);
mVolumeLODs[detail] = new LLVolume(mVolumeParams, mDetailScales[detail]);
}
mLODRefs[detail]++;
return mVolumeLODs[detail].get();
return mVolumeLODs[detail];
}
BOOL LLVolumeLODGroup::derefLOD(LLVolume *volumep)
{
S32 i;
for (i = 0; i < NUM_LODS; i++)
llassert_always(mRefs > 0);
mRefs--;
for (S32 i = 0; i < NUM_LODS; i++)
{
if (mVolumeLODs[i] == volumep)
{
llassert_always(mLODRefs[i] > 0);
mLODRefs[i]--;
#if 1 // SJB: Possible opt: keep other lods around
if (!mLODRefs[i])
{
mVolumeLODs[i] = NULL;
}
#endif
return TRUE;
}
}
@ -428,7 +396,7 @@ F32 LLVolumeLODGroup::dump()
std::ostream& operator<<(std::ostream& s, const LLVolumeLODGroup& volgroup)
{
s << "{ numRefs=" << volgroup.getNumRefs();
s << ", mParams=" << volgroup.mParams;
s << ", mParams=" << volgroup.getVolumeParams();
s << " }";
return s;

View File

@ -41,8 +41,10 @@
class LLVolumeParams;
class LLVolumeLODGroup;
class LLVolumeLODGroup : public LLThreadSafeRefCount
class LLVolumeLODGroup
{
LOG_CLASS(LLVolumeLODGroup);
public:
enum
{
@ -50,29 +52,26 @@ public:
};
LLVolumeLODGroup(const LLVolumeParams &params);
~LLVolumeLODGroup();
bool cleanupRefs();
BOOL derefLOD(LLVolume *volumep);
static S32 getDetailFromTan(const F32 tan_angle);
static void getDetailProximity(const F32 tan_angle, F32 &to_lower, F32& to_higher);
static F32 getVolumeScaleFromDetail(const S32 detail);
LLVolume *getLOD(const S32 detail);
const LLVolumeParams& getParams() const { return mParams; };
LLVolume* getLODVolume(const S32 detail);
BOOL derefLOD(LLVolume *volumep);
S32 getNumRefs() const { return mRefs; }
const LLVolumeParams* getVolumeParams() const { return &mVolumeParams; };
F32 dump();
friend std::ostream& operator<<(std::ostream& s, const LLVolumeLODGroup& volgroup);
#ifdef DEBUG_VOLUME
S32 getTotalVolumeRefCount() const;
#endif
protected:
virtual ~LLVolumeLODGroup();
void destroy();
protected:
LLVolumeParams mParams;
LLVolumeParams mVolumeParams;
S32 mRefs;
S32 mLODRefs[NUM_LODS];
LLPointer<LLVolume> mVolumeLODs[NUM_LODS];
static F32 mDetailThresholds[NUM_LODS];
@ -82,10 +81,6 @@ protected:
class LLVolumeMgr
{
//public:
// static void initClass();
// static BOOL cleanupClass();
public:
LLVolumeMgr();
virtual ~LLVolumeMgr();
@ -96,36 +91,26 @@ public:
// whatever calls getVolume() never owns the LLVolume* and
// cannot keep references for long since it may be deleted
// later. For best results hold it in an LLPointer<LLVolume>.
LLVolume *getVolume(const LLVolumeParams &volume_params, const S32 detail);
void cleanupVolume(LLVolume *volumep);
LLVolume *refVolume(const LLVolumeParams &volume_params, const S32 detail);
void unrefVolume(LLVolume *volumep);
void dump();
// manually call this for mutex magic
void useMutex();
#ifdef DEBUG_VOLUME
S32 getTotalRefCount() const;
S32 getGroupCount() const;
#endif
friend std::ostream& operator<<(std::ostream& s, const LLVolumeMgr& volume_mgr);
protected:
void insertGroup(LLVolumeLODGroup* volgroup);
// Overridden in llphysics/abstract/utils/llphysicsvolumemanager.h
virtual LLVolumeLODGroup* createNewGroup(const LLVolumeParams& volume_params);
protected:
typedef std::map<const LLVolumeParams*, LLVolumeLODGroup*, LLVolumeParams::compare> volume_lod_group_map_t;
typedef volume_lod_group_map_t::const_iterator volume_lod_group_map_iter;
volume_lod_group_map_t mVolumeLODGroups;
LLMutex* mDataMutex;
// We need to be able to disable threadsafe checks to prevent
// some unit_tests from blocking on failure
bool mThreadSafe;
};
//extern LLVolumeMgr* gVolumeMgr;
#endif // LL_LLVOLUMEMGR_H

View File

@ -32,6 +32,7 @@
#include "linden_common.h"
#include "material_codes.h"
#include "llmemtype.h"
#include "llerror.h"
#include "message.h"
#include "llprimitive.h"
@ -178,7 +179,7 @@ LLPrimitive::~LLPrimitive()
// Cleanup handled by volume manager
if (mVolumep)
{
sVolumeManager->cleanupVolume(mVolumep);
sVolumeManager->unrefVolume(mVolumep);
}
mVolumep = NULL;
}
@ -187,6 +188,7 @@ LLPrimitive::~LLPrimitive()
// static
LLPrimitive *LLPrimitive::createPrimitive(LLPCode p_code)
{
LLMemType m1(LLMemType::MTYPE_PRIMITIVE);
LLPrimitive *retval = new LLPrimitive();
if (retval)
@ -204,6 +206,7 @@ LLPrimitive *LLPrimitive::createPrimitive(LLPCode p_code)
//===============================================================
void LLPrimitive::init_primitive(LLPCode p_code)
{
LLMemType m1(LLMemType::MTYPE_PRIMITIVE);
if (mNumTEs)
{
if (mTextureList)
@ -246,6 +249,7 @@ void LLPrimitive::setNumTEs(const U8 num_tes)
// Right now, we don't try and preserve entries when the number of faces
// changes.
LLMemType m1(LLMemType::MTYPE_PRIMITIVE);
if (num_tes)
{
LLTextureEntry *new_tes;
@ -914,6 +918,7 @@ S32 face_index_from_id(LLFaceID face_ID, const std::vector<LLProfile::Face>& fac
BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume)
{
LLMemType m1(LLMemType::MTYPE_VOLUME);
LLVolume *volumep;
if (unique_volume)
{
@ -935,10 +940,10 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai
}
}
volumep = sVolumeManager->getVolume(volume_params, detail);
volumep = sVolumeManager->refVolume(volume_params, detail);
if (volumep == mVolumep)
{
sVolumeManager->cleanupVolume( volumep ); // LLVolumeMgr::getVolume() creates a reference, but we don't need a second one.
sVolumeManager->unrefVolume( volumep ); // LLVolumeMgr::refVolume() creates a reference, but we don't need a second one.
return TRUE;
}
}
@ -981,7 +986,7 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai
// build the new object
sVolumeManager->cleanupVolume(mVolumep);
sVolumeManager->unrefVolume(mVolumep);
mVolumep = volumep;
U32 new_face_mask = mVolumep->mFaceMask;

View File

@ -128,10 +128,16 @@ S32 LLImageGL::dataFormatComponents(S32 dataformat)
void LLImageGL::bindExternalTexture(LLGLuint gl_name, S32 stage, LLGLenum bind_target )
{
gGL.flush();
glActiveTextureARB(GL_TEXTURE0_ARB + stage);
glClientActiveTextureARB(GL_TEXTURE0_ARB + stage);
if (stage > 0)
{
glActiveTextureARB(GL_TEXTURE0_ARB + stage);
}
glBindTexture(bind_target, gl_name);
sCurrentBoundTextures[stage] = gl_name;
if (stage > 0)
{
glActiveTextureARB(GL_TEXTURE0_ARB);
}
}
// static
@ -141,9 +147,16 @@ void LLImageGL::unbindTexture(S32 stage, LLGLenum bind_target)
if (stage >= 0)
{
gGL.flush();
glActiveTextureARB(GL_TEXTURE0_ARB + stage);
glClientActiveTextureARB(GL_TEXTURE0_ARB + stage);
glBindTexture(bind_target, 0);
if (stage > 0)
{
glActiveTextureARB(GL_TEXTURE0_ARB + stage);
glBindTexture(GL_TEXTURE_2D, 0);
glActiveTextureARB(GL_TEXTURE0_ARB);
}
else
{
glBindTexture(GL_TEXTURE_2D, 0);
}
sCurrentBoundTextures[stage] = 0;
}
}
@ -151,15 +164,7 @@ void LLImageGL::unbindTexture(S32 stage, LLGLenum bind_target)
// static (duplicated for speed and to avoid GL_TEXTURE_2D default argument which requires GL header dependency)
void LLImageGL::unbindTexture(S32 stage)
{
// LLGLSLShader can return -1
if (stage >= 0)
{
gGL.flush();
glActiveTextureARB(GL_TEXTURE0_ARB + stage);
glClientActiveTextureARB(GL_TEXTURE0_ARB + stage);
glBindTexture(GL_TEXTURE_2D, 0);
sCurrentBoundTextures[stage] = 0;
}
unbindTexture(stage, GL_TEXTURE_2D);
}
// static
@ -419,8 +424,6 @@ BOOL LLImageGL::bindTextureInternal(const S32 stage) const
}
glActiveTextureARB(GL_TEXTURE0_ARB + stage);
if (sCurrentBoundTextures[stage] && sCurrentBoundTextures[stage] == mTexName)
{
// already set!
@ -434,10 +437,20 @@ BOOL LLImageGL::bindTextureInternal(const S32 stage) const
#endif
gGL.flush();
if (stage > 0)
{
glActiveTextureARB(GL_TEXTURE0_ARB + stage);
}
glBindTexture(mBindTarget, mTexName);
sCurrentBoundTextures[stage] = mTexName;
sBindCount++;
if (stage > 0)
{
glActiveTextureARB(GL_TEXTURE0_ARB);
}
if (mLastBindTime != sLastFrameTime)
{
// we haven't accounted for this texture yet this frame
@ -451,7 +464,15 @@ BOOL LLImageGL::bindTextureInternal(const S32 stage) const
else
{
gGL.flush();
if (stage > 0)
{
glActiveTextureARB(GL_TEXTURE0_ARB+stage);
}
glBindTexture(mBindTarget, 0);
if (stage > 0)
{
glActiveTextureARB(GL_TEXTURE0_ARB+stage);
}
sCurrentBoundTextures[stage] = 0;
return FALSE;
}
@ -594,18 +615,25 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
S32 w = width, h = height;
const U8* prev_mip_data = 0;
const U8* cur_mip_data = 0;
S32 prev_mip_size = 0;
S32 cur_mip_size = 0;
for (int m=0; m<nummips; m++)
{
if (m==0)
{
cur_mip_data = data_in;
cur_mip_size = width * height * mComponents;
}
else
{
S32 bytes = w * h * mComponents;
llassert(prev_mip_data);
llassert(prev_mip_size == bytes);
U8* new_data = new U8[bytes];
llassert_always(new_data);
LLImageBase::generateMip(prev_mip_data, new_data, w, h, mComponents);
cur_mip_data = new_data;
cur_mip_size = bytes;
}
llassert(w > 0 && h > 0 && cur_mip_data);
{
@ -630,12 +658,14 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
delete[] prev_mip_data;
}
prev_mip_data = cur_mip_data;
prev_mip_size = cur_mip_size;
w >>= 1;
h >>= 1;
}
if (prev_mip_data && prev_mip_data != data_in)
{
delete[] prev_mip_data;
prev_mip_data = NULL;
}
}
}
@ -985,6 +1015,21 @@ BOOL LLImageGL::setDiscardLevel(S32 discard_level)
}
}
BOOL LLImageGL::isValidForSculpt(S32 discard_level, S32 image_width, S32 image_height, S32 ncomponents)
{
assert_glerror();
S32 gl_discard = discard_level - mCurrentDiscardLevel;
LLGLint glwidth = 0;
glGetTexLevelParameteriv(mTarget, gl_discard, GL_TEXTURE_WIDTH, (GLint*)&glwidth);
LLGLint glheight = 0;
glGetTexLevelParameteriv(mTarget, gl_discard, GL_TEXTURE_HEIGHT, (GLint*)&glheight);
LLGLint glcomponents = 0 ;
glGetTexLevelParameteriv(mTarget, gl_discard, GL_TEXTURE_INTERNAL_FORMAT, (GLint*)&glcomponents);
assert_glerror();
return glwidth >= image_width && glheight >= image_height && (GL_RGB8 == glcomponents || GL_RGBA8 == glcomponents) ;
}
BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compressed_ok)
{
if (discard_level < 0)
@ -1022,6 +1067,7 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre
llerrs << llformat("LLImageGL::readBackRaw: bogus params: %d x %d x %d",width,height,ncomponents) << llendl;
}
BOOL return_result = TRUE ;
LLGLint is_compressed = 0;
if (compressed_ok)
{
@ -1033,16 +1079,28 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre
glGetTexLevelParameteriv(mTarget, gl_discard, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, (GLint*)&glbytes);
imageraw->allocateDataSize(width, height, ncomponents, glbytes);
glGetCompressedTexImageARB(mTarget, gl_discard, (GLvoid*)(imageraw->getData()));
if(glGetError() != GL_NO_ERROR)
{
llwarns << "Error happens when reading back the compressed texture image." << llendl ;
imageraw->deleteData() ;
return_result = FALSE ;
}
stop_glerror();
}
else
{
imageraw->allocateDataSize(width, height, ncomponents);
glGetTexImage(GL_TEXTURE_2D, gl_discard, mFormatPrimary, mFormatType, (GLvoid*)(imageraw->getData()));
if(glGetError() != GL_NO_ERROR)
{
llwarns << "Error happens when reading back the texture image." << llendl ;
imageraw->deleteData() ;
return_result = FALSE ;
}
stop_glerror();
}
return TRUE;
return return_result ;
}
void LLImageGL::destroyGLTexture()
@ -1057,7 +1115,6 @@ void LLImageGL::destroyGLTexture()
{
unbindTexture(i, GL_TEXTURE_2D);
stop_glerror();
glActiveTextureARB(GL_TEXTURE0_ARB);
}
}

View File

@ -131,6 +131,8 @@ public:
BOOL getUseDiscard() const { return mUseMipMaps && !mDontDiscard; }
BOOL getDontDiscard() const { return mDontDiscard; }
BOOL isValidForSculpt(S32 discard_level, S32 image_width, S32 image_height, S32 ncomponents) ;
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

View File

@ -71,7 +71,7 @@ public:
//allocate resources for rendering
//must be called before use
//multiple calls will release previously allocated resources
void allocate(U32 resx, U32 resy, U32 color_fmt, BOOL depth, U32 usage = GL_TEXTURE_2D, BOOL use_fbo = TRUE);
void allocate(U32 resx, U32 resy, U32 color_fmt, BOOL depth, U32 usage = GL_TEXTURE_2D, BOOL use_fbo = FALSE);
//allocate a depth texture
void allocateDepth();

View File

@ -38,6 +38,7 @@
#include "llglheaders.h"
#include "llmemory.h"
#include "llmemtype.h"
#include "llglimmediate.h"
//============================================================================
@ -76,6 +77,141 @@ S32 LLVertexBuffer::sTypeOffsets[LLVertexBuffer::TYPE_MAX] =
sizeof(LLVector4), // TYPE_CLOTHWEIGHT,
};
U32 LLVertexBuffer::sGLMode[LLVertexBuffer::NUM_MODES] =
{
GL_TRIANGLES,
GL_TRIANGLE_STRIP,
GL_TRIANGLE_FAN,
GL_POINTS,
GL_LINES,
GL_LINE_STRIP
};
//static
void LLVertexBuffer::setupClientArrays(U32 data_mask)
{
if (LLGLImmediate::sStarted)
{
llerrs << "Cannot use LLGLImmediate and LLVertexBuffer simultaneously!" << llendl;
}
if (sLastMask != data_mask)
{
U32 mask[] =
{
MAP_VERTEX,
MAP_NORMAL,
MAP_TEXCOORD,
MAP_COLOR
};
GLenum array[] =
{
GL_VERTEX_ARRAY,
GL_NORMAL_ARRAY,
GL_TEXTURE_COORD_ARRAY,
GL_COLOR_ARRAY
};
for (U32 i = 0; i < 4; ++i)
{
if (sLastMask & mask[i])
{ //was enabled
if (!(data_mask & mask[i]) && i > 0)
{ //needs to be disabled
glDisableClientState(array[i]);
}
else
{ //needs to be enabled, make sure it was (DEBUG TEMPORARY)
if (i > 0 && !glIsEnabled(array[i]))
{
llerrs << "Bad client state! " << array[i] << " disabled." << llendl;
}
}
}
else
{ //was disabled
if (data_mask & mask[i])
{ //needs to be enabled
glEnableClientState(array[i]);
}
else if (glIsEnabled(array[i]))
{ //needs to be disabled, make sure it was (DEBUG TEMPORARY)
llerrs << "Bad client state! " << array[i] << " enabled." << llendl;
}
}
}
if (sLastMask & MAP_TEXCOORD2)
{
if (!(data_mask & MAP_TEXCOORD2))
{
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
}
}
else if (data_mask & MAP_TEXCOORD2)
{
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
}
sLastMask = data_mask;
}
}
void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indices_offset) const
{
if (start >= (U32) mRequestedNumVerts ||
end >= (U32) mRequestedNumVerts)
{
llerrs << "Bad vertex buffer draw range: [" << start << ", " << end << "]" << llendl;
}
if (indices_offset >= (U32) mRequestedNumIndices ||
indices_offset + count > (U32) mRequestedNumIndices)
{
llerrs << "Bad index buffer draw range: [" << indices_offset << ", " << indices_offset+count << "]" << llendl;
}
if (mGLIndices != sGLRenderIndices)
{
llerrs << "Wrong index buffer bound." << llendl;
}
if (mGLBuffer != sGLRenderBuffer)
{
llerrs << "Wrong vertex buffer bound." << llendl;
}
glDrawRangeElements(sGLMode[mode], start, end, count, GL_UNSIGNED_SHORT,
((U16*) getIndicesPointer()) + indices_offset);
}
void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
{
if (indices_offset >= (U32) mRequestedNumIndices ||
indices_offset + count > (U32) mRequestedNumIndices)
{
llerrs << "Bad index buffer draw range: [" << indices_offset << ", " << indices_offset+count << "]" << llendl;
}
if (mGLIndices != sGLRenderIndices)
{
llerrs << "Wrong index buffer bound." << llendl;
}
if (mGLBuffer != sGLRenderBuffer)
{
llerrs << "Wrong vertex buffer bound." << llendl;
}
glDrawElements(sGLMode[mode], count, GL_UNSIGNED_SHORT,
((U16*) getIndicesPointer()) + indices_offset);
}
//static
void LLVertexBuffer::initClass(bool use_vbo)
{
@ -102,7 +238,8 @@ void LLVertexBuffer::unbind()
sGLRenderBuffer = 0;
sGLRenderIndices = 0;
sLastMask = 0;
setupClientArrays(0);
}
//static
@ -118,22 +255,14 @@ void LLVertexBuffer::cleanupClass()
void LLVertexBuffer::startRender()
{
LLMemType mt(LLMemType::MTYPE_VERTEX_DATA);
if (sEnableVBOs)
{
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
sVBOActive = FALSE;
sIBOActive = FALSE;
}
unbind();
sRenderActive = TRUE;
sGLRenderBuffer = 0;
sGLRenderIndices = 0;
sLastMask = 0;
}
void LLVertexBuffer::stopRender()
{
unbind();
sRenderActive = FALSE;
}
@ -615,6 +744,16 @@ U8* LLVertexBuffer::mapBuffer(S32 access)
llerrs << "Mapped two VBOs at the same time!" << llendl;
}
sMapped = TRUE;*/
if (!mMappedData)
{
llerrs << "glMapBuffer returned NULL (no vertex data)" << llendl;
}
if (!mMappedIndexData)
{
llerrs << "glMapBuffer returned NULL (no index data)" << llendl;
}
sMappedCount++;
}
@ -666,7 +805,12 @@ template <class T,S32 type> struct VertexBufferStrider
strider_t& strider,
S32 index)
{
vbo.mapBuffer();
if (vbo.mapBuffer() == NULL)
{
llwarns << "mapBuffer failed!" << llendl;
return FALSE;
}
if (type == LLVertexBuffer::TYPE_INDEX)
{
S32 stride = sizeof(T);
@ -828,6 +972,8 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
sIBOActive = FALSE;
}
}
setupClientArrays(data_mask);
if (mGLIndices)
{
@ -846,8 +992,6 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
sSetCount++;
}
}
sLastMask = data_mask;
}
// virtual (default)
@ -871,10 +1015,10 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) const
{
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glTexCoordPointer(2,GL_FLOAT, stride, (void*)(base + mOffsets[TYPE_TEXCOORD2]));
glClientActiveTextureARB(GL_TEXTURE0_ARB);
}
if (data_mask & MAP_TEXCOORD)
{
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glTexCoordPointer(2,GL_FLOAT, stride, (void*)(base + mOffsets[TYPE_TEXCOORD]));
}
if (data_mask & MAP_COLOR)

View File

@ -84,6 +84,7 @@ public:
static void initClass(bool use_vbo);
static void cleanupClass();
static void setupClientArrays(U32 data_mask);
static void startRender(); //between start and stop render, no client copies will occur
static void stopRender(); //any buffer not copied to GL will be rendered from client memory
static void clientCopy(F64 max_time = 0.005); //copy data from client to GL
@ -123,6 +124,15 @@ public:
MAP_UNMAPPED = 0x8000 // Indicates that buffer has been logically un-mapped
};
enum {
TRIANGLES = 0,
TRIANGLE_STRIP,
TRIANGLE_FAN,
POINTS,
LINES,
LINE_STRIP,
NUM_MODES
};
protected:
friend class LLGLImmediate;
@ -194,6 +204,9 @@ public:
void markDirty(U32 vert_index, U32 vert_count, U32 indices_index, U32 indices_count);
void draw(U32 mode, U32 count, U32 indices_offset) const;
void drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indices_offset) const;
protected:
S32 mNumVerts; // Number of vertices allocated
S32 mNumIndices; // Number of indices allocated
@ -241,6 +254,7 @@ public:
static BOOL sEnableVBOs;
static S32 sTypeOffsets[TYPE_MAX];
static U32 sGLMode[NUM_MODES];
static U32 sGLRenderBuffer;
static U32 sGLRenderIndices;
static BOOL sVBOActive;

View File

@ -923,6 +923,7 @@ void LLFloater::setFocus( BOOL b )
}
}
// virtual
void LLFloater::setIsChrome(BOOL is_chrome)
{
// chrome floaters don't take focus at all
@ -941,6 +942,12 @@ void LLFloater::setIsChrome(BOOL is_chrome)
LLPanel::setIsChrome(is_chrome);
}
void LLFloater::setTitleVisible(bool visible)
{
if (mDragHandle)
mDragHandle->setTitleVisible(visible);
}
// Change the draw style to account for the foreground state.
void LLFloater::setForeground(BOOL front)
{

View File

@ -146,6 +146,7 @@ public:
const LLString& getTitle() const;
void setShortTitle( const LLString& short_title );
LLString getShortTitle();
void setTitleVisible(bool visible);
virtual void setMinimized(BOOL b);
void moveResizeHandlesToFront();
void addDependentFloater(LLFloater* dependent, BOOL reposition = TRUE);

View File

@ -501,6 +501,13 @@ void LLScrollbar::draw()
}
else
{
// Background
rounded_rect_imagep->drawSolid(mOrientation == HORIZONTAL ? SCROLLBAR_SIZE : 0,
mOrientation == VERTICAL ? SCROLLBAR_SIZE : 0,
mOrientation == HORIZONTAL ? getRect().getWidth() - 2 * SCROLLBAR_SIZE : getRect().getWidth(),
mOrientation == VERTICAL ? getRect().getHeight() - 2 * SCROLLBAR_SIZE : getRect().getHeight(),
mTrackColor);
// Thumb
LLRect outline_rect = mThumbRect;
outline_rect.stretch(2);

View File

@ -430,7 +430,7 @@ void LLScrollableContainerView::draw()
if( mIsOpaque )
{
LLGLSNoTexture no_texture;
glColor4fv( mBackgroundColor.mV );
gGL.color4fv( mBackgroundColor.mV );
gl_rect_2d( mInnerRect );
}

View File

@ -1759,7 +1759,7 @@ void LLScrollListCtrl::draw()
if (mBackgroundVisible)
{
LLGLSNoTexture no_texture;
glColor4fv( getEnabled() ? mBgWriteableColor.mV : mBgReadOnlyColor.mV );
gGL.color4fv( getEnabled() ? mBgWriteableColor.mV : mBgReadOnlyColor.mV );
gl_rect_2d(background);
}

View File

@ -1326,8 +1326,9 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
close();
OSMessageBox(
"Second Life is unable to run because your video card drivers\n"
"are out of date or unsupported. Please make sure you have\n"
"the latest video card drivers installed.\n\n"
"did not install properly, are out of date, or are for unsupported\n"
"hardware. Please make sure you have the latest video card drivers\n"
"and even if you do have the latest, try reinstalling them.\n\n"
"If you continue to receive this message, contact customer service.",
"Error",
OSMB_OK);
@ -1836,6 +1837,10 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
break;
}
case WM_IME_SETCONTEXT:
if (gDebugWindowProc)
{
llinfos << "WM_IME_SETCONTEXT" << llendl;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
l_param &= ~ISC_SHOWUICOMPOSITIONWINDOW;
@ -1844,6 +1849,10 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
break;
case WM_IME_STARTCOMPOSITION:
if (gDebugWindowProc)
{
llinfos << "WM_IME_STARTCOMPOSITION" << llendl;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
window_imp->handleStartCompositionMessage();
@ -1852,6 +1861,10 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
break;
case WM_IME_ENDCOMPOSITION:
if (gDebugWindowProc)
{
llinfos << "WM_IME_ENDCOMPOSITION" << llendl;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
return 0;
@ -1859,6 +1872,10 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
break;
case WM_IME_COMPOSITION:
if (gDebugWindowProc)
{
llinfos << "WM_IME_COMPOSITION" << llendl;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
window_imp->handleCompositionMessage(l_param);
@ -1867,6 +1884,10 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
break;
case WM_IME_REQUEST:
if (gDebugWindowProc)
{
llinfos << "WM_IME_REQUEST" << llendl;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
LRESULT result = 0;

View File

@ -953,7 +953,7 @@ U32 LLControlGroup::saveToFile(const LLString& filename, BOOL nondefault_only)
return num_saved;
}
U32 LLControlGroup::loadFromFile(const LLString& filename, BOOL require_declaration, eControlType declare_as)
U32 LLControlGroup::loadFromFile(const LLString& filename)
{
LLString name;
LLSD settings;
@ -965,24 +965,47 @@ U32 LLControlGroup::loadFromFile(const LLString& filename, BOOL require_declarat
llwarns << "Cannot find file " << filename << " to load." << llendl;
return 0;
}
S32 ret = LLSDSerialize::fromXML(settings, infile);
if (ret <= 0)
{
infile.close();
llwarns << "Unable to open LLSD control file " << filename << ". Trying Legacy Method." << llendl;
return loadFromFileLegacy(filename, require_declaration, declare_as);
return loadFromFileLegacy(filename, TRUE, TYPE_STRING);
}
U32 validitems = 0;
U32 validitems = 0;
int persist = 1;
for(LLSD::map_const_iterator itr = settings.beginMap(); itr != settings.endMap(); ++itr)
{
name = (*itr).first;
control_map = (*itr).second;
if(control_map.has("Persist")) persist = control_map["Persist"].asInteger();
if(control_map.has("Persist"))
{
persist = control_map["Persist"].asInteger();
}
declareControl(name, typeStringToEnum(control_map["Type"].asString()), control_map["Value"], control_map["Comment"].asString(), persist);
// If the control exists just set the value from the input file.
LLControlVariable* existing_control = getControl(name);
if(existing_control)
{
// Check persistence. If not persisted, we shouldn't be loading.
if(existing_control->isPersisted())
{
existing_control->setValue(control_map["Value"]);
}
}
else
{
declareControl(name,
typeStringToEnum(control_map["Type"].asString()),
control_map["Value"],
control_map["Comment"].asString(),
persist
);
}
++validitems;
}

View File

@ -213,7 +213,7 @@ public:
// as the given type.
U32 loadFromFileLegacy(const LLString& filename, BOOL require_declaration = TRUE, eControlType declare_as = TYPE_STRING);
U32 saveToFile(const LLString& filename, BOOL nondefault_only);
U32 loadFromFile(const LLString& filename, BOOL require_declaration = TRUE, eControlType declare_as = TYPE_STRING);
U32 loadFromFile(const LLString& filename);
void resetToDefaults();

View File

@ -5829,7 +5829,7 @@
<key>RenderUseCleverUI</key>
<map>
<key>Comment</key>
<string>Turns on the \"clever\" UI rendering optimization. It's a known performace gain (and enabled by default) on apple.</string>
<string>Turns on the \"clever\" UI rendering optimization. It's a known performace gain on apple.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@ -9825,17 +9825,6 @@
<integer>0</integer>
</array>
</map>
<key>AlertedUnsupportedHardware</key>
<map>
<key>Comment</key>
<string>Toggle that lets us tell the user he's on old hardware only once</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>RenderFastAlpha</key>
<map>
<key>Comment</key>

View File

@ -64,6 +64,7 @@
#include "llurldispatcher.h"
#include "llurlhistory.h"
#include "llfirstuse.h"
#include "llglimmediate.h"
#include "llweb.h"
#include "llsecondlifeurls.h"
@ -416,10 +417,11 @@ static void settings_to_globals()
static void settings_modify()
{
LLRenderTarget::sUseFBO = gSavedSettings.getBOOL("RenderUseFBO");
LLVOAvatar::sUseImpostors = FALSE; //gSavedSettings.getBOOL("RenderUseImpostors");
LLVOAvatar::sUseImpostors = gSavedSettings.getBOOL("RenderUseImpostors");
LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor");
LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //sqaure lod factor to get exponential range of [1,4]
gGL.setClever(gSavedSettings.getBOOL("RenderUseCleverUI"));
#if LL_VECTORIZE
if (gSysCPU.hasAltivec())
{
@ -774,15 +776,6 @@ bool LLAppViewer::init()
return 1;
}
#if LL_DARWIN
// Display the release notes for the current version
if(!gHideLinks && gCurrentVersion != gLastRunVersion)
{
// Current version and last run version don't match exactly. Display the release notes.
DisplayReleaseNotes();
}
#endif
//
// Initialize the window
//
@ -821,51 +814,55 @@ bool LLAppViewer::init()
return 0;
}
// alert the user if they are using unsupported hardware
if(!gSavedSettings.getBOOL("AlertedUnsupportedHardware"))
{
bool unsupported = false;
LLString::format_map_t args;
LLString minSpecs;
bool unsupported = false;
LLString::format_map_t args;
LLString minSpecs;
// get cpu data from xml
std::stringstream minCPUString(LLAlertDialog::getTemplateMessage("UnsupportedCPUAmount"));
S32 minCPU = 0;
minCPUString >> minCPU;
// get cpu data from xml
std::stringstream minCPUString(LLAlertDialog::getTemplateMessage("UnsupportedCPUAmount"));
S32 minCPU = 0;
minCPUString >> minCPU;
// get RAM data from XML
std::stringstream minRAMString(LLAlertDialog::getTemplateMessage("UnsupportedRAMAmount"));
U64 minRAM = 0;
minRAMString >> minRAM;
minRAM = minRAM * 1024 * 1024;
// get RAM data from XML
std::stringstream minRAMString(LLAlertDialog::getTemplateMessage("UnsupportedRAMAmount"));
U64 minRAM = 0;
minRAMString >> minRAM;
minRAM = minRAM * 1024 * 1024;
if(!LLFeatureManager::getInstance()->isGPUSupported())
{
minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedGPU");
minSpecs += "\n";
unsupported = true;
}
if(gSysCPU.getMhz() < minCPU)
{
minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedCPU");
minSpecs += "\n";
unsupported = true;
}
if(gSysMemory.getPhysicalMemoryClamped() < minRAM)
{
minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedRAM");
minSpecs += "\n";
unsupported = true;
}
if(!LLFeatureManager::getInstance()->isGPUSupported() && LLFeatureManager::getInstance()->getGPUClass() != GPU_CLASS_UNKNOWN)
{
minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedGPU");
minSpecs += "\n";
unsupported = true;
}
if(gSysCPU.getMhz() < minCPU)
{
minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedCPU");
minSpecs += "\n";
unsupported = true;
}
if(gSysMemory.getPhysicalMemoryClamped() < minRAM)
{
minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedRAM");
minSpecs += "\n";
unsupported = true;
}
if(unsupported)
if (LLFeatureManager::getInstance()->getGPUClass() == GPU_CLASS_UNKNOWN)
{
gViewerWindow->alertXml("UnknownGPU");
}
if(unsupported)
{
if(!gSavedSettings.controlExists("WarnUnsupportedHardware")
|| gSavedSettings.getBOOL("WarnUnsupportedHardware"))
{
args["MINSPECS"] = minSpecs;
gViewerWindow->alertXml("UnsupportedHardware", args );
// turn off flag
gSavedSettings.setBOOL("AlertedUnsupportedHardware", TRUE);
}
}
// Save the current version to the prefs file
@ -1452,10 +1449,13 @@ void LLAppViewer::loadSettingsFromDirectory(ELLPath path_index)
LLString full_settings_path = gDirUtilp->getExpandedFilename(path_index, settings_file);
if(settings_name == sGlobalSettingsName)
if(settings_name == sGlobalSettingsName
&& path_index == LL_PATH_USER_SETTINGS)
{
// The non-persistent setting, ClientSettingsFile, specifies a
// custom name to use for the global settings file.
// Only apply this setting if this method is setting the 'Global'
// settings from the user_settings path.
std::string custom_path;
if(gSettings[sGlobalSettingsName]->controlExists("ClientSettingsFile"))
{

View File

@ -255,7 +255,6 @@ void LLCone::render(S32 level_of_detail)
// center object at 0
glTranslatef(0.f, 0.f, - height / 2.0f);
LLVertexBuffer::unbind();
drawSide(level_of_detail);
drawBottom(level_of_detail);

View File

@ -1188,10 +1188,11 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>*
LLVector3 center = (mExtents[0] + mExtents[1]) * 0.5f;
LLVector3 size = (mExtents[1]-mExtents[0]) * 0.5f;
if (camera_in.AABBInFrustumNoFarClip(center, size) &&
AABBSphereIntersect(mExtents[0], mExtents[1], camera_in.getOrigin(), camera_in.mFrustumCornerDist))
if (LLPipeline::sImpostorRender ||
(camera_in.AABBInFrustumNoFarClip(center, size) &&
AABBSphereIntersect(mExtents[0], mExtents[1], camera_in.getOrigin(), camera_in.mFrustumCornerDist)))
{
if (LLPipeline::calcPixelArea(center, size, camera_in) < FORCE_INVISIBLE_AREA)
if (!LLPipeline::sImpostorRender && LLPipeline::calcPixelArea(center, size, camera_in) < FORCE_INVISIBLE_AREA)
{
return;
}

View File

@ -115,7 +115,6 @@ LLDrawPool::LLDrawPool(const U32 type)
sNumDrawPools++;
mId = sNumDrawPools;
mVertexShaderLevel = 0;
mIndicesDrawn = 0;
}
LLDrawPool::~LLDrawPool()
@ -136,24 +135,6 @@ void LLDrawPool::beginRenderPass( S32 pass )
//virtual
void LLDrawPool::endRenderPass( S32 pass )
{
glDisableClientState ( GL_TEXTURE_COORD_ARRAY );
glDisableClientState ( GL_COLOR_ARRAY );
glDisableClientState ( GL_NORMAL_ARRAY );
}
U32 LLDrawPool::getTrianglesDrawn() const
{
return mIndicesDrawn / 3;
}
void LLDrawPool::resetTrianglesDrawn()
{
mIndicesDrawn = 0;
}
void LLDrawPool::addIndicesDrawn(const U32 indices)
{
mIndicesDrawn += indices;
}
//=============================
@ -224,7 +205,7 @@ void LLFacePool::drawLoop()
{
if (!mDrawFace.empty())
{
mIndicesDrawn += drawLoop(mDrawFace);
drawLoop(mDrawFace);
}
}
@ -382,10 +363,6 @@ void LLRenderPass::renderTexture(U32 type, U32 mask)
void LLRenderPass::pushBatches(U32 type, U32 mask, BOOL texture)
{
#if !LL_RELEASE_FOR_DOWNLOAD
LLGLState::checkClientArrays(mask);
#endif
for (LLCullResult::drawinfo_list_t::iterator i = gPipeline.beginRenderMap(type); i != gPipeline.endRenderMap(type); ++i)
{
LLDrawInfo* pparams = *i;
@ -436,9 +413,7 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture)
if (params.mVertexBuffer.notNull())
{
params.mVertexBuffer->setBuffer(mask);
U16* indices_pointer = (U16*) params.mVertexBuffer->getIndicesPointer();
glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
GL_UNSIGNED_SHORT, indices_pointer+params.mOffset);
params.mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset);
gPipeline.addTrianglesDrawn(params.mCount/3);
}

View File

@ -90,15 +90,10 @@ public:
virtual BOOL isFacePool() { return FALSE; }
virtual void resetDrawOrders() = 0;
U32 getTrianglesDrawn() const;
void resetTrianglesDrawn();
void addIndicesDrawn(const U32 indices);
protected:
S32 mVertexShaderLevel;
S32 mId;
U32 mType; // Type of draw pool
S32 mIndicesDrawn;
};
class LLRenderPass : public LLDrawPool

View File

@ -77,9 +77,6 @@ void LLDrawPoolAlpha::prerender()
void LLDrawPoolAlpha::beginRenderPass(S32 pass)
{
LLFastTimer t(LLFastTimer::FTM_RENDER_ALPHA);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
if (LLPipeline::sUnderWaterRender)
{
@ -128,8 +125,6 @@ void LLDrawPoolAlpha::render(S32 pass)
{
glUseProgramObjectARB(0);
}
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
glColor4f(1,0,0,1);
LLViewerImage::sSmokeImagep->addTextureStats(1024.f*1024.f);
@ -141,10 +136,6 @@ void LLDrawPoolAlpha::render(S32 pass)
void LLDrawPoolAlpha::renderAlpha(U32 mask)
{
#if !LL_RELEASE_FOR_DOWNLOAD
LLGLState::checkClientArrays(mask);
#endif
for (LLCullResult::sg_list_t::iterator i = gPipeline.beginAlphaGroups(); i != gPipeline.endAlphaGroups(); ++i)
{
LLSpatialGroup* group = *i;
@ -182,9 +173,7 @@ void LLDrawPoolAlpha::renderAlphaHighlight(U32 mask)
LLRenderPass::applyModelMatrix(params);
params.mVertexBuffer->setBuffer(mask);
U16* indices_pointer = (U16*) params.mVertexBuffer->getIndicesPointer();
glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
GL_UNSIGNED_SHORT, indices_pointer+params.mOffset);
params.mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset);
gPipeline.addTrianglesDrawn(params.mCount/3);
}
}
@ -303,9 +292,7 @@ void LLDrawPoolAlpha::renderGroupAlpha(LLSpatialGroup* group, U32 type, U32 mask
}
params.mVertexBuffer->setBuffer(mask);
U16* indices_pointer = (U16*) params.mVertexBuffer->getIndicesPointer();
glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
GL_UNSIGNED_SHORT, indices_pointer+params.mOffset);
params.mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset);
gPipeline.addTrianglesDrawn(params.mCount/3);
if (params.mTextureMatrix && texture && params.mTexture.notNull())

View File

@ -216,13 +216,11 @@ void LLDrawPoolAvatar::beginFootShadow()
}
gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
}
void LLDrawPoolAvatar::endFootShadow()
{
gPipeline.enableLightsDynamic();
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
void LLDrawPoolAvatar::beginRigid()
@ -247,16 +245,11 @@ void LLDrawPoolAvatar::beginRigid()
{
sVertexProgram = NULL;
}
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
}
void LLDrawPoolAvatar::endRigid()
{
sShaderLevel = mVertexShaderLevel;
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
if (sVertexProgram != NULL)
{
sVertexProgram->unbind();
@ -265,9 +258,6 @@ void LLDrawPoolAvatar::endRigid()
void LLDrawPoolAvatar::beginSkinned()
{
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
if (sShaderLevel > 0)
{
if (LLPipeline::sUnderWaterRender)
@ -295,8 +285,7 @@ void LLDrawPoolAvatar::beginSkinned()
if (sShaderLevel > 0) // for hardware blending
{
sRenderingSkinned = TRUE;
glClientActiveTextureARB(GL_TEXTURE1_ARB);
sVertexProgram->bind();
if (sShaderLevel >= SHADER_LEVEL_CLOTH)
{
@ -331,7 +320,6 @@ void LLDrawPoolAvatar::endSkinned()
sRenderingSkinned = FALSE;
sVertexProgram->disableTexture(LLShaderMgr::BUMP_MAP);
glActiveTextureARB(GL_TEXTURE0_ARB);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
disable_vertex_weighting(sVertexProgram->mAttribute[LLShaderMgr::AVATAR_WEIGHT]);
if (sShaderLevel >= SHADER_LEVEL_BUMP)
{
@ -356,10 +344,6 @@ void LLDrawPoolAvatar::endSkinned()
}
glActiveTextureARB(GL_TEXTURE0_ARB);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
@ -438,7 +422,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
}
else if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FOOT_SHADOWS))
{
mIndicesDrawn += avatarp->renderFootShadows();
avatarp->renderFootShadows();
}
return;
}
@ -451,7 +435,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
if (pass == 1)
{
// render rigid meshes (eyeballs) first
mIndicesDrawn += avatarp->renderRigid();
avatarp->renderRigid();
return;
}
@ -548,7 +532,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
color.setColor(1.0f, 1.0f, 1.0f, 1.0f);
}
mIndicesDrawn += avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE);
avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE);
}
}
@ -609,9 +593,6 @@ void LLDrawPoolAvatar::renderForSelect()
return;
}
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
sVertexProgram = &gAvatarPickProgram;
if (sShaderLevel > 0)
{
@ -624,13 +605,12 @@ void LLDrawPoolAvatar::renderForSelect()
if ((sShaderLevel > 0) && !gUseGLPick) // for hardware blending
{
glClientActiveTextureARB(GL_TEXTURE0_ARB);
sRenderingSkinned = TRUE;
sVertexProgram->bind();
enable_vertex_weighting(sVertexProgram->mAttribute[LLShaderMgr::AVATAR_WEIGHT]);
}
mIndicesDrawn += avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE);
avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE);
// if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done
if ((sShaderLevel > 0) && !gUseGLPick)
@ -645,8 +625,6 @@ void LLDrawPoolAvatar::renderForSelect()
// restore texture mode
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
//-----------------------------------------------------------------------------

View File

@ -316,12 +316,8 @@ void LLDrawPoolBump::beginShiny(bool invisible)
mShiny = TRUE;
sVertexMask = VERTEX_MASK_SHINY;
// Second pass: environment map
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
if (!invisible && mVertexShaderLevel > 1)
{
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
sVertexMask = VERTEX_MASK_SHINY | LLVertexBuffer::MAP_TEXCOORD;
}
@ -456,13 +452,7 @@ void LLDrawPoolBump::endShiny(bool invisible)
LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
if (!invisible && mVertexShaderLevel > 1)
{
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
diffuse_channel = -1;
cube_channel = 0;
mShiny = FALSE;
@ -479,10 +469,6 @@ void LLDrawPoolBump::beginFullbrightShiny()
sVertexMask = VERTEX_MASK_SHINY | LLVertexBuffer::MAP_TEXCOORD;
// Second pass: environment map
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
if (LLPipeline::sUnderWaterRender)
{
@ -564,9 +550,6 @@ void LLDrawPoolBump::endFullbrightShiny()
LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
diffuse_channel = -1;
cube_channel = 0;
@ -607,9 +590,7 @@ void LLDrawPoolBump::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL
applyModelMatrix(params);
params.mVertexBuffer->setBuffer(mask);
U16* indices_pointer = (U16*) params.mVertexBuffer->getIndicesPointer();
glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
GL_UNSIGNED_SHORT, indices_pointer+params.mOffset);
params.mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset);
gPipeline.addTrianglesDrawn(params.mCount/3);
}
}
@ -670,8 +651,6 @@ void LLDrawPoolBump::beginBump()
// TEXTURE UNIT 0
// Output.rgb = texture at texture coord 0
glActiveTextureARB(GL_TEXTURE0_ARB);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE);
@ -686,8 +665,6 @@ void LLDrawPoolBump::beginBump()
// TEXTURE UNIT 1
glActiveTextureARB(GL_TEXTURE1_ARB);
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_2D); // Texture unit 1
@ -752,15 +729,11 @@ void LLDrawPoolBump::endBump()
// Disable texture unit 1
glActiveTextureARB(GL_TEXTURE1_ARB);
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D); // Texture unit 1
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
// Disable texture unit 0
glActiveTextureARB(GL_TEXTURE0_ARB);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
gGL.blendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
@ -1091,10 +1064,6 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerImage *src_vi, LLIma
void LLDrawPoolBump::renderBump(U32 type, U32 mask)
{
#if !LL_RELEASE_FOR_DOWNLOAD
LLGLState::checkClientArrays(mask);
#endif
LLCullResult::drawinfo_list_t::iterator begin = gPipeline.beginRenderMap(type);
LLCullResult::drawinfo_list_t::iterator end = gPipeline.endRenderMap(type);
@ -1178,11 +1147,8 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture)
}
params.mVertexBuffer->setBuffer(mask);
U16* indices_pointer = (U16*) params.mVertexBuffer->getIndicesPointer();
glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
GL_UNSIGNED_SHORT, indices_pointer+params.mOffset);
params.mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset);
gPipeline.addTrianglesDrawn(params.mCount/3);
if (params.mTextureMatrix)
{
if (mShiny)

View File

@ -68,9 +68,6 @@ void LLDrawPoolGround::render(S32 pass)
return;
}
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
LLGLSPipelineSkyBox gls_skybox;
LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);

View File

@ -65,13 +65,10 @@ void LLDrawPoolGlow::render(S32 pass)
gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
}
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE);
renderTexture(LLRenderPass::PASS_GLOW, getVertexDataMask());
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE);
gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@ -101,10 +98,6 @@ void LLDrawPoolSimple::prerender()
void LLDrawPoolSimple::beginRenderPass(S32 pass)
{
LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
if (LLPipeline::sUnderWaterRender)
{
@ -136,7 +129,6 @@ void LLDrawPoolSimple::endRenderPass(S32 pass)
{
LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE);
LLRenderPass::endRenderPass(pass);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
if (mVertexShaderLevel > 0){
@ -177,7 +169,6 @@ void LLDrawPoolSimple::render(S32 pass)
}
LLFastTimer t(LLFastTimer::FTM_RENDER_FULLBRIGHT);
U32 fullbright_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD | LLVertexBuffer::MAP_COLOR;
glDisableClientState(GL_NORMAL_ARRAY);
renderTexture(LLRenderPass::PASS_FULLBRIGHT, fullbright_mask);
}

View File

@ -113,10 +113,6 @@ void LLDrawPoolSky::render(S32 pass)
LLVector3 origin = LLViewerCamera::getInstance()->getOrigin();
glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
S32 face_count = (S32)mDrawFace.size();
for (S32 i = 0; i < llmin(6, face_count); ++i)
@ -160,8 +156,6 @@ void LLDrawPoolSky::render(S32 pass)
// renderHeavenlyBody(1, hbfaces[1]);
}
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glPopMatrix();
}
@ -184,8 +178,6 @@ void LLDrawPoolSky::renderSkyCubeFace(U8 side)
glColor4f(1, 1, 1, LLSkyTex::getInterpVal()); // lighting is disabled
face.renderIndexed();
}
mIndicesDrawn += face.getIndicesCount();
}
void LLDrawPoolSky::renderHeavenlyBody(U8 hb, LLFace* face)
@ -198,7 +190,6 @@ void LLDrawPoolSky::renderHeavenlyBody(U8 hb, LLFace* face)
LLColor4 color(mHB[hb]->getInterpColor());
LLOverrideFaceColor override(this, color);
face->renderIndexed();
mIndicesDrawn += face->getIndicesCount();
}
@ -215,7 +206,6 @@ void LLDrawPoolSky::renderSunHalo(LLFace* face)
LLOverrideFaceColor override(this, color);
face->renderIndexed();
mIndicesDrawn += face->getIndicesCount();
}

View File

@ -217,14 +217,6 @@ void LLDrawPoolTerrain::render(S32 pass)
void LLDrawPoolTerrain::renderFullShader()
{
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
if (gPipeline.getLightingDetail() >= 2)
{
glEnableClientState(GL_COLOR_ARRAY);
}
// Hack! Get the region that this draw pool is rendering from!
LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion();
LLVLComposition *compp = regionp->getComposition();
@ -247,10 +239,8 @@ void LLDrawPoolTerrain::renderFullShader()
//
S32 detail0 = sShader->enableTexture(LLShaderMgr::TERRAIN_DETAIL0);
LLViewerImage::bindTexture(detail_texture0p,detail0);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glActiveTextureARB(GL_TEXTURE0_ARB);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
@ -269,9 +259,7 @@ void LLDrawPoolTerrain::renderFullShader()
LLViewerImage::bindTexture(detail_texture1p,detail1);
/// ALPHA TEXTURE COORDS 0:
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
@ -283,9 +271,7 @@ void LLDrawPoolTerrain::renderFullShader()
glEnable(GL_TEXTURE_2D);
/// ALPHA TEXTURE COORDS 1:
glClientActiveTextureARB(GL_TEXTURE2_ARB);
glActiveTextureARB(GL_TEXTURE2_ARB);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glTranslatef(-2.f, 0.f, 0.f);
@ -298,9 +284,7 @@ void LLDrawPoolTerrain::renderFullShader()
LLViewerImage::bindTexture(detail_texture3p,detail3);
/// ALPHA TEXTURE COORDS 2:
glClientActiveTextureARB(GL_TEXTURE3_ARB);
glActiveTextureARB(GL_TEXTURE3_ARB);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glTranslatef(-1.f, 0.f, 0.f);
@ -323,7 +307,6 @@ void LLDrawPoolTerrain::renderFullShader()
sShader->disableTexture(LLShaderMgr::TERRAIN_DETAIL3);
LLImageGL::unbindTexture(alpha_ramp, GL_TEXTURE_2D);
glClientActiveTextureARB(GL_TEXTURE4_ARB);
glActiveTextureARB(GL_TEXTURE4_ARB);
glDisable(GL_TEXTURE_2D); // Texture unit 4
glDisable(GL_TEXTURE_GEN_S);
@ -333,10 +316,8 @@ void LLDrawPoolTerrain::renderFullShader()
glMatrixMode(GL_MODELVIEW);
LLImageGL::unbindTexture(detail3, GL_TEXTURE_2D);
glClientActiveTextureARB(GL_TEXTURE3_ARB);
glActiveTextureARB(GL_TEXTURE3_ARB);
glDisable(GL_TEXTURE_2D);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glMatrixMode(GL_TEXTURE);
@ -344,10 +325,8 @@ void LLDrawPoolTerrain::renderFullShader()
glMatrixMode(GL_MODELVIEW);
LLImageGL::unbindTexture(detail2, GL_TEXTURE_2D);
glClientActiveTextureARB(GL_TEXTURE2_ARB);
glActiveTextureARB(GL_TEXTURE2_ARB);
glDisable(GL_TEXTURE_2D);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glMatrixMode(GL_TEXTURE);
@ -355,10 +334,8 @@ void LLDrawPoolTerrain::renderFullShader()
glMatrixMode(GL_MODELVIEW);
LLImageGL::unbindTexture(detail1, GL_TEXTURE_2D);
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glMatrixMode(GL_TEXTURE);
@ -369,7 +346,6 @@ void LLDrawPoolTerrain::renderFullShader()
// Restore Texture Unit 0 defaults
LLImageGL::unbindTexture(detail0, GL_TEXTURE_2D);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glDisable(GL_TEXTURE_GEN_S);
@ -377,14 +353,11 @@ void LLDrawPoolTerrain::renderFullShader()
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
// Restore non Texture Unit specific defaults
glDisableClientState(GL_NORMAL_ARRAY);
}
void LLDrawPoolTerrain::renderFull4TU()
{
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
// Hack! Get the region that this draw pool is rendering from!
@ -434,9 +407,8 @@ void LLDrawPoolTerrain::renderFull4TU()
//
// Stage 1: Generate alpha ramp for detail0/detail1 transition
//
glActiveTextureARB(GL_TEXTURE1_ARB);
LLViewerImage::bindTexture(m2DAlphaRampImagep,1);
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D); // Texture unit 1
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
@ -454,8 +426,8 @@ void LLDrawPoolTerrain::renderFull4TU()
//
// Stage 2: Interpolate detail1 with existing based on ramp
//
glActiveTextureARB(GL_TEXTURE2_ARB);
LLViewerImage::bindTexture(detail_texture1p,2);
glActiveTextureARB(GL_TEXTURE2_ARB);
glEnable(GL_TEXTURE_2D); // Texture unit 2
glClientActiveTextureARB(GL_TEXTURE2_ARB);
@ -480,8 +452,8 @@ void LLDrawPoolTerrain::renderFull4TU()
//
// Stage 3: Modulate with primary (vertex) color for lighting
//
glActiveTextureARB(GL_TEXTURE3_ARB);
LLViewerImage::bindTexture(detail_texture1p,3); // bind any texture
glActiveTextureARB(GL_TEXTURE3_ARB);
glEnable(GL_TEXTURE_2D); // Texture unit 3
glClientActiveTextureARB(GL_TEXTURE3_ARB);
@ -494,6 +466,7 @@ void LLDrawPoolTerrain::renderFull4TU()
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_PRIMARY_COLOR_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_ARB, GL_SRC_COLOR);
glActiveTextureARB(GL_TEXTURE0_ARB);
// GL_BLEND disabled by default
drawLoop();
@ -524,9 +497,8 @@ void LLDrawPoolTerrain::renderFull4TU()
//
// Stage 1: Generate alpha ramp for detail2/detail3 transition
//
glActiveTextureARB(GL_TEXTURE1_ARB);
LLViewerImage::bindTexture(m2DAlphaRampImagep,1);
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D); // Texture unit 1
glClientActiveTextureARB(GL_TEXTURE1_ARB);
@ -551,8 +523,8 @@ void LLDrawPoolTerrain::renderFull4TU()
//
// Stage 2: Interpolate detail2 with existing based on ramp
//
glActiveTextureARB(GL_TEXTURE2_ARB);
LLViewerImage::bindTexture(detail_texture2p,2);
glActiveTextureARB(GL_TEXTURE2_ARB);
glEnable(GL_TEXTURE_2D); // Texture unit 2
glClientActiveTextureARB(GL_TEXTURE2_ARB);
@ -578,9 +550,9 @@ void LLDrawPoolTerrain::renderFull4TU()
//
// Stage 3: Generate alpha ramp for detail1/detail2 transition
//
glActiveTextureARB(GL_TEXTURE3_ARB);
LLViewerImage::bindTexture(m2DAlphaRampImagep,3);
glActiveTextureARB(GL_TEXTURE3_ARB);
glEnable(GL_TEXTURE_2D); // Texture unit 3
glClientActiveTextureARB(GL_TEXTURE3_ARB);
@ -603,7 +575,7 @@ void LLDrawPoolTerrain::renderFull4TU()
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_TEXTURE);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);
glActiveTextureARB(GL_TEXTURE0_ARB);
{
LLGLEnable blend(GL_BLEND);
drawLoop();
@ -611,6 +583,7 @@ void LLDrawPoolTerrain::renderFull4TU()
// Disable multitexture
LLImageGL::unbindTexture(3, GL_TEXTURE_2D);
glActiveTextureARB(GL_TEXTURE3_ARB);
glClientActiveTextureARB(GL_TEXTURE3_ARB);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_TEXTURE_2D); // Texture unit 3
@ -619,6 +592,7 @@ void LLDrawPoolTerrain::renderFull4TU()
glMatrixMode(GL_MODELVIEW);
LLImageGL::unbindTexture(2, GL_TEXTURE_2D);
glActiveTextureARB(GL_TEXTURE2_ARB);
glClientActiveTextureARB(GL_TEXTURE2_ARB);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_TEXTURE_2D); // Texture unit 2
@ -629,6 +603,7 @@ void LLDrawPoolTerrain::renderFull4TU()
glMatrixMode(GL_MODELVIEW);
LLImageGL::unbindTexture(1, GL_TEXTURE_2D);
glActiveTextureARB(GL_TEXTURE1_ARB);
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_TEXTURE_2D); // Texture unit 1
@ -642,6 +617,7 @@ void LLDrawPoolTerrain::renderFull4TU()
//----------------------------------------------------------------------------
// Restore Texture Unit 0 defaults
glActiveTextureARB(GL_TEXTURE0_ARB);
LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glActiveTextureARB(GL_TEXTURE0_ARB);
@ -658,9 +634,6 @@ void LLDrawPoolTerrain::renderFull4TU()
void LLDrawPoolTerrain::renderFull2TU()
{
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
// Hack! Get the region that this draw pool is rendering from!
LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion();
LLVLComposition *compp = regionp->getComposition();
@ -687,9 +660,6 @@ void LLDrawPoolTerrain::renderFull2TU()
// Stage 0: Render detail 0 into base
//
LLViewerImage::bindTexture(detail_texture0p,0);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
@ -715,12 +685,10 @@ void LLDrawPoolTerrain::renderFull2TU()
// Stage 0: Generate alpha ramp for detail0/detail1 transition
//
LLViewerImage::bindTexture(m2DAlphaRampImagep,0);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
// Care about alpha only
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE);
@ -736,10 +704,8 @@ void LLDrawPoolTerrain::renderFull2TU()
// Stage 1: Write detail1
//
LLViewerImage::bindTexture(detail_texture1p,1); // Texture unit 1
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D); // Texture unit 1
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
@ -758,6 +724,7 @@ void LLDrawPoolTerrain::renderFull2TU()
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PREVIOUS);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);
glActiveTextureARB(GL_TEXTURE0_ARB);
{
LLGLEnable blend(GL_BLEND);
drawLoop();
@ -769,14 +736,11 @@ void LLDrawPoolTerrain::renderFull2TU()
// Stage 0: Generate alpha ramp for detail1/detail2 transition
//
LLViewerImage::bindTexture(m2DAlphaRampImagep,0);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
// Set the texture matrix
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glTranslatef(-1.f, 0.f, 0.f);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
// Care about alpha only
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE);
@ -793,9 +757,7 @@ void LLDrawPoolTerrain::renderFull2TU()
LLViewerImage::bindTexture(detail_texture2p,1);
glEnable(GL_TEXTURE_2D); // Texture unit 1
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
@ -826,14 +788,11 @@ void LLDrawPoolTerrain::renderFull2TU()
// Stage 0: Generate alpha ramp for detail2/detail3 transition
//
LLViewerImage::bindTexture(m2DAlphaRampImagep,0);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
// Set the texture matrix
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glTranslatef(-2.f, 0.f, 0.f);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
// Care about alpha only
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE);
@ -847,10 +806,8 @@ void LLDrawPoolTerrain::renderFull2TU()
// Stage 1: Write detail3
LLViewerImage::bindTexture(detail_texture3p,1);
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D); // Texture unit 1
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
@ -869,6 +826,7 @@ void LLDrawPoolTerrain::renderFull2TU()
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PREVIOUS);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);
glActiveTextureARB(GL_TEXTURE0_ARB);
{
LLGLEnable blend(GL_BLEND);
drawLoop();
@ -879,8 +837,7 @@ void LLDrawPoolTerrain::renderFull2TU()
// Disable multitexture
LLImageGL::unbindTexture(1, GL_TEXTURE_2D);
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D); // Texture unit 1
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
@ -891,9 +848,9 @@ void LLDrawPoolTerrain::renderFull2TU()
//----------------------------------------------------------------------------
// Restore Texture Unit 0 defaults
glActiveTextureARB(GL_TEXTURE0_ARB);
LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glActiveTextureARB(GL_TEXTURE0_ARB);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
@ -902,16 +859,12 @@ void LLDrawPoolTerrain::renderFull2TU()
glMatrixMode(GL_MODELVIEW);
// Restore non Texture Unit specific defaults
glDisableClientState(GL_NORMAL_ARRAY);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
}
void LLDrawPoolTerrain::renderSimple()
{
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
LLVector4 tp0, tp1;
//----------------------------------------------------------------------------
@ -923,14 +876,12 @@ void LLDrawPoolTerrain::renderSimple()
glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D); // Texture unit 2
glClientActiveTextureARB(GL_TEXTURE0_ARB);
LLVector3 origin_agent = mDrawFace[0]->getDrawable()->getVObj()->getRegion()->getOriginAgent();
F32 tscale = 1.f/256.f;
tp0.setVec(tscale, 0.f, 0.0f, -1.f*(origin_agent.mV[0]/256.f));
tp1.setVec(0.f, tscale, 0.0f, -1.f*(origin_agent.mV[1]/256.f));
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
@ -952,7 +903,6 @@ void LLDrawPoolTerrain::renderSimple()
// Restore Texture Unit 0 defaults
LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glActiveTextureARB(GL_TEXTURE0_ARB);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
@ -961,7 +911,6 @@ void LLDrawPoolTerrain::renderSimple()
glMatrixMode(GL_MODELVIEW);
// Restore non Texture Unit specific defaults
glDisableClientState(GL_NORMAL_ARRAY);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
}
@ -986,14 +935,8 @@ void LLDrawPoolTerrain::renderOwnership()
LLViewerParcelOverlay *overlayp = regionp->getParcelOverlay();
LLImageGL *texturep = overlayp->getTexture();
glEnableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
LLViewerImage::bindTexture(texturep);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
// *NOTE: Because the region is 256 meters wide, but has 257 pixels, the
// texture coordinates for pixel 256x256 is not 1,1. This makes the
// ownership map not line up with the selection. We address this with
@ -1014,9 +957,6 @@ void LLDrawPoolTerrain::renderOwnership()
glMatrixMode(GL_TEXTURE);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
// Restore non Texture Unit specific defaults
glDisableClientState(GL_NORMAL_ARRAY);
}

View File

@ -67,9 +67,6 @@ void LLDrawPoolTree::prerender()
void LLDrawPoolTree::beginRenderPass(S32 pass)
{
LLFastTimer t(LLFastTimer::FTM_RENDER_TREES);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glAlphaFunc(GL_GREATER, 0.5f);
if (LLPipeline::sUnderWaterRender)
@ -110,9 +107,7 @@ void LLDrawPoolTree::endRenderPass(S32 pass)
{
LLFastTimer t(LLFastTimer::FTM_RENDER_TREES);
glAlphaFunc(GL_GREATER, 0.01f);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
if (gPipeline.canUseWindLightShadersOnObjects())
{
shader->unbind();
@ -126,9 +121,6 @@ void LLDrawPoolTree::renderForSelect()
return;
}
glEnableClientState (GL_VERTEX_ARRAY);
glEnableClientState (GL_TEXTURE_COORD_ARRAY);
LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f);
LLGLSObjectSelectAlpha gls_alpha;
@ -155,7 +147,6 @@ void LLDrawPoolTree::renderForSelect()
gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glDisableClientState (GL_TEXTURE_COORD_ARRAY);
}
void LLDrawPoolTree::renderTree(BOOL selecting)
@ -278,8 +269,6 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
//glPopMatrix();
}
}
addIndicesDrawn(indices_drawn);
}
BOOL LLDrawPoolTree::verify() const

View File

@ -163,17 +163,11 @@ void LLDrawPoolWater::render(S32 pass)
LLGLDisable cullFace(GL_CULL_FACE);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
// Set up second pass first
glActiveTextureARB(GL_TEXTURE1_ARB);
mWaterImagep->addTextureStats(1024.f*1024.f);
mWaterImagep->bind(1);
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D); // Texture unit 1
LLVector3 camera_up = LLViewerCamera::getInstance()->getUpAxis();
@ -215,7 +209,6 @@ void LLDrawPoolWater::render(S32 pass)
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PREVIOUS_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glActiveTextureARB(GL_TEXTURE0_ARB);
glClearStencil(1);
@ -234,11 +227,9 @@ void LLDrawPoolWater::render(S32 pass)
}
face->bindTexture();
face->renderIndexed();
mIndicesDrawn += face->getIndicesCount();
}
// Now, disable texture coord generation on texture state 1
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D); // Texture unit 1
glDisable(GL_TEXTURE_GEN_S); //texture unit 1
@ -246,11 +237,9 @@ void LLDrawPoolWater::render(S32 pass)
LLImageGL::unbindTexture(1, GL_TEXTURE_2D);
// Disable texture coordinate and color arrays
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glActiveTextureARB(GL_TEXTURE0_ARB);
LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
stop_glerror();
if (gSky.mVOSkyp->getCubeMap())
@ -284,7 +273,6 @@ void LLDrawPoolWater::render(S32 pass)
if (face->getGeomCount() > 0)
{
face->renderIndexed();
mIndicesDrawn += face->getIndicesCount();
}
}
@ -310,9 +298,6 @@ void LLDrawPoolWater::render(S32 pass)
renderReflection(refl_face);
}
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
}
@ -338,16 +323,10 @@ void LLDrawPoolWater::renderReflection(LLFace* face)
LLGLSNoFog noFog;
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
LLViewerImage::bindTexture(mHBTex[dr]);
LLOverrideFaceColor override(this, face->getFaceColor().mV);
face->renderIndexed();
mIndicesDrawn += face->getIndicesCount();
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
void LLDrawPoolWater::shade()
@ -361,10 +340,6 @@ void LLDrawPoolWater::shade()
return;
}
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
LLGLDisable blend(GL_BLEND);
LLColor3 light_diffuse(0,0,0);
@ -562,8 +537,6 @@ void LLDrawPoolWater::shade()
face->renderIndexed();
}
}
mIndicesDrawn += face->getIndicesCount();
}
}
@ -576,8 +549,6 @@ void LLDrawPoolWater::shade()
shader->unbind();
glActiveTextureARB(GL_TEXTURE0_ARB);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_2D);
glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_FALSE);

View File

@ -159,9 +159,7 @@ void LLDrawPoolWLSky::renderStars(void) const
// combiners blending below requires something to be bound
// and we might as well only bind once.
//LLGLEnable gl_texture_2d(GL_TEXTURE_2D);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
gPipeline.disableLights();
if (!LLPipeline::sReflectionRender)
@ -224,9 +222,6 @@ void LLDrawPoolWLSky::renderSkyClouds(F32 camHeightLocal) const
void LLDrawPoolWLSky::renderHeavenlyBodies()
{
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
LLGLSPipelineSkyBox gls_skybox;
LLGLEnable blend_on(GL_BLEND);
gPipeline.disableLights();
@ -240,7 +235,6 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
LLColor4 color(gSky.mVOSkyp->getSun().getInterpColor());
LLFacePool::LLOverrideFaceColor color_override(this, color);
face->renderIndexed();
mIndicesDrawn += face->getIndicesCount();
}
#endif
@ -264,10 +258,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
LLFacePool::LLOverrideFaceColor color_override(this, color);
face->renderIndexed();
mIndicesDrawn += face->getIndicesCount();
}
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
void LLDrawPoolWLSky::render(S32 pass)

View File

@ -223,17 +223,15 @@ BOOL LLDynamicTexture::updateAllInstances()
glClear(GL_DEPTH_BUFFER_BIT);
gDisplaySwapBuffers = FALSE;
LLVertexBuffer::startRender();
gGL.start();
dynamicTexture->preRender(); // Must be called outside of startRender()
LLVertexBuffer::startRender();
if (dynamicTexture->render())
{
result = TRUE;
sNumRenders++;
}
gGL.stop();
LLVertexBuffer::stopRender();
dynamicTexture->postRender(result);

View File

@ -263,8 +263,14 @@ void LLFace::setDrawable(LLDrawable *drawable)
void LLFace::setSize(const S32 num_vertices, const S32 num_indices)
{
mGeomCount = num_vertices;
mIndicesCount = num_indices;
if (mGeomCount != num_vertices ||
mIndicesCount != num_indices)
{
mGeomCount = num_vertices;
mIndicesCount = num_indices;
mVertexBuffer = NULL;
mLastVertexBuffer = NULL;
}
}
//============================================================================
@ -368,8 +374,6 @@ void LLFace::renderForSelect(U32 data_mask)
#if !LL_RELEASE_FOR_DOWNLOAD
LLGLState::checkClientArrays(data_mask);
#endif
U16* indicesp = (U16*) mVertexBuffer->getIndicesPointer() + mIndicesIndex;
if (gPickFaces && mTEOffset != -1)
{
// mask off high 4 bits (16 total possible faces)
@ -386,40 +390,26 @@ void LLFace::renderForSelect(U32 data_mask)
{
glPushMatrix();
glMultMatrixf((float*) mDrawablep->getRegion()->mRenderMatrix.mMatrix);
glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_SHORT, indicesp);
mVertexBuffer->draw(LLVertexBuffer::TRIANGLES, mIndicesCount, mIndicesIndex);
glPopMatrix();
}
else
{
glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_SHORT, indicesp);
mVertexBuffer->draw(LLVertexBuffer::TRIANGLES, mIndicesCount, mIndicesIndex);
}
}
else
{
glPushMatrix();
glMultMatrixf((float*)getRenderMatrix().mMatrix);
glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_SHORT, indicesp);
glPopMatrix();
}
}
else if (mGeomCount > 0)
{
if (isState(GLOBAL))
{
glDrawArrays(GL_TRIANGLES, mGeomIndex, mGeomCount);
}
else
{
glPushMatrix();
glMultMatrixf((float*)getRenderMatrix().mMatrix);
glDrawArrays(GL_TRIANGLES, mGeomIndex, mGeomCount);
mVertexBuffer->draw(LLVertexBuffer::TRIANGLES, mIndicesCount, mIndicesIndex);
glPopMatrix();
}
}
}
}
void LLFace::renderSelected(LLImageGL *imagep, const LLColor4& color, const S32 offset, const S32 count)
void LLFace::renderSelected(LLImageGL *imagep, const LLColor4& color)
{
if(mDrawablep.isNull() || mVertexBuffer.isNull())
{
@ -443,27 +433,12 @@ void LLFace::renderSelected(LLImageGL *imagep, const LLColor4& color, const S32
glMultMatrixf((GLfloat*)mDrawablep->getRegion()->mRenderMatrix.mMatrix);
}
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD);
#if !LL_RELEASE_FOR_DOWNLOAD
LLGLState::checkClientArrays(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD);
#endif
U16* indicesp = ((U16*) mVertexBuffer->getIndicesPointer()) + mIndicesIndex;
if (count)
{
glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, indicesp + offset);
}
else
{
glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_SHORT, indicesp);
}
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
mVertexBuffer->draw(LLVertexBuffer::TRIANGLES, mIndicesCount, mIndicesIndex);
glPopMatrix();
}
}
@ -542,8 +517,6 @@ void LLFace::renderSelectedUV(const S32 offset, const S32 count)
}
else
{
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
llassert(mGeomIndex >= 0);
if (count)
{
@ -568,7 +541,6 @@ void LLFace::renderSelectedUV(const S32 offset, const S32 count)
glDrawArrays(GL_TRIANGLES, mGeomIndex, mGeomCount);
}
}
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
glDisable(GL_POLYGON_OFFSET_FILL);
@ -1251,16 +1223,7 @@ S32 LLFace::pushVertices(const U16* index_array) const
{
if (mIndicesCount)
{
if (mGeomCount <= gGLManager.mGLMaxVertexRange &&
mIndicesCount <= (U32) gGLManager.mGLMaxIndexRange)
{
glDrawRangeElements(GL_TRIANGLES, mGeomIndex, mGeomIndex + mGeomCount-1, mIndicesCount,
GL_UNSIGNED_SHORT, index_array + mIndicesIndex);
}
else
{
glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_SHORT, index_array+mIndicesIndex);
}
mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, mGeomIndex, mGeomIndex+mGeomCount-1, mIndicesCount, mIndicesIndex);
gPipeline.addTrianglesDrawn(mIndicesCount/3);
}

View File

@ -167,7 +167,7 @@ public:
void renderSelectedUV(const S32 offset = 0, const S32 count = 0);
void renderForSelect(U32 data_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD);
void renderSelected(LLImageGL *image, const LLColor4 &color, const S32 offset = 0, const S32 count = 0);
void renderSelected(LLImageGL *image, const LLColor4 &color);
F32 getKey() const { return mDistance; }

View File

@ -195,7 +195,7 @@ void LLVolumeImplFlexible::remapSections(LLFlexibleObjectSection *source, S32 so
//-----------------------------------------------------------------------------
void LLVolumeImplFlexible::setAttributesOfAllSections()
void LLVolumeImplFlexible::setAttributesOfAllSections(LLVector3* inScale)
{
LLVector2 bottom_scale, top_scale;
F32 begin_rot = 0, end_rot = 0;
@ -215,8 +215,16 @@ void LLVolumeImplFlexible::setAttributesOfAllSections()
S32 num_sections = 1 << mSimulateRes;
LLVector3 scale = mVO->mDrawable->getScale();
LLVector3 scale;
if (inScale == (LLVector3*)NULL)
{
scale = mVO->mDrawable->getScale();
}
else
{
scale = *inScale;
}
mSection[0].mPosition = getAnchorPosition();
mSection[0].mDirection = LLVector3::z_axis * getFrameRotation();
mSection[0].mdPosition = mSection[0].mDirection;
@ -297,7 +305,7 @@ BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F6
new_res = mRenderRes;
}
if (!mInitialized || (mSimulateRes != new_res))
if (!mInitialized)
{
mSimulateRes = new_res;
setAttributesOfAllSections();
@ -644,7 +652,7 @@ void LLVolumeImplFlexible::doFlexibleRebuild()
void LLVolumeImplFlexible::onSetScale(const LLVector3& scale, BOOL damped)
{
setAttributesOfAllSections();
setAttributesOfAllSections((LLVector3*) &scale);
}
BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable)

View File

@ -138,7 +138,7 @@ class LLVolumeImplFlexible : public LLVolumeInterface
//--------------------------------------
// private methods
//--------------------------------------
void setAttributesOfAllSections ();
void setAttributesOfAllSections (LLVector3* inScale = NULL);
void remapSections(LLFlexibleObjectSection *source, S32 source_sections,
LLFlexibleObjectSection *dest, S32 dest_sections);

View File

@ -293,7 +293,6 @@ BOOL LLFloaterAnimPreview::postBuild()
mAnimPreview = NULL;
mMotionID.setNull();
childSetValue("bad_animation_text", getString("failed_to_initialize"));
setEnabled(FALSE);
}
}
else
@ -1039,6 +1038,8 @@ BOOL LLPreviewAnimation::render()
{
mNeedsUpdate = FALSE;
LLVOAvatar* avatarp = mDummyAvatar;
gGL.start();
glMatrixMode(GL_PROJECTION);
gGL.pushMatrix();
@ -1109,7 +1110,6 @@ BOOL LLPreviewAnimation::render()
avatarPoolp->renderAvatars(avatarp); // renders only one avatar
}
gGL.start();
return TRUE;
}

View File

@ -53,6 +53,7 @@
#include "llviewerdisplay.h"
#include "llviewercontrol.h"
#include "llui.h"
#include "llglimmediate.h"
///----------------------------------------------------------------------------
/// Local function declarations, constants, enums, and typedefs
@ -153,7 +154,7 @@ void LLFloaterAuction::draw()
}
{
LLGLSUIDefault gls_ui;
glColor3f(1.f, 1.f, 1.f);
gGL.color3f(1.f, 1.f, 1.f);
gl_draw_scaled_image(rect.mLeft,
rect.mBottom,
rect.getWidth(),

View File

@ -29,16 +29,20 @@ LLFloaterHUD::LLFloaterHUD()
: LLFloater("floater_hud"),
mWebBrowser(0)
{
// Create floater from its XML definition
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_hud.xml");
// Don't grab the focus as it will impede performing in-world actions
// while using the HUD
setAutoFocus(FALSE);
setIsChrome(TRUE);
// Chrome doesn't show the window title by default, but here we
// want to show it.
setTitleVisible(true);
// Opaque background since we never get the focus
setBackgroundOpaque(TRUE);
// Create floater from its XML definition
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_hud.xml");
// Position floater based on saved location
LLRect saved_position_rect = gSavedSettings.getRect("FloaterHUDRect");
reshape(saved_position_rect.getWidth(), saved_position_rect.getHeight(), FALSE);
@ -47,12 +51,14 @@ LLFloaterHUD::LLFloaterHUD()
mWebBrowser = getChild<LLWebBrowserCtrl>("floater_hud_browser" );
if (mWebBrowser)
{
// Always refresh the browser
mWebBrowser->setAlwaysRefresh(true);
// Open links in internal browser
mWebBrowser->setOpenInExternalBrowser(false);
// This is a "chrome" floater, so we don't want anything to
// take focus (as the user needs to be able to walk with
// arrow keys during tutorial).
mWebBrowser->setTakeFocusOnClick(false);
LLString language(gSavedSettings.getString("Language"));
if(language == "default")
{
@ -110,9 +116,3 @@ void LLFloaterHUD::close()
{
if (sInstance) sInstance->close();
}
void LLFloaterHUD::onFocusReceived()
{
// Never get the focus
setFocus(FALSE);
}

View File

@ -36,7 +36,7 @@ protected:
LLWebBrowserCtrl* mWebBrowser; ///< the actual web browser control
LLFloaterHUD(); ///< default constructor
virtual void onFocusReceived(); ///< called when we get the focus
private:
static LLFloaterHUD* sInstance;
};

View File

@ -667,6 +667,8 @@ void LLImagePreviewAvatar::setPreviewTarget(const char* joint_name, const char*
//-----------------------------------------------------------------------------
BOOL LLImagePreviewAvatar::render()
{
gGL.start();
mNeedsUpdate = FALSE;
LLVOAvatar* avatarp = mDummyAvatar;
@ -723,8 +725,6 @@ BOOL LLImagePreviewAvatar::render()
avatarPoolp->renderAvatars(avatarp); // renders only one avatar
}
gGL.start();
return TRUE;
}
@ -823,6 +823,8 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance)
//-----------------------------------------------------------------------------
BOOL LLImagePreviewSculpted::render()
{
gGL.start();
mNeedsUpdate = FALSE;
LLGLSUIDefault def;
@ -917,6 +919,8 @@ BOOL LLImagePreviewSculpted::render()
delete [] normals;
}
gGL.stop();
return TRUE;
}

View File

@ -1006,17 +1006,17 @@ void LLViewerObjectList::renderObjectBeacons()
return;
}
S32 i;
//const LLFontGL *font = LLResMgr::getInstance()->getRes(LLFONT_SANSSERIF);
LLGLSUIDefault gls_ui;
S32 last_line_width = -1;
{
LLGLSNoTexture gls_ui_no_texture;
gGL.begin(GL_LINES);
for (i = 0; i < mDebugBeacons.count(); i++)
S32 last_line_width = -1;
// gGL.begin(GL_LINES); // Always happens in (line_width != last_line_width)
for (S32 i = 0; i < mDebugBeacons.count(); i++)
{
const LLDebugBeacon &debug_beacon = mDebugBeacons[i];
LLColor4 color = debug_beacon.mColor;
@ -1024,8 +1024,11 @@ void LLViewerObjectList::renderObjectBeacons()
S32 line_width = debug_beacon.mLineWidth;
if (line_width != last_line_width)
{
gGL.end();
gGL.flush();
if (i > 0)
{
gGL.end();
gGL.flush();
}
glLineWidth( (F32)line_width );
last_line_width = line_width;
gGL.begin(GL_LINES);
@ -1049,17 +1052,21 @@ void LLViewerObjectList::renderObjectBeacons()
LLGLSNoTexture gls_ui_no_texture;
LLGLDepthTest gls_depth(GL_TRUE);
gGL.begin(GL_LINES);
last_line_width = -1;
for (i = 0; i < mDebugBeacons.count(); i++)
S32 last_line_width = -1;
// gGL.begin(GL_LINES); // Always happens in (line_width != last_line_width)
for (S32 i = 0; i < mDebugBeacons.count(); i++)
{
const LLDebugBeacon &debug_beacon = mDebugBeacons[i];
S32 line_width = debug_beacon.mLineWidth;
if (line_width != last_line_width)
{
gGL.end();
gGL.flush();
if (i > 0)
{
gGL.end();
gGL.flush();
}
glLineWidth( (F32)line_width );
last_line_width = line_width;
gGL.begin(GL_LINES);
@ -1076,12 +1083,12 @@ void LLViewerObjectList::renderObjectBeacons()
draw_line_cube(0.10f, thisline);
}
gGL.end();
gGL.flush();
glLineWidth(1.f);
for (i = 0; i < mDebugBeacons.count(); i++)
for (S32 i = 0; i < mDebugBeacons.count(); i++)
{
LLDebugBeacon &debug_beacon = mDebugBeacons[i];
if (debug_beacon.mString == "")

View File

@ -1061,7 +1061,7 @@ LLFloaterIMPanel::LLFloaterIMPanel(
mSessionUUID(session_id),
mVoiceChannel(NULL),
mSessionInitialized(FALSE),
mSessionStartMsgPos(0),
mOtherParticipantUUID(other_participant_id),
mDialog(dialog),
mTyping(FALSE),
@ -1090,6 +1090,7 @@ LLFloaterIMPanel::LLFloaterIMPanel(
mSessionUUID(session_id),
mVoiceChannel(NULL),
mSessionInitialized(FALSE),
mSessionStartMsgPos(0),
mOtherParticipantUUID(other_participant_id),
mDialog(dialog),
mTyping(FALSE),
@ -1182,6 +1183,7 @@ void LLFloaterIMPanel::init(const LLString& session_label)
//we don't need to need to wait for any responses
//so we're already initialized
mSessionInitialized = TRUE;
mSessionStartMsgPos = 0;
}
else
{

View File

@ -121,6 +121,8 @@ static const struct mtv_display_info mtv_display_table[] =
{ LLMemType::MTYPE_VERTEX_DATA, "Vertex Buffer", &LLColor4::blue3 },
{ LLMemType::MTYPE_AVATAR, "Avatar", &LLColor4::purple1 },
{ LLMemType::MTYPE_REGIONS, "Regions", &LLColor4::blue1 },
{ LLMemType::MTYPE_VOLUME, "Volume", &LLColor4::pink1 },
{ LLMemType::MTYPE_PRIMITIVE, "Profile", &LLColor4::pink2 },
{ LLMemType::MTYPE_TEMP1, "Temp1", &LLColor4::red1 },
{ LLMemType::MTYPE_TEMP2, "Temp2", &LLColor4::magenta1 },
{ LLMemType::MTYPE_TEMP3, "Temp3", &LLColor4::red2 },

View File

@ -951,6 +951,7 @@ void LLPanelLogin::loadLoginPage()
{
LLAppViewer::instance()->resetURIs();
gGridChoice = (EGridInfo)grid_index;
gSavedSettings.setString("GridChoice", gGridInfo[gGridChoice].mLabel);
gViewerWindow->setMenuBackgroundColor(false,
!LLAppViewer::instance()->isInProductionGrid());
gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor());

View File

@ -1906,9 +1906,8 @@ void pushVerts(LLDrawInfo* params, U32 mask)
{
LLRenderPass::applyModelMatrix(*params);
params->mVertexBuffer->setBuffer(mask);
U16* indicesp = (U16*) params->mVertexBuffer->getIndicesPointer();
glDrawRangeElements(params->mParticle ? GL_POINTS : GL_TRIANGLES, params->mStart, params->mEnd, params->mCount,
GL_UNSIGNED_SHORT, indicesp+params->mOffset);
params->mVertexBuffer->drawRange(params->mParticle ? LLVertexBuffer::POINTS : LLVertexBuffer::TRIANGLES,
params->mStart, params->mEnd, params->mCount, params->mOffset);
}
void pushVerts(LLSpatialGroup* group, U32 mask)
@ -1932,13 +1931,11 @@ void pushVerts(LLFace* face, U32 mask)
if (buffer)
{
buffer->setBuffer(mask);
U16* indicesp = (U16*) buffer->getIndicesPointer();
U16 start = face->getGeomStart();
U16 end = start + face->getGeomCount()-1;
U32 count = face->getIndicesCount();
U16 offset = face->getIndicesStart();
glDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, indicesp + offset);
buffer->drawRange(LLVertexBuffer::TRIANGLES, start, end, count, offset);
}
}
@ -1948,9 +1945,7 @@ void pushBufferVerts(LLVertexBuffer* buffer, U32 mask)
if (buffer)
{
buffer->setBuffer(mask);
U16* indicesp = (U16*) buffer->getIndicesPointer();
glDrawRangeElements(GL_TRIANGLES, 0, buffer->getRequestedVerts(), buffer->getRequestedIndices(),
GL_UNSIGNED_SHORT, indicesp);
buffer->drawRange(LLVertexBuffer::TRIANGLES, 0, buffer->getRequestedVerts()-1, buffer->getRequestedIndices(), 0);
}
}
@ -1999,9 +1994,8 @@ void pushVertsColorCoded(LLSpatialGroup* group, U32 mask)
LLRenderPass::applyModelMatrix(*params);
glColor4f(colors[col].mV[0], colors[col].mV[1], colors[col].mV[2], 0.5f);
params->mVertexBuffer->setBuffer(mask);
U16* indicesp = (U16*) params->mVertexBuffer->getIndicesPointer();
glDrawRangeElements(params->mParticle ? GL_POINTS : GL_TRIANGLES, params->mStart, params->mEnd, params->mCount,
GL_UNSIGNED_SHORT, indicesp+params->mOffset);
params->mVertexBuffer->drawRange(params->mParticle ? LLVertexBuffer::POINTS : LLVertexBuffer::TRIANGLES,
params->mStart, params->mEnd, params->mCount, params->mOffset);
col = (col+1)%col_count;
}
}
@ -2070,8 +2064,7 @@ void renderOctree(LLSpatialGroup* group)
face->mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX);
//drawBox((face->mExtents[0] + face->mExtents[1])*0.5f,
// (face->mExtents[1]-face->mExtents[0])*0.5f);
glDrawElements(GL_TRIANGLES, face->getIndicesCount(), GL_UNSIGNED_SHORT,
((U16*) face->mVertexBuffer->getIndicesPointer())+face->getIndicesStart());
face->mVertexBuffer->draw(LLVertexBuffer::TRIANGLES, face->getIndicesCount(), face->getIndicesStart());
}
}

View File

@ -244,6 +244,8 @@ BOOL LLTexLayerSetBuffer::render()
BOOL upload_now = (gAgent.mNumPendingQueries == 0 && mNeedsUpload && mTexLayerSet->isLocalTextureDataFinal());
BOOL success = TRUE;
gGL.start();
// Composite bump
if( mBumpTexName )
{
@ -295,6 +297,8 @@ BOOL LLTexLayerSetBuffer::render()
glColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE );
gGL.blendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
gGL.stop();
// we have valid texture data now
mInitialized = TRUE;
mNeedsUpdate = FALSE;

View File

@ -163,6 +163,8 @@ void LLVisualParamHint::preRender(BOOL clear_depth)
//-----------------------------------------------------------------------------
BOOL LLVisualParamHint::render()
{
gGL.start();
LLVisualParamReset::sDirty = TRUE;
LLVOAvatar* avatarp = gAgent.getAvatarObject();
@ -223,6 +225,7 @@ BOOL LLVisualParamHint::render()
LLVector3 camera_pos = target_joint_pos + (camera_snapshot_offset * avatar_rotation);
gGL.stop();
LLViewerCamera::getInstance()->setAspect((F32)mWidth / (F32)mHeight);
LLViewerCamera::getInstance()->setOriginAndLookAt(
camera_pos, // camera
@ -238,7 +241,7 @@ BOOL LLVisualParamHint::render()
avatarPoolp->renderAvatars(avatarp); // renders only one avatar
}
avatarp->setVisualParamWeight(mVisualParam, mLastParamWeight);
gGL.start();
return TRUE;
}

View File

@ -886,6 +886,11 @@ void render_ui_and_swap()
LLGLState::checkStates();
#endif
glPushMatrix();
glLoadMatrixd(gGLLastModelView);
glh::matrix4f saved_view = glh_get_current_modelview();
glh_set_current_modelview(glh_copy_matrix(gGLLastModelView));
{
BOOL to_texture = gPipeline.canUseVertexShaders() &&
LLPipeline::sRenderGlow &&
@ -936,6 +941,9 @@ void render_ui_and_swap()
LLVertexBuffer::stopRender();
}
glh_set_current_modelview(saved_view);
glPopMatrix();
}
void render_ui_and_swap_if_needed()
@ -1030,11 +1038,6 @@ void render_ui_3d()
// so 3d elements requiring Z buffer are moved to LLDrawPoolHUD
//
// Render selections
//glDisableClientState(GL_COLOR_ARRAY);
//glDisableClientState(GL_TEXTURE_COORD_ARRAY);
//glDisableClientState(GL_NORMAL_ARRAY);
/////////////////////////////////////////////////////////////
//
// Render 2.5D elements (2D elements in the world)

View File

@ -501,21 +501,6 @@ int compare_int(const void *a, const void *b)
else return 0;
}
void llDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)
{
if (end-start+1 > (U32) gGLManager.mGLMaxVertexRange ||
count > gGLManager.mGLMaxIndexRange)
{
glDrawElements(mode,count,type,indices);
}
else
{
glDrawRangeElements(mode,start,end,count,type,indices);
}
gPipeline.addTrianglesDrawn(count/3);
}
//--------------------------------------------------------------------
// LLViewerJointMesh::drawShape()
//--------------------------------------------------------------------
@ -626,7 +611,7 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass)
U32 start = mMesh->mFaceVertexOffset;
U32 end = start + mMesh->mFaceVertexCount - 1;
U32 count = mMesh->mFaceIndexCount;
U16* indicesp = ((U16*) mFace->mVertexBuffer->getIndicesPointer()) + mMesh->mFaceIndexOffset;
U32 offset = mMesh->mFaceIndexOffset;
if (mMesh->hasWeights())
{
@ -636,23 +621,21 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass)
{
uploadJointMatrices();
}
llDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, indicesp);
}
else
{
llDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, indicesp);
}
mFace->mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, start, end, count, offset);
}
else
{
glPushMatrix();
LLMatrix4 jointToWorld = getWorldMatrix();
glMultMatrixf((GLfloat*)jointToWorld.mMatrix);
llDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, indicesp);
mFace->mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, start, end, count, offset);
glPopMatrix();
}
gPipeline.addTrianglesDrawn(count/3);
triangle_count += mMesh->mFaceIndexCount;
triangle_count += count;
if (mTestImageName)
{

View File

@ -88,8 +88,6 @@ static void agent_handle_doubletap_run(EKeystate s, LLAgent::EDoubleTapRunMode m
{
if (KEYSTATE_UP == s)
{
// Releasing a walk-key resets the double-tap timer
gAgent.mDoubleTapRunTimer.reset();
if (gAgent.mDoubleTapRunMode == mode &&
gAgent.getRunning() &&
!gAgent.getAlwaysRun())
@ -98,17 +96,23 @@ static void agent_handle_doubletap_run(EKeystate s, LLAgent::EDoubleTapRunMode m
gAgent.clearRunning();
gAgent.sendWalkRun(gAgent.getRunning());
}
gAgent.mDoubleTapRunMode = mode;
}
else if (gAllowTapTapHoldRun &&
KEYSTATE_DOWN == s &&
gAgent.mDoubleTapRunMode == mode &&
gAgent.mDoubleTapRunTimer.getElapsedTimeF32() < NUDGE_TIME)
!gAgent.getRunning())
{
// Same walk-key was pushed again quickly; this is a double-tap
// so engage temporary running.
gAgent.setRunning();
gAgent.sendWalkRun(gAgent.getRunning());
if (gAgent.mDoubleTapRunMode == mode &&
gAgent.mDoubleTapRunTimer.getElapsedTimeF32() < NUDGE_TIME)
{
// Same walk-key was pushed again quickly; this is a
// double-tap so engage temporary running.
gAgent.setRunning();
gAgent.sendWalkRun(gAgent.getRunning());
}
// Pressing any walk-key resets the double-tap timer
gAgent.mDoubleTapRunTimer.reset();
gAgent.mDoubleTapRunMode = mode;
}
}

View File

@ -4897,12 +4897,12 @@ BOOL menu_check_build_tool( void* user_data )
void handle_reload_settings(void*)
{
gSavedSettings.resetToDefaults();
gSavedSettings.loadFromFile(gSavedSettings.getString("ClientSettingsFile"), TRUE);
gSavedSettings.loadFromFile(gSavedSettings.getString("ClientSettingsFile"));
llinfos << "Loading colors from colors.xml" << llendl;
std::string color_file = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"colors.xml");
gColors.resetToDefaults();
gColors.loadFromFile(color_file, FALSE, TYPE_COL4U);
gColors.loadFromFileLegacy(color_file, FALSE, TYPE_COL4U);
}
class LLWorldSetHomeLocation : public view_listener_t

View File

@ -5063,7 +5063,7 @@ void callback_load_url(S32 option, void* data)
if (0 == option)
{
LLWeb::loadURL(infop->mUrl);
LLWeb::loadURLExternal(infop->mUrl);
}
delete infop;

View File

@ -821,7 +821,7 @@ U32 LLVOTree::drawBranchPipeline(LLMatrix4& matrix, U16* indicesp, S32 trunk_LOD
glLoadMatrixf((F32*) scale_mat.mMatrix);
glDrawElements(GL_TRIANGLES, sLODIndexCount[trunk_LOD], GL_UNSIGNED_SHORT, indicesp + sLODIndexOffset[trunk_LOD]);
gPipeline.addTrianglesDrawn(LEAF_INDICES/3);
stop_glerror();
ret += sLODIndexCount[trunk_LOD];
}
@ -871,7 +871,7 @@ U32 LLVOTree::drawBranchPipeline(LLMatrix4& matrix, U16* indicesp, S32 trunk_LOD
glLoadMatrixf((F32*) scale_mat.mMatrix);
glDrawElements(GL_TRIANGLES, LEAF_INDICES, GL_UNSIGNED_SHORT, indicesp);
gPipeline.addTrianglesDrawn(LEAF_INDICES/3);
stop_glerror();
ret += LEAF_INDICES;
}
@ -896,7 +896,7 @@ U32 LLVOTree::drawBranchPipeline(LLMatrix4& matrix, U16* indicesp, S32 trunk_LOD
glLoadMatrixf((F32*) scale_mat.mMatrix);
glDrawElements(GL_TRIANGLES, LEAF_INDICES, GL_UNSIGNED_SHORT, indicesp);
gPipeline.addTrianglesDrawn(LEAF_INDICES/3);
stop_glerror();
ret += LEAF_INDICES;

View File

@ -762,16 +762,30 @@ void LLVOVolume::sculpt()
return;
LLPointer<LLImageRaw> raw_image = new LLImageRaw();
mSculptTexture->readBackRaw(discard_level, raw_image, FALSE);
BOOL is_valid = mSculptTexture->readBackRaw(discard_level, raw_image, FALSE);
sculpt_height = raw_image->getHeight();
sculpt_width = raw_image->getWidth();
sculpt_components = raw_image->getComponents();
sculpt_components = raw_image->getComponents();
sculpt_data = raw_image->getData();
llassert_always(raw_image->getDataSize() >= sculpt_height * sculpt_width * sculpt_components);
if(is_valid)
{
is_valid = mSculptTexture->isValidForSculpt(discard_level, sculpt_width, sculpt_height, sculpt_components) ;
}
if(!is_valid)
{
sculpt_width = 0;
sculpt_height = 0;
sculpt_data = NULL ;
}
else
{
if (raw_image->getDataSize() < sculpt_height * sculpt_width * sculpt_components)
llerrs << "Sculpt: image data size = " << raw_image->getDataSize()
<< " < " << sculpt_height << " x " << sculpt_width << " x " <<sculpt_components << llendl;
sculpt_data = raw_image->getData();
}
getVolume()->sculpt(sculpt_width, sculpt_height, sculpt_components, sculpt_data, discard_level);
}
}

View File

@ -484,17 +484,12 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable)
void LLVOWLSky::drawStars(void)
{
glEnableClientState(GL_COLOR_ARRAY);
// render the stars as a sphere centered at viewer camera
if (mStarsVerts.notNull())
{
mStarsVerts->setBuffer(LLDrawPoolWLSky::STAR_VERTEX_DATA_MASK);
U16* indicesp = (U16*) mStarsVerts->getIndicesPointer();
glDrawElements(GL_POINTS, getStarsNumIndices(), GL_UNSIGNED_SHORT, indicesp);
mStarsVerts->draw(LLVertexBuffer::POINTS, getStarsNumIndices(), 0);
}
glDisableClientState(GL_COLOR_ARRAY);
}
void LLVOWLSky::drawDome(void)
@ -507,19 +502,8 @@ void LLVOWLSky::drawDome(void)
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
const U32 data_mask = LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK;
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
#if DOME_SLICES
//mFanVerts->setBuffer(data_mask);
//glDrawRangeElements(
// GL_TRIANGLES,
// 0, getFanNumVerts()-1, getFanNumIndices(),
// GL_UNSIGNED_SHORT,
// mFanVerts->getIndicesPointer());
//gPipeline.addTrianglesDrawn(getFanNumIndices()/3);
std::vector< LLPointer<LLVertexBuffer> >::const_iterator strips_vbo_iter, end_strips;
end_strips = mStripsVerts.end();
for(strips_vbo_iter = mStripsVerts.begin(); strips_vbo_iter != end_strips; ++strips_vbo_iter)
@ -528,13 +512,10 @@ void LLVOWLSky::drawDome(void)
strips_segment->setBuffer(data_mask);
glDrawRangeElements(
//GL_TRIANGLES,
GL_TRIANGLE_STRIP,
0, strips_segment->getRequestedVerts()-1, strips_segment->getRequestedIndices(),
GL_UNSIGNED_SHORT,
strips_segment->getIndicesPointer());
strips_segment->drawRange(
LLVertexBuffer::TRIANGLE_STRIP,
0, strips_segment->getRequestedVerts()-1, strips_segment->getRequestedIndices(),
0);
gPipeline.addTrianglesDrawn(strips_segment->getRequestedIndices() - 2);
}
@ -547,8 +528,6 @@ void LLVOWLSky::drawDome(void)
mStripsVerts->getIndicesPointer());
#endif
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
LLVertexBuffer::unbind();
}

View File

@ -168,7 +168,7 @@ glh::matrix4f glh_get_current_projection()
return glh_copy_matrix(gGLProjection);
}
void glh_copy_matrix(glh::matrix4f& src, GLdouble* dst)
void glh_copy_matrix(const glh::matrix4f& src, GLdouble* dst)
{
for (U32 i = 0; i < 16; i++)
{
@ -176,7 +176,7 @@ void glh_copy_matrix(glh::matrix4f& src, GLdouble* dst)
}
}
void glh_set_current_modelview(glh::matrix4f& mat)
void glh_set_current_modelview(const glh::matrix4f& mat)
{
glh_copy_matrix(mat, gGLModelView);
}
@ -2144,9 +2144,9 @@ void render_hud_elements()
LLViewerParcelMgr::getInstance()->renderParcelCollision();
// Render debugging beacons.
gObjectList.renderObjectBeacons();
LLHUDObject::renderAll();
gObjectList.resetObjectBeacons();
//gObjectList.renderObjectBeacons();
//LLHUDObject::renderAll();
//gObjectList.resetObjectBeacons();
}
else if (gForceRenderLandFence)
{
@ -2253,11 +2253,11 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
//
//
glEnableClientState(GL_VERTEX_ARRAY);
stop_glerror();
gFrameStats.start(LLFrameStats::RENDER_SYNC);
glEnableClientState(GL_VERTEX_ARRAY);
// Do verification of GL state
#ifndef LL_RELEASE_FOR_DOWNLOAD
LLGLState::checkStates();
@ -2377,10 +2377,10 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
break;
}
p->resetTrianglesDrawn();
p->render(i);
}
poolp->endRenderPass(i);
LLVertexBuffer::unbind();
#ifndef LL_RELEASE_FOR_DOWNLOAD
# if LL_DEBUG_GL
GLint depth;
@ -2413,6 +2413,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
}
}
LLVertexBuffer::unbind();
#ifndef LL_RELEASE_FOR_DOWNLOAD
LLGLState::checkStates();
LLGLState::checkTextureChannels();
@ -2452,6 +2453,15 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
LLVertexBuffer::stopRender();
LLVertexBuffer::unbind();
if (!LLPipeline::sReflectionRender && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
{
gGL.start();
// Render debugging beacons.
gObjectList.renderObjectBeacons();
LLHUDObject::renderAll();
gObjectList.resetObjectBeacons();
gGL.stop();
}
//HACK: preserve/restore matrices around HUD render
if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD))
@ -2472,15 +2482,9 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
void LLPipeline::renderGeomDeferred()
{
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
gDeferredDiffuseProgram.bind();
gPipeline.renderObjects(LLRenderPass::PASS_SIMPLE, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD | LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_NORMAL, TRUE);
gDeferredDiffuseProgram.unbind();
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
void LLPipeline::addTrianglesDrawn(S32 count)
@ -2506,11 +2510,6 @@ void LLPipeline::renderDebug()
gGL.start();
// Disable all client state
//glDisableClientState(GL_TEXTURE_COORD_ARRAY);
//glDisableClientState(GL_NORMAL_ARRAY);
//glDisableClientState(GL_COLOR_ARRAY);
gGLLastMatrix = NULL;
glLoadMatrixd(gGLModelView);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE);
@ -2603,8 +2602,6 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects)
LLGLDepthTest gls_depth(GL_TRUE,GL_TRUE);
disableLights();
glEnableClientState ( GL_VERTEX_ARRAY );
//for each drawpool
#ifndef LL_RELEASE_FOR_DOWNLOAD
LLGLState::checkStates();
@ -2619,7 +2616,7 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects)
{
LLFacePool* face_pool = (LLFacePool*) poolp;
face_pool->renderForSelect();
LLVertexBuffer::unbind();
gGLLastMatrix = NULL;
glLoadMatrixd(gGLModelView);
@ -2635,7 +2632,6 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects)
}
}
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
LLGLEnable alpha_test(GL_ALPHA_TEST);
if (gPickTransparent)
{
@ -2759,10 +2755,10 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects)
}
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glDisableClientState( GL_TEXTURE_COORD_ARRAY );
LLVertexBuffer::unbind();
LLVertexBuffer::stopRender();
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
}
@ -4866,6 +4862,12 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
{
if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate)
{
#ifndef LL_RELEASE_FOR_DOWNLOAD
LLGLState::checkStates();
LLGLState::checkTextureChannels();
LLGLState::checkClientArrays();
#endif
LLCamera camera = camera_in;
camera.setFar(camera.getFar()*0.87654321f);
LLPipeline::sReflectionRender = TRUE;
@ -5052,6 +5054,12 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
LLDrawPoolWater::sNeedsDistortionUpdate = FALSE;
LLViewerCamera::getInstance()->setUserClipPlane(LLPlane(-pnorm, -pd));
LLPipeline::sUseOcclusion = occlusion;
#ifndef LL_RELEASE_FOR_DOWNLOAD
LLGLState::checkStates();
LLGLState::checkTextureChannels();
LLGLState::checkClientArrays();
#endif
}
}

View File

@ -67,8 +67,9 @@ BOOL compute_min_max(LLMatrix4& box, LLVector2& min, LLVector2& max); // Shouldn
bool LLRayAABB(const LLVector3 &center, const LLVector3 &size, const LLVector3& origin, const LLVector3& dir, LLVector3 &coord, F32 epsilon = 0);
BOOL LLLineSegmentAABB(const LLVector3& start, const LLVector3& end, const LLVector3& center, const LLVector3& size);
BOOL setup_hud_matrices(BOOL for_select);
glh::matrix4f glh_copy_matrix(GLdouble* src);
glh::matrix4f glh_get_current_modelview();
void glh_set_current_modelview(glh::matrix4f& mat);
void glh_set_current_modelview(const glh::matrix4f& mat);
glh::matrix4f glh_get_current_projection();
void glh_set_current_projection(glh::matrix4f& mat);
glh::matrix4f gl_ortho(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat znear, GLfloat zfar);