1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-18 05:44:53 +00:00

TwoHeadArena and TwoHeadGfxArena docs (#1349)

* TwoHeadArena and TwoHeadGfxArena docs, ALIGNOF macro

* AllocStart -> AllocHead , AllocEnd -> AllocTail

* Format

* Suggested changes

* Fix

* Further suggested changes
This commit is contained in:
Tharo 2022-11-13 23:29:50 +00:00 committed by GitHub
parent c165ed015c
commit 6d5287ff12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 302 additions and 170 deletions

View file

@ -149,7 +149,7 @@ void DynaSSNodeList_Initialize(PlayState* play, DynaSSNodeList* nodeList) {
* Initialize DynaSSNodeList tbl
*/
void DynaSSNodeList_Alloc(PlayState* play, DynaSSNodeList* nodeList, s32 max) {
nodeList->tbl = THA_AllocEndAlign(&play->state.tha, max * sizeof(SSNode), -2);
nodeList->tbl = THA_AllocTailAlign(&play->state.tha, max * sizeof(SSNode), ALIGNOF_MASK(SSNode));
ASSERT(nodeList->tbl != NULL, "psst->tbl != NULL", "../z_bgcheck.c", 1811);
@ -1613,9 +1613,10 @@ void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader
colCtx->subdivAmount.z = 16;
}
}
colCtx->lookupTbl = THA_AllocEndAlign(
&play->state.tha,
colCtx->subdivAmount.x * sizeof(StaticLookup) * colCtx->subdivAmount.y * colCtx->subdivAmount.z, ~1);
colCtx->lookupTbl = THA_AllocTailAlign(&play->state.tha,
colCtx->subdivAmount.x * sizeof(StaticLookup) * colCtx->subdivAmount.y *
colCtx->subdivAmount.z,
ALIGNOF_MASK(StaticLookup));
if (colCtx->lookupTbl == NULL) {
LogUtils_HungupThread("../z_bgcheck.c", 4176);
}
@ -2501,7 +2502,7 @@ void SSNodeList_Initialize(SSNodeList* this) {
void SSNodeList_Alloc(PlayState* play, SSNodeList* this, s32 tblMax, s32 numPolys) {
this->max = tblMax;
this->count = 0;
this->tbl = THA_AllocEndAlign(&play->state.tha, tblMax * sizeof(SSNode), -2);
this->tbl = THA_AllocTailAlign(&play->state.tha, tblMax * sizeof(SSNode), ALIGNOF_MASK(SSNode));
ASSERT(this->tbl != NULL, "this->short_slist_node_tbl != NULL", "../z_bgcheck.c", 5975);
@ -2636,7 +2637,7 @@ void DynaPoly_NullPolyList(CollisionPoly** polyList) {
* Allocate dyna.polyList
*/
void DynaPoly_AllocPolyList(PlayState* play, CollisionPoly** polyList, s32 numPolys) {
*polyList = THA_AllocEndAlign(&play->state.tha, numPolys * sizeof(CollisionPoly), -2);
*polyList = THA_AllocTailAlign(&play->state.tha, numPolys * sizeof(CollisionPoly), ALIGNOF_MASK(CollisionPoly));
ASSERT(*polyList != NULL, "ptbl->pbuf != NULL", "../z_bgcheck.c", 6247);
}
@ -2651,7 +2652,7 @@ void DynaPoly_NullVtxList(Vec3s** vtxList) {
* Allocate dyna.vtxList
*/
void DynaPoly_AllocVtxList(PlayState* play, Vec3s** vtxList, s32 numVtx) {
*vtxList = THA_AllocEndAlign(&play->state.tha, numVtx * sizeof(Vec3s), -2);
*vtxList = THA_AllocTailAlign(&play->state.tha, numVtx * sizeof(Vec3s), ALIGNOF_MASK(Vec3s));
ASSERT(*vtxList != NULL, "ptbl->pbuf != NULL", "../z_bgcheck.c", 6277);
}