diff options
Diffstat (limited to 'src/bossPlayerClown.cpp')
-rw-r--r-- | src/bossPlayerClown.cpp | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/src/bossPlayerClown.cpp b/src/bossPlayerClown.cpp index 5831748..dbf2ff9 100644 --- a/src/bossPlayerClown.cpp +++ b/src/bossPlayerClown.cpp @@ -7,10 +7,8 @@ #define CLOWN_MODEL(clown) ((m3d::mdl_c*)( ((u32)(clown)) + 0xFD0 )) #define playerOccupying (((u32)(clown)) + 0x738 ) +// #define allocator ((mHeapAllocator_c*)(((u32)(clown)) + 0x524 )) -// candidates for player are 0x738. Load the vtable from the actor at 0x738, then fire function 0x6C -// Or just fire 0x6C -// or just check 0x38D extern "C" int PClownCarExecute(dEn_c *clown); extern "C" void PClownCarAfterCreate(dEn_c *clown, u32); @@ -20,15 +18,15 @@ extern "C" void PClownCarMove(dEn_c *clown); int CConDraw(dEn_c *clown) { // setup cannon model - matrix.translation(pos.x, pos.y, pos.z); - newrot = rot.y + 0x4000; - matrix.applyRotationYXZ(&rot.x, &newrot, &rot.z); + clown->matrix.translation(clown->pos.x, clown->pos.y, clown->pos.z); + short newrot = 0x4000; + clown->matrix.applyRotationYXZ(&clown->rot.x, &newrot, &clown->rot.z); - CLOWN_MODEL(clown).setDrawMatrix(matrix); - CLOWN_MODEL(clown).setScale(&scale); - CLOWN_MODEL(clown).calcWorld(false); + // CLOWN_MODEL(clown)->setDrawMatrix(clown->matrix); + // CLOWN_MODEL(clown)->setScale(&clown->scale); + // CLOWN_MODEL(clown)->calcWorld(false); - CLOWN_MODEL(clown).scheduleForDrawing(); + // CLOWN_MODEL(clown)->scheduleForDrawing(); return PClownCarDraw(clown); @@ -45,18 +43,27 @@ void CCafterCreate(dEn_c *clown, u32 param) { clown->scale.y *= 1.25; clown->scale.z *= 1.25; + OSReport("AfterCreate"); // setup the model - mHeapAllocator_c allocator; nw4r::g3d::ResFile resFile; + mHeapAllocator_c allocator; + + OSReport("defined"); allocator.link(-1, GameHeaps[0], 0, 0x20); + OSReport("allocated"); - this->resFile.data = getResource("koopaJr_clown_ply", "g3d/cannon.brres"); - nw4r::g3d::ResMdl mdl = this->resFile.GetResMdl("Cannon"); - CLOWN_MODEL(clown).setup(mdl, &allocator, 0x224, 1, 0); - SetupTextures_MapObject(&CLOWN_MODEL(clown), 0); + resFile.data = getResource("koopaJr_clown_ply", "g3d/cannon.brres"); + OSReport("resource"); + nw4r::g3d::ResMdl mdl = resFile.GetResMdl("Cannon"); + OSReport("model"); + CLOWN_MODEL(clown)->setup(mdl, &allocator, 0x224, 1, 0); + OSReport("setup"); + SetupTextures_MapObj(CLOWN_MODEL(clown), 0); + OSReport("lightmaps"); allocator.unlink(); + OSReport("unlinked"); // Original AfterCreate PClownCarAfterCreate(clown, param); @@ -65,8 +72,8 @@ void CCafterCreate(dEn_c *clown, u32 param) { void CConExecuteMove(dEn_c *clown) { u8 player = ((dStageActor_c *)playerOccupying)->which_player; - OSReport("Angle = %x, %x, %x", (GetSpecificPlayerActor(player))->rot.y, (GetSpecificPlayerActor(player))->rot.x, (GetSpecificPlayerActor(player))->rot.z); - OSReport("Clown = %x, %x, %x", (clown)->rot.y, (clown)->rot.x, (clown)->rot.z); + // OSReport("Angle = %x, %x, %x", (GetSpecificPlayerActor(player))->rot.y, (GetSpecificPlayerActor(player))->rot.x, (GetSpecificPlayerActor(player))->rot.z); + // OSReport("Clown = %x, %x, %x", (clown)->rot.y, (clown)->rot.x, (clown)->rot.z); RemoconMngClass* Remo = GetRemoconMng(); @@ -86,7 +93,7 @@ void CConExecuteMove(dEn_c *clown) { spawned->speed.x = -5.0; } - SpawnEffect("Wm_en_killervanish", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); + SpawnEffect("Wm_en_killervanish", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){0.25, 0.25, 0.25}); PlaySoundAsync(clown, SE_OBJ_HOUDAI_S_SHOT); } |