mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-27 05:32:45 +00:00
ACCESS: Added code to update animations each frame
This commit is contained in:
parent
e3687ea123
commit
f8d64ae6bc
@ -331,4 +331,11 @@ void AnimationManager::animate(int animId) {
|
||||
anim->animate();
|
||||
}
|
||||
|
||||
void AnimationManager::updateTimers() {
|
||||
for (uint idx = 0; idx < _animationTimers.size(); ++idx) {
|
||||
if (_animationTimers[idx]->_countdownTicks > 0)
|
||||
_animationTimers[idx]->_countdownTicks--;
|
||||
}
|
||||
}
|
||||
|
||||
} // End of namespace Access
|
||||
|
@ -49,14 +49,25 @@ public:
|
||||
void freeAnimationData();
|
||||
void loadAnimations(const byte *data, int size);
|
||||
|
||||
void clearTimers();
|
||||
|
||||
Animation *findAnimation(int animId);
|
||||
Animation *setAnimation(int animId);
|
||||
|
||||
void animate(int animId);
|
||||
|
||||
/**
|
||||
* Clear the list of currently active animations
|
||||
*/
|
||||
void clearTimers();
|
||||
|
||||
/**
|
||||
* Add an animation to the list of currently animating ones
|
||||
*/
|
||||
void setAnimTimer(Animation *anim);
|
||||
|
||||
void animate(int animId);
|
||||
/**
|
||||
* Update the timing of all currently active animation
|
||||
*/
|
||||
void updateTimers();
|
||||
};
|
||||
|
||||
class AnimationResource {
|
||||
|
@ -144,17 +144,22 @@ void EventsManager::checkForNextFrameCounter() {
|
||||
++_frameCounter;
|
||||
_priorFrameTime = milli;
|
||||
|
||||
// Give time to the debugger
|
||||
_vm->_debugger->onFrame();
|
||||
|
||||
// Signal the ScummVM debugger
|
||||
_vm->_debugger->onFrame();
|
||||
|
||||
// TODO: Refactor for dirty rects
|
||||
_vm->_screen->updateScreen();
|
||||
nextFrame();
|
||||
}
|
||||
}
|
||||
|
||||
void EventsManager::nextFrame() {
|
||||
|
||||
// Give time to the debugger
|
||||
_vm->_debugger->onFrame();
|
||||
|
||||
// Update timers
|
||||
_vm->_animation->updateTimers();
|
||||
|
||||
// TODO: Refactor for dirty rects
|
||||
_vm->_screen->updateScreen();
|
||||
}
|
||||
|
||||
void EventsManager::delay(int time) {
|
||||
g_system->delayMillis(time);
|
||||
}
|
||||
|
@ -47,6 +47,8 @@ private:
|
||||
uint32 _priorFrameTime;
|
||||
|
||||
void checkForNextFrameCounter();
|
||||
|
||||
void nextFrame();
|
||||
public:
|
||||
CursorType _cursorId;
|
||||
bool _leftButton;
|
||||
|
Loading…
x
Reference in New Issue
Block a user