ScummVM API documentation
tiles.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 ULTIMA1_DATA_TILES_H
23#define ULTIMA1_DATA_TILES_H
24
25#include "graphics/managed_surface.h"
26
27namespace Ultima {
28namespace Ultima1 {
29namespace Data {
30
31constexpr int OVERWORLD_TILES_COUNT = 52;
32constexpr int CITY_TILES_COUNT = 51;
33constexpr int MONDAIN_TILES_COUNT = 19;
34
35// One outer-space ship glyph per shipType*4+facing combination (3 ship
36// types x 4 facings - see Data::SpaceShipType/SpaceShipFacing)
37constexpr int SPACE_SHIP_TILES_COUNT = 12;
38constexpr int SPACE_SHIP_TILE_WIDTH = 32;
39constexpr int SPACE_SHIP_TILE_HEIGHT = 19;
40
41// One cockpit-view enemy fighter glyph per approach stage, growing as it
42// closes in (same height as the ship glyphs, but narrower)
43constexpr int SPACE_ENEMY_TILES_COUNT = 7;
44constexpr int SPACE_ENEMY_TILE_WIDTH = 24;
45
46enum OverworldTileId {
47 TILE_OCEAN = 0,
48 TILE_GRASS = 1,
49 TILE_WOODS = 2,
50 TILE_MOUNTAINS = 3,
51 TILE_CASTLE1 = 4,
52 TILE_CASTLE2 = 5,
53 TILE_SIGNPOST = 6,
54 TILE_CITY1 = 7,
55 TILE_CITY2 = 8,
56 TILE_DUNGEON = 9,
57 TILE_PLAYER = 10,
58 TILE_HORSE = 11,
59 TILE_CART = 12,
60 TILE_RAFT = 13,
61 TILE_FRIGATE1 = 14,
62 TILE_FRIGATE2 = 15,
63 TILE_AIRCAR = 16,
64 TILE_SHUTTLE = 17,
65 TILE_TIME_MACHINE = 18,
66 TILE_FIRST_MONSTER = 19,
67 TILE_WANDERING_WARLOCK = 47,
68 TILE_LAST_MONSTER = 47,
69 // Flying spell-attack projectile glyph, used for casting Magic
70 // Missile/Kill on the overworld - distinct from the melee TILE_ATTACK
71 // impact flash below
72 TILE_SPELL_ATTACK = 49,
73 // Attack projectile/impact glyph, flashed briefly over the map during
74 // combat animations
75 TILE_ATTACK = 50
76};
77
78enum LocationTileId {
79 CTILE_WALL = 0,
80 CTILE_GROUND = 1,
81 CTILE_BARRED_DOOR = 11,
82 CTILE_GUARD = 17,
83 CTILE_PLAYER = 18,
84 CTILE_BARD = 19,
85 // The king/merchant NPC widget types - distinct from CTILE_KING(62)
86 // below, which is the throne tile the player stands on to transact
87 CTILE_KING_WIDGET = 20,
88 CTILE_MERCHANT = 21,
89 CTILE_PRINCESS = 22,
90 CTILE_WENCH = 50,
91 // Wishing tiles for dropping coins on
92 CTILE_DROP1 = 51,
93 CTILE_DROP2 = 52,
94 CTILE_DROP3 = 53,
95 // Shop counter tiles. Each shop spans two adjacent tiles - the even one
96 // is just the other half of the counter, while the odd one is also the
97 // tile get/steal work against
98 CTILE_ARMORY = 54,
99 CTILE_STEAL_ARMOR = 55,
100 CTILE_GROCER = 56,
101 CTILE_STEAL_FOOD = 57,
102 CTILE_WEAPONS = 58,
103 CTILE_STEAL_WEAPON = 59,
104 CTILE_MAGIC = 60,
105 CTILE_TAVERN = 61,
106 // In castles, tiles 60/61 are instead the two lock tiles the player
107 // stands on to Unlock a princess's cell - one of them matches the key
108 // (_castleKeyVal), the other is the wrong one
109 CTILE_LOCK1 = 60,
110 CTILE_LOCK2 = 61,
111 // Tile 62 is a transport shop counter in cities, but the king in castles
112 CTILE_TRANSPORT = 62,
113 CTILE_KING = 62,
114 CTILE_BLANK = 63
115};
116
117enum MondainTileId {
118 // The gem Mondain is creating, which stays put in the room however he
119 // moves. While it's being struck, frames 1-4 of the hit animation (tiles
120 // 6-9) are drawn over it
121 MTILE_GEM = 6,
122 // Tiles 14-19 are the 6 animation frames of a hazard Mondain briefly
123 // conjures onto an empty cell (see updateMondainState / MondainLogic::tick)
124 MTILE_HAZARD = 14,
125 MTILE_PLAYER = 20
126};
127
139extern void loadTiles(const char *filename, Graphics::ManagedSurface *tiles, int count, int size, bool cga);
140
156extern void loadShipTiles(const char *filename, Graphics::ManagedSurface *tiles, int count, int width, bool cga);
157
158} // namespace Data
159} // namespace Ultima1
160} // namespace Ultima
161
162#endif
Definition: managed_surface.h:51