From 3a54d4b4ab624b6858de91b9f324b73c905a96a7 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sat, 13 Apr 2013 22:07:45 +0200 Subject: [PATCH 01/10] Fixed windows build in debug mode --- indra/libpathing/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/libpathing/CMakeLists.txt b/indra/libpathing/CMakeLists.txt index 12d409f20..087faec05 100644 --- a/indra/libpathing/CMakeLists.txt +++ b/indra/libpathing/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.6.4) project(ndPathingLib CXX C) if( MSVC ) - add_definitions(-D_HAS_ITERATOR_DEBUGGING=0 -D_SECURE_SCL=0 -D_CRT_SECURE_NO_WARNINGS=1) + add_definitions(-D_SECURE_SCL=0 -D_CRT_SECURE_NO_WARNINGS=1) endif( MSVC ) file (GLOB SOURCE_FILES *.cpp ) From adb535421dce6edd7090caa2f60e5cbc03a5b19c Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sat, 13 Apr 2013 22:08:19 +0200 Subject: [PATCH 02/10] Fixed build with DEBUG_CURLIO defined --- indra/aistatemachine/aistatemachine.cpp | 2 +- indra/aistatemachine/aistatemachine.h | 2 +- indra/newview/lltexturefetch.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/aistatemachine/aistatemachine.cpp b/indra/aistatemachine/aistatemachine.cpp index 8784a84c4..46bda0ad3 100644 --- a/indra/aistatemachine/aistatemachine.cpp +++ b/indra/aistatemachine/aistatemachine.cpp @@ -373,7 +373,7 @@ void AIEngine::setMaxCount(F32 StateMachineMaxTime) sMaxCount = calc_clock_frequency() * StateMachineMaxTime / 1000; } -#ifdef CWDEBUG +#if defined(CWDEBUG) || defined(DEBUG_CURLIO) char const* AIStateMachine::event_str(event_type event) { switch(event) diff --git a/indra/aistatemachine/aistatemachine.h b/indra/aistatemachine/aistatemachine.h index 979205e02..160c6d6eb 100644 --- a/indra/aistatemachine/aistatemachine.h +++ b/indra/aistatemachine/aistatemachine.h @@ -271,7 +271,7 @@ class AIStateMachine : public LLThreadSafeRefCount // Return stringified state, for debugging purposes. char const* state_str(base_state_type state); -#ifdef CWDEBUG +#if defined(CWDEBUG) || defined(DEBUG_CURLIO) char const* event_str(event_type event); #endif diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 5efd486e0..289d207b8 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1339,7 +1339,7 @@ bool LLTextureFetchWorker::doWork(S32 param) } LLHTTPClient::request(mUrl, LLHTTPClient::HTTP_GET, NULL, new HTTPGetResponder(mFetcher, mID, LLTimer::getTotalTime(), mRequestedSize, mRequestedOffset, true), - headers/*,*/ DEBUG_CURLIO_PARAM(false), keep_alive, no_does_authentication, allow_compressed_reply, NULL, 0, NULL); + headers/*,*/ DEBUG_CURLIO_PARAM(debug_off), keep_alive, no_does_authentication, allow_compressed_reply, NULL, 0, NULL); res = true; } if (!res) From d51b0f8701d01707575f04827302ef0d1de0c9da Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 15 Apr 2013 18:06:46 -0500 Subject: [PATCH 03/10] Tweaked alert dialogs. Clicking 'x' issues a response. Either 'close', 'cancel', 'ok' or a dummy 'close' which will result in LLNotification::getSelectedOption returning -1 in callback. Listed in order of preference. --- indra/llui/llalertdialog.cpp | 158 ++++++++++++++------------ indra/llui/llalertdialog.h | 22 ++-- indra/newview/llviewerparcelmedia.cpp | 46 ++++---- 3 files changed, 126 insertions(+), 100 deletions(-) diff --git a/indra/llui/llalertdialog.cpp b/indra/llui/llalertdialog.cpp index 712683021..7015e9c6a 100644 --- a/indra/llui/llalertdialog.cpp +++ b/indra/llui/llalertdialog.cpp @@ -107,7 +107,7 @@ static const LLFONT_ID FONT_NAME = LLFONT_SANSSERIF; LLAlertDialog::LLAlertDialog( LLNotificationPtr notification, bool modal) : LLModalDialog( notification->getLabel(), 100, 100, modal ), // dummy size. Will reshape below. LLInstanceTracker(notification->getID()), - mDefaultOption( 0 ), + mDefaultButton( NULL ), mCheck(NULL), mCaution(notification->getPriority() >= NOTIFICATION_PRIORITY_HIGH), mLabel(notification->getName()), @@ -126,35 +126,24 @@ LLAlertDialog::LLAlertDialog( LLNotificationPtr notification, bool modal) setBackgroundVisible(TRUE); setBackgroundOpaque(TRUE); - - typedef std::vector > options_t; - options_t supplied_options; + typedef std::list options_t; + options_t options; // for now, get LLSD to iterator over form elements LLSD form_sd = form->asLLSD(); - S32 option_index = 0; for (LLSD::array_const_iterator it = form_sd.beginArray(); it != form_sd.endArray(); ++it) { std::string type = (*it)["type"].asString(); if (type == "button") { - if((*it)["default"]) - { - mDefaultOption = option_index; - } - - supplied_options.push_back(std::make_pair((*it)["name"].asString(), (*it)["text"].asString())); - - ButtonData data; - data.mSelf = this; - if (option_index == mNote->getURLOption()) - { - data.mURL = mNote->getURL(); - } - - mButtonData.push_back(data); - option_index++; + options.push_back(ButtonData()); + ButtonData& button_data = options.back(); + button_data.mName = (*it)["name"].asString(); + button_data.mText = (*it)["text"].asString(); + button_data.mDefault = (*it)["default"].asBoolean(); + if(options.size()-1 == mNote->getURLOption()) + button_data.mUrl = mNote->getURL(); } else if (type == "text") { @@ -168,23 +157,14 @@ LLAlertDialog::LLAlertDialog( LLNotificationPtr notification, bool modal) is_password = true; } } - // Buttons - options_t options; - if (supplied_options.empty()) + if (options.empty()) { - options.push_back(std::make_pair(std::string("close"), std::string("Close"))); - - // add data for ok button. - ButtonData ok_button; - ok_button.mSelf = this; - - mButtonData.push_back(ok_button); - mDefaultOption = 0; - } - else - { - options = supplied_options; + options.push_back(ButtonData()); + ButtonData& button_data = options.back(); + button_data.mName = "close"; + button_data.mText = "Close"; + button_data.mDefault = true; } S32 num_options = options.size(); @@ -192,9 +172,9 @@ LLAlertDialog::LLAlertDialog( LLNotificationPtr notification, bool modal) // Calc total width of buttons S32 button_width = 0; S32 sp = font->getWidth(std::string("OO")); - for( S32 i = 0; i < num_options; i++ ) + for( options_t::iterator it = options.begin(); it != options.end(); it++ ) { - S32 w = S32(font->getWidth( options[i].second ) + 0.99f) + sp + 2 * LLBUTTON_H_PAD; + S32 w = S32(font->getWidth( it->mText ) + 0.99f) + sp + 2 * LLBUTTON_H_PAD; button_width = llmax( w, button_width ); } S32 btn_total_width = button_width; @@ -261,33 +241,37 @@ LLAlertDialog::LLAlertDialog( LLNotificationPtr notification, bool modal) // Buttons S32 button_left = (getRect().getWidth() - btn_total_width) / 2; - for( S32 i = 0; i < num_options; i++ ) + for( options_t::iterator it = options.begin(); it != options.end(); it++ ) { LLRect button_rect; button_rect.setOriginAndSize( button_left, VPAD, button_width, BTN_HEIGHT ); + ButtonData& button_data = *it; + LLButton* btn = new LLButton( - options[i].first, button_rect, + button_data.mName, button_rect, "","", "", - NULL, NULL, + NULL, font, - options[i].second, - options[i].second); + button_data.mText, + button_data.mText); - mButtonData[i].mButton = btn; - - btn->setClickedCallback(&LLAlertDialog::onButtonPressed, (void*)(&mButtonData[i])); + btn->setClickedCallback(boost::bind(&LLAlertDialog::onButtonPressed, this, _1, button_data.mUrl)); addChild(btn); - if( i == mDefaultOption ) + if(!mDefaultButton || button_data.mDefault) { - btn->setFocus(TRUE); + mDefaultButton = btn; } button_left += button_width + BTN_HPAD; } + llassert(mDefaultButton); //'options' map should never be empty, thus mDefaultButton should always get set in the above loop. + mDefaultButton->setFocus(TRUE); + + // (Optional) Edit Box if (!edit_text_name.empty()) { @@ -346,7 +330,7 @@ bool LLAlertDialog::show() mLineEditor->setFocus(TRUE); mLineEditor->selectAll(); } - if(mDefaultOption >= 0) + if(mDefaultButton) { // delay before enabling default button mDefaultBtnTimer.start(DEFAULT_BUTTON_DELAY); @@ -385,7 +369,7 @@ bool LLAlertDialog::setCheckBox( const std::string& check_title, const std::stri check_rect.setOriginAndSize(msg_x, VPAD+BTN_HEIGHT+LINE_HEIGHT/2, max_msg_width, LINE_HEIGHT); - mCheck = new LLCheckboxCtrl(std::string("check"), check_rect, check_title, font, onClickIgnore, this); + mCheck = new LLCheckboxCtrl(std::string("check"), check_rect, check_title, font, boost::bind(&LLAlertDialog::onClickIgnore, this, _1)); addChild(mCheck); return true; @@ -402,8 +386,49 @@ void LLAlertDialog::setVisible( BOOL visible ) } } +//Fixing a hole in alert logic. If the alert isn't modal, clicking 'x' to close its floater would result +//in a dangling notification. To address this we try to find the most reasonable button to emulate clicking. +//Close tends to be the best, as it's most accurate, and is the default for alerts that lack defined buttons. +//Next up is cancel, which is the correct behavior for a majority of alert notifications +//After that, try 'ok', which is the only button that exists for a few alert notifications. 'ok' for these equates to 'dismiss'. +//Finally, if none of the above are found, issue the respond procedure with the dummy button name 'close'. void LLAlertDialog::onClose(bool app_quitting) { + if(mNote.get() && !mNote->isRespondedTo() && !mNote->isIgnored()) + { + LLButton* btn = NULL; + bool found_cancel = false; + for(child_list_const_iter_t it = beginChild(); it != endChild(); ++it) + { + LLButton* cur_btn = dynamic_cast(*it); + if(!cur_btn) + continue; + if( LLStringUtil::compareInsensitive(cur_btn->getName(), "close") == 0 )//prefer 'close' over anything else. + { + btn = cur_btn; + break; + } + else if(LLStringUtil::compareInsensitive(cur_btn->getName(), "cancel") == 0 )//prefer 'cancel' over 'ok'. + { + btn = cur_btn; + found_cancel = true; + } + else if(!found_cancel && LLStringUtil::compareInsensitive(cur_btn->getName(), "ok") == 0 )//accept 'ok' as last resort. + { + btn = cur_btn; + } + } + LLSD response = mNote->getResponseTemplate(); + if(btn) + response[btn->getName()] = true; + else + { //We found no acceptable button so just feed it a fake one. + //LLNotification::getSelectedOption will return -1 in notification callbacks. + response["Close"] = true; + } + mNote->respond(response); + + } LLModalDialog::onClose(app_quitting); } @@ -458,7 +483,7 @@ void LLAlertDialog::draw() if(mDefaultBtnTimer.hasExpired() && mDefaultBtnTimer.getStarted()) { mDefaultBtnTimer.stop(); // prevent this block from being run more than once - setDefaultBtn(mButtonData[mDefaultOption].mButton); + setDefaultBtn(mDefaultButton); } static LLColor4 shadow_color = LLUI::sColorsGroup->getColor("ColorDropShadow"); @@ -483,44 +508,37 @@ void LLAlertDialog::setEditTextArgs(const LLSD& edit_args) } } -// static -void LLAlertDialog::onButtonPressed( void* userdata ) +void LLAlertDialog::onButtonPressed( LLUICtrl* ctrl, const std::string url ) { - ButtonData* button_data = (ButtonData*)userdata; - LLAlertDialog* self = button_data->mSelf; - - LLSD response = self->mNote->getResponseTemplate(); - if (self->mLineEditor) + LLSD response = mNote->getResponseTemplate(); + if (mLineEditor) { - response[self->mLineEditor->getName()] = self->mLineEditor->getValue(); + response[mLineEditor->getName()] = mLineEditor->getValue(); } - response[button_data->mButton->getName()] = true; + response[ctrl->getName()] = true; // If we declared a URL and chose the URL option, go to the url - if (!button_data->mURL.empty() && sURLLoader != NULL) + if (!url.empty() && sURLLoader != NULL) { - sURLLoader->load(button_data->mURL); + sURLLoader->load(url); } - self->mNote->respond(response); // new notification reponse - self->close(); // deletes self + mNote->respond(response); // new notification reponse + close(); // deletes self } -//static -void LLAlertDialog::onClickIgnore(LLUICtrl* ctrl, void* user_data) +void LLAlertDialog::onClickIgnore(LLUICtrl* ctrl) { - LLAlertDialog* self = (LLAlertDialog*)user_data; - // checkbox sometimes means "hide and do the default" and // other times means "warn me again". Yuck. JC BOOL check = ctrl->getValue(); - if (self->mNote->getForm()->getIgnoreType() == LLNotificationForm::IGNORE_SHOW_AGAIN) + if (mNote->getForm()->getIgnoreType() == LLNotificationForm::IGNORE_SHOW_AGAIN) { // question was "show again" so invert value to get "ignore" check = !check; } - self->mNote->setIgnored(check); + mNote->setIgnored(check); } diff --git a/indra/llui/llalertdialog.h b/indra/llui/llalertdialog.h index 04caea651..799ab8a80 100644 --- a/indra/llui/llalertdialog.h +++ b/indra/llui/llalertdialog.h @@ -87,8 +87,8 @@ public: //statics static void initClass(); static bool onNewNotification(const LLSD& notify, bool is_modal); - static void onButtonPressed(void* userdata); - static void onClickIgnore(LLUICtrl* ctrl, void* user_data); + void onButtonPressed( LLUICtrl* ctrl, const std::string url ); + void onClickIgnore( LLUICtrl* ctrl ); private: LLNotificationPtr mNote; @@ -102,18 +102,18 @@ private: BOOL hasTitleBar() const; private: + struct ButtonData + { + std::string mName; + std::string mText; + bool mDefault; + std::string mUrl; + }; + static URLLoader* sURLLoader; static LLControlGroup* sSettings; - struct ButtonData - { - LLAlertDialog* mSelf; - LLButton* mButton; - std::string mURL; - }; - std::vector mButtonData; - - S32 mDefaultOption; + LLButton* mDefaultButton; LLCheckBoxCtrl* mCheck; BOOL mCaution; BOOL mUnique; diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index b95a96ad3..ee56d7b5d 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -123,7 +123,7 @@ void LLViewerParcelMedia::update(LLParcel* parcel) if( ! mediaUrl.empty() && gSavedSettings.getWarning("FirstStreamingVideo") ) { LLNotificationsUtil::add("ParcelCanPlayMedia", LLSD(), LLSD(), - boost::bind(callback_play_media, _1, _2, parcel)); + boost::bind(&callback_play_media, _1, _2, parcel)); return; } @@ -903,35 +903,43 @@ void callback_media_alert(const LLSD ¬ification, const LLSD &response, LLParc LLViewerParcelMedia::playStreamingMusic(parcel, false); } } - else if (option == 1 || option == 2) // Deny or Blacklist + else { - LLViewerParcelMedia::sDeniedMedia.insert(domain); - if (ip != domain && domain.find('/') == std::string::npos) - { - LLViewerParcelMedia::sDeniedMedia.insert(ip); - } if (type == 1) { LLViewerParcelMedia::stopStreamingMusic(); } - if (option == 1) // Deny + else { - LLNotificationsUtil::add("MediaBlocked", args); + LLViewerParcelMedia::stopStreamingMusic(); } - else // Blacklist + if (option == 1 || option == 2) // Deny or Blacklist { - LLSD newmedia; - newmedia["domain"] = domain; - newmedia["action"] = "deny"; - LLViewerParcelMedia::sMediaFilterList.append(newmedia); + LLViewerParcelMedia::sDeniedMedia.insert(domain); if (ip != domain && domain.find('/') == std::string::npos) { - newmedia["domain"] = ip; - LLViewerParcelMedia::sMediaFilterList.append(newmedia); + LLViewerParcelMedia::sDeniedMedia.insert(ip); + } + + if (option == 1) // Deny + { + LLNotificationsUtil::add("MediaBlocked", args); + } + else // Blacklist + { + LLSD newmedia; + newmedia["domain"] = domain; + newmedia["action"] = "deny"; + LLViewerParcelMedia::sMediaFilterList.append(newmedia); + if (ip != domain && domain.find('/') == std::string::npos) + { + newmedia["domain"] = ip; + LLViewerParcelMedia::sMediaFilterList.append(newmedia); + } + LLViewerParcelMedia::saveDomainFilterList(); + args["LISTED"] = "blacklisted"; + LLNotificationsUtil::add("MediaListed", args); } - LLViewerParcelMedia::saveDomainFilterList(); - args["LISTED"] = "blacklisted"; - LLNotificationsUtil::add("MediaListed", args); } } From e22e8d92b80c3b0b5d3f6874627ca26ba2ef93b3 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 15 Apr 2013 18:09:00 -0500 Subject: [PATCH 04/10] Disable AA when drawing ui. --- indra/llrender/llglstates.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/llrender/llglstates.h b/indra/llrender/llglstates.h index 0e2c3bcb4..266f266a6 100644 --- a/indra/llrender/llglstates.h +++ b/indra/llrender/llglstates.h @@ -110,11 +110,13 @@ protected: LLGLEnable mBlend, mAlphaTest; LLGLDisable mCullFace; LLGLDepthTest mDepthTest; + LLGLDisable mMSAA; public: LLGLSUIDefault() : mBlend(GL_BLEND), mAlphaTest(GL_ALPHA_TEST), mCullFace(GL_CULL_FACE), - mDepthTest(GL_FALSE, GL_TRUE, GL_LEQUAL) + mDepthTest(GL_FALSE, GL_TRUE, GL_LEQUAL), + mMSAA(GL_MULTISAMPLE_ARB) {} }; From 70e008bf980da0513c097965cd46cdd5a3eae031 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 15 Apr 2013 18:10:38 -0500 Subject: [PATCH 05/10] Fix some subtle bugs in llrender. --- indra/llrender/llrender.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 88cb7209c..bbf70b9de 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1495,7 +1495,7 @@ void LLRender::translateUI(F32 x, F32 y, F32 z) llerrs << "Need to push a UI translation frame before offsetting" << llendl; } - LLVector4a add(x,y,x); + LLVector4a add(x,y,z); mUIOffset.back()->add(add); } @@ -1564,13 +1564,13 @@ LLVector3 LLRender::getUIScale() { return LLVector3(1,1,1); } - return LLVector3(mUIOffset.back()->getF32ptr()); + return LLVector3(mUIScale.back()->getF32ptr()); } void LLRender::loadUIIdentity() { - if (mUIOffset.empty()) + if (mUIOffset.empty() || mUIScale.empty()) { llerrs << "Need to push UI translation frame before clearing offset." << llendl; } @@ -1730,8 +1730,10 @@ void LLRender::blendFunc(eBlendFactor color_sfactor, eBlendFactor color_dfactor, mCurrBlendAlphaSFactor = alpha_sfactor; mCurrBlendColorDFactor = color_dfactor; mCurrBlendAlphaDFactor = alpha_dfactor; - blendfunc_debug[0]=blendfunc_debug[2]=color_sfactor; - blendfunc_debug[1]=blendfunc_debug[3]=alpha_sfactor; + blendfunc_debug[0]=color_sfactor; + blendfunc_debug[1]=alpha_sfactor; + blendfunc_debug[2]=color_dfactor; + blendfunc_debug[3]=alpha_dfactor; flush(); glBlendFuncSeparateEXT(sGLBlendFactor[color_sfactor], sGLBlendFactor[color_dfactor], sGLBlendFactor[alpha_sfactor], sGLBlendFactor[alpha_dfactor]); From 75c1e74e485b7ce5274eb0fdd473b8c1ef9697a2 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 15 Apr 2013 18:12:15 -0500 Subject: [PATCH 06/10] Avoid using invalid iterator in LLNotifications::getChannel if channel is not found. --- indra/llui/llnotifications.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 8c11a50b8..c512f6816 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1094,6 +1094,7 @@ LLNotificationChannelPtr LLNotifications::getChannel(const std::string& channelN if(p == mChannels.end()) { llerrs << "Did not find channel named " << channelName << llendl; + return LLNotificationChannelPtr(); } return p->second; } From fed6639e4417a0009ddf91ee9d00d1b82cd5df4d Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 15 Apr 2013 18:16:12 -0500 Subject: [PATCH 07/10] Renamed SHAlphaMaskMaxRMSE to SHAutoMaskMaxRMSE. Disabled alpha masking on attachments. --- indra/newview/app_settings/settings_sh.xml | 2 +- indra/newview/llface.cpp | 4 ++-- indra/newview/llpreviewtexture.cpp | 4 ++-- indra/newview/llviewercontrol.cpp | 2 +- indra/newview/llviewerwindow.cpp | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/indra/newview/app_settings/settings_sh.xml b/indra/newview/app_settings/settings_sh.xml index d70e6183f..d0f7516a2 100644 --- a/indra/newview/app_settings/settings_sh.xml +++ b/indra/newview/app_settings/settings_sh.xml @@ -218,7 +218,7 @@ Value 1 - SHAlphaMaskMaxRMSE + SHAutoMaskMaxRMSE Comment Sets the maximum random mean square error cutoff used when detecting suitable textures for alphamasking. (SHUseRMSEAutoMask must be TRUE for this to have any effect) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index d2c6834b9..8b1f2a564 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1068,10 +1068,10 @@ bool LLFace::canRenderAsMask() const LLTextureEntry* te = getTextureEntry(); static const LLCachedControl use_rmse_auto_mask("SHUseRMSEAutoMask",false); - static const LLCachedControl alpha_mas_max_rmse("SHAlphaMaskMaxRMSE",.09f); + static const LLCachedControl auto_mask_max_rmse("SHAutoMaskMaxRMSE",.09f); if ((te->getColor().mV[3] == 1.0f) && // can't treat as mask if we have face alpha (te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask - getTexture()->getIsAlphaMask(use_rmse_auto_mask ? alpha_mas_max_rmse : -1.f)) // texture actually qualifies for masking (lazily recalculated but expensive) + (!getViewerObject()->isAttachment() && getTexture()->getIsAlphaMask(use_rmse_auto_mask ? auto_mask_max_rmse : -1.f))) // texture actually qualifies for masking (lazily recalculated but expensive) { if (LLPipeline::sRenderDeferred) { diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index af2ee3723..5b5649256 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -283,8 +283,8 @@ void LLPreviewTexture::draw() mImage); static const LLCachedControl use_rmse_auto_mask("SHUseRMSEAutoMask",false); - static const LLCachedControl alpha_mas_max_rmse("SHAlphaMaskMaxRMSE",.09f); - if (mAlphaMaskResult != mImage->getIsAlphaMask(use_rmse_auto_mask ? alpha_mas_max_rmse : -1.f)) + static const LLCachedControl auto_mask_max_rmse("SHAutoMaskMaxRMSE",.09f); + if (mAlphaMaskResult != mImage->getIsAlphaMask(use_rmse_auto_mask ? auto_mask_max_rmse : -1.f)) { mAlphaMaskResult = !mAlphaMaskResult; if (!mAlphaMaskResult) diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 90c6a6e1a..9e30efa3c 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -675,7 +675,7 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderAutoMaskAlphaDeferred")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderAutoMaskAlphaNonDeferred")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("SHUseRMSEAutoMask")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); - gSavedSettings.getControl("SHAlphaMaskMaxRMSE")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); + gSavedSettings.getControl("SHAutoMaskMaxRMSE")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderObjectBump")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderMaxVBOSize")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); //See LL jira VWR-3258 comment section. Implemented by LL in 2.1 -Shyotl diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 2088000f8..e8e66bc27 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -370,8 +370,8 @@ public: } } static const LLCachedControl use_rmse_auto_mask("SHUseRMSEAutoMask",false); - static const LLCachedControl alpha_mas_max_rmse("SHAlphaMaskMaxRMSE",.09f); - addText(xpos, ypos, llformat("Mask: %s", imagep->getIsAlphaMask(use_rmse_auto_mask ? alpha_mas_max_rmse : -1.f) ? "TRUE":"FALSE")); ypos += y_inc; + static const LLCachedControl auto_mask_max_rmse("SHAutoMaskMaxRMSE",.09f); + addText(xpos, ypos, llformat("Mask: %s", imagep->getIsAlphaMask(use_rmse_auto_mask ? auto_mask_max_rmse : -1.f) ? "TRUE":"FALSE")); ypos += y_inc; addText(xpos, ypos, llformat("ID: %s", imagep->getID().asString())); ypos += y_inc; } } From f52b97d58854e7fe29368c74ed2d89977a417911 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 15 Apr 2013 23:29:51 -0500 Subject: [PATCH 08/10] Fix llalertdialog.cpp (accidentally grabbed some changes that only work with future alterations I've yet to push to master.) --- indra/llui/llalertdialog.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/llui/llalertdialog.cpp b/indra/llui/llalertdialog.cpp index 7015e9c6a..feb04aa67 100644 --- a/indra/llui/llalertdialog.cpp +++ b/indra/llui/llalertdialog.cpp @@ -251,7 +251,7 @@ LLAlertDialog::LLAlertDialog( LLNotificationPtr notification, bool modal) LLButton* btn = new LLButton( button_data.mName, button_rect, "","", "", - NULL, + NULL, NULL, font, button_data.mText, button_data.mText); @@ -369,7 +369,8 @@ bool LLAlertDialog::setCheckBox( const std::string& check_title, const std::stri check_rect.setOriginAndSize(msg_x, VPAD+BTN_HEIGHT+LINE_HEIGHT/2, max_msg_width, LINE_HEIGHT); - mCheck = new LLCheckboxCtrl(std::string("check"), check_rect, check_title, font, boost::bind(&LLAlertDialog::onClickIgnore, this, _1)); + mCheck = new LLCheckboxCtrl(std::string("check"), check_rect, check_title, font); + mCheck->setCommitCallback(boost::bind(&LLAlertDialog::onClickIgnore, this, _1)); addChild(mCheck); return true; From 4cbf8b16b656311fdf615658d57782a7136790dc Mon Sep 17 00:00:00 2001 From: Shyotl Date: Tue, 16 Apr 2013 00:21:12 -0500 Subject: [PATCH 09/10] Streaming FBO checkbox in preferences->graphics->advanced enable switch was inverted due to vbo rebuild being deferred to a later frame. --- indra/newview/llpaneldisplay.cpp | 164 +++++++++++-------------------- indra/newview/llpaneldisplay.h | 30 +++--- 2 files changed, 69 insertions(+), 125 deletions(-) diff --git a/indra/newview/llpaneldisplay.cpp b/indra/newview/llpaneldisplay.cpp index 269a1f479..375781a95 100644 --- a/indra/newview/llpaneldisplay.cpp +++ b/indra/newview/llpaneldisplay.cpp @@ -105,7 +105,7 @@ LLPanelDisplay::LLPanelDisplay() BOOL LLPanelDisplay::postBuild() { // return to default values - childSetAction("Defaults", setHardwareDefaults, NULL); + getChild("Defaults")->setClickedCallback(boost::bind(&LLPanelDisplay::setHardwareDefaults)); //============================================================================ // Resolution @@ -113,8 +113,7 @@ BOOL LLPanelDisplay::postBuild() // radio set for fullscreen size mCtrlWindowed = getChild( "windowed mode"); - mCtrlWindowed->setCommitCallback(&LLPanelDisplay::onCommitWindowedMode); - mCtrlWindowed->setCallbackUserData(this); + mCtrlWindowed->setCommitCallback(boost::bind(&LLPanelDisplay::onCommitWindowedMode,this)); mAspectRatioLabel1 = getChild("AspectRatioLabel1"); mDisplayResLabel = getChild("DisplayResLabel"); @@ -194,25 +193,21 @@ BOOL LLPanelDisplay::postBuild() } mCtrlAspectRatio = getChild( "aspect_ratio"); - mCtrlAspectRatio->setTextEntryCallback(onKeystrokeAspectRatio); - mCtrlAspectRatio->setCommitCallback(onSelectAspectRatio); - mCtrlAspectRatio->setCallbackUserData(this); + mCtrlAspectRatio->setTextEntryCallback(boost::bind(&LLPanelDisplay::onKeystrokeAspectRatio,this)); + mCtrlAspectRatio->setCommitCallback(boost::bind(&LLPanelDisplay::onSelectAspectRatio,this)); // add default aspect ratios mCtrlAspectRatio->add(aspect_ratio_text, &mAspectRatio, ADD_TOP); mCtrlAspectRatio->setCurrentByIndex(0); mCtrlAutoDetectAspect = getChild( "aspect_auto_detect"); - mCtrlAutoDetectAspect->setCommitCallback(onCommitAutoDetectAspect); - mCtrlAutoDetectAspect->setCallbackUserData(this); + mCtrlAutoDetectAspect->setCommitCallback(boost::bind(&LLPanelDisplay::onCommitAutoDetectAspect,this,_2)); // radio performance box mCtrlSliderQuality = getChild("QualityPerformanceSelection"); - mCtrlSliderQuality->setSliderMouseUpCallback(boost::bind(&LLPanelDisplay::onChangeQuality,mCtrlSliderQuality,this)); - mCtrlSliderQuality->setCallbackUserData(this); + mCtrlSliderQuality->setSliderMouseUpCallback(boost::bind(&LLPanelDisplay::onChangeQuality,this,_1)); mCtrlCustomSettings = getChild("CustomSettings"); - mCtrlCustomSettings->setCommitCallback(onChangeCustom); - mCtrlCustomSettings->setCallbackUserData(this); + mCtrlCustomSettings->setCommitCallback(boost::bind(&LLPanelDisplay::onChangeCustom)); //mGraphicsBorder = getChild("GraphicsBorder"); @@ -226,24 +221,19 @@ BOOL LLPanelDisplay::postBuild() //---------------------------------------------------------------------------- // Enable Reflections mCtrlReflectionDetail = getChild("ReflectionDetailCombo"); - mCtrlReflectionDetail->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); - mCtrlReflectionDetail->setCallbackUserData(this); + mCtrlReflectionDetail->setCommitCallback(boost::bind(&LLPanelDisplay::onVertexShaderEnable)); // WindLight mCtrlWindLight = getChild("WindLightUseAtmosShaders"); - mCtrlWindLight->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); - mCtrlWindLight->setCallbackUserData(this); + mCtrlWindLight->setCommitCallback(boost::bind(&LLPanelDisplay::onVertexShaderEnable)); // Deferred mCtrlDeferred = getChild("RenderDeferred"); - mCtrlDeferred->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); - mCtrlDeferred->setCallbackUserData(this); + mCtrlDeferred->setCommitCallback(boost::bind(&LLPanelDisplay::onVertexShaderEnable)); mCtrlDeferredDoF = getChild("RenderDepthOfField"); - mCtrlDeferredDoF->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); - mCtrlDeferredDoF->setCallbackUserData(this); + mCtrlDeferredDoF->setCommitCallback(boost::bind(&LLPanelDisplay::onVertexShaderEnable)); mCtrlShadowDetail = getChild("ShadowDetailCombo"); - mCtrlShadowDetail->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); - mCtrlShadowDetail->setCallbackUserData(this); + mCtrlShadowDetail->setCommitCallback(boost::bind(&LLPanelDisplay::onVertexShaderEnable)); //---------------------------------------------------------------------------- // Terrain Scale @@ -252,15 +242,13 @@ BOOL LLPanelDisplay::postBuild() //---------------------------------------------------------------------------- // Enable Avatar Shaders mCtrlAvatarVP = getChild("AvatarVertexProgram"); - mCtrlAvatarVP->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); - mCtrlAvatarVP->setCallbackUserData(this); + mCtrlAvatarVP->setCommitCallback(boost::bind(&LLPanelDisplay::onVertexShaderEnable)); //---------------------------------------------------------------------------- // Avatar Render Mode mCtrlAvatarCloth = getChild("AvatarCloth"); mCtrlAvatarImpostors = getChild("AvatarImpostors"); - mCtrlAvatarImpostors->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); - mCtrlAvatarImpostors->setCallbackUserData(this); + mCtrlAvatarImpostors->setCommitCallback(boost::bind(&LLPanelDisplay::onVertexShaderEnable)); mCtrlNonImpostors = getChild("AvatarMaxVisible"); //---------------------------------------------------------------------------- @@ -278,8 +266,7 @@ BOOL LLPanelDisplay::postBuild() //---------------------------------------------------------------------------- // Global Shader Enable mCtrlShaderEnable = getChild("BasicShaders"); - mCtrlShaderEnable->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); - mCtrlShaderEnable->setCallbackUserData(this); + mCtrlShaderEnable->setCommitCallback(boost::bind(&LLPanelDisplay::onVertexShaderEnable)); //============================================================================ @@ -287,50 +274,42 @@ BOOL LLPanelDisplay::postBuild() mCtrlDrawDistance = getChild("DrawDistance"); mDrawDistanceMeterText1 = getChild("DrawDistanceMeterText1"); mDrawDistanceMeterText2 = getChild("DrawDistanceMeterText2"); - mCtrlDrawDistance->setCommitCallback(&LLPanelDisplay::updateMeterText); - mCtrlDrawDistance->setCallbackUserData(this); + mCtrlDrawDistance->setCommitCallback(boost::bind(&LLPanelDisplay::updateMeterText, this)); // Object detail slider mCtrlLODFactor = getChild("ObjectMeshDetail"); mLODFactorText = getChild("ObjectMeshDetailText"); - mCtrlLODFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); - mCtrlLODFactor->setCallbackUserData(mLODFactorText); + mCtrlLODFactor->setCommitCallback(boost::bind(&LLPanelDisplay::updateSliderText, _1,mLODFactorText)); // Flex object detail slider mCtrlFlexFactor = getChild("FlexibleMeshDetail"); mFlexFactorText = getChild("FlexibleMeshDetailText"); - mCtrlFlexFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); - mCtrlFlexFactor->setCallbackUserData(mFlexFactorText); + mCtrlFlexFactor->setCommitCallback(boost::bind(&LLPanelDisplay::updateSliderText,_1, mFlexFactorText)); // Tree detail slider mCtrlTreeFactor = getChild("TreeMeshDetail"); mTreeFactorText = getChild("TreeMeshDetailText"); - mCtrlTreeFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); - mCtrlTreeFactor->setCallbackUserData(mTreeFactorText); + mCtrlTreeFactor->setCommitCallback(boost::bind(&LLPanelDisplay::updateSliderText, _1, mTreeFactorText)); // Avatar detail slider mCtrlAvatarFactor = getChild("AvatarMeshDetail"); mAvatarFactorText = getChild("AvatarMeshDetailText"); - mCtrlAvatarFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); - mCtrlAvatarFactor->setCallbackUserData(mAvatarFactorText); + mCtrlAvatarFactor->setCommitCallback(boost::bind(&LLPanelDisplay::updateSliderText, _1, mAvatarFactorText)); // Avatar physics detail slider mCtrlAvatarPhysicsFactor = getChild("AvatarPhysicsDetail"); mAvatarPhysicsFactorText = getChild("AvatarPhysicsDetailText"); - mCtrlAvatarPhysicsFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); - mCtrlAvatarPhysicsFactor->setCallbackUserData(mAvatarPhysicsFactorText); + mCtrlAvatarPhysicsFactor->setCommitCallback(boost::bind(&LLPanelDisplay::updateSliderText, _1, mAvatarPhysicsFactorText)); // Terrain detail slider mCtrlTerrainFactor = getChild("TerrainMeshDetail"); mTerrainFactorText = getChild("TerrainMeshDetailText"); - mCtrlTerrainFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); - mCtrlTerrainFactor->setCallbackUserData(mTerrainFactorText); + mCtrlTerrainFactor->setCommitCallback(boost::bind(&LLPanelDisplay::updateSliderText, _1, mTerrainFactorText)); // Terrain detail slider mCtrlSkyFactor = getChild("SkyMeshDetail"); mSkyFactorText = getChild("SkyMeshDetailText"); - mCtrlSkyFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); - mCtrlSkyFactor->setCallbackUserData(mSkyFactorText); + mCtrlSkyFactor->setCommitCallback(boost::bind(&LLPanelDisplay::updateSliderText, _1, mSkyFactorText)); // Particle detail slider mCtrlMaxParticle = getChild("MaxParticleCount"); @@ -338,8 +317,7 @@ BOOL LLPanelDisplay::postBuild() // Glow detail slider mCtrlPostProcess = getChild("RenderPostProcess"); mPostProcessText = getChild("PostProcessText"); - mCtrlPostProcess->setCommitCallback(&LLPanelDisplay::updateSliderText); - mCtrlPostProcess->setCallbackUserData(mPostProcessText); + mCtrlPostProcess->setCommitCallback(boost::bind(&LLPanelDisplay::updateSliderText, _1, mPostProcessText)); // Text boxes (for enabling/disabling) mShaderText = getChild("ShadersText"); @@ -351,7 +329,11 @@ BOOL LLPanelDisplay::postBuild() mTerrainScaleText = getChild("TerrainScaleText"); // Hardware tab - childSetCommitCallback("vbo", &LLPanelDisplay::onRenderVBOEnable, this); + mVBO = getChild("vbo"); + mVBO->setCommitCallback(boost::bind(&LLPanelDisplay::onVertexShaderEnable)); + + mVBOStream = getChild("vbo_stream"); + refresh(); @@ -598,13 +580,13 @@ void LLPanelDisplay::refreshEnabledState() if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") || !gGLManager.mHasVertexBufferObject) { - childSetEnabled("vbo", false); + mVBO->setEnabled(false); //Streaming VBOs -Shyotl - childSetEnabled("vbo_stream", false); + mVBOStream->setEnabled(false); } else { - childSetEnabled("vbo_stream", LLVertexBuffer::sEnableVBOs); + mVBOStream->setEnabled(gSavedSettings.getBOOL("RenderVBOEnable")); } // if no windlight shaders, enable gamma, and fog distance @@ -811,7 +793,7 @@ void LLPanelDisplay::setHiddenGraphicsState(bool isHidden) // hide one meter text if we're making things visible if(!isHidden) { - updateMeterText(mCtrlDrawDistance, this); + updateMeterText(); } mMeshDetailText->setVisible(!isHidden); @@ -900,12 +882,11 @@ void LLPanelDisplay::apply() } } -void LLPanelDisplay::onChangeQuality(LLUICtrl *ctrl, void *data) +void LLPanelDisplay::onChangeQuality(LLUICtrl* caller) { - LLSliderCtrl* sldr = static_cast(ctrl); - LLPanelDisplay* cur_panel = static_cast(data); + LLSliderCtrl* sldr = static_cast(caller); - if(sldr == NULL || cur_panel == NULL) + if(sldr == NULL) { return; } @@ -914,19 +895,14 @@ void LLPanelDisplay::onChangeQuality(LLUICtrl *ctrl, void *data) LLFeatureManager::getInstance()->setGraphicsLevel(set, true); LLFloaterPreference::refreshEnabledGraphics(); - cur_panel->refresh(); + refresh(); } -void LLPanelDisplay::onChangeCustom(LLUICtrl *ctrl, void *data) +void LLPanelDisplay::onChangeCustom() { LLFloaterPreference::refreshEnabledGraphics(); } -void LLPanelDisplay::onApplyResolution(LLUICtrl* src, void* user_data) -{ - ((LLPanelDisplay*) src)->applyResolution(); -} - void LLPanelDisplay::applyResolution() { @@ -1018,20 +994,14 @@ void LLPanelDisplay::applyWindowSize() } } -//static -void LLPanelDisplay::onCommitWindowedMode(LLUICtrl* ctrl, void *data) +void LLPanelDisplay::onCommitWindowedMode() { - LLPanelDisplay *panel = (LLPanelDisplay*)data; - - panel->refresh(); + refresh(); } -//static -void LLPanelDisplay::onCommitAutoDetectAspect(LLUICtrl *ctrl, void *data) +void LLPanelDisplay::onCommitAutoDetectAspect(const LLSD& value) { - LLPanelDisplay *panel = (LLPanelDisplay*)data; - - BOOL auto_detect = ((LLCheckBoxCtrl*)ctrl)->get(); + BOOL auto_detect = value.asBoolean(); F32 ratio; if (auto_detect) @@ -1053,27 +1023,21 @@ void LLPanelDisplay::onCommitAutoDetectAspect(LLUICtrl *ctrl, void *data) aspect = llformat("%.3f", gViewerWindow->mWindow->getNativeAspectRatio()); } - panel->mCtrlAspectRatio->setLabel(aspect); + mCtrlAspectRatio->setLabel(aspect); ratio = gViewerWindow->mWindow->getNativeAspectRatio(); gSavedSettings.setF32("FullScreenAspectRatio", ratio); } } -//static -void LLPanelDisplay::onKeystrokeAspectRatio(LLLineEditor* caller, void* user_data) +void LLPanelDisplay::onKeystrokeAspectRatio() { - LLPanelDisplay* panel = (LLPanelDisplay*)user_data; - - panel->mCtrlAutoDetectAspect->set(FALSE); + mCtrlAutoDetectAspect->set(FALSE); } -//static -void LLPanelDisplay::onSelectAspectRatio(LLUICtrl*, void* user_data) +void LLPanelDisplay::onSelectAspectRatio() { - LLPanelDisplay* panel = (LLPanelDisplay*)user_data; - - panel->mCtrlAutoDetectAspect->set(FALSE); + mCtrlAutoDetectAspect->set(FALSE); } //static @@ -1092,22 +1056,13 @@ void LLPanelDisplay::fractionFromDecimal(F32 decimal_val, S32& numerator, S32& d } } -//static -void LLPanelDisplay::onVertexShaderEnable(LLUICtrl* self, void* data) +void LLPanelDisplay::onVertexShaderEnable() { LLFloaterPreference::refreshEnabledGraphics(); } //static -void LLPanelDisplay::onRenderVBOEnable(LLUICtrl* self, void* data) -{ - LLPanelDisplay* panel = (LLPanelDisplay*)data; - bool enable = panel->childGetValue("vbo").asBoolean(); - panel->childSetEnabled("vbo_stream", enable); - if(!enable) panel->childSetValue("vbo_stream", false); -} - -void LLPanelDisplay::setHardwareDefaults(void* user_data) +void LLPanelDisplay::setHardwareDefaults() { LLFeatureManager::getInstance()->applyRecommendedSettings(); LLControlVariable* controlp = gSavedSettings.getControl("RenderAvatarMaxVisible"); @@ -1118,11 +1073,11 @@ void LLPanelDisplay::setHardwareDefaults(void* user_data) LLFloaterPreference::refreshEnabledGraphics(); } -void LLPanelDisplay::updateSliderText(LLUICtrl* ctrl, void* user_data) +//static +void LLPanelDisplay::updateSliderText(LLUICtrl* ctrl, LLTextBox* text_box) { // get our UI widgets - LLTextBox* text_box = (LLTextBox*)user_data; - LLSliderCtrl* slider = (LLSliderCtrl*) ctrl; + LLSliderCtrl* slider = dynamic_cast(ctrl); if(text_box == NULL || slider == NULL) { return; @@ -1160,20 +1115,13 @@ void LLPanelDisplay::updateSliderText(LLUICtrl* ctrl, void* user_data) } } -void LLPanelDisplay::updateMeterText(LLUICtrl* ctrl, void* user_data) +void LLPanelDisplay::updateMeterText() { - // get our UI widgets - LLPanelDisplay* panel = (LLPanelDisplay*)user_data; - LLSliderCtrl* slider = (LLSliderCtrl*) ctrl; - - LLTextBox* m1 = panel->getChild("DrawDistanceMeterText1"); - LLTextBox* m2 = panel->getChild("DrawDistanceMeterText2"); - // toggle the two text boxes based on whether we have 2 or 3 digits - F32 val = slider->getValueF32(); + F32 val = mCtrlDrawDistance->getValueF32(); bool two_digits = val < 100; - m1->setVisible(two_digits); - m2->setVisible(!two_digits); + mDrawDistanceMeterText1->setVisible(two_digits); + mDrawDistanceMeterText2->setVisible(!two_digits); } diff --git a/indra/newview/llpaneldisplay.h b/indra/newview/llpaneldisplay.h index 304c674a4..9b39ee555 100644 --- a/indra/newview/llpaneldisplay.h +++ b/indra/newview/llpaneldisplay.h @@ -146,6 +146,9 @@ protected: LLTextBox *mShadowDetailText; LLTextBox *mTerrainScaleText; + LLCheckBoxCtrl *mVBO; + LLCheckBoxCtrl *mVBOStream; + BOOL mFSAutoDetectAspect; F32 mAspectRatio; @@ -192,31 +195,24 @@ protected: S32 mVideoCardMem; F32 mFogRatio; - static void setGraphicsSettings(LLControlGroup& group); - static void createGroup(); - // if the quality radio buttons are changed - static void onChangeQuality(LLUICtrl *ctrl, void *data); + void onChangeQuality(LLUICtrl* caller); // if the custom settings box is clicked - static void onChangeCustom(LLUICtrl *ctrl, void *data); + static void onChangeCustom(); - static void onCommitAutoDetectAspect(LLUICtrl *ctrl, void *data); - static void onKeystrokeAspectRatio(LLLineEditor* caller, void* user_data); - static void onSelectAspectRatio(LLUICtrl*, void*); - static void onCommitWindowedMode(LLUICtrl* ctrl, void *data); - static void onApplyResolution(LLUICtrl* ctrl, void* data); - static void updateSliderText(LLUICtrl* ctrl, void* user_data); - static void updateMeterText(LLUICtrl* ctrl, void* user_data); + void onCommitAutoDetectAspect(const LLSD& value); + void onKeystrokeAspectRatio(); + void onSelectAspectRatio(); + void onCommitWindowedMode(); + static void updateSliderText(LLUICtrl* ctrl, LLTextBox* text_box); + void updateMeterText(); /// callback for defaults - static void setHardwareDefaults(void *data); + static void setHardwareDefaults(); // callback for when client turns on shaders - static void onVertexShaderEnable(LLUICtrl*, void*); - - // callbacks for hardware tab - static void onRenderVBOEnable(LLUICtrl*, void*); + static void onVertexShaderEnable(); // helper function static void fractionFromDecimal(F32 decimal_val, S32& numerator, S32& denominator); From 11358746dacb61f613dbeced9228127a49d07e4b Mon Sep 17 00:00:00 2001 From: Shyotl Date: Tue, 16 Apr 2013 10:49:56 -0500 Subject: [PATCH 10/10] Use legacy function pointer for old legacy setTextEntryCallback signature. --- indra/newview/llpaneldisplay.cpp | 9 ++++++--- indra/newview/llpaneldisplay.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/indra/newview/llpaneldisplay.cpp b/indra/newview/llpaneldisplay.cpp index 375781a95..d354dc516 100644 --- a/indra/newview/llpaneldisplay.cpp +++ b/indra/newview/llpaneldisplay.cpp @@ -193,7 +193,8 @@ BOOL LLPanelDisplay::postBuild() } mCtrlAspectRatio = getChild( "aspect_ratio"); - mCtrlAspectRatio->setTextEntryCallback(boost::bind(&LLPanelDisplay::onKeystrokeAspectRatio,this)); + mCtrlAspectRatio->setTextEntryCallback(&LLPanelDisplay::onKeystrokeAspectRatio); + mCtrlAspectRatio->setCallbackUserData(this); mCtrlAspectRatio->setCommitCallback(boost::bind(&LLPanelDisplay::onSelectAspectRatio,this)); // add default aspect ratios mCtrlAspectRatio->add(aspect_ratio_text, &mAspectRatio, ADD_TOP); @@ -1030,9 +1031,11 @@ void LLPanelDisplay::onCommitAutoDetectAspect(const LLSD& value) } } -void LLPanelDisplay::onKeystrokeAspectRatio() +void LLPanelDisplay::onKeystrokeAspectRatio(LLLineEditor* caller, void *user_data) { - mCtrlAutoDetectAspect->set(FALSE); + LLPanelDisplay* panel = (LLPanelDisplay*)user_data; + + panel->mCtrlAutoDetectAspect->set(FALSE); } void LLPanelDisplay::onSelectAspectRatio() diff --git a/indra/newview/llpaneldisplay.h b/indra/newview/llpaneldisplay.h index 9b39ee555..07b6b6dbe 100644 --- a/indra/newview/llpaneldisplay.h +++ b/indra/newview/llpaneldisplay.h @@ -202,7 +202,7 @@ protected: static void onChangeCustom(); void onCommitAutoDetectAspect(const LLSD& value); - void onKeystrokeAspectRatio(); + static void onKeystrokeAspectRatio(LLLineEditor* caller, void *user_data); void onSelectAspectRatio(); void onCommitWindowedMode(); static void updateSliderText(LLUICtrl* ctrl, LLTextBox* text_box);