mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-23 02:44:56 +00:00
DREAMWEB: added setSpeed, CTRL-F shortcut and removed erik's comment because it's good idea :)
This commit is contained in:
parent
92a11ea59d
commit
308fcf0953
@ -66,6 +66,7 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam
|
||||
DebugMan.addDebugChannel(kDebugSaveLoad, "SaveLoad", "Track Save/Load Function");
|
||||
_outSaveFile = 0;
|
||||
_inSaveFile = 0;
|
||||
_speed = 1;
|
||||
}
|
||||
|
||||
DreamWebEngine::~DreamWebEngine() {
|
||||
@ -73,10 +74,6 @@ DreamWebEngine::~DreamWebEngine() {
|
||||
delete _console;
|
||||
}
|
||||
|
||||
// Let's see if it's a good idea to emulate VSYNC interrupts with a timer like
|
||||
// this. There's a chance we'll miss interrupts, which could be countered by
|
||||
// counting them instead of just flagging them, but we'll see...
|
||||
|
||||
static void vSyncInterrupt(void *refCon) {
|
||||
DreamWebEngine *vm = (DreamWebEngine *)refCon;
|
||||
|
||||
@ -126,6 +123,15 @@ void DreamWebEngine::processEvents() {
|
||||
keyHandled = true;
|
||||
}
|
||||
break;
|
||||
case Common::KEYCODE_f:
|
||||
if (event.kbd.flags & Common::KBD_CTRL) {
|
||||
if (_speed != 10)
|
||||
setSpeed(10);
|
||||
else
|
||||
setSpeed(1);
|
||||
keyHandled = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -166,6 +172,13 @@ Common::Error DreamWebEngine::run() {
|
||||
return Common::kNoError;
|
||||
}
|
||||
|
||||
void DreamWebEngine::setSpeed(uint speed) {
|
||||
debug(0, "setting speed %u", speed);
|
||||
_speed = speed;
|
||||
getTimerManager()->removeTimerProc(vSyncInterrupt);
|
||||
getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 70 / speed, this);
|
||||
}
|
||||
|
||||
void DreamWebEngine::openFile(const Common::String &name) {
|
||||
processEvents();
|
||||
closeFile();
|
||||
|
@ -104,6 +104,8 @@ private:
|
||||
|
||||
void keyPressed(uint16 ascii);
|
||||
|
||||
void setSpeed(uint speed);
|
||||
|
||||
const DreamWebGameDescription *_gameDescription;
|
||||
Common::RandomSource _rnd;
|
||||
|
||||
@ -111,6 +113,8 @@ private:
|
||||
Common::OutSaveFile *_outSaveFile;
|
||||
Common::InSaveFile *_inSaveFile;
|
||||
|
||||
uint _speed;
|
||||
|
||||
dreamgen::Context _context;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user