0
0
mirror of https://github.com/Nimac0/SDL_Minigame synced 2026-01-12 23:33:41 +00:00

removed magic enum and documentation improvements

since getName is no longer used from the TileComponent.h we no longer need magic_enum for the enum to string conversion
also some minor documentation changes
This commit is contained in:
freezarite 2024-12-01 20:25:31 +01:00
parent dadf846470
commit b490e2dc17
7 changed files with 5 additions and 19 deletions

4
.gitmodules vendored
View File

@ -20,6 +20,4 @@
[submodule "docs/doxygen-awesome-css"] [submodule "docs/doxygen-awesome-css"]
path = docs/doxygen-awesome-css path = docs/doxygen-awesome-css
url = https://github.com/jothepro/doxygen-awesome-css.git url = https://github.com/jothepro/doxygen-awesome-css.git
[submodule "extern/magic_enum"]
path = extern/magic_enum
url = https://github.com/Neargye/magic_enum.git

View File

@ -24,7 +24,7 @@ add_subdirectory(extern/SDL_image EXCLUDE_FROM_ALL)
add_subdirectory(extern/SDL_mixer EXCLUDE_FROM_ALL) add_subdirectory(extern/SDL_mixer EXCLUDE_FROM_ALL)
add_subdirectory(extern/SDL_ttf EXCLUDE_FROM_ALL) add_subdirectory(extern/SDL_ttf EXCLUDE_FROM_ALL)
add_subdirectory(extern/tmxlite/tmxlite EXCLUDE_FROM_ALL) add_subdirectory(extern/tmxlite/tmxlite EXCLUDE_FROM_ALL)
add_subdirectory(extern/magic_enum EXCLUDE_FROM_ALL)
file(GLOB_RECURSE SOURCES ${ENGINE_SOURCE_DIR}/src/*.cpp) file(GLOB_RECURSE SOURCES ${ENGINE_SOURCE_DIR}/src/*.cpp)
add_library(${PROJECT_NAME} ${SOURCES}) add_library(${PROJECT_NAME} ${SOURCES})
@ -37,7 +37,6 @@ target_link_libraries(${PROJECT_NAME} PUBLIC # should be private when all SDL fu
SDL2_image::SDL2_image-static SDL2_image::SDL2_image-static
SDL2_mixer::SDL2_mixer-static SDL2_mixer::SDL2_mixer-static
SDL2_ttf::SDL2_ttf-static SDL2_ttf::SDL2_ttf-static
magic_enum::magic_enum
tmxlite tmxlite
) )

1
extern/magic_enum vendored

@ -1 +0,0 @@
Subproject commit a72a0536c716fdef4f029fb43e1fd7e7b3d9ac9b

View File

@ -35,8 +35,8 @@ private:
int textureXOffset; int textureXOffset;
int textureYOffset; int textureYOffset;
//might be a better solution as this variable is only used for the loading of the tmx map //there should be a better solution as this variable is only used for the loading of the tmx map
//TODO: improve this in the future //TODO: improve this in the future and also remove it from the scope of the developer
const char* path; //empty string if texture has a texture enum value, otherwise the path of the texture const char* path; //empty string if texture has a texture enum value, otherwise the path of the texture
public: public:

View File

@ -16,7 +16,7 @@
* and rendering in the engine. It provides functions to add, load, and draw textures * and rendering in the engine. It provides functions to add, load, and draw textures
* from files, as well as manage sprite sheets. * from files, as well as manage sprite sheets.
* *
* \sa \ref Textures "Textures" are used to identify textures within the engine. * \sa Textures "Textures" are used to identify textures within the engine.
* It is expected that they are implemented within the games scope. * It is expected that they are implemented within the games scope.
*/ */

View File

@ -3,7 +3,6 @@
#include <SDL.h> #include <SDL.h>
#include <string> #include <string>
#include <map> #include <map>
#include <magic_enum/magic_enum.hpp>
#include "Component.h" #include "Component.h"
#include "Textures.h" #include "Textures.h"
@ -31,14 +30,6 @@ public:
return this->collision; return this->collision;
} }
std::string getName() {
#ifdef TEXTURE_ENUM_DEFINED
return std::string(magic_enum::enum_name(this->texture));
#else
return "Undefined Enum";
#endif
}
private: private:
bool collision; bool collision;

View File

@ -3,7 +3,6 @@
#include <SDL_timer.h> #include <SDL_timer.h>
#include <cstring> #include <cstring>
#include <memory> #include <memory>
#include <magic_enum/magic_enum.hpp>
#include "AnimationHandler.h" #include "AnimationHandler.h"
#include "Direction.h" #include "Direction.h"