1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-12 10:54:44 +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:
Dragorn421 2023-09-19 20:10:12 +02:00 committed by GitHub
parent 83a13a64c7
commit 57ce0cf8d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
130 changed files with 789 additions and 770 deletions

View file

@ -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);