[Scummvm-cvs-logs] SF.net SVN: scummvm:[48325] scummvm/trunk/engines/teenagent

megath at users.sourceforge.net megath at users.sourceforge.net
Sat Mar 20 17:23:15 CET 2010


Revision: 48325
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48325&view=rev
Author:   megath
Date:     2010-03-20 16:23:15 +0000 (Sat, 20 Mar 2010)

Log Message:
-----------
flush inventory items on savegame load, fixing invalid item tiles after multiple loads.

Modified Paths:
--------------
    scummvm/trunk/engines/teenagent/inventory.cpp
    scummvm/trunk/engines/teenagent/inventory.h
    scummvm/trunk/engines/teenagent/teenagent.cpp

Modified: scummvm/trunk/engines/teenagent/inventory.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/inventory.cpp	2010-03-20 16:08:28 UTC (rev 48324)
+++ scummvm/trunk/engines/teenagent/inventory.cpp	2010-03-20 16:23:15 UTC (rev 48325)
@@ -115,6 +115,10 @@
 	}
 }
 
+void Inventory::flush() {
+	for (int i = 0; i < 24; ++i) 
+		graphics[i].free();
+}
 
 void Inventory::add(byte item) {
 	if (has(item))

Modified: scummvm/trunk/engines/teenagent/inventory.h
===================================================================
--- scummvm/trunk/engines/teenagent/inventory.h	2010-03-20 16:08:28 UTC (rev 48324)
+++ scummvm/trunk/engines/teenagent/inventory.h	2010-03-20 16:23:15 UTC (rev 48325)
@@ -42,6 +42,7 @@
 	void render(Graphics::Surface *surface, int delta);
 
 	void clear();
+	void flush();
 	void add(byte item);
 	bool has(byte item) const;
 	void remove(byte item);

Modified: scummvm/trunk/engines/teenagent/teenagent.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/teenagent.cpp	2010-03-20 16:08:28 UTC (rev 48324)
+++ scummvm/trunk/engines/teenagent/teenagent.cpp	2010-03-20 16:23:15 UTC (rev 48325)
@@ -213,6 +213,7 @@
 
 	scene->clear();
 	inventory->activate(false);
+	inventory->flush();
 
 	setMusic(Resources::instance()->dseg.get_byte(0xDB90));
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list