Reduced CPU usage of the MADE engine by about 10% (by profiling the code)

- Added delays in places where the screen gets updated
- Moved event polling inside sfPollEvent() (cause that's where events are polled), instead of after each opcode

svn-id: r39392
This commit is contained in:
Filippos Karapetis 2009-03-14 14:58:19 +00:00
parent 092f2a37e3
commit 498a355a74
3 changed files with 6 additions and 15 deletions

View file

@ -203,11 +203,12 @@ int16 ScriptFunctions::sfShowPage(int16 argc, int16 *argv) {
}
int16 ScriptFunctions::sfPollEvent(int16 argc, int16 *argv) {
_vm->_system->updateScreen();
_vm->handleEvents();
_vm->_screen->updateScreenAndWait(10);
int16 eventNum = _vm->_eventNum;
_vm->_eventNum = 0;
return eventNum;
}