Add stackAllocReset method

This commit is contained in:
2023-12-07 10:47:41 +01:00
parent 9800b5576e
commit 7bada9f4e8
3 changed files with 13 additions and 2 deletions

View File

@@ -203,7 +203,12 @@ void update(float dt, void *userData) {
snprintf(titleBuf, sizeof(titleBuf), "FPS: %d | %.2f ms", GetFPS(), GetFrameTime() * 1000);
SetWindowTitle(titleBuf);
updatePlayerInput(NULL);
Game *game = ecs_singleton_get_mut(ECS, Game);
BZ_ASSERT(game->stackAlloc.allocated == 0);
bzStackAllocReset(&game->stackAlloc);
updatePlayerInput();
}
void render(float dt, void *userData) {
@@ -216,7 +221,7 @@ void render(float dt, void *userData) {
bzTileMapDraw(&game->map);
drawPlayerInputUI(NULL);
drawPlayerInputUI();
ecs_progress(ECS, dt);
ecs_enable(ECS, renderDebugPathSystem, game->debugDraw.path);