/* ==================== pgmaptile.h ==================== version 0.0.1 ==================== A widget used by PG_MapWindow to represent a tile on the map grid. PG_MapTile is used to display the contents and occupation of anything inside the tile, including obstacles, pods, hidden items, flags, tokens, etc. CHANGELOG: ---------------------- 0.0.1 - August 8, 2003 - first version. works with PG_MapWindow just fine. includes hiliting TO-DO & EXPANSION LIST ---------------------- =============================================================== */ #ifndef PG_MAPTILE_H #define PG_MAPTILE_H #include #include #include #include #include "paragui.h" #include "pgwidget.h" #include "pgeventobject.h" #include "../map/map.h" #include "../core/pointerhub.h" #include "../axis/axis.h" #include "../visual/renderman.h" #include "../pods/pod.h" class PG_MapTile: public PG_Widget, public PG_EventObject, public PointerHub { public: /** Constructor - will build a widget self-surface*/ PG_MapTile(PG_Widget *parent, const PG_Rect &r); /** Destructor */ virtual ~PG_MapTile(); /** loads all images needed for drawing all map tiles */ static void LoadImages(); /** dumps all images needed for all map tiles */ static void FlushImages(); /** Draws the contents of the tile*/ void DrawTile(); /** Tell the map tile which map coord it corresponds to.*/ void SetCoords(int x, int y); /** Set coords and draw afterwards in one step*/ void SetCoordsAndDraw(int x, int y); private: // DATA int x; //< my map X coord; int y; //< my map Y coord; int my_size; //< size (squared) of the widget bool is_selected; //< whether or not the tile is currently selected static int total_widgets; //< self conter. number of maptiles currently in existence. static bool pix_init; //< 0 = pix have not been loaded yet for maptile use, 1 = pix are ready // pit // barrier // water static SDL_Surface *pod_r; static SDL_Surface *pod_o; static SDL_Surface *pod_y; static SDL_Surface *pod_g; static SDL_Surface *pod_bl; static SDL_Surface *pod_v; static SDL_Surface *pod_w; static SDL_Surface *pod_bk; static SDL_Surface *tile_empty_0; static SDL_Surface *tile_empty_1; static SDL_Surface *tile_empty_2; static SDL_Surface *tile_empty_3; static SDL_Surface *tile_empty_4; static SDL_Surface *tile_empty_5; static SDL_Surface *tile_empty_6; static SDL_Surface *tile_empty_7; static SDL_Surface *tile_empty_8; static SDL_Surface *tile_empty_9; static SDL_Surface *tile_block; static SDL_Surface *tile_hilite; static SDL_Surface *hb_r; static SDL_Surface *hb_o; static SDL_Surface *hb_y; static SDL_Surface *hb_g; static SDL_Surface *hb_bl; static SDL_Surface *hb_v; static SDL_Surface *hb_w; static SDL_Surface *hb_bk; static SDL_Surface *blank; //< for filling the screen with black if we go off the map a bit // EVENTS void eventMouseEnter(); void eventMouseLeave(); }; #endif