diff --git a/CMakeLists.txt b/CMakeLists.txt index c0c271f..a7be17f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,12 +24,12 @@ target_sources(${PROJECT_NAME} PRIVATE src/main.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE sfml-graphics sfml-audio SQLiteCpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) -file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/asset/level/ - DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/level/) -file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/asset/img/ - DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/img/) -file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/asset/audio/ - DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/audio/) +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/assets/level/ + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/assets/level/) +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/assets/img/ + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/assets/img/) +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/assets/audio/ + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/assets/audio/) if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") enable_language("RC") diff --git a/asset/audio/background.wav b/assets/audio/background.wav similarity index 100% rename from asset/audio/background.wav rename to assets/audio/background.wav diff --git a/asset/audio/success.wav b/assets/audio/success.wav similarity index 100% rename from asset/audio/success.wav rename to assets/audio/success.wav diff --git a/asset/img/crate.png b/assets/img/crate.png similarity index 100% rename from asset/img/crate.png rename to assets/img/crate.png diff --git a/asset/img/default.png b/assets/img/default.png similarity index 100% rename from asset/img/default.png rename to assets/img/default.png diff --git a/asset/level/box_world.xsb b/assets/level/box_world.xsb similarity index 100% rename from asset/level/box_world.xsb rename to assets/level/box_world.xsb diff --git a/asset/level/default.xsb b/assets/level/default.xsb similarity index 100% rename from asset/level/default.xsb rename to assets/level/default.xsb diff --git a/src/sokoban.hpp b/src/sokoban.hpp index aeb150d..d433272 100644 --- a/src/sokoban.hpp +++ b/src/sokoban.hpp @@ -19,17 +19,17 @@ class Sokoban { public: Sokoban() : level_(""), - material_("img/default.png"), + material_("assets/img/default.png"), database_("database.db") {} void run(int argc, char* argv[]) { load_sounds(); background_music_.play(); - database_.import_levels_from_file("level/default.xsb"); - database_.import_levels_from_file("level/box_world.xsb"); + database_.import_levels_from_file("assets/level/default.xsb"); + database_.import_levels_from_file("assets/level/box_world.xsb"); - // preview_levels(database_.import_levels_from_file("level/default.xsb")); + // preview_levels(database_.import_levels_from_file("assets/level/default.xsb")); std::cout << R"( _____ __ __ @@ -140,11 +140,11 @@ class Sokoban { } void load_sounds() { - passed_buffer_.loadFromFile("audio/success.wav"); + passed_buffer_.loadFromFile("assets/audio/success.wav"); passed_sound_.setVolume(80.f); passed_sound_.setBuffer(passed_buffer_); - background_music_.openFromFile("audio/background.wav"); + background_music_.openFromFile("assets/audio/background.wav"); background_music_.setVolume(60.f); background_music_.setLoop(true); } @@ -273,7 +273,7 @@ class Sokoban { "Sokoban" ); sf::Image icon; - icon.loadFromFile("img/crate.png"); + icon.loadFromFile("assets/img/crate.png"); window_ .setIcon(icon.getSize().x, icon.getSize().y, icon.getPixelsPtr()); window_.setFramerateLimit(60);