diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-06 18:35:29 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-06 18:35:29 +0100 |
| commit | 0911bfc9b014e02f1dd9d631f39c64a8b1717118 (patch) | |
| tree | 1091758098f70c0d93edb0f69885ccfebcb1adb2 /src/tests/test_mesh.cc | |
| parent | 69fd884aaec5523871696149cd39aff6b10c9397 (diff) | |
fix(test_mesh): Add missing include and wrap debug calls in STRIP_ALL guards
FIXES:
- Added missing include: util/asset_manager_utils.h for MeshVertex struct
- Wrapped Renderer3D::SetDebugEnabled() call in #if !defined(STRIP_ALL)
- Wrapped GetVisualDebug() call in #if !defined(STRIP_ALL)
ISSUE:
test_mesh.cc failed to compile with 8 errors:
- MeshVertex undeclared (missing include)
- SetDebugEnabled/GetVisualDebug unavailable (conditionally compiled methods)
SOLUTION:
Both methods are only available when STRIP_ALL is not defined (debug builds).
Wrapped usage in matching conditional compilation guards.
Build verified: test_mesh compiles successfully.
Diffstat (limited to 'src/tests/test_mesh.cc')
| -rw-r--r-- | src/tests/test_mesh.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tests/test_mesh.cc b/src/tests/test_mesh.cc index 8c64d9b..55de3a9 100644 --- a/src/tests/test_mesh.cc +++ b/src/tests/test_mesh.cc @@ -8,6 +8,7 @@ #include "gpu/effects/shaders.h" #include "gpu/texture_manager.h" #include "platform.h" +#include "util/asset_manager_utils.h" #include <webgpu.h> #include "procedural/generator.h" #include <algorithm> @@ -270,9 +271,11 @@ int main(int argc, char** argv) { g_renderer.init(g_device, g_queue, g_format); g_renderer.resize(platform_state.width, platform_state.height); +#if !defined(STRIP_ALL) if (debug_mode) { Renderer3D::SetDebugEnabled(true); } +#endif /* !defined(STRIP_ALL) */ g_textures.init(g_device, g_queue); ProceduralTextureDef noise_def; @@ -308,11 +311,13 @@ int main(int argc, char** argv) { g_camera.aspect_ratio = platform_state.aspect_ratio; g_scene.objects[1].rotation = quat::from_axis({0.5f, 1.0f, 0.0f}, time); - + +#if !defined(STRIP_ALL) if (debug_mode) { auto* vertices = (std::vector<MeshVertex>*)g_scene.objects[1].user_data; g_renderer.GetVisualDebug().add_mesh_normals(g_scene.objects[1].get_model_matrix(), (uint32_t)vertices->size(), vertices->data()); } +#endif /* !defined(STRIP_ALL) */ WGPUSurfaceTexture surface_tex; wgpuSurfaceGetCurrentTexture(g_surface, &surface_tex); |
