aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress/data/animation.cpp
diff options
context:
space:
mode:
authorMax Horn2011-06-03 18:21:58 +0200
committerMax Horn2011-06-03 18:21:58 +0200
commitaec2ea966183950189d0f5db4c447aa332fc4ae3 (patch)
tree546c1241b710b158182c081df579752cbd1f06ad /engines/lastexpress/data/animation.cpp
parente364072091b41285fcca8a3ec403917181a41118 (diff)
downloadscummvm-rg350-aec2ea966183950189d0f5db4c447aa332fc4ae3.tar.gz
scummvm-rg350-aec2ea966183950189d0f5db4c447aa332fc4ae3.tar.bz2
scummvm-rg350-aec2ea966183950189d0f5db4c447aa332fc4ae3.zip
ENGINES: Remove some uses of g_engine
Diffstat (limited to 'engines/lastexpress/data/animation.cpp')
-rw-r--r--engines/lastexpress/data/animation.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/engines/lastexpress/data/animation.cpp b/engines/lastexpress/data/animation.cpp
index 8ce73993c3..1cbf7672d1 100644
--- a/engines/lastexpress/data/animation.cpp
+++ b/engines/lastexpress/data/animation.cpp
@@ -94,7 +94,7 @@ bool Animation::load(Common::SeekableReadStream *stream, int flag) {
}
_currentChunk = _chunks.begin();
_changed = false;
- _startTime = g_engine->_system->getMillis();
+ _startTime = g_system->getMillis();
return true;
}
@@ -110,7 +110,7 @@ bool Animation::process() {
// - Re-implement to be closer to the original engine
// - Add support for subtitles
// - Use engine sound queue instead of our own appendable sound instance
- int32 currentFrame = (g_engine->_system->getMillis() - _startTime) * 3 / 100;
+ int32 currentFrame = (g_system->getMillis() - _startTime) * 3 / 100;
// Process all chunks until the current frame
while (!_changed && _currentChunk != NULL && currentFrame > _currentChunk->frame && !hasEnded()) {
@@ -180,7 +180,7 @@ bool Animation::process() {
// Synchronize the audio by resetting the start time
if (_currentChunk->frame == 0)
- _startTime = g_engine->_system->getMillis();
+ _startTime = g_system->getMillis();
break;
case kChunkTypeAudioEnd:
@@ -260,7 +260,8 @@ void Animation::processChunkAudio(Common::SeekableReadStream *in, const Chunk &c
// TODO: this method will probably go away and be integrated in the main loop
void Animation::play() {
- while (!hasEnded() && !g_engine->getEventManager()->shouldQuit() && !g_engine->getEventManager()->shouldRTL()) {
+ Common::EventManager *eventMan = g_system->getEventManager();
+ while (!hasEnded() && !Engine::shouldQuit()) {
process();
if (_changed) {
@@ -283,11 +284,11 @@ void Animation::play() {
g_system->updateScreen();
//FIXME: implement subtitles
- g_engine->_system->delayMillis(20);
+ g_system->delayMillis(20);
// Handle right-click to interrupt animations
Common::Event ev = Common::Event();
- while (g_engine->getEventManager()->pollEvent(ev)) {
+ while (eventMan->pollEvent(ev)) {
if (ev.type == Common::EVENT_RBUTTONUP) {
// Stop audio
if (_audio)