From df6aa397f9982e6d3696ac512f9e58aaeef141e2 Mon Sep 17 00:00:00 2001 From: Salvatore La Bua Date: Sun, 22 Sep 2013 00:11:54 +0200 Subject: [PATCH 1/2] Added a menu toggle item at Advanced > UI > Show FPS to show fps as an ui element. The related Debug Setting is: SLBShowFPS --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llviewermenu.cpp | 1 + indra/newview/llviewerwindow.cpp | 7 +++++++ 3 files changed, 19 insertions(+) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7e7bb4796..301624f94 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -846,6 +846,17 @@ Found in Advanced->Rendering->Info Displays Value 0 + SLBShowFPS + + Comment + Show FPS + Persist + 1 + Type + Boolean + Value + 0 + LogShowHistoryLines Comment diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 1526fc8c1..ae8f23910 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1204,6 +1204,7 @@ void init_debug_ui_menu(LLMenuGL* menu) menu->addChild(new LLMenuItemCheckGL("Show Render Info", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowRenderInfo")); menu->addChild(new LLMenuItemCheckGL("Show Matrices", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowRenderMatrices")); menu->addChild(new LLMenuItemCheckGL("Show Color Under Cursor", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowColor")); + menu->addChild(new LLMenuItemCheckGL("Show FPS", menu_toggle_control, NULL, menu_check_control, (void*)"SLBShowFPS")); menu->createJumpKeys(); } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 3e57959b4..867d10857 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -729,6 +729,13 @@ public: ypos += y_inc; } + static const LLCachedControl slb_show_fps("SLBShowFPS"); + if (slb_show_fps) + { + addText(xpos+280, ypos+5, llformat("FPS %3.1f", LLViewerStats::getInstance()->mFPSStat.getMeanPerSec())); + ypos += y_inc; + } + static const LLCachedControl DebugShowPrivateMem("DebugShowPrivateMem",false); if (DebugShowPrivateMem) { From 67720c6a6a47cb938b92aa640404b3c637fe95e7 Mon Sep 17 00:00:00 2001 From: Salvatore La Bua Date: Sun, 22 Sep 2013 01:14:47 +0200 Subject: [PATCH 2/2] Fixed position of ui element Show FPS to the bottom right corner --- indra/newview/llviewerwindow.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 867d10857..3e4d71f6d 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -309,6 +309,13 @@ public: U32 ypos = 64; const U32 y_inc = 20; + static const LLCachedControl slb_show_fps("SLBShowFPS"); + if (slb_show_fps) + { + addText(xpos+280, ypos+5, llformat("FPS %3.1f", LLViewerStats::getInstance()->mFPSStat.getMeanPerSec())); + ypos += y_inc; + } + static const LLCachedControl debug_show_time("DebugShowTime"); if (debug_show_time) { @@ -729,13 +736,6 @@ public: ypos += y_inc; } - static const LLCachedControl slb_show_fps("SLBShowFPS"); - if (slb_show_fps) - { - addText(xpos+280, ypos+5, llformat("FPS %3.1f", LLViewerStats::getInstance()->mFPSStat.getMeanPerSec())); - ypos += y_inc; - } - static const LLCachedControl DebugShowPrivateMem("DebugShowPrivateMem",false); if (DebugShowPrivateMem) {