From 6b037ec7e8cc106dafa85cc32afa6ac0fa74d40d Mon Sep 17 00:00:00 2001 From: MihailRis Date: Mon, 6 May 2024 01:27:24 +0300 Subject: [PATCH] hpp+ --- src/engine.cpp | 2 +- src/frontend/ContentGfxCache.cpp | 3 ++- src/frontend/LevelFrontend.cpp | 5 +++-- .../{LevelFrontend.h => LevelFrontend.hpp} | 6 +++--- src/frontend/hud.cpp | 7 ++++--- src/frontend/{locale/langs.cpp => locale.cpp} | 17 +++++++++-------- src/frontend/{locale/langs.h => locale.hpp} | 10 +++++----- src/frontend/menu.cpp | 9 +++++---- src/frontend/screens/LevelScreen.cpp | 2 +- src/graphics/core/Atlas.cpp | 5 +++-- src/graphics/render/WorldRenderer.cpp | 6 ++++-- src/graphics/ui/elements/InventoryView.cpp | 2 +- src/graphics/ui/gui_util.cpp | 2 +- src/graphics/ui/gui_xml.cpp | 2 +- src/logic/EngineController.cpp | 2 +- src/logic/scripting/lua/libgui.cpp | 2 +- .../{FrustumCulling.h => FrustumCulling.hpp} | 7 ++++++- src/maths/LMPacker.cpp | 2 +- src/maths/{LMPacker.h => LMPacker.hpp} | 12 +++++------- 19 files changed, 57 insertions(+), 46 deletions(-) rename src/frontend/{LevelFrontend.h => LevelFrontend.hpp} (81%) rename src/frontend/{locale/langs.cpp => locale.cpp} (91%) rename src/frontend/{locale/langs.h => locale.hpp} (91%) rename src/maths/{FrustumCulling.h => FrustumCulling.hpp} (97%) rename src/maths/{LMPacker.h => LMPacker.hpp} (85%) diff --git a/src/engine.cpp b/src/engine.cpp index d9ca663e..138717fa 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -13,7 +13,7 @@ #include "core_defs.h" #include "files/files.h" #include "files/settings_io.hpp" -#include "frontend/locale/langs.h" +#include "frontend/locale.hpp" #include "frontend/menu.hpp" #include "frontend/screens/Screen.hpp" #include "frontend/screens/MenuScreen.hpp" diff --git a/src/frontend/ContentGfxCache.cpp b/src/frontend/ContentGfxCache.cpp index 999b337e..6402ba93 100644 --- a/src/frontend/ContentGfxCache.cpp +++ b/src/frontend/ContentGfxCache.cpp @@ -1,5 +1,7 @@ #include "ContentGfxCache.hpp" +#include "UiDocument.hpp" + #include "../assets/Assets.h" #include "../content/Content.h" #include "../content/ContentPack.h" @@ -7,7 +9,6 @@ #include "../graphics/core/Atlas.hpp" #include "../maths/UVRegion.hpp" #include "../voxels/Block.h" -#include "UiDocument.hpp" #include diff --git a/src/frontend/LevelFrontend.cpp b/src/frontend/LevelFrontend.cpp index 1713dd80..28aeaf7e 100644 --- a/src/frontend/LevelFrontend.cpp +++ b/src/frontend/LevelFrontend.cpp @@ -1,4 +1,6 @@ -#include "LevelFrontend.h" +#include "LevelFrontend.hpp" + +#include "ContentGfxCache.hpp" #include "../assets/Assets.h" #include "../audio/audio.hpp" @@ -9,7 +11,6 @@ #include "../logic/PlayerController.h" #include "../voxels/Block.h" #include "../world/Level.h" -#include "ContentGfxCache.hpp" LevelFrontend::LevelFrontend(LevelController* controller, Assets* assets) : level(controller->getLevel()), diff --git a/src/frontend/LevelFrontend.h b/src/frontend/LevelFrontend.hpp similarity index 81% rename from src/frontend/LevelFrontend.h rename to src/frontend/LevelFrontend.hpp index eff35134..6e100670 100644 --- a/src/frontend/LevelFrontend.h +++ b/src/frontend/LevelFrontend.hpp @@ -1,5 +1,5 @@ -#ifndef FRONTEND_LEVEL_FRONTEND_H_ -#define FRONTEND_LEVEL_FRONTEND_H_ +#ifndef FRONTEND_LEVEL_FRONTEND_HPP_ +#define FRONTEND_LEVEL_FRONTEND_HPP_ #include @@ -23,4 +23,4 @@ public: LevelController* getController() const; }; -#endif // FRONTEND_LEVEL_FRONTEND_H_ +#endif // FRONTEND_LEVEL_FRONTEND_HPP_ diff --git a/src/frontend/hud.cpp b/src/frontend/hud.cpp index 974ae8d9..d31c7de8 100644 --- a/src/frontend/hud.cpp +++ b/src/frontend/hud.cpp @@ -1,5 +1,9 @@ #include "hud.hpp" +#include "ContentGfxCache.hpp" +#include "LevelFrontend.hpp" +#include "UiDocument.hpp" + #include "../assets/Assets.h" #include "../content/Content.h" #include "../core_defs.h" @@ -39,9 +43,6 @@ #include "../window/Window.hpp" #include "../world/Level.h" #include "../world/World.h" -#include "ContentGfxCache.hpp" -#include "LevelFrontend.h" -#include "UiDocument.hpp" #include #include diff --git a/src/frontend/locale/langs.cpp b/src/frontend/locale.cpp similarity index 91% rename from src/frontend/locale/langs.cpp rename to src/frontend/locale.cpp index 3294e96d..8b39bb62 100644 --- a/src/frontend/locale/langs.cpp +++ b/src/frontend/locale.cpp @@ -1,13 +1,14 @@ -#include "langs.h" +#include "locale.hpp" -#include +#include "../coders/json.h" +#include "../coders/commons.h" +#include "../content/ContentPack.h" +#include "../files/files.h" +#include "../util/stringutil.h" +#include "../data/dynamic.h" +#include "../debug/Logger.hpp" -#include "../../coders/json.h" -#include "../../coders/commons.h" -#include "../../content/ContentPack.h" -#include "../../files/files.h" -#include "../../util/stringutil.h" -#include "../../data/dynamic.h" +static debug::Logger logger("locale"); namespace fs = std::filesystem; diff --git a/src/frontend/locale/langs.h b/src/frontend/locale.hpp similarity index 91% rename from src/frontend/locale/langs.h rename to src/frontend/locale.hpp index 33684c55..cd209afe 100644 --- a/src/frontend/locale/langs.h +++ b/src/frontend/locale.hpp @@ -1,5 +1,7 @@ -#ifndef FRONTEND_LOCALE_LANGS_H -#define FRONTEND_LOCALE_LANGS_H +#ifndef FRONTEND_LOCALES_HPP_ +#define FRONTEND_LOCALES_HPP_ + +#include "../content/ContentPack.h" #include #include @@ -7,8 +9,6 @@ #include #include -#include "../../content/ContentPack.h" - namespace langs { const char LANG_FILE_EXT[] = ".txt"; const char TEXTS_FOLDER[] = "texts"; @@ -69,4 +69,4 @@ namespace langs { const std::vector& packs); } -#endif // FRONTEND_LOCALE_LANGS_H +#endif // FRONTEND_LOCALES_HPP_ diff --git a/src/frontend/menu.cpp b/src/frontend/menu.cpp index 54bcca68..c3acb467 100644 --- a/src/frontend/menu.cpp +++ b/src/frontend/menu.cpp @@ -1,7 +1,7 @@ #include "menu.hpp" -#include -#include +#include "locale.hpp" +#include "UiDocument.hpp" #include "../delegates.h" #include "../engine.h" @@ -16,8 +16,9 @@ #include "../coders/commons.h" #include "../util/stringutil.h" #include "../window/Window.hpp" -#include "locale/langs.h" -#include "UiDocument.hpp" + +#include +#include namespace fs = std::filesystem; using namespace gui; diff --git a/src/frontend/screens/LevelScreen.cpp b/src/frontend/screens/LevelScreen.cpp index 500fa1ae..61d1ce84 100644 --- a/src/frontend/screens/LevelScreen.cpp +++ b/src/frontend/screens/LevelScreen.cpp @@ -1,7 +1,7 @@ #include "LevelScreen.hpp" #include "../hud.hpp" -#include "../LevelFrontend.h" +#include "../LevelFrontend.hpp" #include "../../debug/Logger.hpp" #include "../../audio/audio.hpp" #include "../../coders/imageio.hpp" diff --git a/src/graphics/core/Atlas.cpp b/src/graphics/core/Atlas.cpp index 8b62d0f3..21187739 100644 --- a/src/graphics/core/Atlas.cpp +++ b/src/graphics/core/Atlas.cpp @@ -1,9 +1,10 @@ #include "Atlas.hpp" -#include -#include "../../maths/LMPacker.h" #include "Texture.hpp" #include "ImageData.hpp" +#include "../../maths/LMPacker.hpp" + +#include Atlas::Atlas( std::unique_ptr image, diff --git a/src/graphics/render/WorldRenderer.cpp b/src/graphics/render/WorldRenderer.cpp index cc7a0dd3..928b2e98 100644 --- a/src/graphics/render/WorldRenderer.cpp +++ b/src/graphics/render/WorldRenderer.cpp @@ -1,15 +1,17 @@ #include "WorldRenderer.hpp" + #include "ChunksRenderer.hpp" #include "Skybox.hpp" + #include "../../assets/Assets.h" #include "../../content/Content.h" #include "../../engine.h" -#include "../../frontend/LevelFrontend.h" +#include "../../frontend/LevelFrontend.hpp" #include "../../items/Inventory.h" #include "../../items/ItemDef.h" #include "../../items/ItemStack.h" #include "../../logic/PlayerController.h" -#include "../../maths/FrustumCulling.h" +#include "../../maths/FrustumCulling.hpp" #include "../../maths/voxmaths.h" #include "../../objects/Player.h" #include "../../settings.h" diff --git a/src/graphics/ui/elements/InventoryView.cpp b/src/graphics/ui/elements/InventoryView.cpp index 5c0b2a00..418ad1fc 100644 --- a/src/graphics/ui/elements/InventoryView.cpp +++ b/src/graphics/ui/elements/InventoryView.cpp @@ -1,7 +1,7 @@ #include "InventoryView.hpp" #include "../../../assets/Assets.h" #include "../../../content/Content.h" -#include "../../../frontend/LevelFrontend.h" +#include "../../../frontend/LevelFrontend.hpp" #include "../../../items/Inventories.h" #include "../../../items/Inventory.h" #include "../../../items/ItemDef.h" diff --git a/src/graphics/ui/gui_util.cpp b/src/graphics/ui/gui_util.cpp index d31ffc0e..a172c31b 100644 --- a/src/graphics/ui/gui_util.cpp +++ b/src/graphics/ui/gui_util.cpp @@ -7,7 +7,7 @@ #include #include "../../logic/scripting/scripting.h" -#include "../../frontend/locale/langs.h" +#include "../../frontend/locale.hpp" #include "../../util/stringutil.h" #include "../../delegates.h" diff --git a/src/graphics/ui/gui_xml.cpp b/src/graphics/ui/gui_xml.cpp index b93e5a81..ec2c3516 100644 --- a/src/graphics/ui/gui_xml.cpp +++ b/src/graphics/ui/gui_xml.cpp @@ -11,7 +11,7 @@ #include "elements/InventoryView.hpp" #include "../../frontend/menu.hpp" -#include "../../frontend/locale/langs.h" +#include "../../frontend/locale.hpp" #include "../../items/Inventory.h" #include "../../logic/scripting/scripting.h" #include "../../maths/voxmaths.h" diff --git a/src/logic/EngineController.cpp b/src/logic/EngineController.cpp index 2df1338a..5df7af58 100644 --- a/src/logic/EngineController.cpp +++ b/src/logic/EngineController.cpp @@ -5,7 +5,7 @@ #include "../engine.h" #include "../files/WorldFiles.h" #include "../files/WorldConverter.h" -#include "../frontend/locale/langs.h" +#include "../frontend/locale.hpp" #include "../frontend/screens/MenuScreen.hpp" #include "../frontend/screens/LevelScreen.hpp" #include "../frontend/menu.hpp" diff --git a/src/logic/scripting/lua/libgui.cpp b/src/logic/scripting/lua/libgui.cpp index 77adf8a9..82ce8ded 100644 --- a/src/logic/scripting/lua/libgui.cpp +++ b/src/logic/scripting/lua/libgui.cpp @@ -17,7 +17,7 @@ #include "../../../graphics/ui/elements/Menu.hpp" #include "../../../graphics/ui/elements/InventoryView.hpp" #include "../../../frontend/UiDocument.hpp" -#include "../../../frontend/locale/langs.h" +#include "../../../frontend/locale.hpp" #include "../../../util/stringutil.h" #include "../../../world/Level.h" diff --git a/src/maths/FrustumCulling.h b/src/maths/FrustumCulling.hpp similarity index 97% rename from src/maths/FrustumCulling.h rename to src/maths/FrustumCulling.hpp index c48e69f2..fb1db3b6 100644 --- a/src/maths/FrustumCulling.h +++ b/src/maths/FrustumCulling.hpp @@ -1,3 +1,6 @@ +#ifndef MATHS_FRUSTUM_CULLING_HPP_ +#define MATHS_FRUSTUM_CULLING_HPP_ + #include class Frustum @@ -110,4 +113,6 @@ inline glm::vec3 Frustum::intersection(const glm::vec3* crosses) const glm::vec3 res = glm::mat3(crosses[ij2k::k], -crosses[ij2k::k], crosses[ij2k::k]) * glm::vec3(m_planes[a].w, m_planes[b].w, m_planes[c].w); return res * (-1.0f / D); -} \ No newline at end of file +} + +#endif // MATHS_FRUSTUM_CULLING_HPP_ diff --git a/src/maths/LMPacker.cpp b/src/maths/LMPacker.cpp index 804bd0be..31cd50a7 100644 --- a/src/maths/LMPacker.cpp +++ b/src/maths/LMPacker.cpp @@ -1,4 +1,4 @@ -#include "LMPacker.h" +#include "LMPacker.hpp" #include diff --git a/src/maths/LMPacker.h b/src/maths/LMPacker.hpp similarity index 85% rename from src/maths/LMPacker.h rename to src/maths/LMPacker.hpp index 9c49b07f..c3a73b6c 100644 --- a/src/maths/LMPacker.h +++ b/src/maths/LMPacker.hpp @@ -1,9 +1,7 @@ -/* - C++ LMPacker port - https://github.com/MihailRis/LMPacker -*/ -#ifndef LMPACKER_H_ -#define LMPACKER_H_ +/// C++ LMPacker port +/// https://github.com/MihailRis/LMPacker +#ifndef LMPACKER_HPP_ +#define LMPACKER_HPP_ #include #include @@ -50,4 +48,4 @@ public: } }; -#endif /* LMPACKER_H_ */ \ No newline at end of file +#endif // LMPACKER_HPP_