aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/agos/window.cpp')
-rw-r--r--engines/agos/window.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/engines/agos/window.cpp b/engines/agos/window.cpp
index 768005479e..909ab97c33 100644
--- a/engines/agos/window.cpp
+++ b/engines/agos/window.cpp
@@ -243,4 +243,38 @@ void AGOSEngine::waitWindow(WindowBlock *window) {
undefineBox(0x7FFF);
}
+void AGOSEngine::writeChar(WindowBlock *window, int x, int y, int offs, int val) {
+ int chr;
+
+ // Clear background of first digit
+ window->textColumnOffset = offs;
+ window->text_color = 0;
+ windowDrawChar(window, x * 8, y, 129);
+
+ if (val != -1) {
+ // Print first digit
+ chr = val / 10 + 48;
+ window->text_color = 15;
+ windowDrawChar(window, x * 8, y, chr);
+ }
+
+ offs += 6;
+ if (offs >= 7) {
+ offs -= 8;
+ x++;
+ }
+
+ // Clear background of second digit
+ window->textColumnOffset = offs;
+ window->text_color = 0;
+ windowDrawChar(window, x * 8, y, 129);
+
+ if (val != -1) {
+ // Print second digit
+ chr = val % 10 + 48;
+ window->text_color = 15;
+ windowDrawChar(window, x * 8, y, chr);
+ }
+}
+
} // End of namespace AGOS