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 HARVESTER_TEXT_H
23
#define HARVESTER_TEXT_H
24
25
#include "common/array.h"
26
#include "common/str.h"
27
28
namespace
Harvester
{
29
30
class
ResourceManager;
31
32
struct
DialogueIndexEntry
{
33
int
wavId = 0;
34
uint32 textOffset = 0;
35
uint32 textLength = 0;
36
};
37
38
struct
CftFontResource
{
39
Common::String
path;
40
Common::String
name;
41
Common::Array<byte>
header;
42
uint32 atlasWidth = 0;
43
uint32 atlasHeight = 0;
44
Common::Array<byte>
atlasPixels;
45
};
46
47
class
Text
{
48
public
:
49
bool
load(
ResourceManager
&resources);
50
51
const
Common::Array<byte>
&getDialogueData()
const
{
return
_dialogueData; }
52
const
Common::Array<DialogueIndexEntry>
&getDialogueEntries()
const
{
return
_dialogueEntries; }
53
const
Common::Array<Common::String>
&getDialogueResponseLines()
const
{
return
_dialogueResponseLines; }
54
const
Common::Array<CftFontResource>
&getFonts()
const
{
return
_fonts; }
55
bool
resolveDialogueSubtitle(
int
wavId,
Common::String
&text)
const
;
56
Common::String
getDialogueResponseLine(
int
zeroBasedIndex)
const
;
57
58
private
:
59
bool
loadDialogueIndex(
ResourceManager
&resources);
60
bool
loadDialogueResponses(
ResourceManager
&resources);
61
bool
loadFont(
ResourceManager
&resources,
const
Common::String
&path);
62
void
decodeXorText(
Common::Array<byte>
&data)
const
;
63
64
Common::Array<byte>
_dialogueData;
65
Common::Array<DialogueIndexEntry>
_dialogueEntries;
66
Common::Array<Common::String>
_dialogueResponseLines;
67
Common::Array<CftFontResource>
_fonts;
68
};
69
70
}
// End of namespace Harvester
71
72
#endif // HARVESTER_TEXT_H
Common::String
Definition:
str.h:59
Harvester
Definition:
art.h:31
Common::Array< byte >
Harvester::Text
Definition:
text.h:47
Harvester::CftFontResource
Definition:
text.h:38
Harvester::ResourceManager
Definition:
resources.h:32
Harvester::DialogueIndexEntry
Definition:
text.h:32
engines
harvester
text.h
Generated on Sun Jul 26 2026 09:09:11 for ScummVM API documentation by
1.8.13