From 1cac64b9ff7384af650fed2bef25fa27069fd589 Mon Sep 17 00:00:00 2001 From: megazig Date: Thu, 12 Jan 2012 19:39:28 -0600 Subject: fixes for using class functions instead of extern'd calls updated full daEnDosun_c definition half working daEnMegaDosun_c --- src/bossBalboaWrench.cpp | 9 +- src/bossFuzzyBear.cpp | 34 +++--- src/bossMegaGoomba.cpp | 21 ++-- src/bossRamboo.cpp | 6 +- src/bossThwompaDomp.cpp | 312 +++++++++++++++++++++++++++++++++++++++++------ src/bossWrenchThrow.cpp | 23 ++-- src/fakeStarCoin.cpp | 18 ++- src/mrsun.cpp | 13 +- src/spritespawner.cpp | 3 +- src/spriteswapper.cpp | 3 +- 10 files changed, 336 insertions(+), 106 deletions(-) (limited to 'src') diff --git a/src/bossBalboaWrench.cpp b/src/bossBalboaWrench.cpp index acdbb44..1db7496 100644 --- a/src/bossBalboaWrench.cpp +++ b/src/bossBalboaWrench.cpp @@ -66,9 +66,6 @@ daBalboa_c *daBalboa_c::build() { } -extern "C" void *HandleXSpeed(daBalboa_c *); -extern "C" void *HandleYSpeed(daBalboa_c *); -extern "C" void *UpdateObjectPosBasedOnSpeedValues_real(daBalboa_c *); extern "C" u32 GenerateRandomNumber(int max); extern "C" dStageActor_c *CreateActor(u16 classID, int settings, Vec pos, char rot, char layer); extern "C" u8 dSprite_c__getXDirectionOfFurthestPlayerRelativeToVEC3(daBalboa_c *, Vec pos); @@ -120,10 +117,10 @@ void daBalboa_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) //FIXME hack to make multiple playerCollisions work this->isDead = 0; this->flags_4FC |= (1<<(31-7)); - if(apOther->owner->_38D > 3) { - OSReport("!!!ATTENTION!!!\napOther->owner->_38D > 3\n"); + if(apOther->owner->which_player > 3) { + OSReport("!!!ATTENTION!!!\napOther->owner->which_player > 3\n"); }else{ - this->counter_504[apOther->owner->_38D] = 0; + this->counter_504[apOther->owner->which_player] = 0; } } diff --git a/src/bossFuzzyBear.cpp b/src/bossFuzzyBear.cpp index 7bb7e8b..1b9cc99 100644 --- a/src/bossFuzzyBear.cpp +++ b/src/bossFuzzyBear.cpp @@ -66,10 +66,6 @@ daFuzzyBear_c *daFuzzyBear_c::build() { } -extern "C" void *HandleXSpeed(daFuzzyBear_c *); -extern "C" void *HandleYSpeed(daFuzzyBear_c *); -extern "C" void *UpdateObjectPosBasedOnSpeedValues_real(daFuzzyBear_c *); -extern "C" void *doSpriteMovement(dEn_c *); extern "C" void *PlaySound(daFuzzyBear_c *, int soundID); extern "C" void *StopSound(int soundID); @@ -123,8 +119,8 @@ void daFuzzyBear_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhy if (blah->speed.y < 0) { blah->speed.y = -blah->speed.y; } - doSpriteMovement(blah); - doSpriteMovement(blah); + blah->doSpriteMovement(); + blah->doSpriteMovement(); if (this->isInvulnerable == 1) { @@ -455,10 +451,10 @@ void daFuzzyBear_c::executeState_Bounce() { else { this->speed.y = this->speed.y - 0.1; } // Gravity - HandleXSpeed(this); - HandleYSpeed(this); + this->HandleXSpeed(); + this->HandleYSpeed(); - UpdateObjectPosBasedOnSpeedValues_real(this); + this->UpdateObjectPosBasedOnSpeedValuesReal(); } @@ -533,10 +529,10 @@ void daFuzzyBear_c::executeState_Needles() { } else { doStateChange(&StateID_Bounce); } - HandleXSpeed(this); - HandleYSpeed(this); + this->HandleXSpeed(); + this->HandleYSpeed(); - UpdateObjectPosBasedOnSpeedValues_real(this); + this->UpdateObjectPosBasedOnSpeedValuesReal(); } void daFuzzyBear_c::endState_Needles() { OSReport("Fuzzy Needle State End"); } @@ -587,10 +583,10 @@ void daFuzzyBear_c::executeState_Spray() { else { this->speed.y = this->speed.y - 0.1; } // Gravity - HandleXSpeed(this); - HandleYSpeed(this); + this->HandleXSpeed(); + this->HandleYSpeed(); - UpdateObjectPosBasedOnSpeedValues_real(this); + this->UpdateObjectPosBasedOnSpeedValuesReal(); } void daFuzzyBear_c::endState_Spray() { @@ -679,11 +675,11 @@ void daFuzzyBear_c::executeState_RolyPoly() { -// HandleXSpeed(this); -// HandleYSpeed(this); +// this->HandleXSpeed(); +// this->HandleYSpeed(); -// doSpriteMovement(this); -// UpdateObjectPosBasedOnSpeedValues_real(this); +// this->doSpriteMovement(); +// this->UpdateObjectPosBasedOnSpeedValuesReal(); } void daFuzzyBear_c::endState_RolyPoly() { diff --git a/src/bossMegaGoomba.cpp b/src/bossMegaGoomba.cpp index 996a609..f701ee7 100644 --- a/src/bossMegaGoomba.cpp +++ b/src/bossMegaGoomba.cpp @@ -117,10 +117,6 @@ void HexDump(char* address, u32 length) { extern "C" void *PlaySound(daMegaGoomba_c *, int soundID); -//FIXME make these dEn_c::HandleXSpeed(); -extern "C" void *HandleXSpeed(daMegaGoomba_c *); -extern "C" void *HandleYSpeed(daMegaGoomba_c *); -extern "C" void *UpdateObjectPosBasedOnSpeedValues_real(daMegaGoomba_c *); extern "C" u32 GenerateRandomNumber(int max); extern "C" u8 dSprite_c__getXDirectionOfFurthestPlayerRelativeToVEC3(daMegaGoomba_c *, Vec pos); extern "C" dStageActor_c *CreateActor(u16 classID, int settings, Vec pos, char rot, char layer); @@ -128,7 +124,6 @@ extern "C" dStageActor_c *GetSpecificPlayerActor(int number); //FIXME make this dEn_c->used... extern "C" char usedForDeterminingStatePress_or_playerCollision(dEn_c* t, ActivePhysics *apThis, ActivePhysics *apOther, int unk1); -extern "C" void doSpriteMovement(dStageActor_c* actor); extern "C" int SomeStrangeModification(dStageActor_c* actor); extern "C" void DoStuffAndMarkDead(dStageActor_c *actor, Vec vector, float unk); extern "C" int SmoothRotation(short* rot, u16 amt, int unk2); @@ -235,10 +230,10 @@ void daMegaGoomba_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOth //FIXME hack to make multiple playerCollisions work this->isDead = 0; this->flags_4FC |= (1<<(31-7)); - if(apOther->owner->_38D > 3) { - OSReport("!!!ATTENTION!!!\napOther->owner->_38D > 3\n"); + if(apOther->owner->which_player > 3) { + OSReport("!!!ATTENTION!!!\napOther->owner->which_player > 3\n"); }else{ - this->counter_504[apOther->owner->_38D] = 0; + this->counter_504[apOther->owner->which_player] = 0; } } @@ -613,8 +608,8 @@ void daMegaGoomba_c::executeState_Turn() { this->bodyModel._vf1C(); this->animationPat.process(); - HandleYSpeed(this); - doSpriteMovement(this); + this->HandleYSpeed(); + this->doSpriteMovement(); /*this->_vf2D0(); //nullsub();*/ int ret = SomeStrangeModification(this); @@ -650,9 +645,9 @@ void daMegaGoomba_c::executeState_Walk() { this->bodyModel._vf1C(); this->animationPat.process(); //HOMEMADE// - HandleXSpeed(this); - HandleYSpeed(this); - doSpriteMovement(this); + this->HandleXSpeed(); + this->HandleYSpeed(); + this->doSpriteMovement(); u16 amt = (this->direction == 0) ? 0x2000 : 0xE000; SmoothRotation(&this->rot.y, amt, 0x200); /*this->_vf2D0(); //nullsub();*/ diff --git a/src/bossRamboo.cpp b/src/bossRamboo.cpp index 598cf75..3ed947d 100644 --- a/src/bossRamboo.cpp +++ b/src/bossRamboo.cpp @@ -62,9 +62,6 @@ daRamboo_c *daRamboo_c::build() { } -extern "C" void *HandleXSpeed(daRamboo_c *); -extern "C" void *HandleYSpeed(daRamboo_c *); -extern "C" void *UpdateObjectPosBasedOnSpeedValues_real(daRamboo_c *); extern "C" u32 GenerateRandomNumber(int max); extern "C" dStageActor_c *CreateActor(u16 classID, int settings, Vec pos, char rot, char layer); extern "C" u8 dSprite_c__getXDirectionOfFurthestPlayerRelativeToVEC3(daRamboo_c *, Vec pos); @@ -105,7 +102,8 @@ void daRamboo_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysic CreateEffect(380, &apOther->owner->pos); doStateChange(&StateID_Flee); - apOther->owner->Delete(); + //FIXME changed to dStageActor_c::Delete(u8) from fBase_c::Delete(void) + apOther->owner->Delete(apOther->owner->_390); } } void daRamboo_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Hammer"); } diff --git a/src/bossThwompaDomp.cpp b/src/bossThwompaDomp.cpp index 1c366b8..268b4bd 100644 --- a/src/bossThwompaDomp.cpp +++ b/src/bossThwompaDomp.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include "daEnDosun_c.h" @@ -22,30 +23,65 @@ void sub_8009ea50( _464_struct* data ) { } #endif + +//FIXME find if needed +extern "C" int s_800b56e0(Vec,float*,float*,u8 zone); +//FIXME +extern "C" void* unk_8042A008; +extern "C" void UnknownBullshit(void*,int,int,int,int); +//FIXME +extern "C" void* SoundRelatedClass; +extern "C" Vec ConvertStagePositionIntoScreenPosition__Maybe(Vec); +extern "C" void AnotherSoundRelatedFunction(void*,SFX,Vec,int); + +#define OLD 0 +#define STATES_NEEDED 1 +#define SETTINGS1CHANGE 1 class daEnMegaDosun_c : public daEnDosun_c { - //int onCreate(); // overload for mega - //int onExecute(); + int onCreate(); // overload for mega + int onExecute(); static daEnMegaDosun_c *build(); //int checkZoneBoundaries(int); +#if STATES_NEEDED //FIXME - //USING_STATES(daEnMegaDosun_c); - //DECLARE_STATE(Wait); + USING_STATES(daEnMegaDosun_c); + DECLARE_STATE(UpWait); + DECLARE_STATE(DownMoveWait); + DECLARE_STATE(PuruMove); + DECLARE_STATE(DownMoveKameck); + DECLARE_STATE(DownMove); + DECLARE_STATE(DownWait); + DECLARE_STATE(UpMove); +#endif }; +#if STATES_NEEDED +CREATE_STATE(daEnMegaDosun_c, UpWait); +CREATE_STATE(daEnMegaDosun_c, DownMoveWait); +CREATE_STATE(daEnMegaDosun_c, PuruMove); +CREATE_STATE(daEnMegaDosun_c, DownMoveKameck); +CREATE_STATE(daEnMegaDosun_c, DownMove); +CREATE_STATE(daEnMegaDosun_c, DownWait); +CREATE_STATE(daEnMegaDosun_c, UpMove); +#endif + daEnMegaDosun_c *daEnMegaDosun_c::build() { + OSReport("Building MegaThwomp\n"); void *buffer = AllocFromGameHeap1(sizeof(daEnMegaDosun_c)); return new(buffer) daEnMegaDosun_c; } -#if 0 +#if 1 +//FIXME stops halfway up int daEnMegaDosun_c::onCreate() { - //FIXME + OSReport("daEnMegaDosun::onCreate()\n"); + this->bigOrSmall = 1; // 0=small,1=big,2=mega this->setupBodyModel(); // add this for linking/rename - + this->_36D = 0; // byte this->holdsFromSettings = this->settings & 0xf; //0=normal,1=??,2=fall @@ -54,17 +90,10 @@ int daEnMegaDosun_c::onCreate() { this->pos.y -= 21.0; this->pos.z = -280.0; // behind layer1 (hides spikes) - //FIXME might be u32 0x11804101 - /* - this->collision_struct[0] = 0x11; - this->collision_struct[1] = 0x80; - this->collision_struct[2] = 0x41; - this->collision_struct[3] = 0x01; - */ - this->collision_struct = 0x11804101; - this->_5C0 = 0xFFFE1000; - this->_5C4 = 0x1F000; - this->_5C8 = 0x5000; + this->collision_struct[0] = 0x11804101; + this->collision_struct[1] = 0xFFFE1000; + this->collision_struct[2] = 0x0001F000; + this->collision_struct[3] = 0x00005000; /* //0x80ACF990 + 0x8C = 80acfa1C @@ -74,6 +103,7 @@ int daEnMegaDosun_c::onCreate() { */ ActivePhysics::Info hm; hm.xDistToCenter = 0.0; + //FIXME find the missing link hm.yDistToCenter = 41.0; hm.xDistToEdge = 36.0; hm.yDistToEdge = 38.0; @@ -83,6 +113,7 @@ int daEnMegaDosun_c::onCreate() { hm.bitfield2 = 0x0000820E; hm.unkShort1C = 0x0100; hm.callback = &dEn_c::collisionCallback; + OSReport("this->aPhysiscs.initWithStruct(this,&hm);\n"); this->aPhysics.initWithStruct(this, &hm); /* 0x00000001,0xfffe1000,0x0001f000,0x00055000, @@ -90,8 +121,9 @@ int daEnMegaDosun_c::onCreate() { * 0x03000000,0x0000004f,0x0000820e,0x01000000, * dEn_c::collisionCallback */ - u8 s3[] = {0,0,0,1,0xff,0xfe,0x10,0,0,1,0xf0,0,0,5,0x50,0}; - //FIXME 0x80ACF990 + 0x58 = 80acf9e8 + //u8 s3[] = {0,0,0,1,0xff,0xfe,0x10,0,0,1,0xf0,0,0,5,0x50,0}; + u8 s3[] = {0,0,0,1,0xff,0xfe,0x10,0,0,1,0xf0,0,0xff,0xfe,0x10,0}; + OSReport("this->collMgr.Init(this,(u8*)&this->collision_struct,(u8*)&s3,0);\n"); this->collMgr.Init(this,(u8*)&this->collision_struct,(u8*)&s3,0); this->pos_delta2.x = 0.0; @@ -100,6 +132,7 @@ int daEnMegaDosun_c::onCreate() { this->_320 = 0.0; this->_324 = 48.0; + OSReport("this->aPhysics.addToList();\n"); this->aPhysics.addToList(); this->scale.x = 1.0; @@ -113,6 +146,7 @@ int daEnMegaDosun_c::onCreate() { this->rot.y = 0; this->rot.z = 0; + OSReport("this->doStateChange(FOO): %d\n", this->holdsFromSettings); // check settings bit if(this->holdsFromSettings == 2) { this->doStateChange(&StateID_DownMove_Kameck); @@ -124,22 +158,230 @@ int daEnMegaDosun_c::onCreate() { } #endif -#if 0 int daEnMegaDosun_c::onExecute() { acState.execute(); - //FIXME change to do outro when leaving screen - //this->checkZoneBoundaries(0); + /* + float tempRect[4] = {this->_320,this->_324,0.5*this->spriteSomeRectX,0.5*this->spriteSomeRectY}; + int foo = this->outOfZone(this->pos, tempRect, this->currentZoneID); + //float tempRect2[4] = {this->_338, this->_33C, this->_340, this->_344}; + //OSReport("s_800b56e0()\n"); + //int bar = s_800b56e0(this->pos, tempRect, tempRect2, this->currentZoneID); + //OSReport("foo: %d, bar: %d\n", foo, bar); + if(foo) { + OSReport("this->outOfZone(%d) : %d\n", this->currentZoneID, foo); + OSReport("daEnMegaDosun_c has left the building\n"); + this->Delete(this->_390); + //FIXME change to do outro when leaving screen + }else{ + OSReport("this->outOfZone(%d) : %d\n", this->currentZoneID, foo); + } + */ + int ret = this->checkZoneBoundaries(0); + if(ret) { + OSReport("daEnMegaDosun_c has left the building\n"); + } return 1; } + +#if STATES_NEEDED +//FIXME add sideways moving +//StateID_UpWait +void daEnMegaDosun_c::beginState_UpWait() { + OSReport("beginState_UpWait()\n"); + this->countdownTimer = 0; + if(!this->bigOrSmall) + return; + this->collision_struct[0] = 0x11804101; +} +void daEnMegaDosun_c::executeState_UpWait() { + OSReport("executeState_UpWait()\n"); + if(this->countdownTimer != 0) { + this->countdownTimer--; + return; + } + + //FIXME need megasized - also needs to be less leeway + float _array[] = { 48.0, 80.0 }; // small, big + //CheckIfPlayerBelow(xDelta, yDelta); + //if(this->CheckIfPlayerBelow(80.0, 256.0)) { + if(this->CheckIfPlayerBelow(40.0, 256.0)) { + this->doStateChange(&StateID_DownMoveWait); + this->speed.y = 0.0; + } +} +void daEnMegaDosun_c::endState_UpWait() { + OSReport("endState_UpWait()\n"); + return; +} + +//StateID_DownMoveWait +void daEnMegaDosun_c::beginState_DownMoveWait() { + OSReport("beginState_DownMoveWait()\n"); + this->anmVis.playState = 1; + this->bodyModel.bindAnim(&this->anmVis, 0.5); +} +void daEnMegaDosun_c::executeState_DownMoveWait() { + OSReport("executeState_DownMoveWait()\n"); + if(this->anmVis.isAnimationDone()) + this->doStateChange(&StateID_PuruMove); + this->anmVis.process(); +} +void daEnMegaDosun_c::endState_DownMoveWait() { + OSReport("endState_DownMoveWait()\n"); + return; +} + +//StateID_PuruMove +void daEnMegaDosun_c::beginState_PuruMove() { + OSReport("beginState_PuruMove()\n"); + this->puruMoveCounter = 8; + this->shakeIndex = 0; +} +void daEnMegaDosun_c::executeState_PuruMove() { + OSReport("executeState_PuruMove()\n"); + if(this->puruMoveCounter == 0) { + this->shakePosXoffset = 0.0; + this->doStateChange(&StateID_DownMove); + return; + } + + this->puruMoveCounter--; + if(this->puruMoveCounter & 2 == 0) + return; + + float _array[] = {2.0, 0.0}; + this->shakeIndex ^= 1; + this->shakePosXoffset = _array[this->shakeIndex]; +} +void daEnMegaDosun_c::endState_PuruMove() { + OSReport("endState_PuruMove()\n"); + return; +} + +//StateID_DownMoveKameck +void daEnMegaDosun_c::beginState_DownMoveKameck() { + OSReport("beginState_DownMoveKameck()\n"); + this->anmVis.playState = 1; + this->bodyModel.bindAnim(&this->anmVis, 0.5); +} +void daEnMegaDosun_c::executeState_DownMoveKameck() { + OSReport("executeState_DownMoveKameck()\n"); + if(this->anmVis.isAnimationDone()) + this->doStateChange(&StateID_DownMove); + this->anmVis.process(); +} +void daEnMegaDosun_c::endState_DownMoveKameck() { + OSReport("endState_DownMoveKameck()\n"); + return; +} + +//StateID_DownMove +void daEnMegaDosun_c::beginState_DownMove() { + OSReport("beginState_DownMove()\n"); + this->speed.y = 0.0; +} +void daEnMegaDosun_c::executeState_DownMove() { + OSReport("executeState_DownMove()\n"); + this->HandleYSpeed(); + this->UpdateObjectPosBasedOnSpeedValuesReal(); + + //FIXME what do I do? - bottom detection + int ret = this->collMgr.s_80072BC0(); + OSReport("s_80072BC0(): %08x\n", ret); + if(!ret) + return; + +#if SETTINGS1CHANGE + if((this->holdsFromSettings == 1) && (ret & 0x8000)) { + OSReport("this->speed.y = 0.0;\n"); + this->speed.y = 0.0; + } + + if(this->holdsFromSettings == 2) { + OSReport("ret |= 0x400000\n"); + ret |= 0x400000; + } +#else + if(this->holdsFromSettings == 1) { + OSReport("ret |= 0x400000\n"); + ret |= 0x400000; + } +#endif + + if(!(ret & 0x400000)) { + OSReport("doStateChange(&StateID_DownWait)\n"); + this->doStateChange(&StateID_DownWait); + this->countdownTimer = 0x40; + this->speed.y = 0.0; + UnknownBullshit(unk_8042A008, 0, 1, 0, 0); + }else{ + this->collision_struct[0] = 0x00000001; + this->speed.y = 0.0; + OSReport("UnknownBullshit(%x,%d,%d,%d,%d)\n", unk_8042A008,0,1,0,0); + UnknownBullshit(unk_8042A008, 0, 1, 0, 0); + this->collMgr.Clear2(); + } + + this->spawnEffects(); + Vec p = ConvertStagePositionIntoScreenPosition__Maybe(this->pos); + AnotherSoundRelatedFunction(SoundRelatedClass, SE_EMY_BIG_DOSSUN, p, 0); + //SoundRelatedClass.AnotherSoundRelatedFunction(SE_EMY_BIG_DOSSUN, p, 0); +} +void daEnMegaDosun_c::endState_DownMove() { + OSReport("endState_DownMove()\n"); + return; +} + +//StateID_DownWait +void daEnMegaDosun_c::beginState_DownWait() { + OSReport("beginState_DownWait()\n"); + return; +} +void daEnMegaDosun_c::executeState_DownWait() { + OSReport("executeState_DownWait()\n"); + if(this->countdownTimer == 0) { + this->doStateChange(&StateID_UpMove); + }else{ + this->countdownTimer--; + if(this->countdownTimer & 0xff == 0x20) + this->anmVis.playState = 3; + } + + this->anmVis.process(); +} +void daEnMegaDosun_c::endState_DownWait() { + OSReport("endState_DownWait()\n"); + return; +} + +//StateID_UpMove +void daEnMegaDosun_c::beginState_UpMove() { + OSReport("beginState_UpMove()\n"); + this->collMgr.Clear2(); +} +void daEnMegaDosun_c::executeState_UpMove() { + OSReport("executeState_UpMove()\n"); + this->speed.y = 0.875; + this->UpdateObjectPosBasedOnSpeedValuesReal(); + int ret = this->collMgr.SomethingSemiImportant(0); + OSReport("this->collMgr.SomethingSemiImportant(0): %08x\n", ret); + if(ret != 0) { // at top + this->doStateChange(&StateID_UpWait); + this->countdownTimer = 0xc; + } +} +void daEnMegaDosun_c::endState_UpMove() { + OSReport("endState_UpMove()\n"); + return; +} #endif -//FIXME #if 0 int daEnMegaDosun_c::checkZoneBoundaries(int foo) { - if(this->_36C == 2) { // is eaten + if(this->eatenState == 2) { // is eaten return 0; } @@ -150,16 +392,14 @@ int daEnMegaDosun_c::checkZoneBoundaries(int foo) { int ret = 0; -#if 0 Rect tempRect = (Rect){this->_320, this->_324, 0.5 * this->spriteSomeRectX, 0.5 * this->spriteSomeRectY}; Rect tempRect2 = (Rect){_338, _33C, _340, _344}; - if(this->s800064da0(pos, &tempRect, currentZoneId) || + if(this->outOfZone(this->pos, &tempRect, currentZoneId) || (!(foo&0x4) && s_800b56e0(pos, &tempRect, &tempRect2, currentZoneId)) ) { ret = 1; } -#endif if(ret && !(foo & 0x2)) this->Delete(this->_390); @@ -173,22 +413,22 @@ extern "C" bool CollidedWithTile(u8 *); extern "C" void *SomeStrangeModification(dEn_c *); void ThwompaDompMoveC(dEn_c *Sprite) { - - - + + + bool FirstCheck; bool SecondCheck; - + // Check for collisions with walls? FirstCheck = CollidedWithTile(Sprite->collMgr); SomeStrangeModification(Sprite); SecondCheck = CollidedWithTile(Sprite->collMgr); - + OSReport("XPos = %f, FirstCheck = %d, SecondCheck = %d", Sprite->pos.x, FirstCheck, SecondCheck); if ((FirstCheck != 0) && (SecondCheck != 0)) { OSReport("Actually doing something, I swear"); - + Sprite->pos.y = Sprite->pos.y + 16.0; Sprite->pos.x = Sprite->pos.x - 180.0; @@ -205,8 +445,8 @@ void ThwompaDompMoveC(dEn_c *Sprite) { else { Sprite->pos.x = Sprite->pos.x - 1.0; } } - - + + return; } #endif diff --git a/src/bossWrenchThrow.cpp b/src/bossWrenchThrow.cpp index beea815..6ce36f6 100644 --- a/src/bossWrenchThrow.cpp +++ b/src/bossWrenchThrow.cpp @@ -48,11 +48,7 @@ CREATE_STATE(daWrench, Straight); extern "C" void *PlaySound(dEn_c *, int soundID); -extern "C" void *UpdateObjectPosBasedOnSpeedValues_real(daWrench *); extern "C" dStageActor_c *GetSpecificPlayerActor(int number); -extern "C" void *HandleXSpeed(daWrench *); -extern "C" void *HandleYSpeed(daWrench *); - void daWrench::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { @@ -61,10 +57,10 @@ void daWrench::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { this->isDead = 0; this->flags_4FC |= (1<<(31-7)); - if(apOther->owner->_38D > 3) { - OSReport("!!!ATTENTION!!!\napOther->owner->_38D > 3\n"); + if(apOther->owner->which_player > 3) { + OSReport("!!!ATTENTION!!!\napOther->owner->which_player > 3\n"); }else{ - this->counter_504[apOther->owner->_38D] = 0; + this->counter_504[apOther->owner->which_player] = 0; } } @@ -78,7 +74,8 @@ void daWrench::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOth PlaySound(this, SE_BOSS_JR_FLOOR_BREAK); - this->Delete(); + //FIXME changed to dStageActor_c::Delete(u8) from fBase_c(void) + this->Delete(this->_390); } void daWrench::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther) {} @@ -266,14 +263,15 @@ void daWrench::executeState_Homing() { this->pos.y += this->ymod * this->lifespan / 360; - UpdateObjectPosBasedOnSpeedValues_real(this); + this->UpdateObjectPosBasedOnSpeedValuesReal(); if (this->lifespan < 1) { PlaySound(this, SE_OBJ_HAMMER_HIT_BOTH); CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.5, 1.5, 1.5}, 242); - this->Delete(); + //FIXME changed to dStageActor_c::Delete(u8) from fBase_c(void) + this->Delete(this->_390); } PlaySound(this, SE_EMY_CHOROPU_M_SPANNER); @@ -316,7 +314,7 @@ void daWrench::executeState_Straight() { this->rot.z += 0x1000; } - UpdateObjectPosBasedOnSpeedValues_real(this); + this->UpdateObjectPosBasedOnSpeedValuesReal(); PlaySound(this, SE_EMY_CHOROPU_M_SPANNER); @@ -327,7 +325,8 @@ void daWrench::executeState_Straight() { PlaySound(this, SE_OBJ_HAMMER_HIT_BOTH); CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){0.75, 0.75, 0.75}, 242); - this->Delete(); + //FIXME changed to dStageActor_c::Delete(u8) from fBase_c(void) + this->Delete(this->_390); } this->lifespan -= 1; diff --git a/src/fakeStarCoin.cpp b/src/fakeStarCoin.cpp index 8248b1c..5160545 100644 --- a/src/fakeStarCoin.cpp +++ b/src/fakeStarCoin.cpp @@ -44,7 +44,8 @@ void daFakeStarCoin::playerCollision(ActivePhysics *apThis, ActivePhysics *apOth PlaySound(this, SE_EMY_CS_TERESA_BEAT_YOU); CreateEffect(377, &this->pos); - this->Delete(); + //FIXME changed to dStageActor_c::Delete(u8) from fBase_c::Delete(void) + this->Delete(this->_390); } void daFakeStarCoin::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { @@ -53,7 +54,8 @@ void daFakeStarCoin::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, A PlaySound(this, SE_OBJ_EMY_FIRE_DISAPP); - this->Delete(); + //FIXME changed to dStageActor_c::Delete(u8) from fBase_c::Delete(void) + this->Delete(this->_390); } bool daFakeStarCoin::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.5, 1.5, 1.5}, 44); @@ -62,7 +64,8 @@ bool daFakeStarCoin::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, Ac PlaySound(this, SE_OBJ_PNGN_ICE_BREAK); - this->Delete(); + //FIXME changed to dStageActor_c::Delete(u8) from fBase_c::Delete(void) + this->Delete(this->_390); return false; } void daFakeStarCoin::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { @@ -71,7 +74,8 @@ void daFakeStarCoin::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePh PlaySound(this, SE_BOSS_JR_FLOOR_BREAK); - this->Delete(); + //FIXME changed to dStageActor_c::Delete(u8) from fBase_c::Delete(void) + this->Delete(this->_390); } void daFakeStarCoin::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) { CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 48); @@ -79,7 +83,8 @@ void daFakeStarCoin::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics PlaySound(this, SE_BOSS_JR_FLOOR_BREAK); - this->Delete(); + //FIXME changed to dStageActor_c::Delete(u8) from fBase_c::Delete(void) + this->Delete(this->_390); } void daFakeStarCoin::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther) { CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 336); @@ -87,7 +92,8 @@ void daFakeStarCoin::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysi PlaySound(this, SE_OBJ_EMY_FIRE_DISAPP); - this->Delete(); + //FIXME changed to dStageActor_c::Delete(u8) from fBase_c::Delete(void) + this->Delete(this->_390); } diff --git a/src/mrsun.cpp b/src/mrsun.cpp index 8fb4524..a93c06f 100755 --- a/src/mrsun.cpp +++ b/src/mrsun.cpp @@ -68,9 +68,6 @@ daMrSun_c *daMrSun_c::build() { } -extern "C" void *HandleXSpeed(daMrSun_c *); -extern "C" void *HandleYSpeed(daMrSun_c *); -extern "C" void *UpdateObjectPosBasedOnSpeedValues_real(daMrSun_c *); extern "C" u32 GenerateRandomNumber(int max); extern "C" u8 dSprite_c__getXDirectionOfFurthestPlayerRelativeToVEC3(daMrSun_c *, Vec pos); extern "C" dStageActor_c *CreateActor(u16 classID, int settings, Vec pos, char rot, char layer); @@ -364,16 +361,16 @@ void daMrSun_c::executeState_Follow() { if (this->speed.x > 6.0) { this->speed.x = this->speed.x - (speedDelta); } } - HandleXSpeed(this); + this->HandleXSpeed(); float yDiff; yDiff = (this->Baseline - this->pos.y) / 8; this->speed.y = yDiff; - HandleYSpeed(this); + this->HandleYSpeed(); - UpdateObjectPosBasedOnSpeedValues_real(this); + this->UpdateObjectPosBasedOnSpeedValuesReal(); this->timer = this->timer + 1; } @@ -575,8 +572,8 @@ void daMrSun_c::executeState_Spin() { if (this->speed.x > 80.0) { this->speed.x = this->speed.x - (0.2 * 2); } } - HandleXSpeed(this); - UpdateObjectPosBasedOnSpeedValues_real(this); + this->HandleXSpeed(); + this->UpdateObjectPosBasedOnSpeedValuesReal(); this->timer = this->timer + 1; diff --git a/src/spritespawner.cpp b/src/spritespawner.cpp index 5335dfe..32462d5 100755 --- a/src/spritespawner.cpp +++ b/src/spritespawner.cpp @@ -95,7 +95,8 @@ void SpriteSpawner_Update(SpriteSpawner *self) { self->x = spawned->pos.x; self->y = spawned->pos.y; self->z = spawned->pos.z; - spawned->Delete(); + //FIXME changed to add dStageActor_c's Delete(u8) instead of fBase_c's Delete(void) + spawned->Delete(spawned->_390); } self->createdActor = 0; } diff --git a/src/spriteswapper.cpp b/src/spriteswapper.cpp index 4929e7c..a158efc 100755 --- a/src/spriteswapper.cpp +++ b/src/spriteswapper.cpp @@ -105,7 +105,8 @@ void SpriteSwapper_CopyAndDestroy(SpriteSwapper *self) { self->direction = spawned->direction; self->speed = spawned->speed; self->rot = spawned->rot; - spawned->Delete(); + //FIXME changed from fBase_c::Delete(void) to dStageActor_c::Delete(u8) + spawned->Delete(spawned->_390); self->spawnedActor = 0; OSReport("Now it's deleted."); -- cgit v1.2.3