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