logging macros

This commit is contained in:
Asuro
2025-02-28 20:53:43 +01:00
parent 136a0e09a9
commit b0c80c1bbb
10 changed files with 139 additions and 59 deletions

View File

@@ -22,27 +22,27 @@ namespace Game
void Setup(SharedData& shared)
{
Log("Game Setup Start!");
LOG("Game Setup Start!");
if (shared.Game.PermanentStorage == nullptr)
{
Log("Game memory not initialized!!");
LOG_ERROR("Game memory not initialized!!");
return;
}
if (shared.Game.EntityStorage == nullptr)
{
Log("Entity memory not initialized!");
LOG_ERROR("Entity memory not initialized!");
return;
}
if (shared.Game.PermanentStorageSize < sizeof(GameInstance))
{
Log("Game memory too small! %u < %u", shared.Game.PermanentStorageSize, sizeof(GameInstance));
LOG_ERROR("Game memory too small! %u < %u", shared.Game.PermanentStorageSize, sizeof(GameInstance));
return;
}
GameInstance& instance = *reinterpret_cast<GameInstance*>(shared.Game.PermanentStorage);
if (sizeof(GameInstance) != instance.Size)
{
Log("Game instance size changed, resetting!");
LOG_ERROR("Game instance size changed, resetting!");
instance = {};
}
instance.UsedScratchAmount = 0;
@@ -81,7 +81,7 @@ namespace Game
void Shutdown()
{
Log("Shutdown");
LOG("Shutdown");
SetupInstance.Rendering.Shutdown();
}
} // namespace Game