mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 05:17:08 +02:00
Some simple code cleanup
This commit is contained in:
parent
8415098fc2
commit
e30b119464
4 changed files with 46 additions and 63 deletions
|
@ -87,44 +87,9 @@ Menu* Menu::getInstance() {
|
||||||
return _instance;
|
return _instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
const float DEFAULT_FACESHIFT_EYE_DEFLECTION = 0.25f;
|
|
||||||
const QString DEFAULT_FACESHIFT_HOSTNAME = "localhost";
|
|
||||||
const float DEFAULT_AVATAR_LOD_DISTANCE_MULTIPLIER = 1.0f;
|
|
||||||
const int ONE_SECOND_OF_FRAMES = 60;
|
|
||||||
const int FIVE_SECONDS_OF_FRAMES = 5 * ONE_SECOND_OF_FRAMES;
|
|
||||||
|
|
||||||
const QString CONSOLE_TITLE = "Scripting Console";
|
|
||||||
const float CONSOLE_WINDOW_OPACITY = 0.95f;
|
|
||||||
const int CONSOLE_WIDTH = 800;
|
|
||||||
const int CONSOLE_HEIGHT = 200;
|
|
||||||
|
|
||||||
Menu::Menu() :
|
Menu::Menu() :
|
||||||
_actionHash(),
|
|
||||||
_receivedAudioStreamSettings(),
|
|
||||||
_fieldOfView(DEFAULT_FIELD_OF_VIEW_DEGREES),
|
|
||||||
_realWorldFieldOfView(DEFAULT_REAL_WORLD_FIELD_OF_VIEW_DEGREES),
|
|
||||||
_faceshiftEyeDeflection(DEFAULT_FACESHIFT_EYE_DEFLECTION),
|
|
||||||
_faceshiftHostname(DEFAULT_FACESHIFT_HOSTNAME),
|
|
||||||
_jsConsole(NULL),
|
|
||||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
|
||||||
_speechRecognizer(),
|
|
||||||
#endif
|
|
||||||
_octreeSizeScale(DEFAULT_OCTREE_SIZE_SCALE),
|
|
||||||
_oculusUIAngularSize(DEFAULT_OCULUS_UI_ANGULAR_SIZE),
|
|
||||||
_sixenseReticleMoveSpeed(DEFAULT_SIXENSE_RETICLE_MOVE_SPEED),
|
|
||||||
_invertSixenseButtons(DEFAULT_INVERT_SIXENSE_MOUSE_BUTTONS),
|
|
||||||
_automaticAvatarLOD(true),
|
|
||||||
_avatarLODDecreaseFPS(DEFAULT_ADJUST_AVATAR_LOD_DOWN_FPS),
|
|
||||||
_avatarLODIncreaseFPS(ADJUST_LOD_UP_FPS),
|
|
||||||
_avatarLODDistanceMultiplier(DEFAULT_AVATAR_LOD_DISTANCE_MULTIPLIER),
|
|
||||||
_boundaryLevelAdjust(0),
|
|
||||||
_maxOctreePacketsPerSecond(DEFAULT_MAX_OCTREE_PPS),
|
|
||||||
_lastAdjust(usecTimestampNow()),
|
_lastAdjust(usecTimestampNow()),
|
||||||
_lastAvatarDetailDrop(usecTimestampNow()),
|
_lastAvatarDetailDrop(usecTimestampNow())
|
||||||
_fpsAverage(FIVE_SECONDS_OF_FRAMES),
|
|
||||||
_fastFPSAverage(ONE_SECOND_OF_FRAMES),
|
|
||||||
_hasLoginDialogDisplayed(false),
|
|
||||||
_shouldRenderTableNeedsRebuilding(true)
|
|
||||||
{
|
{
|
||||||
Application *appInstance = Application::getInstance();
|
Application *appInstance = Application::getInstance();
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,13 @@ const float MINIMUM_AVATAR_LOD_DISTANCE_MULTIPLIER = 0.1f;
|
||||||
const float MAXIMUM_AVATAR_LOD_DISTANCE_MULTIPLIER = 15.0f;
|
const float MAXIMUM_AVATAR_LOD_DISTANCE_MULTIPLIER = 15.0f;
|
||||||
|
|
||||||
const QString SETTINGS_ADDRESS_KEY = "address";
|
const QString SETTINGS_ADDRESS_KEY = "address";
|
||||||
|
|
||||||
|
const float DEFAULT_FACESHIFT_EYE_DEFLECTION = 0.25f;
|
||||||
|
const QString DEFAULT_FACESHIFT_HOSTNAME = "localhost";
|
||||||
|
const float DEFAULT_AVATAR_LOD_DISTANCE_MULTIPLIER = 1.0f;
|
||||||
|
const int ONE_SECOND_OF_FRAMES = 60;
|
||||||
|
const int FIVE_SECONDS_OF_FRAMES = 5 * ONE_SECOND_OF_FRAMES;
|
||||||
|
|
||||||
class QSettings;
|
class QSettings;
|
||||||
|
|
||||||
class AddressBarDialog;
|
class AddressBarDialog;
|
||||||
|
@ -240,32 +247,37 @@ private:
|
||||||
|
|
||||||
QHash<QString, QAction*> _actionHash;
|
QHash<QString, QAction*> _actionHash;
|
||||||
InboundAudioStream::Settings _receivedAudioStreamSettings;
|
InboundAudioStream::Settings _receivedAudioStreamSettings;
|
||||||
float _fieldOfView; /// in Degrees, doesn't apply to HMD like Oculus
|
// in Degrees, doesn't apply to HMD like Oculus
|
||||||
float _realWorldFieldOfView; // The actual FOV set by the user's monitor size and view distance
|
float _fieldOfView = DEFAULT_FIELD_OF_VIEW_DEGREES;
|
||||||
float _faceshiftEyeDeflection;
|
// The actual FOV set by the user's monitor size and view distance
|
||||||
QString _faceshiftHostname;
|
float _realWorldFieldOfView = DEFAULT_REAL_WORLD_FIELD_OF_VIEW_DEGREES;
|
||||||
QPointer<MetavoxelEditor> _MetavoxelEditor;
|
float _faceshiftEyeDeflection = DEFAULT_FACESHIFT_EYE_DEFLECTION;
|
||||||
QPointer<MetavoxelNetworkSimulator> _metavoxelNetworkSimulator;
|
QString _faceshiftHostname = DEFAULT_FACESHIFT_HOSTNAME;
|
||||||
QPointer<ScriptEditorWindow> _ScriptEditor;
|
|
||||||
QPointer<ChatWindow> _chatWindow;
|
QDialog* _jsConsole = nullptr;
|
||||||
QDialog* _jsConsole;
|
|
||||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
||||||
SpeechRecognizer _speechRecognizer;
|
SpeechRecognizer _speechRecognizer;
|
||||||
#endif
|
#endif
|
||||||
float _octreeSizeScale;
|
float _octreeSizeScale = DEFAULT_OCTREE_SIZE_SCALE;
|
||||||
float _oculusUIAngularSize;
|
float _oculusUIAngularSize;// = DEFAULT_OCULUS_UI_ANGULAR_SIZE;
|
||||||
float _sixenseReticleMoveSpeed;
|
float _sixenseReticleMoveSpeed;// = DEFAULT_SIXENSE_RETICLE_MOVE_SPEED;
|
||||||
bool _invertSixenseButtons;
|
bool _invertSixenseButtons;// = DEFAULT_INVERT_SIXENSE_MOUSE_BUTTONS;
|
||||||
bool _automaticAvatarLOD;
|
bool _hasLoginDialogDisplayed = false;
|
||||||
float _avatarLODDecreaseFPS;
|
|
||||||
float _avatarLODIncreaseFPS;
|
bool _automaticAvatarLOD = true;
|
||||||
float _avatarLODDistanceMultiplier;
|
float _avatarLODDecreaseFPS = DEFAULT_ADJUST_AVATAR_LOD_DOWN_FPS;
|
||||||
int _boundaryLevelAdjust;
|
float _avatarLODIncreaseFPS = ADJUST_LOD_UP_FPS;
|
||||||
int _maxOctreePacketsPerSecond;
|
float _avatarLODDistanceMultiplier = DEFAULT_AVATAR_LOD_DISTANCE_MULTIPLIER;
|
||||||
|
|
||||||
|
int _boundaryLevelAdjust = 0;
|
||||||
|
int _maxOctreePacketsPerSecond = DEFAULT_MAX_OCTREE_PPS;
|
||||||
|
|
||||||
quint64 _lastAdjust;
|
quint64 _lastAdjust;
|
||||||
quint64 _lastAvatarDetailDrop;
|
quint64 _lastAvatarDetailDrop;
|
||||||
SimpleMovingAverage _fpsAverage;
|
|
||||||
SimpleMovingAverage _fastFPSAverage;
|
SimpleMovingAverage _fpsAverage = FIVE_SECONDS_OF_FRAMES;
|
||||||
|
SimpleMovingAverage _fastFPSAverage = ONE_SECOND_OF_FRAMES;
|
||||||
|
|
||||||
QPointer<AddressBarDialog> _addressBarDialog;
|
QPointer<AddressBarDialog> _addressBarDialog;
|
||||||
QPointer<AnimationsDialog> _animationsDialog;
|
QPointer<AnimationsDialog> _animationsDialog;
|
||||||
QPointer<AttachmentsDialog> _attachmentsDialog;
|
QPointer<AttachmentsDialog> _attachmentsDialog;
|
||||||
|
@ -278,16 +290,20 @@ private:
|
||||||
QPointer<LoginDialog> _loginDialog;
|
QPointer<LoginDialog> _loginDialog;
|
||||||
QPointer<OctreeStatsDialog> _octreeStatsDialog;
|
QPointer<OctreeStatsDialog> _octreeStatsDialog;
|
||||||
QPointer<PreferencesDialog> _preferencesDialog;
|
QPointer<PreferencesDialog> _preferencesDialog;
|
||||||
bool _hasLoginDialogDisplayed;
|
|
||||||
|
QPointer<MetavoxelEditor> _MetavoxelEditor;
|
||||||
|
QPointer<MetavoxelNetworkSimulator> _metavoxelNetworkSimulator;
|
||||||
|
QPointer<ScriptEditorWindow> _ScriptEditor;
|
||||||
|
QPointer<ChatWindow> _chatWindow;
|
||||||
|
|
||||||
QAction* _loginAction = nullptr;
|
QAction* _loginAction = nullptr;
|
||||||
QAction* _chatAction = nullptr;
|
QAction* _chatAction = nullptr;
|
||||||
QString _snapshotsLocation;
|
QString _snapshotsLocation;
|
||||||
QString _scriptsLocation;
|
QString _scriptsLocation;
|
||||||
QByteArray _walletPrivateKey;
|
QByteArray _walletPrivateKey;
|
||||||
|
|
||||||
bool _shouldRenderTableNeedsRebuilding;
|
bool _shouldRenderTableNeedsRebuilding = true;
|
||||||
QMap<float, float> _shouldRenderTable;
|
QMap<float, float> _shouldRenderTable;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace MenuOption {
|
namespace MenuOption {
|
||||||
|
@ -405,7 +421,6 @@ namespace MenuOption {
|
||||||
const QString RenderTargetFramerate40 = "40";
|
const QString RenderTargetFramerate40 = "40";
|
||||||
const QString RenderTargetFramerate30 = "30";
|
const QString RenderTargetFramerate30 = "30";
|
||||||
const QString RenderTargetFramerateVSyncOn = "V-Sync On";
|
const QString RenderTargetFramerateVSyncOn = "V-Sync On";
|
||||||
|
|
||||||
const QString RenderResolution = "Scale Resolution";
|
const QString RenderResolution = "Scale Resolution";
|
||||||
const QString RenderResolutionOne = "1";
|
const QString RenderResolutionOne = "1";
|
||||||
const QString RenderResolutionTwoThird = "2/3";
|
const QString RenderResolutionTwoThird = "2/3";
|
||||||
|
|
|
@ -20,6 +20,11 @@
|
||||||
#include "ui_console.h"
|
#include "ui_console.h"
|
||||||
#include "ScriptEngine.h"
|
#include "ScriptEngine.h"
|
||||||
|
|
||||||
|
const QString CONSOLE_TITLE = "Scripting Console";
|
||||||
|
const float CONSOLE_WINDOW_OPACITY = 0.95f;
|
||||||
|
const int CONSOLE_WIDTH = 800;
|
||||||
|
const int CONSOLE_HEIGHT = 200;
|
||||||
|
|
||||||
class JSConsole : public QWidget {
|
class JSConsole : public QWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -31,8 +31,6 @@
|
||||||
#include "FlowLayout.h"
|
#include "FlowLayout.h"
|
||||||
#include "JSConsole.h"
|
#include "JSConsole.h"
|
||||||
|
|
||||||
const int CONSOLE_HEIGHT = 150;
|
|
||||||
|
|
||||||
ScriptEditorWindow::ScriptEditorWindow() :
|
ScriptEditorWindow::ScriptEditorWindow() :
|
||||||
_ScriptEditorWindowUI(new Ui::ScriptEditorWindow),
|
_ScriptEditorWindowUI(new Ui::ScriptEditorWindow),
|
||||||
_loadMenu(new QMenu),
|
_loadMenu(new QMenu),
|
||||||
|
|
Loading…
Reference in a new issue