From 3912b443d53de4e7f2117a62c4ff8bc0626cc0b3 Mon Sep 17 00:00:00 2001 From: CatChow0 Date: Mon, 22 Apr 2024 21:56:56 +0200 Subject: [PATCH] Patch Update - Logger --- enginecustom/Logger.h | 40 +++++++++++++++++++++++++++++++++++++ enginecustom/imgui.ini | 10 +++++----- enginecustom/inputclass.cpp | 6 ++++-- 3 files changed, 49 insertions(+), 7 deletions(-) diff --git a/enginecustom/Logger.h b/enginecustom/Logger.h index 6fb69b4..2486fc7 100644 --- a/enginecustom/Logger.h +++ b/enginecustom/Logger.h @@ -85,6 +85,46 @@ public: case LogLevel::Info: levelStr = "INFO"; 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; diff --git a/enginecustom/imgui.ini b/enginecustom/imgui.ini index 9e5e6dd..03ba5a7 100644 --- a/enginecustom/imgui.ini +++ b/enginecustom/imgui.ini @@ -3,18 +3,18 @@ Pos=60,60 Size=400,400 [Window][Khaotic Engine] -Pos=219,17 -Size=392,218 +Pos=1373,52 +Size=392,214 [Window][Objects] -Pos=916,66 +Pos=53,55 Size=637,299 [Window][Terrain] -Pos=397,130 +Pos=741,42 Size=342,82 [Window][Light] -Pos=941,159 +Pos=1107,9 Size=345,230 diff --git a/enginecustom/inputclass.cpp b/enginecustom/inputclass.cpp index f627251..f0e9a4e 100644 --- a/enginecustom/inputclass.cpp +++ b/enginecustom/inputclass.cpp @@ -20,7 +20,7 @@ InputClass::~InputClass() 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; int i; @@ -123,6 +123,7 @@ bool InputClass::Initialize(HINSTANCE hinstance, HWND hwnd, int screenWidth, int void InputClass::KeyDown(unsigned int input) { // 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; return; } @@ -131,6 +132,7 @@ void InputClass::KeyDown(unsigned int input) void InputClass::KeyUp(unsigned int input) { // 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; return; } @@ -144,7 +146,7 @@ bool InputClass::IsKeyDown(unsigned int key) 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. if (m_mouse)