Fixed critical asset bug on both Debug and Release build#11
Merged
Conversation
- **ResourceManager**: Fixed double ownership issue causing silent texture failures
- Add texture validation with isTextureValid() method
- Implement cache validation to detect and recover from invalid cached textures
- Add clearCache() method for state resets without destroying textures
- Enhanced error logging throughout loading pipeline
- Fix Release build texture validation to prevent cache invalidation
- **Entity**: Fixed texture ownership model to prevent double destruction
- Add dual texture support (owned SharedSDLTexture vs non-owned raw pointer)
- Update constructors to handle ResourceManager-owned textures safely
- Prevent premature texture destruction when ResourceManager caches textures
- **Tests**: Added AssetLoadingTest suite for CI/CD validation
- Test all game image assets with validation and caching verification
- Test font loading across all game font sizes with text texture creation
- Test UI text generation for all in-game text elements and colors
- Test ResourceManager caching behavior and edge cases
- Add smart working directory detection for CTest compatibility
- 6 test cases covering complete asset loading pipeline
- **CI/CD**: Added Release build testing to GitHub Actions workflow
- Test both Debug and Release configurations
- Ensure asset loading works correctly in optimized builds
- **MenuSystem**: Changed end screen escape behavior (GoToMainMenu → QuitGame)
- **Cleanup**: Remove old_game_loop.md and added TEST_RUNNERS.md file
Fixes game-breaking asset loading failures that occurred after first gameplay
session, where textures would fail to load silently and worsen with retries.
Not sure what I was thinking in changing the windows path. MacOS worked so now just Ubuntu.
I removed the fixed SDL_Delay(75) calls and replaced them with a more dynamic frame limiting approach based on the actual frame time. The rendering issues are far from fixed but at least this means things should theoretically be more consistent across hardware. This will likely be my last commit for a while as I focus on other projects and entering open source. I will come back to Meowstro
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
Main Fixes
Other changes:
old_game_loop.mdfile.Changes
Testing
I ran the tests, played the game multiple times with both types of builds.