BWAPI
UAlbertaBot_src/Projects/UAlbertaBot/Source/Display.h
Go to the documentation of this file.
00001 #ifndef DISPLAY_H
00002 #define DISPLAY_H
00003 
00004 struct float3
00005 {
00006         float x,y,z;
00007 
00008         float3() {}
00009         float3(float f) : x(f), y(f), z(f) {}
00010         float3(float x, float y, float z) : x(x), y(y), z(z) {}
00011 
00012         operator const float * () const { return &x; }
00013         float3 operator + (const float3 & v) const { return float3(x+v.x,y+v.y,z+v.z); }
00014         float3 operator - (const float3 & v) const { return float3(x-v.x,y-v.y,z-v.z); }
00015         float3 operator * (const float3 & v) const { return float3(x*v.x,y*v.y,z*v.z); }
00016         float3 operator / (const float3 & v) const { return float3(x/v.x,y/v.y,z/v.z); }
00017 
00018         operator float * () { return &x; }
00019         const float3 & operator += (const float3 & v) { x+=v.x; y+=v.y; z+=v.z; return *this; }
00020         const float3 & operator -= (const float3 & v) { x-=v.x; y-=v.y; z-=v.z; return *this; }
00021         const float3 & operator *= (const float3 & v) { x*=v.x; y*=v.y; z*=v.z; return *this; }
00022         const float3 & operator /= (const float3 & v) { x/=v.x; y/=v.y; z/=v.z; return *this; }
00023 };
00024 
00025 class Display
00026 {
00027         int     windowSizeX;
00028         int windowSizeY;
00029 
00030         int cameraX;
00031         int cameraY;
00032 
00033         int mapWidth;
00034         int mapHeight;
00035 
00036         int mapPixelWidth;
00037         int mapPixelHeight;
00038 
00039         bool bl,br,bd,bu;
00040 
00041         void HandleEvents();
00042         void RenderMainMap();
00043         void RenderMinimap();
00044 
00045         void RenderTerrain(int wx0, int wy0, int wx1, int wy1) const;
00046         void RenderTerrainAnalysis() const;
00047         void RenderUnits() const;
00048 
00049         float3 GetWalkTileColor(int x, int y) const;
00050 public:
00051         Display();
00052         ~Display();
00053 
00054         void OnStart();
00055         void OnFrame();
00056 };
00057 
00058 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines