diff --git a/src/assets/Assets.cpp b/src/assets/Assets.cpp index 99531dfb..0f660aaf 100644 --- a/src/assets/Assets.cpp +++ b/src/assets/Assets.cpp @@ -1,4 +1,4 @@ -#include "Assets.h" +#include "Assets.hpp" #include "../audio/audio.hpp" #include "../graphics/core/Texture.hpp" @@ -12,76 +12,76 @@ Assets::~Assets() { } Texture* Assets::getTexture(std::string name) const { - auto found = textures.find(name); - if (found == textures.end()) - return nullptr; - return found->second.get(); + auto found = textures.find(name); + if (found == textures.end()) + return nullptr; + return found->second.get(); } void Assets::store(Texture* texture, std::string name){ - textures.emplace(name, texture); + textures.emplace(name, texture); } Shader* Assets::getShader(std::string name) const{ - auto found = shaders.find(name); - if (found == shaders.end()) - return nullptr; - return found->second.get(); + auto found = shaders.find(name); + if (found == shaders.end()) + return nullptr; + return found->second.get(); } void Assets::store(Shader* shader, std::string name){ - shaders.emplace(name, shader); + shaders.emplace(name, shader); } Font* Assets::getFont(std::string name) const { - auto found = fonts.find(name); - if (found == fonts.end()) - return nullptr; - return found->second.get(); + auto found = fonts.find(name); + if (found == fonts.end()) + return nullptr; + return found->second.get(); } void Assets::store(Font* font, std::string name){ - fonts.emplace(name, font); + fonts.emplace(name, font); } Atlas* Assets::getAtlas(std::string name) const { - auto found = atlases.find(name); - if (found == atlases.end()) - return nullptr; - return found->second.get(); + auto found = atlases.find(name); + if (found == atlases.end()) + return nullptr; + return found->second.get(); } void Assets::store(Atlas* atlas, std::string name){ - atlases.emplace(name, atlas); + atlases.emplace(name, atlas); } audio::Sound* Assets::getSound(std::string name) const { - auto found = sounds.find(name); - if (found == sounds.end()) - return nullptr; - return found->second.get(); + auto found = sounds.find(name); + if (found == sounds.end()) + return nullptr; + return found->second.get(); } void Assets::store(audio::Sound* sound, std::string name) { - sounds.emplace(name, sound); + sounds.emplace(name, sound); } const std::vector& Assets::getAnimations() { - return animations; + return animations; } void Assets::store(const TextureAnimation& animation) { - animations.emplace_back(animation); + animations.emplace_back(animation); } UiDocument* Assets::getLayout(std::string name) const { - auto found = layouts.find(name); - if (found == layouts.end()) - return nullptr; - return found->second.get(); + auto found = layouts.find(name); + if (found == layouts.end()) + return nullptr; + return found->second.get(); } void Assets::store(UiDocument* layout, std::string name) { - layouts[name] = std::shared_ptr(layout); + layouts[name] = std::shared_ptr(layout); } diff --git a/src/assets/Assets.h b/src/assets/Assets.h deleted file mode 100644 index 3e1872b9..00000000 --- a/src/assets/Assets.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef ASSETS_ASSETS_H_ -#define ASSETS_ASSETS_H_ - -#include "../graphics/core/TextureAnimation.hpp" - -#include -#include -#include -#include -#include - -class Texture; -class Shader; -class Font; -class Atlas; -class Assets; -class UiDocument; - -namespace audio { - class Sound; -} - -namespace assetload { - /// @brief final work to do in the main thread - using postfunc = std::function; -} - -class Assets { - std::unordered_map> textures; - std::unordered_map> shaders; - std::unordered_map> fonts; - std::unordered_map> atlases; - std::unordered_map> layouts; - std::unordered_map> sounds; - std::vector animations; -public: - Assets() {} - Assets(const Assets&) = delete; - ~Assets(); - - Texture* getTexture(std::string name) const; - void store(Texture* texture, std::string name); - - Shader* getShader(std::string name) const; - void store(Shader* shader, std::string name); - - Font* getFont(std::string name) const; - void store(Font* font, std::string name); - - Atlas* getAtlas(std::string name) const; - void store(Atlas* atlas, std::string name); - - audio::Sound* getSound(std::string name) const; - void store(audio::Sound* sound, std::string name); - - const std::vector& getAnimations(); - void store(const TextureAnimation& animation); - - UiDocument* getLayout(std::string name) const; - void store(UiDocument* layout, std::string name); -}; - -#endif /* ASSETS_ASSETS_H_ */ diff --git a/src/assets/Assets.hpp b/src/assets/Assets.hpp new file mode 100644 index 00000000..a9d4b927 --- /dev/null +++ b/src/assets/Assets.hpp @@ -0,0 +1,63 @@ +#ifndef ASSETS_ASSETS_HPP_ +#define ASSETS_ASSETS_HPP_ + +#include "../graphics/core/TextureAnimation.hpp" + +#include +#include +#include +#include +#include + +class Texture; +class Shader; +class Font; +class Atlas; +class Assets; +class UiDocument; + +namespace audio { + class Sound; +} + +namespace assetload { + /// @brief final work to do in the main thread + using postfunc = std::function; +} + +class Assets { + std::unordered_map> textures; + std::unordered_map> shaders; + std::unordered_map> fonts; + std::unordered_map> atlases; + std::unordered_map> layouts; + std::unordered_map> sounds; + std::vector animations; +public: + Assets() {} + Assets(const Assets&) = delete; + ~Assets(); + + Texture* getTexture(std::string name) const; + void store(Texture* texture, std::string name); + + Shader* getShader(std::string name) const; + void store(Shader* shader, std::string name); + + Font* getFont(std::string name) const; + void store(Font* font, std::string name); + + Atlas* getAtlas(std::string name) const; + void store(Atlas* atlas, std::string name); + + audio::Sound* getSound(std::string name) const; + void store(audio::Sound* sound, std::string name); + + const std::vector& getAnimations(); + void store(const TextureAnimation& animation); + + UiDocument* getLayout(std::string name) const; + void store(UiDocument* layout, std::string name); +}; + +#endif // ASSETS_ASSETS_HPP_ diff --git a/src/assets/AssetsLoader.cpp b/src/assets/AssetsLoader.cpp index 412afc04..ae11c779 100644 --- a/src/assets/AssetsLoader.cpp +++ b/src/assets/AssetsLoader.cpp @@ -1,6 +1,6 @@ #include "AssetsLoader.hpp" -#include "Assets.h" +#include "Assets.hpp" #include "assetload_funcs.hpp" #include "../util/ThreadPool.hpp" #include "../constants.h" diff --git a/src/assets/AssetsLoader.hpp b/src/assets/AssetsLoader.hpp index 5138563f..a3ff258f 100644 --- a/src/assets/AssetsLoader.hpp +++ b/src/assets/AssetsLoader.hpp @@ -1,7 +1,7 @@ #ifndef ASSETS_ASSETS_LOADER_HPP_ #define ASSETS_ASSETS_LOADER_HPP_ -#include "Assets.h" +#include "Assets.hpp" #include "../interfaces/Task.hpp" #include "../typedefs.h" #include "../delegates.h" diff --git a/src/assets/assetload_funcs.cpp b/src/assets/assetload_funcs.cpp index c830c7b5..ea7ccea4 100644 --- a/src/assets/assetload_funcs.cpp +++ b/src/assets/assetload_funcs.cpp @@ -1,6 +1,6 @@ #include "assetload_funcs.hpp" -#include "Assets.h" +#include "Assets.hpp" #include "AssetsLoader.hpp" #include "../audio/audio.hpp" #include "../files/files.h" diff --git a/src/assets/assetload_funcs.hpp b/src/assets/assetload_funcs.hpp index 5c5eb79c..c021e1e8 100644 --- a/src/assets/assetload_funcs.hpp +++ b/src/assets/assetload_funcs.hpp @@ -1,7 +1,7 @@ #ifndef ASSETS_ASSET_LOADERS_HPP_ #define ASSETS_ASSET_LOADERS_HPP_ -#include "Assets.h" +#include "Assets.hpp" #include #include diff --git a/src/coders/GLSLExtension.cpp b/src/coders/GLSLExtension.cpp index 210b7ada..15f0f5fa 100644 --- a/src/coders/GLSLExtension.cpp +++ b/src/coders/GLSLExtension.cpp @@ -1,6 +1,6 @@ #include "GLSLExtension.hpp" -#include "../util/stringutil.h" +#include "../util/stringutil.hpp" #include "../typedefs.h" #include "../files/files.h" #include "../files/engine_paths.h" diff --git a/src/coders/binary_json.cpp b/src/coders/binary_json.cpp index 5794f921..212bfa38 100644 --- a/src/coders/binary_json.cpp +++ b/src/coders/binary_json.cpp @@ -1,10 +1,10 @@ -#include "binary_json.h" +#include "binary_json.hpp" + +#include "gzip.hpp" +#include "byte_utils.hpp" #include -#include "gzip.h" -#include "byte_utils.h" - using namespace json; using namespace dynamic; diff --git a/src/coders/binary_json.h b/src/coders/binary_json.hpp similarity index 88% rename from src/coders/binary_json.h rename to src/coders/binary_json.hpp index 913e71ec..06308e12 100644 --- a/src/coders/binary_json.h +++ b/src/coders/binary_json.hpp @@ -1,5 +1,5 @@ -#ifndef CODERS_BINARY_JSON_H_ -#define CODERS_BINARY_JSON_H_ +#ifndef CODERS_BINARY_JSON_HPP_ +#define CODERS_BINARY_JSON_HPP_ #include #include @@ -25,4 +25,4 @@ namespace json { extern std::unique_ptr from_binary(const ubyte* src, size_t size); } -#endif // CODERS_BINARY_JSON_H_ +#endif // CODERS_BINARY_JSON_HPP_ diff --git a/src/coders/byte_utils.cpp b/src/coders/byte_utils.cpp index ce52a156..670f5bca 100644 --- a/src/coders/byte_utils.cpp +++ b/src/coders/byte_utils.cpp @@ -1,4 +1,4 @@ -#include "byte_utils.h" +#include "byte_utils.hpp" #include #include diff --git a/src/coders/byte_utils.h b/src/coders/byte_utils.hpp similarity index 73% rename from src/coders/byte_utils.h rename to src/coders/byte_utils.hpp index 4d651892..8eef1943 100644 --- a/src/coders/byte_utils.h +++ b/src/coders/byte_utils.hpp @@ -1,9 +1,10 @@ -#ifndef CODERS_BYTE_UTILS_H_ -#define CODERS_BYTE_UTILS_H_ +#ifndef CODERS_BYTE_UTILS_HPP_ +#define CODERS_BYTE_UTILS_HPP_ + +#include "../typedefs.h" #include #include -#include "../typedefs.h" /* byteorder: little-endian */ class ByteBuilder { @@ -44,7 +45,7 @@ public: std::vector build(); }; -/* byteorder: little-endian */ +/// byteorder: little-endian class ByteReader { const ubyte* data; size_t size; @@ -54,26 +55,29 @@ public: ByteReader(const ubyte* data); void checkMagic(const char* data, size_t size); - /* Read one byte (unsigned 8 bit integer) */ + /// @brief Read one byte (unsigned 8 bit integer) ubyte get(); - /* Read one byte (unsigned 8 bit integer) without pointer move */ + /// @brief Read one byte (unsigned 8 bit integer) without pointer move ubyte peek(); - /* Read signed 16 bit integer */ + /// @brief Read signed 16 bit integer int16_t getInt16(); - /* Read signed 32 bit integer */ + /// @brief Read signed 32 bit integer int32_t getInt32(); - /* Read signed 64 bit integer */ + /// @brief Read signed 64 bit integer int64_t getInt64(); - /* Read 32 bit floating-point number */ + /// @brief Read 32 bit floating-point number float getFloat32(); - /* Read 64 bit floating-point number */ + /// @brief Read 64 bit floating-point number double getFloat64(); + /// @brief Read C-String const char* getCString(); + /// @brief Read string with unsigned 32 bit number before (length) std::string getString(); + /// @return true if there is at least one byte remains bool hasNext() const; const ubyte* pointer() const; void skip(size_t n); }; -#endif // CODERS_BYTE_UTILS_H_ +#endif // CODERS_BYTE_UTILS_HPP_ diff --git a/src/coders/commons.cpp b/src/coders/commons.cpp index a1fc23e9..2f700b57 100644 --- a/src/coders/commons.cpp +++ b/src/coders/commons.cpp @@ -1,6 +1,6 @@ -#include "commons.h" +#include "commons.hpp" -#include "../util/stringutil.h" +#include "../util/stringutil.hpp" #include #include diff --git a/src/coders/commons.h b/src/coders/commons.hpp similarity index 100% rename from src/coders/commons.h rename to src/coders/commons.hpp diff --git a/src/coders/gzip.cpp b/src/coders/gzip.cpp index ee1afd62..c9608b53 100644 --- a/src/coders/gzip.cpp +++ b/src/coders/gzip.cpp @@ -1,10 +1,11 @@ -#include "gzip.h" +#include "gzip.hpp" + +#include "byte_utils.hpp" #define ZLIB_CONST #include #include #include -#include "byte_utils.h" std::vector gzip::compress(const ubyte* src, size_t size) { size_t buffer_size = 23+size*1.01; diff --git a/src/coders/gzip.h b/src/coders/gzip.hpp similarity index 86% rename from src/coders/gzip.h rename to src/coders/gzip.hpp index 75f3618c..a7758a6e 100644 --- a/src/coders/gzip.h +++ b/src/coders/gzip.hpp @@ -1,8 +1,8 @@ -#ifndef CODERS_GZIP_H_ -#define CODERS_GZIP_H_ +#ifndef CODERS_GZIP_HPP_ +#define CODERS_GZIP_HPP_ -#include #include "../typedefs.h" +#include namespace gzip { const unsigned char MAGIC[] = "\x1F\x8B"; @@ -18,4 +18,4 @@ namespace gzip { std::vector decompress(const ubyte* src, size_t size); } -#endif // CODERS_GZIP_H_ +#endif // CODERS_GZIP_HPP_ diff --git a/src/coders/json.cpp b/src/coders/json.cpp index 70bc6782..508ec683 100644 --- a/src/coders/json.cpp +++ b/src/coders/json.cpp @@ -5,9 +5,8 @@ #include #include -#include "commons.h" #include "../data/dynamic.h" -#include "../util/stringutil.h" +#include "../util/stringutil.hpp" using namespace json; using namespace dynamic; diff --git a/src/coders/json.h b/src/coders/json.h index 77ec0dcf..14fe958d 100644 --- a/src/coders/json.h +++ b/src/coders/json.h @@ -1,17 +1,17 @@ #ifndef CODERS_JSON_H_ #define CODERS_JSON_H_ +#include "commons.hpp" +#include "binary_json.hpp" + +#include "../typedefs.h" + #include #include #include #include #include -#include "commons.h" -#include "../typedefs.h" - -#include "binary_json.h" - namespace dynamic { class Map; class List; diff --git a/src/coders/toml.cpp b/src/coders/toml.cpp index 162d18f1..48f3c740 100644 --- a/src/coders/toml.cpp +++ b/src/coders/toml.cpp @@ -1,8 +1,9 @@ #include "toml.hpp" -#include "commons.h" + +#include "commons.hpp" #include "../data/setting.hpp" #include "../data/dynamic.h" -#include "../util/stringutil.h" +#include "../util/stringutil.hpp" #include "../files/settings_io.hpp" #include diff --git a/src/coders/toml.hpp b/src/coders/toml.hpp index 4e347f2c..4574e468 100644 --- a/src/coders/toml.hpp +++ b/src/coders/toml.hpp @@ -1,11 +1,9 @@ #ifndef CODERS_TOML_HPP_ #define CODERS_TOML_HPP_ -#include -#include -#include +#include "commons.hpp" -#include "commons.h" +#include class SettingsHandler; diff --git a/src/coders/xml.cpp b/src/coders/xml.cpp index c5c71e35..59842ff2 100644 --- a/src/coders/xml.cpp +++ b/src/coders/xml.cpp @@ -1,6 +1,6 @@ #include "xml.hpp" -#include "../util/stringutil.h" +#include "../util/stringutil.hpp" #include #include diff --git a/src/coders/xml.hpp b/src/coders/xml.hpp index fc610c46..f8da875d 100644 --- a/src/coders/xml.hpp +++ b/src/coders/xml.hpp @@ -1,14 +1,14 @@ #ifndef CODERS_XML_HPP_ #define CODERS_XML_HPP_ +#include "commons.hpp" + #include #include #include #include #include -#include "commons.h" - namespace xml { class Node; class Attribute; diff --git a/src/constants.h b/src/constants.h index 8909824d..debd6a40 100644 --- a/src/constants.h +++ b/src/constants.h @@ -1,5 +1,5 @@ -#ifndef SRC_CONSTANTS_H_ -#define SRC_CONSTANTS_H_ +#ifndef CONSTANTS_H_ +#define CONSTANTS_H_ #include #include @@ -26,15 +26,17 @@ inline constexpr int CHUNK_D = 16; inline constexpr uint VOXEL_USER_BITS = 8; inline constexpr uint VOXEL_USER_BITS_OFFSET = sizeof(blockstate_t)*8-VOXEL_USER_BITS; +/// @brief pixel size of an item inventory icon inline constexpr int ITEM_ICON_SIZE = 48; -/* Chunk volume (count of voxels per Chunk) */ +/// @brief chunk volume (count of voxels per Chunk) inline constexpr int CHUNK_VOL = (CHUNK_W * CHUNK_H * CHUNK_D); -/* BLOCK_VOID is block id used to mark non-existing voxel (voxel of missing chunk) */ +/// @brief block id used to mark non-existing voxel (voxel of missing chunk) inline constexpr blockid_t BLOCK_VOID = std::numeric_limits::max(); +/// @brief item id used to mark non-existing item (error) inline constexpr itemid_t ITEM_VOID = std::numeric_limits::max(); - +/// @brief max number of block definitions possible inline constexpr blockid_t MAX_BLOCKS = BLOCK_VOID; inline constexpr uint vox_index(uint x, uint y, uint z, uint w=CHUNK_W, uint d=CHUNK_D) { @@ -47,4 +49,4 @@ inline const std::string FONTS_FOLDER = "fonts"; inline const std::string LAYOUTS_FOLDER = "layouts"; inline const std::string SOUNDS_FOLDER = "sounds"; -#endif // SRC_CONSTANTS_H_ +#endif // CONSTANTS_H_ diff --git a/src/content/ContentLUT.cpp b/src/content/ContentLUT.cpp index e27ef1da..c671107c 100644 --- a/src/content/ContentLUT.cpp +++ b/src/content/ContentLUT.cpp @@ -1,6 +1,4 @@ -#include "ContentLUT.h" - -#include +#include "ContentLUT.hpp" #include "Content.h" #include "../constants.h" @@ -8,9 +6,10 @@ #include "../coders/json.h" #include "../voxels/Block.h" #include "../items/ItemDef.h" - #include "../data/dynamic.h" +#include + ContentLUT::ContentLUT(const Content* content, size_t blocksCount, size_t itemsCount) { auto* indices = content->getIndices(); for (size_t i = 0; i < blocksCount; i++) { diff --git a/src/content/ContentLUT.h b/src/content/ContentLUT.hpp similarity index 91% rename from src/content/ContentLUT.h rename to src/content/ContentLUT.hpp index 8b3f5886..7df0f3c4 100644 --- a/src/content/ContentLUT.h +++ b/src/content/ContentLUT.hpp @@ -1,14 +1,14 @@ -#ifndef CONTENT_CONTENT_LUT_H_ -#define CONTENT_CONTENT_LUT_H_ +#ifndef CONTENT_CONTENT_LUT_HPP_ +#define CONTENT_CONTENT_LUT_HPP_ -#include -#include -#include +#include "Content.h" #include "../typedefs.h" #include "../constants.h" -#include "Content.h" +#include +#include +#include namespace fs = std::filesystem; @@ -93,4 +93,4 @@ public: std::vector getMissingContent() const; }; -#endif // CONTENT_CONTENT_LUT_H_ +#endif // CONTENT_CONTENT_LUT_HPP_ diff --git a/src/content/ContentLoader.cpp b/src/content/ContentLoader.cpp index a4aee3d6..7e76057e 100644 --- a/src/content/ContentLoader.cpp +++ b/src/content/ContentLoader.cpp @@ -1,25 +1,24 @@ #include "ContentLoader.h" +#include "Content.h" +#include "ContentPack.h" +#include "../coders/json.h" +#include "../core_defs.hpp" +#include "../data/dynamic.h" +#include "../debug/Logger.hpp" +#include "../files/files.h" +#include "../items/ItemDef.h" +#include "../logic/scripting/scripting.h" +#include "../typedefs.h" +#include "../util/listutil.hpp" +#include "../voxels/Block.h" + #include #include #include #include #include -#include "Content.h" -#include "../debug/Logger.hpp" -#include "../items/ItemDef.h" -#include "../util/listutil.h" -#include "../voxels/Block.h" -#include "../files/files.h" -#include "../coders/json.h" -#include "../typedefs.h" -#include "../core_defs.h" -#include "../data/dynamic.h" - -#include "ContentPack.h" -#include "../logic/scripting/scripting.h" - namespace fs = std::filesystem; static debug::Logger logger("content-loader"); diff --git a/src/content/PacksManager.cpp b/src/content/PacksManager.cpp index 96d9da3d..c1d4ea14 100644 --- a/src/content/PacksManager.cpp +++ b/src/content/PacksManager.cpp @@ -1,6 +1,6 @@ #include "PacksManager.hpp" -#include "../util/listutil.h" +#include "../util/listutil.hpp" #include #include diff --git a/src/core_defs.cpp b/src/core_defs.cpp index d0f3a8f0..5eb755cf 100644 --- a/src/core_defs.cpp +++ b/src/core_defs.cpp @@ -1,4 +1,4 @@ -#include "core_defs.h" +#include "core_defs.hpp" #include "items/ItemDef.h" #include "content/Content.h" diff --git a/src/core_defs.h b/src/core_defs.hpp similarity index 92% rename from src/core_defs.h rename to src/core_defs.hpp index eb0e9e25..f071dd1d 100644 --- a/src/core_defs.h +++ b/src/core_defs.hpp @@ -1,5 +1,5 @@ -#ifndef CORE_DEFS_H_ -#define CORE_DEFS_H_ +#ifndef CORE_DEFS_HPP_ +#define CORE_DEFS_HPP_ #include @@ -8,7 +8,7 @@ inline const std::string CORE_AIR = "core:air"; inline const std::string TEXTURE_NOTFOUND = "notfound"; -// bindings used in engine code +// built-in bindings inline const std::string BIND_MOVE_FORWARD = "movement.forward"; inline const std::string BIND_MOVE_BACK = "movement.back"; inline const std::string BIND_MOVE_LEFT = "movement.left"; @@ -33,4 +33,4 @@ namespace corecontent { void setup(ContentBuilder* builder); } -#endif // CORE_DEFS_H_ +#endif // CORE_DEFS_HPP_ diff --git a/src/data/setting.cpp b/src/data/setting.cpp index 6365da0f..56f166ce 100644 --- a/src/data/setting.cpp +++ b/src/data/setting.cpp @@ -1,6 +1,6 @@ #include "setting.hpp" -#include "../util/stringutil.h" +#include "../util/stringutil.hpp" std::string NumberSetting::toString() const { switch (getFormat()) { diff --git a/src/engine.cpp b/src/engine.cpp index b50da984..c42875e0 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -10,7 +10,7 @@ #include "coders/json.h" #include "coders/toml.hpp" #include "content/ContentLoader.h" -#include "core_defs.h" +#include "core_defs.hpp" #include "files/files.h" #include "files/settings_io.hpp" #include "frontend/locale.hpp" @@ -24,8 +24,8 @@ #include "graphics/ui/GUI.hpp" #include "logic/EngineController.hpp" #include "logic/scripting/scripting.h" -#include "util/listutil.h" -#include "util/platform.h" +#include "util/listutil.hpp" +#include "util/platform.hpp" #include "voxels/DefaultWorldGenerator.h" #include "voxels/FlatWorldGenerator.h" #include "window/Camera.hpp" diff --git a/src/engine.h b/src/engine.h index cba8cb1b..a6ba1b8d 100644 --- a/src/engine.h +++ b/src/engine.h @@ -5,7 +5,7 @@ #include "settings.h" #include "typedefs.h" -#include "assets/Assets.h" +#include "assets/Assets.hpp" #include "content/Content.h" #include "content/ContentPack.h" #include "content/PacksManager.hpp" diff --git a/src/files/WorldConverter.cpp b/src/files/WorldConverter.cpp index b2e769a3..698da4d2 100644 --- a/src/files/WorldConverter.cpp +++ b/src/files/WorldConverter.cpp @@ -1,17 +1,18 @@ #include "WorldConverter.h" +#include "WorldFiles.h" + +#include "../content/ContentLUT.hpp" +#include "../data/dynamic.h" +#include "../debug/Logger.hpp" +#include "../files/files.h" +#include "../objects/Player.h" +#include "../util/ThreadPool.hpp" +#include "../voxels/Chunk.h" + #include #include #include -#include "WorldFiles.h" - -#include "../data/dynamic.h" -#include "../files/files.h" -#include "../voxels/Chunk.h" -#include "../content/ContentLUT.h" -#include "../objects/Player.h" -#include "../debug/Logger.hpp" -#include "../util/ThreadPool.hpp" namespace fs = std::filesystem; diff --git a/src/files/WorldFiles.cpp b/src/files/WorldFiles.cpp index f19ed40e..86e44ef7 100644 --- a/src/files/WorldFiles.cpp +++ b/src/files/WorldFiles.cpp @@ -1,10 +1,10 @@ #include "WorldFiles.h" -#include "../coders/byte_utils.h" +#include "../coders/byte_utils.hpp" #include "../coders/json.h" #include "../constants.h" #include "../content/Content.h" -#include "../core_defs.h" +#include "../core_defs.hpp" #include "../data/dynamic.h" #include "../items/Inventory.h" #include "../items/ItemDef.h" @@ -13,7 +13,7 @@ #include "../objects/Player.h" #include "../physics/Hitbox.h" #include "../typedefs.h" -#include "../util/data_io.h" +#include "../util/data_io.hpp" #include "../voxels/Block.h" #include "../voxels/Chunk.h" #include "../voxels/voxel.h" diff --git a/src/files/WorldRegions.cpp b/src/files/WorldRegions.cpp index 565a4994..b955d266 100644 --- a/src/files/WorldRegions.cpp +++ b/src/files/WorldRegions.cpp @@ -1,8 +1,8 @@ #include "WorldRegions.hpp" #include "../coders/rle.hpp" -#include "../util/data_io.h" -#include "../coders/byte_utils.h" +#include "../util/data_io.hpp" +#include "../coders/byte_utils.hpp" #include "../maths/voxmaths.h" #include "../items/Inventory.h" diff --git a/src/files/engine_paths.cpp b/src/files/engine_paths.cpp index 46da3ad5..9201cbbf 100644 --- a/src/files/engine_paths.cpp +++ b/src/files/engine_paths.cpp @@ -5,7 +5,7 @@ #include #include -#include "../util/stringutil.h" +#include "../util/stringutil.hpp" #include "../typedefs.h" #include "WorldFiles.h" diff --git a/src/files/files.cpp b/src/files/files.cpp index 2ea31a44..c956b96e 100644 --- a/src/files/files.cpp +++ b/src/files/files.cpp @@ -1,14 +1,15 @@ #include "files.h" +#include "../coders/json.h" +#include "../coders/gzip.hpp" +#include "../util/stringutil.hpp" +#include "../data/dynamic.h" + #include #include #include #include #include -#include "../coders/json.h" -#include "../coders/gzip.h" -#include "../util/stringutil.h" -#include "../data/dynamic.h" namespace fs = std::filesystem; diff --git a/src/frontend/ContentGfxCache.cpp b/src/frontend/ContentGfxCache.cpp index 6402ba93..5cfdea82 100644 --- a/src/frontend/ContentGfxCache.cpp +++ b/src/frontend/ContentGfxCache.cpp @@ -2,10 +2,10 @@ #include "UiDocument.hpp" -#include "../assets/Assets.h" +#include "../assets/Assets.hpp" #include "../content/Content.h" #include "../content/ContentPack.h" -#include "../core_defs.h" +#include "../core_defs.hpp" #include "../graphics/core/Atlas.hpp" #include "../maths/UVRegion.hpp" #include "../voxels/Block.h" diff --git a/src/frontend/LevelFrontend.cpp b/src/frontend/LevelFrontend.cpp index 28aeaf7e..280b0c4a 100644 --- a/src/frontend/LevelFrontend.cpp +++ b/src/frontend/LevelFrontend.cpp @@ -2,7 +2,7 @@ #include "ContentGfxCache.hpp" -#include "../assets/Assets.h" +#include "../assets/Assets.hpp" #include "../audio/audio.hpp" #include "../content/Content.h" #include "../graphics/core/Atlas.hpp" diff --git a/src/frontend/debug_panel.cpp b/src/frontend/debug_panel.cpp index 31cb5247..5223cda9 100644 --- a/src/frontend/debug_panel.cpp +++ b/src/frontend/debug_panel.cpp @@ -9,7 +9,7 @@ #include "../graphics/render/WorldRenderer.hpp" #include "../objects/Player.h" #include "../physics/Hitbox.h" -#include "../util/stringutil.h" +#include "../util/stringutil.hpp" #include "../voxels/Block.h" #include "../voxels/Chunk.h" #include "../voxels/Chunks.h" diff --git a/src/frontend/hud.cpp b/src/frontend/hud.cpp index d31c7de8..1d5314ba 100644 --- a/src/frontend/hud.cpp +++ b/src/frontend/hud.cpp @@ -4,9 +4,9 @@ #include "LevelFrontend.hpp" #include "UiDocument.hpp" -#include "../assets/Assets.h" +#include "../assets/Assets.hpp" #include "../content/Content.h" -#include "../core_defs.h" +#include "../core_defs.hpp" #include "../delegates.h" #include "../engine.h" #include "../graphics/core/Atlas.hpp" @@ -33,7 +33,7 @@ #include "../objects/Player.h" #include "../physics/Hitbox.h" #include "../typedefs.h" -#include "../util/stringutil.h" +#include "../util/stringutil.hpp" #include "../voxels/Block.h" #include "../voxels/Chunk.h" #include "../voxels/Chunks.h" diff --git a/src/frontend/locale.cpp b/src/frontend/locale.cpp index 8b39bb62..c92ec5d7 100644 --- a/src/frontend/locale.cpp +++ b/src/frontend/locale.cpp @@ -1,10 +1,10 @@ #include "locale.hpp" #include "../coders/json.h" -#include "../coders/commons.h" +#include "../coders/commons.hpp" #include "../content/ContentPack.h" #include "../files/files.h" -#include "../util/stringutil.h" +#include "../util/stringutil.hpp" #include "../data/dynamic.h" #include "../debug/Logger.hpp" diff --git a/src/frontend/menu.cpp b/src/frontend/menu.cpp index c3acb467..7f2ff3ca 100644 --- a/src/frontend/menu.cpp +++ b/src/frontend/menu.cpp @@ -13,8 +13,8 @@ #include "../graphics/ui/GUI.hpp" #include "../logic/scripting/scripting.h" #include "../settings.h" -#include "../coders/commons.h" -#include "../util/stringutil.h" +#include "../coders/commons.hpp" +#include "../util/stringutil.hpp" #include "../window/Window.hpp" #include diff --git a/src/graphics/render/BlocksPreview.cpp b/src/graphics/render/BlocksPreview.cpp index 6c2b1e87..7553811c 100644 --- a/src/graphics/render/BlocksPreview.cpp +++ b/src/graphics/render/BlocksPreview.cpp @@ -1,6 +1,6 @@ #include "BlocksPreview.hpp" -#include "../../assets/Assets.h" +#include "../../assets/Assets.hpp" #include "../../constants.h" #include "../../content/Content.h" #include "../../frontend/ContentGfxCache.hpp" diff --git a/src/graphics/render/Skybox.cpp b/src/graphics/render/Skybox.cpp index 1351c4b8..c98406da 100644 --- a/src/graphics/render/Skybox.cpp +++ b/src/graphics/render/Skybox.cpp @@ -1,5 +1,5 @@ #include "Skybox.hpp" -#include "../../assets/Assets.h" +#include "../../assets/Assets.hpp" #include "../../graphics/core/Shader.hpp" #include "../../graphics/core/Mesh.hpp" #include "../../graphics/core/Batch3D.hpp" diff --git a/src/graphics/render/WorldRenderer.cpp b/src/graphics/render/WorldRenderer.cpp index 928b2e98..f13db437 100644 --- a/src/graphics/render/WorldRenderer.cpp +++ b/src/graphics/render/WorldRenderer.cpp @@ -3,7 +3,7 @@ #include "ChunksRenderer.hpp" #include "Skybox.hpp" -#include "../../assets/Assets.h" +#include "../../assets/Assets.hpp" #include "../../content/Content.h" #include "../../engine.h" #include "../../frontend/LevelFrontend.hpp" diff --git a/src/graphics/ui/GUI.cpp b/src/graphics/ui/GUI.cpp index af220fff..ed978673 100644 --- a/src/graphics/ui/GUI.cpp +++ b/src/graphics/ui/GUI.cpp @@ -2,10 +2,7 @@ #include "elements/UINode.hpp" #include "elements/Menu.hpp" -#include -#include - -#include "../../assets/Assets.h" +#include "../../assets/Assets.hpp" #include "../../frontend/UiDocument.hpp" #include "../../graphics/core/Batch2D.hpp" #include "../../graphics/core/Shader.hpp" @@ -14,6 +11,9 @@ #include "../../window/input.hpp" #include "../../window/Camera.hpp" +#include +#include + using namespace gui; GUI::GUI() { diff --git a/src/graphics/ui/elements/Image.cpp b/src/graphics/ui/elements/Image.cpp index b9ad1fb1..f350ca0d 100644 --- a/src/graphics/ui/elements/Image.cpp +++ b/src/graphics/ui/elements/Image.cpp @@ -3,7 +3,7 @@ #include "../../core/DrawContext.hpp" #include "../../core/Batch2D.hpp" #include "../../core/Texture.hpp" -#include "../../../assets/Assets.h" +#include "../../../assets/Assets.hpp" #include "../../../maths/UVRegion.hpp" using namespace gui; diff --git a/src/graphics/ui/elements/InputBindBox.cpp b/src/graphics/ui/elements/InputBindBox.cpp index 14d547b6..ad9485dd 100644 --- a/src/graphics/ui/elements/InputBindBox.cpp +++ b/src/graphics/ui/elements/InputBindBox.cpp @@ -3,7 +3,7 @@ #include "Label.hpp" #include "../../core/DrawContext.hpp" #include "../../core/Batch2D.hpp" -#include "../../../util/stringutil.h" +#include "../../../util/stringutil.hpp" using namespace gui; diff --git a/src/graphics/ui/elements/InventoryView.cpp b/src/graphics/ui/elements/InventoryView.cpp index 418ad1fc..7a0d8693 100644 --- a/src/graphics/ui/elements/InventoryView.cpp +++ b/src/graphics/ui/elements/InventoryView.cpp @@ -1,5 +1,5 @@ #include "InventoryView.hpp" -#include "../../../assets/Assets.h" +#include "../../../assets/Assets.hpp" #include "../../../content/Content.h" #include "../../../frontend/LevelFrontend.hpp" #include "../../../items/Inventories.h" @@ -9,7 +9,7 @@ #include "../../../logic/scripting/scripting.h" #include "../../../maths/voxmaths.h" #include "../../../objects/Player.h" -#include "../../../util/stringutil.h" +#include "../../../util/stringutil.hpp" #include "../../../voxels/Block.h" #include "../../../window/Events.hpp" #include "../../../window/input.hpp" diff --git a/src/graphics/ui/elements/Label.cpp b/src/graphics/ui/elements/Label.cpp index 0ccf5b59..73fb8b83 100644 --- a/src/graphics/ui/elements/Label.cpp +++ b/src/graphics/ui/elements/Label.cpp @@ -2,8 +2,8 @@ #include "../../core/DrawContext.hpp" #include "../../core/Batch2D.hpp" #include "../../core/Font.hpp" -#include "../../../assets/Assets.h" -#include "../../../util/stringutil.h" +#include "../../../assets/Assets.hpp" +#include "../../../util/stringutil.hpp" using namespace gui; diff --git a/src/graphics/ui/elements/Plotter.cpp b/src/graphics/ui/elements/Plotter.cpp index 11f93489..bcb653d7 100644 --- a/src/graphics/ui/elements/Plotter.cpp +++ b/src/graphics/ui/elements/Plotter.cpp @@ -3,8 +3,8 @@ #include "../../core/Batch2D.hpp" #include "../../core/Font.hpp" #include "../../core/DrawContext.hpp" -#include "../../../assets/Assets.h" -#include "../../../util/stringutil.h" +#include "../../../assets/Assets.hpp" +#include "../../../util/stringutil.hpp" using namespace gui; diff --git a/src/graphics/ui/elements/TextBox.cpp b/src/graphics/ui/elements/TextBox.cpp index b46d08c7..2ffa5773 100644 --- a/src/graphics/ui/elements/TextBox.cpp +++ b/src/graphics/ui/elements/TextBox.cpp @@ -4,8 +4,8 @@ #include "../../core/DrawContext.hpp" #include "../../core/Batch2D.hpp" #include "../../core/Font.hpp" -#include "../../../assets/Assets.h" -#include "../../../util/stringutil.h" +#include "../../../assets/Assets.hpp" +#include "../../../util/stringutil.hpp" #include "../../../window/Events.hpp" using namespace gui; diff --git a/src/graphics/ui/elements/TrackBar.cpp b/src/graphics/ui/elements/TrackBar.cpp index 6ec89675..7a2b4f74 100644 --- a/src/graphics/ui/elements/TrackBar.cpp +++ b/src/graphics/ui/elements/TrackBar.cpp @@ -2,7 +2,7 @@ #include "../../core/DrawContext.hpp" #include "../../core/Batch2D.hpp" -#include "../../../assets/Assets.h" +#include "../../../assets/Assets.hpp" using namespace gui; diff --git a/src/graphics/ui/gui_util.cpp b/src/graphics/ui/gui_util.cpp index a172c31b..ce104206 100644 --- a/src/graphics/ui/gui_util.cpp +++ b/src/graphics/ui/gui_util.cpp @@ -1,16 +1,17 @@ #include "gui_util.hpp" + #include "elements/Label.hpp" #include "elements/Menu.hpp" #include "elements/Button.hpp" #include "gui_xml.hpp" -#include - #include "../../logic/scripting/scripting.h" #include "../../frontend/locale.hpp" -#include "../../util/stringutil.h" +#include "../../util/stringutil.hpp" #include "../../delegates.h" +#include + using namespace gui; std::shared_ptr