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
28
namespace
Scumm
{
29
30
class
MortimerFont
:
public
Graphics::Font
{
31
public
:
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
39
private
:
40
Common::Array<MortimerSprite>
_glyphs;
41
int
_height = 0, _width = 0;
42
};
43
44
class
MortimerSubtitles
{
45
public
:
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
54
private
:
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;
63
Common::HashMap<uint16, Entry>
_entries;
64
};
65
66
void
drawMortimerMessage(
Graphics::Surface
&screen,
const
MortimerFont
&font,
const
Common::String
&text,
byte
color);
67
68
}
// End of namespace Scumm
69
70
#endif
Common::Array
Definition:
array.h:52
Common::HashMap< uint16, Entry >
Common::SeekableReadStream
Definition:
stream.h:745
Common::String
Definition:
str.h:59
Graphics::Font
Definition:
font.h:83
Scumm::MortimerFont
Definition:
text.h:30
Scumm::MortimerFont::getMaxCharWidth
int getMaxCharWidth() const override
Definition:
text.h:35
Scumm::MortimerFont::drawChar
void drawChar(Graphics::Surface *surface, uint32 chr, int x, int y, uint32 color) const override
Scumm::MortimerFont::getCharWidth
int getCharWidth(uint32 chr) const override
Scumm::MortimerFont::getFontHeight
int getFontHeight() const override
Definition:
text.h:34
Scumm::MortimerSubtitles
Definition:
text.h:44
Scumm
Definition:
actor.h:30
Graphics::Surface
Definition:
surface.h:67
Scumm::MortimerMovieContext
Definition:
movie.h:60
engines
scumm
insane
mortimer
text.h
Generated on Sat Oct 24 2026 09:15:55 for ScummVM API documentation by
1.9.4