ScummVM API documentation
microtiles.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 TOLTECS_MICROTILES_H
23#define TOLTECS_MICROTILES_H
24
25#include "common/scummsys.h"
26#include "common/util.h"
27#include "common/rect.h"
28
29namespace Toltecs {
30
31typedef uint32 BoundingBox;
32
33const BoundingBox FullBoundingBox = 0x00001F1F;
34const BoundingBox EmptyBoundingBox = 0x00000000;
35const int TileSize = 32;
36
38public:
39 MicroTileArray(int16 width, int16 height);
41 void addRect(Common::Rect r);
42 void clear();
43 Common::Rect *getRectangles(int *num_rects, int min_x, int min_y, int max_x, int max_y);
44protected:
45 BoundingBox *_tiles;
46 int16 _tilesW, _tilesH;
47 byte TileX0(const BoundingBox &boundingBox);
48 byte TileY0(const BoundingBox &boundingBox);
49 byte TileX1(const BoundingBox &boundingBox);
50 byte TileY1(const BoundingBox &boundingBox);
51 bool isBoundingBoxEmpty(const BoundingBox &boundingBox);
52 bool isBoundingBoxFull(const BoundingBox &boundingBox);
53 void setBoundingBox(BoundingBox &boundingBox, byte x0, byte y0, byte x1, byte y1);
54 void updateBoundingBox(BoundingBox &boundingBox, byte x0, byte y0, byte x1, byte y1);
55};
56
57} // namespace Toltecs
58
59#endif // TOLTECS_MICROTILES_H
Definition: microtiles.h:37
Definition: rect.h:536