diff options
author | Paweł Kołodziejski | 2003-03-17 15:22:36 +0000 |
---|---|---|
committer | Paweł Kołodziejski | 2003-03-17 15:22:36 +0000 |
commit | d29c68603f95af24e443c91efa872047fede8ed7 (patch) | |
tree | 9a29932f3b7e348f1fdc7cabed722172f5e4dd7f /scumm | |
parent | 975843c758d2369308927f98af576bfa35d0726a (diff) | |
download | scummvm-rg350-d29c68603f95af24e443c91efa872047fede8ed7.tar.gz scummvm-rg350-d29c68603f95af24e443c91efa872047fede8ed7.tar.bz2 scummvm-rg350-d29c68603f95af24e443c91efa872047fede8ed7.zip |
moved backend update_screen() (slooolest thing) from smush updateScreen() into main loop
switching scalers also works now
svn-id: r6826
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/smush/smush_player.cpp | 40 | ||||
-rw-r--r-- | scumm/smush/smush_player.h | 3 |
2 files changed, 28 insertions, 15 deletions
diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp index c203fd82f2..84c219600d 100644 --- a/scumm/smush/smush_player.cpp +++ b/scumm/smush/smush_player.cpp @@ -731,7 +731,7 @@ void SmushPlayer::handleFrame(Chunk &b) { debug(6, "SmushPlayer::handleFrame(%d)", _frame); _skipNext = false; - uint32 start_time, curr_time, start_update, end_update; + uint32 start_time, end_time; start_time = _scumm->_system->get_msecs(); while(!b.eof()) { @@ -774,20 +774,12 @@ void SmushPlayer::handleFrame(Chunk &b) { delete sub; } - curr_time = _scumm->_system->get_msecs(); + end_time = _scumm->_system->get_msecs(); + updateScreen(); _smixer->handleFrame(); - start_update = _scumm->_system->get_msecs(); - if (curr_time < (start_time + _speed / 1000)) { - updateScreen(); - } else { - warning("SmushPlayer: skipping update frame %d", _frame); - } - end_update = _scumm->_system->get_msecs(); - debug(4, "Smush stats: FRME( %03d ),GFX_update( %03d ),FRME+GFX+SFX( %03d ),Limit(%d)", - curr_time - start_time, end_update - start_update, - end_update - start_time, _speed / 1000); + debug(5, "Smush stats: FRME( %03d ), Limit(%d)", end_time - start_time, _speed / 1000); _frame++; } @@ -876,18 +868,36 @@ void SmushPlayer::updateScreen() { int width = MIN(_width, _scumm->_realWidth); int height = MIN(_height, _scumm->_realHeight); -// _scumm->parseEvents(); - _scumm->_system->copy_rect(_data, _width, 0, 0, width, height); - _scumm->_system->update_screen(); + if (_whileUpdate == false) { + _whileCopyRect = true; + uint32 end_time, start_time = _scumm->_system->get_msecs(); + _scumm->_system->copy_rect(_data, _width, 0, 0, width, height); + end_time = _scumm->_system->get_msecs(); + debug(4, "Smush stats: updateScreen( %03d )", end_time - start_time); + _updateNeeded = true; + _whileCopyRect = false; + } } void SmushPlayer::play(const char *filename, const char *directory) { + _whileUpdate = false; + _whileCopyRect = false; + _updateNeeded = false; setupAnim(filename, directory); init(); while (true) { _scumm->processKbd(); _scumm->waitForTimer(1); + if ((_whileCopyRect == false) && (_updateNeeded == true)) { + _whileUpdate = true; + uint32 end_time, start_time = _scumm->_system->get_msecs(); + _scumm->_system->update_screen(); + end_time = _scumm->_system->get_msecs(); + debug(4, "Smush stats: BackendUpdateScreen( %03d )", end_time - start_time); + _whileUpdate = false; + _updateNeeded = false; + } if (_scumm->_videoFinished == true) break; if (_scumm->_saveLoadFlag) diff --git a/scumm/smush/smush_player.h b/scumm/smush/smush_player.h index 73aefb5664..38651b0eae 100644 --- a/scumm/smush/smush_player.h +++ b/scumm/smush/smush_player.h @@ -68,6 +68,9 @@ public: int _width, _height; byte *_data; bool _smushProcessFrame; + bool _whileUpdate; + bool _whileCopyRect; + bool _updateNeeded; SmushPlayer(Scumm *, int, bool); ~SmushPlayer(); |