From 519c388bbdcea5075a9c674aab93443762f91680 Mon Sep 17 00:00:00 2001 From: Rod Kay Date: Fri, 14 Nov 2025 14:57:56 +1100 Subject: [PATCH] gel.world.rid: Complete rid sprite procedure. --- 4-high/gel/source/world/gel-world.adb | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/4-high/gel/source/world/gel-world.adb b/4-high/gel/source/world/gel-world.adb index ae957f9..e84dd57 100644 --- a/4-high/gel/source/world/gel-world.adb +++ b/4-high/gel/source/world/gel-world.adb @@ -760,6 +760,7 @@ is the_Sprite.apply (add_single_Sprite'unrestricted_Access); the_Sprite.apply (add_the_Joint 'unrestricted_Access); end; + else add_single_Sprite (the_Sprite.all); end if; @@ -773,9 +774,10 @@ is procedure rid_single_Sprite (Single : in out Sprite.item'Class) is begin - -- Self.Commands.add ((Kind => rid_Sprite, - -- Sprite => the_Sprite'unchecked_Access, - -- rid_Children => False)); + if Single.physics_Model.is_Tangible + then + Self.physics_Space.rid (physics.Object.view (Single.Solid)); + end if; Self.all_Sprites.rid (Single'unchecked_Access); -- TODO: Handle grandchildren and so on. end rid_single_Sprite; @@ -783,7 +785,22 @@ is begin if and_Children then - the_Sprite.apply (rid_single_Sprite'unrestricted_Access); + declare + procedure rid_the_Joint (the_Sprite : in out Sprite.item'Class) + is + use type gel.Joint.view; + the_Joint : constant gel.Joint.view := the_Sprite.parent_Joint; + begin + if the_Joint /= null + then + Self.physics_Space.rid (the_Joint.Physics.all'Access); + end if; + end rid_the_Joint; + begin + the_Sprite.apply (rid_single_Sprite'unrestricted_Access); + the_Sprite.apply (rid_the_Joint 'unrestricted_Access); + end; + else rid_single_Sprite (the_Sprite.all); end if;