wxArt2D
|
a storage for a a tiled area More...
#include <drawer.h>
Public Member Functions | |
a2dTiles (int width, int height) | |
constructor More... | |
~a2dTiles () | |
destructor | |
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? | |
a2dUpdateList * | GenerateUpdateRectangles () |
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< a2dTileBox > | m_tiles |
array of tiles ( normally m_width * m_height ) | |
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.
a2dTiles::a2dTiles | ( | int | width, |
int | height | ||
) |
constructor
width | number of horizontal tiles |
height | number of vertical tiles |
Definition at line 116 of file drawer.cpp.
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.
x | x of rectangle |
y | y of rectangle |
w | width of rectangle |
h | height of rectangle |
expand | if 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.