diff options
-rw-r--r-- | src/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/main.cpp | 2 | ||||
-rw-r--r-- | src/train.h | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d290495..b30b333 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,3 +23,9 @@ target_link_libraries( PRIVATE SDL2::SDL2 ) + +add_custom_command( + TARGET Nonortho POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/res $<TARGET_FILE_DIR:Nonortho>/res + COMMENT "Copying resources" VERBATIM +) diff --git a/src/main.cpp b/src/main.cpp index 152021e..1d68272 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -11,7 +11,7 @@ int main(int argc, char** argv) constexpr int Scale = 3; Window window("Nonortho", Width, Height, Scale); - Bitmap tiles("../res/tiles.png"); + Bitmap tiles("res/tiles.png"); Level level(32, 32, tiles); Bitmap bitmap(Width, Height); diff --git a/src/train.h b/src/train.h index 51c2729..3cd23e4 100644 --- a/src/train.h +++ b/src/train.h @@ -8,7 +8,7 @@ class Level; class Train { public: explicit Train(Level& level) - : m_sprite("../res/car.png"), m_level(level) { } + : m_sprite("res/car.png"), m_level(level) { } void update(); void draw(Bitmap&, int, int); |