Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
refactor: rename folder 'asset' to 'assets'
Browse files Browse the repository at this point in the history
  • Loading branch information
ShenMian committed Nov 21, 2024
1 parent b604f0e commit b7bfde9
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions src/sokoban.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"(
_____ __ __
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b7bfde9

Please sign in to comment.