diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index a222bc208..83a72eeb1 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -1990,7 +1990,7 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name, image_raw->copyUnscaledAlphaMask(alpha_image_raw, LLColor4U::black); } - tex->createGLTexture(0, image_raw, LLImageGL::GLTextureName(), TRUE, LLGLTexture::LOCAL); + tex->createGLTexture(0, image_raw, nullptr, TRUE, LLGLTexture::LOCAL); gGL.getTexUnit(0)->bind(tex); tex->setAddressMode(LLTexUnit::TAM_CLAMP); diff --git a/indra/llcommon/llindexedvector.h b/indra/llcommon/llindexedvector.h index e8baf0c43..d2cee0f82 100644 --- a/indra/llcommon/llindexedvector.h +++ b/indra/llcommon/llindexedvector.h @@ -62,7 +62,7 @@ public: reverse_iterator rend() { return mVector.rend(); } const_reverse_iterator rend() const { return mVector.rend(); } - void reset() { mVector.resize(0); mIndexMap.resize(0); } + void reset() { mVector.resize(0); } bool empty() const { return mVector.empty(); } size_type size() const { return mVector.size(); } diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp index bd5ddab15..09c76461d 100644 --- a/indra/llrender/llcubemap.cpp +++ b/indra/llrender/llcubemap.cpp @@ -80,14 +80,14 @@ void LLCubeMap::initGL() // Not initialized, do stuff. if (mImages[0].isNull()) { - auto texname = LLImageGL::createTextureName(); + LLImageGL::GLTextureName texname = LLImageGL::createTextureName(); for (int i = 0; i < 6; i++) { mImages[i] = new LLImageGL(64, 64, 4, (use_cube_mipmaps? TRUE : FALSE)); mImages[i]->setTarget(mTargets[i], LLTexUnit::TT_CUBE_MAP); mRawImages[i] = new LLImageRaw(64, 64, 4); - mImages[i]->createGLTexture(0, mRawImages[i], texname); + mImages[i]->createGLTexture(0, mRawImages[i], &texname); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_CUBE_MAP, texname->getTexName()); mImages[i]->setAddressMode(LLTexUnit::TAM_CLAMP); diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index ef56c507c..3b824a3b6 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -73,9 +73,9 @@ void* gl_get_proc_address(const char *pStr) #undef GLH_EXT_GET_PROC_ADDRESS #define GLH_EXT_GET_PROC_ADDRESS(p) gl_get_proc_address(p) #undef GLH_EXT_GET_PROC_ADDRESS_CORE -#define GLH_EXT_GET_PROC_ADDRESS_CORE(ver, p) gl_get_proc_address((mGLVersion >= ver) ? p : p##"ARB") +#define GLH_EXT_GET_PROC_ADDRESS_CORE(ver, p) gl_get_proc_address((mGLVersion >= ver) ? p : p"ARB") #undef GLH_EXT_GET_PROC_ADDRESS_CORE_EXT -#define GLH_EXT_GET_PROC_ADDRESS_CORE_EXT(ver, p) gl_get_proc_address((mGLVersion >= ver) ? p : p##"EXT") +#define GLH_EXT_GET_PROC_ADDRESS_CORE_EXT(ver, p) gl_get_proc_address((mGLVersion >= ver) ? p : p"EXT") #undef GLH_EXT_GET_PROC_ADDRESS_CORE_OR_ARB #define GLH_EXT_GET_PROC_ADDRESS_CORE_OR_ARB(ver, p, arb) gl_get_proc_address((mGLVersion >= ver) ? p : arb) #endif //!LL_DARWIN diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index 409c9eea6..6cffe30fa 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -349,6 +349,7 @@ private: } }; #define initLLGLState(state, value, disabler_ptr) \ + template <> \ LLGLStateStaticData LLGLState::staticData = {#state, state, value, 0, nullptr, disabler_ptr}; \ bool registered_##state = LLGLStateValidator::registerStateData(LLGLState::staticData); diff --git a/indra/llrender/llgltexture.cpp b/indra/llrender/llgltexture.cpp index b3c8a5d6d..0fa14b9d7 100644 --- a/indra/llrender/llgltexture.cpp +++ b/indra/llrender/llgltexture.cpp @@ -167,7 +167,7 @@ BOOL LLGLTexture::createGLTexture() return mGLTexturep->createGLTexture() ; } -BOOL LLGLTexture::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, LLImageGL::GLTextureName& usename, BOOL to_create, S32 category) +BOOL LLGLTexture::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, LLImageGL::GLTextureName* usename, BOOL to_create, S32 category) { llassert(mGLTexturep.notNull()) ; diff --git a/indra/llrender/llgltexture.h b/indra/llrender/llgltexture.h index 81c994347..a8df0bc0d 100644 --- a/indra/llrender/llgltexture.h +++ b/indra/llrender/llgltexture.h @@ -123,7 +123,7 @@ public: BOOL hasGLTexture() const ; LLGLuint getTexName() const ; BOOL createGLTexture() ; - BOOL createGLTexture(S32 discard_level, const LLImageRaw* imageraw, LLImageGL::GLTextureName& usename = LLImageGL::GLTextureName(), BOOL to_create = TRUE, S32 category = LLGLTexture::OTHER); + BOOL createGLTexture(S32 discard_level, const LLImageRaw* imageraw, LLImageGL::GLTextureName* usename = nullptr, BOOL to_create = TRUE, S32 category = LLGLTexture::OTHER); void setFilteringOption(LLTexUnit::eTextureFilterOptions option); void setExplicitFormat(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format = 0, BOOL swap_bytes = FALSE); void setAddressMode(LLTexUnit::eTextureAddressMode mode); diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 2534ba429..46bf49316 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -222,7 +222,7 @@ void LLImageGL::setHighlightTexture(S32 category) } } } - sHighlightTexturep->createGLTexture(0, image_raw, LLImageGL::GLTextureName(), TRUE, category); + sHighlightTexturep->createGLTexture(0, image_raw, nullptr, TRUE, category); image_raw = NULL; } @@ -386,7 +386,7 @@ void LLImageGL::restoreGL() if (data.notNull() && glimage->getComponents() && data->getComponents() && glimage->mSaveDiscardLevel >= 0 && - glimage->createGLTexture(glimage->mSaveDiscardLevel, data, LLImageGL::GLTextureName(), TRUE, glimage->getCategory())) + glimage->createGLTexture(glimage->mSaveDiscardLevel, data, nullptr, TRUE, glimage->getCategory())) { stop_glerror(); /*if (glimage->getHasGLTexture()) @@ -1633,7 +1633,7 @@ BOOL LLImageGL::createGLTexture() } static LLTrace::BlockTimerStatHandle FTM_CREATE_GL_TEXTURE2("createGLTexture(raw)"); -BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, GLTextureName& usename, BOOL to_create, S32 category) +BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, GLTextureName* usename, BOOL to_create, S32 category) { LL_RECORD_BLOCK_TIME(FTM_CREATE_GL_TEXTURE2); if (gGLManager.mIsDisabled) @@ -1710,7 +1710,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, G } static LLTrace::BlockTimerStatHandle FTM_CREATE_GL_TEXTURE3("createGLTexture3(data)"); -BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_hasmips, GLTextureName& usename) +BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_hasmips, GLTextureName* usename) { LL_RECORD_BLOCK_TIME(FTM_CREATE_GL_TEXTURE3); llassert(data_in); @@ -1733,9 +1733,9 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_ // S32 old_discard = mCurrentDiscardLevel; - if (usename) + if (usename && *usename) { - mTexName = usename; + mTexName = *usename; } else { diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index 8366d1a2f..c50b726ff 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -155,9 +155,9 @@ public: static void setManualImage(U32 target, S32 miplevel, S32 intformat, S32 width, S32 height, U32 pixformat, U32 pixtype, const void *pixels, bool allow_compression = true); BOOL createGLTexture() ; - BOOL createGLTexture(S32 discard_level, const LLImageRaw* imageraw, GLTextureName& usename = GLTextureName(), BOOL to_create = TRUE, + BOOL createGLTexture(S32 discard_level, const LLImageRaw* imageraw, GLTextureName* usename = nullptr, BOOL to_create = TRUE, S32 category = sMaxCategories-1); - BOOL createGLTexture(S32 discard_level, const U8* data, BOOL data_hasmips = FALSE, GLTextureName& usename = GLTextureName()); + BOOL createGLTexture(S32 discard_level, const U8* data, BOOL data_hasmips = FALSE, GLTextureName* usename = nullptr); void setImage(const LLImageRaw* imageraw); void setImage(const U8* data_in, BOOL data_hasmips = FALSE); BOOL setSubImage(const LLImageRaw* imageraw, S32 x_pos, S32 y_pos, S32 width, S32 height, BOOL force_fast_update = FALSE); diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index dfa73ffa0..d3170bdf9 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -2139,7 +2139,7 @@ void LLRender::setAmbientLightColor(const LLColor4& color) void LLRender::setLineWidth(F32 line_width) { - //if (LLRender::sGLCoreProfile) + if (LLRender::sGLCoreProfile) { mNewContext.lineWidth = 1.f; return; diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index c48335070..a993bb98a 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -295,9 +295,9 @@ protected: ptrdiff_t mAlignedOffset; ptrdiff_t mAlignedIndexOffset; S32 mSize; - S32 mResidentSize; + U32 mResidentSize; S32 mIndicesSize; - S32 mResidentIndicesSize; + U32 mResidentIndicesSize; U32 mTypeMask; const S32 mUsage; // GL usage diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp index 5df4ae675..ad0166f4e 100644 --- a/indra/llui/llcheckboxctrl.cpp +++ b/indra/llui/llcheckboxctrl.cpp @@ -97,11 +97,10 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const std::string& name, const LLRect& rect, /*std::string local_label = label; if(local_label.empty()) { - - //local_label = " "; + local_label = " "; }*/ - mLabel = new LLTextBox( std::string("CheckboxCtrl Label"), label_rect, local_label, mFont ); + mLabel = new LLTextBox( std::string("CheckboxCtrl Label"), label_rect, label, mFont ); mLabel->setFollowsLeft(); mLabel->setFollowsBottom(); addChild(mLabel); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 2f9062047..f83a3bae5 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1650,8 +1650,6 @@ bool LLAppViewer::cleanup() LLViewerObject::cleanupVOClasses(); - LLAvatarAppearance::cleanupClass(); - LLAvatarAppearance::cleanupClass(); LLTracker::cleanupInstance(); diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index 329ef4be6..e8b9eabcc 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -109,7 +109,7 @@ void LLViewerDynamicTexture::generateGLTexture(LLGLint internal_format, LLGLenum } if(fill_color) raw_image->fill(*fill_color); - createGLTexture(0, raw_image, LLImageGL::GLTextureName(), TRUE, LLViewerTexture::DYNAMIC_TEX); + createGLTexture(0, raw_image, nullptr, TRUE, LLViewerTexture::DYNAMIC_TEX); setAddressMode((mClamp) ? LLTexUnit::TAM_CLAMP : LLTexUnit::TAM_WRAP); mGLTexturep->setGLTextureCreated(false); } diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index c9a3d9362..fca367826 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -783,7 +783,7 @@ void LLFloaterReporter::takeScreenshot() // store in the image list so it doesn't try to fetch from the server LLPointer image_in_list = LLViewerTextureManager::getFetchedTexture(mResourceDatap->mAssetInfo.mUuid, FTT_LOCAL_FILE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::FETCHED_TEXTURE); - image_in_list->createGLTexture(0, raw, LLImageGL::GLTextureName(), TRUE, LLViewerTexture::OTHER); + image_in_list->createGLTexture(0, raw, nullptr, TRUE, LLViewerTexture::OTHER); // the texture picker then uses that texture LLTexturePicker* texture = getChild("screenshot"); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 2ebf1681a..2be358a64 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1297,7 +1297,7 @@ void LLViewerFetchedTexture::addToCreateTexture() if(isForSculptOnly()) { //just update some variables, not to create a real GL texture. - createGLTexture(mRawDiscardLevel, mRawImage, LLImageGL::GLTextureName(), FALSE); + createGLTexture(mRawDiscardLevel, mRawImage, nullptr, FALSE); mNeedsCreateTexture = FALSE; destroyRawImage(); } @@ -1360,7 +1360,7 @@ void LLViewerFetchedTexture::addToCreateTexture() } // ONLY called from LLViewerTextureList -BOOL LLViewerFetchedTexture::createTexture(LLImageGL::GLTextureName& usename) +BOOL LLViewerFetchedTexture::createTexture(LLImageGL::GLTextureName* usename) { if (!mNeedsCreateTexture) { diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index d5fb51114..7c4b2321a 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -318,7 +318,7 @@ public: void addToCreateTexture(); // ONLY call from LLViewerTextureList - BOOL createTexture(LLImageGL::GLTextureName& usename = LLImageGL::GLTextureName()); + BOOL createTexture(LLImageGL::GLTextureName* usename = nullptr); void destroyTexture() ; virtual void processTextureStats() ; diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 2ef1c6e2c..6854acb62 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -298,7 +298,7 @@ void LLSkyTex::create(const F32 brightness) void LLSkyTex::createGLImage(S32 which) { - mTexture[which]->createGLTexture(0, mImageRaw[which], LLImageGL::GLTextureName(), TRUE, LLGLTexture::LOCAL); + mTexture[which]->createGLTexture(0, mImageRaw[which], nullptr, TRUE, LLGLTexture::LOCAL); mTexture[which]->setAddressMode(LLTexUnit::TAM_CLAMP); }