aboutsummaryrefslogtreecommitdiff
path: root/engines/teenagent
diff options
context:
space:
mode:
authorVladimir Menshakov2010-01-08 10:35:25 +0000
committerVladimir Menshakov2010-01-08 10:35:25 +0000
commitadcb8cfa7d27ecfb4d2788a8b46ce4c8a6df6c94 (patch)
tree1c8567202b81332412c7b2457e0cad9fbec24b83 /engines/teenagent
parent65c29eb85183f8cecc1abff0d7776a767abf67ef (diff)
downloadscummvm-rg350-adcb8cfa7d27ecfb4d2788a8b46ce4c8a6df6c94.tar.gz
scummvm-rg350-adcb8cfa7d27ecfb4d2788a8b46ce4c8a6df6c94.tar.bz2
scummvm-rg350-adcb8cfa7d27ecfb4d2788a8b46ce4c8a6df6c94.zip
fixed inventory animation speed
svn-id: r47148
Diffstat (limited to 'engines/teenagent')
-rw-r--r--engines/teenagent/inventory.cpp10
-rw-r--r--engines/teenagent/inventory.h4
-rw-r--r--engines/teenagent/teenagent.cpp2
3 files changed, 8 insertions, 8 deletions
diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp
index caa6a6267b..4468dcd593 100644
--- a/engines/teenagent/inventory.cpp
+++ b/engines/teenagent/inventory.cpp
@@ -246,7 +246,7 @@ void Inventory::Item::free() {
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 @@ void Inventory::Item::render(Inventory *inventory, InventoryObject *obj, Graphic
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::Item::render(Inventory *inventory, InventoryObject *obj, Graphic
}
}
-void Inventory::render(Graphics::Surface *surface) {
+void Inventory::render(Graphics::Surface *surface, int delta) {
if (!_active)
return;
@@ -306,7 +306,7 @@ void Inventory::render(Graphics::Surface *surface) {
//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);
}
}
}
diff --git a/engines/teenagent/inventory.h b/engines/teenagent/inventory.h
index 16f7714c04..ece5ff5d16 100644
--- a/engines/teenagent/inventory.h
+++ b/engines/teenagent/inventory.h
@@ -39,7 +39,7 @@ class TeenAgentEngine;
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 @@ private:
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;
diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp
index 0f6832dd5b..8245cdf62e 100644
--- a/engines/teenagent/teenagent.cpp
+++ b/engines/teenagent/teenagent.cpp
@@ -565,7 +565,7 @@ Common::Error TeenAgentEngine::run() {
}
}
- inventory->render(surface);
+ inventory->render(surface, tick_game? 1: 0);
_system->unlockScreen();