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#ifndef DRAGONS_FONT_H
22#define DRAGONS_FONT_H
23
24#include "common/scummsys.h"
25#include "common/stream.h"
26#include "graphics/surface.h"
27
28namespace Dragons {
29
30class DragonsEngine;
31class BigfileArchive;
32class Screen;
33
34class Font {
35private:
36 uint32 _size;
37 uint16 *_map;
38 byte *_pixels;
39 uint32 _numChars;
40
41public:
42 Font(Common::SeekableReadStream &stream, uint32 mapSize, uint32 pixelOffset, uint32 pixelSize);
43 ~Font();
44 Graphics::Surface *render(uint16 *text, uint16 length);
45 void renderToSurface(Graphics::Surface *surface, int16 x, int16 y, uint16 *text, uint16 length);
46
47private:
48 uint16 mapChar(uint16 in);
49};
50
52public:
53 Font *_fonts[3];
54
55private:
56 uint16 _dat_80086f48_fontColor_flag;
57 DragonsEngine *_vm;
58 Screen *_screen;
59 Graphics::Surface *_surface;
60 byte *_boxFontChr;
61
62 int _numTextEntries;
63
64public:
65 FontManager(DragonsEngine *vm, Screen *screen, BigfileArchive *bigfileArchive);
67 void addText(int16 x, int16 y, uint16 *text, uint16 length, uint8 fontType);
68 void addAsciiText(int16 x, int16 y, const char *text, uint16 length, uint8 fontType);
69 void draw();
70 void clearText();
71 void updatePalette();
72 void drawTextDialogBox(uint32 x1, uint32 y1, uint32 x2, uint32 y2);
73 void clearTextDialog(uint32 x1, uint32 y1, uint32 x2, uint32 y2);
74
75private:
76 Font *loadFont(uint16 index, Common::SeekableReadStream &stream);
77 void drawBoxChar(uint32 x, uint32 y, uint8 tileIndex);
78};
79
80} // End of namespace Dragons
81
82#endif //DRAGONS_FONT_H
Definition: stream.h:745
Definition: bigfile.h:42
Definition: dragons.h:166
Definition: font.h:34
Definition: font.h:51
Definition: screen.h:67
Definition: surface.h:67
Definition: atari-screen.h:58