summaryrefslogtreecommitdiff
path: root/src/code/game.c
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2023-03-24 14:38:04 -0300
committerGitHub <noreply@github.com>2023-03-24 14:38:04 -0300
commit147e4fcedca332070ca15dbc1db358ce2d42972c (patch)
tree30577817a17f58de61a3679cb404fa58e922b750 /src/code/game.c
parentf3d2c56d1deed7194c77909ee41ed5b8ef3ef8a2 (diff)
THA docs (#1177)
* THA docs Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> * format * namefixer * yada * remove zero pad comment * Update include/z64.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update include/thga.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * namefixer * bss * namefixer --------- Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
Diffstat (limited to 'src/code/game.c')
-rw-r--r--src/code/game.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/code/game.c b/src/code/game.c
index f3c381e68..4a4be5291 100644
--- a/src/code/game.c
+++ b/src/code/game.c
@@ -158,11 +158,11 @@ void GameState_InitArena(GameState* gameState, size_t size) {
void* buf = GameAlloc_Malloc(alloc, size);
if (buf) {
- THA_Ct(&gameState->heap, buf, size);
+ THA_Init(&gameState->heap, buf, size);
return;
}
- THA_Ct(&gameState->heap, NULL, 0);
+ THA_Init(&gameState->heap, NULL, 0);
__assert("../game.c", 1035);
}
@@ -174,9 +174,9 @@ void GameState_Realloc(GameState* gameState, size_t size) {
size_t bytesAllocated;
void* heapStart;
- heapStart = gameState->heap.bufp;
+ heapStart = gameState->heap.start;
alloc = &gameState->alloc;
- THA_Dt(&gameState->heap);
+ THA_Destroy(&gameState->heap);
GameAlloc_Free(alloc, heapStart);
SystemArena_GetSizes(&systemMaxFree, &bytesFree, &bytesAllocated);
size = ((systemMaxFree - (sizeof(ArenaNode))) < size) ? (0) : (size);
@@ -185,9 +185,9 @@ void GameState_Realloc(GameState* gameState, size_t size) {
}
if ((gameArena = GameAlloc_Malloc(alloc, size)) != NULL) {
- THA_Ct(&gameState->heap, gameArena, size);
+ THA_Init(&gameState->heap, gameArena, size);
} else {
- THA_Ct(&gameState->heap, 0, 0);
+ THA_Init(&gameState->heap, 0, 0);
__assert("../game.c", 1074);
}
}
@@ -240,7 +240,7 @@ void GameState_Destroy(GameState* gameState) {
func_801420F4(&D_801F8020);
VisMono_Destroy(&sMonoColors);
func_80140900(&D_801F8048);
- THA_Dt(&gameState->heap);
+ THA_Destroy(&gameState->heap);
GameAlloc_Cleanup(&gameState->alloc);
}
@@ -257,7 +257,7 @@ u32 GameState_IsRunning(GameState* gameState) {
}
s32 GameState_GetArenaSize(GameState* gameState) {
- return THA_GetSize(&gameState->heap);
+ return THA_GetRemaining(&gameState->heap);
}
s32 func_80173B48(GameState* gameState) {