Skip to content

Commit

Permalink
Bundle assets better
Browse files Browse the repository at this point in the history
  • Loading branch information
JustDoom committed Dec 7, 2024
1 parent c9afbc5 commit a95cc1b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
- name: Configure and build
run: |
mkdir build && cd build
cmake ..
cmake --build .
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
- name: Upload executable
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ foreach(ASSET ${ASSETS})
endforeach()

add_subdirectory(dependencies)
add_subdirectory(src)
add_subdirectory(src)
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@ if(WIN32)
$<TARGET_FILE_DIR:8ChocChip>)
endif()
endif()

add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${PROJECT_SOURCE_DIR}/assets"
"$<TARGET_FILE_DIR:${PROJECT_NAME}>/assets")
4 changes: 2 additions & 2 deletions src/sfml/MainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ MainMenu::MainMenu(std::unordered_map<std::string *, std::vector<std::string>>&

sf::Vector2u originalWindowSize = this->window.getSize();
sf::Image icon;
icon.loadFromFile("../../assets/icon.png");
icon.loadFromFile("assets/icon.png");
this->window.setIcon(64, 64, icon.getPixelsPtr());
// this->window.setVerticalSyncEnabled(true);

sf::Font font;
font.loadFromFile("../../assets/font.ttf");
font.loadFromFile("assets/font.ttf");

std::unordered_map<std::string, TextButton> roms;

Expand Down

0 comments on commit a95cc1b

Please sign in to comment.