]> git.jsancho.org Git - lugaru.git/commitdiff
Simplify run animations
authorAlexander Monakov <amonakov@gmail.com>
Fri, 31 Dec 2010 00:43:55 +0000 (03:43 +0300)
committerAlexander Monakov <amonakov@gmail.com>
Fri, 31 Dec 2010 00:43:55 +0000 (03:43 +0300)
Source/Animation.def
Source/Person.cpp
Source/Person.h

index 1beec103f324142f46216b5aecde25c48dab95f1..36913f549dc9bd70feb13ce20074b6e97051e115 100644 (file)
@@ -33,7 +33,7 @@ DECLARE_ANIM_BIT(ab_walljump)
 #endif
 
 #ifdef DECLARE_ANIM
-DECLARE_ANIM(runanim, "Run", middleheight, neutral, 0)
+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(jumpupanim, "JumpUp", highheight, neutral, 0)
@@ -118,9 +118,9 @@ DECLARE_ANIM(wolfidle, "Wolfidle", middleheight, neutral, ab_idle)
 DECLARE_ANIM(wolfcrouchanim, "Wolfcrouch", lowheight, neutral, ab_crouch)
 DECLARE_ANIM(wolflandanim, "Wolflanding", lowheight, neutral, 0)
 DECLARE_ANIM(wolflandhardanim, "Wolflandhard", lowheight, neutral, 0)
-DECLARE_ANIM(wolfrunanim, "Wolfrun", middleheight, neutral, 0)
-DECLARE_ANIM(wolfrunninganim, "Wolfrunning", middleheight, neutral, 0)
-DECLARE_ANIM(rabbitrunninganim, "Rabbitrunning", middleheight, 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(rabbittackleanim, "Rabbittackle", middleheight, neutral, 0)
 DECLARE_ANIM(rabbittacklinganim, "Rabbittackling", middleheight, reversal, 0)
index 1301b8f71ab3ad51c59b1c2e981fdb702775cd26..e20023274988cdd66e4b0ce4bbe9a338e894e841 100644 (file)
@@ -208,16 +208,6 @@ int Person::getCrouch(){
        return 0;
 }
 
-bool Person::isRun(){
-       if(targetanimation==runanim||targetanimation==wolfrunanim||targetanimation==wolfrunninganim||targetanimation==rabbitrunninganim)return 1;
-       else return 0;
-}
-
-
-bool Person::wasRun(){
-       if(currentanimation==runanim||currentanimation==wolfrunanim||currentanimation==wolfrunninganim||currentanimation==rabbitrunninganim)return 1;
-       else return 0;
-}
 int Person::getRun(){
        if(creature==rabbittype&&(!superruntoggle||weaponactive!=-1))return runanim;
        if(creature==wolftype&&(!superruntoggle))return wolfrunanim;
index 8f8006ad3a0e24df9924f1061a864451565d4c30..28f21b559b6cc57250e7840010bec627b14528fb 100644 (file)
@@ -361,8 +361,14 @@ class Person
                bool isSneak();
                int getSneak();
                
-               bool wasRun();
-               bool isRun();
+               bool wasRun()
+               {
+                 return animation_bits[currentanimation] & ab_run;
+               }
+               bool isRun()
+               {
+                 return animation_bits[targetanimation] & ab_run;
+               }
                int getRun();
                
                bool wasLanding();