diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-13 20:50:21 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-13 20:50:21 -0500 |
commit | 470b1d43fb6f8e17624ee90f87270de5bd6ff77e (patch) | |
tree | 966f1e18d496f12c3273684be299573e4bf443ec /src/renderer.h | |
parent | ed933607765a6e010689aaaf85184053ff6e8a2b (diff) | |
download | tanetane-470b1d43fb6f8e17624ee90f87270de5bd6ff77e.tar.gz tanetane-470b1d43fb6f8e17624ee90f87270de5bd6ff77e.tar.bz2 tanetane-470b1d43fb6f8e17624ee90f87270de5bd6ff77e.zip |
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.
Diffstat (limited to 'src/renderer.h')
-rw-r--r-- | src/renderer.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/renderer.h b/src/renderer.h index 1684a0c..54dae1c 100644 --- a/src/renderer.h +++ b/src/renderer.h | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | class Game; | 12 | class Game; |
13 | class Map; | 13 | class Map; |
14 | class Sprite; | ||
14 | 15 | ||
15 | class sdl_error : public std::logic_error { | 16 | class sdl_error : public std::logic_error { |
16 | public: | 17 | public: |
@@ -133,6 +134,9 @@ private: | |||
133 | std::vector<texture_ptr> textures_; | 134 | std::vector<texture_ptr> textures_; |
134 | std::map<std::string, int> filenameToTexId_; | 135 | std::map<std::string, int> filenameToTexId_; |
135 | 136 | ||
137 | // Sprite rendering | ||
138 | void renderSprite(const Sprite& sprite); | ||
139 | |||
136 | // Map rendering | 140 | // Map rendering |
137 | texture_ptr renderMapLayer(const Map& map, int layer); | 141 | texture_ptr renderMapLayer(const Map& map, int layer); |
138 | 142 | ||