[Scummvm-cvs-logs] CVS: scummvm/scumm/smush smush_player.cpp,1.4,1.5 smush_player.h,1.1,1.2
Pawel Kolodziejski
aquadran at users.sourceforge.net
Mon Mar 17 07:27:39 CET 2003
Update of /cvsroot/scummvm/scummvm/scumm/smush
In directory sc8-pr-cvs1:/tmp/cvs-serv31023
Modified Files:
smush_player.cpp smush_player.h
Log Message:
moved backend update_screen() (slooolest thing) from smush updateScreen() into main loop
switching scalers also works now
Index: smush_player.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/smush_player.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- smush_player.cpp 17 Mar 2003 13:35:34 -0000 1.4
+++ smush_player.cpp 17 Mar 2003 15:22:31 -0000 1.5
@@ -731,7 +731,7 @@
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 @@
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 @@
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)
Index: smush_player.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/smush_player.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- smush_player.h 17 Mar 2003 12:28:50 -0000 1.1
+++ smush_player.h 17 Mar 2003 15:22:36 -0000 1.2
@@ -68,6 +68,9 @@
int _width, _height;
byte *_data;
bool _smushProcessFrame;
+ bool _whileUpdate;
+ bool _whileCopyRect;
+ bool _updateNeeded;
SmushPlayer(Scumm *, int, bool);
~SmushPlayer();
More information about the Scummvm-git-logs
mailing list