Removed the old Memory Arena and converted all to the new one
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user