From be4c436dcaa960bceedd6d526041df06919bc225 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 22 Dec 2015 19:40:34 +0100 Subject: LAB: Move event update functions out of updateMusic --- engines/lab/anim.cpp | 8 +++--- engines/lab/dispman.cpp | 26 ++++++++++---------- engines/lab/engine.cpp | 12 ++++----- engines/lab/intro.cpp | 24 +++++++++--------- engines/lab/lab.cpp | 6 +++++ engines/lab/lab.h | 1 + engines/lab/map.cpp | 10 ++++---- engines/lab/music.cpp | 60 ++++++++++++++++++++++----------------------- engines/lab/processroom.cpp | 10 ++++---- engines/lab/resource.cpp | 6 ++--- engines/lab/special.cpp | 24 +++++++++--------- 11 files changed, 96 insertions(+), 91 deletions(-) (limited to 'engines') diff --git a/engines/lab/anim.cpp b/engines/lab/anim.cpp index 49dbe285a6..d59a5711a8 100644 --- a/engines/lab/anim.cpp +++ b/engines/lab/anim.cpp @@ -130,7 +130,7 @@ void Anim::diffNextFrame(bool onlyDiffData) { return; } - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); _header = _diffFile->readUint32LE(); _size = _diffFile->readUint32LE(); @@ -191,7 +191,7 @@ void Anim::diffNextFrame(bool onlyDiffData) { case 31: if (_waitForEffect) { while (_vm->_music->isSoundEffectActive()) { - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); _vm->waitTOF(); } } @@ -211,7 +211,7 @@ void Anim::diffNextFrame(bool onlyDiffData) { if (_waitForEffect) { while (_vm->_music->isSoundEffectActive()) { - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); _vm->waitTOF(); if (_vm->_graphics->_dispBitMap->_drawOnScreen) @@ -251,7 +251,7 @@ void Anim::stopDiffEnd() { _stopPlayingEnd = true; while (_isPlaying) { - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); diffNextFrame(); } } diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp index 59d725bbe4..307a7f78ae 100644 --- a/engines/lab/dispman.cpp +++ b/engines/lab/dispman.cpp @@ -91,7 +91,7 @@ void DisplayMan::loadBackPict(const Common::String fileName, uint16 *highPal) { void DisplayMan::readPict(const Common::String filename, bool playOnce, bool onlyDiffData, byte *memoryBuffer, uint16 maxHeight) { _vm->_anim->stopDiff(); loadPict(filename); - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); if (!_vm->_music->_loopSoundEffect) _vm->_music->stopSoundEffect(); @@ -647,16 +647,16 @@ void DisplayMan::doScrollBlack() { img._width = width; img._height = height; img._imageData = mem; - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); img.readScreenImage(0, 0); - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); byte *baseAddr = getCurrentDrawingBuffer(); uint16 by = _vm->_utils->vgaScaleX(4); uint16 nheight = height; while (nheight) { - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); if (!_vm->_isHiRes) _vm->waitTOF(); @@ -734,7 +734,7 @@ void DisplayMan::doScrollWipe(const Common::String filename) { uint16 height = _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2); while (_vm->_music->isSoundEffectActive()) { - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); _vm->waitTOF(); } @@ -742,13 +742,13 @@ void DisplayMan::doScrollWipe(const Common::String filename) { setPalette(_vm->_anim->_diffPalette, 256); byte *mem = _vm->_anim->_rawDiffBM._planes[0]; - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); uint16 by = _vm->_utils->vgaScaleX(3); uint16 nheight = height; uint16 startLine = 0, onRow = 0; while (onRow < _vm->_anim->_headerdata._height) { - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); if ((by > nheight) && nheight) by = nheight; @@ -798,11 +798,11 @@ void DisplayMan::doScrollBounce() { int height = _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2); byte *mem = _vm->_anim->_rawDiffBM._planes[0]; - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); int startLine = _vm->_anim->_headerdata._height - height - 1; for (int i = 0; i < 5; i++) { - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); startLine -= newby[i]; copyPage(width, height, 0, startLine, mem); @@ -811,7 +811,7 @@ void DisplayMan::doScrollBounce() { } for (int i = 8; i > 0; i--) { - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); startLine += newby1[i - 1]; copyPage(width, height, 0, startLine, mem); @@ -841,7 +841,7 @@ void DisplayMan::doTransWipe(CloseDataPtr *closePtrList, const Common::String fi while (curY < lastY) { if (linesDone >= linesLast) { - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); _vm->waitTOF(); linesDone = 0; } @@ -886,7 +886,7 @@ void DisplayMan::doTransWipe(CloseDataPtr *closePtrList, const Common::String fi while (curY < lastY) { if (linesDone >= linesLast) { - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); _vm->waitTOF(); linesDone = 0; } @@ -1045,7 +1045,7 @@ void DisplayMan::fade(bool fadeIn, uint16 res) { setAmigaPal(newPal, 16); _vm->waitTOF(); - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); } } diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp index f16cdabe19..b4c20b58da 100644 --- a/engines/lab/engine.cpp +++ b/engines/lab/engine.cpp @@ -493,7 +493,7 @@ void LabEngine::mainGameLoop() { } // Make sure we check the music at least after every message - _music->updateMusic(); + updateMusicAndEvents(); interfaceOn(); IntuiMessage *curMsg = _event->getMsg(); if (g_engine->shouldQuit()) { @@ -505,7 +505,7 @@ void LabEngine::mainGameLoop() { // Does music load and next animation frame when you've run out of messages gotMessage = false; _music->checkRoomMusic(); - _music->updateMusic(); + updateMusicAndEvents(); _anim->diffNextFrame(); if (_followingCrumbs) { @@ -551,7 +551,7 @@ void LabEngine::showLab2Teaser() { _graphics->readPict("P:End/L2In.1"); for (uint16 i = 0; i < 120; i++) { - _music->updateMusic(); + updateMusicAndEvents(); waitTOF(); } @@ -559,7 +559,7 @@ void LabEngine::showLab2Teaser() { _graphics->readPict("P:End/Lost"); while (!_event->getMsg() && !shouldQuit()) { - _music->updateMusic(); + updateMusicAndEvents(); _anim->diffNextFrame(); waitTOF(); } @@ -728,7 +728,7 @@ bool LabEngine::processKey(IntuiMessage *curMsg, uint32 &msgClass, uint16 &quali while (1) { // Make sure we check the music at least after every message - _music->updateMusic(); + updateMusicAndEvents(); curMsg = _event->getMsg(); if (g_engine->shouldQuit()) @@ -736,7 +736,7 @@ bool LabEngine::processKey(IntuiMessage *curMsg, uint32 &msgClass, uint16 &quali if (!curMsg) { // Does music load and next animation frame when you've run out of messages - _music->updateMusic(); + updateMusicAndEvents(); _anim->diffNextFrame(); } else if (curMsg->_msgClass == kMessageRawKey) { if ((curMsg->_code == Common::KEYCODE_y) || (curMsg->_code == Common::KEYCODE_q)) { diff --git a/engines/lab/intro.cpp b/engines/lab/intro.cpp index 6b28db9b34..a60bd241a1 100644 --- a/engines/lab/intro.cpp +++ b/engines/lab/intro.cpp @@ -67,7 +67,7 @@ void Intro::doPictText(const Common::String filename, TextFont *msgFont, bool is Common::String path = Common::String("Lab:rooms/Intro/") + filename; uint timeDelay = (isScreen) ? 35 : 7; - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); if (_quitIntro) return; @@ -124,7 +124,7 @@ void Intro::doPictText(const Common::String filename, TextFont *msgFont, bool is } if (!msg) { - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); _vm->_anim->diffNextFrame(); uint32 elapsedSeconds = (g_system->getMillis() - lastMillis) / 1000; @@ -190,13 +190,13 @@ void Intro::doPictText(const Common::String filename, TextFont *msgFont, bool is } void Intro::musicDelay() { - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); if (_quitIntro) return; for (uint16 i = 0; i < 20; i++) { - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); _vm->waitTOF(); _vm->waitTOF(); _vm->waitTOF(); @@ -206,7 +206,7 @@ void Intro::musicDelay() { void Intro::nReadPict(const Common::String filename, bool playOnce) { Common::String finalFileName = Common::String("P:Intro/") + filename; - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); introEatMessages(); if (_quitIntro) @@ -268,14 +268,14 @@ void Intro::introSequence() { (_vm->_anim->_diffPalette[i * 3 + 2] >> 2); } - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); _vm->_graphics->fade(true, 0); for (int times = 0; times < 150; times++) { if (_quitIntro) break; - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); uint16 temp = palette[2]; for (uint16 i = 2; i < 15; i++) @@ -289,7 +289,7 @@ void Intro::introSequence() { _vm->_graphics->fade(false, 0); _vm->_graphics->blackAllScreen(); - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); nReadPict("Title.A"); nReadPict("AB"); @@ -311,9 +311,9 @@ void Intro::introSequence() { nReadPict("DA"); musicDelay(); - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); _vm->_graphics->blackAllScreen(); - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); TextFont *msgFont = _vm->_resource->getFont("F:Map.fon"); @@ -334,7 +334,7 @@ void Intro::introSequence() { } _vm->_graphics->blackAllScreen(); - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); _introDoBlack = true; nReadPict("Station1"); @@ -369,7 +369,7 @@ void Intro::introSequence() { for (uint16 idx = (8 * 3); idx < (255 * 3); idx++) _vm->_anim->_diffPalette[idx] = 255 - _vm->_anim->_diffPalette[idx]; - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); _vm->waitTOF(); _vm->_graphics->setPalette(_vm->_anim->_diffPalette, 256); _vm->waitTOF(); diff --git a/engines/lab/lab.cpp b/engines/lab/lab.cpp index ecc9a42650..52a96eb6e5 100644 --- a/engines/lab/lab.cpp +++ b/engines/lab/lab.cpp @@ -239,4 +239,10 @@ void LabEngine::waitTOF() { _lastWaitTOFTicks = now; } +void LabEngine::updateMusicAndEvents() { + _event->processInput(); + _event->updateMouse(); + _music->updateMusic(); +} + } // End of namespace Lab diff --git a/engines/lab/lab.h b/engines/lab/lab.h index ce8bae464b..fa7f850202 100644 --- a/engines/lab/lab.h +++ b/engines/lab/lab.h @@ -196,6 +196,7 @@ public: uint16 getQuarters(); void setDirection(uint16 direction) { _direction = direction; }; void setQuarters(uint16 quarters); + void updateMusicAndEvents(); void waitTOF(); private: diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp index db0ba206fe..b9f5703131 100644 --- a/engines/lab/map.cpp +++ b/engines/lab/map.cpp @@ -82,7 +82,7 @@ void LabEngine::loadMapData() { delete mapImages; Common::File *mapFile = _resource->openDataFile("Lab:Maps", MKTAG('M', 'A', 'P', '0')); - _music->updateMusic(); + updateMusicAndEvents(); if (!_music->_loopSoundEffect) _music->stopSoundEffect(); @@ -344,7 +344,7 @@ void LabEngine::drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fad for (uint16 i = 1; i <= _maxRooms; i++) { if ((_maps[i]._pageNumber == floorNum) && _roomsFound->in(i) && _maps[i]._x) { drawRoomMap(i, (bool)(i == curRoom)); - _music->updateMusic(); + updateMusicAndEvents(); } } @@ -397,7 +397,7 @@ void LabEngine::processMap(uint16 curRoom) { while (1) { // Make sure we check the music at least after every message - _music->updateMusic(); + updateMusicAndEvents(); IntuiMessage *msg = _event->getMsg(); if (g_engine->shouldQuit()) { _quitLab = true; @@ -405,7 +405,7 @@ void LabEngine::processMap(uint16 curRoom) { } if (!msg) { - _music->updateMusic(); + updateMusicAndEvents(); byte newcolor[3]; @@ -554,7 +554,7 @@ void LabEngine::doMap(uint16 curRoom) { _graphics->_fadePalette = amigaMapPalette; - _music->updateMusic(); + updateMusicAndEvents(); loadMapData(); _graphics->blackAllScreen(); _event->attachButtonList(&_mapButtonList); diff --git a/engines/lab/music.cpp b/engines/lab/music.cpp index 78887f1780..a8dd281eb6 100644 --- a/engines/lab/music.cpp +++ b/engines/lab/music.cpp @@ -64,34 +64,32 @@ Music::Music(LabEngine *vm) : _vm(vm) { } void Music::updateMusic() { - _vm->_event->processInput(); - _vm->_event->updateMouse(); + if (!_musicOn || (getPlayingBufferCount() >= MAXBUFFERS)) + return; - if (_musicOn && (getPlayingBufferCount() < MAXBUFFERS)) { - // NOTE: We need to use malloc(), cause this will be freed with free() - // by the music code - byte *musicBuffer = (byte *)malloc(MUSICBUFSIZE); - fillbuffer(musicBuffer); + // NOTE: We need to use malloc(), cause this will be freed with free() + // by the music code + byte *musicBuffer = (byte *)malloc(MUSICBUFSIZE); + fillbuffer(musicBuffer); - // Queue a music block, and start the music, if needed - bool startMusicFlag = false; + // Queue a music block, and start the music, if needed + bool startMusicFlag = false; - if (!_queuingAudioStream) { - _queuingAudioStream = Audio::makeQueuingAudioStream(SAMPLESPEED, false); - startMusicFlag = true; - } + if (!_queuingAudioStream) { + _queuingAudioStream = Audio::makeQueuingAudioStream(SAMPLESPEED, false); + startMusicFlag = true; + } - byte soundFlags = Audio::FLAG_LITTLE_ENDIAN; - if (_vm->getPlatform() == Common::kPlatformWindows) - soundFlags |= Audio::FLAG_16BITS; - else if (_vm->getPlatform() == Common::kPlatformDOS) - soundFlags |= Audio::FLAG_UNSIGNED; + byte soundFlags = Audio::FLAG_LITTLE_ENDIAN; + if (_vm->getPlatform() == Common::kPlatformWindows) + soundFlags |= Audio::FLAG_16BITS; + else if (_vm->getPlatform() == Common::kPlatformDOS) + soundFlags |= Audio::FLAG_UNSIGNED; - _queuingAudioStream->queueBuffer(musicBuffer, MUSICBUFSIZE, DisposeAfterUse::YES, soundFlags); + _queuingAudioStream->queueBuffer(musicBuffer, MUSICBUFSIZE, DisposeAfterUse::YES, soundFlags); - if (startMusicFlag) - _vm->_mixer->playStream(Audio::Mixer::kMusicSoundType, &_musicHandle, _queuingAudioStream); - } + if (startMusicFlag) + _vm->_mixer->playStream(Audio::Mixer::kMusicSoundType, &_musicHandle, _queuingAudioStream); } uint16 Music::getPlayingBufferCount() { @@ -157,7 +155,7 @@ void Music::startMusic(bool restartFl) { } _musicOn = true; - updateMusic(); + _vm->updateMusicAndEvents(); } bool Music::initMusic(const Common::String filename) { @@ -181,7 +179,7 @@ void Music::freeMusic() { void Music::pauseBackMusic() { if (!_musicPaused && _musicOn) { - updateMusic(); + _vm->updateMusicAndEvents(); _musicOn = false; stopSoundEffect(); @@ -198,7 +196,7 @@ void Music::resumeBackMusic() { _vm->_mixer->pauseHandle(_musicHandle, false); - updateMusic(); + _vm->updateMusicAndEvents(); _musicPaused = false; } } @@ -211,7 +209,7 @@ void Music::setMusic(bool on) { startMusic(true); } else if (!on && _musicOn) { _musicOn = false; - updateMusic(); + _vm->updateMusicAndEvents(); } else _musicOn = on; } @@ -264,7 +262,7 @@ void Music::resetMusic() { _musicOn = true; setMusic(false); - updateMusic(); + _vm->updateMusicAndEvents(); if (!_oldMusicOn) { _tFile = 0; @@ -279,7 +277,7 @@ void Music::resetMusic() { bool Music::readMusic(const Common::String filename, bool waitTillFinished) { Common::File *file = _vm->_resource->openDataFile(filename, MKTAG('D', 'I', 'F', 'F')); - updateMusic(); + _vm->updateMusicAndEvents(); if (!_loopSoundEffect) stopSoundEffect(); @@ -307,14 +305,14 @@ void Music::readSound(bool waitTillFinished, Common::File *file) { return; while (soundTag != 65535) { - updateMusic(); + _vm->updateMusicAndEvents(); soundTag = file->readUint32LE(); soundSize = file->readUint32LE() - 8; if ((soundTag == 30) || (soundTag == 31)) { if (waitTillFinished) { while (isSoundEffectActive()) { - updateMusic(); + _vm->updateMusicAndEvents(); _vm->waitTOF(); } } @@ -327,7 +325,7 @@ void Music::readSound(bool waitTillFinished, Common::File *file) { } else if (soundTag == 65535L) { if (waitTillFinished) { while (isSoundEffectActive()) { - updateMusic(); + _vm->updateMusicAndEvents(); _vm->waitTOF(); } } diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp index 76592875c9..0d09c37e84 100644 --- a/engines/lab/processroom.cpp +++ b/engines/lab/processroom.cpp @@ -235,7 +235,7 @@ bool LabEngine::takeItem(Common::Point pos, CloseDataPtr *closePtrList) { void LabEngine::doActions(Action *actionList, CloseDataPtr *closePtrList) { while (actionList) { - _music->updateMusic(); + updateMusicAndEvents(); switch (actionList->_actionType) { case PLAYSOUND: @@ -387,7 +387,7 @@ void LabEngine::doActions(Action *actionList, CloseDataPtr *closePtrList) { _graphics->screenUpdate(); while (g_system->getMillis() < targetMillis) { - _music->updateMusic(); + updateMusicAndEvents(); _anim->diffNextFrame(); } } @@ -412,12 +412,12 @@ void LabEngine::doActions(Action *actionList, CloseDataPtr *closePtrList) { break; case FILLMUSIC: - _music->updateMusic(); + updateMusicAndEvents(); break; case WAITSOUND: while (_music->isSoundEffectActive()) { - _music->updateMusic(); + updateMusicAndEvents(); _anim->diffNextFrame(); waitTOF(); } @@ -497,7 +497,7 @@ void LabEngine::doActions(Action *actionList, CloseDataPtr *closePtrList) { _music->stopSoundEffect(); } else { while (_music->isSoundEffectActive()) { - _music->updateMusic(); + updateMusicAndEvents(); _anim->diffNextFrame(); waitTOF(); } diff --git a/engines/lab/resource.cpp b/engines/lab/resource.cpp index 311f04659c..1063fd5f1b 100644 --- a/engines/lab/resource.cpp +++ b/engines/lab/resource.cpp @@ -59,7 +59,7 @@ TextFont *Resource::getFont(const Common::String fileName) { if (fileSize <= headerSize) return nullptr; - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); TextFont *textfont = new TextFont(); textfont->_dataLength = fileSize - headerSize; @@ -76,7 +76,7 @@ TextFont *Resource::getFont(const Common::String fileName) { Common::String Resource::getText(const Common::String fileName) { Common::File *dataFile = openDataFile(fileName); - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); uint32 count = dataFile->size(); byte *buffer = new byte[count]; @@ -151,7 +151,7 @@ void Resource::readViews(uint16 roomNum) { curRoom->_view[WEST] = readView(dataFile); curRoom->_rules = readRule(dataFile); - _vm->_music->updateMusic(); + _vm->updateMusicAndEvents(); delete dataFile; } diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp index 9a21ee786a..7615c2d073 100644 --- a/engines/lab/special.cpp +++ b/engines/lab/special.cpp @@ -99,7 +99,7 @@ void LabEngine::loadJournalData() { _graphics->closeFont(&_journalFont); _journalFont = _resource->getFont("F:Journal.fon"); - _music->updateMusic(); + updateMusicAndEvents(); Common::String filename = "Lab:Rooms/j0"; @@ -154,7 +154,7 @@ void LabEngine::drawJournalText() { const char *curText = _journalText.c_str(); while (drawingToPage < _journalPage) { - _music->updateMusic(); + updateMusicAndEvents(); curText = _journalText.c_str() + charsDrawn; charsDrawn += _graphics->flowText(_journalFont, -2, 2, 0, false, false, false, false, _utils->vgaRectScale(52, 32, 152, 148), curText); @@ -174,7 +174,7 @@ void LabEngine::drawJournalText() { charsDrawn += _graphics->flowTextToMem(_journalBackImage, _journalFont, -2, 2, 0, false, false, false, true, _utils->vgaRectScale(52, 32, 152, 148), curText); } - _music->updateMusic(); + updateMusicAndEvents(); curText = _journalText.c_str() + charsDrawn; _lastPage = (*curText == 0); _graphics->flowTextToMem(_journalBackImage, _journalFont, -2, 2, 0, false, false, false, true, _utils->vgaRectScale(171, 32, 271, 148), curText); @@ -183,14 +183,14 @@ void LabEngine::drawJournalText() { void LabEngine::turnPage(bool fromLeft) { if (fromLeft) { for (int i = 0; i < _graphics->_screenWidth; i += 8) { - _music->updateMusic(); + updateMusicAndEvents(); waitTOF(); _screenImage->_imageData = _graphics->getCurrentDrawingBuffer(); _journalBackImage->blitBitmap(i, 0, _screenImage, i, 0, 8, _graphics->_screenHeight, false); } } else { for (int i = (_graphics->_screenWidth - 8); i > 0; i -= 8) { - _music->updateMusic(); + updateMusicAndEvents(); waitTOF(); _screenImage->_imageData = _graphics->getCurrentDrawingBuffer(); _journalBackImage->blitBitmap(i, 0, _screenImage, i, 0, 8, _graphics->_screenHeight, false); @@ -200,7 +200,7 @@ void LabEngine::turnPage(bool fromLeft) { void LabEngine::drawJournal(uint16 wipenum, bool needFade) { _event->mouseHide(); - _music->updateMusic(); + updateMusicAndEvents(); drawJournalText(); _graphics->loadBackPict("P:Journal.pic", _highPalette); @@ -225,7 +225,7 @@ void LabEngine::drawJournal(uint16 wipenum, bool needFade) { void LabEngine::processJournal() { while (1) { // Make sure we check the music at least after every message - _music->updateMusic(); + updateMusicAndEvents(); IntuiMessage *msg = _event->getMsg(); if (g_engine->shouldQuit()) { _quitLab = true; @@ -233,7 +233,7 @@ void LabEngine::processJournal() { } if (!msg) - _music->updateMusic(); + updateMusicAndEvents(); else { uint32 msgClass = msg->_msgClass; uint16 buttonId = msg->_code; @@ -269,7 +269,7 @@ void LabEngine::doJournal() { _journalBackImage->_imageData = nullptr; _screenImage->_imageData = _graphics->getCurrentDrawingBuffer(); - _music->updateMusic(); + updateMusicAndEvents(); loadJournalData(); _event->attachButtonList(&_journalButtonList); drawJournal(0, true); @@ -330,7 +330,7 @@ void LabEngine::drawMonText(char *text, TextFont *monitorFont, Common::Rect text } while (drawingToPage < _monitorPage) { - _music->updateMusic(); + updateMusicAndEvents(); curText = text + charsDrawn; charsDrawn += _graphics->flowText(monitorFont, yspacing, 0, 0, false, false, false, false, textRect, curText); _lastPage = (*curText == 0); @@ -377,7 +377,7 @@ void LabEngine::processMonitor(char *ntext, TextFont *monitorFont, bool isIntera } // Make sure we check the music at least after every message - _music->updateMusic(); + updateMusicAndEvents(); IntuiMessage *msg = _event->getMsg(); if (g_engine->shouldQuit()) { _quitLab = true; @@ -385,7 +385,7 @@ void LabEngine::processMonitor(char *ntext, TextFont *monitorFont, bool isIntera } if (!msg) { - _music->updateMusic(); + updateMusicAndEvents(); } else { uint32 msgClass = msg->_msgClass; uint16 mouseX = msg->_mouse.x; -- cgit v1.2.3