0
0
mirror of https://github.com/Nimac0/SDL_Minigame synced 2026-01-12 05:43:43 +00:00

fixed a bug with the implementation of the nlohmann library in the CMakeLists.txt

fixed a bug where the config was not loaded correctly in the GameInternal.cpp
This commit is contained in:
freezarite 2024-12-16 06:08:52 +01:00
parent 691ea06eb0
commit 1f3cf01419
2 changed files with 7 additions and 6 deletions

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_ttf EXCLUDE_FROM_ALL)
add_subdirectory(extern/tmxlite/tmxlite EXCLUDE_FROM_ALL)
add_subdirectory(extern/nlohmann_json EXCLUDE_FROM_ALL)
include_directories(extern/nlohmann_json/include)
file(GLOB_RECURSE SOURCES ${ENGINE_SOURCE_DIR}/src/*.cpp)
@ -40,7 +40,6 @@ target_link_libraries(${PROJECT_NAME} PUBLIC # should be private when all SDL fu
SDL3_mixer::SDL3_mixer-static
SDL3_ttf::SDL3_ttf-static
tmxlite
nlohmann_json::nlohmann_json
)
if(CMAKE_BUILD_TYPE MATCHES "Debug")

View File

@ -31,11 +31,13 @@ GameInternal::~GameInternal() = default;
SDL_AppResult GameInternal::init()
{
this->gameInstance = GameFactory::instance().create(this);
ConfigLoader().setCustomConfig(this->gameInstance->getConfigFilePath());
ConfigLoader().init();
ConfigLoader* loader = new ConfigLoader();
json config = ConfigLoader().getFinalConfig();
this->gameInstance = GameFactory::instance().create(this);
loader->setCustomConfig(this->gameInstance->getConfigFilePath());
loader->init();
json config = loader->getFinalConfig();
GameInternal::assets = new AssetManager(&manager);
GameInternal::textureManager = new TextureManager(&manager);