From 3dc8bd47aebe90a16e3cbd1e1e1049fee065fdcd Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 5 Aug 2015 16:46:44 -0700 Subject: [PATCH] Fix warning and remove unused headers --- interface/src/avatar/ModelReferential.cpp | 2 +- interface/src/avatar/MyAvatar.cpp | 3 -- interface/src/avatar/SkeletonModel.cpp | 1 - interface/src/ui/ApplicationOverlay.cpp | 2 -- interface/src/ui/overlays/Overlays.cpp | 1 - interface/src/ui/overlays/TextOverlay.cpp | 1 - libraries/gpu/src/gpu/GLBackendPipeline.cpp | 2 -- libraries/octree/src/OctreeElement.cpp | 2 -- libraries/render-utils/src/GeometryCache.cpp | 1 - tests/render-utils/src/main.cpp | 32 +++++--------------- tests/shaders/src/main.cpp | 25 ++------------- tests/ui/src/main.cpp | 2 +- 12 files changed, 13 insertions(+), 61 deletions(-) diff --git a/interface/src/avatar/ModelReferential.cpp b/interface/src/avatar/ModelReferential.cpp index 53eae21ff7..46290b17b5 100644 --- a/interface/src/avatar/ModelReferential.cpp +++ b/interface/src/avatar/ModelReferential.cpp @@ -107,7 +107,7 @@ JointReferential::JointReferential(Referential* referential, EntityTree* tree, A EntityItemPointer item = _tree->findEntityByID(_entityID); const Model* model = getModel(item); - if (!isValid() || model == NULL || _jointIndex >= (uint32_t)(model->getJointStateCount())) { + if (isValid() && model != NULL && _jointIndex < (uint32_t)(model->getJointStateCount())) { _lastRefDimension = item->getDimensions(); model->getJointRotationInWorldFrame(_jointIndex, _refRotation); model->getJointPositionInWorldFrame(_jointIndex, _refPosition); diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 3a49b1cc82..7d486dcf50 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -47,9 +47,6 @@ #include "Util.h" #include "InterfaceLogging.h" -#include "gpu/GLBackend.h" - - using namespace std; const glm::vec3 DEFAULT_UP_DIRECTION(0.0f, 1.0f, 0.0f); diff --git a/interface/src/avatar/SkeletonModel.cpp b/interface/src/avatar/SkeletonModel.cpp index d5cb0517a7..d0fc7ad648 100644 --- a/interface/src/avatar/SkeletonModel.cpp +++ b/interface/src/avatar/SkeletonModel.cpp @@ -97,7 +97,6 @@ void SkeletonModel::initJointStates(QVector states) { } const float PALM_PRIORITY = DEFAULT_PRIORITY; -const float LEAN_PRIORITY = DEFAULT_PRIORITY; void SkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) { _rig->computeMotionAnimationState(deltaTime, _owningAvatar->getPosition(), _owningAvatar->getVelocity(), _owningAvatar->getOrientation()); diff --git a/interface/src/ui/ApplicationOverlay.cpp b/interface/src/ui/ApplicationOverlay.cpp index 30a8952011..80f5ce2b69 100644 --- a/interface/src/ui/ApplicationOverlay.cpp +++ b/interface/src/ui/ApplicationOverlay.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -32,7 +31,6 @@ #include "ui/AvatarInputs.h" 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 = -1000.0f; static const float ORTHO_FAR_CLIP = 1000.0f; diff --git a/interface/src/ui/overlays/Overlays.cpp b/interface/src/ui/overlays/Overlays.cpp index 0de88efed1..c4acdbb482 100644 --- a/interface/src/ui/overlays/Overlays.cpp +++ b/interface/src/ui/overlays/Overlays.cpp @@ -15,7 +15,6 @@ #include #include -#include #include #include "Application.h" diff --git a/interface/src/ui/overlays/TextOverlay.cpp b/interface/src/ui/overlays/TextOverlay.cpp index e9fda2def8..6926e9b241 100644 --- a/interface/src/ui/overlays/TextOverlay.cpp +++ b/interface/src/ui/overlays/TextOverlay.cpp @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include diff --git a/libraries/gpu/src/gpu/GLBackendPipeline.cpp b/libraries/gpu/src/gpu/GLBackendPipeline.cpp index d0ed1d51bf..8dd5242c3a 100755 --- a/libraries/gpu/src/gpu/GLBackendPipeline.cpp +++ b/libraries/gpu/src/gpu/GLBackendPipeline.cpp @@ -153,7 +153,6 @@ void GLBackend::releaseUniformBuffer(uint32_t slot) { if (buf) { auto* object = Backend::getGPUObject(*buf); if (object) { - GLuint bo = object->_buffer; glBindBufferBase(GL_UNIFORM_BUFFER, slot, 0); // RELEASE (void) CHECK_GL_ERROR(); @@ -222,7 +221,6 @@ void GLBackend::releaseResourceTexture(uint32_t slot) { if (tex) { auto* object = Backend::getGPUObject(*tex); if (object) { - GLuint to = object->_texture; GLuint target = object->_target; glActiveTexture(GL_TEXTURE0 + slot); glBindTexture(target, 0); // RELEASE diff --git a/libraries/octree/src/OctreeElement.cpp b/libraries/octree/src/OctreeElement.cpp index 1143bdf829..85ea0caef0 100644 --- a/libraries/octree/src/OctreeElement.cpp +++ b/libraries/octree/src/OctreeElement.cpp @@ -636,8 +636,6 @@ OctreeElement* OctreeElement::getOrCreateChildElementAt(float x, float y, float if (s > halfOurScale) { return this; } - // otherwise, we need to find which of our children we should recurse - glm::vec3 ourCenter = _cube.calcCenter(); int childIndex = getMyChildContainingPoint(glm::vec3(x, y, z)); diff --git a/libraries/render-utils/src/GeometryCache.cpp b/libraries/render-utils/src/GeometryCache.cpp index f06022e23a..22204e00f2 100644 --- a/libraries/render-utils/src/GeometryCache.cpp +++ b/libraries/render-utils/src/GeometryCache.cpp @@ -20,7 +20,6 @@ #include #include -#include #include #include "TextureCache.h" diff --git a/tests/render-utils/src/main.cpp b/tests/render-utils/src/main.cpp index 162e9425d3..0fa261db8d 100644 --- a/tests/render-utils/src/main.cpp +++ b/tests/render-utils/src/main.cpp @@ -9,37 +9,21 @@ // #include -#include -#include -#include +#include +#include -#include -#include -#include -#include -#include - -#include #include -#include #include #include -#include -#include -#include + +#include +#include +#include +#include #include -#include #include #include -#include -#include -#include - -#include - -#include "gpu/Batch.h" -#include "gpu/Context.h" class RateCounter { std::vector times; @@ -71,7 +55,7 @@ public: float rate() const { if (elapsed() == 0.0f) { - return NAN; + return 0.0f; } return (float) count() / elapsed(); } diff --git a/tests/shaders/src/main.cpp b/tests/shaders/src/main.cpp index f93a7a2302..c514532eac 100644 --- a/tests/shaders/src/main.cpp +++ b/tests/shaders/src/main.cpp @@ -6,39 +6,20 @@ // #include -#include #include -#include -#include -#include -#include -#include -#include - -#include #include -#include -#include #include -#include -#include -#include + +#include #include -#include #include #include #include #include #include -#include - - -#include "gpu/Batch.h" -#include "gpu/Context.h" - #include "../model/Skybox_vert.h" #include "../model/Skybox_frag.h" @@ -159,7 +140,7 @@ public: float rate() const { if (elapsed() == 0.0f) { - return NAN; + return 0.0f; } return (float) count() / elapsed(); } diff --git a/tests/ui/src/main.cpp b/tests/ui/src/main.cpp index e8ab7e02df..443e662bc1 100644 --- a/tests/ui/src/main.cpp +++ b/tests/ui/src/main.cpp @@ -68,7 +68,7 @@ public: float rate() const { if (elapsed() == 0.0f) { - return NAN; + return 0.0f; } return (float) count() / elapsed(); }