diff --git a/enginecustom/Colorshaderclass.cpp b/enginecustom/Colorshaderclass.cpp index 5447f69..e62c100 100644 --- a/enginecustom/Colorshaderclass.cpp +++ b/enginecustom/Colorshaderclass.cpp @@ -23,7 +23,7 @@ ColorShaderClass::~ColorShaderClass() bool ColorShaderClass::Initialize(ID3D11Device* device, HWND hwnd) { - Logger::Get().Log("Initializing ColorShaderClass", __FILE__, __LINE__); + Logger::Get().Log("Initializing ColorShaderClass", __FILE__, __LINE__, Logger::LogLevel::Initialize); bool result; wchar_t vsFilename[128]; @@ -55,7 +55,7 @@ bool ColorShaderClass::Initialize(ID3D11Device* device, HWND hwnd) return false; } - Logger::Get().Log("ColorShaderClass initialized", __FILE__, __LINE__); + Logger::Get().Log("ColorShaderClass initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -90,7 +90,7 @@ bool ColorShaderClass::Render(ID3D11DeviceContext* deviceContext, int indexCount bool ColorShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* vsFilename, WCHAR* psFilename) { - Logger::Get().Log("Initializing shader", __FILE__, __LINE__); + Logger::Get().Log("Initializing shader", __FILE__, __LINE__, Logger::LogLevel::Initialize); HRESULT result; ID3D10Blob* errorMessage; @@ -213,41 +213,49 @@ bool ColorShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* return false; } - Logger::Get().Log("Shader initialized", __FILE__, __LINE__); + Logger::Get().Log("Shader initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } void ColorShaderClass::ShutdownShader() { - Logger::Get().Log("Shutting down shader", __FILE__, __LINE__); + Logger::Get().Log("Shutting down shader", __FILE__, __LINE__, Logger::LogLevel::Shutdown); // Release the matrix constant buffer. if (m_matrixBuffer) { + Logger::Get().Log("Releasing matrix buffer", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_matrixBuffer->Release(); m_matrixBuffer = 0; + Logger::Get().Log("Matrix buffer released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the layout. if (m_layout) { + Logger::Get().Log("Releasing layout", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_layout->Release(); m_layout = 0; + Logger::Get().Log("Layout released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the pixel shader. if (m_pixelShader) { + Logger::Get().Log("Releasing pixel shader", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_pixelShader->Release(); m_pixelShader = 0; + Logger::Get().Log("Pixel shader released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the vertex shader. if (m_vertexShader) { + Logger::Get().Log("Releasing vertex shader", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_vertexShader->Release(); m_vertexShader = 0; + Logger::Get().Log("Vertex shader released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } Logger::Get().Log("Shader shut down", __FILE__, __LINE__); diff --git a/enginecustom/Lightshaderclass.cpp b/enginecustom/Lightshaderclass.cpp index e137cd9..f195156 100644 --- a/enginecustom/Lightshaderclass.cpp +++ b/enginecustom/Lightshaderclass.cpp @@ -30,7 +30,7 @@ LightShaderClass::~LightShaderClass() bool LightShaderClass::Initialize(ID3D11Device* device, HWND hwnd) { - Logger::Get().Log("Initializing LightShaderClass", __FILE__, __LINE__); + Logger::Get().Log("Initializing LightShaderClass", __FILE__, __LINE__, Logger::LogLevel::Initialize); wchar_t vsFilename[128]; wchar_t psFilename[128]; @@ -60,7 +60,7 @@ bool LightShaderClass::Initialize(ID3D11Device* device, HWND hwnd) return false; } - Logger::Get().Log("LightShaderClass initialized", __FILE__, __LINE__); + Logger::Get().Log("LightShaderClass initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -97,6 +97,8 @@ bool LightShaderClass::Render(ID3D11DeviceContext* deviceContext, int indexCount bool LightShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* vsFilename, WCHAR* psFilename) { + Logger::Get().Log("Initializing shader", __FILE__, __LINE__, Logger::LogLevel::Initialize); + HRESULT result; ID3D10Blob* errorMessage; ID3D10Blob* vertexShaderBuffer; @@ -301,7 +303,7 @@ bool LightShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* return false; } - Logger::Get().Log("Shader initialized", __FILE__, __LINE__); + Logger::Get().Log("Shader initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -309,7 +311,7 @@ bool LightShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* void LightShaderClass::ShutdownShader() { - Logger::Get().Log("Shutting down LightShaderClass", __FILE__, __LINE__); + Logger::Get().Log("Shutting down LightShaderClass", __FILE__, __LINE__, Logger::LogLevel::Shutdown); // Release the light constant buffers. if (m_lightColorBuffer) @@ -373,7 +375,7 @@ void LightShaderClass::ShutdownShader() m_vertexShader = 0; } - Logger::Get().Log("LightShaderClass shut down", __FILE__, __LINE__); + Logger::Get().Log("LightShaderClass shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown); return; } diff --git a/enginecustom/Main.cpp b/enginecustom/Main.cpp index 3c3d8d6..f470c5a 100644 --- a/enginecustom/Main.cpp +++ b/enginecustom/Main.cpp @@ -13,7 +13,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pScmdline, result = System->Initialize(); if (result) { - Logger::Get().Log("System initialized", __FILE__, __LINE__); + Logger::Get().Log("System initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); System->Run(); } diff --git a/enginecustom/Modellistclass.cpp b/enginecustom/Modellistclass.cpp index ae3b3f2..ea52799 100644 --- a/enginecustom/Modellistclass.cpp +++ b/enginecustom/Modellistclass.cpp @@ -19,6 +19,7 @@ ModelListClass::~ModelListClass() void ModelListClass::Initialize(int numModels) { + int i; // Store the number of models. diff --git a/enginecustom/Multitextureshaderclass.cpp b/enginecustom/Multitextureshaderclass.cpp index c6ff3d6..d37c616 100644 --- a/enginecustom/Multitextureshaderclass.cpp +++ b/enginecustom/Multitextureshaderclass.cpp @@ -26,7 +26,7 @@ MultiTextureShaderClass::~MultiTextureShaderClass() bool MultiTextureShaderClass::Initialize(ID3D11Device* device, HWND hwnd) { - Logger::Get().Log("Initializing MultiTextureShaderClass", __FILE__, __LINE__); + Logger::Get().Log("Initializing MultiTextureShaderClass", __FILE__, __LINE__, Logger::LogLevel::Initialize); bool result; wchar_t vsFilename[128]; @@ -57,6 +57,8 @@ bool MultiTextureShaderClass::Initialize(ID3D11Device* device, HWND hwnd) return false; } + Logger::Get().Log("MultiTextureShaderClass initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); + return true; } @@ -90,7 +92,7 @@ bool MultiTextureShaderClass::Render(ID3D11DeviceContext* deviceContext, int ind bool MultiTextureShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* vsFilename, WCHAR* psFilename) { - Logger::Get().Log("Initializing the shader", __FILE__, __LINE__); + Logger::Get().Log("Initializing the shader", __FILE__, __LINE__, Logger::LogLevel::Initialize); HRESULT result; ID3D10Blob* errorMessage; @@ -244,14 +246,14 @@ bool MultiTextureShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, return false; } - Logger::Get().Log("Shader initialized", __FILE__, __LINE__); + Logger::Get().Log("Shader initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } void MultiTextureShaderClass::ShutdownShader() { - Logger::Get().Log("Shutting down the shader", __FILE__, __LINE__); + Logger::Get().Log("Shutting down the shader", __FILE__, __LINE__, Logger::LogLevel::Shutdown); // Release the sampler state. if (m_sampleState) @@ -288,7 +290,7 @@ void MultiTextureShaderClass::ShutdownShader() m_vertexShader = 0; } - Logger::Get().Log("Shader shut down", __FILE__, __LINE__); + Logger::Get().Log("Shader shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown); return; } diff --git a/enginecustom/Timerclass.cpp b/enginecustom/Timerclass.cpp index 3237e7d..2e5a08b 100644 --- a/enginecustom/Timerclass.cpp +++ b/enginecustom/Timerclass.cpp @@ -17,7 +17,7 @@ TimerClass::~TimerClass() bool TimerClass::Initialize() { - Logger::Get().Log("Initilazing timer class", __FILE__, __LINE__); + Logger::Get().Log("Initilazing timer class", __FILE__, __LINE__, Logger::LogLevel::Initialize); INT64 frequency; @@ -36,6 +36,8 @@ bool TimerClass::Initialize() // Get the initial start time. QueryPerformanceCounter((LARGE_INTEGER*)&m_startTime); + Logger::Get().Log("Timer class initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); + return true; } diff --git a/enginecustom/alphamapshaderclass.cpp b/enginecustom/alphamapshaderclass.cpp index 297b1f6..cbf697a 100644 --- a/enginecustom/alphamapshaderclass.cpp +++ b/enginecustom/alphamapshaderclass.cpp @@ -23,7 +23,7 @@ AlphaMapShaderClass::~AlphaMapShaderClass() bool AlphaMapShaderClass::Initialize(ID3D11Device* device, HWND hwnd) { - Logger::Get().Log("Initializing AlphaMapShaderClass", __FILE__, __LINE__); + Logger::Get().Log("Initializing AlphaMapShaderClass", __FILE__, __LINE__, Logger::LogLevel::Initialize); bool result; wchar_t vsFilename[128]; @@ -77,6 +77,7 @@ bool AlphaMapShaderClass::Render(ID3D11DeviceContext* deviceContext, int indexCo result = SetShaderParameters(deviceContext, worldMatrix, viewMatrix, projectionMatrix, texture1, texture2, texture3); if (!result) { + Logger::Get().Log("Error setting shader parameters", __FILE__, __LINE__, Logger::LogLevel::Error); return false; } @@ -89,7 +90,7 @@ bool AlphaMapShaderClass::Render(ID3D11DeviceContext* deviceContext, int indexCo bool AlphaMapShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* vsFilename, WCHAR* psFilename) { - Logger::Get().Log("Initializing shader", __FILE__, __LINE__); + Logger::Get().Log("Initializing shader", __FILE__, __LINE__, Logger::LogLevel::Initialize); HRESULT result; ID3D10Blob* errorMessage; @@ -243,7 +244,7 @@ bool AlphaMapShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHA return false; } - Logger::Get().Log("Shader initialized", __FILE__, __LINE__); + Logger::Get().Log("Shader initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -252,44 +253,54 @@ bool AlphaMapShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHA void AlphaMapShaderClass::ShutdownShader() { - Logger::Get().Log("Shutting down shader", __FILE__, __LINE__); + Logger::Get().Log("Shutting down shader", __FILE__, __LINE__, Logger::LogLevel::Shutdown); // Release the sampler state. if (m_sampleState) { + Logger::Get().Log("Releasing sampler state", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_sampleState->Release(); m_sampleState = 0; + Logger::Get().Log("Sampler state released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the matrix constant buffer. if (m_matrixBuffer) { + Logger::Get().Log("Releasing constant buffer", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_matrixBuffer->Release(); m_matrixBuffer = 0; + Logger::Get().Log("Constant buffer released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the layout. if (m_layout) { + Logger::Get().Log("Releasing layout", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_layout->Release(); m_layout = 0; + Logger::Get().Log("Layout released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the pixel shader. if (m_pixelShader) { + Logger::Get().Log("Releasing pixel shader", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_pixelShader->Release(); m_pixelShader = 0; + Logger::Get().Log("Pixel shader released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the vertex shader. if (m_vertexShader) { + Logger::Get().Log("Releasing vertex shader", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_vertexShader->Release(); m_vertexShader = 0; + Logger::Get().Log("Vertex shader released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } - Logger::Get().Log("Shader shutdown complete", __FILE__, __LINE__); + Logger::Get().Log("Shader shutdown complete", __FILE__, __LINE__, Logger::LogLevel::Shutdown); return; } diff --git a/enginecustom/applicationclass.cpp b/enginecustom/applicationclass.cpp index d9e97ef..feda5f3 100644 --- a/enginecustom/applicationclass.cpp +++ b/enginecustom/applicationclass.cpp @@ -36,7 +36,7 @@ ApplicationClass::~ApplicationClass() bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd) { - Logger::Get().Log("Initializing application class", __FILE__, __LINE__); + Logger::Get().Log("Initializing application class", __FILE__, __LINE__, Logger::LogLevel::Initialize); try { @@ -295,7 +295,7 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd) Logger::Get().Log(std::string("Exception caught during initialization: ") + e.what(), __FILE__, __LINE__, Logger::LogLevel::Error); return false; } - Logger::Get().Log("Application class initialized", __FILE__, __LINE__); + Logger::Get().Log("Application class initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -303,82 +303,82 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd) void ApplicationClass::Shutdown() { - Logger::Get().Log("Shutting down application class", __FILE__, __LINE__); + Logger::Get().Log("Shutting down application class", __FILE__, __LINE__, Logger::LogLevel::Shutdown); // Release the shader manager object. if (m_ShaderManager) { - Logger::Get().Log("Releasing the shader manager object", __FILE__, __LINE__); + Logger::Get().Log("Releasing the shader manager object", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_ShaderManager->Shutdown(); delete m_ShaderManager; m_ShaderManager = 0; - Logger::Get().Log("Shader manager object released", __FILE__, __LINE__); + Logger::Get().Log("Shader manager object released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the frustum class object. if (m_Frustum) { - Logger::Get().Log("Releasing the frustum class object", __FILE__, __LINE__); + Logger::Get().Log("Releasing the frustum class object", __FILE__, __LINE__, Logger::LogLevel::Shutdown); delete m_Frustum; m_Frustum = 0; - Logger::Get().Log("Frustum class object released", __FILE__, __LINE__); + Logger::Get().Log("Frustum class object released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the display plane object. if (m_DisplayPlane) { - Logger::Get().Log("Releasing the display plane object", __FILE__, __LINE__); + Logger::Get().Log("Releasing the display plane object", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_DisplayPlane->Shutdown(); delete m_DisplayPlane; m_DisplayPlane = 0; - Logger::Get().Log("Display plane object released", __FILE__, __LINE__); + Logger::Get().Log("Display plane object released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the position object. if (m_Position) { - Logger::Get().Log("Releasing the position object", __FILE__, __LINE__); + Logger::Get().Log("Releasing the position object", __FILE__, __LINE__, Logger::LogLevel::Shutdown); delete m_Position; m_Position = 0; - Logger::Get().Log("Position object released", __FILE__, __LINE__); + Logger::Get().Log("Position object released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the model list object. if (m_ModelList) { - Logger::Get().Log("Releasing the model list object", __FILE__, __LINE__); + Logger::Get().Log("Releasing the model list object", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_ModelList->Shutdown(); delete m_ModelList; m_ModelList = 0; - Logger::Get().Log("Model list object released", __FILE__, __LINE__); + Logger::Get().Log("Model list object released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the text objects for the render count string. if (m_RenderCountString) { - Logger::Get().Log("Releasing the render count string object", __FILE__, __LINE__); + Logger::Get().Log("Releasing the render count string object", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_RenderCountString->Shutdown(); delete m_RenderCountString; m_RenderCountString = 0; - Logger::Get().Log("Render count string object released", __FILE__, __LINE__); + Logger::Get().Log("Render count string object released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the text objects for the mouse strings. if (m_MouseStrings) { - Logger::Get().Log("Releasing the mouse strings", __FILE__, __LINE__); + Logger::Get().Log("Releasing the mouse strings", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_MouseStrings[0].Shutdown(); m_MouseStrings[1].Shutdown(); @@ -387,108 +387,110 @@ void ApplicationClass::Shutdown() delete[] m_MouseStrings; m_MouseStrings = 0; - Logger::Get().Log("Mouse strings released", __FILE__, __LINE__); + Logger::Get().Log("Mouse strings released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the text object for the fps string. if (m_FpsString) { - Logger::Get().Log("Releasing the fps string object", __FILE__, __LINE__); + Logger::Get().Log("Releasing the fps string object", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_FpsString->Shutdown(); delete m_FpsString; m_FpsString = 0; - Logger::Get().Log("Fps string object released", __FILE__, __LINE__); + Logger::Get().Log("Fps string object released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the fps object. if (m_Fps) { - Logger::Get().Log("Releasing the fps object", __FILE__, __LINE__); + Logger::Get().Log("Releasing the fps object", __FILE__, __LINE__, Logger::LogLevel::Shutdown); delete m_Fps; m_Fps = 0; - Logger::Get().Log("Fps object released", __FILE__, __LINE__); + Logger::Get().Log("Fps object released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the font object. if (m_Font) { - Logger::Get().Log("Releasing the font object", __FILE__, __LINE__); + Logger::Get().Log("Releasing the font object", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_Font->Shutdown(); delete m_Font; m_Font = 0; - Logger::Get().Log("Font object released", __FILE__, __LINE__); + Logger::Get().Log("Font object released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the font shader object. if (m_FontShader) { - Logger::Get().Log("Releasing the font shader object", __FILE__, __LINE__); + Logger::Get().Log("Releasing the font shader object", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_FontShader->Shutdown(); delete m_FontShader; m_FontShader = 0; - Logger::Get().Log("Font shader object released", __FILE__, __LINE__); + Logger::Get().Log("Font shader object released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the timer object. if (m_Timer) { - Logger::Get().Log("Releasing the timer object", __FILE__, __LINE__); + Logger::Get().Log("Releasing the timer object", __FILE__, __LINE__, Logger::LogLevel::Shutdown); delete m_Timer; m_Timer = 0; - Logger::Get().Log("Timer object released", __FILE__, __LINE__); + Logger::Get().Log("Timer object released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the sprite object. if (m_Sprite) { - Logger::Get().Log("Releasing the sprite object", __FILE__, __LINE__); + Logger::Get().Log("Releasing the sprite object", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_Sprite->Shutdown(); delete m_Sprite; m_Sprite = 0; - Logger::Get().Log("Sprite object released", __FILE__, __LINE__); + Logger::Get().Log("Sprite object released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } for (auto light : m_Lights) { - Logger::Get().Log("Releasing the light object", __FILE__, __LINE__); + Logger::Get().Log("Releasing the light object", __FILE__, __LINE__, Logger::LogLevel::Shutdown); if (light) { delete light; light = 0; } - Logger::Get().Log("Light object released", __FILE__, __LINE__); + Logger::Get().Log("Light object released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the light object. if (m_Light) { - Logger::Get().Log("Releasing the light object", __FILE__, __LINE__); + Logger::Get().Log("Releasing the light object", __FILE__, __LINE__, Logger::LogLevel::Shutdown); delete m_Light; m_Light = 0; - Logger::Get().Log("Light object released", __FILE__, __LINE__); + Logger::Get().Log("Light object released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the model object. if (m_Model) { - Logger::Get().Log("Releasing the model object", __FILE__, __LINE__); + Logger::Get().Log("Releasing the model object", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_Model->Shutdown(); delete m_Model; m_Model = 0; - Logger::Get().Log("Model object released", __FILE__, __LINE__); + Logger::Get().Log("Model object released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } + + Logger::Get().Log("Application class shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } @@ -517,7 +519,7 @@ bool ApplicationClass::Frame(InputClass* Input) // Check if the user pressed escape and wants to exit the application. if (Input->IsEscapePressed()) { - Logger::Get().Log("User pressed escape, exiting application", __FILE__, __LINE__); + Logger::Get().Log("User pressed escape, exiting application", __FILE__, __LINE__, Logger::LogLevel::Input); m_ShouldQuit = true; } diff --git a/enginecustom/bitmapclass.cpp b/enginecustom/bitmapclass.cpp index 8f6b01f..17ff2ba 100644 --- a/enginecustom/bitmapclass.cpp +++ b/enginecustom/bitmapclass.cpp @@ -20,7 +20,7 @@ BitmapClass::~BitmapClass() bool BitmapClass::Initialize(ID3D11Device* device, ID3D11DeviceContext* deviceContext, int screenWidth, int screenHeight, char* textureFilename, int renderX, int renderY) { - Logger::Get().Log("Initializing bitmap class", __FILE__, __LINE__); + Logger::Get().Log("Initializing bitmap class", __FILE__, __LINE__, Logger::LogLevel::Initialize); bool result; @@ -48,7 +48,7 @@ bool BitmapClass::Initialize(ID3D11Device* device, ID3D11DeviceContext* deviceCo return false; } - Logger::Get().Log("Bitmap class initialized", __FILE__, __LINE__); + Logger::Get().Log("Bitmap class initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -95,7 +95,7 @@ ID3D11ShaderResourceView* BitmapClass::GetTexture() bool BitmapClass::InitializeBuffers(ID3D11Device* device) { - Logger::Get().Log("Initializing buffers", __FILE__, __LINE__); + Logger::Get().Log("Initializing buffers", __FILE__, __LINE__, Logger::LogLevel::Initialize); VertexType* vertices; unsigned long* indices; @@ -178,27 +178,35 @@ bool BitmapClass::InitializeBuffers(ID3D11Device* device) delete[] indices; indices = 0; - Logger::Get().Log("Buffers initialized", __FILE__, __LINE__); + Logger::Get().Log("Buffers initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } void BitmapClass::ShutdownBuffers() { + Logger::Get().Log("Shutting down buffers", __FILE__, __LINE__, Logger::LogLevel::Shutdown); + // Release the index buffer. if (m_indexBuffer) { + Logger::Get().Log("Releasing index buffer", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_indexBuffer->Release(); m_indexBuffer = 0; + Logger::Get().Log("Index buffer released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } // Release the vertex buffer. if (m_vertexBuffer) { + Logger::Get().Log("Releasing vertex buffer", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_vertexBuffer->Release(); m_vertexBuffer = 0; + Logger::Get().Log("Vertex buffer released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } + Logger::Get().Log("Buffers shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown); + return; } @@ -329,14 +337,19 @@ bool BitmapClass::LoadTexture(ID3D11Device* device, ID3D11DeviceContext* deviceC void BitmapClass::ReleaseTexture() { + Logger::Get().Log("Releasing texture", __FILE__, __LINE__, Logger::LogLevel::Shutdown); // Release the texture object. if (m_Texture) { + Logger::Get().Log("Releasing texture object", __FILE__, __LINE__, Logger::LogLevel::Shutdown); m_Texture->Shutdown(); delete m_Texture; m_Texture = 0; + Logger::Get().Log("Texture object released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } + Logger::Get().Log("Texture released", __FILE__, __LINE__, Logger::LogLevel::Shutdown); + return; } diff --git a/enginecustom/d3dclass.cpp b/enginecustom/d3dclass.cpp index af89d43..1765f76 100644 --- a/enginecustom/d3dclass.cpp +++ b/enginecustom/d3dclass.cpp @@ -32,7 +32,7 @@ D3DClass::~D3DClass() bool D3DClass::Initialize(int screenWidth, int screenHeight, bool vsync, HWND hwnd, bool fullscreen, float screenDepth, float screenNear) { - Logger::Get().Log("Initializing D3Dclass", __FILE__, __LINE__); + Logger::Get().Log("Initializing D3Dclass", __FILE__, __LINE__, Logger::LogLevel::Initialize); HRESULT result; IDXGIFactory* factory; @@ -433,7 +433,7 @@ bool D3DClass::Initialize(int screenWidth, int screenHeight, bool vsync, HWND hw void D3DClass::Shutdown() { - Logger::Get().Log("Shutting down D3Dclass", __FILE__, __LINE__); + Logger::Get().Log("Shutting down D3Dclass", __FILE__, __LINE__, Logger::LogLevel::Shutdown); // Before shutting down set to windowed mode or when you release the swap chain it will throw an exception. if (m_swapChain) @@ -507,7 +507,7 @@ void D3DClass::Shutdown() m_swapChain = 0; } - Logger::Get().Log("D3Dclass shutdown", __FILE__, __LINE__); + Logger::Get().Log("D3Dclass shutdown", __FILE__, __LINE__, Logger::LogLevel::Shutdown); return; } diff --git a/enginecustom/displayplaneclass.cpp b/enginecustom/displayplaneclass.cpp index 527e962..ab6c4d8 100644 --- a/enginecustom/displayplaneclass.cpp +++ b/enginecustom/displayplaneclass.cpp @@ -19,7 +19,7 @@ DisplayPlaneClass::~DisplayPlaneClass() bool DisplayPlaneClass::Initialize(ID3D11Device* device, float width, float height) { - Logger::Get().Log("Initializing DisplayPlaneClass, width: " + std::to_string(width) + ", height: " + std::to_string(height), __FILE__, __LINE__); + Logger::Get().Log("Initializing DisplayPlaneClass, width: " + std::to_string(width) + ", height: " + std::to_string(height), __FILE__, __LINE__, Logger::LogLevel::Initialize); bool result; @@ -27,7 +27,7 @@ bool DisplayPlaneClass::Initialize(ID3D11Device* device, float width, float heig result = InitializeBuffers(device, width, height); if (!result) { - Logger::Get().Log("Could not initialize buffers", __FILE__, __LINE__); + Logger::Get().Log("Could not initialize buffers", __FILE__, __LINE__, Logger::LogLevel::Error); return false; } @@ -60,7 +60,7 @@ int DisplayPlaneClass::GetIndexCount() bool DisplayPlaneClass::InitializeBuffers(ID3D11Device* device, float width, float height) { - Logger::Get().Log("Initializing buffers", __FILE__, __LINE__); + Logger::Get().Log("Initializing buffers", __FILE__, __LINE__, Logger::LogLevel::Initialize); VertexType* vertices; unsigned long* indices; @@ -158,7 +158,7 @@ bool DisplayPlaneClass::InitializeBuffers(ID3D11Device* device, float width, flo delete[] indices; indices = 0; - Logger::Get().Log("Buffers initialized", __FILE__, __LINE__); + Logger::Get().Log("Buffers initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -166,6 +166,8 @@ bool DisplayPlaneClass::InitializeBuffers(ID3D11Device* device, float width, flo void DisplayPlaneClass::ShutdownBuffers() { + Logger::Get().Log("Shutting down Plane buffers", __FILE__, __LINE__, Logger::LogLevel::Shutdown); + // Release the index buffer. if (m_indexBuffer) { @@ -180,6 +182,8 @@ void DisplayPlaneClass::ShutdownBuffers() m_vertexBuffer = 0; } + Logger::Get().Log("Plane buffers shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown); + return; } diff --git a/enginecustom/fontclass.cpp b/enginecustom/fontclass.cpp index 5b165bc..2fe58b7 100644 --- a/enginecustom/fontclass.cpp +++ b/enginecustom/fontclass.cpp @@ -18,7 +18,7 @@ FontClass::~FontClass() bool FontClass::Initialize(ID3D11Device* device, ID3D11DeviceContext* deviceContext, int fontChoice) { - Logger::Get().Log("Initializing font class", __FILE__, __LINE__); + Logger::Get().Log("Initializing font class", __FILE__, __LINE__, Logger::LogLevel::Initialize); char fontFilename[128]; char fontTextureFilename[128]; @@ -49,7 +49,7 @@ bool FontClass::Initialize(ID3D11Device* device, ID3D11DeviceContext* deviceCont result = LoadFontData(fontFilename); if (!result) { - Logger::Get().Log("Failed to load font data", __FILE__, __LINE__); + Logger::Get().Log("Failed to load font data", __FILE__, __LINE__, Logger::LogLevel::Error); return false; } @@ -57,11 +57,11 @@ bool FontClass::Initialize(ID3D11Device* device, ID3D11DeviceContext* deviceCont result = LoadTexture(device, deviceContext, fontTextureFilename); if (!result) { - Logger::Get().Log("Failed to load font texture", __FILE__, __LINE__); + Logger::Get().Log("Failed to load font texture", __FILE__, __LINE__, Logger::LogLevel::Error); return false; } - Logger::Get().Log("Font class initialized", __FILE__, __LINE__); + Logger::Get().Log("Font class initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -148,7 +148,7 @@ bool FontClass::LoadTexture(ID3D11Device* device, ID3D11DeviceContext* deviceCon result = m_Texture->Initialize(device, deviceContext, filename); if (!result) { - Logger::Get().Log("Failed to initialize font texture", __FILE__, __LINE__); + Logger::Get().Log("Failed to initialize font texture", __FILE__, __LINE__, Logger::LogLevel::Error); return false; } diff --git a/enginecustom/fontshaderclass.cpp b/enginecustom/fontshaderclass.cpp index f372676..ab90dd1 100644 --- a/enginecustom/fontshaderclass.cpp +++ b/enginecustom/fontshaderclass.cpp @@ -24,7 +24,7 @@ FontShaderClass::~FontShaderClass() bool FontShaderClass::Initialize(ID3D11Device* device, HWND hwnd) { - Logger::Get().Log("Initializing FontShaderClass", __FILE__, __LINE__); + Logger::Get().Log("Initializing FontShaderClass", __FILE__, __LINE__, Logger::LogLevel::Initialize); bool result; wchar_t vsFilename[128]; @@ -55,7 +55,7 @@ bool FontShaderClass::Initialize(ID3D11Device* device, HWND hwnd) return false; } - Logger::Get().Log("FontShaderClass initialized", __FILE__, __LINE__); + Logger::Get().Log("FontShaderClass initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -90,7 +90,7 @@ bool FontShaderClass::Render(ID3D11DeviceContext* deviceContext, int indexCount, bool FontShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* vsFilename, WCHAR* psFilename) { - Logger::Get().Log("Initializing shader", __FILE__, __LINE__); + Logger::Get().Log("Initializing shader", __FILE__, __LINE__, Logger::LogLevel::Initialize); HRESULT result; ID3D10Blob* errorMessage; @@ -253,14 +253,14 @@ bool FontShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* v return false; } - Logger::Get().Log("Shader initialized", __FILE__, __LINE__); + Logger::Get().Log("Shader initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } void FontShaderClass::ShutdownShader() { - Logger::Get().Log("Shutting down shader", __FILE__, __LINE__); + Logger::Get().Log("Shutting down shader", __FILE__, __LINE__, Logger::LogLevel::Shutdown); // Release the pixel constant buffer. if (m_pixelBuffer) @@ -304,7 +304,7 @@ void FontShaderClass::ShutdownShader() m_vertexShader = 0; } - Logger::Get().Log("Shader shut down", __FILE__, __LINE__); + Logger::Get().Log("Shader shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown); return; } diff --git a/enginecustom/imgui.ini b/enginecustom/imgui.ini index 03ba5a7..0385078 100644 --- a/enginecustom/imgui.ini +++ b/enginecustom/imgui.ini @@ -3,7 +3,7 @@ Pos=60,60 Size=400,400 [Window][Khaotic Engine] -Pos=1373,52 +Pos=1139,42 Size=392,214 [Window][Objects] diff --git a/enginecustom/imguiManager.cpp b/enginecustom/imguiManager.cpp index be2fb45..5cc5ea0 100644 --- a/enginecustom/imguiManager.cpp +++ b/enginecustom/imguiManager.cpp @@ -13,7 +13,7 @@ imguiManager::~imguiManager() bool imguiManager::Initialize(HWND hwnd, ID3D11Device* device, ID3D11DeviceContext* deviceContext) { - Logger::Get().Log("Initializing imgui", __FILE__, __LINE__); + Logger::Get().Log("Initializing imgui", __FILE__, __LINE__, Logger::LogLevel::Initialize); m_device = device; m_deviceContext = deviceContext; @@ -26,16 +26,18 @@ bool imguiManager::Initialize(HWND hwnd, ID3D11Device* device, ID3D11DeviceConte ImGui_ImplDX11_Init(m_device, m_deviceContext); ImGui::StyleColorsDark(); - Logger::Get().Log("imgui initialized", __FILE__, __LINE__); + Logger::Get().Log("imgui initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } void imguiManager::Shutdown() { + Logger::Get().Log("Shutting down imgui", __FILE__, __LINE__, Logger::LogLevel::Shutdown); ImGui_ImplDX11_Shutdown(); ImGui_ImplWin32_Shutdown(); ImGui::DestroyContext(); + Logger::Get().Log("imgui shutdown", __FILE__, __LINE__, Logger::LogLevel::Shutdown); } void imguiManager::Render() diff --git a/enginecustom/inputclass.cpp b/enginecustom/inputclass.cpp index f0e9a4e..530b478 100644 --- a/enginecustom/inputclass.cpp +++ b/enginecustom/inputclass.cpp @@ -112,7 +112,7 @@ bool InputClass::Initialize(HINSTANCE hinstance, HWND hwnd, int screenWidth, int return false; } - Logger::Get().Log("Input class initialized", __FILE__, __LINE__); + Logger::Get().Log("Input class initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -171,7 +171,7 @@ void InputClass::Shutdown() m_directInput = 0; } - Logger::Get().Log("Input class shut down", __FILE__, __LINE__); + Logger::Get().Log("Input class shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown); return; } @@ -282,6 +282,7 @@ bool InputClass::IsLeftArrowPressed() { if (m_keyboardState[DIK_LEFT] & 0x80) { + Logger::Get().Log("Left arrow pressed", __FILE__, __LINE__, Logger::LogLevel::Input); return true; } @@ -293,6 +294,7 @@ bool InputClass::IsRightArrowPressed() { if (m_keyboardState[DIK_RIGHT] & 0x80) { + Logger::Get().Log("Right arrow pressed", __FILE__, __LINE__, Logger::LogLevel::Input); return true; } @@ -308,6 +310,7 @@ bool InputClass::IsAPressed() // Touche A sur QWERTY, Q sur AZERTY if (m_keyboardState[DIK_A] & 0x80) { + Logger::Get().Log("A pressed", __FILE__, __LINE__, Logger::LogLevel::Input); return true; } @@ -318,6 +321,7 @@ bool InputClass::IsDPressed() { if (m_keyboardState[DIK_D] & 0x80) { + Logger::Get().Log("D pressed", __FILE__, __LINE__, Logger::LogLevel::Input); return true; } @@ -329,6 +333,7 @@ bool InputClass::IsWPressed() // Touche W sur QWERTY, Z sur AZERTY if (m_keyboardState[DIK_W] & 0x80) { + Logger::Get().Log("W pressed", __FILE__, __LINE__, Logger::LogLevel::Input); return true; } @@ -339,6 +344,7 @@ bool InputClass::IsSPressed() { if (m_keyboardState[DIK_S] & 0x80) { + Logger::Get().Log("S pressed", __FILE__, __LINE__, Logger::LogLevel::Input); return true; } @@ -350,6 +356,7 @@ bool InputClass::IsQPressed() // Touche Q sur QWERTY, A sur AZERTY if (m_keyboardState[DIK_Q] & 0x80) { + Logger::Get().Log("Q pressed", __FILE__, __LINE__, Logger::LogLevel::Input); return true; } @@ -360,6 +367,7 @@ bool InputClass::IsEPressed() { if (m_keyboardState[DIK_E] & 0x80) { + Logger::Get().Log("E pressed", __FILE__, __LINE__, Logger::LogLevel::Input); return true; } @@ -378,6 +386,7 @@ bool InputClass::IsLeftMousePressed() // Check the left mouse button state. if (m_mouseState.rgbButtons[0] & 0x80) { + Logger::Get().Log("Left mouse button pressed", __FILE__, __LINE__, Logger::LogLevel::Input); return true; } @@ -389,6 +398,7 @@ bool InputClass::IsRightMousePressed() // Check the left mouse button state. if (m_mouseState.rgbButtons[1] & 0x80) { + Logger::Get().Log("Right mouse button pressed", __FILE__, __LINE__, Logger::LogLevel::Input); return true; } diff --git a/enginecustom/lightmapshaderclass.cpp b/enginecustom/lightmapshaderclass.cpp index d1a2c9d..ffa16ba 100644 --- a/enginecustom/lightmapshaderclass.cpp +++ b/enginecustom/lightmapshaderclass.cpp @@ -23,7 +23,7 @@ LightMapShaderClass::~LightMapShaderClass() bool LightMapShaderClass::Initialize(ID3D11Device* device, HWND hwnd) { - Logger::Get().Log("Initializing LightMapShaderClass", __FILE__, __LINE__); + Logger::Get().Log("Initializing LightMapShaderClass", __FILE__, __LINE__, Logger::LogLevel::Initialize); bool result; wchar_t vsFilename[128]; @@ -54,7 +54,7 @@ bool LightMapShaderClass::Initialize(ID3D11Device* device, HWND hwnd) return false; } - Logger::Get().Log("LightMapShaderClass initialized", __FILE__, __LINE__); + Logger::Get().Log("LightMapShaderClass initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -92,6 +92,7 @@ bool LightMapShaderClass::Render(ID3D11DeviceContext* deviceContext, int indexCo bool LightMapShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* vsFilename, WCHAR* psFilename) { + Logger::Get().Log("Initializing shader", __FILE__, __LINE__, Logger::LogLevel::Initialize); HRESULT result; ID3D10Blob* errorMessage; ID3D10Blob* vertexShaderBuffer; @@ -244,7 +245,7 @@ bool LightMapShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHA return false; } - Logger::Get().Log("Shader initialized", __FILE__, __LINE__); + Logger::Get().Log("Shader initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -252,7 +253,7 @@ bool LightMapShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHA void LightMapShaderClass::ShutdownShader() { - Logger::Get().Log("Shutting down LightMapShaderClass", __FILE__, __LINE__); + Logger::Get().Log("Shutting down LightMapShaderClass", __FILE__, __LINE__, Logger::LogLevel::Shutdown); // Release the sampler state. if (m_sampleState) @@ -289,7 +290,7 @@ void LightMapShaderClass::ShutdownShader() m_vertexShader = 0; } - Logger::Get().Log("LightMapShaderClass shut down", __FILE__, __LINE__); + Logger::Get().Log("LightMapShaderClass shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown); return; } diff --git a/enginecustom/lightshaderclass.cpp b/enginecustom/lightshaderclass.cpp index e137cd9..f195156 100644 --- a/enginecustom/lightshaderclass.cpp +++ b/enginecustom/lightshaderclass.cpp @@ -30,7 +30,7 @@ LightShaderClass::~LightShaderClass() bool LightShaderClass::Initialize(ID3D11Device* device, HWND hwnd) { - Logger::Get().Log("Initializing LightShaderClass", __FILE__, __LINE__); + Logger::Get().Log("Initializing LightShaderClass", __FILE__, __LINE__, Logger::LogLevel::Initialize); wchar_t vsFilename[128]; wchar_t psFilename[128]; @@ -60,7 +60,7 @@ bool LightShaderClass::Initialize(ID3D11Device* device, HWND hwnd) return false; } - Logger::Get().Log("LightShaderClass initialized", __FILE__, __LINE__); + Logger::Get().Log("LightShaderClass initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -97,6 +97,8 @@ bool LightShaderClass::Render(ID3D11DeviceContext* deviceContext, int indexCount bool LightShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* vsFilename, WCHAR* psFilename) { + Logger::Get().Log("Initializing shader", __FILE__, __LINE__, Logger::LogLevel::Initialize); + HRESULT result; ID3D10Blob* errorMessage; ID3D10Blob* vertexShaderBuffer; @@ -301,7 +303,7 @@ bool LightShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* return false; } - Logger::Get().Log("Shader initialized", __FILE__, __LINE__); + Logger::Get().Log("Shader initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -309,7 +311,7 @@ bool LightShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* void LightShaderClass::ShutdownShader() { - Logger::Get().Log("Shutting down LightShaderClass", __FILE__, __LINE__); + Logger::Get().Log("Shutting down LightShaderClass", __FILE__, __LINE__, Logger::LogLevel::Shutdown); // Release the light constant buffers. if (m_lightColorBuffer) @@ -373,7 +375,7 @@ void LightShaderClass::ShutdownShader() m_vertexShader = 0; } - Logger::Get().Log("LightShaderClass shut down", __FILE__, __LINE__); + Logger::Get().Log("LightShaderClass shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown); return; } diff --git a/enginecustom/modelclass.cpp b/enginecustom/modelclass.cpp index 650fe4a..7581ead 100644 --- a/enginecustom/modelclass.cpp +++ b/enginecustom/modelclass.cpp @@ -21,7 +21,7 @@ ModelClass::~ModelClass() bool ModelClass::Initialize(ID3D11Device* device, ID3D11DeviceContext* deviceContext, char* modelFilename, vector filename) { - Logger::Get().Log("Initializing model class", __FILE__, __LINE__); + Logger::Get().Log("Initializing model class", __FILE__, __LINE__, Logger::LogLevel::Initialize); bool result; @@ -51,7 +51,7 @@ bool ModelClass::Initialize(ID3D11Device* device, ID3D11DeviceContext* deviceCon return false; } - Logger::Get().Log("Model class initialized", __FILE__, __LINE__); + Logger::Get().Log("Model class initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -94,7 +94,7 @@ ID3D11ShaderResourceView* ModelClass::GetTexture(int index) bool ModelClass::InitializeBuffers(ID3D11Device* device) { - Logger::Get().Log("Initializing buffers", __FILE__, __LINE__); + Logger::Get().Log("Initializing buffers", __FILE__, __LINE__, Logger::LogLevel::Initialize); VertexType* vertices; unsigned long* indices; @@ -170,7 +170,7 @@ bool ModelClass::InitializeBuffers(ID3D11Device* device) delete[] indices; indices = 0; - Logger::Get().Log("Buffers initialized", __FILE__, __LINE__); + Logger::Get().Log("Buffers initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -178,6 +178,7 @@ bool ModelClass::InitializeBuffers(ID3D11Device* device) void ModelClass::ShutdownBuffers() { + Logger::Get().Log("Shutting down buffers", __FILE__, __LINE__, Logger::LogLevel::Shutdown); // Release the index buffer. if (m_indexBuffer) { @@ -192,6 +193,8 @@ void ModelClass::ShutdownBuffers() m_vertexBuffer = 0; } + Logger::Get().Log("Buffers shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown); + return; } diff --git a/enginecustom/normalmapshaderclass.cpp b/enginecustom/normalmapshaderclass.cpp index 75533c4..6333e1c 100644 --- a/enginecustom/normalmapshaderclass.cpp +++ b/enginecustom/normalmapshaderclass.cpp @@ -24,7 +24,7 @@ NormalMapShaderClass::~NormalMapShaderClass() bool NormalMapShaderClass::Initialize(ID3D11Device* device, HWND hwnd) { - Logger::Get().Log("Initializing normal map shader", __FILE__, __LINE__); + Logger::Get().Log("Initializing normal map shader", __FILE__, __LINE__, Logger::LogLevel::Initialize); bool result; wchar_t vsFilename[128]; @@ -55,6 +55,8 @@ bool NormalMapShaderClass::Initialize(ID3D11Device* device, HWND hwnd) return false; } + Logger::Get().Log("Successfully initialized normal map shader", __FILE__, __LINE__, Logger::LogLevel::Initialize); + return true; } @@ -77,7 +79,7 @@ bool NormalMapShaderClass::Render(ID3D11DeviceContext* deviceContext, int indexC result = SetShaderParameters(deviceContext, worldMatrix, viewMatrix, projectionMatrix, texture1, texture2, lightDirection, diffuseColor); if (!result) { - Logger::Get().Log("Failed to set the shader parameters that will be used for rendering", __FILE__, __LINE__); + Logger::Get().Log("Failed to set the shader parameters that will be used for rendering", __FILE__, __LINE__, Logger::LogLevel::Error); return false; } @@ -90,7 +92,7 @@ bool NormalMapShaderClass::Render(ID3D11DeviceContext* deviceContext, int indexC bool NormalMapShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* vsFilename, WCHAR* psFilename) { - Logger::Get().Log("Initializing normal map shader", __FILE__, __LINE__); + Logger::Get().Log("Initializing normal map shader", __FILE__, __LINE__, Logger::LogLevel::Initialize); HRESULT result; ID3D10Blob* errorMessage; @@ -277,7 +279,7 @@ bool NormalMapShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCH return false; } - Logger::Get().Log("Successfully initialized normal map shader", __FILE__, __LINE__); + Logger::Get().Log("Successfully initialized normal map shader", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -285,7 +287,7 @@ bool NormalMapShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCH void NormalMapShaderClass::ShutdownShader() { - Logger::Get().Log("Shutting down normal map shader", __FILE__, __LINE__); + Logger::Get().Log("Shutting down normal map shader", __FILE__, __LINE__, Logger::LogLevel::Shutdown); // Release the light constant buffer. if (m_lightBuffer) @@ -329,7 +331,7 @@ void NormalMapShaderClass::ShutdownShader() m_vertexShader = 0; } - Logger::Get().Log("Successfully shut down normal map shader", __FILE__, __LINE__); + Logger::Get().Log("Successfully shut down normal map shader", __FILE__, __LINE__, Logger::LogLevel::Shutdown); return; } diff --git a/enginecustom/reflectionshaderclass.cpp b/enginecustom/reflectionshaderclass.cpp index 3ace524..02a505d 100644 --- a/enginecustom/reflectionshaderclass.cpp +++ b/enginecustom/reflectionshaderclass.cpp @@ -21,7 +21,7 @@ ReflectionShaderClass::~ReflectionShaderClass() bool ReflectionShaderClass::Initialize(ID3D11Device* device, HWND hwnd) { - Logger::Get().Log("Initializing reflection shader", __FILE__, __LINE__); + Logger::Get().Log("Initializing reflection shader", __FILE__, __LINE__, Logger::LogLevel::Initialize); bool result; wchar_t vsFilename[128]; @@ -52,6 +52,8 @@ bool ReflectionShaderClass::Initialize(ID3D11Device* device, HWND hwnd) return false; } + Logger::Get().Log("Reflection shader initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); + return true; } @@ -85,7 +87,7 @@ bool ReflectionShaderClass::Render(ID3D11DeviceContext* deviceContext, int index bool ReflectionShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* vsFilename, WCHAR* psFilename) { - Logger::Get().Log("Initializing reflection shader", __FILE__, __LINE__); + Logger::Get().Log("Initializing reflection shader", __FILE__, __LINE__, Logger::LogLevel::Initialize); HRESULT result; ID3D10Blob* errorMessage; @@ -245,14 +247,14 @@ bool ReflectionShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WC return false; } - Logger::Get().Log("Reflection shader initialized", __FILE__, __LINE__); + Logger::Get().Log("Reflection shader initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } void ReflectionShaderClass::ShutdownShader() { - Logger::Get().Log("Shutting down reflection shader", __FILE__, __LINE__); + Logger::Get().Log("Shutting down reflection shader", __FILE__, __LINE__, Logger::LogLevel::Shutdown); // Release the reflection constant buffer. if (m_reflectionBuffer) @@ -296,7 +298,7 @@ void ReflectionShaderClass::ShutdownShader() m_vertexShader = 0; } - Logger::Get().Log("Reflection shader shut down", __FILE__, __LINE__); + Logger::Get().Log("Reflection shader shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown); return; } diff --git a/enginecustom/rendertextureclass.cpp b/enginecustom/rendertextureclass.cpp index 75b0a49..79fcfbe 100644 --- a/enginecustom/rendertextureclass.cpp +++ b/enginecustom/rendertextureclass.cpp @@ -21,7 +21,7 @@ RenderTextureClass::~RenderTextureClass() bool RenderTextureClass::Initialize(ID3D11Device * device, int textureWidth, int textureHeight, float screenDepth, float screenNear, int format) { - Logger::Get().Log("Initializing RenderTextureClass", __FILE__, __LINE__); + Logger::Get().Log("Initializing RenderTextureClass", __FILE__, __LINE__, Logger::LogLevel::Initialize); D3D11_TEXTURE2D_DESC textureDesc; HRESULT result; @@ -155,14 +155,14 @@ bool RenderTextureClass::Initialize(ID3D11Device * device, int textureWidth, int // Create an orthographic projection matrix for 2D rendering. m_orthoMatrix = XMMatrixOrthographicLH((float)textureWidth, (float)textureHeight, screenNear, screenDepth); - Logger::Get().Log("RenderTextureClass initialized", __FILE__, __LINE__); + Logger::Get().Log("RenderTextureClass initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } void RenderTextureClass::Shutdown() { - Logger::Get().Log("Shutting down RenderTextureClass", __FILE__, __LINE__); + Logger::Get().Log("Shutting down RenderTextureClass", __FILE__, __LINE__, Logger::LogLevel::Shutdown); if (m_depthStencilView) { @@ -194,7 +194,7 @@ void RenderTextureClass::Shutdown() m_renderTargetTexture = 0; } - Logger::Get().Log("RenderTextureClass shut down", __FILE__, __LINE__); + Logger::Get().Log("RenderTextureClass shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown); return; } diff --git a/enginecustom/shadermanagerclass.cpp b/enginecustom/shadermanagerclass.cpp index ccd0991..063333c 100644 --- a/enginecustom/shadermanagerclass.cpp +++ b/enginecustom/shadermanagerclass.cpp @@ -26,7 +26,7 @@ ShaderManagerClass::~ShaderManagerClass() bool ShaderManagerClass::Initialize(ID3D11Device* device, HWND hwnd) { - Logger::Get().Log("Initializing ShaderManagerClass", __FILE__, __LINE__); + Logger::Get().Log("Initializing ShaderManagerClass", __FILE__, __LINE__, Logger::LogLevel::Initialize); bool result; @@ -100,13 +100,13 @@ bool ShaderManagerClass::Initialize(ID3D11Device* device, HWND hwnd) return false; } - Logger::Get().Log("ShaderManagerClass initialized", __FILE__, __LINE__); // Create and initialize the light shader object. m_LightShader = new LightShaderClass; result = m_LightShader->Initialize(device, hwnd); if (!result) { + Logger::Get().Log("Error initializing LightShaderClass", __FILE__, __LINE__, Logger::LogLevel::Error); return false; } @@ -116,15 +116,18 @@ bool ShaderManagerClass::Initialize(ID3D11Device* device, HWND hwnd) result = m_LightMapShader->Initialize(device, hwnd); if (!result) { + Logger::Get().Log("Error initializing LightMapShaderClass", __FILE__, __LINE__, Logger::LogLevel::Error); return false; } + Logger::Get().Log("ShaderManagerClass initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); + return true; } void ShaderManagerClass::Shutdown() { - Logger::Get().Log("Shutting down ShaderManagerClass", __FILE__, __LINE__); + Logger::Get().Log("Shutting down ShaderManagerClass", __FILE__, __LINE__, Logger::LogLevel::Shutdown); // Release the normal map shader object. if (m_NormalMapShader) @@ -182,7 +185,6 @@ void ShaderManagerClass::Shutdown() m_TransparentShader = 0; } - Logger::Get().Log("ShaderManagerClass shut down", __FILE__, __LINE__); // Release the light shader object. if (m_LightShader) { @@ -199,6 +201,8 @@ void ShaderManagerClass::Shutdown() m_LightMapShader = 0; } + Logger::Get().Log("ShaderManagerClass shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown); + return; } diff --git a/enginecustom/textureclass.cpp b/enginecustom/textureclass.cpp index ecdd88d..1a9f50d 100644 --- a/enginecustom/textureclass.cpp +++ b/enginecustom/textureclass.cpp @@ -19,7 +19,7 @@ TextureClass::~TextureClass() bool TextureClass::Initialize(ID3D11Device * device, ID3D11DeviceContext * deviceContext, std::string filename) { - Logger::Get().Log(("Iinitializing texture: %s", filename), __FILE__, __LINE__); + Logger::Get().Log(("Iinitializing texture: %s", filename), __FILE__, __LINE__, Logger::LogLevel::Initialize); bool result; D3D11_TEXTURE2D_DESC textureDesc; @@ -79,11 +79,15 @@ bool TextureClass::Initialize(ID3D11Device * device, ID3D11DeviceContext * devic delete[] m_targaData; m_targaData = 0; + Logger::Get().Log("Texture initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); + return true; } void TextureClass::Shutdown() { + + Logger::Get().Log("Shutting down texture", __FILE__, __LINE__, Logger::LogLevel::Shutdown); // Release the texture view resource. if (m_textureView) { @@ -105,6 +109,8 @@ void TextureClass::Shutdown() m_targaData = 0; } + Logger::Get().Log("Texture shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown); + return; } @@ -115,6 +121,8 @@ ID3D11ShaderResourceView* TextureClass::GetTexture() bool TextureClass::LoadTarga(std::string filename) { + + Logger::Get().Log(("Loading targa file: %s", filename), __FILE__, __LINE__); int error, bpp, imageSize, index, i, j, k; FILE* filePtr; unsigned int count; @@ -216,7 +224,7 @@ bool TextureClass::LoadTarga(std::string filename) delete[] targaImage; targaImage = 0; - Logger::Get().Log("Targa file loaded", __FILE__, __LINE__); + Logger::Get().Log(("targa file %s loaded", filename), __FILE__, __LINE__); return true; } diff --git a/enginecustom/textureshaderclass.cpp b/enginecustom/textureshaderclass.cpp index 62b7e6f..a011ef9 100644 --- a/enginecustom/textureshaderclass.cpp +++ b/enginecustom/textureshaderclass.cpp @@ -23,7 +23,7 @@ TextureShaderClass::~TextureShaderClass() bool TextureShaderClass::Initialize(ID3D11Device* device, HWND hwnd) { - Logger::Get().Log("Initializing texture shader", __FILE__, __LINE__); + Logger::Get().Log("Initializing texture shader", __FILE__, __LINE__, Logger::LogLevel::Initialize); bool result; wchar_t vsFilename[128]; @@ -53,7 +53,7 @@ bool TextureShaderClass::Initialize(ID3D11Device* device, HWND hwnd) return false; } - Logger::Get().Log("Texture shader initialized", __FILE__, __LINE__); + Logger::Get().Log("Texture shader initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -88,7 +88,7 @@ bool TextureShaderClass::Render(ID3D11DeviceContext* deviceContext, int indexCou bool TextureShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* vsFilename, WCHAR* psFilename) { - Logger::Get().Log("Initializing shader", __FILE__, __LINE__); + Logger::Get().Log("Initializing shader", __FILE__, __LINE__, Logger::LogLevel::Initialize); HRESULT result; ID3D10Blob* errorMessage; @@ -232,14 +232,14 @@ bool TextureShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR return false; } - Logger::Get().Log("Shader initialized", __FILE__, __LINE__); + Logger::Get().Log("Shader initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } void TextureShaderClass::ShutdownShader() { - Logger::Get().Log("Shutting down shader", __FILE__, __LINE__); + Logger::Get().Log("Shutting down shader", __FILE__, __LINE__, Logger::LogLevel::Shutdown); // Release the sampler state. if (m_sampleState) @@ -276,7 +276,7 @@ void TextureShaderClass::ShutdownShader() m_vertexShader = 0; } - Logger::Get().Log("Shader shut down", __FILE__, __LINE__); + Logger::Get().Log("Shader shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown); return; } diff --git a/enginecustom/translateshaderclass.cpp b/enginecustom/translateshaderclass.cpp index 45a407a..e427d55 100644 --- a/enginecustom/translateshaderclass.cpp +++ b/enginecustom/translateshaderclass.cpp @@ -24,7 +24,7 @@ TranslateShaderClass::~TranslateShaderClass() bool TranslateShaderClass::Initialize(ID3D11Device* device, HWND hwnd) { - Logger::Get().Log("Initilaizing TranslateShaderClass", __FILE__, __LINE__); + Logger::Get().Log("Initilaizing TranslateShaderClass", __FILE__, __LINE__, Logger::LogLevel::Initialize); bool result; wchar_t vsFilename[128]; @@ -55,7 +55,7 @@ bool TranslateShaderClass::Initialize(ID3D11Device* device, HWND hwnd) return false; } - Logger::Get().Log("TranslateShaderClass initialized", __FILE__, __LINE__); + Logger::Get().Log("TranslateShaderClass initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -92,7 +92,7 @@ bool TranslateShaderClass::Render(ID3D11DeviceContext * deviceContext, int index bool TranslateShaderClass::InitializeShader(ID3D11Device * device, HWND hwnd, WCHAR * vsFilename, WCHAR * psFilename) { - Logger::Get().Log("Initializing translate shader", __FILE__, __LINE__); + Logger::Get().Log("Initializing translate shader", __FILE__, __LINE__, Logger::LogLevel::Initialize); HRESULT result; ID3D10Blob* errorMessage; @@ -255,7 +255,7 @@ bool TranslateShaderClass::InitializeShader(ID3D11Device * device, HWND hwnd, WC return false; } - Logger::Get().Log("Translate shader initialized", __FILE__, __LINE__); + Logger::Get().Log("Translate shader initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -263,7 +263,7 @@ bool TranslateShaderClass::InitializeShader(ID3D11Device * device, HWND hwnd, WC void TranslateShaderClass::ShutdownShader() { - Logger::Get().Log("Shutting down translate shader", __FILE__, __LINE__); + Logger::Get().Log("Shutting down translate shader", __FILE__, __LINE__, Logger::LogLevel::Shutdown); // Release the texture translation constant buffer. if (m_translateBuffer) @@ -307,7 +307,7 @@ void TranslateShaderClass::ShutdownShader() m_vertexShader = 0; } - Logger::Get().Log("Translate shader shut down", __FILE__, __LINE__); + Logger::Get().Log("Translate shader shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown); return; } diff --git a/enginecustom/transparentshaderclass.cpp b/enginecustom/transparentshaderclass.cpp index 985a657..08e7f63 100644 --- a/enginecustom/transparentshaderclass.cpp +++ b/enginecustom/transparentshaderclass.cpp @@ -24,7 +24,7 @@ TransparentShaderClass::~TransparentShaderClass() bool TransparentShaderClass::Initialize(ID3D11Device* device, HWND hwnd) { - Logger::Get().Log("Initializing TransparentShaderClass", __FILE__, __LINE__); + Logger::Get().Log("Initializing TransparentShaderClass", __FILE__, __LINE__, Logger::LogLevel::Initialize); bool result; wchar_t vsFilename[128]; @@ -55,7 +55,7 @@ bool TransparentShaderClass::Initialize(ID3D11Device* device, HWND hwnd) return false; } - Logger::Get().Log("TransparentShaderClass initialized", __FILE__, __LINE__); + Logger::Get().Log("TransparentShaderClass initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -92,7 +92,7 @@ bool TransparentShaderClass::Render(ID3D11DeviceContext* deviceContext, int inde bool TransparentShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* vsFilename, WCHAR* psFilename) { - Logger::Get().Log("Initializing transparent shader", __FILE__, __LINE__); + Logger::Get().Log("Initializing transparent shader", __FILE__, __LINE__, Logger::LogLevel::Initialize); HRESULT result; ID3D10Blob* errorMessage; @@ -255,7 +255,7 @@ bool TransparentShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, W return false; } - Logger::Get().Log("Transparent shader initialized", __FILE__, __LINE__); + Logger::Get().Log("Transparent shader initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); return true; } @@ -263,7 +263,7 @@ bool TransparentShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, W void TransparentShaderClass::ShutdownShader() { - Logger::Get().Log("Shutting down transparent shader", __FILE__, __LINE__); + Logger::Get().Log("Shutting down transparent shader", __FILE__, __LINE__, Logger::LogLevel::Shutdown); // Release the transparent constant buffer. if (m_transparentBuffer) @@ -307,7 +307,7 @@ void TransparentShaderClass::ShutdownShader() m_vertexShader = 0; } - Logger::Get().Log("Transparent shader shut down", __FILE__, __LINE__); + Logger::Get().Log("Transparent shader shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown); return; }