aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpaneldisplay.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llpaneldisplay.cpp')
-rw-r--r--linden/indra/newview/llpaneldisplay.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/linden/indra/newview/llpaneldisplay.cpp b/linden/indra/newview/llpaneldisplay.cpp
index cc70f79..3e60745 100644
--- a/linden/indra/newview/llpaneldisplay.cpp
+++ b/linden/indra/newview/llpaneldisplay.cpp
@@ -70,7 +70,7 @@
70#include "pipeline.h" 70#include "pipeline.h"
71#include "lluictrlfactory.h" 71#include "lluictrlfactory.h"
72#include "llfeaturemanager.h" 72#include "llfeaturemanager.h"
73#include "llglslshader.h" 73#include "llviewershadermgr.h"
74#include "llfloaterhardwaresettings.h" 74#include "llfloaterhardwaresettings.h"
75#include "llboost.h" 75#include "llboost.h"
76 76
@@ -125,7 +125,7 @@ BOOL LLPanelDisplay::postBuild()
125 125
126 mCtrlFullScreen = getChild<LLComboBox>( "fullscreen combo"); 126 mCtrlFullScreen = getChild<LLComboBox>( "fullscreen combo");
127 127
128 LLUIString resolution_label = getUIString("resolution_format"); 128 LLUIString resolution_label = getString("resolution_format");
129 129
130 for (S32 i = 0; i < num_resolutions; i++) 130 for (S32 i = 0; i < num_resolutions; i++)
131 { 131 {
@@ -181,7 +181,7 @@ BOOL LLPanelDisplay::postBuild()
181 S32 denominator = 0; 181 S32 denominator = 0;
182 fractionFromDecimal(mAspectRatio, numerator, denominator); 182 fractionFromDecimal(mAspectRatio, numerator, denominator);
183 183
184 LLUIString aspect_ratio_text = getUIString("aspect_ratio_text"); 184 LLUIString aspect_ratio_text = getString("aspect_ratio_text");
185 if (numerator != 0) 185 if (numerator != 0)
186 { 186 {
187 aspect_ratio_text.setArg("[NUM]", llformat("%d", numerator)); 187 aspect_ratio_text.setArg("[NUM]", llformat("%d", numerator));
@@ -338,7 +338,7 @@ void LLPanelDisplay::initWindowSizeControls()
338 U32 height_test = 0; 338 U32 height_test = 0;
339 U32 width_test = 0; 339 U32 width_test = 0;
340 mCtrlWindowSize->setCurrentByIndex(i); 340 mCtrlWindowSize->setCurrentByIndex(i);
341 if (extractWindowSizeFromString(mCtrlWindowSize->getValue().asString().c_str(), width_test, height_test)) 341 if (extractWindowSizeFromString(mCtrlWindowSize->getValue().asString(), width_test, height_test))
342 { 342 {
343 if ((height_test == height) && (width_test == width)) 343 if ((height_test == height) && (width_test == width))
344 { 344 {
@@ -347,7 +347,7 @@ void LLPanelDisplay::initWindowSizeControls()
347 } 347 }
348 } 348 }
349 // ...otherwise, add a new entry with the current window height/width. 349 // ...otherwise, add a new entry with the current window height/width.
350 LLUIString resolution_label = getUIString("resolution_format"); 350 LLUIString resolution_label = getString("resolution_format");
351 resolution_label.setArg("[RES_X]", llformat("%d", width)); 351 resolution_label.setArg("[RES_X]", llformat("%d", width));
352 resolution_label.setArg("[RES_Y]", llformat("%d", height)); 352 resolution_label.setArg("[RES_Y]", llformat("%d", height));
353 mCtrlWindowSize->add(resolution_label, ADD_TOP); 353 mCtrlWindowSize->add(resolution_label, ADD_TOP);
@@ -448,11 +448,11 @@ void LLPanelDisplay::refreshEnabledState()
448 // Reflections 448 // Reflections
449 BOOL reflections = gSavedSettings.getBOOL("VertexShaderEnable") 449 BOOL reflections = gSavedSettings.getBOOL("VertexShaderEnable")
450 && gGLManager.mHasCubeMap 450 && gGLManager.mHasCubeMap
451 && LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap"); 451 && LLCubeMap::sUseCubeMaps;
452 mCtrlReflections->setEnabled(reflections); 452 mCtrlReflections->setEnabled(reflections);
453 453
454 // Bump & Shiny 454 // Bump & Shiny
455 bool bumpshiny = gGLManager.mHasCubeMap && LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap") && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump"); 455 bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump");
456 mCtrlBumpShiny->setEnabled(bumpshiny ? TRUE : FALSE); 456 mCtrlBumpShiny->setEnabled(bumpshiny ? TRUE : FALSE);
457 457
458 for (S32 i = 0; i < mRadioReflectionDetail->getItemCount(); ++i) 458 for (S32 i = 0; i < mRadioReflectionDetail->getItemCount(); ++i)
@@ -461,7 +461,7 @@ void LLPanelDisplay::refreshEnabledState()
461 } 461 }
462 462
463 // Avatar Mode 463 // Avatar Mode
464 S32 max_avatar_shader = LLShaderMgr::sMaxAvatarShaderLevel; 464 S32 max_avatar_shader = LLViewerShaderMgr::instance()->mMaxAvatarShaderLevel;
465 mCtrlAvatarVP->setEnabled((max_avatar_shader > 0) ? TRUE : FALSE); 465 mCtrlAvatarVP->setEnabled((max_avatar_shader > 0) ? TRUE : FALSE);
466 466
467 if (gSavedSettings.getBOOL("VertexShaderEnable") == FALSE || 467 if (gSavedSettings.getBOOL("VertexShaderEnable") == FALSE ||
@@ -756,6 +756,7 @@ void LLPanelDisplay::applyResolution()
756 char aspect_ratio_text[ASPECT_RATIO_STR_LEN]; /*Flawfinder: ignore*/ 756 char aspect_ratio_text[ASPECT_RATIO_STR_LEN]; /*Flawfinder: ignore*/
757 if (mCtrlAspectRatio->getCurrentIndex() == -1) 757 if (mCtrlAspectRatio->getCurrentIndex() == -1)
758 { 758 {
759 // *Can't pass const char* from c_str() into strtok
759 strncpy(aspect_ratio_text, mCtrlAspectRatio->getSimple().c_str(), sizeof(aspect_ratio_text) -1); /*Flawfinder: ignore*/ 760 strncpy(aspect_ratio_text, mCtrlAspectRatio->getSimple().c_str(), sizeof(aspect_ratio_text) -1); /*Flawfinder: ignore*/
760 aspect_ratio_text[sizeof(aspect_ratio_text) -1] = '\0'; 761 aspect_ratio_text[sizeof(aspect_ratio_text) -1] = '\0';
761 char *element = strtok(aspect_ratio_text, ":/\\"); 762 char *element = strtok(aspect_ratio_text, ":/\\");
@@ -863,12 +864,12 @@ void LLPanelDisplay::applyResolution()
863} 864}
864 865
865// Extract from strings of the form "<width> x <height>", e.g. "640 x 480". 866// Extract from strings of the form "<width> x <height>", e.g. "640 x 480".
866bool LLPanelDisplay::extractWindowSizeFromString(const char *sInput, U32 &width, U32 &height) 867bool LLPanelDisplay::extractWindowSizeFromString(const std::string& instr, U32 &width, U32 &height)
867{ 868{
868 using namespace boost; 869 using namespace boost;
869 cmatch what; 870 cmatch what;
870 const regex expression("([0-9]+) x ([0-9]+)"); 871 const regex expression("([0-9]+) x ([0-9]+)");
871 if (regex_match(sInput, what, expression)) 872 if (regex_match(instr.c_str(), what, expression))
872 { 873 {
873 width = atoi(what[1].first); 874 width = atoi(what[1].first);
874 height = atoi(what[2].first); 875 height = atoi(what[2].first);
@@ -917,7 +918,7 @@ void LLPanelDisplay::onCommitAutoDetectAspect(LLUICtrl *ctrl, void *data)
917 gViewerWindow->mWindow->setNativeAspectRatio(0.f); 918 gViewerWindow->mWindow->setNativeAspectRatio(0.f);
918 fractionFromDecimal(gViewerWindow->mWindow->getNativeAspectRatio(), numerator, denominator); 919 fractionFromDecimal(gViewerWindow->mWindow->getNativeAspectRatio(), numerator, denominator);
919 920
920 LLString aspect; 921 std::string aspect;
921 if (numerator != 0) 922 if (numerator != 0)
922 { 923 {
923 aspect = llformat("%d:%d", numerator, denominator); 924 aspect = llformat("%d:%d", numerator, denominator);
@@ -997,15 +998,15 @@ void LLPanelDisplay::updateSliderText(LLUICtrl* ctrl, void* user_data)
997 // choose the right text 998 // choose the right text
998 if(slider->getValueF32() < midPoint) 999 if(slider->getValueF32() < midPoint)
999 { 1000 {
1000 text_box->setText(LLString("Low")); 1001 text_box->setText(std::string("Low"));
1001 } 1002 }
1002 else if (slider->getValueF32() < highPoint) 1003 else if (slider->getValueF32() < highPoint)
1003 { 1004 {
1004 text_box->setText(LLString("Mid")); 1005 text_box->setText(std::string("Mid"));
1005 } 1006 }
1006 else 1007 else
1007 { 1008 {
1008 text_box->setText(LLString("High")); 1009 text_box->setText(std::string("High"));
1009 } 1010 }
1010} 1011}
1011 1012