diff options
Diffstat (limited to 'engines/sherlock/events.cpp')
-rw-r--r-- | engines/sherlock/events.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/engines/sherlock/events.cpp b/engines/sherlock/events.cpp index c6a223b6d9..6cfee5d822 100644 --- a/engines/sherlock/events.cpp +++ b/engines/sherlock/events.cpp @@ -143,7 +143,7 @@ void Events::setCursor(CursorId cursorId, const Common::Point &cursorPos, const // Form a single surface containing both frames Surface s(r.width(), r.height()); - s.fill(TRANSPARENCY); + s.clear(TRANSPARENCY); // Draw the passed image Common::Point drawPos; @@ -151,11 +151,11 @@ void Events::setCursor(CursorId cursorId, const Common::Point &cursorPos, const drawPos.x = -cursorPt.x; if (cursorPt.y < 0) drawPos.y = -cursorPt.y; - s.blitFrom(surface, Common::Point(drawPos.x, drawPos.y)); + s.SHblitFrom(surface, Common::Point(drawPos.x, drawPos.y)); // Draw the cursor image drawPos = Common::Point(MAX(cursorPt.x, (int16)0), MAX(cursorPt.y, (int16)0)); - s.transBlitFrom(cursorImg, Common::Point(drawPos.x, drawPos.y)); + s.SHtransBlitFrom(cursorImg, Common::Point(drawPos.x, drawPos.y)); // Set up hotspot position for cursor, adjusting for cursor image's position within the surface Common::Point hotspot; @@ -163,7 +163,7 @@ void Events::setCursor(CursorId cursorId, const Common::Point &cursorPos, const hotspot = Common::Point(8, 8); hotspot += drawPos; // Set the cursor - setCursor(s.getRawSurface(), hotspot.x, hotspot.y); + setCursor(s, hotspot.x, hotspot.y); } void Events::animateCursorIfNeeded() { @@ -263,6 +263,10 @@ void Events::setFrameRate(int newRate) { _frameRate = newRate; } +void Events::toggleSpeed() { + _frameRate = (_frameRate == GAME_FRAME_RATE) ? GAME_FRAME_RATE * 2 : GAME_FRAME_RATE; +} + bool Events::checkForNextFrameCounter() { // Check for next game frame uint32 milli = g_system->getMillis(); @@ -346,7 +350,8 @@ bool Events::delay(uint32 time, bool interruptable) { g_system->delayMillis(time); bool result = !(interruptable && (kbHit() || _pressed || _vm->shouldQuit())); - clearEvents(); + if (interruptable) + clearEvents(); return result; } else { // For long periods go into a loop where we delay by 10ms at a time and then |