[Scummvm-devel] [Scummvm-cvs-logs] SF.net SVN: scummvm:[43059] scummvm/branches/gsoc2009-draci/engines/draci/ game.cpp
Robert Špalek
rspalek at gmail.com
Wed Aug 5 03:36:06 CEST 2009
hi Denis,
On Tue, Aug 4, 2009 at 5:11 PM, <dkasak13 at users.sourceforge.net> wrote:
> Modified: scummvm/branches/gsoc2009-draci/engines/draci/game.cpp
> ===================================================================
> --- scummvm/branches/gsoc2009-draci/engines/draci/game.cpp 2009-08-05
> 00:05:36 UTC (rev 43058)
> +++ scummvm/branches/gsoc2009-draci/engines/draci/game.cpp 2009-08-05
> 00:11:09 UTC (rev 43059)
> if (curObject != kNotFound) {
> -
> titleAnim->markDirtyRect(_vm->_screen->getSurface());
> - reinterpret_cast<Text
> *>(titleAnim->getFrame())->setText(obj->_title);
> + // Mark dirty rectangle to update the text
> + titleAnim->markDirtyRect(surface);
>
> + // 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);
should you not call markDirtyRect() twice, once before changing the position
and once after? two places need to be redrawn if the mouse quickly moves
from one object to another one: deletion of the previous text and addition
of the new one.
--
Robert Špalek <rspalek at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scummvm.org/pipermail/scummvm-devel/attachments/20090804/1576d93b/attachment.html>
More information about the Scummvm-devel
mailing list