Patch Update - Logger

This commit is contained in:
CatChow0 2024-04-22 21:56:56 +02:00
parent 6316d4cb2b
commit 3912b443d5
3 changed files with 49 additions and 7 deletions

View File

@ -85,6 +85,46 @@ public:
case LogLevel::Info: case LogLevel::Info:
levelStr = "INFO"; levelStr = "INFO";
break; break;
case LogLevel::Shutdown:
levelStr = "SHUTDOWN";
break;
case LogLevel::Initialize:
levelStr = "INITIALIZE";
break;
case LogLevel::Update:
levelStr = "UPDATE";
break;
case LogLevel::Render:
levelStr = "RENDER";
break;
case LogLevel::Input:
levelStr = "INPUT";
break;
case LogLevel::Physics:
levelStr = "PHYSICS";
break;
case LogLevel::Audio:
levelStr = "AUDIO";
break;
case LogLevel::Network:
levelStr = "NETWORK";
break;
case LogLevel::Scripting:
levelStr = "SCRIPTING";
break;
case LogLevel::AI:
levelStr = "AI";
break;
case LogLevel::Resource:
levelStr = "RESOURCE";
break;
case LogLevel::Memory:
levelStr = "MEMORY";
break;
case LogLevel::Debug:
levelStr = "DEBUG";
break;
} }
std::stringstream ss; std::stringstream ss;

View File

@ -3,18 +3,18 @@ Pos=60,60
Size=400,400 Size=400,400
[Window][Khaotic Engine] [Window][Khaotic Engine]
Pos=219,17 Pos=1373,52
Size=392,218 Size=392,214
[Window][Objects] [Window][Objects]
Pos=916,66 Pos=53,55
Size=637,299 Size=637,299
[Window][Terrain] [Window][Terrain]
Pos=397,130 Pos=741,42
Size=342,82 Size=342,82
[Window][Light] [Window][Light]
Pos=941,159 Pos=1107,9
Size=345,230 Size=345,230

View File

@ -20,7 +20,7 @@ InputClass::~InputClass()
bool InputClass::Initialize(HINSTANCE hinstance, HWND hwnd, int screenWidth, int screenHeight) bool InputClass::Initialize(HINSTANCE hinstance, HWND hwnd, int screenWidth, int screenHeight)
{ {
Logger::Get().Log("Initializing input class", __FILE__, __LINE__); Logger::Get().Log("Initializing input class", __FILE__, __LINE__, Logger::LogLevel::Initialize);
HRESULT result; HRESULT result;
int i; int i;
@ -123,6 +123,7 @@ bool InputClass::Initialize(HINSTANCE hinstance, HWND hwnd, int screenWidth, int
void InputClass::KeyDown(unsigned int input) void InputClass::KeyDown(unsigned int input)
{ {
// If a key is pressed then save that state in the key array. // If a key is pressed then save that state in the key array.
Logger::Get().Log("Key down", __FILE__, __LINE__, Logger::LogLevel::Input);
m_keys[input] = true; m_keys[input] = true;
return; return;
} }
@ -131,6 +132,7 @@ void InputClass::KeyDown(unsigned int input)
void InputClass::KeyUp(unsigned int input) void InputClass::KeyUp(unsigned int input)
{ {
// If a key is released then clear that state in the key array. // If a key is released then clear that state in the key array.
Logger::Get().Log("Key up", __FILE__, __LINE__, Logger::LogLevel::Input);
m_keys[input] = false; m_keys[input] = false;
return; return;
} }
@ -144,7 +146,7 @@ bool InputClass::IsKeyDown(unsigned int key)
void InputClass::Shutdown() void InputClass::Shutdown()
{ {
Logger::Get().Log("Shutting down input class", __FILE__, __LINE__); Logger::Get().Log("Shutting down input class", __FILE__, __LINE__, Logger::LogLevel::Shutdown);
// Release the mouse. // Release the mouse.
if (m_mouse) if (m_mouse)