diff options
Diffstat (limited to '')
-rw-r--r-- | src/bossMegaGoomba.cpp | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/bossMegaGoomba.cpp b/src/bossMegaGoomba.cpp index e836afb..032cfa8 100644 --- a/src/bossMegaGoomba.cpp +++ b/src/bossMegaGoomba.cpp @@ -44,7 +44,10 @@ class daMegaGoomba_c : public dEn_c { float JumpTime; bool takeHit(char count); + + void bindAnimChr_and_setUpdateRate(const char* name, int unk, float unk2); + void dieFall_Begin(); void dieFall_Execute(); static daMegaGoomba_c *build(); @@ -167,8 +170,17 @@ void daMegaGoomba_c::_vf120(ActivePhysics *apThis, ActivePhysics *apOther) { OSR void daMegaGoomba_c::_vf110(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("_vf110:\n"); } void daMegaGoomba_c::_vf108(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("_vf108:\n"); } +void daMegaGoomba_c::bindAnimChr_and_setUpdateRate(const char* name, int unk, float unk2) { + nw4r::g3d::ResAnmChr anmChr = this->resFile.GetResAnmChr(name); + this->animationChr.bind(&this->bodyModel, anmChr, unk); + this->bodyModel.bindAnim(&this->animationChr, unk2); + this->animationChr.setUpdateRate(1.0); +} - +void daMegaGoomba_c::dieFall_Begin() { + //this->bindAnimChr_and_setUpdateRate("split", 0, 0.0); + //dSprite_c::dieFall_Begin(); +} //TODO make this real perty like void daMegaGoomba_c::dieFall_Execute() { @@ -215,6 +227,7 @@ void daMegaGoomba_c::setupBodyModel() { bool ret; nw4r::g3d::ResAnmChr anmChr = this->resFile.GetResAnmChr("walk"); ret = this->animationChr.setup(mdl, anmChr, &this->allocator, 0); + this->bodyModel.bindAnim(&this->animationChr, 0.0); nw4r::g3d::ResAnmTexPat anmPat = this->resFile.GetResAnmTexPat("walk"); this->resTexPat = anmPat; @@ -309,7 +322,8 @@ int daMegaGoomba_c::onExecute() { int daMegaGoomba_c::onDraw() { bodyModel.scheduleForDrawing(); - animationChr.process(); + bodyModel._vf1C(); + //animationChr.process(); animationPat.process(); return true; } @@ -508,9 +522,11 @@ void daMegaGoomba_c::beginState_Walk() { //SETUP WALK ANIMATION// nw4r::g3d::ResAnmChr anmChr = this->resFile.GetResAnmChr("walk"); - this->animationChr.bind(&this->bodyModel, anmChr, 0); - this->bodyModel.bindAnim(&this->animationChr, 2.0); - /*this->animationChr._setUpdateRate(2.0); FIXME*/ + this->animationChr.bind(&this->bodyModel, anmChr, 1); + this->bodyModel.bindAnim(&this->animationChr, 0.0); + this->animationChr.setUpdateRate(1.0); + //OSReport("Current anmChr frame: %f\n", this->animationChr.getCurrentFrame()); + //OSReport("Is animation done? %d\n", this->animationChr.isAnimationDone()); this->bodyModel.bindAnim(&this->animationPat, 0.0); this->animationPat.setUpdateRateForEntry(1.0, 0); this->animationPat.setEntryByte34(0, 0); @@ -527,6 +543,8 @@ void daMegaGoomba_c::executeState_Walk() { Vec vctr; ConvertMatrixToTranslationVector(&mtx, &vctr); */ + if(this->animationChr.isAnimationDone()) + this->animationChr.setCurrentFrame(0.0); //HandleAcceleration(this); //HandleXSpeed(this); |