Removed the old Memory Arena and converted all to the new one

This commit is contained in:
2026-02-14 18:09:47 -05:00
parent 6260d9aacf
commit 5a22a172a6
17 changed files with 207 additions and 1126 deletions

View File

@@ -31,7 +31,7 @@ namespace Game
using namespace Juliet;
extern "C" JULIET_API void GameInit(GameInitParams* /*params*/)
extern "C" JULIET_API void GameInit(GameInitParams* params)
{
// Example allocation in GameArena
struct GameState
@@ -40,7 +40,7 @@ extern "C" JULIET_API void GameInit(GameInitParams* /*params*/)
int Score;
};
auto* gameState = ArenaPushType<GameState>(GetGameArena(), ConstString("GameState"));
auto* gameState = ArenaPushStruct<GameState>(params->GameArena);
gameState->TotalTime = 0.0f;
gameState->Score = 0;
@@ -49,7 +49,7 @@ extern "C" JULIET_API void GameInit(GameInitParams* /*params*/)
using namespace Game;
// Entity Use case
InitEntityManager();
InitEntityManager(params->GameArena);
auto& manager = GetEntityManager();
Door* door = MakeEntity<Door>(manager, 10.0f, 2.0f);
door->IsOpened = true;
@@ -69,6 +69,10 @@ extern "C" JULIET_API void GameInit(GameInitParams* /*params*/)
extern "C" JULIET_API void __cdecl GameShutdown()
{
printf("Shutting down game...\n");
using namespace Game;
ShutdownEntityManager();
}
extern "C" JULIET_API void __cdecl GameUpdate([[maybe_unused]] float deltaTime)