From 93cf9993eaeb26f2dcb8f60a7c74559007f7a014 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 13:30:02 +0400 Subject: [PATCH] DREAMWEB: report click only once, this fixes phantom clicks after loading or between screens. --- engines/dreamweb/dreamweb.cpp | 6 +++++- engines/dreamweb/dreamweb.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 6b9fda88823..3d74570da22 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -67,6 +67,7 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam _outSaveFile = 0; _inSaveFile = 0; _speed = 1; + _oldMouseState = 0; } DreamWebEngine::~DreamWebEngine() { @@ -270,7 +271,10 @@ void DreamWebEngine::mouseCall() { pos.y = 184; _context.cx = pos.x; _context.dx = pos.y; - _context.bx = eventMan->getButtonState(); + + unsigned state = eventMan->getButtonState(); + _context.bx = state == _oldMouseState? 0: state; + _oldMouseState = state; } void DreamWebEngine::setGraphicsMode() { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 50d2779327d..f61c113e303 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -114,6 +114,7 @@ private: Common::InSaveFile *_inSaveFile; uint _speed; + uint _oldMouseState; dreamgen::Context _context; };