OSDN Git Service

Fixes
authorryan <>
Tue, 16 Feb 2016 00:10:25 +0000 (00:10 +0000)
committerryan <>
Tue, 16 Feb 2016 00:10:25 +0000 (00:10 +0000)
ogrebullet/Collisions/src/Debug/OgreBulletCollisionsDebugContact.cpp
ogrebullet/Collisions/src/Utils/OgreBulletCollisionsMeshToShapeConverter.cpp
src/frontend/skyscraper.cpp
src/sbs/soundsystem.h
src/sbs/texture.cpp

index a23b164..87448b2 100644 (file)
@@ -358,7 +358,7 @@ namespace OgreBulletCollisions
 
         // for calculation of AABB
         Ogre::Vector3 min, max, currPos;
-        Ogre::Real maxSquaredRadius;
+        Ogre::Real maxSquaredRadius = 0;
         bool first = true;
 
         // Use iterator
index 96c8dcf..c7c7cb4 100644 (file)
@@ -1065,8 +1065,8 @@ CapsuleCollisionShape* AnimatedMeshToShapeConverter::createOrientedCapsuleCollis
        // find axes with longest length
 
        Vector3 cap_dir;    //std::max(box_afExtent.x,std::max(box_afExtent.y,box_afExtent.z));
-       Real cap_dirLength;  //std::max(box_afExtent.x,std::max(box_afExtent.y,box_afExtent.z));
-       Real cap_radius;         // max axe length
+       Real cap_dirLength = 0;  //std::max(box_afExtent.x,std::max(box_afExtent.y,box_afExtent.z));
+       Real cap_radius = 0;     // max axe length
        if (box_afExtent.x - box_afExtent.y > 0 && box_afExtent.x - box_afExtent.z > 0)
        {
                cap_dir = Vector3::UNIT_X;
@@ -1079,7 +1079,7 @@ CapsuleCollisionShape* AnimatedMeshToShapeConverter::createOrientedCapsuleCollis
                cap_dirLength = box_afExtent.y;
                cap_radius = std::max (box_afExtent.x, box_afExtent.z);
        }
-       else if (box_afExtent.z - box_afExtent.y > 0 && box_afExtent.z - box_afExtent.y > 0)
+       else if (box_afExtent.z - box_afExtent.x > 0 && box_afExtent.z - box_afExtent.y > 0)
        {
                cap_dir = Vector3::UNIT_Z;
                cap_dirLength = box_afExtent.z;
index 24b7766..bb0fbf6 100644 (file)
@@ -478,11 +478,11 @@ bool Skyscraper::Initialize()
        Ogre::TextureFilterOptions filter;
        if (filtermode == 0)
                filter = Ogre::TFO_NONE;
-       if (filtermode == 1)
+       else if (filtermode == 1)
                filter = Ogre::TFO_BILINEAR;
-       if (filtermode == 2)
+       else if (filtermode == 2)
                filter = Ogre::TFO_TRILINEAR;
-       if (filtermode == 3)
+       else if (filtermode == 3)
                filter = Ogre::TFO_ANISOTROPIC;
 
        Ogre::MaterialManager::getSingleton().setDefaultTextureFiltering(filter);
index 2791b3d..05bf9d1 100644 (file)
@@ -30,7 +30,7 @@
 
 namespace SBS {
 
-class SoundData;
+struct SoundData;
 
 class SBSIMPEXP SoundSystem : public Object
 {
index cd79847..c3c9d51 100644 (file)
@@ -582,28 +582,32 @@ bool TextureManager::TransformTexture(const std::string &name, const std::string
                Ogre::TextureUnitState::TextureTransformType type;
                if (xform_type == "scroll_x")
                        type = Ogre::TextureUnitState::TT_TRANSLATE_U;
-               if (xform_type == "scroll_y")
+               else if (xform_type == "scroll_y")
                        type = Ogre::TextureUnitState::TT_TRANSLATE_V;
-               if (xform_type == "rotate")
+               else if (xform_type == "rotate")
                        type = Ogre::TextureUnitState::TT_ROTATE;
-               if (xform_type == "scale_x")
+               else if (xform_type == "scale_x")
                        type = Ogre::TextureUnitState::TT_SCALE_U;
-               if (xform_type == "scale_y")
+               else if (xform_type == "scale_y")
                        type = Ogre::TextureUnitState::TT_SCALE_V;
+               else
+                       return false;
 
                Ogre::WaveformType wavetype;
                if (wave == "sine")
                        wavetype = Ogre::WFT_SINE;
-               if (wave == "triangle")
+               else if (wave == "triangle")
                        wavetype = Ogre::WFT_TRIANGLE;
-               if (wave == "square")
+               else if (wave == "square")
                        wavetype = Ogre::WFT_SQUARE;
-               if (wave == "sawtooth")
+               else if (wave == "sawtooth")
                        wavetype = Ogre::WFT_SAWTOOTH;
-               if (wave == "inverse_sawtooth")
+               else if (wave == "inverse_sawtooth")
                        wavetype = Ogre::WFT_INVERSE_SAWTOOTH;
-               if (wave == "pwm")
+               else if (wave == "pwm")
                        wavetype = Ogre::WFT_PWM;
+               else
+                       return false;
 
                state->setTransformAnimation(type, wavetype, base, frequency, phase, amplitude);
        }