mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-21 06:21:16 +00:00
Doc/Cleanup pass on object handling (#1227)
* `Object_InitBank` -> `Object_InitContext` * Add and use `OBJECT_SPACE_SIZE_BASE` * Remove `OBJECT_EXCHANGE_BANK_MAX` -> use `ARRAY_COUNT()` instead * "object status" -> "object load entry" * Misc. cleanup/renames * Partial docs and way too much batch renaming and cleanup for a single commit * ctrl shift h * format * format clang-11.1 * fix regressions * Improve a `@bug` comment * Move `OBJECT_SPACE_SIZE_BASE` from header to near `Object_InitContext` * "objectID" -> "objectId" * Revert iterator index to `i` in `Actor_KillActorsWithUnloadedObject` * "object load entry index" -> "object entry" * `Object_UpdateLoadEntries` -> `Object_UpdateEntries` * Run format.sh * "object entry" -> "object slot" (except internal usage) * Proper `Object_SpawnPersistent` doc Co-authored-by: fig02 <fig02srl@gmail.com> * fixup one comment "object bank index" -> "object slot" * Amend `Object_SpawnPersistent` comment to mention running out of free slots * `Actor_KillActorsWithUnloadedObject` -> `Actor_KillAllWithMissingObject` * Remove useless mention of what uses `Object_SpawnPersistent` * Fix mistake on `Object_SpawnPersistent` doing sync dma, not async * run formatter * `Object_InitContext` -> `Object_Init` * `waitObjectSlot` -> `requiredObjectSlot` * `Object_Init` -> `func_80097DD8` * one objectIndex -> objectSlot * Remove `OBJECT_SPACE_SIZE_BASE` * light fix on the merge (rm OBJECT_EXCHANGE_BANK_MAX) * `func_80097DD8` -> `Object_InitContext` --------- Co-authored-by: fig02 <fig02srl@gmail.com>
This commit is contained in:
parent
83a13a64c7
commit
57ce0cf8d9
130 changed files with 789 additions and 770 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue