diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llpaneldisplay.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llpaneldisplay.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/linden/indra/newview/llpaneldisplay.cpp b/linden/indra/newview/llpaneldisplay.cpp index cc70f79..23379cf 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 | ||
@@ -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 | { |
@@ -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". |
866 | bool LLPanelDisplay::extractWindowSizeFromString(const char *sInput, U32 &width, U32 &height) | 867 | bool 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 | ||