Make gcc happier.

This commit is contained in:
Shyotl
2018-11-20 02:49:57 -06:00
parent 523717477d
commit 04ea11c61e
18 changed files with 28 additions and 30 deletions

View File

@@ -1990,7 +1990,7 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name,
image_raw->copyUnscaledAlphaMask(alpha_image_raw, LLColor4U::black); 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); gGL.getTexUnit(0)->bind(tex);
tex->setAddressMode(LLTexUnit::TAM_CLAMP); tex->setAddressMode(LLTexUnit::TAM_CLAMP);

View File

@@ -62,7 +62,7 @@ public:
reverse_iterator rend() { return mVector.rend(); } reverse_iterator rend() { return mVector.rend(); }
const_reverse_iterator rend() const { 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(); } bool empty() const { return mVector.empty(); }
size_type size() const { return mVector.size(); } size_type size() const { return mVector.size(); }

View File

@@ -80,14 +80,14 @@ void LLCubeMap::initGL()
// Not initialized, do stuff. // Not initialized, do stuff.
if (mImages[0].isNull()) if (mImages[0].isNull())
{ {
auto texname = LLImageGL::createTextureName(); LLImageGL::GLTextureName texname = LLImageGL::createTextureName();
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
{ {
mImages[i] = new LLImageGL(64, 64, 4, (use_cube_mipmaps? TRUE : FALSE)); mImages[i] = new LLImageGL(64, 64, 4, (use_cube_mipmaps? TRUE : FALSE));
mImages[i]->setTarget(mTargets[i], LLTexUnit::TT_CUBE_MAP); mImages[i]->setTarget(mTargets[i], LLTexUnit::TT_CUBE_MAP);
mRawImages[i] = new LLImageRaw(64, 64, 4); 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()); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_CUBE_MAP, texname->getTexName());
mImages[i]->setAddressMode(LLTexUnit::TAM_CLAMP); mImages[i]->setAddressMode(LLTexUnit::TAM_CLAMP);

View File

@@ -73,9 +73,9 @@ void* gl_get_proc_address(const char *pStr)
#undef GLH_EXT_GET_PROC_ADDRESS #undef GLH_EXT_GET_PROC_ADDRESS
#define GLH_EXT_GET_PROC_ADDRESS(p) gl_get_proc_address(p) #define GLH_EXT_GET_PROC_ADDRESS(p) gl_get_proc_address(p)
#undef GLH_EXT_GET_PROC_ADDRESS_CORE #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 #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 #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) #define GLH_EXT_GET_PROC_ADDRESS_CORE_OR_ARB(ver, p, arb) gl_get_proc_address((mGLVersion >= ver) ? p : arb)
#endif //!LL_DARWIN #endif //!LL_DARWIN

View File

@@ -349,6 +349,7 @@ private:
} }
}; };
#define initLLGLState(state, value, disabler_ptr) \ #define initLLGLState(state, value, disabler_ptr) \
template <> \
LLGLStateStaticData LLGLState<state>::staticData = {#state, state, value, 0, nullptr, disabler_ptr}; \ LLGLStateStaticData LLGLState<state>::staticData = {#state, state, value, 0, nullptr, disabler_ptr}; \
bool registered_##state = LLGLStateValidator::registerStateData(LLGLState<state>::staticData); bool registered_##state = LLGLStateValidator::registerStateData(LLGLState<state>::staticData);

View File

@@ -167,7 +167,7 @@ BOOL LLGLTexture::createGLTexture()
return mGLTexturep->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()) ; llassert(mGLTexturep.notNull()) ;

View File

@@ -123,7 +123,7 @@ public:
BOOL hasGLTexture() const ; BOOL hasGLTexture() const ;
LLGLuint getTexName() const ; LLGLuint getTexName() const ;
BOOL createGLTexture() ; 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 setFilteringOption(LLTexUnit::eTextureFilterOptions option);
void setExplicitFormat(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format = 0, BOOL swap_bytes = FALSE); void setExplicitFormat(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format = 0, BOOL swap_bytes = FALSE);
void setAddressMode(LLTexUnit::eTextureAddressMode mode); void setAddressMode(LLTexUnit::eTextureAddressMode mode);

View File

