aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2015-03-24 20:14:13 -0400
committerPaul Gilbert2015-03-24 20:14:13 -0400
commit97e58fb0171af885019d997493db33fab9af0091 (patch)
tree5aa342aab2b5a9df5eff87caa86010eff898fdad /engines
parentf2ee94c0ab646d3efe93e0c782494f5888d7cc36 (diff)
downloadscummvm-rg350-97e58fb0171af885019d997493db33fab9af0091.tar.gz
scummvm-rg350-97e58fb0171af885019d997493db33fab9af0091.tar.bz2
scummvm-rg350-97e58fb0171af885019d997493db33fab9af0091.zip
SHERLOCK: Fix display of scene hotspots
Diffstat (limited to 'engines')
-rw-r--r--engines/sherlock/screen.cpp11
-rw-r--r--engines/sherlock/screen.h2
-rw-r--r--engines/sherlock/user_interface.cpp7
3 files changed, 14 insertions, 6 deletions
diff --git a/engines/sherlock/screen.cpp b/engines/sherlock/screen.cpp
index b1ad280b39..e0eab428a8 100644
--- a/engines/sherlock/screen.cpp
+++ b/engines/sherlock/screen.cpp
@@ -46,7 +46,7 @@ Screen::~Screen() {
void Screen::setFont(int fontNumber) {
_fontNumber = fontNumber;
- Common::String fname = Common::String::format("FONT%d.VGS", fontNumber);
+ Common::String fname = Common::String::format("FONT%d.VGS", fontNumber + 1);
// Discard any previous font and read in new one
delete _font;
@@ -372,9 +372,14 @@ void Screen::writeString(const Common::String &str, const Common::Point &pt, int
charPos.x += frame._frame.w + 1;
}
}
-
- addDirtyRect(Common::Rect(pt.x, pt.y, charPos.x, pt.y + _fontHeight));
}
+/**
+ * Fills an area on the back buffer, and then copies it to the screen
+ */
+void Screen::bar(const Common::Rect &r, int color) {
+ _backBuffer.fillRect(r, color);
+ slamRect(r);
+}
} // End of namespace Sherlock
diff --git a/engines/sherlock/screen.h b/engines/sherlock/screen.h
index 257eb916b9..239067b1cc 100644
--- a/engines/sherlock/screen.h
+++ b/engines/sherlock/screen.h
@@ -98,6 +98,8 @@ public:
int stringWidth(const Common::String &str);
int charWidth(char c);
+
+ void bar(const Common::Rect &r, int color);
};
} // End of namespace Sherlock
diff --git a/engines/sherlock/user_interface.cpp b/engines/sherlock/user_interface.cpp
index 1f201c74b8..661604e4bf 100644
--- a/engines/sherlock/user_interface.cpp
+++ b/engines/sherlock/user_interface.cpp
@@ -268,7 +268,8 @@ void UserInterface::handleInput() {
// The mouse was clicked in the playing area with no action buttons down.
// Check if the mouse was clicked in a script zone. If it was,
// then execute the script. Otherwise, walk to the given position
- if (scene.checkForZones(pt, SCRIPT_ZONE) != 0) {
+ if (scene.checkForZones(pt, SCRIPT_ZONE) != 0 ||
+ scene.checkForZones(pt, NOWALK_ZONE) != 0) {
// Mouse clicked in script zone
events._pressed = events._released = false;
} else {
@@ -431,8 +432,8 @@ void UserInterface::toggleButton(int num) {
*/
void UserInterface::clearInfo() {
if (_infoFlag) {
- _vm->_screen->fillRect(16, INFO_LINE, SHERLOCK_SCREEN_WIDTH - 20, INFO_LINE + 9,
- INFO_BLACK);
+ _vm->_screen->bar(Common::Rect(16, INFO_LINE, SHERLOCK_SCREEN_WIDTH - 20,
+ INFO_LINE + 9), INFO_BLACK);
_infoFlag = false;
_oldLook = -1;
}