Commit eabeea3
committed
Fixed critical ResourceManager asset loading issue
- **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.1 parent 8014bed commit eabeea3
File tree
10 files changed
+448
-321
lines changed- .github/workflows
- include
- src
- tests/unit
10 files changed
+448
-321
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
83 | 90 | | |
84 | 91 | | |
85 | 92 | | |
| |||
148 | 155 | | |
149 | 156 | | |
150 | 157 | | |
151 | | - | |
| 158 | + | |
152 | 159 | | |
153 | 160 | | |
154 | 161 | | |
155 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
156 | 169 | | |
157 | 170 | | |
158 | 171 | | |
| |||
219 | 232 | | |
220 | 233 | | |
221 | 234 | | |
222 | | - | |
| 235 | + | |
223 | 236 | | |
224 | 237 | | |
225 | 238 | | |
226 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
227 | 246 | | |
228 | 247 | | |
229 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| 219 | + | |
219 | 220 | | |
220 | 221 | | |
221 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | 32 | | |
51 | 33 | | |
52 | | - | |
| 34 | + | |
53 | 35 | | |
54 | 36 | | |
55 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | | - | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | | - | |
| 60 | + | |
| 61 | + | |
59 | 62 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
25 | 31 | | |
26 | 32 | | |
27 | 33 | | |
| |||
0 commit comments