Conversation
The build process now uses a vcpkg for dependency management. This simplifies a lot of things but required some changes to file paths. I also redid the CMakeLists.txt and build.yml files to work with this new build process. I added a few things to the build.yml so hopefully it works. Updated the documentation to reflect these changes. I also removed some old audio files that are no longer needed. I plan to add tests that can be ran in Git Actions but this is fine for now.
Made it so each function is looped once before exiting to test w/o user input. No tests yet but will probably add them later.
Made it so each function is looped once before exiting to test w/o user input. No tests yet but will probably add them later.
Updated the build configuration and all documentation/scripts related to it I believe. I also changed a bit of the main to just reserve space for a vector of sprites rather than using push_back for each element.
I removed the global download for dependencies step from the README.md because it was unnecessary. Running the build script handled that I also made it so the version information is now documented in DEPENDENCIES.md. I also edited the vcpkg.json and CMakeLists.txt to work with those versions. I also changed the workflow file to be more accurately named name: Windows Build and Test to -> name: Multi-Platform Build and Test
Changed v2.32.2 to v2.28.2 for sdl2
SDL2 >= 2.30.0 SDL2_Image >= 2.8.2 SDL2_Mixer >= 2.8.0 SDL2_TTF >= 2.22.0
SDL2 >= 2.30.0 SDL2_Image >= 2.8.2 SDL2_Mixer >= 2.8.0 SDL2_TTF >= 2.22.0
Use ResourceManager to load and manage fonts and textures. This removes the need for constant calling of getRenderer from RenderWindow.hpp It also reduces code for fixing memory leak. Rather than manually freeing the memory for each texture, the ResourceManager class handles it automatically when the program exits. ResourceManager also uses an unordered_map to cache loaded textures and fonts, improving efficiency by avoiding redundant loading operations. The file size of Meowstro.cpp has decreased a bit thanks to this but there are still many more improvements needed to dismantle the code and make it more modular, maintainable, and testable.
I removed a couple comments that weren't helpful. I also removed the usage of the std namespace in the codebase. Finally, I encapsulated configuration-related data and methods within the GameConfig class for better organization and maintainability. This class just puts related colors, paths, and values into nested structs. I updated the CMakeLists.txt to add the new GameConfig files.
This makes it easier to handle moving things around and allows me to add additional screens/states more easily. One critical state that is planned is the pause menu state. I will also consider a settings state. Currently it only calls the functions in meowstro.cpp but I plan to change that so the meowstro.cpp file isn't cluttered.
The gameLoop function continues to exist simply for reference but once the game loop is completely replaced and moved, the 200 line function will be deleted. It is currently unused thanks to the changes made. There may be a small issue related to the hook animation when thrown but that is a visual bug I will fix in the future. This code is a working game that is essentially a rough draft.
This class allows us to keep all the menus contained here easily. It also allows for easy navigation between different menu states. Finally, It can be used to add more menus. This game really needs a pause and settings menu so those will be very high priority now!
These include - tests/unit/test_Entity.cpp - tests/unit/test_GameConfig.cpp - tests/unit/test_InputHandler.cpp - tests/unit/test_ResourceManager.cpp - tests/unit/test_Sprite.cpp - tests/unit/test_Logger.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request introduces major improvements to the build system, dependency management, and project structure for multi-platform support. The most important changes are the overhaul of the CI workflow to support Windows, Linux, and macOS, the modernization and simplification of the
CMakeLists.txtbuild configuration, and the addition of automated unit testing. It also removes legacy configuration files and clarifies project dependencies.Build system and CI improvements:
.github/workflows/build.ymlworkflow is completely rewritten to support multi-platform builds (Windows, Linux, macOS), with platform-specific setup for dependencies, static analysis (cppcheck, clang-tidy), caching, and artifact uploads. Legacy manual SDL2 downloads are replaced with package managers (vcpkg, apt, Homebrew).CMake configuration modernization:
CMakeLists.txtis refactored to remove reliance onconfig.jsonand presets, instead usingfind_packageandpkg-configto locate SDL2 and related libraries. It sets minimum tested versions, splits logic into a static library for easier testing, copies assets after build, and integrates Google Test for unit testing.Testing and dependency documentation:
DEPENDENCIES.mddocumenting minimum tested versions of core dependencies for easier onboarding and troubleshooting.Cleanup of legacy files:
CMakePresets.default.json, as configuration is now handled directly in CMake and the workflow.Legal and attribution update:
LICENSEto include the full list of project contributors.Refactored Code
src/meowstro.cppfrom 554 lines to 90.Changes
Testing