]> git.jsancho.org Git - lugaru.git/commitdiff
Simplify stop animations
authorAlexander Monakov <amonakov@gmail.com>
Fri, 31 Dec 2010 01:08:50 +0000 (04:08 +0300)
committerAlexander Monakov <amonakov@gmail.com>
Fri, 31 Dec 2010 01:08:50 +0000 (04:08 +0300)
Source/Animation.def
Source/Person.cpp
Source/Person.h

index 36913f549dc9bd70feb13ce20074b6e97051e115..4c0ac3542a0dd374e2f917b13b0e32079cb9e30f 100644 (file)
@@ -35,7 +35,7 @@ DECLARE_ANIM_BIT(ab_walljump)
 #ifdef DECLARE_ANIM
 DECLARE_ANIM(runanim, "Run", middleheight, neutral, ab_run)
 DECLARE_ANIM(bounceidleanim, "Idle", middleheight, neutral, ab_idle)
-DECLARE_ANIM(stopanim, "Stop", middleheight, neutral, 0)
+DECLARE_ANIM(stopanim, "Stop", middleheight, neutral, ab_stop)
 DECLARE_ANIM(jumpupanim, "JumpUp", highheight, neutral, 0)
 DECLARE_ANIM(jumpdownanim, "JumpDown", highheight, neutral, 0)
 DECLARE_ANIM(landanim, "Landing", lowheight, neutral, 0)
@@ -121,7 +121,7 @@ DECLARE_ANIM(wolflandhardanim, "Wolflandhard", lowheight, neutral, 0)
 DECLARE_ANIM(wolfrunanim, "Wolfrun", middleheight, neutral, ab_run)
 DECLARE_ANIM(wolfrunninganim, "Wolfrunning", middleheight, neutral, ab_run)
 DECLARE_ANIM(rabbitrunninganim, "Rabbitrunning", middleheight, neutral, ab_run)
-DECLARE_ANIM(wolfstopanim, "Wolfstop", middleheight, neutral, 0)
+DECLARE_ANIM(wolfstopanim, "Wolfstop", middleheight, neutral, ab_stop)
 DECLARE_ANIM(rabbittackleanim, "Rabbittackle", middleheight, neutral, 0)
 DECLARE_ANIM(rabbittacklinganim, "Rabbittackling", middleheight, reversal, 0)
 DECLARE_ANIM(rabbittackledbackanim, "Rabbittackledback", middleheight, reversed, 0)
index e20023274988cdd66e4b0ce4bbe9a338e894e841..30d4f47aa3d6a7507d1ab690b135423237cd70da 100644 (file)
@@ -217,16 +217,6 @@ int Person::getRun(){
        return 0;
 }
 
-bool Person::isStop(){
-       if(targetanimation==stopanim||targetanimation==wolfstopanim)return 1;
-       else return 0;
-}
-
-
-bool Person::wasStop(){
-       if(currentanimation==stopanim||currentanimation==wolfstopanim)return 1;
-       else return 0;
-}
 int Person::getStop(){
        if(creature==rabbittype)return stopanim;
        if(creature==wolftype)return wolfstopanim;
index 28f21b559b6cc57250e7840010bec627b14528fb..a745481f4d996f7cece4b26ae5ce18fd52692f33 100644 (file)
@@ -353,8 +353,14 @@ class Person
                }
                int getCrouch();
                
-               bool wasStop();
-               bool isStop();
+               bool wasStop()
+               {
+                 return animation_bits[currentanimation] & ab_stop;
+               }
+               bool isStop()
+               {
+                 return animation_bits[targetanimation] & ab_stop;
+               }
                int getStop();
                
                bool wasSneak();