aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Kasak2009-08-06 04:50:37 +0000
committerDenis Kasak2009-08-06 04:50:37 +0000
commit09e49a354fe40b500cf07e2ec97607b903aef70b (patch)
treec161f2d6e6b97c3d7bd3df508ff6b22e2ebc247b
parentc2dccaafcde526875999feb7802c13c482d6ce6d (diff)
downloadscummvm-rg350-09e49a354fe40b500cf07e2ec97607b903aef70b.tar.gz
scummvm-rg350-09e49a354fe40b500cf07e2ec97607b903aef70b.tar.bz2
scummvm-rg350-09e49a354fe40b500cf07e2ec97607b903aef70b.zip
Turn off mouse cursor and disable titles when running look / use scripts.
svn-id: r43083
-rw-r--r--engines/draci/game.cpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index 3e3162e543..cef91528a7 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -266,27 +266,40 @@ void Game::loop() {
// If there is an object under the cursor, display its title and enable
// executing its look and use scripts
if (curObject != kObjectNotFound) {
- // Mark dirty rectangle to update the text
- titleAnim->markDirtyRect(surface);
- // Set the title for the current object
- title->setText(obj->_title);
+ if(_vm->_mouse->isCursorOn()) {
+ // Mark dirty rectangle to delete the previous text
+ titleAnim->markDirtyRect(surface);
- // Move the title to the correct place (just above the cursor)
- int newX = surface->centerOnX(x, title->getWidth());
- int newY = surface->centerOnY(y - smallFontHeight / 2, title->getHeight() * 2);
- titleAnim->setRelative(newX, newY);
+ // Set the title for the current object
+ title->setText(obj->_title);
+
+ // Move the title to the correct place (just above the cursor)
+ int newX = surface->centerOnX(x, title->getWidth());
+ int newY = surface->centerOnY(y - smallFontHeight / 2, title->getHeight() * 2);
+ titleAnim->setRelative(newX, newY);
+ }
if (_loopSubstatus == kStatusOrdinary) {
// HACK: Test running look and use scripts
if (_vm->_mouse->lButtonPressed()) {
+ // Delete title text
+ title->setText("");
+
+ _vm->_mouse->cursorOff();
_vm->_mouse->lButtonSet(false);
_vm->_script->run(obj->_program, obj->_look);
+ _vm->_mouse->cursorOn();
}
if (_vm->_mouse->rButtonPressed()) {
+ // Delete title text
+ title->setText("");
+
+ _vm->_mouse->cursorOff();
_vm->_mouse->rButtonSet(false);
_vm->_script->run(obj->_program, obj->_use);
+ _vm->_mouse->cursorOn();
}
}
} else {