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

megath at users.sourceforge.net megath at users.sourceforge.net
Fri Jan 8 11:35:29 CET 2010


Revision: 47148
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47148&view=rev
Author:   megath
Date:     2010-01-08 10:35:25 +0000 (Fri, 08 Jan 2010)

Log Message:
-----------
fixed inventory animation speed

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-01-08 07:58:04 UTC (rev 47147)
+++ scummvm/trunk/engines/teenagent/inventory.cpp	2010-01-08 10:35:25 UTC (rev 47148)
@@ -246,7 +246,7 @@
 	surface.free();
 }
 
-void Inventory::Item::render(Inventory *inventory, InventoryObject *obj, Graphics::Surface *dst) {
+void Inventory::Item::render(Inventory *inventory, InventoryObject *obj, Graphics::Surface *dst, int delta) {
 	Resources *res = Resources::instance();
 
 	rect.render(dst, hovered ? 233 : 234);
@@ -257,9 +257,9 @@
 			animation.load(inventory->items, Animation::kTypeInventory);
 		}
 		if (hovered) {
-			Surface *s = animation.currentFrame(1);
+			Surface *s = animation.currentFrame(delta);
 			if (animation.currentIndex() == 0)
-				s = animation.currentFrame(1);
+				s = animation.currentFrame(1); //force index to be 1 here
 			if (s != NULL)
 				s->render(dst, rect.left + 1, rect.top + 1);
 		} else {
@@ -290,7 +290,7 @@
 	}
 }
 
-void Inventory::render(Graphics::Surface *surface) {
+void Inventory::render(Graphics::Surface *surface, int delta) {
 	if (!_active)
 		return;
 
@@ -306,7 +306,7 @@
 			//debug(0, "%d,%d -> %u", x0, y0, item);
 
 			InventoryObject *obj = &objects[item];
-			graphics[idx].render(this, obj, surface);
+			graphics[idx].render(this, obj, surface, delta);
 		}
 	}
 }

Modified: scummvm/trunk/engines/teenagent/inventory.h
===================================================================
--- scummvm/trunk/engines/teenagent/inventory.h	2010-01-08 07:58:04 UTC (rev 47147)
+++ scummvm/trunk/engines/teenagent/inventory.h	2010-01-08 10:35:25 UTC (rev 47148)
@@ -39,7 +39,7 @@
 class Inventory {
 public:
 	void init(TeenAgentEngine *engine);
-	void render(Graphics::Surface *surface);
+	void render(Graphics::Surface *surface, int delta);
 
 	void clear();
 	void add(byte item);
@@ -70,7 +70,7 @@
 
 		Item() : hovered(false) {}
 		void free();
-		void render(Inventory *inventory, InventoryObject *obj, Graphics::Surface *surface);
+		void render(Inventory *inventory, InventoryObject *obj, Graphics::Surface *surface, int delta);
 	} graphics[24];
 
 	bool _active;

Modified: scummvm/trunk/engines/teenagent/teenagent.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/teenagent.cpp	2010-01-08 07:58:04 UTC (rev 47147)
+++ scummvm/trunk/engines/teenagent/teenagent.cpp	2010-01-08 10:35:25 UTC (rev 47148)
@@ -565,7 +565,7 @@
 			}
 		}
 
-		inventory->render(surface);
+		inventory->render(surface, tick_game? 1: 0);
 
 		_system->unlockScreen();
 


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