22#ifndef ULTIMA3_DATA_MAP_H
23#define ULTIMA3_DATA_MAP_H
25#include "common/scummsys.h"
26#include "common/serializer.h"
32constexpr int MAP_SIZE = 64;
33constexpr int CREATURE_COUNT = 32;
41 byte _tile[CREATURE_COUNT] = {};
42 byte _floor[CREATURE_COUNT] = {};
43 byte _x[CREATURE_COUNT] = {};
44 byte _y[CREATURE_COUNT] = {};
47 byte _flags[CREATURE_COUNT] = {};
57 static const int TEXT_SIZE = 0x180;
58 static const int EXTRA_SIZE = 8;
60 byte _cells[MAP_SIZE * MAP_SIZE] = {};
63 byte _text[TEXT_SIZE] = {};
66 byte _extra[EXTRA_SIZE] = {};
84 static bool exists(
const char *filename);
89 void load(
const char *filename);
107 byte cell(
int x,
int y)
const {
108 return _cells[(y & (MAP_SIZE - 1)) * MAP_SIZE + (x & (MAP_SIZE - 1))];
111 void setCell(
int x,
int y,
byte value) {
112 _cells[(y & (MAP_SIZE - 1)) * MAP_SIZE + (x & (MAP_SIZE - 1))] = value;
119 const char *
text(
int index)
const;
124 byte tile(
int x,
int y)
const {
125 return cell(x, y) >> 2;
Definition: serializer.h:80
static bool exists(const char *filename)
void save(Common::WriteStream &dest)
bool load(Common::SeekableReadStream &src)
byte cell(int x, int y) const
Definition: map.h:107
byte & extra(int index)
Definition: map.h:77
byte tile(int x, int y) const
Definition: map.h:124
void load(const char *filename)
const char * text(int index) const