ScummVM API documentation
font.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 HOPKINS_FONT_H
23 #define HOPKINS_FONT_H
24 
25 #include "common/scummsys.h"
26 #include "common/events.h"
27 #include "common/str.h"
28 
29 namespace Hopkins {
30 
31 #define MAX_TEXT 11
32 
33 class HopkinsEngine;
34 
35 struct TxtItem {
36  bool _textOnFl;
37  Common::Path _filename;
38  Common::Point _pos;
39  int _messageId;
40  int _lineCount;
41  Common::String _lines[10];
42  int _textType;
43  int _length;
44  byte *_textBlock;
45  int16 _width;
46  int16 _height;
47  bool _textLoadedFl;
48  int _color;
49 };
50 
51 struct TxtItemList {
52  bool _enabledFl;
53  Common::Point _pos;
54  int16 _width;
55  int16 _height;
56 };
57 
58 class FontManager {
59 private:
60  HopkinsEngine *_vm;
61 
62  void setTextColor(int idx, byte colByte);
63 
64  int _textSortArray[21];
65  Common::Path _oldName;
66  Common::Path _indexName;
67  int _index[4048];
68  byte *_tempText;
69  byte *_zoneText;
70  int _boxWidth;
71 
72  void loadZoneText();
73 public:
74  byte *_font;
75  int _fontFixedWidth;
76  int _fontFixedHeight;
77  TxtItem _text[12];
78  TxtItemList _textList[12];
79 
81  ~FontManager();
82  void clearAll();
83  void initData();
84 
85  void showText(int idx);
86  void hideText(int idx);
87  void initTextBuffers(int idx, int messageId, const Common::Path &filename, int xp, int yp, int textType, int length, int color);
88  void displayText(int xp, int yp, const Common::String &message, int col);
89  void displayTextVesa(int xp, int yp, const Common::String &message, int col);
90  void renderTextDisplay(int xp, int yp, const Common::String &msg, int col);
91  void setOptimalColor(int idx1, int idx2, int idx3, int idx4);
92  void box(int idx, int messageId, const Common::Path &filename, int xp, int yp);
93 };
94 
95 } // End of namespace Hopkins
96 
97 #endif /* HOPKINS_FONT_H */
Definition: str.h:59
Definition: font.h:51
Definition: path.h:52
Definition: rect.h:45
Definition: anim.h:30
Definition: font.h:58
Definition: hopkins.h:77
Definition: font.h:35