From 265af929eecba3acf3258e6684f9f9b2f7cc1443 Mon Sep 17 00:00:00 2001 From: Colin Noga Date: Wed, 21 Mar 2012 21:00:50 -0500 Subject: Giving up on this approach, going to try something else later --- src/bossPlayerClown.cpp | 43 +++++++++++++---------- src/challengeStar.cpp | 2 +- src/makeYourOwnModelSprite.cpp | 80 +++++++++++++++++++++++++++++++++++++----- 3 files changed, 98 insertions(+), 27 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); } diff --git a/src/challengeStar.cpp b/src/challengeStar.cpp index ae73851..1f9c91a 100644 --- a/src/challengeStar.cpp +++ b/src/challengeStar.cpp @@ -103,7 +103,7 @@ int dChallengeStar::onCreate() { this->scale.y = 0.70; this->scale.z = 0.70; - this->pos.x = 8.0; + this->pos.x += 8.0; this->pos.y -= 14.0; this->pos.z = 3300.0; diff --git a/src/makeYourOwnModelSprite.cpp b/src/makeYourOwnModelSprite.cpp index d607f78..edf70ce 100644 --- a/src/makeYourOwnModelSprite.cpp +++ b/src/makeYourOwnModelSprite.cpp @@ -35,7 +35,7 @@ class dMakeYourOwn : public dStageActor_c { // Some variables to use int model; - char isAnimating; + bool isAnimating; float size; void setupAnim(const char* name, float rate); @@ -172,7 +172,7 @@ int dMakeYourOwn::onCreate() { SetupTextures_MapObj(&bodyModel, 0); this->pos.z = 3300.0; - setupAnim("anim08", 1.0); // AnmChr name, animation speed + setupAnim("anim08", 2.0); // AnmChr name, animation speed break; // ends the case case 9: // If nyb 12 is 0, it'll load this model @@ -205,7 +205,7 @@ int dMakeYourOwn::onCreate() { case 12: // If nyb 12 is 0, it'll load this model setupModel("block_arrow", "g3d/bre12.brres", "mario_end"); // arc name (no .arc), brres name, model name - SetupTextures_MapObj(&bodyModel, 0); + SetupTextures_Player(&bodyModel, 0); this->pos.z = 3000.0; setupAnim("anim12", 1.0); // AnmChr name, animation speed @@ -214,16 +214,16 @@ int dMakeYourOwn::onCreate() { case 13: // If nyb 12 is 0, it'll load this model setupModel("block_arrow", "g3d/bre13.brres", "luigi_end"); // arc name (no .arc), brres name, model name - SetupTextures_MapObj(&bodyModel, 0); + SetupTextures_Player(&bodyModel, 0); this->pos.z = 3000.0; - setupAnim("anim13", 1.0); // AnmChr name, animation speed + setupAnim("anim13", 2.0); // AnmChr name, animation speed break; // ends the case case 14: // If nyb 12 is 0, it'll load this model setupModel("block_arrow", "g3d/bre14.brres", "toady_end"); // arc name (no .arc), brres name, model name - SetupTextures_MapObj(&bodyModel, 0); + SetupTextures_Player(&bodyModel, 0); this->pos.z = 3000.0; setupAnim("anim14", 1.0); // AnmChr name, animation speed @@ -232,7 +232,7 @@ int dMakeYourOwn::onCreate() { case 15: // If nyb 12 is 0, it'll load this model setupModel("block_arrow", "g3d/bre15.brres", "toadb_end"); // arc name (no .arc), brres name, model name - SetupTextures_MapObj(&bodyModel, 0); + SetupTextures_Player(&bodyModel, 0); this->pos.z = 3000.0; setupAnim("anim15", 1.0); // AnmChr name, animation speed @@ -241,11 +241,75 @@ int dMakeYourOwn::onCreate() { case 16: // If nyb 12 is 0, it'll load this model setupModel("block_arrow", "g3d/bre16.brres", "peach_end"); // arc name (no .arc), brres name, model name - SetupTextures_MapObj(&bodyModel, 0); + SetupTextures_Enemy(&bodyModel, 0); this->pos.z = 3000.0; setupAnim("anim16", 1.0); // AnmChr name, animation speed break; // ends the case + + case 17: // If nyb 12 is 0, it'll load this model + + setupModel("arrow", "g3d/bre17.brres", "ground_perfect"); // arc name (no .arc), brres name, model name + SetupTextures_Map(&bodyModel, 0); + SetupTextures_MapObj(&bodyModel, 0); + this->pos.z = 3300.0; + + setupAnim("anim17", 1.0); // AnmChr name, animation speed + break; // ends the case + + case 18: // If nyb 12 is 0, it'll load this model + + setupModel("arrow", "g3d/bre18.brres", "mario_perfect"); // arc name (no .arc), brres name, model name + SetupTextures_Player(&bodyModel, 0); + this->pos.z = 3300.0; + + setupAnim("anim18", 1.0); // AnmChr name, animation speed + break; // ends the case + + case 19: // If nyb 12 is 0, it'll load this model + + setupModel("arrow", "g3d/bre19.brres", "luigi_perfect"); // arc name (no .arc), brres name, model name + SetupTextures_Player(&bodyModel, 0); + this->pos.z = 3000.0; + + setupAnim("anim19", 1.0); // AnmChr name, animation speed + break; // ends the case + + case 20: // If nyb 12 is 0, it'll load this model + + setupModel("arrow", "g3d/bre16.brres", "toady_perfect"); // arc name (no .arc), brres name, model name + SetupTextures_Player(&bodyModel, 0); + this->pos.z = 3000.0; + + setupAnim("anim20", 1.0); // AnmChr name, animation speed + break; // ends the case + + case 21: // If nyb 12 is 0, it'll load this model + + setupModel("arrow", "g3d/bre16.brres", "toadb_perfect"); // arc name (no .arc), brres name, model name + SetupTextures_Player(&bodyModel, 0); + this->pos.z = 3000.0; + + setupAnim("anim21", 1.0); // AnmChr name, animation speed + break; // ends the case + + case 22: // If nyb 12 is 0, it'll load this model + + setupModel("arrow", "g3d/bre22.brres", "peach_perfect"); // arc name (no .arc), brres name, model name + SetupTextures_Enemy(&bodyModel, 0); + this->pos.z = 3000.0; + + setupAnim("anim22", 1.0); // AnmChr name, animation speed + break; // ends the case + + case 23: // If nyb 12 is 0, it'll load this model + + setupModel("arrow", "g3d/bre23.brres", "backdrop"); // arc name (no .arc), brres name, model name + SetupTextures_Map(&bodyModel, 0); + this->pos.z = 3000.0; + + setupAnim("anim23", 1.0); // AnmChr name, animation speed + break; // ends the case // COPY the entire case here, and then change the number // -- cgit v1.2.3