]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Skeleton.cpp
Fixed a lot of warnings
[lugaru.git] / Source / Skeleton.cpp
index c8207a0ea8066f9b8c8689c475cc3bba1b34c4db..0d7e95fb0ce5da4f2d4d860d92c4e359ca44be4a 100644 (file)
@@ -45,22 +45,6 @@ extern int whichjointendarray[26];
 
 extern bool visibleloading;
 
-/* convenience functions
- */
-Joint& Skeleton::joint(int bodypart)
-{
-    return joints[jointlabels[bodypart]];
-}
-XYZ& Skeleton::jointPos(int bodypart)
-{
-    return joint(bodypart).position;
-}
-XYZ& Skeleton::jointVel(int bodypart)
-{
-    return joint(bodypart).velocity;
-}
-
-
 /* EFFECT
  */
 void dealloc2(void* param)
@@ -201,7 +185,7 @@ float Skeleton::DoConstraints(XYZ *coords, float *scale)
     XYZ bounceness;
     const int numrepeats = 3;
     float groundlevel = .15;
-    int i, j, k, l, m;
+    int i, j, k, m;
     XYZ temp;
     XYZ terrainnormal;
     int whichhit;
@@ -359,7 +343,10 @@ float Skeleton::DoConstraints(XYZ *coords, float *scale)
 
                     if (tutoriallevel != 1 || id == 0)
                         if (findLengthfast(&bounceness) > 8000 && breaking) {
-                            objects.model[k].MakeDecal(breakdecal, DoRotation(temp - objects.position[k], 0, -objects.yaw[k], 0), .4, .5, Random() % 360);
+                            // FIXME: this crashes because k is not initialized!
+                            // to reproduce, type 'wolfie' in console and play a while
+                            // I'll just comment it out for now
+                            //objects.model[k].MakeDecal(breakdecal, DoRotation(temp - objects.position[k], 0, -objects.yaw[k], 0), .4, .5, Random() % 360);
                             Sprite::MakeSprite(cloudsprite, joints[i].position * (*scale) + *coords, joints[i].velocity * .06, 1, 1, 1, 4, .2);
                             breaking = false;
                             camerashake += .6;
@@ -847,16 +834,11 @@ void Skeleton::Load(const char *filename,       const char *lowfilename, const c
     int parentID;
     FILE *tfile;
     float lSize;
-    int i, j, tempmuscle;
-
-    int newload;
+    int i, j;
     int edit;
 
     LOGFUNC;
 
-
-    newload = 0;
-
     num_models = 7;
 
     // load various models
@@ -947,7 +929,6 @@ void Skeleton::Load(const char *filename,       const char *lowfilename, const c
         }
 
         // read num_muscles
-        tempmuscle = num_muscles;
         funpackf(tfile, "Bi", &num_muscles);
 
         // allocate memory
@@ -956,12 +937,9 @@ void Skeleton::Load(const char *filename,       const char *lowfilename, const c
             delete [] muscles; //dealloc2(muscles);
         muscles = (Muscle*)new Muscle[num_muscles]; //malloc(sizeof(Muscle)*num_muscles);
 
-        newload = 1;
-
         // for each muscle...
         for (i = 0; i < num_muscles; i++) {
             // read info
-            tempmuscle = muscles[i].numvertices;
             funpackf(tfile, "Bf Bf Bf Bf Bf Bi Bi", &muscles[i].length, &muscles[i].targetlength, &muscles[i].minlength, &muscles[i].maxlength, &muscles[i].strength, &muscles[i].type, &muscles[i].numvertices);
 
             // allocate memory for vertices
@@ -1084,7 +1062,6 @@ void Skeleton::Load(const char *filename,       const char *lowfilename, const c
             fseek(tfile, lSize, SEEK_CUR);
 
             // read numverticeslow
-            tempmuscle = muscles[i].numverticeslow;
             funpackf(tfile, "Bi", &muscles[i].numverticeslow);
 
             if (muscles[i].numverticeslow) {
@@ -1198,7 +1175,6 @@ void Skeleton::Load(const char *filename,       const char *lowfilename, const c
             fseek(tfile, lSize, SEEK_CUR);
 
             // read numverticesclothes
-            tempmuscle = muscles[i].numverticesclothes;
             funpackf(tfile, "Bi", &muscles[i].numverticesclothes);
 
             // read verticesclothes
@@ -1360,24 +1336,24 @@ Skeleton::Skeleton()
     selected = 0;
 
     memset(forwardjoints, 0, sizeof(forwardjoints));
-    //         XYZ forward;
+    // XYZ forward;
 
     id = 0;
 
     memset(lowforwardjoints, 0, sizeof(lowforwardjoints));
-    //         XYZ lowforward;
+    // XYZ lowforward;
 
-    //         XYZ specialforward[5];
+    // XYZ specialforward[5];
     memset(jointlabels, 0, sizeof(jointlabels));
 
-    //         Model model[7];
-    //         Model modellow;
-    //         Model modelclothes;
+    // Model model[7];
+    // Model modellow;
+    // Model modelclothes;
     num_models = 0;
 
-    //         Model drawmodel;
-    //         Model drawmodellow;
-    //         Model drawmodelclothes;
+    // Model drawmodel;
+    // Model drawmodellow;
+    // Model drawmodelclothes;
 
     clothes = 0;
     spinny = 0;