ScummVM API documentation
data.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 ULTIMA3_DATA_DATA_H
23#define ULTIMA3_DATA_DATA_H
24
25#include "common/scummsys.h"
26
27namespace Ultima {
28namespace Ultima3 {
29namespace Data {
30
31// The original CGA 4-color palette, used by the original and composite modes
32extern const byte CGA_PALETTE1[4 * 3];
33
34// The renderers from the Ultima III Upgrade patch
35enum RenderMode {
36 RENDER_CGA = 0, RENDER_CGA_COMPOSITE = 1, RENDER_EGA = 2, RENDER_VGA = 3,
37 RENDER_MODE_COUNT = 4
38};
39
40// Descriptions of the modes for the launcher's graphics mode drop-down, in
41// the same order. Marked for translation, but not translated
42extern const char *const RENDER_MODE_LABELS[RENDER_MODE_COUNT];
43
44// EGA and VGA draw everything from the upgrade's coloured graphics files
45inline bool isEnhancedMode(RenderMode mode) {
46 return mode == RENDER_EGA || mode == RENDER_VGA;
47}
48
49// The composite renderer's 16 artifact colors, loaded from CGACOMP.PAL, are
50// kept clear of the CGA colors. Gfx::compositeDecode maps each decoded CGA
51// pixel to one of these
52constexpr int COMPOSITE_PALETTE_BASE = 32;
53constexpr int COMPOSITE_PALETTE_SIZE = 16;
54
55// The colors the game draws with, which differ between the modes
56inline byte whiteColor(RenderMode mode) {
57 return isEnhancedMode(mode) ? 15 : 3;
58}
59
60// The color of the frame around the screens in the EGA renderer, which is made of solid cells
61constexpr byte EGA_FRAME_COLOR = 9;
62
63// What the pixels flipped to show something inverted are XORed with
64inline byte invertMask(RenderMode mode) {
65 return isEnhancedMode(mode) ? 0x0F : 3;
66}
67
72void setPalette(RenderMode mode);
73
74// The letters a character's sex, race and class are stored as, with the
75// names shown for each
76constexpr int SEX_COUNT = 3;
77constexpr int RACE_COUNT = 5;
78constexpr int CLASS_COUNT = 11;
79constexpr int STATUS_COUNT = 4;
80constexpr int WEAPON_COUNT = 16;
81constexpr int ARMOUR_COUNT = 8;
82constexpr int NAME_COUNT = 136;
83
84extern const char SEX_KEYS[];
85extern const char RACE_KEYS[];
86extern const char CLASS_KEYS[];
87extern const char STATUS_KEYS[];
88extern const char *const SEX_NAMES[SEX_COUNT];
89extern const char *const RACE_NAMES[RACE_COUNT];
90extern const char *const CLASS_NAMES[CLASS_COUNT];
91extern const char *const STATUS_NAMES[STATUS_COUNT];
92extern const char *const WEAPON_NAMES[WEAPON_COUNT];
93extern const char *const ARMOUR_NAMES[ARMOUR_COUNT];
94
95// The game's table of terrain, creature, equipment and spell names, which
96// are referred to by a number starting at 1
97extern const char *const NAMES[NAME_COUNT];
98
99// The most hit points each kind of monster starts out with, and the
100// experience it gives (in BCD) when killed, found from the low four bits of
101// its tile number
102extern const byte MONSTER_HIT_POINTS[16];
103extern const byte MONSTER_EXPERIENCE[16];
104
109char weaponLimit(char classKey);
110char armourLimit(char classKey);
111
115byte fightingTile(char classKey);
116
121int lookupIndex(char key, const char *keys, int count);
122
123} // namespace Data
124} // namespace Ultima3
125} // namespace Ultima
126
127#endif
RenderMode
Definition: rendermode.h:48