DIRECTOR: Track when mouse is down

This commit is contained in:
Eugene Sandulenko 2019-12-29 00:35:37 +01:00
parent cb497e3620
commit cd7da28a97
3 changed files with 6 additions and 0 deletions

View File

@ -74,6 +74,8 @@ void DirectorEngine::processEvents() {
spriteId = currentFrame->getSpriteIDFromPos(pos);
sc->_currentMouseDownSpriteId = spriteId;
sc->_mouseIsDown = true;
debugC(3, kDebugEvents, "event: Button Down @(%d, %d), sprite id: %d", pos.x, pos.y, spriteId);
_lingo->processEvent(kEventMouseDown);
@ -89,6 +91,8 @@ void DirectorEngine::processEvents() {
debugC(3, kDebugEvents, "event: Button Up @(%d, %d), sprite id: %d", pos.x, pos.y, spriteId);
sc->_mouseIsDown = false;
_lingo->processEvent(kEventMouseUp);
sc->_currentMouseDownSpriteId = 0;
break;

View File

@ -72,6 +72,7 @@ Score::Score(DirectorEngine *vm) {
_lingo = _vm->getLingo();
_soundManager = _vm->getSoundManager();
_currentMouseDownSpriteId = 0;
_mouseIsDown = false;
// FIXME: TODO: Check whether the original truely does it
if (_vm->getVersion() <= 3) {

View File

@ -137,6 +137,7 @@ public:
Archive *_movieArchive;
Common::Rect _movieRect;
uint16 _currentMouseDownSpriteId;
bool _mouseIsDown;
bool _stopPlay;
uint32 _nextFrameTime;