]> git.jsancho.org Git - lugaru.git/commitdiff
Fixed a few parentheses
authorCôme Chilliet <come@chilliet.eu>
Mon, 9 Jan 2017 23:48:44 +0000 (00:48 +0100)
committerCôme Chilliet <come@chilliet.eu>
Mon, 9 Jan 2017 23:48:44 +0000 (00:48 +0100)
Source/Animation/Muscle.cpp
Source/Environment/Terrain.cpp
Source/GameDraw.cpp
Source/Objects/Person.cpp

index da8c64c663a1f5cd14dfd88a9c84d20262d1656d..6ccad1816c6574423fd9b5025924f097fefaee02 100644 (file)
@@ -133,7 +133,7 @@ void Muscle::DoConstraint(bool spinny)
         strength = 1;
 
     length -= (length - relaxlength) * (1 - strength) * multiplier * 10000;
-    length -= (length - targetlength) * (strength) * multiplier * 10000;
+    length -= (length - targetlength) * strength * multiplier * 10000;
     if (strength == 0)
         length = relaxlength;
 
index 4e4971f132ae681ff6cac8962cc01d3f39e75eae..6d195e204eaf9f5c39262b07c01b8a2d3f006af2 100644 (file)
@@ -635,7 +635,7 @@ bool Terrain::load(const std::string& fileName)
     Game::LoadingScreen();
 
     patch_size = size / subdivision;
-    patch_elements = (patch_size) * (patch_size) * 54;
+    patch_elements = patch_size * patch_size * 54;
     CalculateNormals();
 
     return true;
@@ -932,17 +932,17 @@ void Terrain::draw(int layer)
     viewdistsquared = viewdistance * viewdistance;
 
     //Only nearby blocks
-    beginx = (viewer.x - viewdistance) / (patch_size) - 1;
+    beginx = ((viewer.x - viewdistance) / patch_size) - 1;
     if (beginx < 0)
         beginx = 0;
-    beginz = (viewer.z - viewdistance) / (patch_size) - 1;
+    beginz = ((viewer.z - viewdistance) / patch_size) - 1;
     if (beginz < 0)
         beginz = 0;
 
-    endx = (viewer.x + viewdistance) / (patch_size) + 1;
+    endx = ((viewer.x + viewdistance) / patch_size) + 1;
     if (endx > subdivision)
         endx = subdivision;
-    endz = (viewer.z + viewdistance) / (patch_size) + 1;
+    endz = ((viewer.z + viewdistance) / patch_size) + 1;
     if (endz > subdivision)
         endz = subdivision;
 
@@ -1255,13 +1255,13 @@ void Terrain::DoShadows()
     //Calculate shadows
     for (short int i = 0; i < size; i++) {
         for (short int j = 0; j < size; j++) {
-            terrainpoint.x = (float)(i) * scale;
-            terrainpoint.z = (float)(j) * scale;
+            terrainpoint.x = (float)i * scale;
+            terrainpoint.z = (float)j * scale;
             terrainpoint.y = heightmap[i][j] * scale;
 
             shadowed = 0;
-            patchx = (float)(i) * subdivision / size;
-            patchz = (float)(j) * subdivision / size;
+            patchx = (float)i * subdivision / size;
+            patchz = (float)j * subdivision / size;
             if (patchobjects[patchx][patchz].size()) {
                 for (unsigned int k = 0; k < patchobjects[patchx][patchz].size(); k++) {
                     unsigned int l = patchobjects[patchx][patchz][k];
index c569a763fcb422f538ddaddc944c2656f50c2871..7ec4b65f92e0b06dab62265df3abefd0627efd32 100644 (file)
@@ -1554,7 +1554,7 @@ int Game::DrawGLScene(StereoSide side)
                 offset = consoleselected - 60;
             textmono->glPrint(10, 30, " ]", 0, 1, 1024, 768);
             if (consoleblink) {
-                textmono->glPrint(30 + (float)(consoleselected) * 10 - offset * 10, 30, "_", 0, 1, 1024, 768);
+                textmono->glPrint(30 + (float)consoleselected * 10 - offset * 10, 30, "_", 0, 1, 1024, 768);
             }
             for (unsigned i = 0; i < 15; i++) {
                 textmono->glPrint(30 - offset * 10, 30 + i * 20, consoletext[i], 0, 1, 1024, 768);
index ba26f803b7c85b850ca1502560e4ee74df5ba413..a6f2bc199647fb3b763f41c36c6a85964a8986d9 100644 (file)
@@ -4255,15 +4255,15 @@ void Person::DoAnimations()
             oldframeCurrent = frameCurrent;
 
             for (unsigned i = 0; i < skeleton.joints.size(); i++) {
-                skeleton.joints[i].velocity = (currentFrame().joints[i].position * (1 - target) + targetFrame().joints[i].position * (target) - skeleton.joints[i].position) / multiplier;
-                skeleton.joints[i].position = currentFrame().joints[i].position * (1 - target) + targetFrame().joints[i].position * (target);
+                skeleton.joints[i].velocity = (currentFrame().joints[i].position * (1 - target) + targetFrame().joints[i].position * target - skeleton.joints[i].position) / multiplier;
+                skeleton.joints[i].position = currentFrame().joints[i].position * (1 - target) + targetFrame().joints[i].position * target;
             }
             offset = currentoffset * (1 - target) + targetoffset * target;
             for (unsigned i = 0; i < skeleton.muscles.size(); i++) {
                 if (skeleton.muscles[i].visible) {
-                    skeleton.muscles[i].rotate1 = skeleton.muscles[i].oldrotate1 * (1 - target) + skeleton.muscles[i].newrotate1 * (target);
-                    skeleton.muscles[i].rotate2 = skeleton.muscles[i].oldrotate2 * (1 - target) + skeleton.muscles[i].newrotate2 * (target);
-                    skeleton.muscles[i].rotate3 = skeleton.muscles[i].oldrotate3 * (1 - target) + skeleton.muscles[i].newrotate3 * (target);
+                    skeleton.muscles[i].rotate1 = skeleton.muscles[i].oldrotate1 * (1 - target) + skeleton.muscles[i].newrotate1 * target;
+                    skeleton.muscles[i].rotate2 = skeleton.muscles[i].oldrotate2 * (1 - target) + skeleton.muscles[i].newrotate2 * target;
+                    skeleton.muscles[i].rotate3 = skeleton.muscles[i].oldrotate3 * (1 - target) + skeleton.muscles[i].newrotate3 * target;
                 }
             }
         }