diff options
author | Johannes Schickel | 2007-10-12 00:58:59 +0000 |
---|---|---|
committer | Johannes Schickel | 2007-10-12 00:58:59 +0000 |
commit | 1764f165a72f05cae4690d956c83a75e07fe8b82 (patch) | |
tree | d2c6a3297d5e9a15cb7c68f609c709321ffceb3a /engines/kyra/text.h | |
parent | dd661390baf9d6ef80de8cded941b3d8606c717b (diff) | |
download | scummvm-rg350-1764f165a72f05cae4690d956c83a75e07fe8b82.tar.gz scummvm-rg350-1764f165a72f05cae4690d956c83a75e07fe8b82.tar.bz2 scummvm-rg350-1764f165a72f05cae4690d956c83a75e07fe8b82.zip |
HoF:
- Subclassed TextDisplayer for use with Kyra2
- Implemented opcodes:
-> o2_zanthiaChat 169
-> o2_customChat 152
-> o2_customChatFinish 153
svn-id: r29187
Diffstat (limited to 'engines/kyra/text.h')
-rw-r--r-- | engines/kyra/text.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/engines/kyra/text.h b/engines/kyra/text.h index 7ffcbf0d06..f1016f26e8 100644 --- a/engines/kyra/text.h +++ b/engines/kyra/text.h @@ -26,10 +26,12 @@ #ifndef KYRA_TEXT_H #define KYRA_TEXT_H +#include "common/scummsys.h" + +#include "kyra/screen.h" + namespace Kyra { -class Screen; class KyraEngine; -class FontId; class TextDisplayer { struct TalkCoords { @@ -38,21 +40,23 @@ class TextDisplayer { enum { TALK_SUBSTRING_LEN = 80, - TALK_SUBSTRING_NUM = 3 + TALK_SUBSTRING_NUM = 5 }; public: TextDisplayer(KyraEngine *vm, Screen *screen); - ~TextDisplayer() {} + virtual ~TextDisplayer() {} + + int maxSubstringLen() const { return TALK_SUBSTRING_LEN; } void setTalkCoords(uint16 y); int getCenterStringX(const char *str, int x1, int x2); int getCharLength(const char *str, int len); int dropCRIntoString(char *str, int offs); - char *preprocessString(const char *str); + virtual char *preprocessString(const char *str); int buildMessageSubstrings(const char *str); int getWidestLineWidth(int linesCount); - void calcWidestLineBounds(int &x1, int &x2, int w, int cx); - void restoreTalkTextMessageBkgd(int srcPage, int dstPage); + virtual void calcWidestLineBounds(int &x1, int &x2, int w, int cx); + virtual void restoreTalkTextMessageBkgd(int srcPage, int dstPage); void printTalkTextMessage(const char *text, int x, int y, uint8 color, int srcPage, int dstPage); void printIntroTextMessage(const char *text, int x, int y, uint8 col1, uint8 col2, uint8 col3, int dstPage, Screen::FontId font=Screen::FID_8_FNT); @@ -62,11 +66,11 @@ public: uint16 _talkMessageY; uint16 _talkMessageH; bool printed() const { return _talkMessagePrinted; } -private: +protected: Screen *_screen; KyraEngine *_vm; - char _talkBuffer[300]; + char _talkBuffer[1040]; char _talkSubstrings[TALK_SUBSTRING_LEN * TALK_SUBSTRING_NUM]; TalkCoords _talkCoords; bool _talkMessagePrinted; |