From: Alexander Monakov Date: Fri, 31 Dec 2010 01:08:50 +0000 (+0300) Subject: Simplify stop animations X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=429b479f57d0a432b07deb320d8f3e9e7c75c5df;p=lugaru.git Simplify stop animations --- diff --git a/Source/Animation.def b/Source/Animation.def index 36913f5..4c0ac35 100644 --- a/Source/Animation.def +++ b/Source/Animation.def @@ -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) diff --git a/Source/Person.cpp b/Source/Person.cpp index e200232..30d4f47 100644 --- a/Source/Person.cpp +++ b/Source/Person.cpp @@ -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; diff --git a/Source/Person.h b/Source/Person.h index 28f21b5..a745481 100644 --- a/Source/Person.h +++ b/Source/Person.h @@ -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();