From 648d0f6d433113b65dcef2aa588d00e26e555f89 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Mon, 20 Jul 2015 15:12:27 -0700 Subject: [PATCH] fix a bunch of warnings --- interface/src/Application.cpp | 4 ++-- interface/src/GLCanvas.cpp | 4 ++-- interface/src/Stars.cpp | 16 +++++++++------- interface/src/avatar/FaceModel.cpp | 1 - interface/src/devices/OculusManager.cpp | 2 ++ interface/src/ui/ApplicationOverlay.cpp | 8 ++++---- interface/src/ui/ApplicationOverlay.h | 2 +- interface/src/ui/overlays/LocalModelsOverlay.cpp | 2 -- libraries/render-utils/src/TextRenderer3D.cpp | 1 - libraries/render-utils/src/TextRenderer3D.h | 1 - tests/render-utils/src/main.cpp | 2 +- 11 files changed, 21 insertions(+), 22 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index ce156354fb..a6444bb98d 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -333,11 +333,11 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : _isThrottleFPSEnabled(false), _aboutToQuit(false), _notifiedPacketVersionMismatchThisDomain(false), + _glWidget(new GLCanvas()), _domainConnectionRefusals(QList()), _maxOctreePPS(maxOctreePacketsPerSecond.get()), _lastFaceTrackerUpdate(0), - _applicationOverlay(), - _glWidget(new GLCanvas()) + _applicationOverlay() { setInstance(this); #ifdef Q_OS_WIN diff --git a/interface/src/GLCanvas.cpp b/interface/src/GLCanvas.cpp index be7ed6ec72..705a98b855 100644 --- a/interface/src/GLCanvas.cpp +++ b/interface/src/GLCanvas.cpp @@ -60,8 +60,8 @@ void GLCanvas::initializeGL() { void GLCanvas::paintGL() { PROFILE_RANGE(__FUNCTION__); - if (!_throttleRendering - && (!Application::getInstance()->getWindow()->isMinimized()) || !Application::getInstance()->isThrottleFPSEnabled()) { + if (!_throttleRendering && + (!Application::getInstance()->getWindow()->isMinimized() || !Application::getInstance()->isThrottleFPSEnabled())) { Application::getInstance()->paintGL(); } } diff --git a/interface/src/Stars.cpp b/interface/src/Stars.cpp index e6c96d9b4b..5f15363ab1 100644 --- a/interface/src/Stars.cpp +++ b/interface/src/Stars.cpp @@ -31,14 +31,14 @@ static const float TILT = 0.0f; static const unsigned int STARFIELD_NUM_STARS = 50000; static const unsigned int STARFIELD_SEED = 1; -static const float STAR_COLORIZATION = 0.1f; +//static const float STAR_COLORIZATION = 0.1f; static const float TAU = 6.28318530717958f; -static const float HALF_TAU = TAU / 2.0f; -static const float QUARTER_TAU = TAU / 4.0f; -static const float MILKY_WAY_WIDTH = TAU / 30.0f; // width in radians of one half of the Milky Way -static const float MILKY_WAY_INCLINATION = 0.0f; // angle of Milky Way from horizontal in degrees -static const float MILKY_WAY_RATIO = 0.4f; +//static const float HALF_TAU = TAU / 2.0f; +//static const float QUARTER_TAU = TAU / 4.0f; +//static const float MILKY_WAY_WIDTH = TAU / 30.0f; // width in radians of one half of the Milky Way +//static const float MILKY_WAY_INCLINATION = 0.0f; // angle of Milky Way from horizontal in degrees +//static const float MILKY_WAY_RATIO = 0.4f; static const char* UNIFORM_TIME_NAME = "iGlobalTime"; @@ -55,9 +55,11 @@ static float frand() { } // Produce a random radian value between 0 and 2 PI (TAU) +/* static float rrand() { return frand() * TAU; } + */ // http://mathworld.wolfram.com/SpherePointPicking.html static vec2 randPolar() { @@ -117,7 +119,7 @@ void Stars::render(RenderArgs* renderArgs, float alpha) { static std::once_flag once; const int VERTICES_SLOT = 0; - const int COLOR_SLOT = 2; + //const int COLOR_SLOT = 2; std::call_once(once, [&] { QElapsedTimer startTime; diff --git a/interface/src/avatar/FaceModel.cpp b/interface/src/avatar/FaceModel.cpp index 170965bb4d..16b370d459 100644 --- a/interface/src/avatar/FaceModel.cpp +++ b/interface/src/avatar/FaceModel.cpp @@ -49,7 +49,6 @@ void FaceModel::simulate(float deltaTime, bool fullUpdate) { } void FaceModel::maybeUpdateNeckRotation(const JointState& parentState, const FBXJoint& joint, JointState& state) { - Avatar* owningAvatar = static_cast(_owningHead->_owningAvatar); // get the rotation axes in joint space and use them to adjust the rotation glm::mat3 axes = glm::mat3_cast(glm::quat()); glm::mat3 inverse = glm::mat3(glm::inverse(parentState.getTransform() * diff --git a/interface/src/devices/OculusManager.cpp b/interface/src/devices/OculusManager.cpp index 9395584a66..f9c2adc785 100644 --- a/interface/src/devices/OculusManager.cpp +++ b/interface/src/devices/OculusManager.cpp @@ -398,6 +398,8 @@ void OculusManager::connect(QOpenGLContext* shareContext) { int configResult = ovrHmd_ConfigureRendering(_ovrHmd, &cfg.Config, distortionCaps, _eyeFov, _eyeRenderDesc); assert(configResult); + Q_UNUSED(configResult); + _outputWindow->doneCurrent(); for_each_eye([&](ovrEyeType eye) { diff --git a/interface/src/ui/ApplicationOverlay.cpp b/interface/src/ui/ApplicationOverlay.cpp index ed2c68aba5..2c1b01fee1 100644 --- a/interface/src/ui/ApplicationOverlay.cpp +++ b/interface/src/ui/ApplicationOverlay.cpp @@ -32,8 +32,8 @@ const vec4 CONNECTION_STATUS_BORDER_COLOR{ 1.0f, 0.0f, 0.0f, 0.8f }; const float CONNECTION_STATUS_BORDER_LINE_WIDTH = 4.0f; -static const float ORTHO_NEAR_CLIP = -10000; -static const float ORTHO_FAR_CLIP = 10000; +static const float ORTHO_NEAR_CLIP = -1000; +static const float ORTHO_FAR_CLIP = 1000; ApplicationOverlay::ApplicationOverlay() { @@ -131,7 +131,7 @@ void ApplicationOverlay::renderAudioScope(RenderArgs* renderArgs) { batch.setResourceTexture(0, textureCache->getWhiteTexture()); int width = renderArgs->_viewport.z; int height = renderArgs->_viewport.w; - mat4 legacyProjection = glm::ortho(0, width, height, 0, -1000, 1000); + mat4 legacyProjection = glm::ortho(0, width, height, 0, ORTHO_NEAR_CLIP, ORTHO_FAR_CLIP); batch.setProjectionTransform(legacyProjection); batch.setModelTransform(Transform()); batch.setViewTransform(Transform()); @@ -151,7 +151,7 @@ void ApplicationOverlay::renderOverlays(RenderArgs* renderArgs) { batch.setResourceTexture(0, textureCache->getWhiteTexture()); int width = renderArgs->_viewport.z; int height = renderArgs->_viewport.w; - mat4 legacyProjection = glm::ortho(0, width, height, 0, -1000, 1000); + mat4 legacyProjection = glm::ortho(0, width, height, 0, ORTHO_NEAR_CLIP, ORTHO_FAR_CLIP); batch.setProjectionTransform(legacyProjection); batch.setModelTransform(Transform()); batch.setViewTransform(Transform()); diff --git a/interface/src/ui/ApplicationOverlay.h b/interface/src/ui/ApplicationOverlay.h index 92485fba82..66cf591e21 100644 --- a/interface/src/ui/ApplicationOverlay.h +++ b/interface/src/ui/ApplicationOverlay.h @@ -13,7 +13,7 @@ #define hifi_ApplicationOverlay_h #include -class QOpenGLFramebufferObject; +//class QOpenGLFramebufferObject; // Handles the drawing of the overlays to the screen // TODO, move divide up the rendering, displaying and input handling diff --git a/interface/src/ui/overlays/LocalModelsOverlay.cpp b/interface/src/ui/overlays/LocalModelsOverlay.cpp index 9a2733c739..875ffb1a35 100644 --- a/interface/src/ui/overlays/LocalModelsOverlay.cpp +++ b/interface/src/ui/overlays/LocalModelsOverlay.cpp @@ -31,8 +31,6 @@ void LocalModelsOverlay::update(float deltatime) { void LocalModelsOverlay::render(RenderArgs* args) { if (_visible) { - float glowLevel = getGlowLevel(); // FIXME, glowing removed for now - auto batch = args ->_batch; Transform transform = Transform(); transform.setTranslation(args->_viewFrustum->getPosition() + getPosition()); diff --git a/libraries/render-utils/src/TextRenderer3D.cpp b/libraries/render-utils/src/TextRenderer3D.cpp index 5519300a2e..c3056be00b 100644 --- a/libraries/render-utils/src/TextRenderer3D.cpp +++ b/libraries/render-utils/src/TextRenderer3D.cpp @@ -40,7 +40,6 @@ TextRenderer3D* TextRenderer3D::getInstance(const char* family, float pointSize, TextRenderer3D::TextRenderer3D(const char* family, float pointSize, int weight, bool italic, EffectType effect, int effectThickness) : - _pointSize(pointSize), _effectType(effect), _effectThickness(effectThickness), _font(Font::load(family)) { diff --git a/libraries/render-utils/src/TextRenderer3D.h b/libraries/render-utils/src/TextRenderer3D.h index c5af61a252..ea230016f2 100644 --- a/libraries/render-utils/src/TextRenderer3D.h +++ b/libraries/render-utils/src/TextRenderer3D.h @@ -54,7 +54,6 @@ private: // text color glm::vec4 _color; - float _pointSize{ DEFAULT_POINT_SIZE }; Font* _font; }; diff --git a/tests/render-utils/src/main.cpp b/tests/render-utils/src/main.cpp index 350db8c879..3b7eb18368 100644 --- a/tests/render-utils/src/main.cpp +++ b/tests/render-utils/src/main.cpp @@ -184,7 +184,7 @@ protected: #define SERIF_FONT_FAMILY "Times New Roman" #endif -static const wchar_t* EXAMPLE_TEXT = L"Hello"; +//static const wchar_t* EXAMPLE_TEXT = L"Hello"; //static const wchar_t* EXAMPLE_TEXT = L"\xC1y Hello 1.0\ny\xC1 line 2\n\xC1y"; static const glm::uvec2 QUAD_OFFSET(10, 10);