[Scummvm-cvs-logs] SF.net SVN: scummvm:[43083] scummvm/branches/gsoc2009-draci/engines/draci/ game.cpp
dkasak13 at users.sourceforge.net
dkasak13 at users.sourceforge.net
Thu Aug 6 06:50:37 CEST 2009
Revision: 43083
http://scummvm.svn.sourceforge.net/scummvm/?rev=43083&view=rev
Author: dkasak13
Date: 2009-08-06 04:50:37 +0000 (Thu, 06 Aug 2009)
Log Message:
-----------
Turn off mouse cursor and disable titles when running look / use scripts.
Modified Paths:
--------------
scummvm/branches/gsoc2009-draci/engines/draci/game.cpp
Modified: scummvm/branches/gsoc2009-draci/engines/draci/game.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/game.cpp 2009-08-06 04:48:43 UTC (rev 43082)
+++ scummvm/branches/gsoc2009-draci/engines/draci/game.cpp 2009-08-06 04:50:37 UTC (rev 43083)
@@ -266,27 +266,40 @@
// 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 {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list