]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Objects/Objects.cpp
Fixed a few ifs
[lugaru.git] / Source / Objects / Objects.cpp
index 20e117ca58feb31ed4d7b7d4da1b96baa40e54ef..3877b9e8e6c29be90ce6d5c668d8902200254ed1 100644 (file)
@@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
 along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "Objects/Objects.h"
+#include "Objects/Objects.hpp"
 
 extern XYZ viewer;
 extern float viewdistance;
@@ -595,14 +595,14 @@ void Objects::MakeObject(int atype, XYZ where, float ayaw, float ascale)
         model[numobjects].CalculateNormals(1);
         model[numobjects].ScaleNormals(-1, -1, -1);
 
-        if (atype == treetrunktype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) {
-            if (detail == 2)
+        if (detail == 2) {
+            if (atype == treetrunktype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) {
                 terrain.MakeDecal(shadowdecalpermanent, position[numobjects], 2, .4, 0);
-        }
+            }
 
-        if (atype == bushtype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) {
-            if (detail == 2)
+            if (atype == bushtype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) {
                 terrain.MakeDecal(shadowdecalpermanent, position[numobjects], 1, .4, 0);
+            }
         }
 
         if (atype != treeleavestype && atype != bushtype && atype != firetype)
@@ -689,18 +689,19 @@ void Objects::MakeObject(int atype, XYZ where, float ayaw, float apitch, float a
         model[numobjects].CalculateNormals(1);
         model[numobjects].ScaleNormals(-1, -1, -1);
 
-        if (atype == treetrunktype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) {
-            if (detail == 2)
+        if (detail == 2) {
+            if (atype == treetrunktype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) {
                 terrain.MakeDecal(shadowdecalpermanent, position[numobjects], 2, .4, 0);
-        }
+            }
 
-        if (atype == bushtype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) {
-            if (detail == 2)
+            if (atype == bushtype && position[numobjects].y < terrain.getHeight(position[numobjects].x, position[numobjects].z) + 1) {
                 terrain.MakeDecal(shadowdecalpermanent, position[numobjects], 1, .4, 0);
+            }
         }
 
-        if (atype != treeleavestype && atype != bushtype && atype != firetype)
+        if (atype != treeleavestype && atype != bushtype && atype != firetype) {
             terrain.AddObject(where + DoRotation(model[numobjects].boundingspherecenter, 0, ayaw, 0), model[numobjects].boundingsphereradius, numobjects);
+        }
 
         numobjects++;
     }
@@ -838,5 +839,4 @@ Objects::~Objects()
     treetextureptr.destroy();
     bushtextureptr.destroy();
     rocktextureptr.destroy();
-};
-
+}