]> git.jsancho.org Git - lugaru.git/commitdiff
Removed empty destructors. Joint::label is a bodypart
authorCôme Chilliet <come@chilliet.eu>
Fri, 9 Dec 2016 17:32:46 +0000 (00:32 +0700)
committerCôme Chilliet <come@chilliet.eu>
Fri, 9 Dec 2016 17:32:46 +0000 (00:32 +0700)
Source/Animation/Animation.cpp
Source/Animation/Animation.h
Source/Animation/Joint.cpp
Source/Animation/Joint.h
Source/Animation/Muscle.cpp
Source/Animation/Muscle.h
Source/Animation/Skeleton.cpp
Source/Animation/Skeleton.h
Source/Person.cpp
Source/Person.h

index f28861ca9452892ef1c29b6ade5157aeb179acd6..83e2c0e1da31e199f9fb978c3f3b81642bb48dd2 100644 (file)
@@ -149,7 +149,3 @@ Animation::Animation(const std::string& filename, anim_height_type aheight, anim
     offset = endoffset;
     offset.y = 0;
 }
-
-Animation::~Animation()
-{
-}
index 91bdd4ce80bdb6fa75b9124d064f696bc1cb6b8d..4a74c5c1d0afbcdacb0fc8d9e0ad04319b75bd0d 100644 (file)
@@ -94,6 +94,5 @@ public:
 
     Animation();
     Animation(const std::string& fileName, anim_height_type aheight, anim_attack_type aattack);
-    ~Animation();
 };
 #endif
index 96f94c97ac6d5a03546017cd8ff63e54cd0ed1b6..4d3dd7c3e98d110bf0c1070ebe412148bd1e3156 100644 (file)
@@ -32,7 +32,7 @@ Joint::Joint() :
     visible(false),
     parent(nullptr),
     sametwist(false),
-    label(0),
+    label(head),
     hasgun(0),
     delay(0)
 {
index 764b095de9ff44d69c7ef48f89f2b45be573c89d..c4c8e3b4318809c79fc3b05110dcbf2e59107ca5 100644 (file)
@@ -24,6 +24,15 @@ along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 #include "Quaternions.h"
 #include <vector>
 
+enum bodypart {
+    head, neck,
+    leftshoulder,  leftelbow,  leftwrist,  lefthand,
+    rightshoulder, rightelbow, rightwrist, righthand,
+    abdomen, lefthip, righthip, groin,
+    leftknee,  leftankle,  leftfoot,
+    rightknee, rightankle, rightfoot
+};
+
 class Joint
 {
 public:
@@ -43,7 +52,7 @@ public:
     bool visible;
     Joint* parent;
     bool sametwist;
-    int label;
+    bodypart label;
     int hasgun;
     float delay;
     XYZ velchange;
index 627b8e067eda4eea98d889251dee78dd9227a301..94ed5b15d19e9677c2d682a2f8a8ad3f28b5440e 100644 (file)
@@ -42,10 +42,6 @@ Muscle::Muscle()
     strength = 0;
 }
 
-Muscle::~Muscle()
-{
-}
-
 void Muscle::load(FILE* tfile, int vertexNum, std::vector<Joint>& joints)
 {
     int numvertices, vertice, parentID;
index 3a080ba28eff41fbfa9e56d923cc7cd025e9b733..a286928673181ea30e4c8cc5f8ae0980597ff3fb 100644 (file)
@@ -48,7 +48,6 @@ public:
     float strength;
 
     Muscle();
-    ~Muscle();
     void load(FILE* tfile, int vertexNum, std::vector<Joint>& joints);
     void loadVerticesLow(FILE* tfile, int vertexNum);
     void loadVerticesClothes(FILE* tfile, int vertexNum);
index 607be81689c4c3b787229d0c8829692af5248c18..ee247c51f70e135778c7c1b8a728a0d1859a0650 100644 (file)
@@ -40,39 +40,25 @@ extern int whichjointendarray[26];
 
 extern bool visibleloading;
 
-Skeleton::Skeleton()
+Skeleton::Skeleton() :
+    selected(0),
+    id(0),
+    num_models(0),
+    clothes(false),
+    spinny(false),
+    skinsize(0),
+    checkdelay(0),
+    longdead(0),
+    broken(false),
+    free(0),
+    oldfree(0),
+    freetime(0),
+    freefall(false)
 {
-    selected = 0;
-
     memset(forwardjoints, 0, sizeof(forwardjoints));
-
-    id = 0;
-
     memset(lowforwardjoints, 0, sizeof(lowforwardjoints));
-
     memset(jointlabels, 0, sizeof(jointlabels));
-
-    num_models = 0;
-
-    clothes = 0;
-    spinny = 0;
-
     memset(skinText, 0, sizeof(skinText));
-    skinsize = 0;
-
-    checkdelay = 0;
-
-    longdead = 0;
-    broken = 0;
-
-    free = 0;
-    oldfree = 0;
-    freetime = 0;
-    freefall = 0;
-}
-
-Skeleton::~Skeleton()
-{
 }
 
 /* EFFECT
index 2882188a3d646bbdd09e430a63cb95f3f683cb0a..db03e75af512cbf9fba57349ee90ea27cc3d8108 100644 (file)
@@ -33,15 +33,6 @@ along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 #include "Animation/Joint.h"
 #include "Animation/Muscle.h"
 
-enum bodyparts {
-    head, neck,
-    leftshoulder,  leftelbow,  leftwrist,  lefthand,
-    rightshoulder, rightelbow, rightwrist, righthand,
-    abdomen, lefthip, righthip, groin,
-    leftknee,  leftankle,  leftfoot,
-    rightknee, rightankle, rightfoot
-};
-
 const int max_joints = 50;
 
 class Skeleton
@@ -98,7 +89,6 @@ public:
     void Load(const std::string& fileName, const std::string& lowfileName, const std::string& clothesfileName, const std::string& modelfileName, const std::string& model2fileName, const std::string& model3fileName, const std::string& model4fileName, const std::string& model5fileNamee, const std::string& model6fileName, const std::string& model7fileName, const std::string& modellowfileName, const std::string& modelclothesfileName, bool aclothes);
 
     Skeleton();
-    ~Skeleton();
 
 private:
     // convenience functions
index f0b00193a059cedf58339f9857d904e1745238c7..a9b5983919f8b45507ce5e1f364d73b23f1b5322 100644 (file)
@@ -1839,7 +1839,7 @@ void Person::RagDoll(bool checkcollision)
 
 /* EFFECT
  */
-void Person::FootLand(bodyparts whichfoot, float opacity)
+void Person::FootLand(bodypart whichfoot, float opacity)
 {
     if ((whichfoot != leftfoot) && (whichfoot != rightfoot)) {
         cerr << "FootLand called on wrong bodypart" << endl;
index fbb62ebae210f81a45cef559115dcd2572f80b70..ebdde320af4f487e1784ac8ecb80084db61278ff 100644 (file)
@@ -386,7 +386,7 @@ public:
     int SphereCheck(XYZ *p1, float radius, XYZ *p, XYZ *move, float *rotate, Model *model);
     int DrawSkeleton();
     void Puff(int whichlabel);
-    void FootLand(bodyparts whichfoot, float opacity);
+    void FootLand(bodypart whichfoot, float opacity);
     void DoStuff();
     void setAnimation(int);
     void DoAnimations();