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#ifndef SCUMM_INSANE_MORTIMER_TEXT_H
22#define SCUMM_INSANE_MORTIMER_TEXT_H
23
24#include "common/hashmap.h"
25#include "graphics/font.h"
26#include "scumm/insane/mortimer/movie.h"
27
28namespace Scumm {
29
31public:
32 bool load(const char *path);
33 bool load(Common::SeekableReadStream &stream);
34 int getFontHeight() const override { return _height; }
35 int getMaxCharWidth() const override { return _width; }
36 int getCharWidth(uint32 chr) const override;
37 void drawChar(Graphics::Surface *surface, uint32 chr, int x, int y, uint32 color) const override;
38
39private:
41 int _height = 0, _width = 0;
42};
43
45public:
46 bool load(const char *textPath, const char *fontPath, const char *infoFontPath);
47 bool loadText(Common::SeekableReadStream &stream);
48 Common::String text(uint16 id) const;
49 void drawScore(Graphics::Surface &screen, uint32 score) const;
50 void drawPause(Graphics::Surface &screen, bool isDemo) const;
51 void draw(Graphics::Surface &screen, const Common::Array<MortimerMovie::Caption> &captions, bool enabled,
52 const MortimerMovieContext *context = nullptr) const;
53
54private:
55 struct Entry {
56 Common::String text;
57 byte color = 1;
58 bool information = false;
59 bool conditional = false;
60 };
61
62 MortimerFont _font, _infoFont;
64};
65
66void drawMortimerMessage(Graphics::Surface &screen, const MortimerFont &font, const Common::String &text, byte color);
67
68} // End of namespace Scumm
69
70#endif
Definition: array.h:52
Definition: stream.h:745
Definition: str.h:59
Definition: font.h:83
Definition: text.h:30
int getMaxCharWidth() const override
Definition: text.h:35
void drawChar(Graphics::Surface *surface, uint32 chr, int x, int y, uint32 color) const override
int getCharWidth(uint32 chr) const override
int getFontHeight() const override
Definition: text.h:34
Definition: text.h:44
Definition: actor.h:30
Definition: surface.h:67
Definition: movie.h:60