[Scummvm-cvs-logs] scummvm master -> 531029f54aa5381a72d5f08a2e31721932dcfaa0
eriktorbjorn
eriktorbjorn at telia.com
Thu Feb 5 00:07:17 CET 2015
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
531029f54a HUGO: Avoid drawing text above screen (bug #6799)
Commit: 531029f54aa5381a72d5f08a2e31721932dcfaa0
https://github.com/scummvm/scummvm/commit/531029f54aa5381a72d5f08a2e31721932dcfaa0
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2015-02-05T00:04:04+01:00
Commit Message:
HUGO: Avoid drawing text above screen (bug #6799)
When drawing cursor text, don't draw it above the top of the screen,
since this would lead to memory corruption and crashes. I'm not quite
sure this is all of bug #6799 since it also mentioned that "sometimes
simply using a hotspot will be enough", but it's a start.
Changed paths:
engines/hugo/mouse.cpp
diff --git a/engines/hugo/mouse.cpp b/engines/hugo/mouse.cpp
index 558a596..3674c90 100644
--- a/engines/hugo/mouse.cpp
+++ b/engines/hugo/mouse.cpp
@@ -121,12 +121,24 @@ void MouseHandler::cursorText(const char *buffer, const int16 cx, const int16 cy
int16 sx, sy;
if (cx < kXPix / 2) {
sx = cx + kCursorNameOffX;
- sy = (_vm->_inventory->getInventoryObjId() == -1) ? cy + kCursorNameOffY : cy + kCursorNameOffY - (_vm->_screen->fontHeight() + 1);
+ if (_vm->_inventory->getInventoryObjId() == -1) {
+ sy = cy + kCursorNameOffY;
+ } else {
+ sy = cy + kCursorNameOffY - (_vm->_screen->fontHeight() + 1);
+ if (sy < 0) {
+ sx = cx + kCursorNameOffX + 25;
+ sy = cy + kCursorNameOffY;
+ }
+ }
} else {
sx = cx - sdx - kCursorNameOffX / 2;
sy = cy + kCursorNameOffY;
}
+ if (sy < 0) {
+ sy = 0;
+ }
+
// Display the string and add rect to display list
_vm->_screen->shadowStr(sx, sy, buffer, _TBRIGHTWHITE);
_vm->_screen->displayList(kDisplayAdd, sx, sy, sdx, sdy);
More information about the Scummvm-git-logs
mailing list