lace.events: Optimise.
This commit is contained in:
@@ -29,9 +29,9 @@ is
|
||||
|
||||
Self.Worlds.append (the_world_Info);
|
||||
|
||||
Self.local_Subject_and_Observer.add (the_add_new_sprite_Response'Access,
|
||||
to_Kind (gel.events.new_sprite_added_to_world_Event'Tag),
|
||||
the_world_Info.World.Name);
|
||||
-- Self.local_Subject_and_Observer.add (the_add_new_sprite_Response'Access,
|
||||
-- to_Kind (gel.events.new_sprite_added_to_world_Event'Tag),
|
||||
-- the_world_Info.World.Name);
|
||||
the_world_Info.World.start;
|
||||
end define;
|
||||
|
||||
|
||||
@@ -29,9 +29,9 @@ is
|
||||
|
||||
Self.Worlds.append (the_world_Info);
|
||||
|
||||
Self.local_Subject_and_Observer.add (the_add_new_sprite_Response'Access,
|
||||
to_Kind (gel.events.new_sprite_added_to_world_Event'Tag),
|
||||
the_world_Info.World.Name);
|
||||
-- Self.local_Subject_and_Observer.add (the_add_new_sprite_Response'Access,
|
||||
-- to_Kind (gel.events.new_sprite_added_to_world_Event'Tag),
|
||||
-- the_world_Info.World.Name);
|
||||
the_world_Info.World.start;
|
||||
end define;
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ is
|
||||
space_Kind => physics.Bullet,
|
||||
Renderer => Self.Renderer).all'Access;
|
||||
|
||||
the_world_Info.World.register (Self.all'unchecked_Access,
|
||||
to_Kind (gel.events.new_sprite_added_to_world_Event'Tag));
|
||||
-- the_world_Info.World.register (Self.all'unchecked_Access,
|
||||
-- to_Kind (gel.events.new_sprite_added_to_world_Event'Tag));
|
||||
|
||||
the_Camera.Viewport_is (Self.Window.Width, Self.Window.Height);
|
||||
the_Camera.Renderer_is (Self.Renderer);
|
||||
@@ -34,9 +34,9 @@ is
|
||||
the_world_Info.Cameras.append (the_Camera);
|
||||
Self.Worlds .append (the_world_Info);
|
||||
|
||||
Self.local_Subject_and_Observer.add (the_add_new_sprite_Response'Access,
|
||||
to_Kind (gel.events.new_sprite_added_to_world_Event'Tag),
|
||||
the_world_Info.World.Name);
|
||||
-- Self.local_Subject_and_Observer.add (the_add_new_sprite_Response'Access,
|
||||
-- to_Kind (gel.events.new_sprite_added_to_world_Event'Tag),
|
||||
-- the_world_Info.World.Name);
|
||||
the_world_Info.World.start;
|
||||
end;
|
||||
|
||||
@@ -49,8 +49,8 @@ is
|
||||
space_Kind => physics.Bullet,
|
||||
Renderer => Self.Renderer).all'Access;
|
||||
|
||||
the_world_Info.World.register (the_Observer => Self.all'unchecked_Access,
|
||||
of_Kind => to_Kind (gel.events.new_sprite_added_to_world_Event'Tag));
|
||||
-- the_world_Info.World.register (the_Observer => Self.all'unchecked_Access,
|
||||
-- of_Kind => to_Kind (gel.events.new_sprite_added_to_world_Event'Tag));
|
||||
|
||||
the_Camera.Viewport_is (Self.Window.Width, Self.Window.Height);
|
||||
the_Camera.Renderer_is (Self.Renderer);
|
||||
@@ -59,9 +59,9 @@ is
|
||||
the_world_Info.Cameras.append (the_Camera);
|
||||
Self.Worlds .append (the_world_Info);
|
||||
|
||||
Self.local_Subject_and_Observer.add (the_add_new_sprite_Response'Access,
|
||||
to_Kind (gel.events.new_sprite_added_to_world_Event'Tag),
|
||||
the_world_Info.World.Name);
|
||||
-- Self.local_Subject_and_Observer.add (the_add_new_sprite_Response'Access,
|
||||
-- to_Kind (gel.events.new_sprite_added_to_world_Event'Tag),
|
||||
-- the_world_Info.World.Name);
|
||||
the_world_Info.World.start;
|
||||
end;
|
||||
end define;
|
||||
|
||||
@@ -30,9 +30,9 @@ is
|
||||
|
||||
Self.Worlds.append (the_world_Info);
|
||||
|
||||
Self.local_Subject_and_Observer.add (the_add_new_sprite_Response'Access,
|
||||
to_Kind (gel.events.new_sprite_added_to_world_Event'Tag),
|
||||
the_world_Info.World.Name);
|
||||
-- Self.local_Subject_and_Observer.add (the_add_new_sprite_Response'Access,
|
||||
-- to_Kind (gel.events.new_sprite_added_to_world_Event'Tag),
|
||||
-- the_world_Info.World.Name);
|
||||
the_world_Info.World.start;
|
||||
end define;
|
||||
|
||||
|
||||
@@ -55,14 +55,14 @@ is
|
||||
overriding
|
||||
procedure respond (Self : in out add_new_Sprite; to_Event : in lace.Event.item'Class)
|
||||
is
|
||||
the_Event : constant gel.events.new_sprite_added_to_world_Event
|
||||
:= gel.events.new_sprite_added_to_world_Event (to_Event);
|
||||
-- the_Event : constant gel.events.new_sprite_added_to_world_Event
|
||||
-- := gel.events.new_sprite_added_to_world_Event (to_Event);
|
||||
|
||||
the_Sprite : gel.Sprite.view;
|
||||
|
||||
begin
|
||||
log ("gel.applet.add_new_Sprite.respond");
|
||||
the_Sprite := Self.Applet.World (the_Event.World_Id).fetch_Sprite (the_event.Sprite_Id);
|
||||
-- the_Sprite := Self.Applet.World (the_Event.World_Id).fetch_Sprite (the_event.Sprite_Id);
|
||||
|
||||
the_Sprite.is_Visible (True);
|
||||
Self.Applet.add (the_Sprite);
|
||||
@@ -276,9 +276,9 @@ is
|
||||
|
||||
Self.Worlds.append (the_world_Info);
|
||||
|
||||
Self.local_Subject_and_Observer.add (the_add_new_sprite_Response'Access,
|
||||
to_Kind (gel.Events.new_sprite_added_to_world_Event'Tag),
|
||||
the_world_Info.World.Name);
|
||||
-- Self.local_Subject_and_Observer.add (the_add_new_sprite_Response'Access,
|
||||
-- to_Kind (gel.Events.new_sprite_added_to_world_Event'Tag),
|
||||
-- the_world_Info.World.Name);
|
||||
the_world_Info.World.start;
|
||||
|
||||
Self.add (the_world_Info);
|
||||
|
||||
@@ -137,6 +137,8 @@ is
|
||||
|
||||
private
|
||||
|
||||
pragma Suppress (Container_Checks); -- Suppress expensive tamper checks.
|
||||
|
||||
use type Sprite.view;
|
||||
package sprite_Vectors is new ada.containers.Vectors (Positive, Sprite.view);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user