aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/screen.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-03-26 21:40:24 -0400
committerPaul Gilbert2015-03-26 21:40:24 -0400
commit5e45abcca4b76955cc0ebcfa54a1b9f9be12bfa0 (patch)
tree71a94f2d967c5ca51d76073f46a427ecfe96bd3c /engines/sherlock/screen.cpp
parent0f52dcc561fbe05816452d2a20b3f09f6cd9e0fa (diff)
downloadscummvm-rg350-5e45abcca4b76955cc0ebcfa54a1b9f9be12bfa0.tar.gz
scummvm-rg350-5e45abcca4b76955cc0ebcfa54a1b9f9be12bfa0.tar.bz2
scummvm-rg350-5e45abcca4b76955cc0ebcfa54a1b9f9be12bfa0.zip
SHERLOCK: Implemented printObjectDesc
Diffstat (limited to 'engines/sherlock/screen.cpp')
-rw-r--r--engines/sherlock/screen.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/engines/sherlock/screen.cpp b/engines/sherlock/screen.cpp
index 098d43e827..646802094f 100644
--- a/engines/sherlock/screen.cpp
+++ b/engines/sherlock/screen.cpp
@@ -309,7 +309,7 @@ void Screen::flushImage(ImageFrame *frame, const Common::Point &pt,
* Prints the text passed onto the back buffer at the given position and color.
* The string is then blitted to the screen
*/
-void Screen::print(const Common::Point &pt, int fgColor, int bgColor, const char *format, ...) {
+void Screen::print(const Common::Point &pt, int color, const char *format, ...) {
// Create the string to display
char buffer[100];
va_list args;
@@ -334,13 +334,31 @@ void Screen::print(const Common::Point &pt, int fgColor, int bgColor, const char
textBounds.moveTo(textBounds.left, SHERLOCK_SCREEN_HEIGHT - _fontHeight);
// Write out the string at the given position
- writeString(str, Common::Point(textBounds.left, textBounds.top), fgColor);
+ writeString(str, Common::Point(textBounds.left, textBounds.top), color);
// Copy the affected area to the screen
slamRect(textBounds);
}
/**
+ * Print a strings onto the back buffer without blitting it to the screen
+ */
+void Screen::gPrint(const Common::Point &pt, int color, const char *format, ...) {
+ // Create the string to display
+ char buffer[100];
+ va_list args;
+
+ va_start(args, format);
+ vsprintf(buffer, format, args);
+ va_end(args);
+ Common::String str(buffer);
+
+ // Print the text
+ writeString(str, pt, color);
+}
+
+
+/**
* Returns the width of a string in pixels
*/
int Screen::stringWidth(const Common::String &str) {