00001
00002
00003
00004
00005
00006 #ifdef USE_TILE
00007 #ifndef TILEREG_MAP_H
00008 #define TILEREG_MAP_H
00009
00010 #include "tilereg.h"
00011
00012 enum map_colour
00013 {
00014 MAP_BLACK,
00015 MAP_DKGREY,
00016 MAP_MDGREY,
00017 MAP_LTGREY,
00018 MAP_WHITE,
00019 MAP_BLUE,
00020 MAP_LTBLUE,
00021 MAP_DKBLUE,
00022 MAP_GREEN,
00023 MAP_LTGREEN,
00024 MAP_DKGREEN,
00025 MAP_CYAN,
00026 MAP_LTCYAN,
00027 MAP_DKCYAN,
00028 MAP_RED,
00029 MAP_LTRED,
00030 MAP_DKRED,
00031 MAP_MAGENTA,
00032 MAP_LTMAGENTA,
00033 MAP_DKMAGENTA,
00034 MAP_YELLOW,
00035 MAP_LTYELLOW,
00036 MAP_DKYELLOW,
00037 MAP_BROWN,
00038 MAX_MAP_COL
00039 };
00040
00041 class MapRegion : public Region
00042 {
00043 public:
00044 MapRegion(int pixsz);
00045 ~MapRegion();
00046
00047 virtual void render();
00048 virtual void clear();
00049 virtual int handle_mouse(MouseEvent &event);
00050 virtual bool update_tip_text(std::string &tip);
00051
00052 void init_colours();
00053 void set(const coord_def &gc, map_feature f);
00054 void set_window(const coord_def &start, const coord_def &end);
00055 void update_bounds();
00056
00057 protected:
00058 virtual void on_resize();
00059 void recenter();
00060 void pack_buffers();
00061
00062 map_colour m_colours[MF_MAX];
00063 int m_min_gx, m_max_gx, m_min_gy, m_max_gy;
00064 coord_def m_win_start;
00065 coord_def m_win_end;
00066 unsigned char *m_buf;
00067
00068 ShapeBuffer m_buf_map;
00069 LineBuffer m_buf_lines;
00070 bool m_dirty;
00071 bool m_far_view;
00072 };
00073
00074 #endif
00075 #endif