mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 01:15:58 +00:00
fixed inventory animation speed
svn-id: r47148
This commit is contained in:
parent
65c29eb851
commit
adcb8cfa7d
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -565,7 +565,7 @@ Common::Error TeenAgentEngine::run() {
|
||||
}
|
||||
}
|
||||
|
||||
inventory->render(surface);
|
||||
inventory->render(surface, tick_game? 1: 0);
|
||||
|
||||
_system->unlockScreen();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user