diff options
-rw-r--r-- | engines/teenagent/inventory.cpp | 4 | ||||
-rw-r--r-- | engines/teenagent/inventory.h | 1 | ||||
-rw-r--r-- | engines/teenagent/teenagent.cpp | 1 |
3 files changed, 6 insertions, 0 deletions
diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp index 21584394c6..3ffda1ac4c 100644 --- a/engines/teenagent/inventory.cpp +++ b/engines/teenagent/inventory.cpp @@ -115,6 +115,10 @@ void Inventory::clear() { } } +void Inventory::flush() { + for (int i = 0; i < 24; ++i) + graphics[i].free(); +} void Inventory::add(byte item) { if (has(item)) diff --git a/engines/teenagent/inventory.h b/engines/teenagent/inventory.h index c1f56e6f84..8b302055b8 100644 --- a/engines/teenagent/inventory.h +++ b/engines/teenagent/inventory.h @@ -42,6 +42,7 @@ public: void render(Graphics::Surface *surface, int delta); void clear(); + void flush(); void add(byte item); bool has(byte item) const; void remove(byte item); diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp index 43bb78c495..7f8c5b3ccc 100644 --- a/engines/teenagent/teenagent.cpp +++ b/engines/teenagent/teenagent.cpp @@ -213,6 +213,7 @@ Common::Error TeenAgentEngine::loadGameState(int slot) { scene->clear(); inventory->activate(false); + inventory->flush(); setMusic(Resources::instance()->dseg.get_byte(0xDB90)); |