From 470b1d43fb6f8e17624ee90f87270de5bd6ff77e Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 13 Feb 2021 20:50:21 -0500 Subject: Added lightning sprite to mailbox event Sprites can be destroyed now, which really just means that their index is removed from the list of active sprites. The actual memory is not freed until all sprites are deleted on map change. Sprite layers are introduced. All sprites by default are on layer 0 (Normal) which renders them in between the lower and upper map layers. There is also a layer 1 (Above) that renders above the upper map layer, and the sprite for the lightning strike uses this layer in order to not be hidden by the trees. Fixed a bug where waiting for the end of a non-looping animation would trip the flag immediately upon the final frame activating, instead of waiting the length of the last frame. --- src/camera_system.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/camera_system.h') diff --git a/src/camera_system.h b/src/camera_system.h index 77d813f..37ff8b4 100644 --- a/src/camera_system.h +++ b/src/camera_system.h @@ -26,6 +26,8 @@ public: void tick(double dt) override; + void destroySprite(int spriteId) override; + void clearSpriteCache() override; private: -- cgit 1.4.1