@@ -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; image_raw = NULL;
} }
@@ -386,7 +386,7 @@ void LLImageGL::restoreGL()
if (data.notNull() && glimage->getComponents() && if (data.notNull() && glimage->getComponents() &&
data->getComponents() && data->getComponents() &&
glimage->mSaveDiscardLevel >= 0 && glimage->mSaveDiscardLevel >= 0 &&
glimage->createGLTexture(glimage->mSaveDiscardLevel, data, LLImageGL::GLTextureName(), TRUE, glimage->getCategory())) glimage->createGLTexture(glimage->mSaveDiscardLevel, data, nullptr, TRUE, glimage->getCategory()))
{ {
stop_glerror(); stop_glerror();
/*if (glimage->getHasGLTexture()) /*if (glimage->getHasGLTexture())
@@ -1633,7 +1633,7 @@ BOOL LLImageGL::createGLTexture()
} }
static LLTrace::BlockTimerStatHandle FTM_CREATE_GL_TEXTURE2("createGLTexture(raw)"); 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); LL_RECORD_BLOCK_TIME(FTM_CREATE_GL_TEXTURE2);
if (gGLManager.mIsDisabled) 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)"); 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); LL_RECORD_BLOCK_TIME(FTM_CREATE_GL_TEXTURE3);
llassert(data_in); llassert(data_in);
@@ -1733,9 +1733,9 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_
// S32 old_discard = mCurrentDiscardLevel; // S32 old_discard = mCurrentDiscardLevel;
if (usename) if (usename && *usename)
{ {
mTexName = usename; mTexName = *usename;
} }
else else
{ {

View File

@@ -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); 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() ;
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); 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 LLImageRaw* imageraw);
void setImage(const U8* data_in, BOOL data_hasmips = FALSE); 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); BOOL setSubImage(const LLImageRaw* imageraw, S32 x_pos, S32 y_pos, S32 width, S32 height, BOOL force_fast_update = FALSE);

View File

@@ -2139,7 +2139,7 @@ void LLRender::setAmbientLightColor(const LLColor4& color)
void LLRender::setLineWidth(F32 line_width) void LLRender::setLineWidth(F32 line_width)
{ {
//if (LLRender::sGLCoreProfile) if (LLRender::sGLCoreProfile)
{ {
mNewContext.lineWidth = 1.f; mNewContext.lineWidth = 1.f;
return; return;

View File

@@ -295,9 +295,9 @@ protected:
ptrdiff_t mAlignedOffset; ptrdiff_t mAlignedOffset;
ptrdiff_t mAlignedIndexOffset; ptrdiff_t mAlignedIndexOffset;
S32 mSize; S32 mSize;
S32 mResidentSize; U32 mResidentSize;
S32 mIndicesSize; S32 mIndicesSize;
S32 mResidentIndicesSize; U32 mResidentIndicesSize;
U32 mTypeMask; U32 mTypeMask;
const S32 mUsage; // GL usage const S32 mUsage; // GL usage

View File

@@ -97,11 +97,10 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const std::string& name, const LLRect& rect,
/*std::string local_label = label; /*std::string local_label = label;
if(local_label.empty()) 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->setFollowsLeft();
mLabel->setFollowsBottom(); mLabel->setFollowsBottom();
addChild(mLabel); addChild(mLabel);

View File

@@ -1652,8 +1652,6 @@ bool LLAppViewer::cleanup()
LLAvatarAppearance::cleanupClass(); LLAvatarAppearance::cleanupClass();
LLAvatarAppearance::cleanupClass();
LLTracker::cleanupInstance(); LLTracker::cleanupInstance();
// *FIX: This is handled in LLAppViewerWin32::cleanup(). // *FIX: This is handled in LLAppViewerWin32::cleanup().

View File

@@ -109,7 +109,7 @@ void LLViewerDynamicTexture::generateGLTexture(LLGLint internal_format, LLGLenum
} }
if(fill_color) if(fill_color)
raw_image->fill(*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); setAddressMode((mClamp) ? LLTexUnit::TAM_CLAMP : LLTexUnit::TAM_WRAP);
mGLTexturep->setGLTextureCreated(false); mGLTexturep->setGLTextureCreated(false);
} }

View File

@@ -783,7 +783,7 @@ void LLFloaterReporter::takeScreenshot()
// store in the image list so it doesn't try to fetch from the server // store in the image list so it doesn't try to fetch from the server
LLPointer<LLViewerFetchedTexture> image_in_list = LLPointer<LLViewerFetchedTexture> image_in_list =
LLViewerTextureManager::getFetchedTexture(mResourceDatap->mAssetInfo.mUuid, FTT_LOCAL_FILE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::FETCHED_TEXTURE); 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 // the texture picker then uses that texture
LLTexturePicker* texture = getChild<LLTextureCtrl>("screenshot"); LLTexturePicker* texture = getChild<LLTextureCtrl>("screenshot");

View File

@@ -1297,7 +1297,7 @@ void LLViewerFetchedTexture::addToCreateTexture()
if(isForSculptOnly()) if(isForSculptOnly())
{ {
//just update some variables, not to create a real GL texture. //just update some variables, not to create a real GL texture.
createGLTexture(mRawDiscardLevel, mRawImage, LLImageGL::GLTextureName(), FALSE); createGLTexture(mRawDiscardLevel, mRawImage, nullptr, FALSE);
mNeedsCreateTexture = FALSE; mNeedsCreateTexture = FALSE;
destroyRawImage(); destroyRawImage();
} }
@@ -1360,7 +1360,7 @@ void LLViewerFetchedTexture::addToCreateTexture()
} }
// ONLY called from LLViewerTextureList // ONLY called from LLViewerTextureList
BOOL LLViewerFetchedTexture::createTexture(LLImageGL::GLTextureName& usename) BOOL LLViewerFetchedTexture::createTexture(LLImageGL::GLTextureName* usename)
{ {
if (!mNeedsCreateTexture) if (!mNeedsCreateTexture)
{ {

View File

@@ -318,7 +318,7 @@ public:
void addToCreateTexture(); void addToCreateTexture();
// ONLY call from LLViewerTextureList // ONLY call from LLViewerTextureList
BOOL createTexture(LLImageGL::GLTextureName& usename = LLImageGL::GLTextureName()); BOOL createTexture(LLImageGL::GLTextureName* usename = nullptr);
void destroyTexture() ; void destroyTexture() ;
virtual void processTextureStats() ; virtual void processTextureStats() ;

View File

@@ -298,7 +298,7 @@ void LLSkyTex::create(const F32 brightness)
void LLSkyTex::createGLImage(S32 which) 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); mTexture[which]->setAddressMode(LLTexUnit::TAM_CLAMP);
} }