mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-02 22:14:33 +00:00
Doc/Cleanup pass on object handling (#1227)
* `Object_InitBank` -> `Object_InitContext` * Add and use `OBJECT_SPACE_SIZE_BASE` * Remove `OBJECT_EXCHANGE_BANK_MAX` -> use `ARRAY_COUNT()` instead * "object status" -> "object load entry" * Misc. cleanup/renames * Partial docs and way too much batch renaming and cleanup for a single commit * ctrl shift h * format * format clang-11.1 * fix regressions * Improve a `@bug` comment * Move `OBJECT_SPACE_SIZE_BASE` from header to near `Object_InitContext` * "objectID" -> "objectId" * Revert iterator index to `i` in `Actor_KillActorsWithUnloadedObject` * "object load entry index" -> "object entry" * `Object_UpdateLoadEntries` -> `Object_UpdateEntries` * Run format.sh * "object entry" -> "object slot" (except internal usage) * Proper `Object_SpawnPersistent` doc Co-authored-by: fig02 <fig02srl@gmail.com> * fixup one comment "object bank index" -> "object slot" * Amend `Object_SpawnPersistent` comment to mention running out of free slots * `Actor_KillActorsWithUnloadedObject` -> `Actor_KillAllWithMissingObject` * Remove useless mention of what uses `Object_SpawnPersistent` * Fix mistake on `Object_SpawnPersistent` doing sync dma, not async * run formatter * `Object_InitContext` -> `Object_Init` * `waitObjectSlot` -> `requiredObjectSlot` * `Object_Init` -> `func_80097DD8` * one objectIndex -> objectSlot * Remove `OBJECT_SPACE_SIZE_BASE` * light fix on the merge (rm OBJECT_EXCHANGE_BANK_MAX) * `func_80097DD8` -> `Object_InitContext` --------- Co-authored-by: fig02 <fig02srl@gmail.com>
This commit is contained in:
parent
83a13a64c7
commit
57ce0cf8d9
130 changed files with 789 additions and 770 deletions
|
@ -103,10 +103,10 @@ void BgBreakwall_Init(Actor* thisx, PlayState* play) {
|
|||
this->dyna.actor.world.pos.y -= 40.0f;
|
||||
}
|
||||
|
||||
this->bankIndex = (wallType >= BWALL_KD_FLOOR) ? Object_GetIndex(&play->objectCtx, OBJECT_KINGDODONGO)
|
||||
: Object_GetIndex(&play->objectCtx, OBJECT_BWALL);
|
||||
this->requiredObjectSlot = (wallType >= BWALL_KD_FLOOR) ? Object_GetSlot(&play->objectCtx, OBJECT_KINGDODONGO)
|
||||
: Object_GetSlot(&play->objectCtx, OBJECT_BWALL);
|
||||
|
||||
if (this->bankIndex < 0) {
|
||||
if (this->requiredObjectSlot < 0) {
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
} else {
|
||||
BgBreakwall_SetupAction(this, BgBreakwall_WaitForObject);
|
||||
|
@ -201,11 +201,11 @@ Actor* BgBreakwall_SpawnFragments(PlayState* play, BgBreakwall* this, Vec3f* pos
|
|||
* Sets up the collision model as well is the object dependency and action function to use.
|
||||
*/
|
||||
void BgBreakwall_WaitForObject(BgBreakwall* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->bankIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
CollisionHeader* colHeader = NULL;
|
||||
s32 wallType = ((this->dyna.actor.params >> 13) & 3) & 0xFF;
|
||||
|
||||
this->dyna.actor.objBankIndex = this->bankIndex;
|
||||
this->dyna.actor.objectSlot = this->requiredObjectSlot;
|
||||
Actor_SetObjectDependency(play, &this->dyna.actor);
|
||||
this->dyna.actor.flags &= ~ACTOR_FLAG_4;
|
||||
this->dyna.actor.draw = BgBreakwall_Draw;
|
||||
|
|
|
@ -12,7 +12,7 @@ typedef struct BgBreakwall {
|
|||
/* 0x0000 */ DynaPolyActor dyna;
|
||||
/* 0x0164 */ Gfx* bombableWallDList;
|
||||
/* 0x0168 */ s8 colType;
|
||||
/* 0x0169 */ s8 bankIndex;
|
||||
/* 0x0169 */ s8 requiredObjectSlot;
|
||||
/* 0x016C */ ColliderQuad collider;
|
||||
/* 0x01EC */ BgBreakwallActionFunc actionFunc;
|
||||
} BgBreakwall; // size = 0x01F0
|
||||
|
|
|
@ -66,12 +66,12 @@ void BgHakaMegane_Init(Actor* thisx, PlayState* play) {
|
|||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
|
||||
if (thisx->params < 3) {
|
||||
this->objBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_HAKACH_OBJECTS);
|
||||
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_HAKACH_OBJECTS);
|
||||
} else {
|
||||
this->objBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_HAKA_OBJECTS);
|
||||
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_HAKA_OBJECTS);
|
||||
}
|
||||
|
||||
if (this->objBankIndex < 0) {
|
||||
if (this->requiredObjectSlot < 0) {
|
||||
Actor_Kill(thisx);
|
||||
} else {
|
||||
this->actionFunc = func_8087DB24;
|
||||
|
@ -88,8 +88,8 @@ void func_8087DB24(BgHakaMegane* this, PlayState* play) {
|
|||
CollisionHeader* colHeader;
|
||||
CollisionHeader* collision;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objBankIndex)) {
|
||||
this->dyna.actor.objBankIndex = this->objBankIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
this->dyna.actor.objectSlot = this->requiredObjectSlot;
|
||||
this->dyna.actor.draw = BgHakaMegane_Draw;
|
||||
Actor_SetObjectDependency(play, &this->dyna.actor);
|
||||
if (play->roomCtx.curRoom.lensMode != LENS_MODE_HIDE_ACTORS) {
|
||||
|
|
|
@ -12,7 +12,7 @@ typedef struct BgHakaMegane {
|
|||
/* 0x0000 */ DynaPolyActor dyna;
|
||||
/* 0x0164 */ BgHakaMeganeActionFunc actionFunc;
|
||||
/* 0x0168 */ char unk_168[0x1];
|
||||
/* 0x0169 */ s8 objBankIndex;
|
||||
/* 0x0169 */ s8 requiredObjectSlot;
|
||||
/* 0x016A */ char unk_16A[0x2];
|
||||
} BgHakaMegane; // size = 0x016C
|
||||
|
||||
|
|
|
@ -169,16 +169,16 @@ void BgHakaSgami_Init(Actor* thisx, PlayState* play) {
|
|||
Effect_Add(play, &this->blureEffectIndex[1], EFFECT_BLURE1, 0, 0, &blureInit);
|
||||
|
||||
if (thisx->params == SCYTHE_TRAP_SHADOW_TEMPLE) {
|
||||
this->requiredObjBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_HAKA_OBJECTS);
|
||||
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_HAKA_OBJECTS);
|
||||
thisx->flags &= ~ACTOR_FLAG_0;
|
||||
} else {
|
||||
this->requiredObjBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_ICE_OBJECTS);
|
||||
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_ICE_OBJECTS);
|
||||
this->colliderScytheCenter.dim.radius = 30;
|
||||
this->colliderScytheCenter.dim.height = 70;
|
||||
Actor_SetFocus(thisx, 40.0f);
|
||||
}
|
||||
|
||||
if (this->requiredObjBankIndex < 0) {
|
||||
if (this->requiredObjectSlot < 0) {
|
||||
Actor_Kill(thisx);
|
||||
return;
|
||||
}
|
||||
|
@ -196,8 +196,8 @@ void BgHakaSgami_Destroy(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
void BgHakaSgami_SetupSpin(BgHakaSgami* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjBankIndex)) {
|
||||
this->actor.objBankIndex = this->requiredObjBankIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
this->actor.objectSlot = this->requiredObjectSlot;
|
||||
this->actor.draw = BgHakaSgami_Draw;
|
||||
this->timer = SCYTHE_SPIN_TIME;
|
||||
this->actor.flags &= ~ACTOR_FLAG_4;
|
||||
|
|
|
@ -11,7 +11,7 @@ typedef void (*BgHakaSgamiActionFunc)(struct BgHakaSgami*, PlayState*);
|
|||
typedef struct BgHakaSgami {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ BgHakaSgamiActionFunc actionFunc;
|
||||
/* 0x0150 */ s8 requiredObjBankIndex;
|
||||
/* 0x0150 */ s8 requiredObjectSlot;
|
||||
/* 0x0151 */ s8 unk_151;
|
||||
/* 0x0152 */ s16 timer;
|
||||
/* 0x0154 */ s32 blureEffectIndex[2];
|
||||
|
|
|
@ -102,11 +102,11 @@ void BgHakaZou_Init(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
}
|
||||
|
||||
this->requiredObjBankIndex = (thisx->params == STA_BOMBABLE_RUBBLE)
|
||||
? Object_GetIndex(&play->objectCtx, OBJECT_HAKACH_OBJECTS)
|
||||
: Object_GetIndex(&play->objectCtx, OBJECT_HAKA_OBJECTS);
|
||||
this->requiredObjectSlot = (thisx->params == STA_BOMBABLE_RUBBLE)
|
||||
? Object_GetSlot(&play->objectCtx, OBJECT_HAKACH_OBJECTS)
|
||||
: Object_GetSlot(&play->objectCtx, OBJECT_HAKA_OBJECTS);
|
||||
|
||||
if (this->requiredObjBankIndex < 0) {
|
||||
if (this->requiredObjectSlot < 0) {
|
||||
Actor_Kill(thisx);
|
||||
} else if ((thisx->params != STA_UNKNOWN) && Flags_GetSwitch(play, this->switchFlag)) {
|
||||
if (thisx->params != STA_GIANT_BIRD_STATUE) {
|
||||
|
@ -158,8 +158,8 @@ void func_808828F4(BgHakaZou* this, PlayState* play) {
|
|||
void BgHakaZou_Wait(BgHakaZou* this, PlayState* play) {
|
||||
CollisionHeader* colHeader;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjBankIndex)) {
|
||||
this->dyna.actor.objBankIndex = this->requiredObjBankIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
this->dyna.actor.objectSlot = this->requiredObjectSlot;
|
||||
this->dyna.actor.draw = BgHakaZou_Draw;
|
||||
|
||||
if (this->dyna.actor.params == STA_UNKNOWN) {
|
||||
|
|
|
@ -11,7 +11,7 @@ typedef void (*BgHakaZouActionFunc)(struct BgHakaZou*, PlayState*);
|
|||
typedef struct BgHakaZou {
|
||||
/* 0x0000 */ DynaPolyActor dyna;
|
||||
/* 0x0164 */ BgHakaZouActionFunc actionFunc;
|
||||
/* 0x0168 */ s8 requiredObjBankIndex;
|
||||
/* 0x0168 */ s8 requiredObjectSlot;
|
||||
/* 0x0169 */ u8 switchFlag;
|
||||
/* 0x016A */ s16 timer;
|
||||
/* 0x016C */ ColliderCylinder collider;
|
||||
|
|
|
@ -117,8 +117,8 @@ void BgJyaBigmirror_SetBombiwaFlag(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
void BgJyaBigmirror_HandleMirRay(Actor* thisx, PlayState* play) {
|
||||
static s16 sMirRayParamss[] = { 0x0005, 0x0007, 0x0008 };
|
||||
static Vec3f sMirRayPoss[] = {
|
||||
static s16 sMirRayParamsVals[] = { 0x0005, 0x0007, 0x0008 };
|
||||
static Vec3f sMirRayPositions[] = {
|
||||
{ 60.0f, 1802.0f, -1102.0f },
|
||||
{ -560.0f, 1800.0f, -310.0f },
|
||||
{ 60.0f, 1800.0f, -310.0f },
|
||||
|
@ -127,11 +127,11 @@ void BgJyaBigmirror_HandleMirRay(Actor* thisx, PlayState* play) {
|
|||
s32 puzzleSolved;
|
||||
s32 lightBeamToggles[3];
|
||||
s32 i;
|
||||
s32 objBankIndex;
|
||||
s32 mirRayObjectSlot;
|
||||
|
||||
objBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_MIR_RAY);
|
||||
mirRayObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MIR_RAY);
|
||||
|
||||
if ((objBankIndex < 0) || (objBankIndex != this->mirRayObjIndex)) {
|
||||
if ((mirRayObjectSlot < 0) || (mirRayObjectSlot != this->mirRayObjectSlot)) {
|
||||
this->lightBeams[2] = NULL;
|
||||
this->lightBeams[1] = NULL;
|
||||
this->lightBeams[0] = NULL;
|
||||
|
@ -152,9 +152,11 @@ void BgJyaBigmirror_HandleMirRay(Actor* thisx, PlayState* play) {
|
|||
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (lightBeamToggles[i]) {
|
||||
if ((this->lightBeams[i] == NULL) && Object_IsLoaded(&play->objectCtx, objBankIndex)) {
|
||||
this->lightBeams[i] = Actor_Spawn(&play->actorCtx, play, ACTOR_MIR_RAY, sMirRayPoss[i].x,
|
||||
sMirRayPoss[i].y, sMirRayPoss[i].z, 0, 0, 0, sMirRayParamss[i]);
|
||||
if ((this->lightBeams[i] == NULL) && Object_IsLoaded(&play->objectCtx, mirRayObjectSlot)) {
|
||||
|
||||
this->lightBeams[i] =
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_MIR_RAY, sMirRayPositions[i].x, sMirRayPositions[i].y,
|
||||
sMirRayPositions[i].z, 0, 0, 0, sMirRayParamsVals[i]);
|
||||
|
||||
if (this->lightBeams[i] == NULL) {
|
||||
// "Mir Ray generation failed"
|
||||
|
@ -169,7 +171,7 @@ void BgJyaBigmirror_HandleMirRay(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
}
|
||||
}
|
||||
this->mirRayObjIndex = objBankIndex;
|
||||
this->mirRayObjectSlot = mirRayObjectSlot;
|
||||
}
|
||||
|
||||
void BgJyaBigmirror_Init(Actor* thisx, PlayState* play) {
|
||||
|
@ -186,7 +188,7 @@ void BgJyaBigmirror_Init(Actor* thisx, PlayState* play) {
|
|||
this->actor.room = -1;
|
||||
sIsSpawned = true;
|
||||
this->spawned = true;
|
||||
this->mirRayObjIndex = -1;
|
||||
this->mirRayObjectSlot = -1;
|
||||
|
||||
// "jya Bigmirror"
|
||||
osSyncPrintf("(jya 大鏡)(arg_data 0x%04x)\n", this->actor.params);
|
||||
|
|
|
@ -25,7 +25,7 @@ typedef struct BgJyaBigmirror {
|
|||
/* 0x015C */ u8 puzzleFlags;
|
||||
/* 0x015D */ u8 spawned;
|
||||
/* 0x0160 */ Actor* lightBeams[3];
|
||||
/* 0x016C */ s32 mirRayObjIndex;
|
||||
/* 0x016C */ s32 mirRayObjectSlot;
|
||||
/* 0x0170 */ f32 liftHeight;
|
||||
} BgJyaBigmirror; // size = 0x0174
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ static InitChainEntry sInitChain[] = {
|
|||
ICHAIN_F32(uncullZoneDownward, 400, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
static s16 sObjectIDs[] = { OBJECT_MJIN_FLASH, OBJECT_MJIN_DARK, OBJECT_MJIN_FLAME,
|
||||
static s16 sObjectIds[] = { OBJECT_MJIN_FLASH, OBJECT_MJIN_DARK, OBJECT_MJIN_FLAME,
|
||||
OBJECT_MJIN_ICE, OBJECT_MJIN_SOUL, OBJECT_MJIN_WIND };
|
||||
|
||||
void BgMjin_SetupAction(BgMjin* this, BgMjinActionFunc actionFunc) {
|
||||
|
@ -54,12 +54,12 @@ void BgMjin_SetupAction(BgMjin* this, BgMjinActionFunc actionFunc) {
|
|||
|
||||
void BgMjin_Init(Actor* thisx, PlayState* play) {
|
||||
BgMjin* this = (BgMjin*)thisx;
|
||||
s8 objBankIndex;
|
||||
s8 objectSlot;
|
||||
|
||||
Actor_ProcessInitChain(thisx, sInitChain);
|
||||
objBankIndex = Object_GetIndex(&play->objectCtx, (thisx->params != 0 ? OBJECT_MJIN : OBJECT_MJIN_OKA));
|
||||
this->objBankIndex = objBankIndex;
|
||||
if (objBankIndex < 0) {
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, (thisx->params != 0 ? OBJECT_MJIN : OBJECT_MJIN_OKA));
|
||||
this->requiredObjectSlot = objectSlot;
|
||||
if (objectSlot < 0) {
|
||||
Actor_Kill(thisx);
|
||||
} else {
|
||||
BgMjin_SetupAction(this, func_808A0850);
|
||||
|
@ -76,10 +76,10 @@ void func_808A0850(BgMjin* this, PlayState* play) {
|
|||
CollisionHeader* colHeader;
|
||||
CollisionHeader* collision;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objBankIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
colHeader = NULL;
|
||||
this->dyna.actor.flags &= ~ACTOR_FLAG_4;
|
||||
this->dyna.actor.objBankIndex = this->objBankIndex;
|
||||
this->dyna.actor.objectSlot = this->requiredObjectSlot;
|
||||
Actor_SetObjectDependency(play, &this->dyna.actor);
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
collision = this->dyna.actor.params != 0 ? &gWarpPadCol : &gOcarinaWarpPadCol;
|
||||
|
@ -106,10 +106,10 @@ void BgMjin_Draw(Actor* thisx, PlayState* play) {
|
|||
OPEN_DISPS(play->state.gfxCtx, "../z_bg_mjin.c", 250);
|
||||
|
||||
if (thisx->params != 0) {
|
||||
s32 objBankIndex = Object_GetIndex(&play->objectCtx, sObjectIDs[thisx->params - 1]);
|
||||
s32 objectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[thisx->params - 1]);
|
||||
|
||||
if (objBankIndex >= 0) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objBankIndex].segment);
|
||||
if (objectSlot >= 0) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
|
||||
}
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(&D_06000000));
|
||||
|
|
|
@ -10,7 +10,7 @@ typedef void (*BgMjinActionFunc)(struct BgMjin*, PlayState*);
|
|||
|
||||
typedef struct BgMjin {
|
||||
/* 0x0000 */ DynaPolyActor dyna;
|
||||
/* 0x0164 */ s8 objBankIndex;
|
||||
/* 0x0164 */ s8 requiredObjectSlot;
|
||||
/* 0x0168 */ BgMjinActionFunc actionFunc;
|
||||
} BgMjin; // size = 0x016C
|
||||
|
||||
|
|
|
@ -77,8 +77,8 @@ void BgMoriBigst_Init(Actor* thisx, PlayState* play) {
|
|||
GET_PLAYER(play)->actor.world.pos.y);
|
||||
BgMoriBigst_InitDynapoly(this, play, &gMoriBigstCol, 0);
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
this->moriTexObjIndex = Object_GetIndex(&play->objectCtx, OBJECT_MORI_TEX);
|
||||
if (this->moriTexObjIndex < 0) {
|
||||
this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX);
|
||||
if (this->moriTexObjectSlot < 0) {
|
||||
// "【Big Stalfos key ceiling】 bank danger!"
|
||||
osSyncPrintf("【ビッグスタルフォス鍵型天井】 バンク危険!\n");
|
||||
osSyncPrintf("%s %d\n", "../z_bg_mori_bigst.c", 234);
|
||||
|
@ -108,7 +108,7 @@ void BgMoriBigst_SetupWaitForMoriTex(BgMoriBigst* this, PlayState* play) {
|
|||
void BgMoriBigst_WaitForMoriTex(BgMoriBigst* this, PlayState* play) {
|
||||
Actor* thisx = &this->dyna.actor;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->moriTexObjIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->moriTexObjectSlot)) {
|
||||
thisx->draw = BgMoriBigst_Draw;
|
||||
if (Flags_GetClear(play, thisx->room) && (GET_PLAYER(play)->actor.world.pos.y > 700.0f)) {
|
||||
if (Flags_GetSwitch(play, (thisx->params >> 8) & 0x3F)) {
|
||||
|
@ -248,7 +248,7 @@ void BgMoriBigst_Draw(Actor* thisx, PlayState* play) {
|
|||
OPEN_DISPS(play->state.gfxCtx, "../z_bg_mori_bigst.c", 541);
|
||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.status[this->moriTexObjIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.slots[this->moriTexObjectSlot].segment);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_bg_mori_bigst.c", 548),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
|
|
@ -12,7 +12,7 @@ typedef struct BgMoriBigst {
|
|||
/* 0x0000 */ DynaPolyActor dyna;
|
||||
/* 0x0164 */ BgMoriBigstActionFunc actionFunc;
|
||||
/* 0x0168 */ s16 waitTimer;
|
||||
/* 0x016A */ s8 moriTexObjIndex;
|
||||
/* 0x016A */ s8 moriTexObjectSlot;
|
||||
} BgMoriBigst; // size = 0x016C
|
||||
|
||||
#endif
|
||||
|
|
|
@ -87,8 +87,8 @@ void BgMoriElevator_Init(Actor* thisx, PlayState* play) {
|
|||
CollisionHeader* colHeader = NULL;
|
||||
|
||||
this->unk_172 = sIsSpawned;
|
||||
this->moriTexObjIndex = Object_GetIndex(&play->objectCtx, OBJECT_MORI_TEX);
|
||||
if (this->moriTexObjIndex < 0) {
|
||||
this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX);
|
||||
if (this->moriTexObjectSlot < 0) {
|
||||
Actor_Kill(thisx);
|
||||
// "Forest Temple obj elevator Bank Danger!"
|
||||
osSyncPrintf("Error : 森の神殿 obj elevator バンク危険!(%s %d)\n", "../z_bg_mori_elevator.c", 277);
|
||||
|
@ -134,7 +134,7 @@ void BgMoriElevator_SetupWaitAfterInit(BgMoriElevator* this) {
|
|||
}
|
||||
|
||||
void BgMoriElevator_WaitAfterInit(BgMoriElevator* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->moriTexObjIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->moriTexObjectSlot)) {
|
||||
if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) {
|
||||
if (play->roomCtx.curRoom.num == 2) {
|
||||
this->dyna.actor.world.pos.y = 73.0f;
|
||||
|
@ -255,7 +255,7 @@ void BgMoriElevator_Draw(Actor* thisx, PlayState* play) {
|
|||
OPEN_DISPS(play->state.gfxCtx, "../z_bg_mori_elevator.c", 575);
|
||||
|
||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.status[this->moriTexObjIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.slots[this->moriTexObjectSlot].segment);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_bg_mori_elevator.c", 580),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gMoriElevatorDL);
|
||||
|
|
|
@ -14,7 +14,7 @@ typedef struct BgMoriElevator {
|
|||
/* 0x0168 */ f32 targetY;
|
||||
/* 0x016C */ s32 unk_16C;
|
||||
/* 0x0170 */ u8 unk_170;
|
||||
/* 0x0171 */ s8 moriTexObjIndex;
|
||||
/* 0x0171 */ s8 moriTexObjectSlot;
|
||||
/* 0x0172 */ s16 unk_172;
|
||||
} BgMoriElevator; // size = 0x0174
|
||||
|
||||
|
|
|
@ -164,8 +164,8 @@ void BgMoriHashigo_Init(Actor* thisx, PlayState* play) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
this->moriTexObjIndex = Object_GetIndex(&play->objectCtx, OBJECT_MORI_TEX);
|
||||
if (this->moriTexObjIndex < 0) {
|
||||
this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX);
|
||||
if (this->moriTexObjectSlot < 0) {
|
||||
// "Bank danger!"
|
||||
osSyncPrintf("Error : バンク危険!(arg_data 0x%04x)(%s %d)\n", this->dyna.actor.params,
|
||||
"../z_bg_mori_hashigo.c", 312);
|
||||
|
@ -194,7 +194,7 @@ void BgMoriHashigo_SetupWaitForMoriTex(BgMoriHashigo* this) {
|
|||
}
|
||||
|
||||
void BgMoriHashigo_WaitForMoriTex(BgMoriHashigo* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->moriTexObjIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->moriTexObjectSlot)) {
|
||||
if (this->dyna.actor.params == HASHIGO_CLASP) {
|
||||
BgMoriHashigo_SetupClasp(this);
|
||||
} else if (this->dyna.actor.params == HASHIGO_LADDER) {
|
||||
|
@ -285,7 +285,7 @@ void BgMoriHashigo_Draw(Actor* thisx, PlayState* play) {
|
|||
OPEN_DISPS(play->state.gfxCtx, "../z_bg_mori_hashigo.c", 516);
|
||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||
if (1) {}
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.status[this->moriTexObjIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.slots[this->moriTexObjectSlot].segment);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_bg_mori_hashigo.c", 521),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
|
|
@ -15,7 +15,7 @@ typedef struct BgMoriHashigo {
|
|||
/* 0x01C4 */ BgMoriHashigoActionFunc actionFunc;
|
||||
/* 0x01C8 */ s16 hitTimer;
|
||||
/* 0x01CA */ s16 bounceCounter;
|
||||
/* 0x01CC */ s8 moriTexObjIndex;
|
||||
/* 0x01CC */ s8 moriTexObjectSlot;
|
||||
} BgMoriHashigo; // size = 0x01D0
|
||||
|
||||
typedef enum {
|
||||
|
|
|
@ -78,8 +78,8 @@ void BgMoriHashira4_Init(Actor* thisx, PlayState* play) {
|
|||
BgMoriHashira4_InitDynaPoly(this, play, &gMoriHashira2Col, 0);
|
||||
}
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
this->moriTexObjIndex = Object_GetIndex(&play->objectCtx, OBJECT_MORI_TEX);
|
||||
if (this->moriTexObjIndex < 0) {
|
||||
this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX);
|
||||
if (this->moriTexObjectSlot < 0) {
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
// "Bank danger!"
|
||||
osSyncPrintf("Error : バンク危険!(arg_data 0x%04x)(%s %d)\n", this->dyna.actor.params,
|
||||
|
@ -109,7 +109,7 @@ void BgMoriHashira4_SetupWaitForMoriTex(BgMoriHashira4* this) {
|
|||
}
|
||||
|
||||
void BgMoriHashira4_WaitForMoriTex(BgMoriHashira4* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->moriTexObjIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->moriTexObjectSlot)) {
|
||||
this->gateTimer = 0;
|
||||
if (this->dyna.actor.params == 0) {
|
||||
BgMoriHashira4_SetupPillarsRotate(this);
|
||||
|
@ -163,7 +163,7 @@ void BgMoriHashira4_Draw(Actor* thisx, PlayState* play) {
|
|||
OPEN_DISPS(play->state.gfxCtx, "../z_bg_mori_hashira4.c", 339);
|
||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.status[this->moriTexObjIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.slots[this->moriTexObjectSlot].segment);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_bg_mori_hashira4.c", 344),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
|
|
@ -11,7 +11,7 @@ typedef void (*BgMoriHashira4ActionFunc)(struct BgMoriHashira4*, PlayState*);
|
|||
typedef struct BgMoriHashira4 {
|
||||
/* 0x0000 */ DynaPolyActor dyna;
|
||||
/* 0x0164 */ BgMoriHashira4ActionFunc actionFunc;
|
||||
/* 0x0168 */ s8 moriTexObjIndex;
|
||||
/* 0x0168 */ s8 moriTexObjectSlot;
|
||||
/* 0x0169 */ s8 switchFlag;
|
||||
/* 0x016A */ s16 gateTimer;
|
||||
} BgMoriHashira4; // size = 0x016C
|
||||
|
|
|
@ -54,7 +54,7 @@ static Gfx* sDLists[] = {
|
|||
|
||||
void BgMoriHineri_Init(Actor* thisx, PlayState* play) {
|
||||
BgMoriHineri* this = (BgMoriHineri*)thisx;
|
||||
s8 moriHineriObjIdx;
|
||||
s8 objectSlot;
|
||||
u32 switchFlagParam;
|
||||
s32 t6;
|
||||
|
||||
|
@ -78,26 +78,26 @@ void BgMoriHineri_Init(Actor* thisx, PlayState* play) {
|
|||
this->dyna.actor.params = 3;
|
||||
}
|
||||
}
|
||||
this->boxObjIdx = -1;
|
||||
this->boxObjectSlot = -1;
|
||||
if (this->dyna.actor.params == 0) {
|
||||
this->moriHineriObjIdx = Object_GetIndex(&play->objectCtx, OBJECT_MORI_HINERI1);
|
||||
this->moriHineriObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_HINERI1);
|
||||
if (t6 == 0) {
|
||||
this->boxObjIdx = Object_GetIndex(&play->objectCtx, OBJECT_BOX);
|
||||
this->boxObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_BOX);
|
||||
}
|
||||
} else {
|
||||
if (this->dyna.actor.params == 1) {
|
||||
moriHineriObjIdx = Object_GetIndex(&play->objectCtx, OBJECT_MORI_HINERI1A);
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_HINERI1A);
|
||||
} else {
|
||||
moriHineriObjIdx = (this->dyna.actor.params == 2) ? Object_GetIndex(&play->objectCtx, OBJECT_MORI_HINERI2)
|
||||
: Object_GetIndex(&play->objectCtx, OBJECT_MORI_HINERI2A);
|
||||
objectSlot = (this->dyna.actor.params == 2) ? Object_GetSlot(&play->objectCtx, OBJECT_MORI_HINERI2)
|
||||
: Object_GetSlot(&play->objectCtx, OBJECT_MORI_HINERI2A);
|
||||
}
|
||||
this->moriHineriObjIdx = moriHineriObjIdx;
|
||||
this->moriHineriObjectSlot = objectSlot;
|
||||
}
|
||||
this->moriTexObjIdx = Object_GetIndex(&play->objectCtx, OBJECT_MORI_TEX);
|
||||
this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX);
|
||||
if (t6 != 0) {
|
||||
this->dyna.actor.params += 4;
|
||||
}
|
||||
if ((this->moriHineriObjIdx < 0) || (this->moriTexObjIdx < 0)) {
|
||||
if ((this->moriHineriObjectSlot < 0) || (this->moriTexObjectSlot < 0)) {
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
} else {
|
||||
this->actionFunc = func_808A39FC;
|
||||
|
@ -112,22 +112,22 @@ void BgMoriHineri_Destroy(Actor* thisx, PlayState* play) {
|
|||
void func_808A39FC(BgMoriHineri* this, PlayState* play) {
|
||||
CollisionHeader* colHeader;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->moriHineriObjIdx) &&
|
||||
Object_IsLoaded(&play->objectCtx, this->moriTexObjIdx) &&
|
||||
((this->boxObjIdx < 0) || Object_IsLoaded(&play->objectCtx, this->boxObjIdx))) {
|
||||
this->dyna.actor.objBankIndex = this->moriHineriObjIdx;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->moriHineriObjectSlot) &&
|
||||
Object_IsLoaded(&play->objectCtx, this->moriTexObjectSlot) &&
|
||||
((this->boxObjectSlot < 0) || Object_IsLoaded(&play->objectCtx, this->boxObjectSlot))) {
|
||||
this->dyna.actor.objectSlot = this->moriHineriObjectSlot;
|
||||
if (this->dyna.actor.params >= 4) {
|
||||
this->dyna.actor.params -= 4;
|
||||
if (this->dyna.actor.params == 0) {
|
||||
this->moriHineriObjIdx = Object_GetIndex(&play->objectCtx, OBJECT_MORI_HINERI1A);
|
||||
this->moriHineriObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_HINERI1A);
|
||||
} else if (this->dyna.actor.params == 1) {
|
||||
this->moriHineriObjIdx = Object_GetIndex(&play->objectCtx, OBJECT_MORI_HINERI1);
|
||||
this->moriHineriObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_HINERI1);
|
||||
} else {
|
||||
this->moriHineriObjIdx = (this->dyna.actor.params == 2)
|
||||
? Object_GetIndex(&play->objectCtx, OBJECT_MORI_HINERI2A)
|
||||
: Object_GetIndex(&play->objectCtx, OBJECT_MORI_HINERI2);
|
||||
this->moriHineriObjectSlot = (this->dyna.actor.params == 2)
|
||||
? Object_GetSlot(&play->objectCtx, OBJECT_MORI_HINERI2A)
|
||||
: Object_GetSlot(&play->objectCtx, OBJECT_MORI_HINERI2);
|
||||
}
|
||||
if (this->moriHineriObjIdx < 0) {
|
||||
if (this->moriHineriObjectSlot < 0) {
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
} else {
|
||||
this->actionFunc = func_808A3D58;
|
||||
|
@ -194,13 +194,13 @@ void func_808A3D58(BgMoriHineri* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void func_808A3E54(BgMoriHineri* this, PlayState* play) {
|
||||
s8 objBankIndex;
|
||||
s8 objectSlot;
|
||||
|
||||
if (play->activeCamId == sSubCamId) {
|
||||
if (sSubCamId != SUB_CAM_ID_DONE) {
|
||||
objBankIndex = this->dyna.actor.objBankIndex;
|
||||
this->dyna.actor.objBankIndex = this->moriHineriObjIdx;
|
||||
this->moriHineriObjIdx = objBankIndex;
|
||||
objectSlot = this->dyna.actor.objectSlot;
|
||||
this->dyna.actor.objectSlot = this->moriHineriObjectSlot;
|
||||
this->moriHineriObjectSlot = objectSlot;
|
||||
this->dyna.actor.params ^= 1;
|
||||
sSubCamId = SUB_CAM_ID_DONE;
|
||||
Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR);
|
||||
|
@ -223,17 +223,17 @@ void BgMoriHineri_Update(Actor* thisx, PlayState* play) {
|
|||
|
||||
void BgMoriHineri_DrawHallAndRoom(Actor* thisx, PlayState* play) {
|
||||
BgMoriHineri* this = (BgMoriHineri*)thisx;
|
||||
s8 objIndex;
|
||||
s32 pad;
|
||||
MtxF mtx;
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_bg_mori_hineri.c", 611);
|
||||
|
||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.status[this->moriTexObjIdx].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.slots[this->moriTexObjectSlot].segment);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_bg_mori_hineri.c", 618),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDLists[this->dyna.actor.params]);
|
||||
if (this->boxObjIdx > 0) {
|
||||
if (this->boxObjectSlot > 0) {
|
||||
Matrix_Get(&mtx);
|
||||
}
|
||||
if ((this->actionFunc == func_808A3C8C) && (this->dyna.actor.shape.rot.z != 0)) {
|
||||
|
@ -249,9 +249,9 @@ void BgMoriHineri_DrawHallAndRoom(Actor* thisx, PlayState* play) {
|
|||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gDungeonDoorDL);
|
||||
}
|
||||
if ((this->boxObjIdx > 0) && ((this->boxObjIdx = Object_GetIndex(&play->objectCtx, OBJECT_BOX)) > 0) &&
|
||||
Object_IsLoaded(&play->objectCtx, this->boxObjIdx)) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->boxObjIdx].segment);
|
||||
if ((this->boxObjectSlot > 0) && ((this->boxObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_BOX)) > 0) &&
|
||||
Object_IsLoaded(&play->objectCtx, this->boxObjectSlot)) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->boxObjectSlot].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, &D_80116280[2]);
|
||||
Matrix_Put(&mtx);
|
||||
Matrix_Translate(147.0f, -245.0f, -453.0f, MTXMODE_APPLY);
|
||||
|
|
|
@ -11,9 +11,9 @@ typedef void (*BgMoriHineriActionFunc)(struct BgMoriHineri*, PlayState*);
|
|||
typedef struct BgMoriHineri {
|
||||
/* 0x0000 */ DynaPolyActor dyna;
|
||||
/* 0x0164 */ BgMoriHineriActionFunc actionFunc;
|
||||
/* 0x0168 */ s8 moriHineriObjIdx;
|
||||
/* 0x0169 */ s8 moriTexObjIdx;
|
||||
/* 0x016A */ s8 boxObjIdx;
|
||||
/* 0x0168 */ s8 moriHineriObjectSlot;
|
||||
/* 0x0169 */ s8 moriTexObjectSlot;
|
||||
/* 0x016A */ s8 boxObjectSlot;
|
||||
/* 0x016B */ s8 switchFlag;
|
||||
} BgMoriHineri; // size = 0x016C
|
||||
|
||||
|
|
|
@ -66,8 +66,8 @@ void BgMoriIdomizu_Init(Actor* thisx, PlayState* play) {
|
|||
this->actor.world.pos.y = 184.0f;
|
||||
BgMoriIdomizu_SetWaterLevel(play, 184);
|
||||
}
|
||||
this->moriTexObjIndex = Object_GetIndex(&play->objectCtx, OBJECT_MORI_TEX);
|
||||
if (this->moriTexObjIndex < 0) {
|
||||
this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX);
|
||||
if (this->moriTexObjectSlot < 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
// "Bank danger!"
|
||||
osSyncPrintf("Error : バンク危険!(arg_data 0x%04x)(%s %d)\n", this->actor.params, "../z_bg_mori_idomizu.c",
|
||||
|
@ -96,7 +96,7 @@ void BgMoriIdomizu_SetupWaitForMoriTex(BgMoriIdomizu* this) {
|
|||
}
|
||||
|
||||
void BgMoriIdomizu_WaitForMoriTex(BgMoriIdomizu* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->moriTexObjIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->moriTexObjectSlot)) {
|
||||
BgMoriIdomizu_SetupMain(this);
|
||||
this->actor.draw = BgMoriIdomizu_Draw;
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ void BgMoriIdomizu_Draw(Actor* thisx, PlayState* play) {
|
|||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_bg_mori_idomizu.c", 360),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, play->objectCtx.status[this->moriTexObjIndex].segment);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, play->objectCtx.slots[this->moriTexObjectSlot].segment);
|
||||
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, 128);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ typedef struct BgMoriIdomizu {
|
|||
/* 0x0154 */ s32 prevSwitchFlagSet;
|
||||
/* 0x0158 */ s16 isLoaded;
|
||||
/* 0x015A */ s16 drainTimer;
|
||||
/* 0x015C */ s8 moriTexObjIndex;
|
||||
/* 0x015C */ s8 moriTexObjectSlot;
|
||||
} BgMoriIdomizu; // size = 0x0160
|
||||
|
||||
#endif
|
||||
|
|
|
@ -56,8 +56,8 @@ void BgMoriKaitenkabe_Init(Actor* thisx, PlayState* play) {
|
|||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
CollisionHeader_GetVirtual(&gMoriKaitenkabeCol, &colHeader);
|
||||
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
|
||||
this->moriTexObjIndex = Object_GetIndex(&play->objectCtx, OBJECT_MORI_TEX);
|
||||
if (this->moriTexObjIndex < 0) {
|
||||
this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX);
|
||||
if (this->moriTexObjectSlot < 0) {
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
// "【Rotating wall】 Bank danger!"
|
||||
osSyncPrintf("【回転壁】 バンク危険!(%s %d)\n", "../z_bg_mori_kaitenkabe.c", 176);
|
||||
|
@ -74,7 +74,7 @@ void BgMoriKaitenkabe_Destroy(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
void BgMoriKaitenkabe_WaitForMoriTex(BgMoriKaitenkabe* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->moriTexObjIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->moriTexObjectSlot)) {
|
||||
BgMoriKaitenkabe_SetupWait(this);
|
||||
this->dyna.actor.draw = BgMoriKaitenkabe_Draw;
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ void BgMoriKaitenkabe_Draw(Actor* thisx, PlayState* play) {
|
|||
OPEN_DISPS(play->state.gfxCtx, "../z_bg_mori_kaitenkabe.c", 347);
|
||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.status[this->moriTexObjIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.slots[this->moriTexObjectSlot].segment);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_bg_mori_kaitenkabe.c", 352),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
|
|
@ -16,7 +16,7 @@ typedef struct BgMoriKaitenkabe {
|
|||
/* 0x0170 */ f32 rotSpeed;
|
||||
/* 0x0174 */ f32 rotYdeg;
|
||||
/* 0x0178 */ Vec3f lockedPlayerPos;
|
||||
/* 0x0184 */ s8 moriTexObjIndex;
|
||||
/* 0x0184 */ s8 moriTexObjectSlot;
|
||||
} BgMoriKaitenkabe; // size = 0x0188
|
||||
|
||||
#endif
|
||||
|
|
|
@ -64,8 +64,8 @@ void BgMoriRakkatenjo_Init(Actor* thisx, PlayState* play) {
|
|||
// "The set Angle has changed. Let's fix the program."
|
||||
osSyncPrintf("Warning : セット Angle が変更されています。プログラムを修正しましょう。\n");
|
||||
}
|
||||
this->moriTexObjIndex = Object_GetIndex(&play->objectCtx, OBJECT_MORI_TEX);
|
||||
if (this->moriTexObjIndex < 0) {
|
||||
this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX);
|
||||
if (this->moriTexObjectSlot < 0) {
|
||||
// "Forest Temple obj Falling Ceiling Bank Danger!"
|
||||
osSyncPrintf("Error : 森の神殿 obj 落下天井 バンク危険!(%s %d)\n", "../z_bg_mori_rakkatenjo.c", 205);
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
|
@ -102,7 +102,7 @@ void BgMoriRakkatenjo_SetupWaitForMoriTex(BgMoriRakkatenjo* this) {
|
|||
}
|
||||
|
||||
void BgMoriRakkatenjo_WaitForMoriTex(BgMoriRakkatenjo* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->moriTexObjIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->moriTexObjectSlot)) {
|
||||
BgMoriRakkatenjo_SetupWait(this);
|
||||
this->dyna.actor.draw = BgMoriRakkatenjo_Draw;
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ void BgMoriRakkatenjo_Draw(Actor* thisx, PlayState* play) {
|
|||
OPEN_DISPS(play->state.gfxCtx, "../z_bg_mori_rakkatenjo.c", 497);
|
||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.status[this->moriTexObjIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, play->objectCtx.slots[this->moriTexObjectSlot].segment);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_bg_mori_rakkatenjo.c", 502),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
|
|
@ -14,7 +14,7 @@ typedef struct BgMoriRakkatenjo {
|
|||
/* 0x0168 */ s32 timer;
|
||||
/* 0x016C */ s32 bounceCount;
|
||||
/* 0x0170 */ s32 fallCount;
|
||||
/* 0x0174 */ s8 moriTexObjIndex;
|
||||
/* 0x0174 */ s8 moriTexObjectSlot;
|
||||
} BgMoriRakkatenjo; // size = 0x0178
|
||||
|
||||
#endif
|
||||
|
|
|
@ -59,8 +59,8 @@ void BgSpot01Objects2_Init(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
if (this->objectId >= 0) {
|
||||
this->objBankIndex = Object_GetIndex(&play->objectCtx, this->objectId);
|
||||
if (this->objBankIndex < 0) {
|
||||
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, this->objectId);
|
||||
if (this->requiredObjectSlot < 0) {
|
||||
// "There was no bank setting."
|
||||
osSyncPrintf("-----------------------------バンク設定ありませんでした.");
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
|
@ -91,12 +91,12 @@ void func_808AC2BC(BgSpot01Objects2* this, PlayState* play) {
|
|||
s32 pad;
|
||||
Vec3f position;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objBankIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
// "---- Successful bank switching!!"
|
||||
osSyncPrintf("-----バンク切り換え成功!!\n");
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objBankIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->requiredObjectSlot].segment);
|
||||
|
||||
this->dyna.actor.objBankIndex = this->objBankIndex;
|
||||
this->dyna.actor.objectSlot = this->requiredObjectSlot;
|
||||
DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS);
|
||||
|
||||
switch (this->dyna.actor.params & 7) {
|
||||
|
|
|
@ -13,7 +13,7 @@ typedef struct BgSpot01Objects2 {
|
|||
/* 0x0164 */ BgSpot01Objects2ActionFunc actionFunc;
|
||||
/* 0x0168 */ char unk_168[0x10];
|
||||
/* 0x0178 */ s32 objectId;
|
||||
/* 0x017C */ s8 objBankIndex;
|
||||
/* 0x017C */ s8 requiredObjectSlot;
|
||||
} BgSpot01Objects2; // size = 0x0180
|
||||
|
||||
#endif
|
||||
|
|
|
@ -218,9 +218,9 @@ s32 func_808B4E58(BgSpot16Bombstone* this, PlayState* play) {
|
|||
actor->shape.rot.z = D_808B5DD8[actor->params][9];
|
||||
|
||||
this->dList = object_bombiwa_DL_0009E0;
|
||||
this->bombiwaBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_BOMBIWA);
|
||||
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_BOMBIWA);
|
||||
|
||||
if (this->bombiwaBankIndex < 0) {
|
||||
if (this->requiredObjectSlot < 0) {
|
||||
osSyncPrintf("Error : バンク危険!(arg_data 0x%04x)(%s %d)\n", actor->params, "../z_bg_spot16_bombstone.c",
|
||||
589);
|
||||
return false;
|
||||
|
@ -486,7 +486,7 @@ void func_808B5AF0(BgSpot16Bombstone* this) {
|
|||
}
|
||||
|
||||
void func_808B5B04(BgSpot16Bombstone* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->bombiwaBankIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
func_808B5B58(this);
|
||||
this->actor.draw = BgSpot16Bombstone_Draw;
|
||||
}
|
||||
|
@ -546,7 +546,7 @@ void BgSpot16Bombstone_Draw(Actor* thisx, PlayState* play) {
|
|||
gSPDisplayList(POLY_OPA_DISP++, this->dList);
|
||||
} else {
|
||||
// The boulder is debris
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->bombiwaBankIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->requiredObjectSlot].segment);
|
||||
gSPDisplayList(POLY_OPA_DISP++, this->dList);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ typedef struct BgSpot16Bombstone {
|
|||
/* 0x01C4 */ ColliderCylinder colliderCylinder;
|
||||
/* 0x0210 */ s16 unk_210;
|
||||
/* 0x0212 */ s16 unk_212;
|
||||
/* 0x0214 */ s8 bombiwaBankIndex;
|
||||
/* 0x0214 */ s8 requiredObjectSlot;
|
||||
} BgSpot16Bombstone; // size = 0x0218
|
||||
|
||||
#endif
|
||||
|
|
|
@ -321,8 +321,8 @@ void BossGanon_SetColliderPos(Vec3f* pos, ColliderCylinder* collider) {
|
|||
}
|
||||
|
||||
void BossGanon_SetAnimationObject(BossGanon* this, PlayState* play, s32 objectId) {
|
||||
this->animBankIndex = Object_GetIndex(&play->objectCtx, objectId);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->animBankIndex].segment);
|
||||
this->animObjectSlot = Object_GetSlot(&play->objectCtx, objectId);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
|
||||
}
|
||||
|
||||
static InitChainEntry sInitChain[] = {
|
||||
|
@ -474,18 +474,18 @@ void BossGanon_Destroy(Actor* thisx, PlayState* play) {
|
|||
|
||||
void BossGanon_SetupIntroCutscene(BossGanon* this, PlayState* play) {
|
||||
s32 pad;
|
||||
s32 animBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GANON_ANIME2);
|
||||
s32 animObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GANON_ANIME2);
|
||||
|
||||
if (animBankIndex < 0) {
|
||||
if (animObjectSlot < 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, animBankIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, animObjectSlot)) {
|
||||
this->actionFunc = BossGanon_IntroCutscene;
|
||||
this->unk_198 = 1;
|
||||
this->animBankIndex = animBankIndex;
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[animBankIndex].segment);
|
||||
this->animObjectSlot = animObjectSlot;
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[animObjectSlot].segment);
|
||||
Animation_MorphToLoop(&this->skelAnime, &gGanondorfPlayOrganAnim, 0.0f);
|
||||
} else {
|
||||
this->actionFunc = BossGanon_SetupIntroCutscene;
|
||||
|
@ -533,7 +533,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) {
|
|||
f32 cos;
|
||||
Camera* mainCam;
|
||||
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->animBankIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
|
||||
|
||||
sCape->backPush = -2.0f;
|
||||
sCape->backSwayMagnitude = 0.25f;
|
||||
|
@ -1079,8 +1079,8 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) {
|
|||
}
|
||||
|
||||
if (this->csTimer == 50) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(
|
||||
play->objectCtx.status[Object_GetIndex(&play->objectCtx, OBJECT_GANON)].segment);
|
||||
gSegments[6] =
|
||||
VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[Object_GetSlot(&play->objectCtx, OBJECT_GANON)].segment);
|
||||
|
||||
if (!GET_EVENTCHKINF(EVENTCHKINF_78)) {
|
||||
TitleCard_InitBossName(play, &play->actorCtx.titleCtx, SEGMENTED_TO_VIRTUAL(gGanondorfTitleCardTex),
|
||||
|
@ -1163,14 +1163,14 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) {
|
|||
|
||||
void BossGanon_SetupDeathCutscene(BossGanon* this, PlayState* play) {
|
||||
s32 pad;
|
||||
s32 animBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GANON_ANIME2);
|
||||
s32 animObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GANON_ANIME2);
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, animBankIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, animObjectSlot)) {
|
||||
this->actionFunc = BossGanon_DeathAndTowerCutscene;
|
||||
this->csTimer = this->csState = 0;
|
||||
this->unk_198 = 1;
|
||||
this->animBankIndex = animBankIndex;
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[animBankIndex].segment);
|
||||
this->animObjectSlot = animObjectSlot;
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[animObjectSlot].segment);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &gGanondorfDefeatedStartAnim, 0.0f);
|
||||
this->fwork[GDF_FWORK_1] = Animation_GetLastFrame(&gGanondorfDefeatedStartAnim);
|
||||
this->unk_508 = 0.0f;
|
||||
|
@ -1179,11 +1179,11 @@ void BossGanon_SetupDeathCutscene(BossGanon* this, PlayState* play) {
|
|||
|
||||
void BossGanon_SetupTowerCutscene(BossGanon* this, PlayState* play) {
|
||||
s32 pad;
|
||||
s32 animBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GANON_ANIME2);
|
||||
s32 animObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GANON_ANIME2);
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, animBankIndex)) {
|
||||
this->animBankIndex = animBankIndex;
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[animBankIndex].segment);
|
||||
if (Object_IsLoaded(&play->objectCtx, animObjectSlot)) {
|
||||
this->animObjectSlot = animObjectSlot;
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[animObjectSlot].segment);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &gGanondorfDefeatedStartAnim, 0.0f);
|
||||
this->fwork[GDF_FWORK_1] = Animation_GetLastFrame(&gGanondorfDefeatedStartAnim);
|
||||
this->actionFunc = BossGanon_DeathAndTowerCutscene;
|
||||
|
@ -1226,7 +1226,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) {
|
|||
Camera* mainCam;
|
||||
Vec3f sp64;
|
||||
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->animBankIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
|
||||
|
||||
this->csTimer++;
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
@ -2796,7 +2796,7 @@ void BossGanon_Update(Actor* thisx, PlayState* play2) {
|
|||
if ((this->actionFunc != BossGanon_IntroCutscene) && (this->actionFunc != BossGanon_DeathAndTowerCutscene)) {
|
||||
BossGanon_SetAnimationObject(this, play, OBJECT_GANON_ANIME1);
|
||||
} else {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->animBankIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
|
||||
}
|
||||
|
||||
if (this->windowShatterState != GDF_WINDOW_SHATTER_OFF) {
|
||||
|
|
|
@ -85,7 +85,7 @@ typedef enum {
|
|||
|
||||
typedef struct BossGanon {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ s32 animBankIndex;
|
||||
/* 0x014C */ s32 animObjectSlot;
|
||||
/* 0x0150 */ SkelAnime skelAnime;
|
||||
/* 0x0194 */ BossGanonActionFunc actionFunc;
|
||||
/* 0x0198 */ u8 unk_198;
|
||||
|
|
|
@ -78,15 +78,15 @@ void func_808FD080(s32 idx, ColliderJntSph* collider, Vec3f* arg2) {
|
|||
|
||||
void BossGanon2_SetObjectSegment(BossGanon2* this, PlayState* play, s32 objectId, u8 setRSPSegment) {
|
||||
s32 pad;
|
||||
s32 objectIdx = Object_GetIndex(&play->objectCtx, objectId);
|
||||
s32 objectSlot = Object_GetSlot(&play->objectCtx, objectId);
|
||||
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIdx].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
|
||||
|
||||
if (setRSPSegment) {
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_boss_ganon2.c", 790);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[objectIdx].segment);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.status[objectIdx].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[objectSlot].segment);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.slots[objectSlot].segment);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_boss_ganon2.c", 799);
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
|
|||
s16 pad;
|
||||
u8 sp8D;
|
||||
Player* player;
|
||||
s32 objectIdx;
|
||||
s32 objectSlot;
|
||||
s32 zero = 0;
|
||||
s32 pad2;
|
||||
|
||||
|
@ -193,8 +193,8 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) {
|
|||
|
||||
switch (this->unk_39C) {
|
||||
case 0:
|
||||
objectIdx = Object_GetIndex(&play->objectCtx, OBJECT_GANON_ANIME3);
|
||||
if (Object_IsLoaded(&play->objectCtx, objectIdx)) {
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GANON_ANIME3);
|
||||
if (Object_IsLoaded(&play->objectCtx, objectSlot)) {
|
||||
Cutscene_StartManual(play, &play->csCtx);
|
||||
func_8002DF54(play, &this->actor, PLAYER_CSMODE_8);
|
||||
this->subCamId = Play_CreateSubCamera(play);
|
||||
|
@ -1040,10 +1040,10 @@ void func_808FFCFC(BossGanon2* this, PlayState* play) {
|
|||
|
||||
void func_808FFDB0(BossGanon2* this, PlayState* play) {
|
||||
s32 sp28;
|
||||
s32 objectIdx = Object_GetIndex(&play->objectCtx, OBJECT_GANON2);
|
||||
s32 objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GANON2);
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, objectIdx)) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIdx].segment);
|
||||
if (Object_IsLoaded(&play->objectCtx, objectSlot)) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
|
||||
Animation_MorphToLoop(&this->skelAnime, &gGanonGuardIdleAnim, -10.0f);
|
||||
this->actionFunc = func_808FFEBC;
|
||||
|
||||
|
|
|
@ -2083,7 +2083,7 @@ void BossGoma_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* r
|
|||
sDeadLimbLifetime[limbIndex] + 100);
|
||||
if (babyGohma != NULL) {
|
||||
babyGohma->bossLimbDL = *dList;
|
||||
babyGohma->actor.objBankIndex = this->actor.objBankIndex;
|
||||
babyGohma->actor.objectSlot = this->actor.objectSlot;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ void Demo6K_Init(Actor* thisx, PlayState* play);
|
|||
void Demo6K_Destroy(Actor* thisx, PlayState* play);
|
||||
void Demo6K_Update(Actor* thisx, PlayState* play);
|
||||
|
||||
void func_80966DB0(Demo6K* this, PlayState* play);
|
||||
void Demo6K_WaitForObject(Demo6K* this, PlayState* play);
|
||||
void func_80966E04(Demo6K* this, PlayState* play);
|
||||
void func_80966E98(Demo6K* this, PlayState* play);
|
||||
void func_80966F84(Demo6K* this, PlayState* play);
|
||||
|
@ -69,26 +69,26 @@ void Demo6K_Init(Actor* thisx, PlayState* play) {
|
|||
Demo6K* this = (Demo6K*)thisx;
|
||||
s32 pad;
|
||||
s32 params = this->actor.params;
|
||||
s32 objBankIndex;
|
||||
s32 objectSlot;
|
||||
s32 i;
|
||||
|
||||
osSyncPrintf("no = %d\n", params);
|
||||
|
||||
if (sObjectIds[params] != OBJECT_GAMEPLAY_KEEP) {
|
||||
objBankIndex = Object_GetIndex(&play->objectCtx, sObjectIds[params]);
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[params]);
|
||||
} else {
|
||||
objBankIndex = 0;
|
||||
objectSlot = 0;
|
||||
}
|
||||
|
||||
osSyncPrintf("bank_ID = %d\n", objBankIndex);
|
||||
osSyncPrintf("bank_ID = %d\n", objectSlot);
|
||||
|
||||
if (objBankIndex < 0) {
|
||||
if (objectSlot < 0) {
|
||||
ASSERT(0, "0", "../z_demo_6k.c", 334);
|
||||
} else {
|
||||
this->objBankIndex = objBankIndex;
|
||||
this->requiredObjectSlot = objectSlot;
|
||||
}
|
||||
|
||||
Demo6K_SetupAction(this, func_80966DB0);
|
||||
Demo6K_SetupAction(this, Demo6K_WaitForObject);
|
||||
this->timer1 = 0;
|
||||
this->flags = 0;
|
||||
this->timer2 = 0;
|
||||
|
@ -197,9 +197,9 @@ void Demo6K_Destroy(Actor* thisx, PlayState* play) {
|
|||
LightContext_RemoveLight(play, &play->lightCtx, this->lightNode);
|
||||
}
|
||||
|
||||
void func_80966DB0(Demo6K* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objBankIndex)) {
|
||||
this->actor.objBankIndex = this->objBankIndex;
|
||||
void Demo6K_WaitForObject(Demo6K* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
this->actor.objectSlot = this->requiredObjectSlot;
|
||||
this->actor.draw = this->drawFunc;
|
||||
this->actionFunc = this->initActionFunc;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ typedef struct Demo6K {
|
|||
/* 0x028C */ u16 flags;
|
||||
/* 0x028E */ u16 timer1;
|
||||
/* 0x0290 */ u16 timer2;
|
||||
/* 0x0292 */ u8 objBankIndex;
|
||||
/* 0x0292 */ u8 requiredObjectSlot;
|
||||
/* 0x0293 */ u8 unk_293;
|
||||
} Demo6K; // size = 0x0294
|
||||
|
||||
|
|
|
@ -314,22 +314,22 @@ void DemoEc_DrawSkeletonCustomColor(DemoEc* this, PlayState* play, Gfx* arg2, Gf
|
|||
|
||||
void DemoEc_UseDrawObject(DemoEc* this, PlayState* play) {
|
||||
s32 pad[2];
|
||||
s32 drawObjBankIndex = this->drawObjBankIndex;
|
||||
s32 drawObjectSlot = this->drawObjectSlot;
|
||||
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
||||
|
||||
OPEN_DISPS(gfxCtx, "../z_demo_ec.c", 662);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[drawObjBankIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[drawObjBankIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[drawObjectSlot].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[drawObjectSlot].segment);
|
||||
if (!play) {}
|
||||
|
||||
CLOSE_DISPS(gfxCtx, "../z_demo_ec.c", 670);
|
||||
}
|
||||
|
||||
void DemoEc_UseAnimationObject(DemoEc* this, PlayState* play) {
|
||||
s32 animObjBankIndex = this->animObjBankIndex;
|
||||
s32 animObjectSlot = this->animObjectSlot;
|
||||
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[animObjBankIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[animObjectSlot].segment);
|
||||
}
|
||||
|
||||
CsCmdActorCue* DemoEc_GetCue(PlayState* play, s32 cueChannel) {
|
||||
|
@ -1261,26 +1261,27 @@ void DemoEc_InitCommon(DemoEc* this, PlayState* play) {
|
|||
s32 type;
|
||||
s16 pad2;
|
||||
s16 sp28;
|
||||
s32 primaryBankIndex;
|
||||
s32 secondaryBankIndex;
|
||||
s32 primaryObjectSlot;
|
||||
s32 secondaryObjectSlot;
|
||||
|
||||
type = this->actor.params;
|
||||
primary = sDrawObjects[type];
|
||||
sp28 = sAnimationObjects[type];
|
||||
primaryBankIndex = Object_GetIndex(&play->objectCtx, primary);
|
||||
secondaryBankIndex = Object_GetIndex(&play->objectCtx, sp28);
|
||||
primaryObjectSlot = Object_GetSlot(&play->objectCtx, primary);
|
||||
secondaryObjectSlot = Object_GetSlot(&play->objectCtx, sp28);
|
||||
|
||||
if ((secondaryBankIndex < 0) || (primaryBankIndex < 0)) {
|
||||
if ((secondaryObjectSlot < 0) || (primaryObjectSlot < 0)) {
|
||||
// "Demo_Ec_main_bank: Bank unreadable arg_data = %d!"
|
||||
osSyncPrintf(VT_FGCOL(RED) "Demo_Ec_main_bank:バンクを読めない arg_data = %d!\n" VT_RST, type);
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, primaryBankIndex) && Object_IsLoaded(&play->objectCtx, secondaryBankIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, primaryObjectSlot) &&
|
||||
Object_IsLoaded(&play->objectCtx, secondaryObjectSlot)) {
|
||||
|
||||
this->drawObjBankIndex = primaryBankIndex;
|
||||
this->animObjBankIndex = secondaryBankIndex;
|
||||
this->drawObjectSlot = primaryObjectSlot;
|
||||
this->animObjectSlot = secondaryObjectSlot;
|
||||
|
||||
DemoEc_InitNpc(this, play);
|
||||
}
|
||||
|
|
|
@ -18,8 +18,8 @@ typedef struct DemoEc {
|
|||
/* 0x0194 */ s32 updateMode;
|
||||
/* 0x0198 */ s32 drawConfig;
|
||||
/* 0x019C */ s32 cueId;
|
||||
/* 0x01A0 */ s32 drawObjBankIndex;
|
||||
/* 0x01A4 */ s32 animObjBankIndex;
|
||||
/* 0x01A0 */ s32 drawObjectSlot;
|
||||
/* 0x01A4 */ s32 animObjectSlot;
|
||||
} DemoEc; // size = 0x01A8
|
||||
|
||||
#endif
|
||||
|
|
|
@ -28,7 +28,7 @@ void DemoEffect_DrawLightEffect(Actor* thisx, PlayState* play);
|
|||
void DemoEffect_DrawTimeWarp(Actor* thisx, PlayState* play);
|
||||
void DemoEffect_DrawJewel(Actor* thisx, PlayState* play2);
|
||||
|
||||
void DemoEffect_Wait(DemoEffect* this, PlayState* play);
|
||||
void DemoEffect_WaitForObject(DemoEffect* this, PlayState* play);
|
||||
void DemoEffect_InitTimeWarp(DemoEffect* this, PlayState* play);
|
||||
void DemoEffect_InitTimeWarpTimeblock(DemoEffect* this, PlayState* play);
|
||||
void DemoEffect_InitCreationFireball(DemoEffect* this, PlayState* play);
|
||||
|
@ -166,7 +166,7 @@ void DemoEffect_Init(Actor* thisx, PlayState* play2) {
|
|||
DemoEffect* this = (DemoEffect*)thisx;
|
||||
s32 effectType;
|
||||
s32 lightEffect;
|
||||
s32 objectIndex;
|
||||
s32 objectSlot;
|
||||
DemoEffect* crystalLight;
|
||||
DemoEffect* lightRing;
|
||||
|
||||
|
@ -175,16 +175,16 @@ void DemoEffect_Init(Actor* thisx, PlayState* play2) {
|
|||
|
||||
osSyncPrintf(VT_FGCOL(CYAN) " no = %d\n" VT_RST, effectType);
|
||||
|
||||
objectIndex = sEffectTypeObjects[effectType] == OBJECT_GAMEPLAY_KEEP
|
||||
? 0
|
||||
: Object_GetIndex(&play->objectCtx, sEffectTypeObjects[effectType]);
|
||||
objectSlot = sEffectTypeObjects[effectType] == OBJECT_GAMEPLAY_KEEP
|
||||
? 0
|
||||
: Object_GetSlot(&play->objectCtx, sEffectTypeObjects[effectType]);
|
||||
|
||||
osSyncPrintf(VT_FGCOL(CYAN) " bank_ID = %d\n" VT_RST, objectIndex);
|
||||
osSyncPrintf(VT_FGCOL(CYAN) " bank_ID = %d\n" VT_RST, objectSlot);
|
||||
|
||||
if (objectIndex < 0) {
|
||||
if (objectSlot < 0) {
|
||||
ASSERT(0, "0", "../z_demo_effect.c", 723);
|
||||
} else {
|
||||
this->initObjectBankIndex = objectIndex;
|
||||
this->requiredObjectSlot = objectSlot;
|
||||
}
|
||||
|
||||
this->effectFlags = 0;
|
||||
|
@ -499,7 +499,7 @@ void DemoEffect_Init(Actor* thisx, PlayState* play2) {
|
|||
}
|
||||
|
||||
ActorShape_Init(&thisx->shape, 0.0f, NULL, 0.0f);
|
||||
DemoEffect_SetupUpdate(this, DemoEffect_Wait);
|
||||
DemoEffect_SetupUpdate(this, DemoEffect_WaitForObject);
|
||||
}
|
||||
|
||||
void DemoEffect_Destroy(Actor* thisx, PlayState* play) {
|
||||
|
@ -518,9 +518,9 @@ void DemoEffect_Destroy(Actor* thisx, PlayState* play) {
|
|||
* They are copied to actor.draw and updateFunc.
|
||||
* initUpdateFunc/initDrawFunc are set during initialization and are NOT executed.
|
||||
*/
|
||||
void DemoEffect_Wait(DemoEffect* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->initObjectBankIndex)) {
|
||||
this->actor.objBankIndex = this->initObjectBankIndex;
|
||||
void DemoEffect_WaitForObject(DemoEffect* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
this->actor.objectSlot = this->requiredObjectSlot;
|
||||
this->actor.draw = this->initDrawFunc;
|
||||
this->updateFunc = this->initUpdateFunc;
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ typedef struct {
|
|||
typedef struct DemoEffect {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ SkelCurve skelCurve;
|
||||
/* 0x016C */ u8 initObjectBankIndex;
|
||||
/* 0x016C */ u8 requiredObjectSlot;
|
||||
/* 0x0170 */ Gfx* jewelDisplayList;
|
||||
/* 0x0174 */ Gfx* jewelHolderDisplayList;
|
||||
/* 0x0178 */ u8 primXluColor[3];
|
||||
|
|
|
@ -23,7 +23,7 @@ void func_80978308(DemoGeff* this, PlayState* play);
|
|||
void func_809784D4(DemoGeff* this, PlayState* play);
|
||||
void func_80978344(DemoGeff* this, PlayState* play);
|
||||
|
||||
static s16 sObjectIDs[] = {
|
||||
static s16 sObjectIds[] = {
|
||||
OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF,
|
||||
};
|
||||
|
||||
|
@ -86,13 +86,13 @@ void func_80977EA8(PlayState* play, Gfx* dlist) {
|
|||
|
||||
void func_80977F80(DemoGeff* this, PlayState* play) {
|
||||
s32 pad[2];
|
||||
s32 objBankIndex = this->objBankIndex;
|
||||
s32 objectSlot = this->objectSlot;
|
||||
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
||||
|
||||
OPEN_DISPS(gfxCtx, "../z_demo_geff.c", 204);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[objBankIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objBankIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[objectSlot].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
|
||||
|
||||
// Necessary to match
|
||||
if (!play) {}
|
||||
|
@ -188,17 +188,17 @@ void func_809783D4(DemoGeff* this, PlayState* play) {
|
|||
ObjectContext* objCtx = &play->objectCtx;
|
||||
Actor* thisx = &this->actor;
|
||||
s32 params = thisx->params;
|
||||
s16 objectId = sObjectIDs[params];
|
||||
s32 objBankIndex = Object_GetIndex(objCtx, objectId);
|
||||
s16 objectId = sObjectIds[params];
|
||||
s32 objectSlot = Object_GetSlot(objCtx, objectId);
|
||||
s32 pad;
|
||||
|
||||
if (objBankIndex < 0) {
|
||||
if (objectSlot < 0) {
|
||||
osSyncPrintf(VT_FGCOL(RED) "Demo_Geff_main_bank:バンクを読めない arg_data = %d!\n" VT_RST, params);
|
||||
Actor_Kill(thisx);
|
||||
return;
|
||||
}
|
||||
if (Object_IsLoaded(objCtx, objBankIndex)) {
|
||||
this->objBankIndex = objBankIndex;
|
||||
if (Object_IsLoaded(objCtx, objectSlot)) {
|
||||
this->objectSlot = objectSlot;
|
||||
func_80978370(this, play);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ typedef struct DemoGeff {
|
|||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ s32 action;
|
||||
/* 0x0150 */ s32 drawConfig;
|
||||
/* 0x0154 */ s32 objBankIndex;
|
||||
/* 0x0154 */ s32 objectSlot;
|
||||
/* 0x0158 */ DemoGt* demoGt;
|
||||
/* 0x015C */ f32 deltaPosX;
|
||||
/* 0x0160 */ f32 deltaPosY;
|
||||
|
|
|
@ -52,7 +52,7 @@ ActorInit Demo_Kankyo_InitVars = {
|
|||
(ActorFunc)DemoKankyo_Draw,
|
||||
};
|
||||
|
||||
static s16 sObjIds[] = {
|
||||
static s16 sObjectIds[] = {
|
||||
OBJECT_EFC_STAR_FIELD, OBJECT_EFC_STAR_FIELD, OBJECT_EFC_STAR_FIELD, OBJECT_EFC_STAR_FIELD, OBJECT_EFC_STAR_FIELD,
|
||||
OBJECT_EFC_STAR_FIELD, OBJECT_EFC_STAR_FIELD, OBJECT_GAMEPLAY_KEEP, OBJECT_GI_MELODY, OBJECT_GI_MELODY,
|
||||
OBJECT_GI_MELODY, OBJECT_GI_MELODY, OBJECT_GI_MELODY, OBJECT_TOKI_OBJECTS, OBJECT_TOKI_OBJECTS,
|
||||
|
@ -181,13 +181,13 @@ void DemoKankyo_SetupAction(DemoKankyo* this, DemoKankyoActionFunc actionFunc) {
|
|||
void DemoKankyo_Init(Actor* thisx, PlayState* play) {
|
||||
DemoKankyo* this = (DemoKankyo*)thisx;
|
||||
s16 i;
|
||||
s32 objBankIndex = Object_GetIndex(&play->objectCtx, sObjIds[this->actor.params]);
|
||||
s32 objectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[this->actor.params]);
|
||||
|
||||
osSyncPrintf("bank_ID = %d\n", objBankIndex);
|
||||
if (objBankIndex < 0) {
|
||||
osSyncPrintf("bank_ID = %d\n", objectSlot);
|
||||
if (objectSlot < 0) {
|
||||
ASSERT(0, "0", "../z_demo_kankyo.c", 521);
|
||||
} else {
|
||||
this->objBankIndex = objBankIndex;
|
||||
this->requiredObjectSlot = objectSlot;
|
||||
}
|
||||
|
||||
switch (this->actor.params) {
|
||||
|
@ -279,7 +279,7 @@ void DemoKankyo_SetupType(DemoKankyo* this, PlayState* play) {
|
|||
Player* player = GET_PLAYER(play);
|
||||
f32 temp;
|
||||
|
||||
if (this->actor.objBankIndex == this->objBankIndex) {
|
||||
if (this->actor.objectSlot == this->requiredObjectSlot) {
|
||||
switch (this->actor.params) {
|
||||
case DEMOKANKYO_ROCK_1:
|
||||
case DEMOKANKYO_ROCK_2:
|
||||
|
@ -432,7 +432,7 @@ void DemoKankyo_Update(Actor* thisx, PlayState* play) {
|
|||
void DemoKankyo_Draw(Actor* thisx, PlayState* play) {
|
||||
DemoKankyo* this = (DemoKankyo*)thisx;
|
||||
|
||||
if (this->actor.objBankIndex == this->objBankIndex) {
|
||||
if (this->actor.objectSlot == this->requiredObjectSlot) {
|
||||
switch (this->actor.params) {
|
||||
case DEMOKANKYO_BLUE_RAIN:
|
||||
case DEMOKANKYO_BLUE_RAIN_2:
|
||||
|
@ -480,8 +480,8 @@ void DemoKankyo_Draw(Actor* thisx, PlayState* play) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objBankIndex)) {
|
||||
this->actor.objBankIndex = this->objBankIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
this->actor.objectSlot = this->requiredObjectSlot;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ typedef struct {
|
|||
|
||||
typedef struct DemoKankyo {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ u8 objBankIndex;
|
||||
/* 0x014C */ u8 requiredObjectSlot;
|
||||
/* 0x014D */ u8 sparkleCounter;
|
||||
/* 0x014E */ u8 warpTimer;
|
||||
/* 0x0150 */ DemoKankyoUnk150 unk_150[30];
|
||||
|
|
|
@ -25,7 +25,7 @@ void DoorKiller_Init(Actor* thisx, PlayState* play2);
|
|||
void DoorKiller_Destroy(Actor* thisx, PlayState* play);
|
||||
void DoorKiller_Update(Actor* thisx, PlayState* play);
|
||||
void DoorKiller_Wait(DoorKiller* this, PlayState* play);
|
||||
void DoorKiller_SetProperties(DoorKiller* this, PlayState* play);
|
||||
void DoorKiller_WaitForObject(DoorKiller* this, PlayState* play);
|
||||
void DoorKiller_DrawDoor(Actor* thisx, PlayState* play);
|
||||
void DoorKiller_DrawRubble(Actor* thisx, PlayState* play);
|
||||
|
||||
|
@ -99,18 +99,19 @@ void DoorKiller_Init(Actor* thisx, PlayState* play2) {
|
|||
PlayState* play = play2;
|
||||
f32 randF;
|
||||
DoorKiller* this = (DoorKiller*)thisx;
|
||||
s32 bankIndex;
|
||||
s32 objectSlot;
|
||||
s32 i;
|
||||
|
||||
// Look in the object bank for one of the four objects containing door textures
|
||||
bankIndex = -1;
|
||||
for (i = 0; bankIndex < 0; i++) {
|
||||
bankIndex = Object_GetIndex(&play->objectCtx, sDoorTextures[i].objectId);
|
||||
objectSlot = -1;
|
||||
//! @bug If no objectSlot is found, `sDoorTextures` will be read out of bounds
|
||||
for (i = 0; objectSlot < 0; i++) {
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, sDoorTextures[i].objectId);
|
||||
this->textureEntryIndex = i;
|
||||
}
|
||||
osSyncPrintf("bank_ID = %d\n", bankIndex);
|
||||
osSyncPrintf("bank_ID = %d\n", objectSlot);
|
||||
osSyncPrintf("status = %d\n", this->textureEntryIndex);
|
||||
this->doorObjBankIndex = bankIndex;
|
||||
this->requiredObjectSlot = objectSlot;
|
||||
this->texture = sDoorTextures[this->textureEntryIndex].texture;
|
||||
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f);
|
||||
|
@ -126,8 +127,8 @@ void DoorKiller_Init(Actor* thisx, PlayState* play2) {
|
|||
// play any animations it does not cause problems, but it would need to be changed otherwise.
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &object_door_killer_Skel_001BC8, NULL, this->jointTable,
|
||||
this->jointTable, 9);
|
||||
this->actionFunc = DoorKiller_SetProperties;
|
||||
DoorKiller_SetProperties(this, play);
|
||||
this->actionFunc = DoorKiller_WaitForObject;
|
||||
DoorKiller_WaitForObject(this, play);
|
||||
|
||||
// manually set the overall rotation of the door
|
||||
this->jointTable[1].x = this->jointTable[1].z = 0x4000;
|
||||
|
@ -152,8 +153,8 @@ void DoorKiller_Init(Actor* thisx, PlayState* play2) {
|
|||
case DOOR_KILLER_RUBBLE_PIECE_2:
|
||||
case DOOR_KILLER_RUBBLE_PIECE_3:
|
||||
case DOOR_KILLER_RUBBLE_PIECE_4:
|
||||
this->actionFunc = DoorKiller_SetProperties;
|
||||
DoorKiller_SetProperties(this, play);
|
||||
this->actionFunc = DoorKiller_WaitForObject;
|
||||
DoorKiller_WaitForObject(this, play);
|
||||
|
||||
this->actor.gravity = -0.6f;
|
||||
this->actor.minVelocityY = -6.0f;
|
||||
|
@ -459,17 +460,17 @@ void DoorKiller_Wait(DoorKiller* this, PlayState* play) {
|
|||
void DoorKiller_UpdateTexture(Actor* thisx, PlayState* play) {
|
||||
DoorKiller* this = (DoorKiller*)thisx;
|
||||
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->doorObjBankIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->requiredObjectSlot].segment);
|
||||
this->texture = SEGMENTED_TO_VIRTUAL(this->texture);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[thisx->objBankIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->actor.objectSlot].segment);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the correct door texture, defines the appropriate draw fucntion and action function based on type behaviour
|
||||
* (door or rubble).
|
||||
*/
|
||||
void DoorKiller_SetProperties(DoorKiller* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->doorObjBankIndex)) {
|
||||
void DoorKiller_WaitForObject(DoorKiller* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
DoorKiller_UpdateTexture(&this->actor, play);
|
||||
switch (this->actor.params & 0xFF) {
|
||||
case DOOR_KILLER_DOOR:
|
||||
|
|
|
@ -25,7 +25,7 @@ typedef struct DoorKiller {
|
|||
/* 0x0214 */ void* texture;
|
||||
/* 0x0218 */ u16 hasHitPlayerOrGround;
|
||||
/* 0x021A */ u16 timer;
|
||||
/* 0x021C */ u8 doorObjBankIndex;
|
||||
/* 0x021C */ u8 requiredObjectSlot;
|
||||
/* 0x021D */ u8 textureEntryIndex;
|
||||
/* 0x0220 */ ColliderJntSph colliderJntSph;
|
||||
/* 0x0240 */ ColliderJntSphElement colliderJntSphItems[1];
|
||||
|
|
|
@ -402,7 +402,7 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) {
|
|||
PlayState* play = play2;
|
||||
s32 styleType;
|
||||
s32 pad;
|
||||
s32 objectIndex;
|
||||
s32 objectSlot;
|
||||
s32 i;
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
|
@ -432,9 +432,8 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) {
|
|||
} else { // DOORSHUTTER_STYLE_PHANTOM_GANON, DOORSHUTTER_STYLE_GOHMA_BLOCK
|
||||
this->dyna.actor.room = -1;
|
||||
}
|
||||
|
||||
if (this->requiredObjBankIndex = objectIndex = Object_GetIndex(&play->objectCtx, sStyleInfo[styleType].objectId),
|
||||
(s8)objectIndex < 0) {
|
||||
if (this->requiredObjectSlot = objectSlot = Object_GetSlot(&play->objectCtx, sStyleInfo[styleType].objectId),
|
||||
(s8)objectSlot < 0) {
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
return;
|
||||
}
|
||||
|
@ -468,8 +467,8 @@ void DoorShutter_Destroy(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
void DoorShutter_WaitForObject(DoorShutter* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjBankIndex)) {
|
||||
this->dyna.actor.objBankIndex = this->requiredObjBankIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
this->dyna.actor.objectSlot = this->requiredObjectSlot;
|
||||
if (this->doorType == SHUTTER_PG_BARS || this->doorType == SHUTTER_GOHMA_BLOCK) {
|
||||
// Init dynapoly for shutters of the type that uses it
|
||||
CollisionHeader* colHeader = NULL;
|
||||
|
@ -977,7 +976,7 @@ void DoorShutter_Draw(Actor* thisx, PlayState* play) {
|
|||
DoorShutter* this = (DoorShutter*)thisx;
|
||||
|
||||
//! @bug This actor is not fully initialized until the required object dependency is loaded.
|
||||
//! In most cases, the check for objBankIndex to equal requiredObjBankIndex prevents the actor
|
||||
//! In most cases, the check for objectSlot to equal requiredObjectSlot prevents the actor
|
||||
//! from drawing until initialization is complete. However if the required object is the same as the
|
||||
//! object dependency listed in init vars (gameplay_keep in this case), the check will pass even though
|
||||
//! initialization has not completed. When this happens, it will try to draw the display list of the
|
||||
|
@ -988,7 +987,7 @@ void DoorShutter_Draw(Actor* thisx, PlayState* play) {
|
|||
//! The best way to fix this issue (and what was done in Majora's Mask) is to null out the draw function in
|
||||
//! the init vars for the actor, and only set draw after initialization is complete.
|
||||
|
||||
if (this->dyna.actor.objBankIndex == this->requiredObjBankIndex &&
|
||||
if (this->dyna.actor.objectSlot == this->requiredObjectSlot &&
|
||||
(this->styleType == DOORSHUTTER_STYLE_PHANTOM_GANON || DoorShutter_ShouldDraw(this, play))) {
|
||||
s32 pad[2];
|
||||
DoorShutterGfxInfo* gfxInfo = &sGfxInfo[this->gfxType];
|
||||
|
|
|
@ -48,7 +48,7 @@ typedef struct DoorShutter {
|
|||
/* 0x016A */ u8 doorType;
|
||||
/* 0x016B */ u8 styleType;
|
||||
/* 0x016C */ u8 gfxType;
|
||||
/* 0x016D */ s8 requiredObjBankIndex;
|
||||
/* 0x016D */ s8 requiredObjectSlot;
|
||||
/* 0x016E */ s8 unlockTimer; // non-0 if the door is locked, ticks down while the door is unlocking
|
||||
/* 0x016F */ s8 actionTimer;
|
||||
/* 0x0170 */ f32 barsClosedAmount; // Ranges from 0.0f (unbarred) to 1.0f (barred)
|
||||
|
|
|
@ -1267,7 +1267,7 @@ void EnBb_Update(Actor* thisx, PlayState* play2) {
|
|||
void EnBb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
|
||||
EnBb* this = (EnBb*)thisx;
|
||||
|
||||
BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 4, 15, 15, dList, BODYBREAK_OBJECT_DEFAULT);
|
||||
BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 4, 15, 15, dList, BODYBREAK_OBJECT_SLOT_DEFAULT);
|
||||
}
|
||||
|
||||
static Vec3f sFireIceOffsets[] = {
|
||||
|
|
|
@ -470,18 +470,18 @@ void EnCs_Draw(Actor* thisx, PlayState* play) {
|
|||
EnCs_OverrideLimbDraw, EnCs_PostLimbDraw, &this->actor);
|
||||
|
||||
if (GET_ITEMGETINF(ITEMGETINF_3A)) {
|
||||
s32 childLinkObjectIndex = Object_GetIndex(&play->objectCtx, OBJECT_LINK_CHILD);
|
||||
s32 linkChildObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_LINK_CHILD);
|
||||
|
||||
// Handle attaching the Spooky Mask to the boy's face
|
||||
if (childLinkObjectIndex >= 0) {
|
||||
if (linkChildObjectSlot >= 0) {
|
||||
Mtx* mtx;
|
||||
|
||||
Matrix_Put(&this->spookyMaskMtx);
|
||||
mtx = Matrix_NewMtx(play->state.gfxCtx, "../z_en_cs.c", 1000);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[childLinkObjectIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[linkChildObjectSlot].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0D, mtx - 7);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gLinkChildSpookyMaskDL);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->actor.objBankIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->actor.objectSlot].segment);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ void EnDntNomal_Init(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
this->actor.colChkInfo.mass = 0xFF;
|
||||
this->objId = -1;
|
||||
this->objectId = -1;
|
||||
if (this->type == ENDNTNOMAL_TARGET) {
|
||||
osSyncPrintf("\n\n");
|
||||
// "Deku Scrub target"
|
||||
|
@ -132,21 +132,21 @@ void EnDntNomal_Init(Actor* thisx, PlayState* play) {
|
|||
Collider_InitQuad(play, &this->targetQuad);
|
||||
Collider_SetQuad(play, &this->targetQuad, &this->actor, &sTargetQuadInit);
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
|
||||
this->objId = OBJECT_HINTNUTS;
|
||||
this->objectId = OBJECT_HINTNUTS;
|
||||
} else {
|
||||
osSyncPrintf("\n\n");
|
||||
// "Deku Scrub mask show audience"
|
||||
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ デグナッツお面品評会一般人 ☆☆☆☆☆ \n" VT_RST);
|
||||
Collider_InitCylinder(play, &this->bodyCyl);
|
||||
Collider_SetCylinder(play, &this->bodyCyl, &this->actor, &sBodyCylinderInit);
|
||||
this->objId = OBJECT_DNK;
|
||||
this->objectId = OBJECT_DNK;
|
||||
}
|
||||
if (this->objId >= 0) {
|
||||
this->objIndex = Object_GetIndex(&play->objectCtx, this->objId);
|
||||
if (this->objIndex < 0) {
|
||||
if (this->objectId >= 0) {
|
||||
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, this->objectId);
|
||||
if (this->requiredObjectSlot < 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
// "What?"
|
||||
osSyncPrintf(VT_FGCOL(MAGENTA) " なにみの? %d\n" VT_RST "\n", this->objIndex);
|
||||
osSyncPrintf(VT_FGCOL(MAGENTA) " なにみの? %d\n" VT_RST "\n", this->requiredObjectSlot);
|
||||
// "Bank is funny"
|
||||
osSyncPrintf(VT_FGCOL(CYAN) " バンクおかしいしぞ!%d\n" VT_RST "\n", this->actor.params);
|
||||
return;
|
||||
|
@ -169,9 +169,9 @@ void EnDntNomal_Destroy(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
void EnDntNomal_WaitForObject(EnDntNomal* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objIndex)) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objIndex].segment);
|
||||
this->actor.objBankIndex = this->objIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->requiredObjectSlot].segment);
|
||||
this->actor.objectSlot = this->requiredObjectSlot;
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f);
|
||||
this->actor.gravity = -2.0f;
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
|
|
|
@ -24,7 +24,7 @@ typedef struct EnDntNomal {
|
|||
/* 0x0260 */ s16 blinkTimer;
|
||||
/* 0x0262 */ s16 unkCounter;
|
||||
/* 0x0264 */ s16 timer3;
|
||||
/* 0x0266 */ s16 objId;
|
||||
/* 0x0266 */ s16 objectId;
|
||||
/* 0x0268 */ s16 eyeState;
|
||||
/* 0x026A */ s16 type;
|
||||
/* 0x026C */ s16 hitCounter;
|
||||
|
@ -35,7 +35,7 @@ typedef struct EnDntNomal {
|
|||
/* 0x0276 */ u8 ignore;
|
||||
/* 0x0277 */ u8 spawnedItem;
|
||||
/* 0x0278 */ u8 stagePrize;
|
||||
/* 0x0279 */ s8 objIndex;
|
||||
/* 0x0279 */ s8 requiredObjectSlot;
|
||||
/* 0x027C */ Vec3f mouthPos;
|
||||
/* 0x0288 */ Vec3f targetPos;
|
||||
/* 0x0294 */ ColliderQuad targetQuad;
|
||||
|
|
|
@ -111,7 +111,7 @@ void EnDoor_Init(Actor* thisx, PlayState* play2) {
|
|||
EnDoor* this = (EnDoor*)thisx;
|
||||
EnDoorInfo* objectInfo;
|
||||
s32 i;
|
||||
s32 objBankIndex;
|
||||
s32 objectSlot;
|
||||
f32 xOffset;
|
||||
f32 zOffset;
|
||||
|
||||
|
@ -124,20 +124,20 @@ void EnDoor_Init(Actor* thisx, PlayState* play2) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (i >= ARRAY_COUNT(sDoorInfo) - 2 && Object_GetIndex(&play->objectCtx, OBJECT_GAMEPLAY_FIELD_KEEP) >= 0) {
|
||||
if (i >= ARRAY_COUNT(sDoorInfo) - 2 && Object_GetSlot(&play->objectCtx, OBJECT_GAMEPLAY_FIELD_KEEP) >= 0) {
|
||||
objectInfo++;
|
||||
}
|
||||
|
||||
this->dListIndex = objectInfo->dListIndex;
|
||||
objBankIndex = Object_GetIndex(&play->objectCtx, objectInfo->objectId);
|
||||
if (objBankIndex < 0) {
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, objectInfo->objectId);
|
||||
if (objectSlot < 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
||||
this->requiredObjBankIndex = objBankIndex;
|
||||
this->requiredObjectSlot = objectSlot;
|
||||
this->dListIndex = objectInfo->dListIndex;
|
||||
if (this->actor.objBankIndex == this->requiredObjBankIndex) {
|
||||
if (this->actor.objectSlot == this->requiredObjectSlot) {
|
||||
EnDoor_SetupType(this, play);
|
||||
} else {
|
||||
this->actionFunc = EnDoor_SetupType;
|
||||
|
@ -175,10 +175,10 @@ void EnDoor_Destroy(Actor* thisx, PlayState* play) {
|
|||
void EnDoor_SetupType(EnDoor* this, PlayState* play) {
|
||||
s32 doorType;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjBankIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
doorType = ENDOOR_GET_TYPE(&this->actor);
|
||||
this->actor.flags &= ~ACTOR_FLAG_4;
|
||||
this->actor.objBankIndex = this->requiredObjBankIndex;
|
||||
this->actor.objectSlot = this->requiredObjectSlot;
|
||||
this->actionFunc = EnDoor_Idle;
|
||||
if (doorType == DOOR_EVENING) {
|
||||
doorType = (gSaveContext.save.dayTime > CLOCK_TIME(18, 0) && gSaveContext.save.dayTime < CLOCK_TIME(21, 0))
|
||||
|
@ -360,7 +360,7 @@ s32 EnDoor_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
|
|||
void EnDoor_Draw(Actor* thisx, PlayState* play) {
|
||||
EnDoor* this = (EnDoor*)thisx;
|
||||
|
||||
if (this->actor.objBankIndex == this->requiredObjBankIndex) {
|
||||
if (this->actor.objectSlot == this->requiredObjectSlot) {
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_en_door.c", 910);
|
||||
|
||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||
|
|
|
@ -49,7 +49,7 @@ typedef void (*EnDoorActionFunc)(struct EnDoor*, PlayState*);
|
|||
typedef struct EnDoor {
|
||||
/* 0x0000 */ DOOR_ACTOR_BASE;
|
||||
/* 0x0192 */ u8 unk_192;
|
||||
/* 0x0193 */ s8 requiredObjBankIndex;
|
||||
/* 0x0193 */ s8 requiredObjectSlot;
|
||||
/* 0x0194 */ s8 dListIndex;
|
||||
/* 0x0196 */ s16 lockTimer;
|
||||
/* 0x0198 */ Vec3s jointTable[5];
|
||||
|
|
|
@ -342,15 +342,15 @@ void EnEncount2_DrawEffects(Actor* thisx, PlayState* play) {
|
|||
EnEncount2Effect* effect = this->effects;
|
||||
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
||||
s16 i;
|
||||
s32 objBankIndex;
|
||||
s32 objectSlot;
|
||||
|
||||
OPEN_DISPS(gfxCtx, "../z_en_encount2.c", 642);
|
||||
|
||||
objBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_EFC_STAR_FIELD);
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_EFC_STAR_FIELD);
|
||||
|
||||
if (objBankIndex >= 0) {
|
||||
if (objectSlot >= 0) {
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[objBankIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[objectSlot].segment);
|
||||
|
||||
for (i = 0; i < EN_ENCOUNT2_EFFECT_COUNT; effect++, i++) {
|
||||
if (effect->isAlive) {
|
||||
|
|
|
@ -60,23 +60,23 @@ void EnExItem_Init(Actor* thisx, PlayState* play) {
|
|||
// "What will come out?"
|
||||
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ なにがでるかな? ☆☆☆☆☆ %d\n" VT_RST, this->unusedParam);
|
||||
this->initPos = this->actor.world.pos;
|
||||
this->getItemObjId = -1;
|
||||
this->getItemObjectId = -1;
|
||||
switch (this->type) {
|
||||
case EXITEM_BOMB_BAG_BOWLING:
|
||||
case EXITEM_BOMB_BAG_COUNTER:
|
||||
this->getItemObjId = OBJECT_GI_BOMBPOUCH;
|
||||
this->getItemObjectId = OBJECT_GI_BOMBPOUCH;
|
||||
break;
|
||||
case EXITEM_HEART_PIECE_BOWLING:
|
||||
case EXITEM_HEART_PIECE_COUNTER:
|
||||
this->getItemObjId = OBJECT_GI_HEARTS;
|
||||
this->getItemObjectId = OBJECT_GI_HEARTS;
|
||||
break;
|
||||
case EXITEM_BOMBCHUS_BOWLING:
|
||||
case EXITEM_BOMBCHUS_COUNTER:
|
||||
this->getItemObjId = OBJECT_GI_BOMB_2;
|
||||
this->getItemObjectId = OBJECT_GI_BOMB_2;
|
||||
break;
|
||||
case EXITEM_BOMBS_BOWLING:
|
||||
case EXITEM_BOMBS_COUNTER:
|
||||
this->getItemObjId = OBJECT_GI_BOMB_1;
|
||||
this->getItemObjectId = OBJECT_GI_BOMB_1;
|
||||
break;
|
||||
case EXITEM_PURPLE_RUPEE_BOWLING:
|
||||
case EXITEM_PURPLE_RUPEE_COUNTER:
|
||||
|
@ -85,7 +85,7 @@ void EnExItem_Init(Actor* thisx, PlayState* play) {
|
|||
case EXITEM_RED_RUPEE_CHEST:
|
||||
case EXITEM_13:
|
||||
case EXITEM_14:
|
||||
this->getItemObjId = OBJECT_GI_RUPY;
|
||||
this->getItemObjectId = OBJECT_GI_RUPY;
|
||||
break;
|
||||
case EXITEM_SMALL_KEY_CHEST:
|
||||
this->scale = 0.05f;
|
||||
|
@ -96,16 +96,16 @@ void EnExItem_Init(Actor* thisx, PlayState* play) {
|
|||
case EXITEM_MAGIC_FIRE:
|
||||
case EXITEM_MAGIC_WIND:
|
||||
case EXITEM_MAGIC_DARK:
|
||||
this->getItemObjId = OBJECT_GI_GODDESS;
|
||||
this->getItemObjectId = OBJECT_GI_GODDESS;
|
||||
break;
|
||||
case EXITEM_BULLET_BAG:
|
||||
this->getItemObjId = OBJECT_GI_DEKUPOUCH;
|
||||
this->getItemObjectId = OBJECT_GI_DEKUPOUCH;
|
||||
}
|
||||
|
||||
if (this->getItemObjId >= 0) {
|
||||
this->objectIdx = Object_GetIndex(&play->objectCtx, this->getItemObjId);
|
||||
if (this->getItemObjectId >= 0) {
|
||||
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, this->getItemObjectId);
|
||||
this->actor.draw = NULL;
|
||||
if (this->objectIdx < 0) {
|
||||
if (this->requiredObjectSlot < 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
// "What?"
|
||||
osSyncPrintf("なにみの? %d\n", this->actor.params);
|
||||
|
@ -120,14 +120,14 @@ void EnExItem_Init(Actor* thisx, PlayState* play) {
|
|||
void EnExItem_WaitForObject(EnExItem* this, PlayState* play) {
|
||||
s32 onCounter;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectIdx)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
// "End of transfer"
|
||||
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params, this);
|
||||
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params, this);
|
||||
osSyncPrintf(VT_FGCOL(BLUE) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params, this);
|
||||
osSyncPrintf(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params, this);
|
||||
osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 転送終了 ☆☆☆☆☆ %d\n\n" VT_RST, this->actor.params, this);
|
||||
this->actor.objBankIndex = this->objectIdx;
|
||||
this->actor.objectSlot = this->requiredObjectSlot;
|
||||
this->actor.draw = EnExItem_Draw;
|
||||
this->stopRotate = false;
|
||||
onCounter = false;
|
||||
|
|
|
@ -12,7 +12,7 @@ typedef void (*EnExItemLightFunc)(Actor*, PlayState*, s32);
|
|||
typedef struct EnExItem {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ EnExItemActionFunc actionFunc;
|
||||
/* 0x0150 */ s16 getItemObjId;
|
||||
/* 0x0150 */ s16 getItemObjectId;
|
||||
/* 0x0152 */ s16 type;
|
||||
/* 0x0152 */ s16 unusedParam;
|
||||
/* 0x0156 */ s16 giDrawId;
|
||||
|
@ -23,7 +23,7 @@ typedef struct EnExItem {
|
|||
/* 0x0160 */ s16 killItem;
|
||||
/* 0x0164 */ f32 scale;
|
||||
/* 0x0168 */ f32 unkFloat; // set to the same value as scale, but unused
|
||||
/* 0x016C */ s8 objectIdx;
|
||||
/* 0x016C */ s8 requiredObjectSlot;
|
||||
/* 0x0170 */ Vec3f initPos; // unused
|
||||
/* 0x017C */ EnExItemLightFunc unk_17C;
|
||||
/* 0x0180 */ EnExItemLightFunc unk_180;
|
||||
|
|
|
@ -250,8 +250,8 @@ void EnFr_Init(Actor* thisx, PlayState* play) {
|
|||
ASSERT(0, "0", "../z_en_fr.c", 372);
|
||||
}
|
||||
|
||||
this->objBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GAMEPLAY_FIELD_KEEP);
|
||||
if (this->objBankIndex < 0) {
|
||||
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GAMEPLAY_FIELD_KEEP);
|
||||
if (this->requiredObjectSlot < 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
osSyncPrintf(VT_COL(RED, WHITE));
|
||||
// "There is no bank!!"
|
||||
|
@ -277,7 +277,7 @@ void EnFr_Update(Actor* thisx, PlayState* play) {
|
|||
s32 frogIndex;
|
||||
s32 pad2;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objBankIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_4;
|
||||
frogIndex = this->actor.params - 1;
|
||||
sEnFrPointers.frogs[frogIndex] = this;
|
||||
|
|
|
@ -39,7 +39,7 @@ typedef struct EnFr {
|
|||
/* 0x0354 */ EnFrActionFunc actionFunc;
|
||||
/* 0x0358 */ LightNode* lightNode; // Frogs light up during the Frog Song, specifically the frog with the next note.
|
||||
/* 0x035C */ LightInfo lightInfo;
|
||||
/* 0x036A */ s8 objBankIndex;
|
||||
/* 0x036A */ s8 requiredObjectSlot;
|
||||
/* 0x036C */ s32 jumpCounter; // cyclic clock used to time celebratory frog jumps every 4 frames when child song is played.
|
||||
/* 0x0370 */ s32 blinkTimer; // blinking timer
|
||||
/* 0x0374 */ EnFrBlinkFunc blinkFunc; // unique case of using a function pointer for blinking
|
||||
|
|
|
@ -136,12 +136,12 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) {
|
|||
this->actor.scale.y = 0.45f;
|
||||
this->actor.scale.z = 0.25f;
|
||||
this->collider.info.bumper.dmgFlags = DMG_ARROW;
|
||||
this->objId = OBJECT_TSUBO;
|
||||
this->objIndex = Object_GetIndex(&play->objectCtx, this->objId);
|
||||
if (this->objIndex < 0) {
|
||||
this->objectId = OBJECT_TSUBO;
|
||||
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, this->objectId);
|
||||
if (this->requiredObjectSlot < 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
// "what?"
|
||||
osSyncPrintf(VT_FGCOL(MAGENTA) " なにみの? %d\n" VT_RST "\n", this->objIndex);
|
||||
osSyncPrintf(VT_FGCOL(MAGENTA) " なにみの? %d\n" VT_RST "\n", this->requiredObjectSlot);
|
||||
// "bank is funny"
|
||||
osSyncPrintf(VT_FGCOL(CYAN) " バンクおかしいしぞ!%d\n" VT_RST "\n", this->actor.params);
|
||||
}
|
||||
|
@ -197,9 +197,9 @@ void EnGSwitch_Break(EnGSwitch* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void EnGSwitch_WaitForObject(EnGSwitch* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objIndex)) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objIndex].segment);
|
||||
this->actor.objBankIndex = this->objIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->requiredObjectSlot].segment);
|
||||
this->actor.objectSlot = this->requiredObjectSlot;
|
||||
this->actor.draw = EnGSwitch_DrawPot;
|
||||
this->actionFunc = EnGSwitch_ArcheryPot;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ typedef struct EnGSwitch {
|
|||
/* 0x0158 */ s16 colorIdx;
|
||||
/* 0x015A */ s16 broken;
|
||||
/* 0x015C */ s16 numEffects;
|
||||
/* 0x015E */ s16 objId;
|
||||
/* 0x015E */ s16 objectId;
|
||||
/* 0x0160 */ s16 index; // first or second rupee in two-rupee patterns
|
||||
/* 0x0162 */ s16 delayTimer; // delay between the two blue rupees appearing
|
||||
/* 0x0164 */ s16 waitTimer; // time rupee waits before retreating
|
||||
|
@ -54,7 +54,7 @@ typedef struct EnGSwitch {
|
|||
/* 0x0168 */ s16 moveState; // Appear or retreat (for blue rupees and the stationary green one)
|
||||
/* 0x016A */ s16 noteIndex;
|
||||
/* 0x016C */ Vec3f targetPos;
|
||||
/* 0x0178 */ s8 objIndex;
|
||||
/* 0x0178 */ s8 requiredObjectSlot;
|
||||
/* 0x017C */ ColliderCylinder collider;
|
||||
/* 0x01C8 */ EnGSwitchEffect effects[EN_GSWITCH_EFFECT_COUNT];
|
||||
} EnGSwitch; // size = 0x12F8
|
||||
|
|
|
@ -15,7 +15,7 @@ void EnGirlA_Update(Actor* thisx, PlayState* play);
|
|||
|
||||
void EnGirlA_SetItemOutOfStock(PlayState* play, EnGirlA* this);
|
||||
void EnGirlA_UpdateStockedItem(PlayState* play, EnGirlA* this);
|
||||
void EnGirlA_InitializeItemAction(EnGirlA* this, PlayState* play);
|
||||
void EnGirlA_WaitForObject(EnGirlA* this, PlayState* play);
|
||||
void EnGirlA_Update2(EnGirlA* this, PlayState* play);
|
||||
void func_80A3C498(Actor* thisx, PlayState* play, s32 flags);
|
||||
void EnGirlA_Draw(Actor* thisx, PlayState* play);
|
||||
|
@ -387,9 +387,9 @@ void EnGirlA_InitItem(EnGirlA* this, PlayState* play) {
|
|||
return;
|
||||
}
|
||||
|
||||
this->objBankIndex = Object_GetIndex(&play->objectCtx, shopItemEntries[params].objID);
|
||||
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, shopItemEntries[params].objID);
|
||||
|
||||
if (this->objBankIndex < 0) {
|
||||
if (this->requiredObjectSlot < 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
osSyncPrintf(VT_COL(RED, WHITE));
|
||||
osSyncPrintf("バンクが無いよ!!(%s)\n", sShopItemDescriptions[params]);
|
||||
|
@ -399,7 +399,7 @@ void EnGirlA_InitItem(EnGirlA* this, PlayState* play) {
|
|||
}
|
||||
|
||||
this->actor.params = params;
|
||||
this->actionFunc2 = EnGirlA_InitializeItemAction;
|
||||
this->actionFunc2 = EnGirlA_WaitForObject;
|
||||
}
|
||||
|
||||
void EnGirlA_Init(Actor* thisx, PlayState* play) {
|
||||
|
@ -976,13 +976,13 @@ s32 EnGirlA_TrySetMaskItemDescription(EnGirlA* this, PlayState* play) {
|
|||
return false;
|
||||
}
|
||||
|
||||
void EnGirlA_InitializeItemAction(EnGirlA* this, PlayState* play) {
|
||||
void EnGirlA_WaitForObject(EnGirlA* this, PlayState* play) {
|
||||
s16 params = this->actor.params;
|
||||
ShopItemEntry* itemEntry = &shopItemEntries[params];
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objBankIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_4;
|
||||
this->actor.objBankIndex = this->objBankIndex;
|
||||
this->actor.objectSlot = this->requiredObjectSlot;
|
||||
switch (this->actor.params) {
|
||||
case SI_KEATON_MASK:
|
||||
if (GET_ITEMGETINF(ITEMGETINF_38)) {
|
||||
|
|
|
@ -15,7 +15,7 @@ typedef struct EnGirlA {
|
|||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ SkelAnime skelAnime;
|
||||
/* 0x0190 */ EnGirlAActionFunc actionFunc;
|
||||
/* 0x0194 */ s8 objBankIndex;
|
||||
/* 0x0194 */ s8 requiredObjectSlot;
|
||||
/* 0x0198 */ EnGirlAActionFunc actionFunc2;
|
||||
/* 0x019C */ s32 isInitialized;
|
||||
/* 0x01A0 */ s16 itemBuyPromptTextId;
|
||||
|
|
|
@ -70,9 +70,9 @@ void EnGm_Init(Actor* thisx, PlayState* play) {
|
|||
// "Medi Goron"
|
||||
osSyncPrintf(VT_FGCOL(GREEN) "%s[%d] : 中ゴロン[%d]" VT_RST "\n", "../z_en_gm.c", 133, this->actor.params);
|
||||
|
||||
this->objGmBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GM);
|
||||
this->gmObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GM);
|
||||
|
||||
if (this->objGmBankIndex < 0) {
|
||||
if (this->gmObjectSlot < 0) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE));
|
||||
// "There is no model bank! !! (Medi Goron)"
|
||||
osSyncPrintf("モデル バンクが無いよ!!(中ゴロン)\n");
|
||||
|
@ -102,10 +102,10 @@ s32 func_80A3D7C8(void) {
|
|||
}
|
||||
|
||||
void func_80A3D838(EnGm* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objGmBankIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->gmObjectSlot)) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_4;
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &gGoronSkel, NULL, this->jointTable, this->morphTable, 18);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objGmBankIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->gmObjectSlot].segment);
|
||||
Animation_Change(&this->skelAnime, &object_gm_Anim_0002B8, 1.0f, 0.0f,
|
||||
Animation_GetLastFrame(&object_gm_Anim_0002B8), ANIMMODE_LOOP, 0.0f);
|
||||
this->actor.draw = EnGm_Draw;
|
||||
|
@ -274,7 +274,7 @@ void func_80A3DF60(EnGm* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void func_80A3DFBC(EnGm* this, PlayState* play) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objGmBankIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->gmObjectSlot].segment);
|
||||
this->timer++;
|
||||
this->actionFunc(this, play);
|
||||
this->actor.focus.rot.x = this->actor.world.rot.x;
|
||||
|
|
|
@ -17,7 +17,7 @@ typedef struct EnGm {
|
|||
/* 0x0268 */ EnGmUpdateFunc updateFunc;
|
||||
/* 0x026C */ EnGmActionFunc actionFunc;
|
||||
/* 0x0270 */ ColliderCylinder collider;
|
||||
/* 0x02BC */ s8 objGmBankIndex;
|
||||
/* 0x02BC */ s8 gmObjectSlot;
|
||||
/* 0x02BE */ s16 timer;
|
||||
/* 0x02C0 */ s16 blinkTimer;
|
||||
/* 0x02C2 */ u8 eyeTexIndex;
|
||||
|
|
|
@ -55,8 +55,8 @@ void EnGuest_Init(Actor* thisx, PlayState* play) {
|
|||
if (GET_INFTABLE(INFTABLE_76)) {
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
this->osAnimeBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_OS_ANIME);
|
||||
if (this->osAnimeBankIndex < 0) {
|
||||
this->osAnimeObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_OS_ANIME);
|
||||
if (this->osAnimeObjectSlot < 0) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE));
|
||||
// "No such bank!!"
|
||||
osSyncPrintf("%s[%d] : バンクが無いよ!!\n", "../z_en_guest.c", 129);
|
||||
|
@ -76,13 +76,13 @@ void EnGuest_Update(Actor* thisx, PlayState* play) {
|
|||
EnGuest* this = (EnGuest*)thisx;
|
||||
s32 pad;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->osAnimeBankIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->osAnimeObjectSlot)) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_4;
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &object_boj_Skel_0000F0, NULL, this->jointTable, this->morphTable,
|
||||
16);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->osAnimeBankIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment);
|
||||
Animation_Change(&this->skelAnime, &gObjOsAnim_42AC, 1.0f, 0.0f, Animation_GetLastFrame(&gObjOsAnim_42AC),
|
||||
ANIMMODE_LOOP, 0.0f);
|
||||
|
||||
|
@ -160,7 +160,7 @@ void func_80A505CC(Actor* thisx, PlayState* play) {
|
|||
|
||||
func_80034F54(play, this->unk_2CC, this->unk_2EC, 16);
|
||||
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->osAnimeBankIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment);
|
||||
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
Actor_SetFocus(&this->actor, 60.0f);
|
||||
|
|
|
@ -20,7 +20,7 @@ typedef struct EnGuest {
|
|||
/* 0x02CA */ s16 unk_2CA;
|
||||
/* 0x02CC */ s16 unk_2CC[16];
|
||||
/* 0x02EC */ s16 unk_2EC[16];
|
||||
/* 0x030C */ s8 osAnimeBankIndex;
|
||||
/* 0x030C */ s8 osAnimeObjectSlot;
|
||||
/* 0x030D */ u8 unk_30D;
|
||||
/* 0x030E */ u8 unk_30E;
|
||||
} EnGuest; // size = 0x0310
|
||||
|
|
|
@ -838,7 +838,7 @@ void EnHeishi2_DrawKingGuard(Actor* thisx, PlayState* play) {
|
|||
void EnHeishi2_Draw(Actor* thisx, PlayState* play) {
|
||||
EnHeishi2* this = (EnHeishi2*)thisx;
|
||||
Mtx* mtx;
|
||||
s32 linkObjBankIndex;
|
||||
s32 linkChildObjectSlot;
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_en_heishi2.c", 1792);
|
||||
|
||||
|
@ -847,17 +847,17 @@ void EnHeishi2_Draw(Actor* thisx, PlayState* play) {
|
|||
SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, EnHeishi2_OverrideLimbDraw,
|
||||
EnHeishi2_PostLimbDraw, this);
|
||||
if ((this->type == 5) && GET_INFTABLE(INFTABLE_77)) {
|
||||
linkObjBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_LINK_CHILD);
|
||||
if (linkObjBankIndex >= 0) {
|
||||
linkChildObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_LINK_CHILD);
|
||||
if (linkChildObjectSlot >= 0) {
|
||||
Matrix_Put(&this->mtxf_330);
|
||||
Matrix_Translate(-570.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateZ(DEG_TO_RAD(70), MTXMODE_APPLY);
|
||||
mtx = Matrix_NewMtx(play->state.gfxCtx, "../z_en_heishi2.c", 1820) - 7;
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[linkObjBankIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[linkChildObjectSlot].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0D, mtx);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gLinkChildKeatonMaskDL);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->actor.objBankIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->actor.objectSlot].segment);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -757,15 +757,15 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
|
|||
this->actor.params &= ~0x8000;
|
||||
this->type = HORSE_HNI;
|
||||
|
||||
if ((this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_HNI)) < 0) {
|
||||
if ((this->hniObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_HNI)) < 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
||||
do {
|
||||
} while (!Object_IsLoaded(&play->objectCtx, this->bankIndex));
|
||||
} while (!Object_IsLoaded(&play->objectCtx, this->hniObjectSlot));
|
||||
|
||||
this->actor.objBankIndex = this->bankIndex;
|
||||
this->actor.objectSlot = this->hniObjectSlot;
|
||||
Actor_SetObjectDependency(play, &this->actor);
|
||||
this->boostSpeed = 12;
|
||||
} else {
|
||||
|
|
|
@ -97,7 +97,7 @@ typedef struct EnHorse {
|
|||
/* 0x0150 */ s32 noInputTimer;
|
||||
/* 0x0154 */ s32 noInputTimerMax;
|
||||
/* 0x0158 */ s32 type;
|
||||
/* 0x015C */ s8 bankIndex;
|
||||
/* 0x015C */ s8 hniObjectSlot;
|
||||
/* 0x0160 */ Skin skin;
|
||||
/* 0x01F0 */ u32 stateFlags;
|
||||
/* 0x01F4 */ Vec3f lastPos;
|
||||
|
|
|
@ -207,9 +207,9 @@ static AnimationInfo sAnimationInfo[] = {
|
|||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 headInfoIndex; // EnHyHeadIndex
|
||||
/* 0x01 */ u8 skelInfoIndex2; // EnHySkeletonIndex, see EnHy.objBankIndexSkel2
|
||||
/* 0x01 */ u8 skelInfoIndex2; // EnHySkeletonIndex, see EnHy.objectSlotSkel2
|
||||
/* 0x02 */ Color_RGBA8 envColorSeg8;
|
||||
/* 0x06 */ u8 skelInfoIndex1; // EnHySkeletonIndex, see EnHy.objBankIndexSkel1
|
||||
/* 0x06 */ u8 skelInfoIndex1; // EnHySkeletonIndex, see EnHy.objectSlotSkel1
|
||||
/* 0x07 */ Color_RGBA8 envColorSeg9;
|
||||
/* 0x0B */ u8 animInfoIndex; // EnHyAnimationIndex
|
||||
} EnHyModelInfo; // size = 0xC
|
||||
|
@ -356,18 +356,18 @@ s32 EnHy_FindSkelAndHeadObjects(EnHy* this, PlayState* play) {
|
|||
u8 skelInfoIndex2 = sModelInfo[this->actor.params & 0x7F].skelInfoIndex2;
|
||||
u8 skelInfoIndex1 = sModelInfo[this->actor.params & 0x7F].skelInfoIndex1;
|
||||
|
||||
this->objBankIndexSkel1 = Object_GetIndex(&play->objectCtx, sSkeletonInfo[skelInfoIndex1].objectId);
|
||||
if (this->objBankIndexSkel1 < 0) {
|
||||
this->objectSlotSkel1 = Object_GetSlot(&play->objectCtx, sSkeletonInfo[skelInfoIndex1].objectId);
|
||||
if (this->objectSlotSkel1 < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this->objBankIndexSkel2 = Object_GetIndex(&play->objectCtx, sSkeletonInfo[skelInfoIndex2].objectId);
|
||||
if (this->objBankIndexSkel2 < 0) {
|
||||
this->objectSlotSkel2 = Object_GetSlot(&play->objectCtx, sSkeletonInfo[skelInfoIndex2].objectId);
|
||||
if (this->objectSlotSkel2 < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this->objBankIndexHead = Object_GetIndex(&play->objectCtx, sHeadInfo[headInfoIndex].objectId);
|
||||
if (this->objBankIndexHead < 0) {
|
||||
this->objectSlotHead = Object_GetSlot(&play->objectCtx, sHeadInfo[headInfoIndex].objectId);
|
||||
if (this->objectSlotHead < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -375,15 +375,15 @@ s32 EnHy_FindSkelAndHeadObjects(EnHy* this, PlayState* play) {
|
|||
}
|
||||
|
||||
s32 EnHy_AreSkelAndHeadObjectsLoaded(EnHy* this, PlayState* play) {
|
||||
if (!Object_IsLoaded(&play->objectCtx, this->objBankIndexSkel1)) {
|
||||
if (!Object_IsLoaded(&play->objectCtx, this->objectSlotSkel1)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Object_IsLoaded(&play->objectCtx, this->objBankIndexSkel2)) {
|
||||
if (!Object_IsLoaded(&play->objectCtx, this->objectSlotSkel2)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Object_IsLoaded(&play->objectCtx, this->objBankIndexHead)) {
|
||||
if (!Object_IsLoaded(&play->objectCtx, this->objectSlotHead)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -391,9 +391,9 @@ s32 EnHy_AreSkelAndHeadObjectsLoaded(EnHy* this, PlayState* play) {
|
|||
}
|
||||
|
||||
s32 EnHy_FindOsAnimeObject(EnHy* this, PlayState* play) {
|
||||
this->objBankIndexOsAnime = Object_GetIndex(&play->objectCtx, OBJECT_OS_ANIME);
|
||||
this->objectSlotOsAnime = Object_GetSlot(&play->objectCtx, OBJECT_OS_ANIME);
|
||||
|
||||
if (this->objBankIndexOsAnime < 0) {
|
||||
if (this->objectSlotOsAnime < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -401,7 +401,7 @@ s32 EnHy_FindOsAnimeObject(EnHy* this, PlayState* play) {
|
|||
}
|
||||
|
||||
s32 EnHy_IsOsAnimeObjectLoaded(EnHy* this, PlayState* play) {
|
||||
if (!Object_IsLoaded(&play->objectCtx, this->objBankIndexOsAnime)) {
|
||||
if (!Object_IsLoaded(&play->objectCtx, this->objectSlotOsAnime)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -898,13 +898,13 @@ void EnHy_Destroy(Actor* thisx, PlayState* play) {
|
|||
|
||||
void EnHy_InitImpl(EnHy* this, PlayState* play) {
|
||||
if (EnHy_IsOsAnimeObjectLoaded(this, play) && EnHy_AreSkelAndHeadObjectsLoaded(this, play)) {
|
||||
this->actor.objBankIndex = this->objBankIndexSkel1;
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->actor.objBankIndex].segment);
|
||||
this->actor.objectSlot = this->objectSlotSkel1;
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->actor.objectSlot].segment);
|
||||
SkelAnime_InitFlex(play, &this->skelAnime,
|
||||
sSkeletonInfo[sModelInfo[this->actor.params & 0x7F].skelInfoIndex1].skeleton, NULL,
|
||||
this->jointTable, this->morphTable, 16);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objBankIndexOsAnime].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotOsAnime].segment);
|
||||
Collider_InitCylinder(play, &this->collider);
|
||||
Collider_SetCylinder(play, &this->collider, &this->actor, &sColCylInit);
|
||||
EnHy_InitCollider(this);
|
||||
|
@ -1082,7 +1082,7 @@ void EnHy_Update(Actor* thisx, PlayState* play) {
|
|||
EnHy* this = (EnHy*)thisx;
|
||||
|
||||
if (this->actionFunc != EnHy_InitImpl) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objBankIndexOsAnime].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotOsAnime].segment);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
EnHy_UpdateEyes(this);
|
||||
|
||||
|
@ -1110,8 +1110,8 @@ s32 EnHy_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
|
|||
OPEN_DISPS(play->state.gfxCtx, "../z_en_hy.c", 2170);
|
||||
|
||||
if (limbIndex == 15) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->objBankIndexHead].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objBankIndexHead].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->objectSlotHead].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotHead].segment);
|
||||
i = sModelInfo[this->actor.params & 0x7F].headInfoIndex;
|
||||
*dList = sHeadInfo[i].headDList;
|
||||
|
||||
|
@ -1120,7 +1120,7 @@ s32 EnHy_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
|
|||
gSPSegment(POLY_OPA_DISP++, 0x0A, SEGMENTED_TO_VIRTUAL(ptr));
|
||||
}
|
||||
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objBankIndexSkel1].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotSkel1].segment);
|
||||
}
|
||||
|
||||
if (limbIndex == 15) {
|
||||
|
@ -1155,8 +1155,8 @@ void EnHy_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
|
|||
OPEN_DISPS(play->state.gfxCtx, "../z_en_hy.c", 2255);
|
||||
|
||||
if (limbIndex == 7) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->objBankIndexSkel2].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objBankIndexSkel2].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->objectSlotSkel2].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotSkel2].segment);
|
||||
}
|
||||
|
||||
if ((this->actor.params & 0x7F) == ENHY_TYPE_BOJ_3 && limbIndex == 8) {
|
||||
|
|
|
@ -39,10 +39,10 @@ typedef struct EnHy {
|
|||
/* 0x0190 */ EnHyActionFunc actionFunc;
|
||||
/* 0x0194 */ char unk_194; // unused
|
||||
/* 0x0195 */ u8 pathReverse;
|
||||
/* 0x0196 */ s8 objBankIndexHead;
|
||||
/* 0x0197 */ s8 objBankIndexSkel2; // 7 < limb < 15 (upper part?) (always same as objBankIndexSkel1)
|
||||
/* 0x0198 */ s8 objBankIndexSkel1; // sets the object used when drawing the skeleton for limb <= 7 (lower part?)
|
||||
/* 0x0199 */ s8 objBankIndexOsAnime;
|
||||
/* 0x0196 */ s8 objectSlotHead;
|
||||
/* 0x0197 */ s8 objectSlotSkel2; // 7 < limb < 15 (upper part?) (always same as objectSlotSkel1)
|
||||
/* 0x0198 */ s8 objectSlotSkel1; // sets the object used when drawing the skeleton for limb <= 7 (lower part?)
|
||||
/* 0x0199 */ s8 objectSlotOsAnime;
|
||||
/* 0x019C */ ColliderCylinder collider;
|
||||
/* 0x01E8 */ NpcInteractInfo interactInfo;
|
||||
/* 0x0210 */ Path* path;
|
||||
|
|
|
@ -928,7 +928,8 @@ void EnIk_PostLimbDrawEnemy(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s*
|
|||
|
||||
if (this->armorStatusFlag & ARMOR_BROKEN) {
|
||||
BodyBreak_SetInfo(&this->bodyBreak, limbIndex, IRON_KNUCKLE_LIMB_CHEST_ARMOR_FRONT,
|
||||
IRON_KNUCKLE_LIMB_CHEST_ARMOR_BACK, IRON_KNUCKLE_LIMB_TORSO, dList, BODYBREAK_OBJECT_DEFAULT);
|
||||
IRON_KNUCKLE_LIMB_CHEST_ARMOR_BACK, IRON_KNUCKLE_LIMB_TORSO, dList,
|
||||
BODYBREAK_OBJECT_SLOT_DEFAULT);
|
||||
}
|
||||
if (limbIndex == IRON_KNUCKLE_LIMB_HELMET_ARMOR) {
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_ik_inFight.c", 1217),
|
||||
|
|
|
@ -9,7 +9,7 @@ void EnIn_Destroy(Actor* thisx, PlayState* play);
|
|||
void EnIn_Update(Actor* thisx, PlayState* play);
|
||||
void EnIn_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
void func_80A79FB0(EnIn* this, PlayState* play);
|
||||
void EnIn_WaitForObject(EnIn* this, PlayState* play);
|
||||
void func_80A7A304(EnIn* this, PlayState* play);
|
||||
void func_80A7A4C8(EnIn* this, PlayState* play);
|
||||
void func_80A7A568(EnIn* this, PlayState* play);
|
||||
|
@ -481,8 +481,8 @@ void EnIn_Init(Actor* thisx, PlayState* play) {
|
|||
RespawnData* respawn = &gSaveContext.respawn[RESPAWN_MODE_DOWN];
|
||||
Vec3f respawnPos;
|
||||
|
||||
this->ingoObjBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_IN);
|
||||
if (this->ingoObjBankIndex < 0 && this->actor.params > 0) {
|
||||
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_IN);
|
||||
if (this->requiredObjectSlot < 0 && this->actor.params > 0) {
|
||||
this->actionFunc = NULL;
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
|
@ -493,21 +493,23 @@ void EnIn_Init(Actor* thisx, PlayState* play) {
|
|||
gSaveContext.eventInf[EVENTINF_HORSES_INDEX] = 0;
|
||||
D_80A7B998 = 1;
|
||||
}
|
||||
this->actionFunc = func_80A79FB0;
|
||||
this->actionFunc = EnIn_WaitForObject;
|
||||
}
|
||||
|
||||
void EnIn_Destroy(Actor* thisx, PlayState* play) {
|
||||
EnIn* this = (EnIn*)thisx;
|
||||
|
||||
if (this->actionFunc != NULL && this->actionFunc != func_80A79FB0) {
|
||||
if (this->actionFunc != NULL && this->actionFunc != EnIn_WaitForObject) {
|
||||
Collider_DestroyCylinder(play, &this->collider);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A79FB0(EnIn* this, PlayState* play) {
|
||||
// This function does not actually wait since it waits for OBJECT_IN,
|
||||
// but the object is already loaded at this point from being set in the ActorInit data
|
||||
void EnIn_WaitForObject(EnIn* this, PlayState* play) {
|
||||
s32 sp3C = 0;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->ingoObjBankIndex) || this->actor.params <= 0) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot) || this->actor.params <= 0) {
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f);
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &gIngoSkel, NULL, this->jointTable, this->morphTable, 20);
|
||||
Collider_InitCylinder(play, &this->collider);
|
||||
|
@ -911,7 +913,7 @@ void EnIn_Update(Actor* thisx, PlayState* play) {
|
|||
ColliderCylinder* collider;
|
||||
EnIn* this = (EnIn*)thisx;
|
||||
|
||||
if (this->actionFunc == func_80A79FB0) {
|
||||
if (this->actionFunc == EnIn_WaitForObject) {
|
||||
this->actionFunc(this, play);
|
||||
return;
|
||||
}
|
||||
|
@ -1000,7 +1002,7 @@ void EnIn_Draw(Actor* thisx, PlayState* play) {
|
|||
EnIn* this = (EnIn*)thisx;
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_en_in.c", 2384);
|
||||
if (this->actionFunc != func_80A79FB0) {
|
||||
if (this->actionFunc != EnIn_WaitForObject) {
|
||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(eyeTextures[this->eyeIndex]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(gIngoHeadGradient2Tex));
|
||||
|
|
|
@ -38,7 +38,7 @@ typedef struct EnIn {
|
|||
/* 0x0190 */ EnInActionFunc actionFunc;
|
||||
/* 0x0194 */ ColliderCylinder collider;
|
||||
/* 0x01E0 */ f32 unk_1E0;
|
||||
/* 0x01E4 */ s8 ingoObjBankIndex;
|
||||
/* 0x01E4 */ s8 requiredObjectSlot;
|
||||
/* 0x01E6 */ s16 animationIdx;
|
||||
/* 0x01E8 */ s16 unk_1E8;
|
||||
/* 0x01EA */ s16 blinkTimer;
|
||||
|
|
|
@ -259,46 +259,46 @@ s32 EnKo_AreObjectsAvailable(EnKo* this, PlayState* play) {
|
|||
u8 bodyId = sModelInfo[ENKO_TYPE].bodyId;
|
||||
u8 legsId = sModelInfo[ENKO_TYPE].legsId;
|
||||
|
||||
this->legsObjectBankIdx = Object_GetIndex(&play->objectCtx, sSkeleton[legsId].objectId);
|
||||
if (this->legsObjectBankIdx < 0) {
|
||||
this->legsObjectSlot = Object_GetSlot(&play->objectCtx, sSkeleton[legsId].objectId);
|
||||
if (this->legsObjectSlot < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this->bodyObjectBankIdx = Object_GetIndex(&play->objectCtx, sSkeleton[bodyId].objectId);
|
||||
if (this->bodyObjectBankIdx < 0) {
|
||||
this->bodyObjectSlot = Object_GetSlot(&play->objectCtx, sSkeleton[bodyId].objectId);
|
||||
if (this->bodyObjectSlot < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this->headObjectBankIdx = Object_GetIndex(&play->objectCtx, sHead[headId].objectId);
|
||||
if (this->headObjectBankIdx < 0) {
|
||||
this->headObjectSlot = Object_GetSlot(&play->objectCtx, sHead[headId].objectId);
|
||||
if (this->headObjectSlot < 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
s32 EnKo_AreObjectsLoaded(EnKo* this, PlayState* play) {
|
||||
if (!Object_IsLoaded(&play->objectCtx, this->legsObjectBankIdx)) {
|
||||
if (!Object_IsLoaded(&play->objectCtx, this->legsObjectSlot)) {
|
||||
return false;
|
||||
}
|
||||
if (!Object_IsLoaded(&play->objectCtx, this->bodyObjectBankIdx)) {
|
||||
if (!Object_IsLoaded(&play->objectCtx, this->bodyObjectSlot)) {
|
||||
return false;
|
||||
}
|
||||
if (!Object_IsLoaded(&play->objectCtx, this->headObjectBankIdx)) {
|
||||
if (!Object_IsLoaded(&play->objectCtx, this->headObjectSlot)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
s32 EnKo_IsOsAnimeAvailable(EnKo* this, PlayState* play) {
|
||||
this->osAnimeBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_OS_ANIME);
|
||||
if (this->osAnimeBankIndex < 0) {
|
||||
this->osAnimeObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_OS_ANIME);
|
||||
if (this->osAnimeObjectSlot < 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
s32 EnKo_IsOsAnimeLoaded(EnKo* this, PlayState* play) {
|
||||
if (!Object_IsLoaded(&play->objectCtx, this->osAnimeBankIndex)) {
|
||||
if (!Object_IsLoaded(&play->objectCtx, this->osAnimeObjectSlot)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -1150,12 +1150,12 @@ void EnKo_Destroy(Actor* thisx, PlayState* play) {
|
|||
void func_80A99048(EnKo* this, PlayState* play) {
|
||||
if (EnKo_IsOsAnimeLoaded(this, play) && EnKo_AreObjectsLoaded(this, play)) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_4;
|
||||
this->actor.objBankIndex = this->legsObjectBankIdx;
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->actor.objBankIndex].segment);
|
||||
this->actor.objectSlot = this->legsObjectSlot;
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->actor.objectSlot].segment);
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, sSkeleton[sModelInfo[ENKO_TYPE].legsId].flexSkeletonHeader, NULL,
|
||||
this->jointTable, this->morphTable, 16);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->osAnimeBankIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment);
|
||||
Collider_InitCylinder(play, &this->collider);
|
||||
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
|
||||
|
@ -1270,7 +1270,7 @@ void EnKo_Update(Actor* thisx, PlayState* play) {
|
|||
|
||||
if (this->actionFunc != func_80A99048) {
|
||||
if ((s32)this->modelAlpha != 0) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->osAnimeBankIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
func_80A98DB4(this, play);
|
||||
EnKo_Blink(this);
|
||||
|
@ -1302,8 +1302,8 @@ s32 EnKo_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
|
|||
s32 pad;
|
||||
|
||||
if (limbIndex == 15) {
|
||||
gSPSegment((*gfx)++, 0x06, play->objectCtx.status[this->headObjectBankIdx].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->headObjectBankIdx].segment);
|
||||
gSPSegment((*gfx)++, 0x06, play->objectCtx.slots[this->headObjectSlot].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->headObjectSlot].segment);
|
||||
|
||||
headId = sModelInfo[ENKO_TYPE].headId;
|
||||
*dList = sHead[headId].dList;
|
||||
|
@ -1311,7 +1311,7 @@ s32 EnKo_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
|
|||
eyeTexture = sHead[headId].eyeTextures[this->eyeTextureIndex];
|
||||
gSPSegment((*gfx)++, 0x0A, SEGMENTED_TO_VIRTUAL(eyeTexture));
|
||||
}
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->legsObjectBankIdx].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->legsObjectSlot].segment);
|
||||
}
|
||||
if (limbIndex == 8) {
|
||||
limbRot = this->interactInfo.torsoRot;
|
||||
|
@ -1338,8 +1338,8 @@ void EnKo_PostLimbDraw(PlayState* play2, s32 limbIndex, Gfx** dList, Vec3s* rot,
|
|||
Vec3f D_80A9A774 = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
if (limbIndex == 7) {
|
||||
gSPSegment((*gfx)++, 0x06, play->objectCtx.status[this->bodyObjectBankIdx].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->bodyObjectBankIdx].segment);
|
||||
gSPSegment((*gfx)++, 0x06, play->objectCtx.slots[this->bodyObjectSlot].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->bodyObjectSlot].segment);
|
||||
}
|
||||
if (limbIndex == 15) {
|
||||
Matrix_MultVec3f(&D_80A9A774, &this->actor.focus.pos);
|
||||
|
|
|
@ -12,10 +12,10 @@ typedef struct EnKo {
|
|||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ SkelAnime skelAnime;
|
||||
/* 0x0190 */ EnKoActionFunc actionFunc;
|
||||
/* 0x0194 */ s8 headObjectBankIdx;
|
||||
/* 0x0195 */ s8 bodyObjectBankIdx;
|
||||
/* 0x0196 */ s8 legsObjectBankIdx;
|
||||
/* 0x0197 */ s8 osAnimeBankIndex;
|
||||
/* 0x0194 */ s8 headObjectSlot;
|
||||
/* 0x0195 */ s8 bodyObjectSlot;
|
||||
/* 0x0196 */ s8 legsObjectSlot;
|
||||
/* 0x0197 */ s8 osAnimeObjectSlot;
|
||||
/* 0x0198 */ ColliderCylinder collider;
|
||||
/* 0x01E4 */ Path* path;
|
||||
/* 0x01E8 */ NpcInteractInfo interactInfo;
|
||||
|
|
|
@ -20,7 +20,7 @@ void EnKusa_Update(Actor* thisx, PlayState* play);
|
|||
void EnKusa_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
void EnKusa_SetupLiftedUp(EnKusa* this);
|
||||
void EnKusa_SetupWaitObject(EnKusa* this);
|
||||
void EnKusa_SetupWaitForObject(EnKusa* this);
|
||||
void EnKusa_SetupMain(EnKusa* this);
|
||||
void EnKusa_SetupFall(EnKusa* this);
|
||||
void EnKusa_SetupCut(EnKusa* this);
|
||||
|
@ -28,7 +28,7 @@ void EnKusa_SetupUprootedWaitRegrow(EnKusa* this);
|
|||
void EnKusa_SetupRegrow(EnKusa* this);
|
||||
|
||||
void EnKusa_Fall(EnKusa* this, PlayState* play);
|
||||
void EnKusa_WaitObject(EnKusa* this, PlayState* play);
|
||||
void EnKusa_WaitForObject(EnKusa* this, PlayState* play);
|
||||
void EnKusa_Main(EnKusa* this, PlayState* play);
|
||||
void EnKusa_LiftedUp(EnKusa* this, PlayState* play);
|
||||
void EnKusa_CutWaitRegrow(EnKusa* this, PlayState* play);
|
||||
|
@ -253,16 +253,16 @@ void EnKusa_Init(Actor* thisx, PlayState* play) {
|
|||
return;
|
||||
}
|
||||
|
||||
this->objBankIndex = Object_GetIndex(&play->objectCtx, sObjectIds[thisx->params & 3]);
|
||||
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[thisx->params & 3]);
|
||||
|
||||
if (this->objBankIndex < 0) {
|
||||
if (this->requiredObjectSlot < 0) {
|
||||
// "Bank danger!"
|
||||
osSyncPrintf("Error : バンク危険! (arg_data 0x%04x)(%s %d)\n", thisx->params, "../z_en_kusa.c", 561);
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
||||
EnKusa_SetupWaitObject(this);
|
||||
EnKusa_SetupWaitForObject(this);
|
||||
}
|
||||
|
||||
void EnKusa_Destroy(Actor* thisx, PlayState* play2) {
|
||||
|
@ -272,12 +272,12 @@ void EnKusa_Destroy(Actor* thisx, PlayState* play2) {
|
|||
Collider_DestroyCylinder(play, &this->collider);
|
||||
}
|
||||
|
||||
void EnKusa_SetupWaitObject(EnKusa* this) {
|
||||
EnKusa_SetupAction(this, EnKusa_WaitObject);
|
||||
void EnKusa_SetupWaitForObject(EnKusa* this) {
|
||||
EnKusa_SetupAction(this, EnKusa_WaitForObject);
|
||||
}
|
||||
|
||||
void EnKusa_WaitObject(EnKusa* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objBankIndex)) {
|
||||
void EnKusa_WaitForObject(EnKusa* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
if (this->actor.flags & ACTOR_FLAG_ENKUSA_CUT) {
|
||||
EnKusa_SetupCut(this);
|
||||
} else {
|
||||
|
@ -285,7 +285,7 @@ void EnKusa_WaitObject(EnKusa* this, PlayState* play) {
|
|||
}
|
||||
|
||||
this->actor.draw = EnKusa_Draw;
|
||||
this->actor.objBankIndex = this->objBankIndex;
|
||||
this->actor.objectSlot = this->requiredObjectSlot;
|
||||
this->actor.flags &= ~ACTOR_FLAG_4;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ typedef struct EnKusa {
|
|||
/* 0x014C */ EnKusaActionFunc actionFunc;
|
||||
/* 0x0150 */ ColliderCylinder collider;
|
||||
/* 0x019C */ s16 timer;
|
||||
/* 0x019E */ s8 objBankIndex;
|
||||
/* 0x019E */ s8 requiredObjectSlot;
|
||||
} EnKusa; // size = 0x01A0
|
||||
|
||||
#endif
|
||||
|
|
|
@ -394,7 +394,7 @@ void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxP) {
|
|||
u16 rectLeft;
|
||||
u16 rectTop;
|
||||
|
||||
gSPSegment(gfx++, 0x06, play->objectCtx.status[this->actor.objBankIndex].segment);
|
||||
gSPSegment(gfx++, 0x06, play->objectCtx.slots[this->actor.objectSlot].segment);
|
||||
|
||||
Gfx_SetupDL_39Ptr(&gfx);
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ void EnMm_Init(Actor* thisx, PlayState* play) {
|
|||
this->actor.targetMode = 2;
|
||||
this->actor.gravity = -1.0f;
|
||||
this->speedXZ = 3.0f;
|
||||
this->unk_204 = this->actor.objBankIndex;
|
||||
this->unk_204 = this->actor.objectSlot;
|
||||
|
||||
if (func_80AADA70() == 1) {
|
||||
this->mouthTexIndex = RM_MOUTH_OPEN;
|
||||
|
@ -524,10 +524,10 @@ void EnMm_Draw(Actor* thisx, PlayState* play) {
|
|||
EnMm_OverrideLimbDraw, EnMm_PostLimbDraw, this);
|
||||
|
||||
if (GET_ITEMGETINF(ITEMGETINF_3B)) {
|
||||
s32 linkChildObjBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_LINK_CHILD);
|
||||
s32 linkChildObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_LINK_CHILD);
|
||||
|
||||
// Draw Bunny Hood
|
||||
if (linkChildObjBankIndex >= 0) {
|
||||
if (linkChildObjectSlot >= 0) {
|
||||
Mtx* mtx;
|
||||
Vec3s earRot;
|
||||
Mtx* mtx2;
|
||||
|
@ -537,7 +537,7 @@ void EnMm_Draw(Actor* thisx, PlayState* play) {
|
|||
Matrix_Put(&this->unk_208);
|
||||
mtx2 = Matrix_NewMtx(play->state.gfxCtx, "../z_en_mm.c", 1111);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[linkChildObjBankIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[linkChildObjectSlot].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0B, mtx);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0D, mtx2 - 7);
|
||||
|
||||
|
@ -558,7 +558,7 @@ void EnMm_Draw(Actor* thisx, PlayState* play) {
|
|||
Matrix_ToMtx(mtx, "../z_en_mm.c", 1131);
|
||||
|
||||
gSPDisplayList(POLY_OPA_DISP++, gLinkChildBunnyHoodDL);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->actor.objBankIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->actor.objectSlot].segment);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -70,9 +70,9 @@ void EnNiwLady_Init(Actor* thisx, PlayState* play) {
|
|||
s32 pad;
|
||||
EnNiwLady* this = (EnNiwLady*)thisx;
|
||||
|
||||
this->objectAneIndex = Object_GetIndex(&play->objectCtx, OBJECT_ANE);
|
||||
this->objectOsAnimeIndex = Object_GetIndex(&play->objectCtx, OBJECT_OS_ANIME);
|
||||
if ((this->objectOsAnimeIndex < 0) || (this->objectAneIndex < 0)) {
|
||||
this->aneObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_ANE);
|
||||
this->osAnimeObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_OS_ANIME);
|
||||
if ((this->osAnimeObjectSlot < 0) || (this->aneObjectSlot < 0)) {
|
||||
Actor_Kill(thisx);
|
||||
return;
|
||||
}
|
||||
|
@ -153,11 +153,11 @@ void func_80AB9F24(EnNiwLady* this, PlayState* play) {
|
|||
f32 frames;
|
||||
s32 pad;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectAneIndex) &&
|
||||
Object_IsLoaded(&play->objectCtx, this->objectOsAnimeIndex)) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objectAneIndex].segment);
|
||||
if (Object_IsLoaded(&play->objectCtx, this->aneObjectSlot) &&
|
||||
Object_IsLoaded(&play->objectCtx, this->osAnimeObjectSlot)) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->aneObjectSlot].segment);
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &gCuccoLadySkel, NULL, this->jointTable, this->morphTable, 16);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objectOsAnimeIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment);
|
||||
this->unk_27E = 1;
|
||||
this->actor.gravity = -3.0f;
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
|
@ -507,8 +507,8 @@ void EnNiwLady_Update(Actor* thisx, PlayState* play) {
|
|||
if (this->unk_276 == 0) {
|
||||
Math_SmoothStepToS(&this->headRot.y, 0, 5, 3000, 0);
|
||||
}
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objectOsAnimeIndex].segment);
|
||||
if (this->objectOsAnimeIndex >= 0) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->osAnimeObjectSlot].segment);
|
||||
if (this->osAnimeObjectSlot >= 0) {
|
||||
if (this->unk_27E != 0) {
|
||||
if (this->unk_26E != 0) {
|
||||
this->unk_26E--;
|
||||
|
@ -517,8 +517,8 @@ void EnNiwLady_Update(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
}
|
||||
this->objectAneIndex = Object_GetIndex(&play->objectCtx, OBJECT_ANE);
|
||||
if (this->objectAneIndex >= 0) {
|
||||
this->aneObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_ANE);
|
||||
if (this->aneObjectSlot >= 0) {
|
||||
this->actionFunc(this, play);
|
||||
if (this->unusedTimer2 != 0) {
|
||||
this->unusedTimer2--;
|
||||
|
|
|
@ -35,8 +35,8 @@ typedef struct EnNiwLady {
|
|||
/* 0x027A */ s16 unk_27A;
|
||||
/* 0x027C */ s16 faceState;
|
||||
/* 0x027E */ s16 unk_27E;
|
||||
/* 0x0280 */ s8 objectAneIndex;
|
||||
/* 0x0281 */ s8 objectOsAnimeIndex;
|
||||
/* 0x0280 */ s8 aneObjectSlot;
|
||||
/* 0x0281 */ s8 osAnimeObjectSlot;
|
||||
/* 0x0284 */ s32 getItemId;
|
||||
/* 0x0288 */ NpcInteractInfo interactInfo;
|
||||
/* 0x02B0 */ ColliderCylinder collider;
|
||||
|
|
|
@ -54,7 +54,7 @@ static ColliderCylinderInit sCylinderInit = {
|
|||
{ 13, 13, 0, { 0 } },
|
||||
};
|
||||
|
||||
static s16 sObjectIDs[] = {
|
||||
static s16 sObjectIds[] = {
|
||||
OBJECT_DEKUNUTS, OBJECT_HINTNUTS, OBJECT_SHOPNUTS, OBJECT_DNS, OBJECT_DNK,
|
||||
};
|
||||
|
||||
|
@ -69,9 +69,9 @@ void EnNutsball_Init(Actor* thisx, PlayState* play) {
|
|||
ActorShape_Init(&this->actor.shape, 400.0f, ActorShadow_DrawCircle, 13.0f);
|
||||
Collider_InitCylinder(play, &this->collider);
|
||||
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
this->objBankIndex = Object_GetIndex(&play->objectCtx, sObjectIDs[this->actor.params]);
|
||||
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[this->actor.params]);
|
||||
|
||||
if (this->objBankIndex < 0) {
|
||||
if (this->requiredObjectSlot < 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
this->actionFunc = func_80ABBB34;
|
||||
|
@ -85,8 +85,8 @@ void EnNutsball_Destroy(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
void func_80ABBB34(EnNutsball* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objBankIndex)) {
|
||||
this->actor.objBankIndex = this->objBankIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
this->actor.objectSlot = this->requiredObjectSlot;
|
||||
this->actor.draw = EnNutsball_Draw;
|
||||
this->actor.shape.rot.y = 0;
|
||||
this->timer = 30;
|
||||
|
|
|
@ -11,7 +11,7 @@ typedef void (*EnNutsballActionFunc)(struct EnNutsball*, PlayState*);
|
|||
typedef struct EnNutsball {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ EnNutsballActionFunc actionFunc;
|
||||
/* 0x0150 */ s8 objBankIndex;
|
||||
/* 0x0150 */ s8 requiredObjectSlot;
|
||||
/* 0x0152 */ s16 timer;
|
||||
/* 0x0154 */ ColliderCylinder collider;
|
||||
} EnNutsball; // size = 0x01A0
|
||||
|
|
|
@ -549,20 +549,20 @@ void EnOssan_UpdateCameraDirection(EnOssan* this, PlayState* play, f32 cameraFac
|
|||
|
||||
s32 EnOssan_TryGetObjBankIndices(EnOssan* this, PlayState* play, s16* objectIds) {
|
||||
if (objectIds[1] != OBJECT_ID_MAX) {
|
||||
this->objBankIndex2 = Object_GetIndex(&play->objectCtx, objectIds[1]);
|
||||
if (this->objBankIndex2 < 0) {
|
||||
this->objectSlot2 = Object_GetSlot(&play->objectCtx, objectIds[1]);
|
||||
if (this->objectSlot2 < 0) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
this->objBankIndex2 = -1;
|
||||
this->objectSlot2 = -1;
|
||||
}
|
||||
if (objectIds[2] != OBJECT_ID_MAX) {
|
||||
this->objBankIndex3 = Object_GetIndex(&play->objectCtx, objectIds[2]);
|
||||
if (this->objBankIndex3 < 0) {
|
||||
this->objectSlot3 = Object_GetSlot(&play->objectCtx, objectIds[2]);
|
||||
if (this->objectSlot3 < 0) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
this->objBankIndex3 = -1;
|
||||
this->objectSlot3 = -1;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -604,9 +604,9 @@ void EnOssan_Init(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
objectIds = sShopkeeperObjectIds[this->actor.params];
|
||||
this->objBankIndex1 = Object_GetIndex(&play->objectCtx, objectIds[0]);
|
||||
this->objectSlot1 = Object_GetSlot(&play->objectCtx, objectIds[0]);
|
||||
|
||||
if (this->objBankIndex1 < 0) {
|
||||
if (this->objectSlot1 < 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
osSyncPrintf(VT_COL(RED, WHITE));
|
||||
osSyncPrintf("バンクが無いよ!!(%s)\n", sShopkeeperPrintName[this->actor.params]);
|
||||
|
@ -1970,11 +1970,11 @@ void EnOssan_Blink(EnOssan* this) {
|
|||
}
|
||||
|
||||
s32 EnOssan_AreShopkeeperObjectsLoaded(EnOssan* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objBankIndex1)) {
|
||||
if (this->objBankIndex2 >= 0 && !Object_IsLoaded(&play->objectCtx, this->objBankIndex2)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot1)) {
|
||||
if (this->objectSlot2 >= 0 && !Object_IsLoaded(&play->objectCtx, this->objectSlot2)) {
|
||||
return false;
|
||||
}
|
||||
if (this->objBankIndex3 >= 0 && !Object_IsLoaded(&play->objectCtx, this->objBankIndex3)) {
|
||||
if (this->objectSlot3 >= 0 && !Object_IsLoaded(&play->objectCtx, this->objectSlot3)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -1990,7 +1990,7 @@ void EnOssan_InitBazaarShopkeeper(EnOssan* this, PlayState* play) {
|
|||
|
||||
void EnOssan_InitKokiriShopkeeper(EnOssan* this, PlayState* play) {
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &gKm1Skel, NULL, NULL, NULL, 0);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objBankIndex3].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot3].segment);
|
||||
Animation_Change(&this->skelAnime, &object_masterkokiri_Anim_0004A8, 1.0f, 0.0f,
|
||||
Animation_GetLastFrame(&object_masterkokiri_Anim_0004A8), 0, 0.0f);
|
||||
this->actor.draw = EnOssan_DrawKokiriShopkeeper;
|
||||
|
@ -2001,7 +2001,7 @@ void EnOssan_InitKokiriShopkeeper(EnOssan* this, PlayState* play) {
|
|||
|
||||
void EnOssan_InitGoronShopkeeper(EnOssan* this, PlayState* play) {
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &gGoronSkel, NULL, NULL, NULL, 0);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objBankIndex3].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot3].segment);
|
||||
Animation_Change(&this->skelAnime, &gGoronShopkeeperAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gGoronShopkeeperAnim),
|
||||
0, 0.0f);
|
||||
this->actor.draw = EnOssan_DrawGoronShopkeeper;
|
||||
|
@ -2010,7 +2010,7 @@ void EnOssan_InitGoronShopkeeper(EnOssan* this, PlayState* play) {
|
|||
|
||||
void EnOssan_InitZoraShopkeeper(EnOssan* this, PlayState* play) {
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &gZoraSkel, NULL, NULL, NULL, 0);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objBankIndex3].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot3].segment);
|
||||
Animation_Change(&this->skelAnime, &gZoraShopkeeperAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gZoraShopkeeperAnim),
|
||||
0, 0.0f);
|
||||
this->actor.draw = EnOssan_DrawZoraShopkeeper;
|
||||
|
@ -2103,7 +2103,7 @@ void EnOssan_InitActionFunc(EnOssan* this, PlayState* play) {
|
|||
|
||||
if (EnOssan_AreShopkeeperObjectsLoaded(this, play)) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_4;
|
||||
this->actor.objBankIndex = this->objBankIndex1;
|
||||
this->actor.objectSlot = this->objectSlot1;
|
||||
Actor_SetObjectDependency(play, &this->actor);
|
||||
|
||||
this->shelves = (EnTana*)Actor_Find(&play->actorCtx, ACTOR_EN_TANA, ACTORCAT_PROP);
|
||||
|
@ -2193,7 +2193,7 @@ void EnOssan_InitActionFunc(EnOssan* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void EnOssan_Obj3ToSeg6(EnOssan* this, PlayState* play) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objBankIndex3].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot3].segment);
|
||||
}
|
||||
|
||||
void EnOssan_MainActionFunc(EnOssan* this, PlayState* play) {
|
||||
|
@ -2360,8 +2360,8 @@ s32 EnOssan_OverrideLimbDrawKokiriShopkeeper(PlayState* play, s32 limbIndex, Gfx
|
|||
OPEN_DISPS(play->state.gfxCtx, "../z_en_oB1.c", 4354);
|
||||
|
||||
if (limbIndex == 15) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->objBankIndex2].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objBankIndex2].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->objectSlot2].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot2].segment);
|
||||
*dList = gKokiriShopkeeperHeadDL;
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0A, SEGMENTED_TO_VIRTUAL(sKokiriShopkeeperEyeTextures[this->eyeTextureIdx]));
|
||||
}
|
||||
|
|
|
@ -41,9 +41,9 @@ typedef struct EnOssan {
|
|||
/* 0x0198 */ ColliderCylinder collider; // unused
|
||||
/* 0x01E4 */ s16 timer;
|
||||
/* 0x01E6 */ s16 delayTimer;
|
||||
/* 0x01E8 */ s8 objBankIndex1;
|
||||
/* 0x01E9 */ s8 objBankIndex2;
|
||||
/* 0x01EA */ s8 objBankIndex3;
|
||||
/* 0x01E8 */ s8 objectSlot1;
|
||||
/* 0x01E9 */ s8 objectSlot2;
|
||||
/* 0x01EA */ s8 objectSlot3;
|
||||
/* 0x01EB */ u8 happyMaskShopState;
|
||||
/* 0x01EC */ u8 happyMaskShopkeeperEyeIdx;
|
||||
/* 0x01EE */ s16 headRot;
|
||||
|
|
|
@ -230,16 +230,16 @@ void EnPoh_Init(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
}
|
||||
if (this->actor.params < EN_POH_SHARP) {
|
||||
this->objectIdx = Object_GetIndex(&play->objectCtx, OBJECT_POH);
|
||||
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_POH);
|
||||
this->infoIdx = EN_POH_INFO_NORMAL;
|
||||
this->actor.naviEnemyId = NAVI_ENEMY_POE;
|
||||
} else {
|
||||
this->objectIdx = Object_GetIndex(&play->objectCtx, OBJECT_PO_COMPOSER);
|
||||
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_PO_COMPOSER);
|
||||
this->infoIdx = EN_POH_INFO_COMPOSER;
|
||||
this->actor.naviEnemyId = NAVI_ENEMY_POE_COMPOSER;
|
||||
}
|
||||
this->info = &sPoeInfo[this->infoIdx];
|
||||
if (this->objectIdx < 0) {
|
||||
if (this->requiredObjectSlot < 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
|
@ -712,14 +712,14 @@ void func_80ADF894(EnPoh* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void EnPoh_Death(EnPoh* this, PlayState* play) {
|
||||
s32 objId;
|
||||
s32 objectId;
|
||||
|
||||
if (this->unk_198 != 0) {
|
||||
this->unk_198--;
|
||||
}
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
objId = (this->infoIdx == EN_POH_INFO_COMPOSER) ? OBJECT_PO_COMPOSER : OBJECT_POH;
|
||||
EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 6.0f, 0, 1, 1, 15, objId, 10,
|
||||
objectId = (this->infoIdx == EN_POH_INFO_COMPOSER) ? OBJECT_PO_COMPOSER : OBJECT_POH;
|
||||
EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 6.0f, 0, 1, 1, 15, objectId, 10,
|
||||
this->info->lanternDisplayList);
|
||||
func_80ADE6D4(this);
|
||||
} else if (this->unk_198 == 0) {
|
||||
|
@ -906,8 +906,8 @@ void EnPoh_UpdateVisibility(EnPoh* this) {
|
|||
void EnPoh_Update(Actor* thisx, PlayState* play) {
|
||||
EnPoh* this = (EnPoh*)thisx;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectIdx)) {
|
||||
this->actor.objBankIndex = this->objectIdx;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
this->actor.objectSlot = this->requiredObjectSlot;
|
||||
this->actor.update = EnPoh_UpdateLiving;
|
||||
Actor_SetObjectDependency(play, &this->actor);
|
||||
if (this->infoIdx == EN_POH_INFO_NORMAL) {
|
||||
|
|
|
@ -41,7 +41,7 @@ typedef struct EnPoh {
|
|||
/* 0x0190 */ EnPohActionFunc actionFunc;
|
||||
/* 0x0194 */ u8 unk_194;
|
||||
/* 0x0195 */ u8 unk_195;
|
||||
/* 0x0196 */ s8 objectIdx;
|
||||
/* 0x0196 */ s8 requiredObjectSlot;
|
||||
/* 0x0197 */ u8 infoIdx;
|
||||
/* 0x0198 */ s16 unk_198;
|
||||
/* 0x019A */ s16 visibilityTimer;
|
||||
|
|
|
@ -476,7 +476,7 @@ void EnSb_Update(Actor* thisx, PlayState* play) {
|
|||
void EnSb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
|
||||
EnSb* this = (EnSb*)thisx;
|
||||
|
||||
BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 0, 6, 8, dList, BODYBREAK_OBJECT_DEFAULT);
|
||||
BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 0, 6, 8, dList, BODYBREAK_OBJECT_SLOT_DEFAULT);
|
||||
}
|
||||
|
||||
void EnSb_Draw(Actor* thisx, PlayState* play) {
|
||||
|
|
|
@ -558,9 +558,9 @@ void EnSkb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
|
|||
Collider_UpdateSpheres(limbIndex, &this->collider);
|
||||
|
||||
if ((this->breakFlags ^ 1) == 0) {
|
||||
BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 11, 12, 18, dList, BODYBREAK_OBJECT_DEFAULT);
|
||||
BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 11, 12, 18, dList, BODYBREAK_OBJECT_SLOT_DEFAULT);
|
||||
} else if ((this->breakFlags ^ (this->breakFlags | 4)) == 0) {
|
||||
BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 0, 18, 18, dList, BODYBREAK_OBJECT_DEFAULT);
|
||||
BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 0, 18, 18, dList, BODYBREAK_OBJECT_SLOT_DEFAULT);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ void EnSth_Update(Actor* thisx, PlayState* play);
|
|||
void EnSth_Update2(Actor* thisx, PlayState* play);
|
||||
void EnSth_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
void EnSth_WaitForObjectLoaded(EnSth* this, PlayState* play);
|
||||
void EnSth_WaitForObject(EnSth* this, PlayState* play);
|
||||
void EnSth_ParentRewardObtainedWait(EnSth* this, PlayState* play);
|
||||
void EnSth_RewardUnobtainedWait(EnSth* this, PlayState* play);
|
||||
void EnSth_ChildRewardObtainedWait(EnSth* this, PlayState* play);
|
||||
|
@ -97,7 +97,7 @@ void EnSth_Init(Actor* thisx, PlayState* play) {
|
|||
|
||||
s16 objectId;
|
||||
s32 params = this->actor.params;
|
||||
s32 objectBankIdx;
|
||||
s32 objectSlot;
|
||||
|
||||
osSyncPrintf(VT_FGCOL(BLUE) "金スタル屋 no = %d\n" VT_RST, params); // "Gold Skulltula Shop"
|
||||
if (this->actor.params == 0) {
|
||||
|
@ -116,19 +116,19 @@ void EnSth_Init(Actor* thisx, PlayState* play) {
|
|||
|
||||
objectId = sObjectIds[params];
|
||||
if (objectId != 1) {
|
||||
objectBankIdx = Object_GetIndex(&play->objectCtx, objectId);
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, objectId);
|
||||
} else {
|
||||
objectBankIdx = 0;
|
||||
objectSlot = 0;
|
||||
}
|
||||
|
||||
osSyncPrintf("bank_ID = %d\n", objectBankIdx);
|
||||
if (objectBankIdx < 0) {
|
||||
osSyncPrintf("bank_ID = %d\n", objectSlot);
|
||||
if (objectSlot < 0) {
|
||||
ASSERT(0, "0", "../z_en_sth.c", 1564);
|
||||
}
|
||||
this->objectBankIdx = objectBankIdx;
|
||||
this->requiredObjectSlot = objectSlot;
|
||||
this->drawFunc = EnSth_Draw;
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
EnSth_SetupAction(this, EnSth_WaitForObjectLoaded);
|
||||
EnSth_SetupAction(this, EnSth_WaitForObject);
|
||||
this->actor.draw = NULL;
|
||||
this->unk_2B2 = 0;
|
||||
this->actor.targetMode = 6;
|
||||
|
@ -150,7 +150,7 @@ void EnSth_SetupAfterObjectLoaded(EnSth* this, PlayState* play) {
|
|||
s16* params;
|
||||
|
||||
EnSth_SetupShapeColliderUpdate2AndDraw(this, play);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objectBankIdx].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->requiredObjectSlot].segment);
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, sSkeletons[this->actor.params], NULL, this->jointTable, this->morphTable,
|
||||
16);
|
||||
Animation_PlayLoop(&this->skelAnime, sAnimations[this->actor.params]);
|
||||
|
@ -170,9 +170,9 @@ void EnSth_Destroy(Actor* thisx, PlayState* play) {
|
|||
Collider_DestroyCylinder(play, &this->collider);
|
||||
}
|
||||
|
||||
void EnSth_WaitForObjectLoaded(EnSth* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectBankIdx)) {
|
||||
this->actor.objBankIndex = this->objectBankIdx;
|
||||
void EnSth_WaitForObject(EnSth* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
this->actor.objectSlot = this->requiredObjectSlot;
|
||||
this->actionFunc = EnSth_SetupAfterObjectLoaded;
|
||||
}
|
||||
}
|
||||
|
@ -389,7 +389,7 @@ void EnSth_Draw(Actor* thisx, PlayState* play) {
|
|||
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_en_sth.c", 2133);
|
||||
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objectBankIdx].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->requiredObjectSlot].segment);
|
||||
Gfx_SetupDL_37Opa(play->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08,
|
||||
|
|
|
@ -16,7 +16,7 @@ typedef struct EnSth {
|
|||
/* 0x023C */ Vec3s morphTable[16];
|
||||
/* 0x029C */ u16 eventFlag;
|
||||
/* 0x02A0 */ ActorFunc drawFunc;
|
||||
/* 0x02A4 */ u8 objectBankIdx;
|
||||
/* 0x02A4 */ u8 requiredObjectSlot;
|
||||
/* 0x02A6 */ Vec3s headRot;
|
||||
/* 0x02AC */ Vec3s unk_2AC;
|
||||
/* 0x02B2 */ u16 unk_2B2;
|
||||
|
|
|
@ -1865,7 +1865,7 @@ void EnTest_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot
|
|||
s32 pad;
|
||||
Vec3f sp50;
|
||||
|
||||
BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 0, 60, 60, dList, BODYBREAK_OBJECT_DEFAULT);
|
||||
BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 0, 60, 60, dList, BODYBREAK_OBJECT_SLOT_DEFAULT);
|
||||
|
||||
if (limbIndex == STALFOS_LIMB_SWORD) {
|
||||
Matrix_MultVec3f(&D_8086467C, &this->swordCollider.dim.quad[1]);
|
||||
|
|
|
@ -980,7 +980,7 @@ void EnTite_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** limbDList, Vec3s*
|
|||
break;
|
||||
}
|
||||
|
||||
BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 0, 24, 24, limbDList, BODYBREAK_OBJECT_DEFAULT);
|
||||
BodyBreak_SetInfo(&this->bodyBreak, limbIndex, 0, 24, 24, limbDList, BODYBREAK_OBJECT_SLOT_DEFAULT);
|
||||
}
|
||||
|
||||
void EnTite_Draw(Actor* thisx, PlayState* play) {
|
||||
|
|
|
@ -123,7 +123,7 @@ void EnViewer_InitAnimGanondorfOrZelda(EnViewer* this, PlayState* play, void* sk
|
|||
SkelAnime_Init(play, &this->skin.skelAnime, skeletonHeaderSeg, NULL, NULL, NULL, 0);
|
||||
}
|
||||
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->animObjBankIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
|
||||
if (type == ENVIEWER_TYPE_3_GANONDORF || type == ENVIEWER_TYPE_7_GANONDORF || type == ENVIEWER_TYPE_8_GANONDORF ||
|
||||
type == ENVIEWER_TYPE_9_GANONDORF) {
|
||||
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, anim, 1.0f);
|
||||
|
@ -134,7 +134,7 @@ void EnViewer_InitAnimGanondorfOrZelda(EnViewer* this, PlayState* play, void* sk
|
|||
|
||||
void EnViewer_InitAnimImpa(EnViewer* this, PlayState* play, void* skeletonHeaderSeg, AnimationHeader* anim) {
|
||||
SkelAnime_InitFlex(play, &this->skin.skelAnime, skeletonHeaderSeg, NULL, NULL, NULL, 0);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->animObjBankIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
|
||||
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, anim, 3.0f);
|
||||
}
|
||||
|
||||
|
@ -167,21 +167,21 @@ static ActorShadowFunc sShadowDrawFuncs[] = {
|
|||
|
||||
void EnViewer_InitImpl(EnViewer* this, PlayState* play) {
|
||||
EnViewerInitData* initData = &sInitData[this->actor.params >> 8];
|
||||
s32 skelObjBankIndex = Object_GetIndex(&play->objectCtx, initData->skeletonObject);
|
||||
s32 skelObjectSlot = Object_GetSlot(&play->objectCtx, initData->skeletonObject);
|
||||
|
||||
ASSERT(skelObjBankIndex >= 0, "bank_ID >= 0", "../z_en_viewer.c", 576);
|
||||
ASSERT(skelObjectSlot >= 0, "bank_ID >= 0", "../z_en_viewer.c", 576);
|
||||
|
||||
this->animObjBankIndex = Object_GetIndex(&play->objectCtx, initData->animObject);
|
||||
ASSERT(this->animObjBankIndex >= 0, "this->anime_bank_ID >= 0", "../z_en_viewer.c", 579);
|
||||
this->animObjectSlot = Object_GetSlot(&play->objectCtx, initData->animObject);
|
||||
ASSERT(this->animObjectSlot >= 0, "this->anime_bank_ID >= 0", "../z_en_viewer.c", 579);
|
||||
|
||||
if (!Object_IsLoaded(&play->objectCtx, skelObjBankIndex) ||
|
||||
!Object_IsLoaded(&play->objectCtx, this->animObjBankIndex)) {
|
||||
if (!Object_IsLoaded(&play->objectCtx, skelObjectSlot) ||
|
||||
!Object_IsLoaded(&play->objectCtx, this->animObjectSlot)) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_6;
|
||||
return;
|
||||
}
|
||||
|
||||
this->isVisible = true;
|
||||
this->actor.objBankIndex = skelObjBankIndex;
|
||||
this->actor.objectSlot = skelObjectSlot;
|
||||
Actor_SetObjectDependency(play, &this->actor);
|
||||
Actor_SetScale(&this->actor, initData->scale / 100.0f);
|
||||
ActorShape_Init(&this->actor.shape, initData->yOffset * 100, sShadowDrawFuncs[initData->shadowType],
|
||||
|
@ -487,7 +487,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) {
|
|||
void EnViewer_Update(Actor* thisx, PlayState* play) {
|
||||
EnViewer* this = (EnViewer*)thisx;
|
||||
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->animObjBankIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->animObjectSlot].segment);
|
||||
this->actionFunc(this, play);
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ typedef enum {
|
|||
typedef struct EnViewer {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ Skin skin;
|
||||
/* 0x01DC */ s8 animObjBankIndex;
|
||||
/* 0x01DC */ s8 animObjectSlot;
|
||||
/* 0x01DD */ u8 drawFuncIndex;
|
||||
/* 0x01E0 */ EnViewerActionFunc actionFunc;
|
||||
/* 0x01E4 */ u8 unused;
|
||||
|
|
|
@ -559,9 +559,9 @@ void EnZl2_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
|
|||
}
|
||||
|
||||
void func_80B4FCCC(EnZl2* this, PlayState* play) {
|
||||
s32 unk_274 = this->unk_274;
|
||||
s32 objectSlot = this->zl2Anime1ObjectSlot;
|
||||
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[unk_274].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
|
||||
}
|
||||
|
||||
void func_80B4FD00(EnZl2* this, AnimationHeader* animation, u8 arg2, f32 morphFrames, s32 arg4) {
|
||||
|
@ -1575,16 +1575,16 @@ void func_80B52114(EnZl2* this, PlayState* play) {
|
|||
void func_80B521A0(EnZl2* this, PlayState* play) {
|
||||
s32 pad;
|
||||
ObjectContext* objectCtx = &play->objectCtx;
|
||||
s32 bankIndex = Object_GetIndex(objectCtx, OBJECT_ZL2_ANIME1);
|
||||
s32 objectSlot = Object_GetSlot(objectCtx, OBJECT_ZL2_ANIME1);
|
||||
s32 pad2;
|
||||
|
||||
if (bankIndex < 0) {
|
||||
if (objectSlot < 0) {
|
||||
osSyncPrintf(VT_FGCOL(RED) "En_Zl2_main_bankアニメーションのバンクを読めない!!!!!!!!!!!!\n" VT_RST);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Object_IsLoaded(objectCtx, bankIndex)) {
|
||||
this->unk_274 = bankIndex;
|
||||
if (Object_IsLoaded(objectCtx, objectSlot)) {
|
||||
this->zl2Anime1ObjectSlot = objectSlot;
|
||||
func_80B4FCCC(this, play);
|
||||
this->unk_278 = Animation_GetLastFrame(&gZelda2Anime1Anim_0022D0);
|
||||
func_80B52114(this, play);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue