]> git.seodisparate.com - RockPaperScissorsDuel/commitdiff
Unload added resources on game deconstruction
authorStephen Seo <seo.disparate@gmail.com>
Wed, 15 Mar 2023 07:14:27 +0000 (16:14 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Wed, 15 Mar 2023 07:14:27 +0000 (16:14 +0900)
src/3d_renderer.cc

index 74a67b82d6f981747fccd3aa63d6adee30aaa11f..f99c3963b1ea258777bcfadfdc29e4cf9ff51ff5 100644 (file)
@@ -114,6 +114,22 @@ Renderer3D::~Renderer3D() {
   UnloadTexture(paper_texture);
   UnloadTexture(scissors_texture);
 
+  UnloadMesh(avatar_mesh);
+
+  if (avatar1_texture.has_value()) {
+    UnloadTexture(avatar1_texture.value());
+  }
+  if (avatar2_texture.has_value()) {
+    UnloadTexture(avatar2_texture.value());
+  }
+
+  if (avatar1_material.has_value()) {
+    UnloadMaterial(avatar1_material.value());
+  }
+  if (avatar2_material.has_value()) {
+    UnloadMaterial(avatar2_material.value());
+  }
+
   UnloadModel(skybox_model);
   UnloadModel(platform_model);
   UnloadModel(qm_model);