summary refs log tree commit diff stats
path: root/src/game.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-02-17 20:34:59 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-02-17 20:34:59 -0500
commitaac57db782718bf40a7adea15baf8d6b899ea925 (patch)
treec9f32563cdb9a06e6e24343946c5bb35dc254b76 /src/game.h
parentb3720c4a401f345c49eadabdb852968e273e7077 (diff)
downloadtanetane-aac57db782718bf40a7adea15baf8d6b899ea925.tar.gz
tanetane-aac57db782718bf40a7adea15baf8d6b899ea925.tar.bz2
tanetane-aac57db782718bf40a7adea15baf8d6b899ea925.zip
Made some sprites persist between map changes
The player party characters are now initialised at the start of the game and are no longer re-created after every map change. The script system takes care of moving the player into the correct position on the new map.

Deleted sprite IDs are now reused the next time a sprite is created, instead of throwing out everything between maps.
Diffstat (limited to 'src/game.h')
-rw-r--r--src/game.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/game.h b/src/game.h index 736fa7a..9340c65 100644 --- a/src/game.h +++ b/src/game.h
@@ -1,6 +1,7 @@
1#ifndef GAME_H_E6F1396E 1#ifndef GAME_H_E6F1396E
2#define GAME_H_E6F1396E 2#define GAME_H_E6F1396E
3 3
4#include <deque>
4#include <list> 5#include <list>
5#include <range/v3/all.hpp> 6#include <range/v3/all.hpp>
6#include <vector> 7#include <vector>
@@ -76,7 +77,7 @@ public:
76 }); 77 });
77 } 78 }
78 79
79 void loadMap(std::string filename, std::string warpPoint, Direction dir); 80 void loadMap(std::string filename);
80 81
81 const Map& getMap() const { return *map_; } 82 const Map& getMap() const { return *map_; }
82 83
@@ -84,8 +85,6 @@ public:
84 85
85private: 86private:
86 87
87 void clearSprites();
88
89 Mixer mixer_; 88 Mixer mixer_;
90 bool shouldQuit_ = false; 89 bool shouldQuit_ = false;
91 90
@@ -93,6 +92,7 @@ private:
93 std::map<SystemKey, System*> systemByKey_; 92 std::map<SystemKey, System*> systemByKey_;
94 93
95 std::set<int> spriteIds_; 94 std::set<int> spriteIds_;
95 std::deque<int> idsToReuse_;
96 std::vector<Sprite> sprites_; 96 std::vector<Sprite> sprites_;
97 std::map<std::string, int> spritesByAlias_; 97 std::map<std::string, int> spritesByAlias_;
98 std::unique_ptr<Map> map_; 98 std::unique_ptr<Map> map_;