diff options
author | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
commit | b2afb8800bb033a04bb3ecdf0363068d56648ef1 (patch) | |
tree | 3568129b5bbddb47cd39d622b4137a8fbff4abaf /linden/indra/newview/llpaneldisplay.cpp | |
parent | Second Life viewer sources 1.14.0.1 (diff) | |
download | meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.zip meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.gz meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.bz2 meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.xz |
Second Life viewer sources 1.15.0.2
Diffstat (limited to 'linden/indra/newview/llpaneldisplay.cpp')
-rw-r--r-- | linden/indra/newview/llpaneldisplay.cpp | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/linden/indra/newview/llpaneldisplay.cpp b/linden/indra/newview/llpaneldisplay.cpp index a8611b1..d22d1c2 100644 --- a/linden/indra/newview/llpaneldisplay.cpp +++ b/linden/indra/newview/llpaneldisplay.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -66,6 +67,7 @@ | |||
66 | #include "pipeline.h" | 67 | #include "pipeline.h" |
67 | #include "llvieweruictrlfactory.h" | 68 | #include "llvieweruictrlfactory.h" |
68 | #include "llfeaturemanager.h" | 69 | #include "llfeaturemanager.h" |
70 | #include "llglslshader.h" | ||
69 | 71 | ||
70 | //RN temporary includes for resolution switching | 72 | //RN temporary includes for resolution switching |
71 | #include "llglheaders.h" | 73 | #include "llglheaders.h" |
@@ -394,11 +396,11 @@ void LLPanelDisplay::onCommitAutoDetectAspect(LLUICtrl *ctrl, void *data) | |||
394 | 396 | ||
395 | if (numerator != 0) | 397 | if (numerator != 0) |
396 | { | 398 | { |
397 | snprintf(aspect, sizeof(aspect), "%d:%d", numerator, denominator); /*Flawfinder: ignore*/ | 399 | snprintf(aspect, sizeof(aspect), "%d:%d", numerator, denominator); /* Flawfinder: ignore */ |
398 | } | 400 | } |
399 | else | 401 | else |
400 | { | 402 | { |
401 | snprintf(aspect, sizeof(aspect), "%.3f", gViewerWindow->mWindow->getNativeAspectRatio()); /*Flawfinder: ignore*/ | 403 | snprintf(aspect, sizeof(aspect), "%.3f", gViewerWindow->mWindow->getNativeAspectRatio()); /* Flawfinder: ignore */ |
402 | } | 404 | } |
403 | 405 | ||
404 | panel->mCtrlAspectRatio->setLabel(aspect); | 406 | panel->mCtrlAspectRatio->setLabel(aspect); |
@@ -454,6 +456,7 @@ BOOL LLPanelDisplay2::postBuild() | |||
454 | requires("fog", WIDGET_TYPE_SPINNER); | 456 | requires("fog", WIDGET_TYPE_SPINNER); |
455 | requires("particles", WIDGET_TYPE_SPINNER); | 457 | requires("particles", WIDGET_TYPE_SPINNER); |
456 | requires("comp limit", WIDGET_TYPE_SPINNER); | 458 | requires("comp limit", WIDGET_TYPE_SPINNER); |
459 | requires("debug beacon line width", WIDGET_TYPE_SPINNER); | ||
457 | 460 | ||
458 | if (!checkRequirements()) | 461 | if (!checkRequirements()) |
459 | { | 462 | { |
@@ -486,6 +489,7 @@ void LLPanelDisplay2::refresh() | |||
486 | mFogRatio = gSavedSettings.getF32("RenderFogRatio"); | 489 | mFogRatio = gSavedSettings.getF32("RenderFogRatio"); |
487 | mParticleCount = gSavedSettings.getS32("RenderMaxPartCount"); | 490 | mParticleCount = gSavedSettings.getS32("RenderMaxPartCount"); |
488 | mCompositeLimit = gSavedSettings.getS32("AvatarCompositeLimit"); | 491 | mCompositeLimit = gSavedSettings.getS32("AvatarCompositeLimit"); |
492 | mDebugBeaconLineWidth = gSavedSettings.getS32("DebugBeaconLineWidth"); | ||
489 | 493 | ||
490 | refreshEnabledState(); | 494 | refreshEnabledState(); |
491 | } | 495 | } |
@@ -532,6 +536,7 @@ void LLPanelDisplay2::cancel() | |||
532 | gSavedSettings.setF32("RenderFogRatio", mFogRatio); | 536 | gSavedSettings.setF32("RenderFogRatio", mFogRatio); |
533 | gSavedSettings.setS32("RenderMaxPartCount", mParticleCount); | 537 | gSavedSettings.setS32("RenderMaxPartCount", mParticleCount); |
534 | gSavedSettings.setS32("AvatarCompositeLimit", mCompositeLimit); | 538 | gSavedSettings.setS32("AvatarCompositeLimit", mCompositeLimit); |
539 | gSavedSettings.setS32("DebugBeaconLineWidth", mDebugBeaconLineWidth); | ||
535 | } | 540 | } |
536 | 541 | ||
537 | //============================================================================ | 542 | //============================================================================ |
@@ -546,6 +551,7 @@ BOOL LLPanelDisplay3::postBuild() | |||
546 | requires("bumpshiny", WIDGET_TYPE_CHECKBOX); | 551 | requires("bumpshiny", WIDGET_TYPE_CHECKBOX); |
547 | requires("ripple", WIDGET_TYPE_CHECKBOX); | 552 | requires("ripple", WIDGET_TYPE_CHECKBOX); |
548 | requires("avatarvp", WIDGET_TYPE_CHECKBOX); | 553 | requires("avatarvp", WIDGET_TYPE_CHECKBOX); |
554 | requires("shaders", WIDGET_TYPE_CHECKBOX); | ||
549 | 555 | ||
550 | requires("Avatar Appearance", WIDGET_TYPE_RADIO_GROUP); | 556 | requires("Avatar Appearance", WIDGET_TYPE_RADIO_GROUP); |
551 | requires("lighting detail radio", WIDGET_TYPE_RADIO_GROUP); | 557 | requires("lighting detail radio", WIDGET_TYPE_RADIO_GROUP); |
@@ -587,6 +593,13 @@ BOOL LLPanelDisplay3::postBuild() | |||
587 | // radio set for terrain detail mode | 593 | // radio set for terrain detail mode |
588 | mRadioTerrainDetail = LLUICtrlFactory::getRadioGroupByName(this, "terrain detail radio"); | 594 | mRadioTerrainDetail = LLUICtrlFactory::getRadioGroupByName(this, "terrain detail radio"); |
589 | 595 | ||
596 | //---------------------------------------------------------------------------- | ||
597 | // Global Shader Enable | ||
598 | mCtrlShaderEnable = LLUICtrlFactory::getCheckBoxByName(this, "shaders"); | ||
599 | mCtrlShaderEnable->setCommitCallback(&LLPanelDisplay3::onVertexShaderEnable); | ||
600 | mCtrlShaderEnable->setCallbackUserData(this); | ||
601 | |||
602 | |||
590 | //============================================================================ | 603 | //============================================================================ |
591 | 604 | ||
592 | // Object detail slider | 605 | // Object detail slider |
@@ -618,6 +631,7 @@ void LLPanelDisplay3::refresh() | |||
618 | mBumpShiny = gSavedSettings.getBOOL("RenderObjectBump"); | 631 | mBumpShiny = gSavedSettings.getBOOL("RenderObjectBump"); |
619 | mRippleWater = gSavedSettings.getBOOL("RenderRippleWater"); | 632 | mRippleWater = gSavedSettings.getBOOL("RenderRippleWater"); |
620 | mAvatarVP = gSavedSettings.getBOOL("RenderAvatarVP"); | 633 | mAvatarVP = gSavedSettings.getBOOL("RenderAvatarVP"); |
634 | mShaderEnable = gSavedSettings.getBOOL("VertexShaderEnable"); | ||
621 | mAvatarMode = gSavedSettings.getS32("RenderAvatarMode"); | 635 | mAvatarMode = gSavedSettings.getS32("RenderAvatarMode"); |
622 | mLightingDetail = gSavedSettings.getS32("RenderLightingDetail"); | 636 | mLightingDetail = gSavedSettings.getS32("RenderLightingDetail"); |
623 | mTerrainDetail = gSavedSettings.getS32("RenderTerrainDetail"); | 637 | mTerrainDetail = gSavedSettings.getS32("RenderTerrainDetail"); |
@@ -632,32 +646,28 @@ void LLPanelDisplay3::refresh() | |||
632 | void LLPanelDisplay3::refreshEnabledState() | 646 | void LLPanelDisplay3::refreshEnabledState() |
633 | { | 647 | { |
634 | // Ripple Water | 648 | // Ripple Water |
635 | if (gPipeline.getMaxVertexShaderLevel(LLPipeline::SHADER_ENVIRONMENT) < 2) | 649 | bool ripple = (LLShaderMgr::getMaxVertexShaderLevel(LLShaderMgr::SHADER_ENVIRONMENT) >= 2); |
636 | { | 650 | mCtrlRippleWater->setEnabled(ripple ? TRUE : FALSE); |
637 | mCtrlRippleWater->setEnabled(FALSE); | 651 | |
638 | } | ||
639 | // Avatar Mode | 652 | // Avatar Mode |
640 | S32 max_avatar_shader = gPipeline.getMaxVertexShaderLevel(LLPipeline::SHADER_AVATAR); | 653 | S32 max_avatar_shader = LLShaderMgr::getMaxVertexShaderLevel(LLShaderMgr::SHADER_AVATAR); |
641 | if (max_avatar_shader == 0) | 654 | mCtrlAvatarVP->setEnabled((max_avatar_shader > 0) ? TRUE : FALSE); |
642 | { | ||
643 | mCtrlAvatarVP->setEnabled(FALSE); | ||
644 | } | ||
645 | else | ||
646 | { | ||
647 | mCtrlAvatarVP->setEnabled(TRUE); | ||
648 | } | ||
649 | 655 | ||
650 | if (gSavedSettings.getBOOL("RenderAvatarVP") == FALSE) | 656 | if (gSavedSettings.getBOOL("RenderAvatarVP") == FALSE) |
651 | { | 657 | { |
652 | max_avatar_shader = 1; | 658 | max_avatar_shader = 1; |
653 | } | 659 | } |
654 | |||
655 | max_avatar_shader = llmax(max_avatar_shader, 1); | 660 | max_avatar_shader = llmax(max_avatar_shader, 1); |
656 | |||
657 | for (S32 i = 0; i < mCtrlAvatarMode->getItemCount(); i++) | 661 | for (S32 i = 0; i < mCtrlAvatarMode->getItemCount(); i++) |
658 | { | 662 | { |
659 | mCtrlAvatarMode->setIndexEnabled(i, i < max_avatar_shader); | 663 | mCtrlAvatarMode->setIndexEnabled(i, i < max_avatar_shader); |
660 | } | 664 | } |
665 | if (mCtrlAvatarMode->getSelectedIndex() >= max_avatar_shader) | ||
666 | { | ||
667 | mCtrlAvatarMode->setSelectedIndex(llmax(max_avatar_shader-1,0)); | ||
668 | } | ||
669 | // Vertex Shaders | ||
670 | mCtrlShaderEnable->setEnabled(gPipeline.canUseVertexShaders()); | ||
661 | } | 671 | } |
662 | 672 | ||
663 | void LLPanelDisplay3::apply() | 673 | void LLPanelDisplay3::apply() |