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