diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llpaneldisplay.cpp | 51 |
1 files changed, 13 insertions, 38 deletions
diff --git a/linden/indra/newview/llpaneldisplay.cpp b/linden/indra/newview/llpaneldisplay.cpp index ea3d7e7..a8611b1 100644 --- a/linden/indra/newview/llpaneldisplay.cpp +++ b/linden/indra/newview/llpaneldisplay.cpp | |||
@@ -247,11 +247,11 @@ void LLPanelDisplay::onApplyResolution(LLUICtrl* src, void* user_data) | |||
247 | 247 | ||
248 | void LLPanelDisplay::applyResolution() | 248 | void LLPanelDisplay::applyResolution() |
249 | { | 249 | { |
250 | char aspect_ratio_text[ASPECT_RATIO_STR_LEN]; | 250 | char aspect_ratio_text[ASPECT_RATIO_STR_LEN]; /*Flawfinder: ignore*/ |
251 | if (mCtrlAspectRatio->getCurrentIndex() == -1) | 251 | if (mCtrlAspectRatio->getCurrentIndex() == -1) |
252 | { | 252 | { |
253 | strcpy(aspect_ratio_text, mCtrlAspectRatio->getSimple().c_str()); | 253 | strncpy(aspect_ratio_text, mCtrlAspectRatio->getSimple().c_str(), sizeof(aspect_ratio_text) -1); /*Flawfinder: ignore*/ |
254 | 254 | aspect_ratio_text[sizeof(aspect_ratio_text) -1] = '\0'; | |
255 | char *element = strtok(aspect_ratio_text, ":/\\"); | 255 | char *element = strtok(aspect_ratio_text, ":/\\"); |
256 | if (!element) | 256 | if (!element) |
257 | { | 257 | { |
@@ -385,7 +385,7 @@ void LLPanelDisplay::onCommitAutoDetectAspect(LLUICtrl *ctrl, void *data) | |||
385 | 385 | ||
386 | if (auto_detect) | 386 | if (auto_detect) |
387 | { | 387 | { |
388 | char aspect[100]; | 388 | char aspect[100]; /*Flawfinder: ignore*/ |
389 | S32 numerator = 0; | 389 | S32 numerator = 0; |
390 | S32 denominator = 0; | 390 | S32 denominator = 0; |
391 | // clear any aspect ratio override | 391 | // clear any aspect ratio override |
@@ -394,11 +394,11 @@ void LLPanelDisplay::onCommitAutoDetectAspect(LLUICtrl *ctrl, void *data) | |||
394 | 394 | ||
395 | if (numerator != 0) | 395 | if (numerator != 0) |
396 | { | 396 | { |
397 | sprintf(aspect, "%d:%d", numerator, denominator); | 397 | snprintf(aspect, sizeof(aspect), "%d:%d", numerator, denominator); /*Flawfinder: ignore*/ |
398 | } | 398 | } |
399 | else | 399 | else |
400 | { | 400 | { |
401 | sprintf(aspect, "%.3f", gViewerWindow->mWindow->getNativeAspectRatio()); | 401 | snprintf(aspect, sizeof(aspect), "%.3f", gViewerWindow->mWindow->getNativeAspectRatio()); /*Flawfinder: ignore*/ |
402 | } | 402 | } |
403 | 403 | ||
404 | panel->mCtrlAspectRatio->setLabel(aspect); | 404 | panel->mCtrlAspectRatio->setLabel(aspect); |
@@ -449,7 +449,7 @@ BOOL LLPanelDisplay2::postBuild() | |||
449 | 449 | ||
450 | requires("ani", WIDGET_TYPE_CHECKBOX); | 450 | requires("ani", WIDGET_TYPE_CHECKBOX); |
451 | requires("gamma", WIDGET_TYPE_SPINNER); | 451 | requires("gamma", WIDGET_TYPE_SPINNER); |
452 | requires("agp", WIDGET_TYPE_CHECKBOX); | 452 | requires("vbo", WIDGET_TYPE_CHECKBOX); |
453 | requires("video card memory radio", WIDGET_TYPE_RADIO_GROUP); | 453 | requires("video card memory radio", WIDGET_TYPE_RADIO_GROUP); |
454 | requires("fog", WIDGET_TYPE_SPINNER); | 454 | requires("fog", WIDGET_TYPE_SPINNER); |
455 | requires("particles", WIDGET_TYPE_SPINNER); | 455 | requires("particles", WIDGET_TYPE_SPINNER); |
@@ -460,35 +460,9 @@ BOOL LLPanelDisplay2::postBuild() | |||
460 | return FALSE; | 460 | return FALSE; |
461 | } | 461 | } |
462 | 462 | ||
463 | //============================================================================ | ||
464 | //Visual Enancements | ||
465 | |||
466 | // Anisotropic filtering checkbox | ||
467 | mCtrlAnisotropic = LLUICtrlFactory::getCheckBoxByName(this, "ani"); | ||
468 | |||
469 | //============================================================================ | ||
470 | // Gamma | ||
471 | mCtrlGamma = LLUICtrlFactory::getSpinnerByName(this, "gamma"); | ||
472 | |||
473 | // Nighttime brigtness detail slider | ||
474 | mCtrlNighttimeBrightness = LLUICtrlFactory::getSpinnerByName(this, "nighttime_brightness"); | ||
475 | |||
476 | //============================================================================ | ||
477 | // Use AGP | ||
478 | mCtrlUseAGP = LLUICtrlFactory::getCheckBoxByName(this, "agp"); | ||
479 | |||
480 | // Graphics Card Memory | 463 | // Graphics Card Memory |
481 | mRadioVideoCardMem = LLUICtrlFactory::getRadioGroupByName(this, "video card memory radio"); | 464 | mRadioVideoCardMem = LLUICtrlFactory::getRadioGroupByName(this, "video card memory radio"); |
482 | 465 | ||
483 | // Fog ratio spin ctrl | ||
484 | mCtrlFogRatio = LLUICtrlFactory::getSpinnerByName(this, "fog"); | ||
485 | |||
486 | // Particle count spin ctrl | ||
487 | mCtrlParticles = LLUICtrlFactory::getSpinnerByName(this, "particles"); | ||
488 | |||
489 | // Avatar composite limit spin ctrl | ||
490 | mCtrlCompositeLimit = LLUICtrlFactory::getSpinnerByName(this, "comp limit"); | ||
491 | |||
492 | refresh(); | 466 | refresh(); |
493 | 467 | ||
494 | return TRUE; | 468 | return TRUE; |
@@ -504,7 +478,7 @@ void LLPanelDisplay2::refresh() | |||
504 | { | 478 | { |
505 | LLPanel::refresh(); | 479 | LLPanel::refresh(); |
506 | 480 | ||
507 | mUseAGP = gSavedSettings.getBOOL("RenderUseAGP"); | 481 | mUseVBO = gSavedSettings.getBOOL("RenderVBOEnable"); |
508 | mUseAniso = gSavedSettings.getBOOL("RenderAnisotropic"); | 482 | mUseAniso = gSavedSettings.getBOOL("RenderAnisotropic"); |
509 | mGamma = gSavedSettings.getF32("RenderGamma"); | 483 | mGamma = gSavedSettings.getF32("RenderGamma"); |
510 | mBrightness = gSavedSettings.getF32("RenderNightBrightness"); | 484 | mBrightness = gSavedSettings.getF32("RenderNightBrightness"); |
@@ -525,9 +499,10 @@ void LLPanelDisplay2::refreshEnabledState() | |||
525 | mRadioVideoCardMem->getRadioButton(i)->setEnabled(FALSE); | 499 | mRadioVideoCardMem->getRadioButton(i)->setEnabled(FALSE); |
526 | } | 500 | } |
527 | 501 | ||
528 | if (!gGLManager.mHasAnyAGP || !gFeatureManagerp->isFeatureAvailable("RenderAGP")) | 502 | if (!gFeatureManagerp->isFeatureAvailable("RenderVBO") || |
503 | !gGLManager.mHasVertexBufferObject) | ||
529 | { | 504 | { |
530 | mCtrlUseAGP->setEnabled(FALSE); | 505 | childSetEnabled("vbo", FALSE); |
531 | } | 506 | } |
532 | } | 507 | } |
533 | 508 | ||
@@ -535,7 +510,7 @@ void LLPanelDisplay2::apply() | |||
535 | { | 510 | { |
536 | // Anisotropic rendering | 511 | // Anisotropic rendering |
537 | BOOL old_anisotropic = LLImageGL::sGlobalUseAnisotropic; | 512 | BOOL old_anisotropic = LLImageGL::sGlobalUseAnisotropic; |
538 | LLImageGL::sGlobalUseAnisotropic = mCtrlAnisotropic->get(); | 513 | LLImageGL::sGlobalUseAnisotropic = childGetValue("ani"); |
539 | if (old_anisotropic != LLImageGL::sGlobalUseAnisotropic) | 514 | if (old_anisotropic != LLImageGL::sGlobalUseAnisotropic) |
540 | { | 515 | { |
541 | BOOL logged_in = (gStartupState >= STATE_STARTED); | 516 | BOOL logged_in = (gStartupState >= STATE_STARTED); |
@@ -549,7 +524,7 @@ void LLPanelDisplay2::apply() | |||
549 | 524 | ||
550 | void LLPanelDisplay2::cancel() | 525 | void LLPanelDisplay2::cancel() |
551 | { | 526 | { |
552 | gSavedSettings.setBOOL("RenderUseAGP", mUseAGP); | 527 | gSavedSettings.setBOOL("RenderVBOEnable", mUseVBO); |
553 | gSavedSettings.setBOOL("RenderAnisotropic", mUseAniso); | 528 | gSavedSettings.setBOOL("RenderAnisotropic", mUseAniso); |
554 | gSavedSettings.setF32("RenderGamma", mGamma); | 529 | gSavedSettings.setF32("RenderGamma", mGamma); |
555 | gSavedSettings.setF32("RenderNightBrightness", mBrightness); | 530 | gSavedSettings.setF32("RenderNightBrightness", mBrightness); |