aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/supernova/supernova.cpp13
-rw-r--r--engines/supernova/supernova.h5
2 files changed, 14 insertions, 4 deletions
diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp
index 6c2bd688c3..eef19d28c2 100644
--- a/engines/supernova/supernova.cpp
+++ b/engines/supernova/supernova.cpp
@@ -251,9 +251,10 @@ static int characterWidth(const char *text) {
return charWidth;
}
-void SupernovaEngine::renderMessage(char *text, MessagePosition position) {
+void SupernovaEngine::renderMessage(const char *text, MessagePosition position) {
+ Common::String t(text);
char *row[20];
- char *p = text;
+ Common::String::iterator p = t.begin();
size_t numRows = 0;
int rowWidthMax = 0;
int x = 0;
@@ -318,7 +319,13 @@ void SupernovaEngine::renderMessage(char *text, MessagePosition position) {
y += 9;
}
-// timer1 = (Common::strnlen(text, BUFSIZ) + 20) * textspeed / 10;
+ _messageDisplayed = true;
+// _timer1 = (Common::strnlen(text, BUFSIZ) + 20) * textspeed / 10;
+}
+
+void SupernovaEngine::removeMessage() {
+ // TODO: restore surface
+ _messageDisplayed = false;
}
void SupernovaEngine::renderText(const char *text, int x, int y, byte color) {
diff --git a/engines/supernova/supernova.h b/engines/supernova/supernova.h
index f1f5b4a442..f3ccdf526c 100644
--- a/engines/supernova/supernova.h
+++ b/engines/supernova/supernova.h
@@ -84,6 +84,7 @@ private:
byte _menuBrightness;
byte _brightness;
uint _delay;
+ bool _messageDisplayed;
uint getDOSTicks();
void initData();
@@ -96,11 +97,13 @@ private:
void playSoundMod(int filenumber);
void stopSound();
void renderImage(int filenumber, int section, bool fullscreen = false);
- void renderMessage(char *text, MessagePosition position);
+ void renderMessage(const char *text, MessagePosition position = kMessageNormal);
+ void removeMessage();
void renderText(const char *text, int x, int y, byte color);
void renderBox(int x, int y, int width, int height, byte color);
};
+
class Inventory {
public:
Inventory();