ScummVM API documentation
tile.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 MADS_CORE_TILE_H
23
#define MADS_CORE_TILE_H
24
25
#include "mads/core/general.h"
26
#include "mads/core/color.h"
27
28
namespace
MADS
{
29
30
#define DEFAULT_TILE_X 20
31
#define DEFAULT_TILE_Y 12
32
33
#define EMPTY_TILE -1
34
#define REPEAT_TILE 0x8000
35
36
#define TILE_PICTURE -1
37
#define TILE_ATTRIBUTE 0
38
39
#define TILE_MAP_SHADOW 0x0020
/* Load shadow for tile */
40
41
struct
TileResource
{
42
uint16 num_tiles;
/* Number of tiles in resource */
43
int16 tile_x;
/* Tile X size */
44
int16 tile_y;
/* Tile Y size */
45
int16 compression;
/* Compression in resource file */
46
int16 ems_handle;
/* EMS handle of resource (on-disk field; unused at runtime) */
47
uint16 num_pages;
/* Number of pages needed */
48
uint16 tiles_per_page;
/* Tiles stored per page */
49
uint32 chunk_size;
/* Tile size in bytes (x*y) */
50
int16 color_handle;
/* Color handle for loaded resource */
51
52
byte *tile_data;
/* Flat tile store allocated by tile_load (not serialised) */
53
54
static
constexpr
size_t
SIZE = 2 + 2 + 2 + 2 + 2 + 2 + 2 + 4 + 2;
55
void
load(
Common::SeekableReadStream
*src);
56
};
57
58
struct
Tile
{
59
int32 file_offset;
60
};
61
62
struct
TileMapHeader
{
63
int16 tile_type;
/* Type of tile */
64
uint16 one_to_one;
/* One-to-one ratio with scr_orig */
65
uint16 num_x_tiles;
/* Number of X tiles in map */
66
uint16 num_y_tiles;
/* Number of Y tiles in map */
67
uint16 tile_x_size;
/* Tile X size */
68
uint16 tile_y_size;
/* Tile Y size */
69
uint16 viewport_x;
/* Viewport X size */
70
uint16 viewport_y;
/* Viewport Y size */
71
uint16 orig_x_size;
/* Orig buffer X pixel size */
72
uint16 orig_y_size;
/* Orig buffer Y pixel size */
73
uint16 orig_x_tiles;
/* Orig buffer X tile size */
74
uint16 orig_y_tiles;
/* Orig buffer Y tile size */
75
uint16 total_x_size;
/* Total picture X size (pixels) */
76
uint16 total_y_size;
/* Total picture Y size (pixels) */
77
78
int16 pan_x;
/* Panned to pixel X value */
79
int16 pan_y;
/* Panned to pixel Y value */
80
int16 pan_tile_x;
/* Panned to tile X value */
81
int16 pan_tile_y;
/* Panned to tile Y value */
82
int16 pan_base_x;
/* Base orig screen pixel X value */
83
int16 pan_base_y;
/* Base orig screen pixel Y value */
84
int16 pan_offset_x;
/* Panning orig offset to work X */
85
int16 pan_offset_y;
/* Panning orig offset to work Y */
86
87
TileResource
*resource;
/* Resource pointer */
88
Buffer
*buffer;
/* Buffer pointer */
89
90
int16 *map;
/* Picture tile map pointer (not in size) */
91
92
static
constexpr
size_t
SIZE = (14 * 2) + (8 * 2) + 4 + 4;
93
void
load(
Common::SeekableReadStream
*src);
94
};
95
96
extern
ShadowList
tile_shadow;
97
extern
int
tile_load_error;
98
99
extern
int
tile_setup();
100
extern
int
tile_load(
const
char
*base,
int
tile_type,
TileResource
*tile_resource,
101
TileMapHeader
*map,
Buffer
*picture,
ColorListPtr
color_list,
102
CycleListPtr
cycle_list,
int
ems_handle,
int
load_flags);
103
extern
int
tile_buffer(
Buffer
*target,
TileResource
*tile_resource,
104
TileMapHeader
*map,
int
tile_x,
int
tile_y);
105
extern
void
tile_map_free(
TileMapHeader
*map);
106
extern
void
tile_pan(
TileMapHeader
*tile_map,
int
x,
int
y);
107
extern
int
tile_fake_map(
int
tile_type,
TileMapHeader
*tile_map,
108
Buffer
*buffer,
int
x,
int
y);
109
110
}
// namespace MADS
111
112
#endif
MADS::Tile
Definition:
tile.h:58
MADS::Buffer
Definition:
general.h:57
Common::SeekableReadStream
Definition:
stream.h:745
MADS::TileMapHeader
Definition:
tile.h:62
MADS::ColorList
Definition:
color.h:78
MADS
Definition:
anim_timer.h:27
MADS::CycleList
Definition:
color.h:106
MADS::TileResource
Definition:
tile.h:41
MADS::ShadowList
Definition:
color.h:125
engines
mads
core
tile.h
Generated on Sun Aug 23 2026 09:13:37 for ScummVM API documentation by
1.8.13