History

Merge branch 'master' of https://github.com/worklist/hifi into 19495

stojce committed 12 years ago

Commit cd1ec972 parents e6ea51a cbe948040 files · +800 −246Browse files

Showing the changes to interface/src/Menu.cpp (1 of 40 files). Show all

Unified · Split

interface/src/Menu.cpp+36−7
@@ -1062,15 +1062,10 @@ void Menu::showChat() { · 1061 unmodified lines
10621062 if (!_chatWindow) {
10631063 _chatWindow = new ChatWindow();
10641064 QMainWindow* mainWindow = Application::getInstance()->getWindow();
1065−
1066− // the height of the title bar is given by frameGeometry().height() - geometry().height()
1067− // however, frameGeometry() is initialised after showing (Qt queries the OS windowing system)
1068− // on the other hand, moving a window after showing it flickers; so just use some reasonable value
1069− int titleBarHeight = 16;
10701065 _chatWindow->setGeometry(mainWindow->width() - _chatWindow->width(),
1071− mainWindow->geometry().y() + titleBarHeight,
1066+ mainWindow->geometry().y(),
10721067 _chatWindow->width(),
1073− mainWindow->height() - titleBarHeight);
1068+ mainWindow->height());
10741069 _chatWindow->show();
10751070 }
10761071 _chatWindow->raise();
@@ -1114,6 +1109,40 @@ void Menu::octreeStatsDetailsClosed() { · 37 unmodified lines
11141109 }
11151110 }
11161111
1112+QString Menu::getLODFeedbackText() {
1113+ // determine granularity feedback
1114+ int boundaryLevelAdjust = getBoundaryLevelAdjust();
1115+ QString granularityFeedback;
1116+
1117+ switch (boundaryLevelAdjust) {
1118+ case 0: {
1119+ granularityFeedback = QString("at standard granularity.");
1120+ } break;
1121+ case 1: {
1122+ granularityFeedback = QString("at half of standard granularity.");
1123+ } break;
1124+ case 2: {
1125+ granularityFeedback = QString("at a third of standard granularity.");
1126+ } break;
1127+ default: {
1128+ granularityFeedback = QString("at 1/%1th of standard granularity.").arg(boundaryLevelAdjust + 1);
1129+ } break;
1130+ }
1131+
1132+ // distance feedback
1133+ float voxelSizeScale = getVoxelSizeScale();
1134+ float relativeToDefault = voxelSizeScale / DEFAULT_OCTREE_SIZE_SCALE;
1135+ QString result;
1136+ if (relativeToDefault > 1.01) {
1137+ result = QString("%1 further %2").arg(relativeToDefault,8,'f',2).arg(granularityFeedback);
1138+ } else if (relativeToDefault > 0.99) {
1139+ result = QString("the default distance %1").arg(granularityFeedback);
1140+ } else {
1141+ result = QString("%1 of default %2").arg(relativeToDefault,8,'f',3).arg(granularityFeedback);
1142+ }
1143+ return result;
1144+}
1145+
11171146 void Menu::autoAdjustLOD(float currentFPS) {
11181147 // NOTE: our first ~100 samples at app startup are completely all over the place, and we don't
11191148 // really want to count them in our average, so we will ignore the real frame rates and stuff