diff --git a/include/functions.h b/include/functions.h index 73ec1d5c73..1456c40c35 100644 --- a/include/functions.h +++ b/include/functions.h @@ -458,7 +458,7 @@ void Enemy_StartFinishingBlow(PlayState* play, Actor* actor); s16 func_80032CB4(s16* arg0, s16 arg1, s16 arg2, s16 arg3); void BodyBreak_Alloc(BodyBreak* bodyBreak, s32 count, PlayState* play); void BodyBreak_SetInfo(BodyBreak* bodyBreak, s32 limbIndex, s32 minLimbIndex, s32 maxLimbIndex, u32 count, Gfx** dList, - s16 objectId); + s16 objectSlot); s32 BodyBreak_SpawnParts(Actor* actor, BodyBreak* bodyBreak, PlayState* play, s16 type); void Actor_SpawnFloorDustRing(PlayState* play, Actor* actor, Vec3f* posXZ, f32 radius, s32 amountMinusOne, f32 randAccelWeight, s16 scale, s16 scaleStep, u8 useLighting); @@ -1106,11 +1106,10 @@ void Sample_Init(GameState* thisx); void Inventory_ChangeEquipment(s16 equipment, u16 value); u8 Inventory_DeleteEquipment(PlayState* play, s16 equipment); void Inventory_ChangeUpgrade(s16 upgrade, s16 value); -s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId); -void Object_InitBank(PlayState* play, ObjectContext* objectCtx); -void Object_UpdateBank(ObjectContext* objectCtx); -s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId); -s32 Object_IsLoaded(ObjectContext* objectCtx, s32 bankIndex); +void Object_InitContext(PlayState* play, ObjectContext* objectCtx); +void Object_UpdateEntries(ObjectContext* objectCtx); +s32 Object_GetSlot(ObjectContext* objectCtx, s16 objectId); +s32 Object_IsLoaded(ObjectContext* objectCtx, s32 slot); void func_800981B8(ObjectContext* objectCtx); s32 Scene_ExecuteCommands(PlayState* play, SceneCmd* sceneCmd); void TransitionActor_InitContext(GameState* state, TransitionActorContext* transiActorCtx); diff --git a/include/z64actor.h b/include/z64actor.h index 4c1d0ec68c..8fdbbf1dbc 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -199,7 +199,7 @@ typedef struct Actor { /* 0x004 */ u32 flags; // Flags used for various purposes /* 0x008 */ PosRot home; // Initial position/rotation when spawned. Can be used for other purposes /* 0x01C */ s16 params; // Configurable variable set by the actor's spawn data; original name: "args_data" - /* 0x01E */ s8 objBankIndex; // Object bank index of the actor's object dependency; original name: "bank" + /* 0x01E */ s8 objectSlot; // Object slot (in ObjectContext) corresponding to the actor's object; original name: "bank" /* 0x01F */ s8 targetMode; // Controls how far the actor can be targeted from and how far it can stay locked on /* 0x020 */ u16 sfx; // SFX ID to play. Sfx plays when value is set, then is cleared the following update cycle /* 0x024 */ PosRot world; // Position/rotation in the world @@ -287,14 +287,14 @@ typedef struct DynaPolyActor { typedef struct { /* 0x00 */ MtxF* matrices; - /* 0x04 */ s16* objectIds; + /* 0x04 */ s16* objectSlots; /* 0x08 */ s16 count; /* 0x0C */ Gfx** dLists; /* 0x10 */ s32 val; // used for various purposes: both a status indicator and counter /* 0x14 */ s32 prevLimbIndex; } BodyBreak; -#define BODYBREAK_OBJECT_DEFAULT -1 // use the same object as the actor +#define BODYBREAK_OBJECT_SLOT_DEFAULT -1 // use the same object as the actor #define BODYBREAK_STATUS_READY -1 #define BODYBREAK_STATUS_FINISHED 0 diff --git a/include/z64effect.h b/include/z64effect.h index e0dca34c0c..4189edc5bb 100644 --- a/include/z64effect.h +++ b/include/z64effect.h @@ -246,7 +246,7 @@ typedef struct { #define rgEnvColorG regs[8] #define rgEnvColorB regs[9] #define rgEnvColorA regs[10] -#define rgObjBankIdx regs[11] +#define rgObjectSlot regs[11] #define DEFINE_EFFECT_SS(_0, enum) enum, #define DEFINE_EFFECT_SS_UNSET(enum) enum, diff --git a/include/z64object.h b/include/z64object.h index 3f80fee7a7..aa7c2a85e1 100644 --- a/include/z64object.h +++ b/include/z64object.h @@ -4,24 +4,22 @@ #include "ultra64.h" #include "z64dma.h" -#define OBJECT_EXCHANGE_BANK_MAX 19 - typedef struct { - /* 0x00 */ s16 id; - /* 0x04 */ void* segment; - /* 0x08 */ DmaRequest dmaRequest; + /* 0x00 */ s16 id; + /* 0x04 */ void* segment; + /* 0x08 */ DmaRequest dmaRequest; /* 0x28 */ OSMesgQueue loadQueue; - /* 0x40 */ OSMesg loadMsg; -} ObjectStatus; // size = 0x44 + /* 0x40 */ OSMesg loadMsg; +} ObjectEntry; // size = 0x44 typedef struct { - /* 0x0000 */ void* spaceStart; - /* 0x0004 */ void* spaceEnd; // original name: "endSegment" - /* 0x0008 */ u8 num; // number of objects in bank - /* 0x0009 */ u8 unk_09; - /* 0x000A */ u8 mainKeepIndex; // "gameplay_keep" index in bank - /* 0x000B */ u8 subKeepIndex; // "gameplay_field_keep" or "gameplay_dangeon_keep" index in bank - /* 0x000C */ ObjectStatus status[OBJECT_EXCHANGE_BANK_MAX]; + /* 0x0000 */ void* spaceStart; + /* 0x0004 */ void* spaceEnd; // original name: "endSegment" + /* 0x0008 */ u8 numEntries; // total amount of used entries + /* 0x0009 */ u8 numPersistentEntries; // amount of entries that won't be reused when loading a new object list (when loading a new room) + /* 0x000A */ u8 mainKeepSlot; // "gameplay_keep" slot + /* 0x000B */ u8 subKeepSlot; // "gameplay_field_keep" or "gameplay_dangeon_keep" slot + /* 0x000C */ ObjectEntry slots[19]; } ObjectContext; // size = 0x518 #define DEFINE_OBJECT(_0, enum) enum, @@ -31,7 +29,7 @@ typedef struct { typedef enum { #include "tables/object_table.h" /* 0x0192 */ OBJECT_ID_MAX -} ObjectID; +} ObjectId; #undef DEFINE_OBJECT #undef DEFINE_OBJECT_NULL diff --git a/src/code/z_actor.c b/src/code/z_actor.c index aa1f16291f..4ef0bf10f2 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -799,7 +799,7 @@ void Actor_SetScale(Actor* actor, f32 scale) { } void Actor_SetObjectDependency(PlayState* play, Actor* actor) { - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[actor->objBankIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[actor->objectSlot].segment); } void Actor_Init(Actor* actor, PlayState* play) { @@ -818,7 +818,7 @@ void Actor_Init(Actor* actor, PlayState* play) { CollisionCheck_InitInfo(&actor->colChkInfo); actor->floorBgId = BGCHECK_SCENE; ActorShape_Init(&actor->shape, 0.0f, NULL, 0.0f); - if (Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) { + if (Object_IsLoaded(&play->objectCtx, actor->objectSlot)) { Actor_SetObjectDependency(play, actor); actor->init(actor, play); actor->init = NULL; @@ -2143,13 +2143,13 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { actor->sfx = 0; if (actor->init != NULL) { - if (Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) { + if (Object_IsLoaded(&play->objectCtx, actor->objectSlot)) { Actor_SetObjectDependency(play, actor); actor->init(actor, play); actor->init = NULL; } actor = actor->next; - } else if (!Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) { + } else if (!Object_IsLoaded(&play->objectCtx, actor->objectSlot)) { Actor_Kill(actor); actor = actor->next; } else if ((requiredActorFlag && !(actor->flags & requiredActorFlag)) || @@ -2272,8 +2272,8 @@ void Actor_Draw(PlayState* play, Actor* actor) { Matrix_Scale(actor->scale.x, actor->scale.y, actor->scale.z, MTXMODE_APPLY); Actor_SetObjectDependency(play, actor); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[actor->objBankIndex].segment); - gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.status[actor->objBankIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[actor->objectSlot].segment); + gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.slots[actor->objectSlot].segment); if (actor->colorFilterTimer != 0) { Color_RGBA8 color = { 0, 0, 0, 255 }; @@ -2570,7 +2570,7 @@ void Actor_KillAllWithMissingObject(PlayState* play, ActorContext* actorCtx) { for (i = 0; i < ARRAY_COUNT(actorCtx->actorLists); i++) { actor = actorCtx->actorLists[i].head; while (actor != NULL) { - if (!Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) { + if (!Object_IsLoaded(&play->objectCtx, actor->objectSlot)) { Actor_Kill(actor); } actor = actor->next; @@ -2745,7 +2745,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos s32 pad; Actor* actor; ActorInit* actorInit; - s32 objBankIndex; + s32 objectSlot; ActorOverlay* overlayEntry; uintptr_t temp; char* name; @@ -2828,13 +2828,13 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos : NULL); } - objBankIndex = Object_GetIndex(&play->objectCtx, actorInit->objectId); + objectSlot = Object_GetSlot(&play->objectCtx, actorInit->objectId); - if ((objBankIndex < 0) || + if ((objectSlot < 0) || ((actorInit->category == ACTORCAT_ENEMY) && Flags_GetClear(play, play->roomCtx.curRoom.num))) { // "No data bank!! (profilep->bank=%d)" osSyncPrintf(VT_COL(RED, WHITE) "データバンク無し!!<データバンク=%d>(profilep->bank=%d)\n" VT_RST, - objBankIndex, actorInit->objectId); + objectSlot, actorInit->objectId); Actor_FreeOverlay(overlayEntry); return NULL; } @@ -2864,10 +2864,10 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos actor->flags = actorInit->flags; if (actorInit->id == ACTOR_EN_PART) { - actor->objBankIndex = rotZ; + actor->objectSlot = rotZ; rotZ = 0; } else { - actor->objBankIndex = objBankIndex; + actor->objectSlot = objectSlot; } actor->init = actorInit->init; @@ -3155,7 +3155,7 @@ s16 func_80032D60(s16* arg0, s16 arg1, s16 arg2, s16 arg3) { void BodyBreak_Alloc(BodyBreak* bodyBreak, s32 count, PlayState* play) { u32 matricesSize; u32 dListsSize; - u32 objectIdsSize; + u32 objectSlotsSize; matricesSize = (count + 1) * sizeof(*bodyBreak->matrices); bodyBreak->matrices = ZeldaArena_MallocDebug(matricesSize, "../z_actor.c", 7540); @@ -3165,13 +3165,13 @@ void BodyBreak_Alloc(BodyBreak* bodyBreak, s32 count, PlayState* play) { bodyBreak->dLists = ZeldaArena_MallocDebug(dListsSize, "../z_actor.c", 7543); if (bodyBreak->dLists != NULL) { - objectIdsSize = (count + 1) * sizeof(*bodyBreak->objectIds); - bodyBreak->objectIds = ZeldaArena_MallocDebug(objectIdsSize, "../z_actor.c", 7546); + objectSlotsSize = (count + 1) * sizeof(*bodyBreak->objectSlots); + bodyBreak->objectSlots = ZeldaArena_MallocDebug(objectSlotsSize, "../z_actor.c", 7546); - if (bodyBreak->objectIds != NULL) { + if (bodyBreak->objectSlots != NULL) { Lib_MemSet((u8*)bodyBreak->matrices, matricesSize, 0); Lib_MemSet((u8*)bodyBreak->dLists, dListsSize, 0); - Lib_MemSet((u8*)bodyBreak->objectIds, objectIdsSize, 0); + Lib_MemSet((u8*)bodyBreak->objectSlots, objectSlotsSize, 0); bodyBreak->val = 1; return; } @@ -3186,20 +3186,20 @@ void BodyBreak_Alloc(BodyBreak* bodyBreak, s32 count, PlayState* play) { ZeldaArena_FreeDebug(bodyBreak->dLists, "../z_actor.c", 7561); } - if (bodyBreak->objectIds != NULL) { - ZeldaArena_FreeDebug(bodyBreak->objectIds, "../z_actor.c", 7564); + if (bodyBreak->objectSlots != NULL) { + ZeldaArena_FreeDebug(bodyBreak->objectSlots, "../z_actor.c", 7564); } } void BodyBreak_SetInfo(BodyBreak* bodyBreak, s32 limbIndex, s32 minLimbIndex, s32 maxLimbIndex, u32 count, Gfx** dList, - s16 objectId) { + s16 objectSlot) { PlayState* play = Effect_GetPlayState(); if ((play->actorCtx.freezeFlashTimer == 0) && (bodyBreak->val > 0)) { if ((limbIndex >= minLimbIndex) && (limbIndex <= maxLimbIndex) && (*dList != NULL)) { bodyBreak->dLists[bodyBreak->val] = *dList; Matrix_Get(&bodyBreak->matrices[bodyBreak->val]); - bodyBreak->objectIds[bodyBreak->val] = objectId; + bodyBreak->objectSlots[bodyBreak->val] = objectSlot; bodyBreak->val++; } @@ -3219,7 +3219,7 @@ void BodyBreak_SetInfo(BodyBreak* bodyBreak, s32 limbIndex, s32 minLimbIndex, s3 s32 BodyBreak_SpawnParts(Actor* actor, BodyBreak* bodyBreak, PlayState* play, s16 type) { EnPart* spawnedEnPart; MtxF* mtx; - s16 objBankIndex; + s16 objectSlot; if (bodyBreak->val != BODYBREAK_STATUS_READY) { return false; @@ -3231,17 +3231,17 @@ s32 BodyBreak_SpawnParts(Actor* actor, BodyBreak* bodyBreak, PlayState* play, s1 Matrix_Get(&bodyBreak->matrices[bodyBreak->count]); if (1) { - if (bodyBreak->objectIds[bodyBreak->count] >= 0) { - objBankIndex = bodyBreak->objectIds[bodyBreak->count]; + if (bodyBreak->objectSlots[bodyBreak->count] > BODYBREAK_OBJECT_SLOT_DEFAULT) { + objectSlot = bodyBreak->objectSlots[bodyBreak->count]; } else { - objBankIndex = actor->objBankIndex; + objectSlot = actor->objectSlot; } } mtx = &bodyBreak->matrices[bodyBreak->count]; spawnedEnPart = (EnPart*)Actor_SpawnAsChild(&play->actorCtx, actor, play, ACTOR_EN_PART, mtx->xw, mtx->yw, - mtx->zw, 0, 0, objBankIndex, type); + mtx->zw, 0, 0, objectSlot, type); if (spawnedEnPart != NULL) { Matrix_MtxFToYXZRotS(&bodyBreak->matrices[bodyBreak->count], &spawnedEnPart->actor.shape.rot, 0); @@ -3256,7 +3256,7 @@ s32 BodyBreak_SpawnParts(Actor* actor, BodyBreak* bodyBreak, PlayState* play, s1 ZeldaArena_FreeDebug(bodyBreak->matrices, "../z_actor.c", 7678); ZeldaArena_FreeDebug(bodyBreak->dLists, "../z_actor.c", 7679); - ZeldaArena_FreeDebug(bodyBreak->objectIds, "../z_actor.c", 7680); + ZeldaArena_FreeDebug(bodyBreak->objectSlots, "../z_actor.c", 7680); return true; } @@ -4329,7 +4329,7 @@ Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3, EnPart* spawnedEnPart; spawnedEnPart = (EnPart*)Actor_SpawnAsChild(&play->actorCtx, actor, play, ACTOR_EN_PART, spawnPos->x, spawnPos->y, - spawnPos->z, spawnRot->x, spawnRot->y, actor->objBankIndex, params); + spawnPos->z, spawnRot->x, spawnRot->y, actor->objectSlot, params); if (spawnedEnPart != NULL) { spawnedEnPart->actor.scale = actor->scale; spawnedEnPart->actor.speed = arg3[0]; diff --git a/src/code/z_effect_soft_sprite_old_init.c b/src/code/z_effect_soft_sprite_old_init.c index f2d7d0a541..253996b625 100644 --- a/src/code/z_effect_soft_sprite_old_init.c +++ b/src/code/z_effect_soft_sprite_old_init.c @@ -49,7 +49,7 @@ void EffectSs_DrawGEffect(PlayState* play, EffectSs* this, void* texture) { MtxF mfTransBillboard; s32 pad1; Mtx* mtx; - void* object = play->objectCtx.status[this->rgObjBankIdx].segment; + void* objectPtr = play->objectCtx.slots[this->rgObjectSlot].segment; OPEN_DISPS(gfxCtx, "../z_effect_soft_sprite_old_init.c", 196); @@ -58,8 +58,8 @@ void EffectSs_DrawGEffect(PlayState* play, EffectSs* this, void* texture) { SkinMatrix_SetScale(&mfScale, scale, scale, scale); SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTransBillboard); SkinMatrix_MtxFMtxFMult(&mfTransBillboard, &mfScale, &mfResult); - gSegments[6] = VIRTUAL_TO_PHYSICAL(object); - gSPSegment(POLY_XLU_DISP++, 0x06, object); + gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr); + gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr); mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &mfResult); diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 2755c05659..b7b9e79cd6 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -236,7 +236,7 @@ void EnItem00_Init(Actor* thisx, PlayState* play) { this->scale = 0.01f; break; case ITEM00_SHIELD_DEKU: - this->actor.objBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GI_SHIELD_1); + this->actor.objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GI_SHIELD_1); Actor_SetObjectDependency(play, &this->actor); Actor_SetScale(&this->actor, 0.5f); this->scale = 0.5f; @@ -245,7 +245,7 @@ void EnItem00_Init(Actor* thisx, PlayState* play) { this->actor.world.rot.x = 0x4000; break; case ITEM00_SHIELD_HYLIAN: - this->actor.objBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GI_SHIELD_2); + this->actor.objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GI_SHIELD_2); Actor_SetObjectDependency(play, &this->actor); Actor_SetScale(&this->actor, 0.5f); this->scale = 0.5f; @@ -255,7 +255,7 @@ void EnItem00_Init(Actor* thisx, PlayState* play) { break; case ITEM00_TUNIC_ZORA: case ITEM00_TUNIC_GORON: - this->actor.objBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GI_CLOTHES); + this->actor.objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GI_CLOTHES); Actor_SetObjectDependency(play, &this->actor); Actor_SetScale(&this->actor, 0.5f); this->scale = 0.5f; @@ -765,10 +765,10 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { case ITEM00_RECOVERY_HEART: if (this->despawnTimer < 0) { if (this->despawnTimer == -1) { - s8 bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GI_HEART); + s8 objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GI_HEART); - if (Object_IsLoaded(&play->objectCtx, bankIndex)) { - this->actor.objBankIndex = bankIndex; + if (Object_IsLoaded(&play->objectCtx, objectSlot)) { + this->actor.objectSlot = objectSlot; Actor_SetObjectDependency(play, &this->actor); this->despawnTimer = -2; } diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index 0cd66f64df..6fffcaf973 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -432,7 +432,7 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused) play->csCtx.actorCues[i] = NULL; } - if (Object_GetIndex(&play->objectCtx, OBJECT_GAMEPLAY_FIELD_KEEP) < 0 && !play->envCtx.sunMoonDisabled) { + if (Object_GetSlot(&play->objectCtx, OBJECT_GAMEPLAY_FIELD_KEEP) < 0 && !play->envCtx.sunMoonDisabled) { play->envCtx.sunMoonDisabled = true; // "Sun setting other than field keep! So forced release!" osSyncPrintf(VT_COL(YELLOW, BLACK) "\n\nフィールド常駐以外、太陽設定!よって強制解除!\n" VT_RST); diff --git a/src/code/z_play.c b/src/code/z_play.c index c4d8915484..2ece8f9708 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -482,8 +482,8 @@ void Play_Update(PlayState* this) { ActorOverlayTable_LogPrint(); } - gSegments[4] = VIRTUAL_TO_PHYSICAL(this->objectCtx.status[this->objectCtx.mainKeepIndex].segment); - gSegments[5] = VIRTUAL_TO_PHYSICAL(this->objectCtx.status[this->objectCtx.subKeepIndex].segment); + gSegments[4] = VIRTUAL_TO_PHYSICAL(this->objectCtx.slots[this->objectCtx.mainKeepSlot].segment); + gSegments[5] = VIRTUAL_TO_PHYSICAL(this->objectCtx.slots[this->objectCtx.subKeepSlot].segment); gSegments[2] = VIRTUAL_TO_PHYSICAL(this->sceneSegment); if (FrameAdvance_Update(&this->frameAdvCtx, &input[1])) { @@ -855,7 +855,7 @@ void Play_Update(PlayState* this) { AnimationContext_Reset(&this->animationCtx); PLAY_LOG(3561); - Object_UpdateBank(&this->objectCtx); + Object_UpdateEntries(&this->objectCtx); PLAY_LOG(3577); @@ -1035,21 +1035,21 @@ void Play_Draw(PlayState* this) { OPEN_DISPS(gfxCtx, "../z_play.c", 3907); - gSegments[4] = VIRTUAL_TO_PHYSICAL(this->objectCtx.status[this->objectCtx.mainKeepIndex].segment); - gSegments[5] = VIRTUAL_TO_PHYSICAL(this->objectCtx.status[this->objectCtx.subKeepIndex].segment); + gSegments[4] = VIRTUAL_TO_PHYSICAL(this->objectCtx.slots[this->objectCtx.mainKeepSlot].segment); + gSegments[5] = VIRTUAL_TO_PHYSICAL(this->objectCtx.slots[this->objectCtx.subKeepSlot].segment); gSegments[2] = VIRTUAL_TO_PHYSICAL(this->sceneSegment); gSPSegment(POLY_OPA_DISP++, 0x00, NULL); gSPSegment(POLY_XLU_DISP++, 0x00, NULL); gSPSegment(OVERLAY_DISP++, 0x00, NULL); - gSPSegment(POLY_OPA_DISP++, 0x04, this->objectCtx.status[this->objectCtx.mainKeepIndex].segment); - gSPSegment(POLY_XLU_DISP++, 0x04, this->objectCtx.status[this->objectCtx.mainKeepIndex].segment); - gSPSegment(OVERLAY_DISP++, 0x04, this->objectCtx.status[this->objectCtx.mainKeepIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x04, this->objectCtx.slots[this->objectCtx.mainKeepSlot].segment); + gSPSegment(POLY_XLU_DISP++, 0x04, this->objectCtx.slots[this->objectCtx.mainKeepSlot].segment); + gSPSegment(OVERLAY_DISP++, 0x04, this->objectCtx.slots[this->objectCtx.mainKeepSlot].segment); - gSPSegment(POLY_OPA_DISP++, 0x05, this->objectCtx.status[this->objectCtx.subKeepIndex].segment); - gSPSegment(POLY_XLU_DISP++, 0x05, this->objectCtx.status[this->objectCtx.subKeepIndex].segment); - gSPSegment(OVERLAY_DISP++, 0x05, this->objectCtx.status[this->objectCtx.subKeepIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x05, this->objectCtx.slots[this->objectCtx.subKeepSlot].segment); + gSPSegment(POLY_XLU_DISP++, 0x05, this->objectCtx.slots[this->objectCtx.subKeepSlot].segment); + gSPSegment(OVERLAY_DISP++, 0x05, this->objectCtx.slots[this->objectCtx.subKeepSlot].segment); gSPSegment(POLY_OPA_DISP++, 0x02, this->sceneSegment); gSPSegment(POLY_XLU_DISP++, 0x02, this->sceneSegment); @@ -1434,7 +1434,7 @@ void Play_InitScene(PlayState* this, s32 spawn) { this->numActorEntries = 0; - Object_InitBank(this, &this->objectCtx); + Object_InitContext(this, &this->objectCtx); LightContext_Init(this, &this->lightCtx); TransitionActor_InitContext(&this->state, &this->transiActorCtx); func_80096FD4(this, &this->roomCtx.curRoom); diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index ad90fed5a0..57fdfd532c 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -1370,7 +1370,7 @@ void Player_DrawHookshotReticle(PlayState* play, Player* this, f32 arg2) { gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_player_lib.c", 2587), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPSegment(OVERLAY_DISP++, 0x06, play->objectCtx.status[this->actor.objBankIndex].segment); + gSPSegment(OVERLAY_DISP++, 0x06, play->objectCtx.slots[this->actor.objectSlot].segment); gSPDisplayList(OVERLAY_DISP++, gLinkAdultHookshotReticleDL); CLOSE_DISPS(play->state.gfxCtx, "../z_player_lib.c", 2592); diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 7de8b3a226..72d77af174 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -3,64 +3,77 @@ RomFile sNaviQuestHintFiles[]; -s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId) { +/** + * Spawn an object file of a specified ID that will persist through room changes. + * + * This waits for the file to be fully loaded, the data is available when the function returns. + * + * @return The new object slot corresponding to the requested object ID. + * + * @note This function is not meant to be called externally to spawn object files on the fly. + * When an object is spawned with this function, all objects that come before it in the entry list will be treated as + * persistent, which will likely cause either the amount of free slots or object space memory to run out. + * This function is only meant to be called internally on scene load, before the object list from any room is processed. + */ +s32 Object_SpawnPersistent(ObjectContext* objectCtx, s16 objectId) { u32 size; - objectCtx->status[objectCtx->num].id = objectId; + objectCtx->slots[objectCtx->numEntries].id = objectId; size = gObjectTable[objectId].vromEnd - gObjectTable[objectId].vromStart; - osSyncPrintf("OBJECT[%d] SIZE %fK SEG=%x\n", objectId, size / 1024.0f, objectCtx->status[objectCtx->num].segment); + osSyncPrintf("OBJECT[%d] SIZE %fK SEG=%x\n", objectId, size / 1024.0f, + objectCtx->slots[objectCtx->numEntries].segment); - osSyncPrintf("num=%d adrs=%x end=%x\n", objectCtx->num, (uintptr_t)objectCtx->status[objectCtx->num].segment + size, - objectCtx->spaceEnd); + osSyncPrintf("num=%d adrs=%x end=%x\n", objectCtx->numEntries, + (uintptr_t)objectCtx->slots[objectCtx->numEntries].segment + size, objectCtx->spaceEnd); - ASSERT(((objectCtx->num < OBJECT_EXCHANGE_BANK_MAX) && - (((uintptr_t)objectCtx->status[objectCtx->num].segment + size) < (uintptr_t)objectCtx->spaceEnd)), + ASSERT(((objectCtx->numEntries < ARRAY_COUNT(objectCtx->slots)) && + (((uintptr_t)objectCtx->slots[objectCtx->numEntries].segment + size) < (uintptr_t)objectCtx->spaceEnd)), "this->num < OBJECT_EXCHANGE_BANK_MAX && (this->status[this->num].Segment + size) < this->endSegment", "../z_scene.c", 142); - DmaMgr_RequestSyncDebug(objectCtx->status[objectCtx->num].segment, gObjectTable[objectId].vromStart, size, + DmaMgr_RequestSyncDebug(objectCtx->slots[objectCtx->numEntries].segment, gObjectTable[objectId].vromStart, size, "../z_scene.c", 145); - if (objectCtx->num < OBJECT_EXCHANGE_BANK_MAX - 1) { - objectCtx->status[objectCtx->num + 1].segment = - (void*)ALIGN16((uintptr_t)objectCtx->status[objectCtx->num].segment + size); + if (objectCtx->numEntries < (ARRAY_COUNT(objectCtx->slots) - 1)) { + objectCtx->slots[objectCtx->numEntries + 1].segment = + (void*)ALIGN16((uintptr_t)objectCtx->slots[objectCtx->numEntries].segment + size); } - objectCtx->num++; - objectCtx->unk_09 = objectCtx->num; + objectCtx->numEntries++; + objectCtx->numPersistentEntries = objectCtx->numEntries; - return objectCtx->num - 1; + return objectCtx->numEntries - 1; } -void Object_InitBank(PlayState* play, ObjectContext* objectCtx) { - PlayState* play2 = play; // Needs to be a new variable to match (possibly a sub struct?) +void Object_InitContext(PlayState* play, ObjectContext* objectCtx) { + PlayState* play2 = play; u32 spaceSize; s32 i; if (play2->sceneId == SCENE_HYRULE_FIELD) { - spaceSize = 1024000; + spaceSize = 1000 * 1024; } else if (play2->sceneId == SCENE_GANON_BOSS) { if (gSaveContext.sceneLayer != 4) { - spaceSize = 1177600; + spaceSize = 1150 * 1024; } else { - spaceSize = 1024000; + spaceSize = 1000 * 1024; } } else if (play2->sceneId == SCENE_SPIRIT_TEMPLE_BOSS) { - spaceSize = 1075200; + spaceSize = 1050 * 1024; } else if (play2->sceneId == SCENE_CHAMBER_OF_THE_SAGES) { - spaceSize = 1075200; + spaceSize = 1050 * 1024; } else if (play2->sceneId == SCENE_GANONDORF_BOSS) { - spaceSize = 1075200; + spaceSize = 1050 * 1024; } else { - spaceSize = 1024000; + spaceSize = 1000 * 1024; } - objectCtx->num = objectCtx->unk_09 = 0; - objectCtx->mainKeepIndex = objectCtx->subKeepIndex = 0; + objectCtx->numEntries = objectCtx->numPersistentEntries = 0; + objectCtx->mainKeepSlot = objectCtx->subKeepSlot = 0; - for (i = 0; i < OBJECT_EXCHANGE_BANK_MAX; i++) { - objectCtx->status[i].id = OBJECT_INVALID; + for (i = 0; i < ARRAY_COUNT(objectCtx->slots); i++) { + objectCtx->slots[i].id = OBJECT_INVALID; } osSyncPrintf(VT_FGCOL(GREEN)); @@ -68,42 +81,43 @@ void Object_InitBank(PlayState* play, ObjectContext* objectCtx) { osSyncPrintf("オブジェクト入れ替えバンク情報 %8.3fKB\n", spaceSize / 1024.0f); osSyncPrintf(VT_RST); - objectCtx->spaceStart = objectCtx->status[0].segment = - GameState_Alloc(&play->state, spaceSize, "../z_scene.c", 219); + objectCtx->spaceStart = objectCtx->slots[0].segment = GameState_Alloc(&play->state, spaceSize, "../z_scene.c", 219); objectCtx->spaceEnd = (void*)((uintptr_t)objectCtx->spaceStart + spaceSize); - objectCtx->mainKeepIndex = Object_Spawn(objectCtx, OBJECT_GAMEPLAY_KEEP); - gSegments[4] = VIRTUAL_TO_PHYSICAL(objectCtx->status[objectCtx->mainKeepIndex].segment); + objectCtx->mainKeepSlot = Object_SpawnPersistent(objectCtx, OBJECT_GAMEPLAY_KEEP); + gSegments[4] = VIRTUAL_TO_PHYSICAL(objectCtx->slots[objectCtx->mainKeepSlot].segment); } -void Object_UpdateBank(ObjectContext* objectCtx) { +void Object_UpdateEntries(ObjectContext* objectCtx) { s32 i; - ObjectStatus* status = &objectCtx->status[0]; + ObjectEntry* entry = &objectCtx->slots[0]; RomFile* objectFile; u32 size; - for (i = 0; i < objectCtx->num; i++) { - if (status->id < 0) { - if (status->dmaRequest.vromAddr == 0) { - osCreateMesgQueue(&status->loadQueue, &status->loadMsg, 1); - objectFile = &gObjectTable[-status->id]; + for (i = 0; i < objectCtx->numEntries; i++) { + if (entry->id < 0) { + if (entry->dmaRequest.vromAddr == 0) { + osCreateMesgQueue(&entry->loadQueue, &entry->loadMsg, 1); + objectFile = &gObjectTable[-entry->id]; size = objectFile->vromEnd - objectFile->vromStart; - osSyncPrintf("OBJECT EXCHANGE BANK-%2d SIZE %8.3fK SEG=%08x\n", i, size / 1024.0f, status->segment); - DmaMgr_RequestAsync(&status->dmaRequest, status->segment, objectFile->vromStart, size, 0, - &status->loadQueue, NULL, "../z_scene.c", 266); - } else if (osRecvMesg(&status->loadQueue, NULL, OS_MESG_NOBLOCK) == 0) { - status->id = -status->id; + + osSyncPrintf("OBJECT EXCHANGE BANK-%2d SIZE %8.3fK SEG=%08x\n", i, size / 1024.0f, entry->segment); + + DmaMgr_RequestAsync(&entry->dmaRequest, entry->segment, objectFile->vromStart, size, 0, + &entry->loadQueue, NULL, "../z_scene.c", 266); + } else if (osRecvMesg(&entry->loadQueue, NULL, OS_MESG_NOBLOCK) == 0) { + entry->id = -entry->id; } } - status++; + entry++; } } -s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId) { +s32 Object_GetSlot(ObjectContext* objectCtx, s16 objectId) { s32 i; - for (i = 0; i < objectCtx->num; i++) { - if (ABS(objectCtx->status[i].id) == objectId) { + for (i = 0; i < objectCtx->numEntries; i++) { + if (ABS(objectCtx->slots[i].id) == objectId) { return i; } } @@ -111,8 +125,8 @@ s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId) { return -1; } -s32 Object_IsLoaded(ObjectContext* objectCtx, s32 bankIndex) { - if (objectCtx->status[bankIndex].id > 0) { +s32 Object_IsLoaded(ObjectContext* objectCtx, s32 slot) { + if (objectCtx->slots[slot].id > 0) { return true; } else { return false; @@ -124,30 +138,30 @@ void func_800981B8(ObjectContext* objectCtx) { s32 id; u32 size; - for (i = 0; i < objectCtx->num; i++) { - id = objectCtx->status[i].id; + for (i = 0; i < objectCtx->numEntries; i++) { + id = objectCtx->slots[i].id; size = gObjectTable[id].vromEnd - gObjectTable[id].vromStart; - osSyncPrintf("OBJECT[%d] SIZE %fK SEG=%x\n", objectCtx->status[i].id, size / 1024.0f, - objectCtx->status[i].segment); - osSyncPrintf("num=%d adrs=%x end=%x\n", objectCtx->num, (uintptr_t)objectCtx->status[i].segment + size, + osSyncPrintf("OBJECT[%d] SIZE %fK SEG=%x\n", objectCtx->slots[i].id, size / 1024.0f, + objectCtx->slots[i].segment); + osSyncPrintf("num=%d adrs=%x end=%x\n", objectCtx->numEntries, (uintptr_t)objectCtx->slots[i].segment + size, objectCtx->spaceEnd); - DmaMgr_RequestSyncDebug(objectCtx->status[i].segment, gObjectTable[id].vromStart, size, "../z_scene.c", 342); + DmaMgr_RequestSyncDebug(objectCtx->slots[i].segment, gObjectTable[id].vromStart, size, "../z_scene.c", 342); } } -void* func_800982FC(ObjectContext* objectCtx, s32 bankIndex, s16 objectId) { - ObjectStatus* status = &objectCtx->status[bankIndex]; +void* func_800982FC(ObjectContext* objectCtx, s32 slot, s16 objectId) { + ObjectEntry* entry = &objectCtx->slots[slot]; RomFile* objectFile = &gObjectTable[objectId]; u32 size; void* nextPtr; - status->id = -objectId; - status->dmaRequest.vromAddr = 0; + entry->id = -objectId; + entry->dmaRequest.vromAddr = 0; size = objectFile->vromEnd - objectFile->vromStart; - osSyncPrintf("OBJECT EXCHANGE NO=%2d BANK=%3d SIZE=%8.3fK\n", bankIndex, objectId, size / 1024.0f); + osSyncPrintf("OBJECT EXCHANGE NO=%2d BANK=%3d SIZE=%8.3fK\n", slot, objectId, size / 1024.0f); - nextPtr = (void*)ALIGN16((uintptr_t)status->segment + size); + nextPtr = (void*)ALIGN16((uintptr_t)entry->segment + size); ASSERT(nextPtr < objectCtx->spaceEnd, "nextptr < this->endSegment", "../z_scene.c", 381); @@ -191,7 +205,7 @@ void Scene_CommandPlayerEntryList(PlayState* play, SceneCmd* cmd) { linkObjectId = gLinkObjectIds[((void)0, gSaveContext.save.linkAge)]; gActorOverlayTable[playerEntry->id].initInfo->objectId = linkObjectId; - Object_Spawn(&play->objectCtx, linkObjectId); + Object_SpawnPersistent(&play->objectCtx, linkObjectId); } void Scene_CommandActorEntryList(PlayState* play, SceneCmd* cmd) { @@ -226,8 +240,8 @@ void Scene_CommandSpawnList(PlayState* play, SceneCmd* cmd) { void Scene_CommandSpecialFiles(PlayState* play, SceneCmd* cmd) { if (cmd->specialFiles.keepObjectId != OBJECT_INVALID) { - play->objectCtx.subKeepIndex = Object_Spawn(&play->objectCtx, cmd->specialFiles.keepObjectId); - gSegments[5] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[play->objectCtx.subKeepIndex].segment); + play->objectCtx.subKeepSlot = Object_SpawnPersistent(&play->objectCtx, cmd->specialFiles.keepObjectId); + gSegments[5] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[play->objectCtx.subKeepSlot].segment); } if (cmd->specialFiles.naviQuestHintFileId != NAVI_QUEST_HINTS_NONE) { @@ -250,25 +264,27 @@ void Scene_CommandObjectList(PlayState* play, SceneCmd* cmd) { s32 i; s32 j; s32 k; - ObjectStatus* status; - ObjectStatus* status2; - ObjectStatus* firstStatus; - s16* objectEntry = SEGMENTED_TO_VIRTUAL(cmd->objectList.data); + ObjectEntry* entry; + ObjectEntry* invalidatedEntry; + ObjectEntry* entries; + s16* objectListEntry = SEGMENTED_TO_VIRTUAL(cmd->objectList.data); void* nextPtr; k = 0; - i = play->objectCtx.unk_09; - firstStatus = &play->objectCtx.status[0]; - status = &play->objectCtx.status[i]; + i = play->objectCtx.numPersistentEntries; + entries = play->objectCtx.slots; + entry = &play->objectCtx.slots[i]; - while (i < play->objectCtx.num) { - if (status->id != *objectEntry) { - status2 = &play->objectCtx.status[i]; - for (j = i; j < play->objectCtx.num; j++) { - status2->id = OBJECT_INVALID; - status2++; + while (i < play->objectCtx.numEntries) { + if (entry->id != *objectListEntry) { + + invalidatedEntry = &play->objectCtx.slots[i]; + for (j = i; j < play->objectCtx.numEntries; j++) { + invalidatedEntry->id = OBJECT_INVALID; + invalidatedEntry++; } - play->objectCtx.num = i; + + play->objectCtx.numEntries = i; Actor_KillAllWithMissingObject(play, &play->actorCtx); continue; @@ -276,24 +292,24 @@ void Scene_CommandObjectList(PlayState* play, SceneCmd* cmd) { i++; k++; - objectEntry++; - status++; + objectListEntry++; + entry++; } - ASSERT(cmd->objectList.length <= OBJECT_EXCHANGE_BANK_MAX, + ASSERT(cmd->objectList.length <= ARRAY_COUNT(play->objectCtx.slots), "scene_info->object_bank.num <= OBJECT_EXCHANGE_BANK_MAX", "../z_scene.c", 705); while (k < cmd->objectList.length) { - nextPtr = func_800982FC(&play->objectCtx, i, *objectEntry); - if (i < OBJECT_EXCHANGE_BANK_MAX - 1) { - firstStatus[i + 1].segment = nextPtr; + nextPtr = func_800982FC(&play->objectCtx, i, *objectListEntry); + if (i < (ARRAY_COUNT(play->objectCtx.slots) - 1)) { + entries[i + 1].segment = nextPtr; } i++; k++; - objectEntry++; + objectListEntry++; } - play->objectCtx.num = i; + play->objectCtx.numEntries = i; } void Scene_CommandLightList(PlayState* play, SceneCmd* cmd) { diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index bf72c4ce4d..45ab8be192 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -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; diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h index 022a439f29..6880026c2a 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h @@ -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 diff --git a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c index 2c1b5ca9b4..e734780de7 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c +++ b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c @@ -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) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.h b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.h index 9de05508fc..e82c0a97c6 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.h +++ b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.h @@ -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 diff --git a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c index 9e76939f4c..9dcf1f52c7 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c +++ b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c @@ -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; diff --git a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h index 6f140a39c3..d13418053e 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h +++ b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h @@ -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]; diff --git a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c index 4286c35b35..bccdea961a 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c +++ b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c @@ -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) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h index b5fe2a2fd3..6eb5ddcaea 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h +++ b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h @@ -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; diff --git a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c index 87376ca9d1..a5ca45520b 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c @@ -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); diff --git a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h index 298d956927..90647a7a8a 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h +++ b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h @@ -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 diff --git a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c index a7ea7b0b5e..5f13fd87a8 100644 --- a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c +++ b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c @@ -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)); diff --git a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h index 415625574c..03e18fbb76 100644 --- a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h +++ b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h @@ -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 diff --git a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c index 9f10928f17..5e27a7fc01 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c +++ b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c @@ -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); diff --git a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h index c2a97444e0..c71eac7ab1 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h +++ b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h @@ -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 diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c index 146c9d2fcc..1fbbe33c8d 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c +++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c @@ -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); diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h index a981c71dd9..e7bcc5018e 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h +++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h @@ -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 diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c index aecc6935ee..cc6d15db24 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c @@ -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); diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h index fc5d99cc34..5e957f4035 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h +++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h @@ -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 { diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c index d43569075e..a44854df67 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c @@ -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); diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h index 797688bdb1..a36a6ef36b 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h +++ b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h @@ -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 diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c index 79fbaaa3d0..43f17618f9 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c @@ -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); diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h index e42c23a438..8d4323e630 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h @@ -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 diff --git a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c index ea22541703..40735aab0e 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c +++ b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c @@ -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); diff --git a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h index d2e6f173a0..3e7036ec4b 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h +++ b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h @@ -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 diff --git a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c index 07276e6e61..c3c4c391cf 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c +++ b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c @@ -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); diff --git a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h index 05272c6f20..7bd6939d3f 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h +++ b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h @@ -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 diff --git a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c index 1ec1cc9a5d..f737bdfbcd 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c @@ -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); diff --git a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h index b263892f08..97bdbc0bfd 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h +++ b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h @@ -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 diff --git a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c index 4fec9780c2..4b723b5515 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c @@ -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) { diff --git a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h index 1da5f4f3f3..d1d96d045b 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h +++ b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h @@ -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 diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index 10d1059998..5064684c3e 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -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); } diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h index 499b01031a..01fb4cc3e0 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h @@ -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 diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index 32c4cbd2c9..b9d7cb6170 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -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) { diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h index c1db637928..85bbc27f12 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h @@ -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; diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index 04c71324a1..4189fffdbd 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -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; diff --git a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index 463c45a737..106e44a15a 100644 --- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -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; } } diff --git a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c index 7bc4fee6a9..83f03c30e7 100644 --- a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c +++ b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c @@ -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; } diff --git a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h index 5d6a5367a0..09d9c175fb 100644 --- a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h +++ b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h @@ -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 diff --git a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c index 176ea5615a..fd63ace9f8 100644 --- a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c +++ b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c @@ -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); } diff --git a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h index a93a8589ac..fe71483505 100644 --- a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h +++ b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h @@ -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 diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index 7b6a93278d..3456f28f12 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -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; diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h index 8dea6944cf..2e7263e58c 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h @@ -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]; diff --git a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c index 6bfc52a268..6ce5d38aba 100644 --- a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c +++ b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c @@ -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); } } diff --git a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h index a21eb64a23..ca719594ad 100644 --- a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h +++ b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h @@ -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; diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index e677fd3508..7d392ba0ae 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -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; } } diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h index 89ad474b35..0103812c6f 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h @@ -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]; diff --git a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index bff036cc7a..9e4225ea9c 100644 --- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -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: diff --git a/src/overlays/actors/ovl_Door_Killer/z_door_killer.h b/src/overlays/actors/ovl_Door_Killer/z_door_killer.h index 37865805ea..1b32564504 100644 --- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.h +++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.h @@ -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]; diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index 750480a5e4..8cbe2cd2ef 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -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]; diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h index 4dd268ea84..3eb39148c2 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h @@ -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) diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index b7bafb238f..c431e53e68 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -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[] = { diff --git a/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/src/overlays/actors/ovl_En_Cs/z_en_cs.c index 8e5c500686..1268c94467 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -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); } } diff --git a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c index b1ddf03353..2645f01345 100644 --- a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c +++ b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h index 0b5c6f12ec..13974bb1b1 100644 --- a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h +++ b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index 2f92472621..c3216cdc80 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.h b/src/overlays/actors/ovl_En_Door/z_en_door.h index 05c41e16c0..58ff784ee5 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.h +++ b/src/overlays/actors/ovl_En_Door/z_en_door.h @@ -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]; diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c index d8a342d425..432534d3b5 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -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) { diff --git a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index bb0b388f5a..349632c02b 100644 --- a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h index b8e4d27126..6c6ff404a7 100644 --- a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h +++ b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c index 5958f28a18..d7e4830e40 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.h b/src/overlays/actors/ovl_En_Fr/z_en_fr.h index c5425e6b2a..530bb8f662 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.h +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.h @@ -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 diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c index c50826e472..347f0749a0 100644 --- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c +++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c @@ -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; } diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h index b79c6e4566..3631d11704 100644 --- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h +++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h @@ -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 diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index 6dee49a5a7..1a93d1a42d 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -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)) { diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h index 29d5d66822..65725c5c1e 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c index 4ce4f48371..9a22b0c509 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.h b/src/overlays/actors/ovl_En_Gm/z_en_gm.h index fd699d518d..3cfedca015 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.h +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Guest/z_en_guest.c b/src/overlays/actors/ovl_En_Guest/z_en_guest.c index 332638be11..e624d6720d 100644 --- a/src/overlays/actors/ovl_En_Guest/z_en_guest.c +++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Guest/z_en_guest.h b/src/overlays/actors/ovl_En_Guest/z_en_guest.h index 2835a6d8c5..6633f2741a 100644 --- a/src/overlays/actors/ovl_En_Guest/z_en_guest.h +++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.h @@ -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 diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index 33febb17ae..66e1679bfa 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -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); } } diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index cd87b114a8..3dd8a99fe9 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -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 { diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.h b/src/overlays/actors/ovl_En_Horse/z_en_horse.h index 5a2f47f1b0..785ddc8a9e 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.h +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c index e2d76dc0af..aa149275c2 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -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) { diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.h b/src/overlays/actors/ovl_En_Hy/z_en_hy.h index 086a4bf2e0..760ed9dfed 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.h +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index e1e9d5822c..3ef6332ef3 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -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), diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index 9b31fbc2ff..73698fd4aa 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -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)); diff --git a/src/overlays/actors/ovl_En_In/z_en_in.h b/src/overlays/actors/ovl_En_In/z_en_in.h index 2cf2668a44..57baa280d4 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.h +++ b/src/overlays/actors/ovl_En_In/z_en_in.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/src/overlays/actors/ovl_En_Ko/z_en_ko.c index d0f6538da2..a1be751edc 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.h b/src/overlays/actors/ovl_En_Ko/z_en_ko.h index 2828b067bd..a33ac3e38c 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.h +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index 48d8cefdc7..193725512a 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -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; } } diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h index 3a922ebce8..8c8423223c 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h @@ -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 diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/src/overlays/actors/ovl_En_Mag/z_en_mag.c index 164252b17b..30ccb46ab1 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index a37c364aa0..2245d1984e 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -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); } } diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index 0d66faf11a..313def7542 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -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--; diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h index f50f66494d..7ecb165cca 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index 5f553dd558..5df8760582 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h index 5a59e27d96..4dff4fa555 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h @@ -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 diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 79f00094fe..4e133aea45 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -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])); } diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h index 03538fbb6e..236e47e866 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/src/overlays/actors/ovl_En_Poh/z_en_poh.c index 62f3b6835c..d07b2cb355 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -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) { diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.h b/src/overlays/actors/ovl_En_Poh/z_en_poh.h index 8c57fd5126..1a44a60e81 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.h +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index 10831f79de..fb61fbf8c9 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -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) { diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index 89b99aace2..bac9333852 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -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); } } diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/src/overlays/actors/ovl_En_Sth/z_en_sth.c index dd3863f267..3e07652e54 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -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, diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.h b/src/overlays/actors/ovl_En_Sth/z_en_sth.h index dec16c4e1e..9408c542dd 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.h +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.c b/src/overlays/actors/ovl_En_Test/z_en_test.c index a51c4d133d..4717547c86 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -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]); diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index 2f5d32da8a..b43c735d4f 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -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) { diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c index 6c9d9b7241..9e3736d0f4 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c @@ -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); } diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h index c24e0ff838..fee5fe7620 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h @@ -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; diff --git a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c index cbc290de76..5af5e26df9 100644 --- a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c +++ b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h index 51a620c54a..c477ea57e1 100644 --- a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h +++ b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h @@ -35,7 +35,7 @@ typedef struct EnZl2 { /* 0x0258 */ char unk_258[0xC]; /* 0x0264 */ s32 overrideLimbDrawConfig; /* 0x0268 */ char unk_268[0xC]; - /* 0x0274 */ s32 unk_274; + /* 0x0274 */ s32 zl2Anime1ObjectSlot; /* 0x0278 */ f32 unk_278; /* 0x027C */ f32 unk_27C; } EnZl2; // size = 0x0280 diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index 517dbc58a2..3449464d0e 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -726,9 +726,9 @@ s32 func_80B54DD4(EnZl3* this) { } void func_80B54DE0(EnZl3* this, PlayState* play) { - s32 idx = this->unk_318; + s32 objectSlot = this->zl2Anime2ObjectSlot; - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[idx].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment); } void func_80B54E14(EnZl3* this, AnimationHeader* animation, u8 arg2, f32 morphFrames, s32 arg4) { @@ -2612,17 +2612,17 @@ void func_80B59B6C(EnZl3* this, PlayState* play) { void func_80B59DB8(EnZl3* this, PlayState* play) { s32 pad; - ObjectContext* objCtx = &play->objectCtx; - s32 objIndex = Object_GetIndex(objCtx, OBJECT_ZL2_ANIME2); + ObjectContext* objectCtx = &play->objectCtx; + s32 objectSlot = Object_GetSlot(objectCtx, OBJECT_ZL2_ANIME2); s32 pad2; - if (objIndex < 0) { + if (objectSlot < 0) { osSyncPrintf(VT_FGCOL(RED) "En_Zl3_main_bankアニメーションのバンクを読めない!!!!!!!!!!!!\n" VT_RST); return; } - if (Object_IsLoaded(objCtx, objIndex)) { - this->unk_318 = objIndex; + if (Object_IsLoaded(objectCtx, objectSlot)) { + this->zl2Anime2ObjectSlot = objectSlot; func_80B54DE0(this, play); func_80B59B6C(this, play); } diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.h b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.h index e7634ec6f4..25c336f42d 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.h +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.h @@ -36,7 +36,7 @@ typedef struct EnZl3 { /* 0x030C */ Path* unk_30C; /* 0x0310 */ s32 unk_310; /* 0x0314 */ s32 unk_314; - /* 0x0318 */ s32 unk_318; + /* 0x0318 */ s32 zl2Anime2ObjectSlot; /* 0x031C */ Vec3f unk_31C; /* 0x0328 */ s32 unk_328; /* 0x032C */ Vec3f unk_32C; diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index a59f8f4ec0..b3fa044e51 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -14,7 +14,7 @@ void ItemEtcetera_Update(Actor* thisx, PlayState* play); void ItemEtcetera_DrawThroughLens(Actor* thisx, PlayState* play); void ItemEtcetera_Draw(Actor* thisx, PlayState* play); -void func_80B857D0(ItemEtcetera* this, PlayState* play); +void ItemEtcetera_WaitForObject(ItemEtcetera* this, PlayState* play); void func_80B85824(ItemEtcetera* this, PlayState* play); void func_80B858B4(ItemEtcetera* this, PlayState* play); void ItemEtcetera_SpawnSparkles(ItemEtcetera* this, PlayState* play); @@ -94,23 +94,23 @@ void ItemEtcetera_Init(Actor* thisx, PlayState* play) { ItemEtcetera* this = (ItemEtcetera*)thisx; s32 pad; s32 type; - s32 objBankIndex; + s32 objectSlot; type = this->actor.params & 0xFF; osSyncPrintf("no = %d\n", type); - objBankIndex = Object_GetIndex(&play->objectCtx, sObjectIds[type]); - osSyncPrintf("bank_ID = %d\n", objBankIndex); - if (objBankIndex < 0) { + objectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[type]); + osSyncPrintf("bank_ID = %d\n", objectSlot); + if (objectSlot < 0) { ASSERT(0, "0", "../z_item_etcetera.c", 241); } else { - this->objBankIndex = objBankIndex; + this->requiredObjectSlot = objectSlot; } this->giDrawId = sDrawItemIndices[type]; this->getItemId = sGetItemIds[type]; this->futureActionFunc = func_80B85824; this->drawFunc = ItemEtcetera_Draw; Actor_SetScale(&this->actor, 0.25f); - ItemEtcetera_SetupAction(this, func_80B857D0); + ItemEtcetera_SetupAction(this, ItemEtcetera_WaitForObject); switch (type) { case ITEM_ETC_LETTER: Actor_SetScale(&this->actor, 0.5f); @@ -142,9 +142,9 @@ void ItemEtcetera_Init(Actor* thisx, PlayState* play) { void ItemEtcetera_Destroy(Actor* thisx, PlayState* play) { } -void func_80B857D0(ItemEtcetera* this, PlayState* play) { - if (Object_IsLoaded(&play->objectCtx, this->objBankIndex)) { - this->actor.objBankIndex = this->objBankIndex; +void ItemEtcetera_WaitForObject(ItemEtcetera* this, PlayState* play) { + if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) { + this->actor.objectSlot = this->requiredObjectSlot; this->actor.draw = this->drawFunc; this->actionFunc = this->futureActionFunc; } diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h index cb881828e5..a77192c797 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h @@ -13,7 +13,7 @@ typedef struct ItemEtcetera { /* 0x014C */ ItemEtceteraActionFunc futureActionFunc; /* 0x0150 */ s16 giDrawId; /* 0x0152 */ s16 getItemId; - /* 0x0154 */ u8 objBankIndex; + /* 0x0154 */ u8 requiredObjectSlot; /* 0x0158 */ ActorFunc drawFunc; /* 0x015C */ ItemEtceteraActionFunc actionFunc; } ItemEtcetera; // size = 0x0160 diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index d720145e2e..f6c7f80046 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -135,8 +135,8 @@ void ObjTsubo_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->actor); return; } - this->objTsuboBankIndex = Object_GetIndex(&play->objectCtx, sObjectIds[(this->actor.params >> 8) & 1]); - if (this->objTsuboBankIndex < 0) { + this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[(this->actor.params >> 8) & 1]); + if (this->requiredObjectSlot < 0) { osSyncPrintf("Error : バンク危険! (arg_data 0x%04x)(%s %d)\n", this->actor.params, "../z_obj_tsubo.c", 410); Actor_Kill(&this->actor); } else { @@ -221,9 +221,9 @@ void ObjTsubo_SetupWaitForObject(ObjTsubo* this) { } void ObjTsubo_WaitForObject(ObjTsubo* this, PlayState* play) { - if (Object_IsLoaded(&play->objectCtx, this->objTsuboBankIndex)) { + if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) { this->actor.draw = ObjTsubo_Draw; - this->actor.objBankIndex = this->objTsuboBankIndex; + this->actor.objectSlot = this->requiredObjectSlot; ObjTsubo_SetupIdle(this); this->actor.flags &= ~ACTOR_FLAG_4; } diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h index 62ea296f8b..aa30398c78 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h @@ -12,7 +12,7 @@ typedef struct ObjTsubo { /* 0x0000 */ Actor actor; /* 0x014C */ ObjTsuboActionFunc actionFunc; /* 0x0150 */ ColliderCylinder collider; - /* 0x019C */ s8 objTsuboBankIndex; + /* 0x019C */ s8 requiredObjectSlot; } ObjTsubo; // size = 0x01A0 #endif diff --git a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c index bb9e3d5e3c..48e1a1ebb0 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c @@ -776,21 +776,21 @@ void ObjectKankyo_DrawLightning(Actor* thisx, PlayState* play) { } void ObjectKankyo_SunGraveSparkInit(ObjectKankyo* this, PlayState* play) { - s32 objBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_SPOT02_OBJECTS); + s32 objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_SPOT02_OBJECTS); - if (objBankIndex < 0) { + if (objectSlot < 0) { ASSERT(0, "0", "../z_object_kankyo.c", 1251); } else { - this->requiredObjBankIndex = objBankIndex; + this->requiredObjectSlot = objectSlot; } ObjectKankyo_SetupAction(this, ObjectKankyo_WaitForSunGraveSparkObject); } void ObjectKankyo_WaitForSunGraveSparkObject(ObjectKankyo* this, PlayState* play) { - if (Object_IsLoaded(&play->objectCtx, this->requiredObjBankIndex)) { + if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) { this->requiredObjectLoaded = true; this->effects[0].alpha = 0; - this->actor.objBankIndex = this->requiredObjBankIndex; + this->actor.objectSlot = this->requiredObjectSlot; this->effects[0].size = 7.0f; ObjectKankyo_SetupAction(this, ObjectKankyo_SunGraveSpark); } @@ -875,20 +875,20 @@ void ObjectKankyo_DrawSunGraveSpark(Actor* thisx, PlayState* play2) { } void ObjectKankyo_InitBeams(ObjectKankyo* this, PlayState* play) { - s32 objectIndex = Object_GetIndex(&play->objectCtx, OBJECT_DEMO_KEKKAI); + s32 objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_DEMO_KEKKAI); if (objectIndex < 0) { ASSERT(0, "0", "../z_object_kankyo.c", 1449); } else { - this->requiredObjBankIndex = objectIndex; + this->requiredObjectSlot = objectIndex; } ObjectKankyo_SetupAction(this, ObjectKankyo_WaitForBeamObject); } void ObjectKankyo_WaitForBeamObject(ObjectKankyo* this, PlayState* play) { - if (Object_IsLoaded(&play->objectCtx, this->requiredObjBankIndex)) { + if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) { this->requiredObjectLoaded = true; - this->actor.objBankIndex = this->requiredObjBankIndex; + this->actor.objectSlot = this->requiredObjectSlot; ObjectKankyo_SetupAction(this, ObjectKankyo_Beams); } } diff --git a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h index 48a2c9d27e..4449fa013c 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h @@ -30,7 +30,7 @@ typedef struct ObjectKankyo { /* 0x0000 */ Actor actor; /* 0x014C */ ObjectKankyoEffect effects[64]; /* 0x164C */ Vec3f prevEyePos; - /* 0x1658 */ u8 requiredObjBankIndex; + /* 0x1658 */ u8 requiredObjectSlot; /* 0x1659 */ u8 requiredObjectLoaded; /* 0x165C */ ObjectKankyoActionFunc actionFunc; } ObjectKankyo; // size = 0x1660 diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 7519787dea..befd4adfbd 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -11061,7 +11061,7 @@ void Player_Update(Actor* thisx, PlayState* play) { if (func_8084FCAC(this, play)) { if (gSaveContext.dogParams < 0) { - if (Object_GetIndex(&play->objectCtx, OBJECT_DOG) < 0) { + if (Object_GetSlot(&play->objectCtx, OBJECT_DOG) < 0) { gSaveContext.dogParams = 0; } else { gSaveContext.dogParams &= 0x7FFF; diff --git a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c index b52bdfb796..1ba2d700ea 100644 --- a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c +++ b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c @@ -15,7 +15,7 @@ #define rPrimColorA regs[5] #define rFadeDelay regs[6] #define rScaleStep regs[9] -#define rObjBankIdx regs[10] +#define rObjectSlot regs[10] #define rYAccelStep regs[11] // has no effect due to how it's implemented u32 EffectSsDFire_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx); @@ -29,9 +29,9 @@ EffectSsInit Effect_Ss_D_Fire_InitVars = { u32 EffectSsDFire_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx) { EffectSsDFireInitParams* initParams = (EffectSsDFireInitParams*)initParamsx; - s32 objBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_DODONGO); + s32 objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_DODONGO); - if (objBankIndex >= 0) { + if (objectSlot >= 0) { this->pos = initParams->pos; this->velocity = initParams->velocity; this->accel = initParams->accel; @@ -45,7 +45,7 @@ u32 EffectSsDFire_Init(PlayState* play, u32 index, EffectSs* this, void* initPar this->rScale = initParams->scale; this->rScaleStep = initParams->scaleStep; this->rYAccelStep = 0; - this->rObjBankIdx = objBankIndex; + this->rObjectSlot = objectSlot; this->draw = EffectSsDFire_Draw; this->update = EffectSsDFire_Update; this->rTexIndex = ((s16)(play->state.frames % 4) ^ 3); @@ -70,17 +70,17 @@ void EffectSsDFire_Draw(PlayState* play, u32 index, EffectSs* this) { MtxF mfResult; MtxF mfTransBillboard; s32 pad; - void* object; + void* objectPtr; Mtx* mtx; f32 scale; - object = play->objectCtx.status[this->rObjBankIdx].segment; + objectPtr = play->objectCtx.slots[this->rObjectSlot].segment; OPEN_DISPS(gfxCtx, "../z_eff_ss_d_fire.c", 276); - if (Object_GetIndex(&play->objectCtx, OBJECT_DODONGO) > -1) { - gSegments[6] = VIRTUAL_TO_PHYSICAL(object); - gSPSegment(POLY_XLU_DISP++, 0x06, object); + if (Object_GetSlot(&play->objectCtx, OBJECT_DODONGO) >= 0) { + gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr); + gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr); scale = this->rScale / 100.0f; SkinMatrix_SetTranslate(&mfTrans, this->pos.x, this->pos.y, this->pos.z); SkinMatrix_SetScale(&mfScale, scale, scale, 1.0f); @@ -95,7 +95,7 @@ void EffectSsDFire_Draw(PlayState* play, u32 index, EffectSs* this) { gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB, this->rPrimColorA); - gSegments[6] = VIRTUAL_TO_PHYSICAL(object); + gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sTextures[this->rTexIndex])); gSPDisplayList(POLY_XLU_DISP++, this->gfx); } diff --git a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c index fc096037e1..b1e14efdec 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c +++ b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c @@ -7,7 +7,7 @@ #include "z_eff_ss_extra.h" #include "assets/objects/object_yabusame_point/object_yabusame_point.h" -#define rObjBankIdx regs[0] +#define rObjectSlot regs[0] #define rTimer regs[1] #define rScoreIdx regs[2] #define rScale regs[3] @@ -26,14 +26,14 @@ EffectSsInit Effect_Ss_Extra_InitVars = { u32 EffectSsExtra_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx) { EffectSsExtraInitParams* initParams = (EffectSsExtraInitParams*)initParamsx; s32 pad; - s32 objBankIndex; + s32 objectSlot; uintptr_t oldSeg6; - objBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_YABUSAME_POINT); + objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_YABUSAME_POINT); - if ((objBankIndex >= 0) && Object_IsLoaded(&play->objectCtx, objBankIndex)) { + if ((objectSlot >= 0) && Object_IsLoaded(&play->objectCtx, objectSlot)) { oldSeg6 = gSegments[6]; - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objBankIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment); this->pos = initParams->pos; this->velocity = initParams->velocity; this->accel = initParams->accel; @@ -43,7 +43,7 @@ u32 EffectSsExtra_Init(PlayState* play, u32 index, EffectSs* this, void* initPar this->rScoreIdx = initParams->scoreIdx; this->rScale = initParams->scale; this->rTimer = 5; - this->rObjBankIdx = objBankIndex; + this->rObjectSlot = objectSlot; gSegments[6] = oldSeg6; return 1; @@ -61,12 +61,12 @@ static void* sTextures[] = { void EffectSsExtra_Draw(PlayState* play, u32 index, EffectSs* this) { s32 pad; f32 scale = this->rScale / 100.0f; - void* object = play->objectCtx.status[this->rObjBankIdx].segment; + void* objectPtr = play->objectCtx.slots[this->rObjectSlot].segment; OPEN_DISPS(play->state.gfxCtx, "../z_eff_ss_extra.c", 168); - gSegments[6] = VIRTUAL_TO_PHYSICAL(object); - gSPSegment(POLY_XLU_DISP++, 0x06, object); + gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr); + gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr); Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); Gfx_SetupDL_25Xlu(play->state.gfxCtx); diff --git a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c index 29451fdb4d..96e789c794 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c +++ b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c @@ -9,7 +9,7 @@ #include "assets/objects/object_fhg/object_fhg.h" #define rAlpha regs[0] -#define rObjBankIdx regs[2] +#define rObjectSlot regs[2] #define rXZRot regs[3] #define rParam regs[4] #define rScale regs[8] @@ -32,18 +32,18 @@ static Gfx sShockDL[15]; u32 EffectSsFhgFlash_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx) { EffectSsFhgFlashInitParams* initParams = (EffectSsFhgFlashInitParams*)initParamsx; s32 pad; - s32 objBankIdx; + s32 objectSlot; Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; Vec3f farAwayVec = { 0.0f, -1000.0f, 0.0f }; - uintptr_t oldSeg6; + uintptr_t prevSeg6; if (initParams->type == FHGFLASH_LIGHTBALL) { - objBankIdx = Object_GetIndex(&play->objectCtx, OBJECT_FHG); + objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_FHG); - if ((objBankIdx > -1) && Object_IsLoaded(&play->objectCtx, objBankIdx)) { - oldSeg6 = gSegments[6]; - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objBankIdx].segment); - this->rObjBankIdx = objBankIdx; + if ((objectSlot >= 0) && Object_IsLoaded(&play->objectCtx, objectSlot)) { + prevSeg6 = gSegments[6]; + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment); + this->rObjectSlot = objectSlot; this->pos = initParams->pos; this->velocity = initParams->velocity; this->accel = initParams->accel; @@ -54,7 +54,7 @@ u32 EffectSsFhgFlash_Init(PlayState* play, u32 index, EffectSs* this, void* init this->draw = EffectSsFhgFlash_DrawLightBall; this->update = EffectSsFhgFlash_UpdateLightBall; this->gfx = SEGMENTED_TO_VIRTUAL(gPhantomEnergyBallDL); - gSegments[6] = oldSeg6; + gSegments[6] = prevSeg6; } else { osSyncPrintf("Effect_Ss_Fhg_Flash_ct():pffd->modeエラー\n"); return 0; @@ -89,17 +89,17 @@ void EffectSsFhgFlash_DrawLightBall(PlayState* play, u32 index, EffectSs* this) GraphicsContext* gfxCtx = play->state.gfxCtx; s32 pad; f32 scale; - void* object; + void* objectPtr; scale = this->rScale / 100.0f; - object = play->objectCtx.status[this->rObjBankIdx].segment; + objectPtr = play->objectCtx.slots[this->rObjectSlot].segment; OPEN_DISPS(gfxCtx, "../z_eff_fhg_flash.c", 268); Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSegments[6] = VIRTUAL_TO_PHYSICAL(object); - gSPSegment(POLY_XLU_DISP++, 0x06, object); + gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr); + gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr); Gfx_SetupDL_25Xlu(play->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, this->rAlpha); gDPSetEnvColor(POLY_XLU_DISP++, sLightBallColors[this->rParam].r, sLightBallColors[this->rParam].g, diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.c b/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.c index b7cda8ceda..244e9791bd 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.c @@ -17,7 +17,7 @@ #define rTimer regs[7] #define rUpdateRate regs[8] #define rDrawMode regs[9] -#define rObjBankIdx regs[10] +#define rObjectSlot regs[10] #define rScale regs[11] u32 EffectSsGMagma2_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx); @@ -38,15 +38,15 @@ EffectSsInit Effect_Ss_G_Magma2_InitVars = { }; u32 EffectSsGMagma2_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx) { - s32 objBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_KINGDODONGO); + s32 objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_KINGDODONGO); s32 pad; - if ((objBankIndex >= 0) && Object_IsLoaded(&play->objectCtx, objBankIndex)) { + if ((objectSlot >= 0) && Object_IsLoaded(&play->objectCtx, objectSlot)) { Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; EffectSsGMagma2InitParams* initParams = (EffectSsGMagma2InitParams*)initParamsx; - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objBankIndex].segment); - this->rObjBankIdx = objBankIndex; + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment); + this->rObjectSlot = objectSlot; this->pos = initParams->pos; this->velocity = zeroVec; this->accel = zeroVec; @@ -75,17 +75,17 @@ void EffectSsGMagma2_Draw(PlayState* play, u32 index, EffectSs* this) { GraphicsContext* gfxCtx = play->state.gfxCtx; s32 pad; f32 scale; - void* object; + void* objectPtr; scale = this->rScale / 100.0f; - object = play->objectCtx.status[this->rObjBankIdx].segment; + objectPtr = play->objectCtx.slots[this->rObjectSlot].segment; OPEN_DISPS(gfxCtx, "../z_eff_ss_g_magma2.c", 261); Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - gSegments[6] = VIRTUAL_TO_PHYSICAL(object); - gSPSegment(POLY_XLU_DISP++, 0x06, object); + gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr); + gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_ss_g_magma2.c", 282), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c b/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c index 3315b5c0a6..fe65984f59 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c @@ -7,7 +7,7 @@ #include "z_eff_ss_g_splash.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" -//! @bug the reuse of regs[11] means that EffectSs_DrawGEffect will treat the type as an object bank index +//! @bug the reuse of regs[11] means that EffectSs_DrawGEffect will treat the type as an object slot (`rgObjectSlot`) // this ends up having no effect because the texture provided does not use segment 6 #define rType regs[11] diff --git a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c index a07d924829..951ab24065 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c +++ b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c @@ -12,7 +12,7 @@ #define rUnused regs[2] #define rScale regs[3] #define rObjId regs[4] -#define rObjBankIdx regs[5] +#define rObjectSlot regs[5] #define rMinLife regs[6] u32 EffectSsHahen_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx); @@ -26,8 +26,8 @@ EffectSsInit Effect_Ss_Hahen_InitVars = { }; void EffectSsHahen_CheckForObject(EffectSs* this, PlayState* play) { - if (((this->rObjBankIdx = Object_GetIndex(&play->objectCtx, this->rObjId)) < 0) || - !Object_IsLoaded(&play->objectCtx, this->rObjBankIdx)) { + if (((this->rObjectSlot = Object_GetSlot(&play->objectCtx, this->rObjId)) < 0) || + !Object_IsLoaded(&play->objectCtx, this->rObjectSlot)) { this->life = -1; this->draw = NULL; } @@ -74,7 +74,7 @@ void EffectSsHahen_Draw(PlayState* play, u32 index, EffectSs* this) { OPEN_DISPS(gfxCtx, "../z_eff_hahen.c", 208); if (this->rObjId != -1) { - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->rObjBankIdx].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->rObjectSlot].segment); } Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW); @@ -98,7 +98,7 @@ void EffectSsHahen_DrawGray(PlayState* play, u32 index, EffectSs* this) { OPEN_DISPS(gfxCtx, "../z_eff_hahen.c", 253); if (this->rObjId != -1) { - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->rObjBankIdx].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->rObjectSlot].segment); } Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW); diff --git a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c index b9693e1ece..8301fee44d 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c +++ b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c @@ -7,7 +7,7 @@ #include "z_eff_ss_ice_smoke.h" #include "assets/objects/object_fz/object_fz.h" -#define rObjBankIdx regs[0] +#define rObjectSlot regs[0] #define rAlpha regs[1] #define rScale regs[2] @@ -23,24 +23,24 @@ EffectSsInit Effect_Ss_Ice_Smoke_InitVars = { u32 EffectSsIceSmoke_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx) { EffectSsIceSmokeInitParams* initParams = (EffectSsIceSmokeInitParams*)initParamsx; s32 pad; - s32 objBankIdx; - uintptr_t oldSeg6; + s32 objectSlot; + uintptr_t prevSeg6; - objBankIdx = Object_GetIndex(&play->objectCtx, OBJECT_FZ); + objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_FZ); - if ((objBankIdx > -1) && Object_IsLoaded(&play->objectCtx, objBankIdx)) { - oldSeg6 = gSegments[6]; - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objBankIdx].segment); + if ((objectSlot >= 0) && Object_IsLoaded(&play->objectCtx, objectSlot)) { + prevSeg6 = gSegments[6]; + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment); Math_Vec3f_Copy(&this->pos, &initParams->pos); Math_Vec3f_Copy(&this->velocity, &initParams->velocity); Math_Vec3f_Copy(&this->accel, &initParams->accel); - this->rObjBankIdx = objBankIdx; + this->rObjectSlot = objectSlot; this->rAlpha = 0; this->rScale = initParams->scale; this->life = 50; this->draw = EffectSsIceSmoke_Draw; this->update = EffectSsIceSmoke_Update; - gSegments[6] = oldSeg6; + gSegments[6] = prevSeg6; return 1; } @@ -52,22 +52,22 @@ u32 EffectSsIceSmoke_Init(PlayState* play, u32 index, EffectSs* this, void* init void EffectSsIceSmoke_Draw(PlayState* play, u32 index, EffectSs* this) { s32 pad; - void* object; + void* objectPtr; Mtx* mtx; f32 scale; - s32 objBankIdx; + s32 objectSlot; - object = play->objectCtx.status[this->rObjBankIdx].segment; + objectPtr = play->objectCtx.slots[this->rObjectSlot].segment; OPEN_DISPS(play->state.gfxCtx, "../z_eff_ss_ice_smoke.c", 155); - objBankIdx = Object_GetIndex(&play->objectCtx, OBJECT_FZ); + objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_FZ); - if ((objBankIdx > -1) && Object_IsLoaded(&play->objectCtx, objBankIdx)) { + if ((objectSlot >= 0) && Object_IsLoaded(&play->objectCtx, objectSlot)) { gDPPipeSync(POLY_XLU_DISP++); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSegments[6] = VIRTUAL_TO_PHYSICAL(object); - gSPSegment(POLY_XLU_DISP++, 0x06, object); + gSegments[6] = VIRTUAL_TO_PHYSICAL(objectPtr); + gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gFreezardSteamStartDL)); gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 235, 235, this->rAlpha); @@ -93,11 +93,11 @@ void EffectSsIceSmoke_Draw(PlayState* play, u32 index, EffectSs* this) { } void EffectSsIceSmoke_Update(PlayState* play, u32 index, EffectSs* this) { - s32 objBankIdx; + s32 objectSlot; - objBankIdx = Object_GetIndex(&play->objectCtx, OBJECT_FZ); + objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_FZ); - if ((objBankIdx > -1) && Object_IsLoaded(&play->objectCtx, objBankIdx)) { + if ((objectSlot >= 0) && Object_IsLoaded(&play->objectCtx, objectSlot)) { if (this->rAlpha < 100) { this->rAlpha += 10; } diff --git a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c index 8a2d924180..ed7d96a724 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c +++ b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c @@ -17,7 +17,7 @@ #define rReg8 regs[8] #define rReg9 regs[9] #define rObjId regs[10] -#define rObjBankIdx regs[11] +#define rObjectSlot regs[11] #define rColorIdx regs[12] u32 EffectSsKakera_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx); @@ -100,9 +100,9 @@ void EffectSsKakera_Draw(PlayState* play, u32 index, EffectSs* this) { if (this->rObjId != KAKERA_OBJECT_DEFAULT) { if ((((this->rReg4 >> 7) & 1) << 7) == 0x80) { - gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.status[this->rObjBankIdx].segment); + gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.slots[this->rObjectSlot].segment); } else { - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->rObjBankIdx].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->rObjectSlot].segment); } } @@ -137,9 +137,9 @@ void EffectSsKakera_Draw(PlayState* play, u32 index, EffectSs* this) { } void func_809A9BA8(EffectSs* this, PlayState* play) { - this->rObjBankIdx = Object_GetIndex(&play->objectCtx, this->rObjId); + this->rObjectSlot = Object_GetSlot(&play->objectCtx, this->rObjId); - if ((this->rObjBankIdx < 0) || !Object_IsLoaded(&play->objectCtx, this->rObjBankIdx)) { + if ((this->rObjectSlot < 0) || !Object_IsLoaded(&play->objectCtx, this->rObjectSlot)) { this->life = 0; this->draw = NULL; } diff --git a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c index 44a3b42be8..0c9f8b379f 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c +++ b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c @@ -8,7 +8,7 @@ #include "assets/objects/object_link_boy/object_link_boy.h" #include "assets/objects/object_link_child/object_link_child.h" -#define rObjBankIdx regs[0] +#define rObjectSlot regs[0] #define rYaw regs[1] u32 EffectSsStick_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx); @@ -21,7 +21,7 @@ EffectSsInit Effect_Ss_Stick_InitVars = { }; typedef struct { - /* 0x00 */ s16 objectID; + /* 0x00 */ s16 objectId; /* 0x04 */ Gfx* displayList; } StickDrawInfo; @@ -33,7 +33,7 @@ u32 EffectSsStick_Init(PlayState* play, u32 index, EffectSs* this, void* initPar StickDrawInfo* ageInfoEntry = gSaveContext.save.linkAge + drawInfo; EffectSsStickInitParams* initParams = (EffectSsStickInitParams*)initParamsx; - this->rObjBankIdx = Object_GetIndex(&play->objectCtx, ageInfoEntry->objectID); + this->rObjectSlot = Object_GetSlot(&play->objectCtx, ageInfoEntry->objectId); this->gfx = ageInfoEntry->displayList; this->vec = this->pos = initParams->pos; this->rYaw = initParams->yaw; @@ -67,7 +67,7 @@ void EffectSsStick_Draw(PlayState* play, u32 index, EffectSs* this) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_ss_stick.c", 176), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); Gfx_SetupDL_25Opa(gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->rObjBankIdx].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->rObjectSlot].segment); gSPSegment(POLY_OPA_DISP++, 0x0C, gCullBackDList); gSPDisplayList(POLY_OPA_DISP++, this->gfx);