00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef __MINIMAP_H__
00031 #define __MINIMAP_H__
00032
00034
00035 #include "vec2i.h"
00036 #include "video.h"
00037
00038 class CViewport;
00039
00040
00041
00042
00043
00044 class CMinimap
00045 {
00046 template <const int BPP>
00047 void UpdateMapTerrain(void *const mpixels, const int mpitch,
00048 const void *const tpixels, const int tpitch);
00049
00050 void UpdateTerrain();
00051
00052 template <const int BPP>
00053 void UpdateSeen(void *const pixels, const int pitch);
00054
00055 public:
00056 CMinimap() : X(0), Y(0), W(0), H(0), XOffset(0), YOffset(0),
00057 WithTerrain(false), ShowSelected(false),
00058 Transparent(false), UpdateCache(false) {}
00059
00060 void UpdateXY(const Vec2i &pos);
00061 void UpdateSeenXY(const Vec2i &) {}
00062 void Update();
00063 void Create();
00064 void FreeOpenGL();
00065 void Reload();
00066 void Destroy();
00067 void Draw() const;
00068 void DrawViewportArea(const CViewport &viewport) const;
00069 void AddEvent(const Vec2i &pos, Uint32 color);
00070
00071 Vec2i ScreenToTilePos(const PixelPos &screenPos) const;
00072 PixelPos TilePosToScreenPos(const Vec2i &tilePos) const;
00073
00074 bool Contains(const PixelPos &screenPos) const;
00075 public:
00076 int X;
00077 int Y;
00078 int W;
00079 int H;
00080 int XOffset;
00081 int YOffset;
00082 bool WithTerrain;
00083 bool ShowSelected;
00084 bool Transparent;
00085 bool UpdateCache;
00086 };
00087
00088
00089 extern unsigned char *MinimapSurfaceGL;
00090
00091 extern unsigned char *MinimapTerrainSurfaceGL;
00092
00093 extern SDL_Surface *MinimapSurface;
00094
00095 extern SDL_Surface *MinimapTerrainSurface;
00096
00098
00099 #endif // !__MINIMAP_H__