diff options
author | Vladimir Menshakov | 2009-09-07 20:38:02 +0000 |
---|---|---|
committer | Vladimir Menshakov | 2009-09-07 20:38:02 +0000 |
commit | 776d5183fd64a8bd831e552c4471d43103f36e99 (patch) | |
tree | ff3a3da19477de6cb0bfc92352964a3c5294b046 /engines/teenagent/inventory.cpp | |
parent | 3a1c347da6744ed97ba3240c10d07f5976371338 (diff) | |
download | scummvm-rg350-776d5183fd64a8bd831e552c4471d43103f36e99.tar.gz scummvm-rg350-776d5183fd64a8bd831e552c4471d43103f36e99.tar.bz2 scummvm-rg350-776d5183fd64a8bd831e552c4471d43103f36e99.zip |
play animation only when hovered
svn-id: r44005
Diffstat (limited to 'engines/teenagent/inventory.cpp')
-rw-r--r-- | engines/teenagent/inventory.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp index bdf99bd971..ccb182e8b0 100644 --- a/engines/teenagent/inventory.cpp +++ b/engines/teenagent/inventory.cpp @@ -237,9 +237,17 @@ void Inventory::Item::render(Inventory * inventory, InventoryObject *obj, Graphi inventory->items->seek(inventory->offset[obj->id - 1]); animation.load(inventory->items, Animation::TypeInventory); } - Surface * s = animation.currentFrame(); - if (s != NULL) - s->render(dst, rect.left + 1, rect.top + 1); + if (hovered) { + Surface * s = animation.currentFrame(); + if (animation.currentIndex() == 0) + s = animation.currentFrame(); + if (s != NULL) + s->render(dst, rect.left + 1, rect.top + 1); + } else { + Surface * s = animation.firstFrame(); + if (s != NULL) + s->render(dst, rect.left + 1, rect.top + 1); + } } else { if (surface.empty()) { debug(0, "loading item %d from offset %x", obj->id, inventory->offset[obj->id - 1]); |