From: Alexander Monakov Date: Fri, 31 Dec 2010 00:43:55 +0000 (+0300) Subject: Simplify run animations X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=797dc38c1623b98280500df2ab37edba4effabea;p=lugaru.git Simplify run animations --- diff --git a/Source/Animation.def b/Source/Animation.def index 1beec10..36913f5 100644 --- a/Source/Animation.def +++ b/Source/Animation.def @@ -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) diff --git a/Source/Person.cpp b/Source/Person.cpp index 1301b8f..e200232 100644 --- a/Source/Person.cpp +++ b/Source/Person.cpp @@ -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; diff --git a/Source/Person.h b/Source/Person.h index 8f8006a..28f21b5 100644 --- a/Source/Person.h +++ b/Source/Person.h @@ -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();