Skip to content

Commit

Permalink
SCI32: Improve mouse responsiveness
Browse files Browse the repository at this point in the history
This is most noticeable at the beginning of the game during
benchmarking, where the benchmarking loop used to cause the mouse
to get stuck for the duration of the benchmark.
  • Loading branch information
csnover committed Jan 11, 2017
1 parent 7b90f06 commit 7156a82
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions engines/sci/graphics/frameout.cpp
Expand Up @@ -35,6 +35,7 @@

#include "sci/sci.h"
#include "sci/console.h"
#include "sci/event.h"
#include "sci/engine/features.h"
#include "sci/engine/kernel.h"
#include "sci/engine/state.h"
Expand Down Expand Up @@ -507,6 +508,14 @@ void GfxFrameout::kernelAddPicAt(const reg_t planeObject, const GuiResourceId pi
#pragma mark Rendering

void GfxFrameout::frameOut(const bool shouldShowBits, const Common::Rect &eraseRect) {
// In SSCI, mouse events were received via hardware interrupt, so the mouse
// cursor would always get updated whenever the user moved the mouse. Since
// we must poll for mouse events instead, poll here so that the mouse gets
// updated with its current position at render time. If we do not do this,
// the mouse gets "stuck" during loops that do not make calls to kGetEvent,
// like transitions and the benchmarking loop at the start of every game.
g_sci->getEventManager()->getSciEvent(SCI_EVENT_PEEK);

RobotDecoder &robotPlayer = g_sci->_video32->getRobotPlayer();
const bool robotIsActive = robotPlayer.getStatus() != RobotDecoder::kRobotStatusUninitialized;

Expand Down

0 comments on commit 7156a82

Please sign in to comment.