Public Member Functions | Public Attributes | List of all members
a2dTiles Class Reference

a storage for a a tiled area More...

#include <drawer.h>

Public Member Functions

 a2dTiles (int width, int height)
 constructor More...
 ~a2dTiles ()
void SetSize (int width, int height)
 change tile area
void Clear ()
 All tiles become empty.
void DrawTiles (a2dDrawer2D *drawer)
 draw tiles to given view in device coordinates.
void DrawRects (a2dDrawer2D *drawer)
 draw optimized rectangles to given view in device coordinates.
int toP (int tilexy)
 convert internal tile to pixel coordinate tiles area
int toT (int xy)
 convert pixel to internal tile coordinate tiles area
int ModT (int xy)
 xy modules 256
void FillTiles (const wxRect &rect, bool expand=true)
 fill tiles covering the rect given see FillTiles( int x, int y, int w, int h, bool expand )
void FillTiles (int x, int y, int w, int h, bool expand)
 fill tiles covering the rect given More...
bool HasFilledTiles ()
 are there filled tiles available?
a2dUpdateListGenerateUpdateRectangles ()
 generate from files tiles a list of semi optimal covering rectangles More...
void GenerateUpdateRectangles (a2dUpdateList *rects, wxUint8 id)
 see GenerateUpdateRectangles(), this one adds to the list given.
a2dTileBox tile (int i)
 get tile at index i

Public Attributes

int m_width
 number of horizontal tiles
int m_height
 number of vertical tiles
vector< a2dTileBoxm_tiles
 array of tiles ( normally m_width * m_height )

Detailed Description

a storage for a a tiled area

An array of tiles width * height is maintained here. The tiles can be filled using scaning functions which take basic primitives as input. Later on the covered tiles can be extracted as a list of rectangles which cover the same area but with less rectangles in general.

Definition at line 206 of file drawer.h.

Constructor & Destructor Documentation

a2dTiles::a2dTiles ( int  width,
int  height 


widthnumber of horizontal tiles
heightnumber of vertical tiles

Definition at line 116 of file drawer.cpp.

Member Function Documentation

void a2dTiles::FillTiles ( int  x,
int  y,
int  w,
int  h,
bool  expand 

fill tiles covering the rect given

The rect formed by x,y,w,h, is divided over the tiles, filling the the part of the tiles that are covered by the rectangle.

xx of rectangle
yy of rectangle
wwidth of rectangle
hheight of rectangle
expandif true keep existing filled tiles, else clear all.

Definition at line 221 of file drawer.cpp.

a2dUpdateList * a2dTiles::GenerateUpdateRectangles ( )

generate from files tiles a list of semi optimal covering rectangles

The tiles are iterated in horizontal rows, combining filed tiles found in the rows when at same height and connecting with the previous tile. The found rect is then combined a rectangle already found in a previous row.

Definition at line 327 of file drawer.cpp.

The documentation for this class was generated from the following files:
a2dTiles Class Reference -- Sun Oct 12 2014 17:04:51 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation