From 4df668e68f78274465dbe184e5a6e84c23867672 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 29 Dec 2019 22:26:05 +0100 Subject: [PATCH] Minor formating fixes. --- include/Spectre/Core/NonCopyable.h | 4 ++-- include/Spectre/Display/DisplayMode.h | 2 +- include/Spectre/Game/FPSCounter.h | 4 ++-- include/Spectre/Game/GameTime.h | 2 +- include/Spectre/Graphics/BatchRenderer2D.h | 4 ++-- include/Spectre/Graphics/DefaultRenderer2D.h | 2 +- include/Spectre/Graphics/OpenGL.h | 2 +- include/Spectre/Graphics/Renderer2D.h | 2 +- include/Spectre/Graphics/Shader.h | 4 ++-- include/Spectre/Graphics/ShaderProgram.h | 6 +++--- include/Spectre/Graphics/Transformable.h | 2 +- include/Spectre/Input/InputListener.h | 2 +- include/Spectre/Math/Math.h | 4 ++-- include/Spectre/Math/Matrix3.h | 8 ++++---- include/Spectre/Math/Matrix3.inl | 6 +++--- include/Spectre/Math/Matrix4.h | 2 +- include/Spectre/Math/Matrix4.inl | 2 +- include/Spectre/Math/Transform.h | 2 +- include/Spectre/Math/Vector2.inl | 2 +- include/Spectre/Math/Vector3.h | 2 +- include/Spectre/Math/Vector3.inl | 2 +- include/Spectre/Math/Vector4.h | 2 +- include/Spectre/Scene/Camera2D.h | 4 ++-- include/Spectre/Scene/ICamera.h | 2 +- include/Spectre/System/MessageHandler.h | 2 +- include/Spectre/System/SystemEvent.h | 2 +- source/Display/Display.cpp | 2 +- source/Display/DisplayDescription.cpp | 2 +- source/Display/DisplayMode.cpp | 2 +- source/Game/FPSCounter.cpp | 2 +- source/Game/GameTime.cpp | 4 ++-- source/Graphics/BatchRenderer2D.cpp | 2 +- source/Graphics/DefaultRenderer2D.cpp | 4 ++-- source/Graphics/Font.cpp | 4 ++-- source/Graphics/Font/FontDriver.cpp | 2 +- source/Graphics/Font/FreeTypeDriver.cpp | 6 +++--- source/Graphics/Font/FreeTypeError.cpp | 2 +- source/Graphics/Font/FreeTypeError.h | 2 +- source/Graphics/GL/CheckError.cpp | 2 +- source/Graphics/GL/CheckError.h | 4 ++-- source/Graphics/Image.cpp | 2 +- source/Graphics/OpenGL.cpp | 2 +- source/Graphics/RenderState.cpp | 4 ++-- source/Graphics/Renderable2D.cpp | 4 ++-- source/Graphics/Renderer2D.cpp | 2 +- source/Graphics/Shader.cpp | 2 +- source/Graphics/ShaderProgram.cpp | 6 +++--- source/Graphics/Sprite.cpp | 4 ++-- source/Graphics/Text.cpp | 2 +- source/Graphics/Texture.cpp | 18 +++++++++--------- source/Graphics/Transformable.cpp | 2 +- source/Input/InputDevice.cpp | 2 +- source/Input/InputEvent.cpp | 4 ++-- source/Input/InputListener.cpp | 2 +- source/Input/InputModule.cpp | 4 ++-- source/Input/Keyboard.cpp | 4 ++-- source/Input/Mouse.cpp | 2 +- source/Math/Color.cpp | 2 +- source/Math/Math.cpp | 2 +- source/Math/Transform.cpp | 2 +- source/Platform/PlatformApplication.h | 2 +- source/Platform/PlatformDisplay.cpp | 2 +- source/Platform/PlatformDisplay.h | 4 ++-- source/Platform/Win32/Win32Application.cpp | 2 +- source/Platform/Win32/Win32GLContext.cpp | 4 ++-- source/Platform/Win32/Win32Input.cpp | 2 +- source/Platform/Win32/Win32Internal.cpp | 10 +++++----- source/Platform/Win32/Win32Internal.h | 2 +- source/Platform/Win32/Win32Keyboard.cpp | 2 +- source/Platform/Win32/Win32Misc.cpp | 2 +- source/Platform/Win32/Win32Mouse.cpp | 10 +++++----- source/Platform/Win32/Win32MsgBuffer.cpp | 2 +- source/Platform/Win32/Win32MsgBuffer.h | 2 +- source/Scene/Camera2D.cpp | 2 +- source/System/Log.cpp | 2 +- source/System/SystemEvent.cpp | 2 +- 76 files changed, 121 insertions(+), 121 deletions(-) diff --git a/include/Spectre/Core/NonCopyable.h b/include/Spectre/Core/NonCopyable.h index c5b6f96..95c5db4 100644 --- a/include/Spectre/Core/NonCopyable.h +++ b/include/Spectre/Core/NonCopyable.h @@ -13,10 +13,10 @@ protected : private : // Skip implementation to trigger compiler error. - NonCopyable(const NonCopyable&); + NonCopyable(const NonCopyable&); NonCopyable& operator =(const NonCopyable&); }; } // namespace sp -#endif /* SPECTRE_CORE_NONCOPYABLE_H */ \ No newline at end of file +#endif /* SPECTRE_CORE_NONCOPYABLE_H */ diff --git a/include/Spectre/Display/DisplayMode.h b/include/Spectre/Display/DisplayMode.h index d12d194..70f62a0 100644 --- a/include/Spectre/Display/DisplayMode.h +++ b/include/Spectre/Display/DisplayMode.h @@ -36,4 +36,4 @@ public : } // namespace sp -#endif /* SPECTRE_DISPLAY_DISPLAYMODE_H */ \ No newline at end of file +#endif /* SPECTRE_DISPLAY_DISPLAYMODE_H */ diff --git a/include/Spectre/Game/FPSCounter.h b/include/Spectre/Game/FPSCounter.h index 2042a75..7e3511b 100644 --- a/include/Spectre/Game/FPSCounter.h +++ b/include/Spectre/Game/FPSCounter.h @@ -11,7 +11,7 @@ class FPSCounter public : FPSCounter(); - // Add a frame to the counter. + // Add a frame to the counter. // Should be called whenever a frame has been rendered. void addFrame(); @@ -44,4 +44,4 @@ private : } // namespace sp -#endif /* SPECTRE_FPS_COUNTER_H */ \ No newline at end of file +#endif /* SPECTRE_FPS_COUNTER_H */ diff --git a/include/Spectre/Game/GameTime.h b/include/Spectre/Game/GameTime.h index 6d4fea3..c1d322b 100644 --- a/include/Spectre/Game/GameTime.h +++ b/include/Spectre/Game/GameTime.h @@ -46,4 +46,4 @@ protected : } // namespace sp -#endif /* SPECTRE_GAME_TIME_H */ \ No newline at end of file +#endif /* SPECTRE_GAME_TIME_H */ diff --git a/include/Spectre/Graphics/BatchRenderer2D.h b/include/Spectre/Graphics/BatchRenderer2D.h index ed383c8..448a503 100644 --- a/include/Spectre/Graphics/BatchRenderer2D.h +++ b/include/Spectre/Graphics/BatchRenderer2D.h @@ -64,7 +64,7 @@ protected : unsigned int m_VBO; RenderState m_state; - + unsigned short m_size; ShaderProgram m_textShader; @@ -73,4 +73,4 @@ protected : } // namespace -#endif /* SPECTRE_BATCH_RENDERER2D_H */ \ No newline at end of file +#endif /* SPECTRE_BATCH_RENDERER2D_H */ diff --git a/include/Spectre/Graphics/DefaultRenderer2D.h b/include/Spectre/Graphics/DefaultRenderer2D.h index 9a35acc..6ef367a 100644 --- a/include/Spectre/Graphics/DefaultRenderer2D.h +++ b/include/Spectre/Graphics/DefaultRenderer2D.h @@ -26,4 +26,4 @@ protected : } // namespace -#endif /* SPECTRE_DEFAULT_RENDERER2D_H */ \ No newline at end of file +#endif /* SPECTRE_DEFAULT_RENDERER2D_H */ diff --git a/include/Spectre/Graphics/OpenGL.h b/include/Spectre/Graphics/OpenGL.h index a07a687..a999a76 100644 --- a/include/Spectre/Graphics/OpenGL.h +++ b/include/Spectre/Graphics/OpenGL.h @@ -4,4 +4,4 @@ #include -#endif /* SPECTRE_OPENGL_H */ \ No newline at end of file +#endif /* SPECTRE_OPENGL_H */ diff --git a/include/Spectre/Graphics/Renderer2D.h b/include/Spectre/Graphics/Renderer2D.h index ed2b2d1..f5192b3 100644 --- a/include/Spectre/Graphics/Renderer2D.h +++ b/include/Spectre/Graphics/Renderer2D.h @@ -32,4 +32,4 @@ protected : } // namespace sp -#endif /* SPECTRE_GRAPHICS_RENDERER2D_H */ \ No newline at end of file +#endif /* SPECTRE_GRAPHICS_RENDERER2D_H */ diff --git a/include/Spectre/Graphics/Shader.h b/include/Spectre/Graphics/Shader.h index d399acd..66e9a5a 100644 --- a/include/Spectre/Graphics/Shader.h +++ b/include/Spectre/Graphics/Shader.h @@ -34,7 +34,7 @@ public : protected : - // Compile the shader. + // Compile the shader. // Returns true if the shader compiled without errors. false otherwise. bool compile(); @@ -55,4 +55,4 @@ protected : } // namespace sp -#endif /* SPECTRE_GRAPHICS_SHADER_H */ \ No newline at end of file +#endif /* SPECTRE_GRAPHICS_SHADER_H */ diff --git a/include/Spectre/Graphics/ShaderProgram.h b/include/Spectre/Graphics/ShaderProgram.h index 5272f64..f11d769 100644 --- a/include/Spectre/Graphics/ShaderProgram.h +++ b/include/Spectre/Graphics/ShaderProgram.h @@ -41,11 +41,11 @@ public : // Returns true if the program was linked successfully bool isLinked() const; - - // Enable this shader + + // Enable this shader // All shader operations after this call will affect this shader. void enable() const; - + // Disable this shader // Operations will no longer affect this shader after this call. void disable() const; diff --git a/include/Spectre/Graphics/Transformable.h b/include/Spectre/Graphics/Transformable.h index 67c4406..4a1325a 100644 --- a/include/Spectre/Graphics/Transformable.h +++ b/include/Spectre/Graphics/Transformable.h @@ -60,4 +60,4 @@ private : } // namespace sp -#endif /* SPECTRE_GRAPHICS_TRANSFORMABLE_H */ \ No newline at end of file +#endif /* SPECTRE_GRAPHICS_TRANSFORMABLE_H */ diff --git a/include/Spectre/Input/InputListener.h b/include/Spectre/Input/InputListener.h index 9f92406..c15a7ae 100644 --- a/include/Spectre/Input/InputListener.h +++ b/include/Spectre/Input/InputListener.h @@ -14,4 +14,4 @@ public : } // namespace sp -#endif /* SPECTRE_INPUT_LISTENER_H */ \ No newline at end of file +#endif /* SPECTRE_INPUT_LISTENER_H */ diff --git a/include/Spectre/Math/Math.h b/include/Spectre/Math/Math.h index 97f62d0..c888b36 100644 --- a/include/Spectre/Math/Math.h +++ b/include/Spectre/Math/Math.h @@ -6,7 +6,7 @@ #include "Vector2.h" #include "Matrix4.h" -namespace sp { namespace math +namespace sp { namespace math { float rand(float min, float max); @@ -50,4 +50,4 @@ namespace sp { namespace math } } // namespace sp -#endif /* SPECTRE_MATH_MATH_H */ \ No newline at end of file +#endif /* SPECTRE_MATH_MATH_H */ diff --git a/include/Spectre/Math/Matrix3.h b/include/Spectre/Math/Matrix3.h index d1d005a..d962cee 100644 --- a/include/Spectre/Math/Matrix3.h +++ b/include/Spectre/Math/Matrix3.h @@ -22,7 +22,7 @@ struct Matrix3 | 0 3 6 | | 1 4 7 | | 2 5 8 | - |_ _| + |_ _| */ T v[9]; }; @@ -32,8 +32,8 @@ struct Matrix3 inline Matrix3(); - inline Matrix3( T a, T b, T c, - T d, T e, T f, + inline Matrix3( T a, T b, T c, + T d, T e, T f, T g, T h, T i); inline Matrix3(T *a); @@ -83,4 +83,4 @@ typedef Matrix3 Matrix3u; #include "Matrix3.inl" -#endif /* SPECTRE_MATH_MATRIX3_H */ \ No newline at end of file +#endif /* SPECTRE_MATH_MATRIX3_H */ diff --git a/include/Spectre/Math/Matrix3.inl b/include/Spectre/Math/Matrix3.inl index 8ac9947..f63cdab 100644 --- a/include/Spectre/Math/Matrix3.inl +++ b/include/Spectre/Math/Matrix3.inl @@ -108,9 +108,9 @@ Matrix3 Matrix3::transpose() const { Matrix3 t; - t.v[0] = v[0]; t.v[3] = v[1]; t.v[6] = v[2]; - t.v[1] = v[3]; t.v[4] = v[4]; t.v[7] = v[5]; - t.v[2] = v[6]; t.v[5] = v[7]; t.v[8] = v[8]; + t.v[0] = v[0]; t.v[3] = v[1]; t.v[6] = v[2]; + t.v[1] = v[3]; t.v[4] = v[4]; t.v[7] = v[5]; + t.v[2] = v[6]; t.v[5] = v[7]; t.v[8] = v[8]; return t; } diff --git a/include/Spectre/Math/Matrix4.h b/include/Spectre/Math/Matrix4.h index f1f7ddf..9b6c1dc 100644 --- a/include/Spectre/Math/Matrix4.h +++ b/include/Spectre/Math/Matrix4.h @@ -109,4 +109,4 @@ typedef Matrix4 mat4u; // ---------------- #include "Matrix4.inl" -#endif /* SPECTRE_MATH_MATRIX4_H */ \ No newline at end of file +#endif /* SPECTRE_MATH_MATRIX4_H */ diff --git a/include/Spectre/Math/Matrix4.inl b/include/Spectre/Math/Matrix4.inl index 586469e..f7a100e 100644 --- a/include/Spectre/Math/Matrix4.inl +++ b/include/Spectre/Math/Matrix4.inl @@ -155,4 +155,4 @@ inline std::ostream& operator<<(std::ostream &s, const Matrix4& mat) return s << mat.toString(); } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/include/Spectre/Math/Transform.h b/include/Spectre/Math/Transform.h index aff5782..dfed6b4 100644 --- a/include/Spectre/Math/Transform.h +++ b/include/Spectre/Math/Transform.h @@ -79,4 +79,4 @@ Vector2f operator*(const Transform& t, const Vector2f& v); } // namespace sp -#endif /* SPECTRE_MATH_TRANSFORM_H */ \ No newline at end of file +#endif /* SPECTRE_MATH_TRANSFORM_H */ diff --git a/include/Spectre/Math/Vector2.inl b/include/Spectre/Math/Vector2.inl index 17bfb14..819695a 100644 --- a/include/Spectre/Math/Vector2.inl +++ b/include/Spectre/Math/Vector2.inl @@ -317,4 +317,4 @@ inline std::ostream& operator<<(std::ostream &s, const Vector2& v) return s << "(" << v.x << "," << v.y << ")"; } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/include/Spectre/Math/Vector3.h b/include/Spectre/Math/Vector3.h index b759747..27e0a37 100644 --- a/include/Spectre/Math/Vector3.h +++ b/include/Spectre/Math/Vector3.h @@ -11,7 +11,7 @@ template struct Vector3 { union { - struct { + struct { T x, y, z; }; T v[3]; diff --git a/include/Spectre/Math/Vector3.inl b/include/Spectre/Math/Vector3.inl index 5859693..1b1d2a4 100644 --- a/include/Spectre/Math/Vector3.inl +++ b/include/Spectre/Math/Vector3.inl @@ -268,4 +268,4 @@ inline std::ostream& operator<<(std::ostream &s, const Vector3& v) return s << "(" << v.x << "," << v.y << "," << v.z << ")"; } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/include/Spectre/Math/Vector4.h b/include/Spectre/Math/Vector4.h index 7b9e45b..0a9ac6c 100644 --- a/include/Spectre/Math/Vector4.h +++ b/include/Spectre/Math/Vector4.h @@ -10,7 +10,7 @@ template struct Vector4 { union { - struct { + struct { T x, y, z, w; }; T v[4]; diff --git a/include/Spectre/Scene/Camera2D.h b/include/Spectre/Scene/Camera2D.h index af62e76..a4b4279 100644 --- a/include/Spectre/Scene/Camera2D.h +++ b/include/Spectre/Scene/Camera2D.h @@ -10,7 +10,7 @@ // TODO: Support unprojection, from Screenspace -> Worldspace. -// TODO: Zoom is implemented using a scale matrix. +// TODO: Zoom is implemented using a scale matrix. // It's abit weird to control. Must be a better solution. namespace sp { @@ -84,4 +84,4 @@ protected : } // namespace sp -#endif /* SPECTRE_SCENE_CAMERA2D_H */ \ No newline at end of file +#endif /* SPECTRE_SCENE_CAMERA2D_H */ diff --git a/include/Spectre/Scene/ICamera.h b/include/Spectre/Scene/ICamera.h index 8d249eb..b78d4cd 100644 --- a/include/Spectre/Scene/ICamera.h +++ b/include/Spectre/Scene/ICamera.h @@ -21,4 +21,4 @@ public : } // namespace sp -#endif /* SPECTRE_SCENE_ICAMERA_H */ \ No newline at end of file +#endif /* SPECTRE_SCENE_ICAMERA_H */ diff --git a/include/Spectre/System/MessageHandler.h b/include/Spectre/System/MessageHandler.h index c82812c..759ae3e 100644 --- a/include/Spectre/System/MessageHandler.h +++ b/include/Spectre/System/MessageHandler.h @@ -16,4 +16,4 @@ public : } // namespace sp -#endif /* SPECTRE_SYSTEM_MESSAGEHANDLER_H */ \ No newline at end of file +#endif /* SPECTRE_SYSTEM_MESSAGEHANDLER_H */ diff --git a/include/Spectre/System/SystemEvent.h b/include/Spectre/System/SystemEvent.h index 31588e8..e802634 100644 --- a/include/Spectre/System/SystemEvent.h +++ b/include/Spectre/System/SystemEvent.h @@ -38,4 +38,4 @@ public : } // namespace sp -#endif /* SYSTEM_EVENT_H */ \ No newline at end of file +#endif /* SYSTEM_EVENT_H */ diff --git a/source/Display/Display.cpp b/source/Display/Display.cpp index 7738b40..6895d06 100644 --- a/source/Display/Display.cpp +++ b/source/Display/Display.cpp @@ -151,4 +151,4 @@ void Display::onReshape(int width, int height) m_context->setSize(width, height); } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Display/DisplayDescription.cpp b/source/Display/DisplayDescription.cpp index fe07531..0f6a72d 100644 --- a/source/Display/DisplayDescription.cpp +++ b/source/Display/DisplayDescription.cpp @@ -15,4 +15,4 @@ decoration (decoration) { } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Display/DisplayMode.cpp b/source/Display/DisplayMode.cpp index 85fea69..4973d08 100644 --- a/source/Display/DisplayMode.cpp +++ b/source/Display/DisplayMode.cpp @@ -55,4 +55,4 @@ DisplayMode DisplayMode::getDesktopMode() return PlatformMisc::GetDesktopMode(); } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Game/FPSCounter.cpp b/source/Game/FPSCounter.cpp index 3fa112f..84fa6b0 100644 --- a/source/Game/FPSCounter.cpp +++ b/source/Game/FPSCounter.cpp @@ -27,7 +27,7 @@ void FPSCounter::setUpdateRate(unsigned int ups) if (ups < 1) { ups = 1; } - + m_updateRate = ups * 1000; // Must reset the counter. diff --git a/source/Game/GameTime.cpp b/source/Game/GameTime.cpp index 1f46431..f5a1d18 100644 --- a/source/Game/GameTime.cpp +++ b/source/Game/GameTime.cpp @@ -60,7 +60,7 @@ void GameTime::reset() void GameTime::accumulateTime() { updateTime(); - + m_acc += (double) (m_current - m_lastUpdate); if (m_acc > (1000.f / m_slice)) { m_acc = 1000.f / m_slice; @@ -77,4 +77,4 @@ void GameTime::updateTime() } } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Graphics/BatchRenderer2D.cpp b/source/Graphics/BatchRenderer2D.cpp index 03e2e88..bad2251 100644 --- a/source/Graphics/BatchRenderer2D.cpp +++ b/source/Graphics/BatchRenderer2D.cpp @@ -220,7 +220,7 @@ unsigned int BatchRenderer2D::addRenderable(Vertex2D* buffer, const Renderable2D const Transform& transform = renderable->getTransform(); const std::vector& vertices = renderable->getVertices(); - // Pretransform vertex positions to skip setting a uniform model + // Pretransform vertex positions to skip setting a uniform model // matrix in the shader for each renderable reducing the number of draw calls. for(size_t i = 0; i < vertices.size(); i++) { diff --git a/source/Graphics/DefaultRenderer2D.cpp b/source/Graphics/DefaultRenderer2D.cpp index da943a8..8076d47 100644 --- a/source/Graphics/DefaultRenderer2D.cpp +++ b/source/Graphics/DefaultRenderer2D.cpp @@ -6,7 +6,7 @@ namespace sp { -DefaultRenderer2D::DefaultRenderer2D() +DefaultRenderer2D::DefaultRenderer2D() { m_shader.create(); if (!m_shader.loadFromFile("assets/shaders/standard.shader.glsl")) { @@ -73,4 +73,4 @@ void DefaultRenderer2D::render() m_queue.clear(); } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Graphics/Font.cpp b/source/Graphics/Font.cpp index fd24c3a..2f76461 100644 --- a/source/Graphics/Font.cpp +++ b/source/Graphics/Font.cpp @@ -114,7 +114,7 @@ Vector2u Font::findTextureRegion(const Image& img) const resizeTexture(); } } - + pos = m_cacheTextureA.texpos; m_cacheTextureA.texpos.x += img.getWidth() + 1; @@ -127,4 +127,4 @@ const Texture* Font::getTexture() const return &m_cacheTextureA.texture; } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Graphics/Font/FontDriver.cpp b/source/Graphics/Font/FontDriver.cpp index dc7603f..e64e54d 100644 --- a/source/Graphics/Font/FontDriver.cpp +++ b/source/Graphics/Font/FontDriver.cpp @@ -13,4 +13,4 @@ void FontDriver::setHinting(bool value) m_hinting = value; } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Graphics/Font/FreeTypeDriver.cpp b/source/Graphics/Font/FreeTypeDriver.cpp index 08a58e1..aa953c4 100644 --- a/source/Graphics/Font/FreeTypeDriver.cpp +++ b/source/Graphics/Font/FreeTypeDriver.cpp @@ -80,14 +80,14 @@ bool FreeTypeDriver::setCharacterSize(unsigned int size) return true; } -bool FreeTypeDriver::loadFromFile(const std::string& filename) +bool FreeTypeDriver::loadFromFile(const std::string& filename) { FT_Face face; FT_Error error; error = FT_New_Face(LibWrapper::getInstance().handle, filename.c_str(), 0, &face); if (error) { - Log::warn("FreeType: could not load file (%s): %s", + Log::warn("FreeType: could not load file (%s): %s", filename.c_str(), FT_GetErrorString(error)); return false; } @@ -168,4 +168,4 @@ std::string FreeTypeDriver::getName() return m_face->family_name; } -} // namespace \ No newline at end of file +} // namespace diff --git a/source/Graphics/Font/FreeTypeError.cpp b/source/Graphics/Font/FreeTypeError.cpp index 57cc581..abe83f3 100644 --- a/source/Graphics/Font/FreeTypeError.cpp +++ b/source/Graphics/Font/FreeTypeError.cpp @@ -11,7 +11,7 @@ const struct error_list { int code; const char* msg; -} ft_errors[] = +} ft_errors[] = #include FT_ERRORS_H const char* FT_GetErrorString(FT_Error error) { diff --git a/source/Graphics/Font/FreeTypeError.h b/source/Graphics/Font/FreeTypeError.h index 4c19c87..47d76e3 100644 --- a/source/Graphics/Font/FreeTypeError.h +++ b/source/Graphics/Font/FreeTypeError.h @@ -7,4 +7,4 @@ const char* FT_GetErrorString(FT_Error error); -#endif /* SPECTRE_GRAPHICS_FONT_FREETYPE_ERROR_H */ \ No newline at end of file +#endif /* SPECTRE_GRAPHICS_FONT_FREETYPE_ERROR_H */ diff --git a/source/Graphics/GL/CheckError.cpp b/source/Graphics/GL/CheckError.cpp index 8069616..36a25ec 100644 --- a/source/Graphics/GL/CheckError.cpp +++ b/source/Graphics/GL/CheckError.cpp @@ -9,4 +9,4 @@ void glCheckError(const char *file, unsigned int line, const char *expr) { if (err != GL_NO_ERROR) { std::string msg; } -} \ No newline at end of file +} diff --git a/source/Graphics/GL/CheckError.h b/source/Graphics/GL/CheckError.h index 8c98141..192ac5f 100644 --- a/source/Graphics/GL/CheckError.h +++ b/source/Graphics/GL/CheckError.h @@ -4,8 +4,8 @@ #include -#define checkGLError(expr) do { expr; glCheckError(__FILE__, __LINE__, #expr); } while(false) +#define checkGLError(expr) do { expr; glCheckError(__FILE__, __LINE__, #expr); } while(false) void glCheckError(const char *file, unsigned int line, const char *expr); -#endif /* SPECTRE_GRAPHICS_GL_CHECKERROR_H */ \ No newline at end of file +#endif /* SPECTRE_GRAPHICS_GL_CHECKERROR_H */ diff --git a/source/Graphics/Image.cpp b/source/Graphics/Image.cpp index 5497c60..f04de34 100644 --- a/source/Graphics/Image.cpp +++ b/source/Graphics/Image.cpp @@ -210,4 +210,4 @@ const unsigned char* Image::getPixels() const return NULL; } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Graphics/OpenGL.cpp b/source/Graphics/OpenGL.cpp index 06513f8..55ecee9 100644 --- a/source/Graphics/OpenGL.cpp +++ b/source/Graphics/OpenGL.cpp @@ -90,4 +90,4 @@ void Graphics::swapBuffers() m_display->swapBuffers(); } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Graphics/RenderState.cpp b/source/Graphics/RenderState.cpp index 81c24af..b6330b8 100644 --- a/source/Graphics/RenderState.cpp +++ b/source/Graphics/RenderState.cpp @@ -22,7 +22,7 @@ void RenderState::enableTexture(const Texture *texture) // Enable the new texture. if (texture) { texture->enable(); - } + } // No texture selected. // Must unbind cached texture if set. else if (m_texture) { @@ -49,4 +49,4 @@ void RenderState::cleanup() } } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Graphics/Renderable2D.cpp b/source/Graphics/Renderable2D.cpp index d7d85e5..780f766 100644 --- a/source/Graphics/Renderable2D.cpp +++ b/source/Graphics/Renderable2D.cpp @@ -8,7 +8,7 @@ m_zorder (0) { } -Renderable2D::Renderable2D(const Vector2f& position) : +Renderable2D::Renderable2D(const Vector2f& position) : m_zorder (0), Transformable (position) { @@ -28,4 +28,4 @@ void Renderable2D::setZOrder(unsigned char value) m_zorder = value; } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Graphics/Renderer2D.cpp b/source/Graphics/Renderer2D.cpp index 6e48eb5..bc47a5f 100644 --- a/source/Graphics/Renderer2D.cpp +++ b/source/Graphics/Renderer2D.cpp @@ -16,4 +16,4 @@ void Renderer2D::setCamera(const Camera2D& camera) m_camera = &camera; } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Graphics/Shader.cpp b/source/Graphics/Shader.cpp index c0b750d..c1827c5 100644 --- a/source/Graphics/Shader.cpp +++ b/source/Graphics/Shader.cpp @@ -101,4 +101,4 @@ std::string Shader::fetchErrorLog() return std::string(buf); } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Graphics/ShaderProgram.cpp b/source/Graphics/ShaderProgram.cpp index b6dceaa..79da3c4 100644 --- a/source/Graphics/ShaderProgram.cpp +++ b/source/Graphics/ShaderProgram.cpp @@ -47,7 +47,7 @@ bool ShaderProgram::loadFromFile(const std::string& filename) std::string base_name = filename.substr(0, filename.length() - extension.length()); // vert and frag are not optional. they must exist. - return loadFromFile(base_name + "vert.glsl", Shader::Type::Vertex) && + return loadFromFile(base_name + "vert.glsl", Shader::Type::Vertex) && loadFromFile(base_name + "frag.glsl", Shader::Type::Fragment); } else if (extension == "vert.glsl") { @@ -117,7 +117,7 @@ void ShaderProgram::enable() const { glUseProgram(m_id); } - + void ShaderProgram::disable() const { glUseProgram(0); @@ -194,4 +194,4 @@ std::string ShaderProgram::fetchErrorLog() return std::string(buf); } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Graphics/Sprite.cpp b/source/Graphics/Sprite.cpp index 092ecd4..1f1d7aa 100644 --- a/source/Graphics/Sprite.cpp +++ b/source/Graphics/Sprite.cpp @@ -86,7 +86,7 @@ void Sprite::setTextureCoords(const vec2u& pos, const vec2u& size) float left = pos.x / tex_size.x; float right = left + (size.x / tex_size.x); float top = pos.y / tex_size.y; - float bottom = top + (size.y / tex_size.y); + float bottom = top + (size.y / tex_size.y); m_vertices[0].uv = Vector2f(left , top); m_vertices[1].uv = Vector2f(left , bottom); @@ -118,4 +118,4 @@ void Sprite::render(Renderer2D& renderer) const renderer.draw(this); } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Graphics/Text.cpp b/source/Graphics/Text.cpp index 36c8bc3..c28d209 100644 --- a/source/Graphics/Text.cpp +++ b/source/Graphics/Text.cpp @@ -177,4 +177,4 @@ void Text::render(Renderer2D& renderer) const renderer.draw(this); } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Graphics/Texture.cpp b/source/Graphics/Texture.cpp index f1d9d11..954adf7 100644 --- a/source/Graphics/Texture.cpp +++ b/source/Graphics/Texture.cpp @@ -60,8 +60,8 @@ void Texture::create(unsigned width, unsigned heigth, PixelFormat format) glPixelStorei(GL_UNPACK_ALIGNMENT, 1); } - glTexImage2D(GL_TEXTURE_2D, 0, - pixelFormatToInternal(format), width, heigth, 0, + glTexImage2D(GL_TEXTURE_2D, 0, + pixelFormatToInternal(format), width, heigth, 0, pixelFormatToGL(format), GL_UNSIGNED_BYTE, &empty_pixels[0]); setSmooth(true); @@ -98,7 +98,7 @@ void Texture::create(const Image& image) srcFormat = pixelFormatToGL(image.getFormat()); glFormat = pixelFormatToInternal(image.getFormat()); - glTexImage2D(GL_TEXTURE_2D, 0, glFormat, m_size.x, m_size.y, + glTexImage2D(GL_TEXTURE_2D, 0, glFormat, m_size.x, m_size.y, 0, srcFormat, GL_UNSIGNED_BYTE, image.getPixels()); setSmooth(true); @@ -157,8 +157,8 @@ void Texture::update(vec2u pos, const Image& image) format = pixelFormatToGL(image.getFormat()); - glTexSubImage2D(GL_TEXTURE_2D, 0, pos.x, pos.y, - image.getWidth(), image.getHeight(), + glTexSubImage2D(GL_TEXTURE_2D, 0, pos.x, pos.y, + image.getWidth(), image.getHeight(), format, GL_UNSIGNED_BYTE, image.getPixels()); disable(); @@ -180,9 +180,9 @@ Image Texture::copyToImage() const //glPixelStorei(GL_PACK_ALIGNMENT, 4); - glGetTexImage(GL_TEXTURE_2D, 0, - pixelFormatToGL(m_format), - GL_UNSIGNED_BYTE, + glGetTexImage(GL_TEXTURE_2D, 0, + pixelFormatToGL(m_format), + GL_UNSIGNED_BYTE, &pixels[0]); img.create(m_format, m_size.x, m_size.y, &pixels[0]); @@ -255,4 +255,4 @@ bool Texture::operator!=(const Texture* other) const return m_id != other->m_id; } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Graphics/Transformable.cpp b/source/Graphics/Transformable.cpp index c729162..a5b2ece 100644 --- a/source/Graphics/Transformable.cpp +++ b/source/Graphics/Transformable.cpp @@ -96,4 +96,4 @@ const Transform& Transformable::getTransform() const return m_transform; } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Input/InputDevice.cpp b/source/Input/InputDevice.cpp index 83d24e4..cffa4a3 100644 --- a/source/Input/InputDevice.cpp +++ b/source/Input/InputDevice.cpp @@ -11,4 +11,4 @@ void InputDevice::init() { } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Input/InputEvent.cpp b/source/Input/InputEvent.cpp index 0bd96c9..4bc80c4 100644 --- a/source/Input/InputEvent.cpp +++ b/source/Input/InputEvent.cpp @@ -5,7 +5,7 @@ namespace sp { -InputEvent::InputEvent(Type type) : +InputEvent::InputEvent(Type type) : type (type) { } @@ -20,4 +20,4 @@ std::string InputEvent::MouseButtonEvent::getName() const return Mouse::getButtonName(button); } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Input/InputListener.cpp b/source/Input/InputListener.cpp index 6fce171..2310737 100644 --- a/source/Input/InputListener.cpp +++ b/source/Input/InputListener.cpp @@ -7,4 +7,4 @@ void InputListener::onInputEvent(const InputEvent& event) { } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Input/InputModule.cpp b/source/Input/InputModule.cpp index 977cc9d..3f5f3ec 100644 --- a/source/Input/InputModule.cpp +++ b/source/Input/InputModule.cpp @@ -42,7 +42,7 @@ void InputModule::registerListener(InputListener* listener) void InputModule::removeListener(InputListener* listener) { - + } Mouse* InputModule::getMouse() @@ -97,4 +97,4 @@ void InputModule::dispatch() m_buffer.clear(); } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Input/Keyboard.cpp b/source/Input/Keyboard.cpp index 3942dff..6c64bf5 100644 --- a/source/Input/Keyboard.cpp +++ b/source/Input/Keyboard.cpp @@ -60,7 +60,7 @@ struct keyentry table[] = { MapSym(Key::Down, "Down"), MapSym(Key::Left, "Left"), MapSym(Key::Right, "Right"), - + // Numpad MapSym(Key::NUMPAD_1, "Numpad 1"), MapSym(Key::NUMPAD_2, "Numpad 2"), @@ -113,4 +113,4 @@ std::string Keyboard::getKeyName(Key::Type key) return table[key].name; } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Input/Mouse.cpp b/source/Input/Mouse.cpp index 4520d5e..45edde6 100644 --- a/source/Input/Mouse.cpp +++ b/source/Input/Mouse.cpp @@ -21,4 +21,4 @@ std::string Mouse::getButtonName(MouseButton::Type button) } } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Math/Color.cpp b/source/Math/Color.cpp index 8150278..94458be 100644 --- a/source/Math/Color.cpp +++ b/source/Math/Color.cpp @@ -129,4 +129,4 @@ Color operator *(const Color& c, unsigned int s) return Color(c.r * s, c.g * s, c.b * s, c.a * s); } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Math/Math.cpp b/source/Math/Math.cpp index bee7afd..2cfdf76 100644 --- a/source/Math/Math.cpp +++ b/source/Math/Math.cpp @@ -29,7 +29,7 @@ namespace sp { namespace math float bottom, float top, float zNear, float zFar) { - float rl = (right - left), + float rl = (right - left), tb = (top - bottom), fn = (zFar - zNear), rl2 = 2.0f / rl, diff --git a/source/Math/Transform.cpp b/source/Math/Transform.cpp index ad9905c..4d54068 100644 --- a/source/Math/Transform.cpp +++ b/source/Math/Transform.cpp @@ -154,7 +154,7 @@ Transform& operator*=(Transform& a, const Transform& other) return a; } -Vector2f operator*(const Transform& transform, const Vector2f& vec) +Vector2f operator*(const Transform& transform, const Vector2f& vec) { return transform.transformPoint(vec); } diff --git a/source/Platform/PlatformApplication.h b/source/Platform/PlatformApplication.h index b6cbc47..21315e8 100644 --- a/source/Platform/PlatformApplication.h +++ b/source/Platform/PlatformApplication.h @@ -26,4 +26,4 @@ public : } // namespace sp -#endif /* SPECTRE_PLATFORM_H */ \ No newline at end of file +#endif /* SPECTRE_PLATFORM_H */ diff --git a/source/Platform/PlatformDisplay.cpp b/source/Platform/PlatformDisplay.cpp index dfe33bf..154930e 100644 --- a/source/Platform/PlatformDisplay.cpp +++ b/source/Platform/PlatformDisplay.cpp @@ -33,4 +33,4 @@ void PlatformDisplay::onReshape(int width, int height) m_parent->onReshape(width, height); } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Platform/PlatformDisplay.h b/source/Platform/PlatformDisplay.h index cf16c14..f805732 100644 --- a/source/Platform/PlatformDisplay.h +++ b/source/Platform/PlatformDisplay.h @@ -1,6 +1,6 @@ #ifndef SPECTRE_PLATFORM_DISPLAY_H -#define SPECTRE_PLATFORM_DISPLAY_H +#define SPECTRE_PLATFORM_DISPLAY_H #include #include @@ -53,4 +53,4 @@ private : } // namespace sp -#endif /* SPECTRE_PLATFORM_DISPLAY_H */ \ No newline at end of file +#endif /* SPECTRE_PLATFORM_DISPLAY_H */ diff --git a/source/Platform/Win32/Win32Application.cpp b/source/Platform/Win32/Win32Application.cpp index 3e51837..20124e5 100644 --- a/source/Platform/Win32/Win32Application.cpp +++ b/source/Platform/Win32/Win32Application.cpp @@ -97,4 +97,4 @@ LRESULT Win32Application::processMessage(MSG msg) return DispatchMessage(&msg); } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Platform/Win32/Win32GLContext.cpp b/source/Platform/Win32/Win32GLContext.cpp index 668f962..13bb7d4 100644 --- a/source/Platform/Win32/Win32GLContext.cpp +++ b/source/Platform/Win32/Win32GLContext.cpp @@ -9,7 +9,7 @@ namespace sp { -// Can't use GLAD's standard loader function because it +// Can't use GLAD's standard loader function because it // calls wglGetProcAddress without __stdcall // that results in some runtime exception. static GLADapiproc func_loader(const char *name) { @@ -186,4 +186,4 @@ bool Win32GLContext::setPixelFormat() return false; } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Platform/Win32/Win32Input.cpp b/source/Platform/Win32/Win32Input.cpp index 0474539..40cc230 100644 --- a/source/Platform/Win32/Win32Input.cpp +++ b/source/Platform/Win32/Win32Input.cpp @@ -28,4 +28,4 @@ void Win32Input::update() { } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Platform/Win32/Win32Internal.cpp b/source/Platform/Win32/Win32Internal.cpp index e75ad80..85658d0 100644 --- a/source/Platform/Win32/Win32Internal.cpp +++ b/source/Platform/Win32/Win32Internal.cpp @@ -7,12 +7,12 @@ const char* Win32GetMessage(DWORD messageId) { static char buf[1024] = { '\0' }; DWORD rc = FormatMessage( - FORMAT_MESSAGE_IGNORE_INSERTS | - FORMAT_MESSAGE_FROM_SYSTEM, - NULL, messageId, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + FORMAT_MESSAGE_IGNORE_INSERTS | + FORMAT_MESSAGE_FROM_SYSTEM, + NULL, messageId, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, 1024, NULL); - + if (!rc) { strcpy_s(buf, "Unkown error!\n"); } diff --git a/source/Platform/Win32/Win32Internal.h b/source/Platform/Win32/Win32Internal.h index 3084488..59d4905 100644 --- a/source/Platform/Win32/Win32Internal.h +++ b/source/Platform/Win32/Win32Internal.h @@ -7,4 +7,4 @@ const char* Win32GetMessage(DWORD messageId); -#endif /* PLATFORM_WIN32_INTERNAL_H */ \ No newline at end of file +#endif /* PLATFORM_WIN32_INTERNAL_H */ diff --git a/source/Platform/Win32/Win32Keyboard.cpp b/source/Platform/Win32/Win32Keyboard.cpp index d9fef35..8cbd4ee 100644 --- a/source/Platform/Win32/Win32Keyboard.cpp +++ b/source/Platform/Win32/Win32Keyboard.cpp @@ -120,4 +120,4 @@ bool Win32Keyboard::handleMessage(MSG message) return msg_buf.postMessage(message); } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Platform/Win32/Win32Misc.cpp b/source/Platform/Win32/Win32Misc.cpp index d20ad9c..49ef357 100644 --- a/source/Platform/Win32/Win32Misc.cpp +++ b/source/Platform/Win32/Win32Misc.cpp @@ -23,4 +23,4 @@ DisplayMode PlatformMisc::GetDesktopMode() return DisplayMode(); } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Platform/Win32/Win32Mouse.cpp b/source/Platform/Win32/Win32Mouse.cpp index e652f3d..3675486 100644 --- a/source/Platform/Win32/Win32Mouse.cpp +++ b/source/Platform/Win32/Win32Mouse.cpp @@ -10,7 +10,7 @@ namespace sp { static Win32MsgBuffer msg_buf; -static Vector2f _normalizePos(int x, int y, RECT area) +static Vector2f _normalizePos(int x, int y, RECT area) { Vector2f out; @@ -75,8 +75,8 @@ void Win32Mouse::update(InputModule *input) m_state[MouseButton::Middle] = event.mouseButton.pressed; input->postInputEvent(event); - } else if (msg.message == WM_XBUTTONDOWN || msg.message == WM_XBUTTONUP) { - + } else if (msg.message == WM_XBUTTONDOWN || msg.message == WM_XBUTTONUP) { + int btn = GET_XBUTTON_WPARAM(msg.wParam); InputEvent event(InputEvent::MouseButton); @@ -90,7 +90,7 @@ void Win32Mouse::update(InputModule *input) InputEvent event(InputEvent::MousePosition); RECT area = GetClientArea(msg.hwnd); - + int x = LOWORD(msg.lParam); int y = HIWORD(msg.lParam); @@ -116,4 +116,4 @@ bool Win32Mouse::handleMessage(MSG message) return msg_buf.postMessage(message); } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Platform/Win32/Win32MsgBuffer.cpp b/source/Platform/Win32/Win32MsgBuffer.cpp index 318e0b3..a1d6693 100644 --- a/source/Platform/Win32/Win32MsgBuffer.cpp +++ b/source/Platform/Win32/Win32MsgBuffer.cpp @@ -19,4 +19,4 @@ bool Win32MsgBuffer::postMessage(MSG msg) return false; } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/Platform/Win32/Win32MsgBuffer.h b/source/Platform/Win32/Win32MsgBuffer.h index 9518f93..e7bf87b 100644 --- a/source/Platform/Win32/Win32MsgBuffer.h +++ b/source/Platform/Win32/Win32MsgBuffer.h @@ -19,4 +19,4 @@ struct Win32MsgBuffer { } // namespace sp -#endif /* PLATFORM_WIN32_MSG_BUFFER_H */ \ No newline at end of file +#endif /* PLATFORM_WIN32_MSG_BUFFER_H */ diff --git a/source/Scene/Camera2D.cpp b/source/Scene/Camera2D.cpp index 7e4fd08..bba4b0f 100644 --- a/source/Scene/Camera2D.cpp +++ b/source/Scene/Camera2D.cpp @@ -175,4 +175,4 @@ const Transform& Camera2D::getTransform() const return m_view; } -} // namespace sp \ No newline at end of file +} // namespace sp diff --git a/source/System/Log.cpp b/source/System/Log.cpp index 7870906..257351c 100644 --- a/source/System/Log.cpp +++ b/source/System/Log.cpp @@ -3,7 +3,7 @@ #include #include -namespace sp +namespace sp { void Log::info(const char *message, ...) { diff --git a/source/System/SystemEvent.cpp b/source/System/SystemEvent.cpp index ad66452..2d625be 100644 --- a/source/System/SystemEvent.cpp +++ b/source/System/SystemEvent.cpp @@ -17,4 +17,4 @@ SysEvent SysEvent::sizeEvent(Display *display, int width, int height) return event; } -} // namespace sp \ No newline at end of file +} // namespace sp