mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-18 13:00:23 +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
|
@ -17,7 +17,7 @@ void Demo6K_Init(Actor* thisx, PlayState* play);
|
|||
void Demo6K_Destroy(Actor* thisx, PlayState* play);
|
||||
void Demo6K_Update(Actor* thisx, PlayState* play);
|
||||
|
||||
void func_80966DB0(Demo6K* this, PlayState* play);
|
||||
void Demo6K_WaitForObject(Demo6K* this, PlayState* play);
|
||||
void func_80966E04(Demo6K* this, PlayState* play);
|
||||
void func_80966E98(Demo6K* this, PlayState* play);
|
||||
void func_80966F84(Demo6K* this, PlayState* play);
|
||||
|
@ -69,26 +69,26 @@ void Demo6K_Init(Actor* thisx, PlayState* play) {
|
|||
Demo6K* this = (Demo6K*)thisx;
|
||||
s32 pad;
|
||||
s32 params = this->actor.params;
|
||||
s32 objBankIndex;
|
||||
s32 objectSlot;
|
||||
s32 i;
|
||||
|
||||
osSyncPrintf("no = %d\n", params);
|
||||
|
||||
if (sObjectIds[params] != OBJECT_GAMEPLAY_KEEP) {
|
||||
objBankIndex = Object_GetIndex(&play->objectCtx, sObjectIds[params]);
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[params]);
|
||||
} else {
|
||||
objBankIndex = 0;
|
||||
objectSlot = 0;
|
||||
}
|
||||
|
||||
osSyncPrintf("bank_ID = %d\n", objBankIndex);
|
||||
osSyncPrintf("bank_ID = %d\n", objectSlot);
|
||||
|
||||
if (objBankIndex < 0) {
|
||||
if (objectSlot < 0) {
|
||||
ASSERT(0, "0", "../z_demo_6k.c", 334);
|
||||
} else {
|
||||
this->objBankIndex = objBankIndex;
|
||||
this->requiredObjectSlot = objectSlot;
|
||||
}
|
||||
|
||||
Demo6K_SetupAction(this, func_80966DB0);
|
||||
Demo6K_SetupAction(this, Demo6K_WaitForObject);
|
||||
this->timer1 = 0;
|
||||
this->flags = 0;
|
||||
this->timer2 = 0;
|
||||
|
@ -197,9 +197,9 @@ void Demo6K_Destroy(Actor* thisx, PlayState* play) {
|
|||
LightContext_RemoveLight(play, &play->lightCtx, this->lightNode);
|
||||
}
|
||||
|
||||
void func_80966DB0(Demo6K* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objBankIndex)) {
|
||||
this->actor.objBankIndex = this->objBankIndex;
|
||||
void Demo6K_WaitForObject(Demo6K* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
|
||||
this->actor.objectSlot = this->requiredObjectSlot;
|
||||
this->actor.draw = this->drawFunc;
|
||||
this->actionFunc = this->initActionFunc;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ typedef struct Demo6K {
|
|||
/* 0x028C */ u16 flags;
|
||||
/* 0x028E */ u16 timer1;
|
||||
/* 0x0290 */ u16 timer2;
|
||||
/* 0x0292 */ u8 objBankIndex;
|
||||
/* 0x0292 */ u8 requiredObjectSlot;
|
||||
/* 0x0293 */ u8 unk_293;
|
||||
} Demo6K; // size = 0x0294
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue