ScummVM API documentation
px_staticlayers.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 * Additional copyright for this file:
8 * Copyright (C) 1999-2000 Revolution Software Ltd.
9 * This code is based on source code created by Revolution Software,
10 * used with permission.
11 *
12 * This program is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation, either version 3 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 *
25 */
26
27#ifndef ICB_PX_STATIC_LAYERS_H
28#define ICB_PX_STATIC_LAYERS_H
29
30#include "engines/icb/common/px_common.h"
31
32namespace ICB {
33
34#define PCLAYER_SCHEMA 1
35#define PCLAYER_ID MKTAG('r', 'y', 'a', 'L')
36
37#define TILE_WIDTH 64
38#define TILE_HEIGHT 48
39#define TILES_WIDE (640 / TILE_WIDTH)
40#define TILES_HIGH (480 / TILE_HEIGHT)
41#define TILE_COUNT (TILES_WIDE * TILES_HIGH)
42
44private:
45 char id[4];
46 uint32 schema;
47 uint32 mapping;
48 uint32 tilePtrs[TILE_COUNT]; // 10 x 10 array of tiles (null means an empty tile)
49 uint32 semiPtrs[TILE_COUNT]; // 10 x 10 array of tiles (null means an empty tile)
50
51 uint8 *DataStart() { return (uint8 *)id; }
52
53public:
54 uint16 *GetSemiTileTable(int32 idx) { return semiPtrs[idx] ? (uint16 *)(DataStart() + semiPtrs[idx]) : 0; }
55
56 uint16 *GetTileTable(int32 idx) { return tilePtrs[idx] ? (uint16 *)(DataStart() + tilePtrs[idx]) : 0; }
57
58 uint32 GetSchema() {
59 if (READ_LE_U32(id) != PCLAYER_ID)
60 return 0;
61 else
62 return schema;
63 }
65 (void)mapping; // shutup warning
66 }
67};
68
69} // End of namespace ICB
70
71#endif // _PX_STATIC_LAYERS_H
Definition: px_staticlayers.h:43