aboutsummaryrefslogtreecommitdiff
path: root/engines/supernova
diff options
context:
space:
mode:
Diffstat (limited to 'engines/supernova')
-rw-r--r--engines/supernova/supernova.cpp15
-rw-r--r--engines/supernova/supernova.h3
2 files changed, 18 insertions, 0 deletions
diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp
index cde54ab193..d11f85670b 100644
--- a/engines/supernova/supernova.cpp
+++ b/engines/supernova/supernova.cpp
@@ -362,6 +362,11 @@ void SupernovaEngine::renderRoom(Room &room) {
}
}
+int SupernovaEngine::textWidth(const uint16 key) {
+ const char text[2] = {key & 0xFF, 0};
+ return textWidth(text);
+}
+
int SupernovaEngine::textWidth(const char *text) {
int charWidth = 0;
while (*text != '\0') {
@@ -502,10 +507,20 @@ void SupernovaEngine::renderText(const char *text, int x, int y, byte color) {
_textColor = color;
}
+void SupernovaEngine::renderText(const uint16 character, int x, int y, byte color) {
+ char text[2] = {character & 0xFF, 0};
+ renderText(text, x, y, color);
+}
+
void SupernovaEngine::renderText(const char *text) {
renderText(text, _textCursorX, _textCursorY, _textColor);
}
+void SupernovaEngine::renderText(const uint16 character) {
+ char text[2] = {character & 0xFF, 0};
+ renderText(text, _textCursorX, _textCursorY, _textColor);
+}
+
void SupernovaEngine::renderBox(int x, int y, int width, int height, byte color) {
Graphics::Surface *screen = _system->lockScreen();
screen->fillRect(Common::Rect(x, y, x + width, y + height), color);
diff --git a/engines/supernova/supernova.h b/engines/supernova/supernova.h
index 86d5d81b37..eef3c9d015 100644
--- a/engines/supernova/supernova.h
+++ b/engines/supernova/supernova.h
@@ -109,6 +109,7 @@ public:
int getDOSTicks();
int textWidth(const char *text);
+ int textWidth(const uint16 key);
void initData();
void initPalette();
void paletteFadeIn();
@@ -126,7 +127,9 @@ public:
void renderMessage(const char *text, MessagePosition position = kMessageNormal);
void removeMessage();
void renderText(const char *text, int x, int y, byte color);
+ void renderText(const uint16 character, int x, int y, byte color);
void renderText(const char *text);
+ void renderText(const uint16 character);
void renderBox(int x, int y, int width, int height, byte color);
void setColor63(byte value);
void command_print();