1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-02 07:46:01 +00:00
oot/include/thga.h
Tharo 6d5287ff12
TwoHeadArena and TwoHeadGfxArena docs (#1349)
* TwoHeadArena and TwoHeadGfxArena docs, ALIGNOF macro

* AllocStart -> AllocHead , AllocEnd -> AllocTail

* Format

* Suggested changes

* Fix

* Further suggested changes
2022-11-13 18:29:50 -05:00

33 lines
1.1 KiB
C

#ifndef THGA_H
#define THGA_H
#include "tha.h"
typedef union {
/* 0x00 */ TwoHeadArena tha;
struct { // Same as TwoHeadArena, with different types and field names for the head and tail pointers
/* 0x00 */ size_t size;
/* 0x04 */ void* start;
/* 0x08 */ Gfx* p;
/* 0x0C */ void* d;
};
} TwoHeadGfxArena; // size = 0x10
void THGA_Init(TwoHeadGfxArena* thga, void* start, size_t size);
void THGA_Destroy(TwoHeadGfxArena* thga);
u32 THGA_IsCrash(TwoHeadGfxArena* thga);
void THGA_Reset(TwoHeadGfxArena* thga);
s32 THGA_GetRemaining(TwoHeadGfxArena* thga);
Gfx* THGA_GetHead(TwoHeadGfxArena* thga);
void THGA_SetHead(TwoHeadGfxArena* thga, Gfx* newHead);
void* THGA_GetTail(TwoHeadGfxArena* thga);
Gfx* THGA_AllocDisplayList(TwoHeadGfxArena* thga, size_t num);
Gfx* THGA_AllocGfx(TwoHeadGfxArena* thga);
Gfx* THGA_AllocGfx2(TwoHeadGfxArena* thga);
void* THGA_AllocTail(TwoHeadGfxArena* thga, size_t size);
Mtx* THGA_AllocMtxArray(TwoHeadGfxArena* thga, size_t num);
Mtx* THGA_AllocMtx(TwoHeadGfxArena* thga);
Vtx* THGA_AllocVtxArray(TwoHeadGfxArena* thga, size_t num);
Vtx* THGA_AllocVtx(TwoHeadGfxArena* thga);
#endif