11 #include "../math/Vector.h"
17 /// Defines a rectangular section of a map.
18 /// Tiles are rendered ltr with a row break each width tiles.
19 /// Missing tiles in the last row are possible but don't fool yourself.
23 static const int TYPE_ID = 601;
30 /// Get the width in tiles.
31 int Width() const { return width; }
32 /// Get the height in tiles.
33 int Height() const { return numTiles / width + (numTiles % width ? 1 : 0); }
34 /// Get the size in tiles.
35 math::Vector<int> Size() const { return math::Vector<int>(Width(), Height()); }
36 /// Get a tile by tile coordinates (not pixel coordinates!).
37 Tile *TileAt(const math::Vector<int> &);
38 const Tile *TileAt(const math::Vector<int> &) const;
40 /// Get the default battle background for this area.
41 SDL_Surface *BattleBackground() { return battlebg; }
45 const graphics::Sprite *tileset,
46 const math::Vector<int> &offset,
47 unsigned int frame) const;
48 void RenderDebug(SDL_Surface *dest, const graphics::Sprite *tileset, const math::Vector<int> &offset) const;
50 static void CreateTypeDescription();
51 static void Construct(void *);
55 void SetTiles(Tile *t, int num) { tiles = t; numTiles = num; }
56 void SetWidth(int w) { width = w; }
59 SDL_Surface *battlebg;