ScummVM API documentation
text.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef TRECISION_TEXT_H
23 #define TRECISION_TEXT_H
24 
25 #define MAXLENSUBSTRING 128
26 #define MAXSUBSTRING 16
27 
28 #include "common/scummsys.h"
29 #include "trecision/struct.h"
30 
31 namespace Trecision {
32 
33 class TrecisionEngine;
34 
35 struct StackText {
36  uint16 _x = 0;
37  uint16 _y = 0;
38  uint16 _textColor = 0;
39  Common::String _text;
40  bool _clear = false;
41 };
42 
43 class TextManager {
44  TrecisionEngine *_vm;
45 
46  uint32 _someoneSpeakTime;
47  bool _subStringAgain;
48  uint32 _talkTime;
49  char _subString[MAXSUBSTRING][MAXLENSUBSTRING];
50  uint16 _subStringUsed;
51  Common::String _superString;
52  uint16 _subStringStart;
53  uint16 _curSentenceId;
54  uint16 _curSubString;
55  Common::Path _lastFilename;
56  uint16 _talkingPersonId;
57  SDText _curString;
58  SDText _oldString;
59 
60  Common::List<StackText> _textStack;
61 
62  Common::Point positionString(uint16 x, uint16 y, const char *string, bool characterFl);
63  void formattingSuperString();
64  void formattingOneString();
65  void characterTalk(Common::String s);
66  void characterContinueTalk();
67  void characterMute();
68  void someoneContinueTalk();
69  void someoneMute();
70 
71 public:
73  ~TextManager();
74 
75  void doString();
76  void showObjName(uint16 obj, bool show);
77  void someoneSay(uint16 sentence, uint16 person);
78  void characterSay(uint16 i);
79  void characterSayInAction(uint16 ss);
80 
81  void addText(Common::Point pos, const char *text, uint16 textCol);
82  void clearLastText();
83  void drawText(StackText *text);
84  void clearText();
85  void drawTexts();
86  void redrawString();
87  void clearTextStack();
88  Common::Rect getOldTextRect() const;
89  void clearOldText();
90 
91  void drawCurString();
92 };
93 
94 } // End of namespace Trecision
95 #endif
96 
Definition: text.h:43
Definition: str.h:59
Definition: trecision.h:99
Definition: list.h:44
Definition: rect.h:144
Definition: path.h:52
Definition: actor.h:29
Definition: rect.h:45
Definition: struct.h:189
Definition: text.h:35