mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-13 12:33:42 +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:
parent
691ea06eb0
commit
1f3cf01419
@ -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/nlohmann_json EXCLUDE_FROM_ALL)
|
include_directories(extern/nlohmann_json/include)
|
||||||
|
|
||||||
|
|
||||||
file(GLOB_RECURSE SOURCES ${ENGINE_SOURCE_DIR}/src/*.cpp)
|
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_mixer::SDL3_mixer-static
|
||||||
SDL3_ttf::SDL3_ttf-static
|
SDL3_ttf::SDL3_ttf-static
|
||||||
tmxlite
|
tmxlite
|
||||||
nlohmann_json::nlohmann_json
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE MATCHES "Debug")
|
if(CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||||
|
|||||||
@ -31,11 +31,13 @@ GameInternal::~GameInternal() = default;
|
|||||||
|
|
||||||
SDL_AppResult GameInternal::init()
|
SDL_AppResult GameInternal::init()
|
||||||
{
|
{
|
||||||
this->gameInstance = GameFactory::instance().create(this);
|
ConfigLoader* loader = new ConfigLoader();
|
||||||
ConfigLoader().setCustomConfig(this->gameInstance->getConfigFilePath());
|
|
||||||
ConfigLoader().init();
|
|
||||||
|
|
||||||
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::assets = new AssetManager(&manager);
|
||||||
GameInternal::textureManager = new TextureManager(&manager);
|
GameInternal::textureManager = new TextureManager(&manager);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user