Skip to content

Conversation

@tony
Copy link
Owner

@tony tony commented Mar 15, 2025

No description provided.

tony added 2 commits March 15, 2025 04:34
Build System Improvements:
- Added a proper `clean` target to the Makefile that works with both Ninja and Make build systems
- The clean target intelligently detects whether to use `ninja clean` or `make clean` based on the presence of build files
- Also cleans up CMake configuration files (CMakeCache.txt and CMakeFiles directory)
- Added `clean` to PHONY targets to ensure it always runs

Code Modernization:
resource.cpp
- Eliminated C++17 warning about copying in range-based for loop by using C++23 structured bindings
- Replaced `std::pair<std::string, std::string>& i` with `const auto& [key, value]` for cleaner iteration over map

util.cpp
- Modernized iterator-based for loops with cleaner range-based for loops
- Simplified TintToSDL_Rect and TintToSDL_Color functions using range-based for loops
- Used post-increment operator (idx++) inline for more concise code

stage.cpp
- Improved iterator management in nested for loops for better readability
- Added references to iterators to avoid repeated dereferencing
- Improved variable naming to be more descriptive (enemy → enemy_it, bullet → bullet_it)
- Added a break statement to optimize processing when an enemy is destroyed
- Improved code structure with descriptive comments

All changes have been tested and build successfully with the C++23 standard.
@tony tony mentioned this pull request Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants