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 TWINE_PARSER_TEXT_H
23#define TWINE_PARSER_TEXT_H
24
25#include "common/array.h"
26#include "common/memstream.h"
27#include "common/stream.h"
28#include "twine/parser/parser.h"
29#include "twine/shared.h"
30
31namespace TwinE {
32
33class TextEntry {
34public:
36 int index;
37 TextId textIndex;
38};
39
40class TextData {
41private:
42 // 30 is the max for lba2, lba1 uses 28
43 Common::Array<TextEntry> _texts[30];
44 void add(TextBankId textBankId, const TextEntry &entry) {
45 _texts[(int)textBankId].push_back(entry);
46 }
47
48 // custom texts that are not included in the original game
49 void initCustomTexts(TextBankId textBankId);
50public:
51 bool loadFromHQR(const char *name, TextBankId textBankId, int language, bool lba1, int entryCount);
52
53 const TextEntry *getText(TextBankId textBankId, TextId textIndex) const;
54};
55
56} // End of namespace TwinE
57
58#endif
Definition: array.h:52
Definition: str.h:59
Definition: text.h:40
Definition: text.h:33
TextId textIndex
Definition: text.h:37
int index
Definition: text.h:36
Common::String string
Definition: text.h:35