From 67f34ceb8cf49eb26f4d0dc2224578da6468b16d Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 23 Apr 2024 16:45:29 +0300 Subject: [PATCH] minor refactor --- src/assets/AssetsLoader.cpp | 2 +- src/files/WorldConverter.cpp | 2 +- src/files/WorldFiles.h | 2 +- src/files/WorldRegions.cpp | 2 +- src/files/{WorldRegions.h => WorldRegions.hpp} | 8 ++++---- src/graphics/core/Atlas.hpp | 6 +++--- src/graphics/core/Batch2D.hpp | 6 +++--- src/graphics/core/Batch3D.hpp | 6 +++--- src/graphics/core/Cubemap.hpp | 6 +++--- src/graphics/core/Font.hpp | 6 +++--- src/graphics/core/Framebuffer.hpp | 6 +++--- src/graphics/core/GfxContext.hpp | 6 +++--- src/graphics/core/ImageData.hpp | 6 +++--- src/graphics/core/LineBatch.hpp | 6 +++--- src/graphics/core/Mesh.hpp | 6 +++--- src/graphics/core/PostProcessing.h | 6 +++--- src/graphics/core/Shader.hpp | 6 +++--- src/graphics/core/Texture.hpp | 6 +++--- src/graphics/core/TextureAnimation.hpp | 6 +++--- src/graphics/core/Viewport.hpp | 6 +++--- src/graphics/core/commons.hpp | 6 +++--- src/graphics/core/gl_util.hpp | 6 +++--- src/graphics/render/ChunksRenderer.h | 2 +- src/util/{BufferPool.h => BufferPool.hpp} | 6 +++--- src/util/{ThreadPool.h => ThreadPool.hpp} | 6 +++--- 25 files changed, 66 insertions(+), 66 deletions(-) rename src/files/{WorldRegions.h => WorldRegions.hpp} (97%) rename src/util/{BufferPool.h => BufferPool.hpp} (92%) rename src/util/{ThreadPool.h => ThreadPool.hpp} (98%) diff --git a/src/assets/AssetsLoader.cpp b/src/assets/AssetsLoader.cpp index 63134648..544dcb10 100644 --- a/src/assets/AssetsLoader.cpp +++ b/src/assets/AssetsLoader.cpp @@ -6,7 +6,7 @@ #include #include -#include "../util/ThreadPool.h" +#include "../util/ThreadPool.hpp" #include "../constants.h" #include "../data/dynamic.h" diff --git a/src/files/WorldConverter.cpp b/src/files/WorldConverter.cpp index 8c81b1d8..7db2b917 100644 --- a/src/files/WorldConverter.cpp +++ b/src/files/WorldConverter.cpp @@ -11,7 +11,7 @@ #include "../content/ContentLUT.h" #include "../objects/Player.h" #include "../debug/Logger.h" -#include "../util/ThreadPool.h" +#include "../util/ThreadPool.hpp" namespace fs = std::filesystem; diff --git a/src/files/WorldFiles.h b/src/files/WorldFiles.h index 70db605c..bb816125 100644 --- a/src/files/WorldFiles.h +++ b/src/files/WorldFiles.h @@ -1,7 +1,7 @@ #ifndef FILES_WORLD_FILES_H_ #define FILES_WORLD_FILES_H_ -#include "WorldRegions.h" +#include "WorldRegions.hpp" #include "files.h" #include "../typedefs.h" diff --git a/src/files/WorldRegions.cpp b/src/files/WorldRegions.cpp index 9be46960..29ffcd5f 100644 --- a/src/files/WorldRegions.cpp +++ b/src/files/WorldRegions.cpp @@ -1,4 +1,4 @@ -#include "WorldRegions.h" +#include "WorldRegions.hpp" #include "../coders/rle.h" #include "../util/data_io.h" diff --git a/src/files/WorldRegions.h b/src/files/WorldRegions.hpp similarity index 97% rename from src/files/WorldRegions.h rename to src/files/WorldRegions.hpp index 65c35f6a..baeca195 100644 --- a/src/files/WorldRegions.h +++ b/src/files/WorldRegions.hpp @@ -1,9 +1,9 @@ -#ifndef FILES_WORLD_REGIONS_H_ -#define FILES_WORLD_REGIONS_H_ +#ifndef FILES_WORLD_REGIONS_HPP_ +#define FILES_WORLD_REGIONS_HPP_ #include "files.h" #include "../typedefs.h" -#include "../util/BufferPool.h" +#include "../util/BufferPool.hpp" #include "../voxels/Chunk.h" #include @@ -162,4 +162,4 @@ public: static bool parseRegionFilename(const std::string& name, int& x, int& y); }; -#endif // FILES_WORLD_REGIONS_H_ +#endif // FILES_WORLD_REGIONS_HPP_ diff --git a/src/graphics/core/Atlas.hpp b/src/graphics/core/Atlas.hpp index 05762693..1450196d 100644 --- a/src/graphics/core/Atlas.hpp +++ b/src/graphics/core/Atlas.hpp @@ -1,5 +1,5 @@ -#ifndef GRAPHICS_CORE_ATLAS_H_ -#define GRAPHICS_CORE_ATLAS_H_ +#ifndef GRAPHICS_CORE_ATLAS_HPP_ +#define GRAPHICS_CORE_ATLAS_HPP_ #include #include @@ -58,4 +58,4 @@ public: Atlas* build(uint extrusion, bool prepare=true, uint maxResolution=0); }; -#endif // GRAPHICS_CORE_ATLAS_H_ +#endif // GRAPHICS_CORE_ATLAS_HPP_ diff --git a/src/graphics/core/Batch2D.hpp b/src/graphics/core/Batch2D.hpp index d3313312..7c0832ef 100644 --- a/src/graphics/core/Batch2D.hpp +++ b/src/graphics/core/Batch2D.hpp @@ -1,5 +1,5 @@ -#ifndef GRAPHICS_CORE_BATCH2D_H_ -#define GRAPHICS_CORE_BATCH2D_H_ +#ifndef GRAPHICS_CORE_BATCH2D_HPP_ +#define GRAPHICS_CORE_BATCH2D_HPP_ #include #include @@ -92,4 +92,4 @@ public: void lineWidth(float width); }; -#endif // GRAPHICS_CORE_BATCH2D_H_ +#endif // GRAPHICS_CORE_BATCH2D_HPP_ diff --git a/src/graphics/core/Batch3D.hpp b/src/graphics/core/Batch3D.hpp index 43354366..8a457a67 100644 --- a/src/graphics/core/Batch3D.hpp +++ b/src/graphics/core/Batch3D.hpp @@ -1,5 +1,5 @@ -#ifndef GRAPHICS_CORE_BATCH3D_H_ -#define GRAPHICS_CORE_BATCH3D_H_ +#ifndef GRAPHICS_CORE_BATCH3D_HPP_ +#define GRAPHICS_CORE_BATCH3D_HPP_ #include "../../maths/UVRegion.h" #include "../../typedefs.h" @@ -51,4 +51,4 @@ public: void flushPoints(); }; -#endif // GRAPHICS_CORE_BATCH3D_H_ +#endif // GRAPHICS_CORE_BATCH3D_HPP_ diff --git a/src/graphics/core/Cubemap.hpp b/src/graphics/core/Cubemap.hpp index 8921116a..21f6c378 100644 --- a/src/graphics/core/Cubemap.hpp +++ b/src/graphics/core/Cubemap.hpp @@ -1,5 +1,5 @@ -#ifndef GRAPHICS_CORE_CUBEMAP_H_ -#define GRAPHICS_CORE_CUBEMAP_H_ +#ifndef GRAPHICS_CORE_CUBEMAP_HPP_ +#define GRAPHICS_CORE_CUBEMAP_HPP_ #include "Texture.hpp" @@ -12,4 +12,4 @@ public: virtual void unbind() override; }; -#endif // GRAPHICS_CORE_CUBEMAP_H_ +#endif // GRAPHICS_CORE_CUBEMAP_HPP_ diff --git a/src/graphics/core/Font.hpp b/src/graphics/core/Font.hpp index 2c09f044..1a8dc4a6 100644 --- a/src/graphics/core/Font.hpp +++ b/src/graphics/core/Font.hpp @@ -1,5 +1,5 @@ -#ifndef GRAPHICS_CORE_FONT_H_ -#define GRAPHICS_CORE_FONT_H_ +#ifndef GRAPHICS_CORE_FONT_HPP_ +#define GRAPHICS_CORE_FONT_HPP_ #include #include @@ -40,4 +40,4 @@ public: void draw(Batch2D* batch, std::wstring_view text, int x, int y, FontStyle style); }; -#endif // GRAPHICS_CORE_FONT_H_ +#endif // GRAPHICS_CORE_FONT_HPP_ diff --git a/src/graphics/core/Framebuffer.hpp b/src/graphics/core/Framebuffer.hpp index 8580f4d5..e72e46ad 100644 --- a/src/graphics/core/Framebuffer.hpp +++ b/src/graphics/core/Framebuffer.hpp @@ -1,5 +1,5 @@ -#ifndef GRAPHICS_CORE_FRAMEBUFFER_H_ -#define GRAPHICS_CORE_FRAMEBUFFER_H_ +#ifndef GRAPHICS_CORE_FRAMEBUFFER_HPP_ +#define GRAPHICS_CORE_FRAMEBUFFER_HPP_ #include "../../typedefs.h" @@ -39,4 +39,4 @@ public: uint getHeight() const; }; -#endif // GRAPHICS_CORE_FRAMEBUFFER_H_ +#endif // GRAPHICS_CORE_FRAMEBUFFER_HPP_ diff --git a/src/graphics/core/GfxContext.hpp b/src/graphics/core/GfxContext.hpp index a3b1de3b..fb627e8e 100644 --- a/src/graphics/core/GfxContext.hpp +++ b/src/graphics/core/GfxContext.hpp @@ -1,5 +1,5 @@ -#ifndef GRAPHICS_CORE_GFX_CONTEXT_H_ -#define GRAPHICS_CORE_GFX_CONTEXT_H_ +#ifndef GRAPHICS_CORE_GFX_CONTEXT_HPP_ +#define GRAPHICS_CORE_GFX_CONTEXT_HPP_ #include "Viewport.hpp" #include "../../window/Window.h" @@ -35,4 +35,4 @@ public: void setScissors(glm::vec4 area); }; -#endif // GRAPHICS_CORE_GFX_CONTEXT_H_ +#endif // GRAPHICS_CORE_GFX_CONTEXT_HPP_ diff --git a/src/graphics/core/ImageData.hpp b/src/graphics/core/ImageData.hpp index 41730087..a64fedb0 100644 --- a/src/graphics/core/ImageData.hpp +++ b/src/graphics/core/ImageData.hpp @@ -1,5 +1,5 @@ -#ifndef GRAPHICS_CORE_IMAGE_DATA_H_ -#define GRAPHICS_CORE_IMAGE_DATA_H_ +#ifndef GRAPHICS_CORE_IMAGE_DATA_HPP_ +#define GRAPHICS_CORE_IMAGE_DATA_HPP_ #include "../../typedefs.h" @@ -46,4 +46,4 @@ public: extern ImageData* add_atlas_margins(ImageData* image, int grid_size); -#endif // GRAPHICS_CORE_IMAGE_DATA_H_ \ No newline at end of file +#endif // GRAPHICS_CORE_IMAGE_DATA_HPP_ diff --git a/src/graphics/core/LineBatch.hpp b/src/graphics/core/LineBatch.hpp index 7b0d13cb..0cd8065a 100644 --- a/src/graphics/core/LineBatch.hpp +++ b/src/graphics/core/LineBatch.hpp @@ -1,5 +1,5 @@ -#ifndef GRAPHICS_CORE_LINEBATCH_H_ -#define GRAPHICS_CORE_LINEBATCH_H_ +#ifndef GRAPHICS_CORE_LINEBATCH_HPP_ +#define GRAPHICS_CORE_LINEBATCH_HPP_ #include #include @@ -33,4 +33,4 @@ public: void lineWidth(float width); }; -#endif // GRAPHICS_CORE_LINEBATCH_H_ +#endif // GRAPHICS_CORE_LINEBATCH_HPP_ diff --git a/src/graphics/core/Mesh.hpp b/src/graphics/core/Mesh.hpp index ccfc6a71..e2de99d0 100644 --- a/src/graphics/core/Mesh.hpp +++ b/src/graphics/core/Mesh.hpp @@ -1,5 +1,5 @@ -#ifndef GRAPHICS_CORE_MESH_H_ -#define GRAPHICS_CORE_MESH_H_ +#ifndef GRAPHICS_CORE_MESH_HPP_ +#define GRAPHICS_CORE_MESH_HPP_ #include #include "../../typedefs.h" @@ -39,4 +39,4 @@ public: static int meshesCount; }; -#endif // GRAPHICS_CORE_MESH_H_ +#endif // GRAPHICS_CORE_MESH_HPP_ diff --git a/src/graphics/core/PostProcessing.h b/src/graphics/core/PostProcessing.h index a8668edc..f72762ab 100644 --- a/src/graphics/core/PostProcessing.h +++ b/src/graphics/core/PostProcessing.h @@ -1,5 +1,5 @@ -#ifndef GRAPHICS_CORE_POST_PROCESSING_H_ -#define GRAPHICS_CORE_POST_PROCESSING_H_ +#ifndef GRAPHICS_CORE_POST_PROCESSING_HPP_ +#define GRAPHICS_CORE_POST_PROCESSING_HPP_ #include "Viewport.hpp" #include "GfxContext.hpp" @@ -39,4 +39,4 @@ public: Framebuffer* getFramebuffer() const; }; -#endif // GRAPHICS_CORE_POST_PROCESSING_H_ +#endif // GRAPHICS_CORE_POST_PROCESSING_HPP_ diff --git a/src/graphics/core/Shader.hpp b/src/graphics/core/Shader.hpp index 5035fee4..1bb4992c 100644 --- a/src/graphics/core/Shader.hpp +++ b/src/graphics/core/Shader.hpp @@ -1,5 +1,5 @@ -#ifndef GRAPHICS_CORE_SHADER_H_ -#define GRAPHICS_CORE_SHADER_H_ +#ifndef GRAPHICS_CORE_SHADER_HPP_ +#define GRAPHICS_CORE_SHADER_HPP_ #include "../../typedefs.h" @@ -44,4 +44,4 @@ public: ); }; -#endif // GRAPHICS_SHADER_H_ +#endif // GRAPHICS_SHADER_HPP_ diff --git a/src/graphics/core/Texture.hpp b/src/graphics/core/Texture.hpp index 250a758b..13771c8b 100644 --- a/src/graphics/core/Texture.hpp +++ b/src/graphics/core/Texture.hpp @@ -1,5 +1,5 @@ -#ifndef GRAPHICS_CORE_TEXTURE_H_ -#define GRAPHICS_CORE_TEXTURE_H_ +#ifndef GRAPHICS_CORE_TEXTURE_HPP_ +#define GRAPHICS_CORE_TEXTURE_HPP_ #include #include @@ -34,4 +34,4 @@ public: static Texture* from(const ImageData* image); }; -#endif // GRAPHICS_CORE_TEXTURE_H_ +#endif // GRAPHICS_CORE_TEXTURE_HPP_ diff --git a/src/graphics/core/TextureAnimation.hpp b/src/graphics/core/TextureAnimation.hpp index 9cc1c685..97aeeff5 100644 --- a/src/graphics/core/TextureAnimation.hpp +++ b/src/graphics/core/TextureAnimation.hpp @@ -1,5 +1,5 @@ -#ifndef GRAPHICS_CORE_TEXTURE_ANIMATION_H_ -#define GRAPHICS_CORE_TEXTURE_ANIMATION_H_ +#ifndef GRAPHICS_CORE_TEXTURE_ANIMATION_HPP_ +#define GRAPHICS_CORE_TEXTURE_ANIMATION_HPP_ #include "../../typedefs.h" @@ -49,4 +49,4 @@ private: std::vector animations; }; -#endif // GRAPHICS_CORE_TEXTURE_ANIMATION_H_ +#endif // GRAPHICS_CORE_TEXTURE_ANIMATION_HPP_ diff --git a/src/graphics/core/Viewport.hpp b/src/graphics/core/Viewport.hpp index b9f66287..63f8b795 100644 --- a/src/graphics/core/Viewport.hpp +++ b/src/graphics/core/Viewport.hpp @@ -1,5 +1,5 @@ -#ifndef GRAPHICS_CORE_VIEWPORT_H_ -#define GRAPHICS_CORE_VIEWPORT_H_ +#ifndef GRAPHICS_CORE_VIEWPORT_HPP_ +#define GRAPHICS_CORE_VIEWPORT_HPP_ #include @@ -19,4 +19,4 @@ public: } }; -#endif // GRAPHICS_VIEWPORT_H_ \ No newline at end of file +#endif // GRAPHICS_VIEWPORT_HPP_ diff --git a/src/graphics/core/commons.hpp b/src/graphics/core/commons.hpp index 3a0adc37..261f1928 100644 --- a/src/graphics/core/commons.hpp +++ b/src/graphics/core/commons.hpp @@ -1,5 +1,5 @@ -#ifndef GRAPHICS_CORE_COMMONS_H_ -#define GRAPHICS_CORE_COMMONS_H_ +#ifndef GRAPHICS_CORE_COMMONS_HPP_ +#define GRAPHICS_CORE_COMMONS_HPP_ enum class DrawPrimitive { point = 0, @@ -7,4 +7,4 @@ enum class DrawPrimitive { triangle, }; -#endif // GRAPHICS_CORE_COMMONS_H_ +#endif // GRAPHICS_CORE_COMMONS_HPP_ diff --git a/src/graphics/core/gl_util.hpp b/src/graphics/core/gl_util.hpp index 39af411f..f95f9f2a 100644 --- a/src/graphics/core/gl_util.hpp +++ b/src/graphics/core/gl_util.hpp @@ -1,5 +1,5 @@ -#ifndef GRAPHICS_CORE_GL_UTIL_H_ -#define GRAPHICS_CORE_GL_UTIL_H_ +#ifndef GRAPHICS_CORE_GL_UTIL_HPP_ +#define GRAPHICS_CORE_GL_UTIL_HPP_ #include "commons.hpp" #include "ImageData.hpp" @@ -26,4 +26,4 @@ namespace gl { } } -#endif // GRAPHICS_CORE_GL_UTIL_H_ +#endif // GRAPHICS_CORE_GL_UTIL_HPP_ diff --git a/src/graphics/render/ChunksRenderer.h b/src/graphics/render/ChunksRenderer.h index d64083bb..86fb8c84 100644 --- a/src/graphics/render/ChunksRenderer.h +++ b/src/graphics/render/ChunksRenderer.h @@ -9,7 +9,7 @@ #include "../../voxels/Block.h" #include "../../voxels/ChunksStorage.h" -#include "../../util/ThreadPool.h" +#include "../../util/ThreadPool.hpp" #include "../../settings.h" class Mesh; diff --git a/src/util/BufferPool.h b/src/util/BufferPool.hpp similarity index 92% rename from src/util/BufferPool.h rename to src/util/BufferPool.hpp index c441c385..82613ae5 100644 --- a/src/util/BufferPool.h +++ b/src/util/BufferPool.hpp @@ -1,5 +1,5 @@ -#ifndef UTIL_BUFFER_POOL_H_ -#define UTIL_BUFFER_POOL_H_ +#ifndef UTIL_BUFFER_POOL_HPP_ +#define UTIL_BUFFER_POOL_HPP_ #include "../typedefs.h" @@ -39,4 +39,4 @@ namespace util { }; } -#endif // UTIL_BUFFER_POOL_H_ +#endif // UTIL_BUFFER_POOL_HPP_ diff --git a/src/util/ThreadPool.h b/src/util/ThreadPool.hpp similarity index 98% rename from src/util/ThreadPool.h rename to src/util/ThreadPool.hpp index 7480a0a8..fd01e9c7 100644 --- a/src/util/ThreadPool.h +++ b/src/util/ThreadPool.hpp @@ -1,5 +1,5 @@ -#ifndef UTIL_THREAD_POOL_H_ -#define UTIL_THREAD_POOL_H_ +#ifndef UTIL_THREAD_POOL_HPP_ +#define UTIL_THREAD_POOL_HPP_ #include #include @@ -247,4 +247,4 @@ public: } // namespace util -#endif // UTIL_THREAD_POOL_H_ +#endif // UTIL_THREAD_POOL_HPP_