From 4ae8d446bec332ac1c1fdee49682e48109105cd3 Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Tue, 12 Apr 2016 18:44:55 +0200 Subject: [PATCH] Fix compilation errors on Visual Studio and warnings --- src/collision/CollisionDetection.cpp | 4 +++- src/collision/shapes/HeightFieldShape.cpp | 5 ++++- testbed/common/ConcaveMesh.cpp | 6 +++--- testbed/opengl-framework/src/Light.cpp | 8 ++++---- testbed/opengl-framework/src/Light.h | 7 ++----- testbed/scenes/collisionshapes/CollisionShapesScene.h | 3 --- testbed/scenes/concavemesh/ConcaveMeshScene.h | 2 +- testbed/scenes/heightfield/HeightFieldScene.h | 2 +- testbed/src/Gui.cpp | 4 ++-- testbed/src/SceneDemo.cpp | 3 +-- 10 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/collision/CollisionDetection.cpp b/src/collision/CollisionDetection.cpp index 05409d3a..ea469ccb 100644 --- a/src/collision/CollisionDetection.cpp +++ b/src/collision/CollisionDetection.cpp @@ -375,8 +375,10 @@ void CollisionDetection::broadPhaseNotifyOverlappingPair(ProxyShape* shape1, Pro OverlappingPair(shape1, shape2, nbMaxManifolds, mWorld->mMemoryAllocator); assert(newPair != NULL); +#ifndef NDEBUG std::pair::iterator, bool> check = - mOverlappingPairs.insert(make_pair(pairID, newPair)); +#endif + mOverlappingPairs.insert(make_pair(pairID, newPair)); assert(check.second); // Wake up the two bodies diff --git a/src/collision/shapes/HeightFieldShape.cpp b/src/collision/shapes/HeightFieldShape.cpp index b0edb3ae..88224e2d 100644 --- a/src/collision/shapes/HeightFieldShape.cpp +++ b/src/collision/shapes/HeightFieldShape.cpp @@ -106,7 +106,10 @@ void HeightFieldShape::testAllTriangles(TriangleCallback& callback, const AABB& computeMinMaxGridCoordinates(minGridCoords, maxGridCoords, aabb); // Compute the starting and ending coords of the sub-grid according to the up axis - int iMin, iMax, jMin, jMax; + int iMin = 0; + int iMax = 0; + int jMin = 0; + int jMax = 0; switch(mUpAxis) { case 0 : iMin = clamp(minGridCoords[1], 0, mNbColumns - 1); iMax = clamp(maxGridCoords[1], 0, mNbColumns - 1); diff --git a/testbed/common/ConcaveMesh.cpp b/testbed/common/ConcaveMesh.cpp index e1da9390..26a27920 100644 --- a/testbed/common/ConcaveMesh.cpp +++ b/testbed/common/ConcaveMesh.cpp @@ -47,7 +47,7 @@ ConcaveMesh::ConcaveMesh(const openglframework::Vector3 &position, mScalingMatrix = openglframework::Matrix4::identity(); // For each subpart of the mesh - for (uint i=0; i mDumbbells; - /// Concave triangles mesh - ConcaveMesh* mConcaveMesh; - /// Box for the floor Box* mFloor; diff --git a/testbed/scenes/concavemesh/ConcaveMeshScene.h b/testbed/scenes/concavemesh/ConcaveMeshScene.h index 58985e41..9871526d 100644 --- a/testbed/scenes/concavemesh/ConcaveMeshScene.h +++ b/testbed/scenes/concavemesh/ConcaveMeshScene.h @@ -37,7 +37,7 @@ namespace trianglemeshscene { // Constants -const float SCENE_RADIUS = 30.0f; // Radius of the scene in meters +const float SCENE_RADIUS = 70.0f; // Radius of the scene in meters const int NB_BOXES_X = 8; const int NB_BOXES_Z = 8; const float BOX_SIZE = 3.0f; diff --git a/testbed/scenes/heightfield/HeightFieldScene.h b/testbed/scenes/heightfield/HeightFieldScene.h index 46348178..36749ef6 100644 --- a/testbed/scenes/heightfield/HeightFieldScene.h +++ b/testbed/scenes/heightfield/HeightFieldScene.h @@ -36,7 +36,7 @@ namespace heightfieldscene { // Constants -const float SCENE_RADIUS = 30.0f; +const float SCENE_RADIUS = 50.0f; // Class HeightFieldScene class HeightFieldScene : public SceneDemo { diff --git a/testbed/src/Gui.cpp b/testbed/src/Gui.cpp index e2597841..499f1fb3 100644 --- a/testbed/src/Gui.cpp +++ b/testbed/src/Gui.cpp @@ -97,7 +97,7 @@ void Gui::createSimulationPanel() { mSimulationPanel->setFixedWidth(220); // Scenes/Physics/Rendering buttons - Label* labelControls = new Label(mSimulationPanel, "Controls","sans-bold"); + new Label(mSimulationPanel, "Controls","sans-bold"); Widget* panelControls = new Widget(mSimulationPanel); panelControls->setLayout(new BoxLayout(Orientation::Horizontal, Alignment::Middle, 0, 5)); ToolButton* buttonPlay = new ToolButton(panelControls, ENTYPO_ICON_PLAY); @@ -127,7 +127,7 @@ void Gui::createSimulationPanel() { for (uint i=0; igetName().c_str()); } - Label* labelScenes = new Label(mSimulationPanel, "Scene","sans-bold"); + new Label(mSimulationPanel, "Scene","sans-bold"); ComboBox* comboBoxScenes = new ComboBox(mSimulationPanel, scenesNames, [&, scenes](int index) { mApp->switchScene(scenes[index]); }); diff --git a/testbed/src/SceneDemo.cpp b/testbed/src/SceneDemo.cpp index b850110c..1906d9f4 100644 --- a/testbed/src/SceneDemo.cpp +++ b/testbed/src/SceneDemo.cpp @@ -42,8 +42,7 @@ openglframework::Color SceneDemo::mDemoColors[] = {SceneDemo::mYellowColorDemo, // Constructor SceneDemo::SceneDemo(const std::string& name, float sceneRadius, bool isShadowMappingEnabled) - : Scene(name, isShadowMappingEnabled), - mLight0(0), mIsShadowMappingInitialized(false), + : Scene(name, isShadowMappingEnabled), mIsShadowMappingInitialized(false), mDepthShader("shaders/depth.vert", "shaders/depth.frag"), mPhongShader("shaders/phong.vert", "shaders/phong.frag"), mQuadShader("shaders/quad.vert", "shaders/quad.frag"),