diff options
author | Joseph-Eugene Winzer | 2017-06-18 18:28:01 +0200 |
---|---|---|
committer | Thierry Crozat | 2018-01-22 23:32:46 +0000 |
commit | e534581e627429206672cba0a6f41644bc442007 (patch) | |
tree | db9891b26e6669d8f8a1a061416bb64a62cc78a4 /engines/supernova | |
parent | 5c706dfb596cae682dcc759c3f18e8d97ff1cd14 (diff) | |
download | scummvm-rg350-e534581e627429206672cba0a6f41644bc442007.tar.gz scummvm-rg350-e534581e627429206672cba0a6f41644bc442007.tar.bz2 scummvm-rg350-e534581e627429206672cba0a6f41644bc442007.zip |
SUPERNOVA: Extends screen message system
Messages will be 'removable' by over-rendering the message by invoking
removeMessage() with what was previously overdrawn.
_messageDisplayed might need to be reworked to an int, depending if
there are multiple messages rendered simultaneously.
Diffstat (limited to 'engines/supernova')
-rw-r--r-- | engines/supernova/supernova.cpp | 13 | ||||
-rw-r--r-- | engines/supernova/supernova.h | 5 |
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(); |