MapView Class Reference

#include <MapView.h>

Inheritance diagram for MapView:

ScrollView Window

List of all members.


Public Member Functions

 MapView ()
 Public constructor.
virtual ~MapView ()
 Virtual destructor.
void SetConsole (Console *pConsole)
 (*** add brief description here ***)
void ScanMap (regcom::common::Map *pMap)
 (*** add brief description here ***)
void ZoomIn ()
 (*** add brief description here ***)
void ZoomOut ()
 (*** add brief description here ***)
void ToggleGrid ()
 (*** add brief description here ***)
void WarpToTile (gui::Point point)
 (*** add brief description here ***)
gui::Point TileFromPoint (gui::Point point)
 (*** add brief description here ***)
virtual void OnMouseMove (gui::Point point)
 (*** add brief description here ***)
virtual void OnMouseDown (int n, gui::Point point)
 (*** add brief description here ***)
virtual void OnMouseUp (int n, gui::Point point)
 (*** add brief description here ***)
void ClearLOS ()
 (*** add brief description here ***)
void MarkLOS (int x0, int y0, int x1, int y1)
 (*** add brief description here ***)

Protected Member Functions

void SetDataSize (int x, int y)
 (*** add brief description here ***)
void UnloadTiles ()
 (*** add brief description here ***)
void LoadTiles ()
 (*** add brief description here ***)
void LoadTile (int n, gui::Surface *pTiles, int x, int y)
 (*** add brief description here ***)
void LoadUnitTile (int n, gui::Surface *pTiles, int x, int y)
 (*** add brief description here ***)
void RefreshTile (int x, int y)
 (*** add brief description here ***)
void SetTileIndex (int x, int y, int z, int n)
 (*** add brief description here ***)
int GetTileIndex (int x, int y, int z)
 (*** add brief description here ***)
void DrawTile (int n, int x, int y, gui::Surface *pSurface, gui::Rect clip)
 (*** add brief description here ***)
void DrawLayer (int n, gui::Rect rect, gui::Surface *pSurface, int x, int y)
 (*** add brief description here ***)
void ClipMargins (gui::Rect &rect, gui::Surface *pSurface, int &x, int &y)
 (*** add brief description here ***)
virtual void DrawImage (gui::Rect rect, gui::Surface *pSurface, int x, int y)
 (*** add brief description here ***)
virtual void ViewportChanged ()
 (*** add brief description here ***)
void ImageSizeChanged ()
 (*** add brief description here ***)
virtual int GetImageWidth ()
 (*** add brief description here ***)
virtual int GetImageHeight ()
 (*** add brief description here ***)
void SetZoomLevel (int n)
 (*** add brief description here ***)
gui::Point ArrayToHex (gui::Point p)
 (*** add brief description here ***)
gui::Point HexToArray (gui::Point p)
 (*** add brief description here ***)

Private Types

enum  TILEBASE {
  TILEBASE_CLEAR = 0, TILEBASE_WATER = 8, TILEBASE_WOODS = 16, TILEBASE_MARKERS = 24,
  TILEBASE_UNIT1_BASE = 32, TILEBASE_UNIT1_BODY = 38, TILEBASE_UNIT2_BASE = 44, TILEBASE_UNIT2_BODY = 50
}
 (*** add brief description here ***) More...
enum  TILECOUNT {
  TILECOUNT_CLEAR = 8, TILECOUNT_WATER = 8, TILECOUNT_WOODS = 8, TILECOUNT_MARKERS = 8,
  TILECOUNT_UNIT1_BASE = 6, TILECOUNT_UNIT1_BODY = 6, TILECOUNT_UNIT2_BASE = 6, TILECOUNT_UNIT2_BODY = 6
}
 (*** add brief description here ***) More...
enum  TILEROW {
  TILEROW_CLEAR = 0, TILEROW_CLEARGRID = 1, TILEROW_WATER = 2, TILEROW_WATERGRID = 3,
  TILEROW_WOODS = 4, TILEROW_MARKERS = 5, TILEROW_UNIT1_BASE = 0, TILEROW_UNIT1_BODY = 1,
  TILEROW_UNIT2_BASE = 2, TILEROW_UNIT2_BODY = 3
}
 (*** add brief description here ***) More...

Private Attributes

int m_ZoomLevel
 (*** add brief description here ***)
bool m_ShowGrid
 (*** add brief description here ***)
Consolem_pConsole
 (*** add brief description here ***)
unsigned char * m_pData [MAPVIEW_LAYERS]
 (*** add brief description here ***)
int m_DataWidth
 (*** add brief description here ***)
int m_DataHeight
 (*** add brief description here ***)
int m_ImageWidth
 (*** add brief description here ***)
int m_ImageHeight
 (*** add brief description here ***)
gui::Surfacem_pTile [MAPVIEW_MAXTILE]
 (*** add brief description here ***)
bool m_Dragging
 (*** add brief description here ***)
gui::Point m_DragBegin
 (*** add brief description here ***)
gui::Point m_DragEnd
 (*** add brief description here ***)
int m_DebugRects
 (*** add brief description here ***)

Static Private Attributes

static const int ZOOM_LEVELS = 3
 (*** add brief description here ***)
static const TileInfo s_TileInfo [ZOOM_LEVELS]
 (*** add brief description here ***)

Detailed Description

(*** add brief description here ***)
Full Description
(*** add full description here ***)

Member Enumeration Documentation

enum TILEBASE [private]

(*** add brief description here ***)

Enumerator:
TILEBASE_CLEAR 
TILEBASE_WATER 
TILEBASE_WOODS 
TILEBASE_MARKERS 
TILEBASE_UNIT1_BASE 
TILEBASE_UNIT1_BODY 
TILEBASE_UNIT2_BASE 
TILEBASE_UNIT2_BODY 

enum TILECOUNT [private]

(*** add brief description here ***)

Enumerator:
TILECOUNT_CLEAR 
TILECOUNT_WATER 
TILECOUNT_WOODS 
TILECOUNT_MARKERS 
TILECOUNT_UNIT1_BASE 
TILECOUNT_UNIT1_BODY 
TILECOUNT_UNIT2_BASE 
TILECOUNT_UNIT2_BODY 

enum TILEROW [private]

(*** add brief description here ***)

Enumerator:
TILEROW_CLEAR 
TILEROW_CLEARGRID 
TILEROW_WATER 
TILEROW_WATERGRID 
TILEROW_WOODS 
TILEROW_MARKERS 
TILEROW_UNIT1_BASE 
TILEROW_UNIT1_BODY 
TILEROW_UNIT2_BASE 
TILEROW_UNIT2_BODY 


Constructor & Destructor Documentation

MapView (  ) 

Public constructor.

Full Description
This method creates a new instance of the class.
Returns:
New instance of the class.

~MapView (  )  [virtual]

Virtual destructor.

Full Description
This method destroys an existing instance of the class.
Returns:
None.


Member Function Documentation

void SetConsole ( Console pConsole  ) 

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
pConsole  (*** add description here ***)

void ScanMap ( regcom::common::Map pMap  ) 

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
pMap  (*** add description here ***)

void ZoomIn (  ) 

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)

void ZoomOut (  ) 

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)

void ToggleGrid (  ) 

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)

void WarpToTile ( gui::Point  point  ) 

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
point  (*** add description here ***)

Point TileFromPoint ( gui::Point  point  ) 

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
point  (*** add description here ***)

void OnMouseMove ( gui::Point  point  )  [virtual]

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
point  (*** add description here ***)

Reimplemented from Window.

void OnMouseDown ( int  n,
gui::Point  point 
) [virtual]

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
n  (*** add description here ***)
point  (*** add description here ***)

Reimplemented from Window.

void OnMouseUp ( int  n,
gui::Point  point 
) [virtual]

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
n  (*** add description here ***)
point  (*** add description here ***)

Reimplemented from Window.

void ClearLOS (  ) 

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)

void MarkLOS ( int  x0,
int  y0,
int  x1,
int  y1 
)

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
x0  (*** add description here ***)
y0  (*** add description here ***)
x1  (*** add description here ***)
y1  (*** add description here ***)

void SetDataSize ( int  x,
int  y 
) [protected]

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
x  (*** add description here ***)
y  (*** add description here ***)

void UnloadTiles (  )  [protected]

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)

void LoadTiles (  )  [protected]

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)

void LoadTile ( int  n,
gui::Surface pTiles,
int  x,
int  y 
) [protected]

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
n  (*** add description here ***)
pTiles  (*** add description here ***)
x  (*** add description here ***)
y  (*** add description here ***)

void LoadUnitTile ( int  n,
gui::Surface pTiles,
int  x,
int  y 
) [protected]

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
n  (*** add description here ***)
pTiles  (*** add description here ***)
x  (*** add description here ***)
y  (*** add description here ***)

void RefreshTile ( int  x,
int  y 
) [protected]

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
x  (*** add description here ***)
y  (*** add description here ***)

void SetTileIndex ( int  x,
int  y,
int  z,
int  n 
) [protected]

(*** add brief description here ***)

int GetTileIndex ( int  x,
int  y,
int  z 
) [protected]

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
x  (*** add description here ***)
y  (*** add description here ***)
z  (*** add description here ***)

void DrawTile ( int  n,
int  x,
int  y,
gui::Surface pSurface,
gui::Rect  clip 
) [protected]

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
n  (*** add description here ***)
x  (*** add description here ***)
y  (*** add description here ***)
pSurface  (*** add description here ***)
clip  (*** add description here ***)

void DrawLayer ( int  n,
gui::Rect  rect,
gui::Surface pSurface,
int  x,
int  y 
) [protected]

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
n  (*** add description here ***)
rect  (*** add description here ***)
pSurface  (*** add description here ***)
x  (*** add description here ***)
y  (*** add description here ***)

void ClipMargins ( gui::Rect rect,
gui::Surface pSurface,
int &  x,
int &  y 
) [protected]

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
rect  (*** add description here ***)
pSurface  (*** add description here ***)
x  (*** add description here ***)
y  (*** add description here ***)

void DrawImage ( gui::Rect  rect,
gui::Surface pSurface,
int  x,
int  y 
) [protected, virtual]

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
rect  (*** add description here ***)
pSurface  (*** add description here ***)
x  (*** add description here ***)
y  (*** add description here ***)

Implements ScrollView.

void ViewportChanged (  )  [protected, virtual]

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)

Implements ScrollView.

void ImageSizeChanged (  )  [protected]

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)

virtual int GetImageWidth (  )  [inline, protected, virtual]

(*** add brief description here ***)

Implements ScrollView.

virtual int GetImageHeight (  )  [inline, protected, virtual]

(*** add brief description here ***)

Implements ScrollView.

void SetZoomLevel ( int  n  )  [protected]

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
n  (*** add description here ***)

Point ArrayToHex ( gui::Point  p  )  [protected]

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
p  (*** add description here ***)

Point HexToArray ( gui::Point  p  )  [protected]

(*** add brief description here ***)

Full Description
(*** add full description here ***)
Returns:
(*** add return description here ***)
Parameters:
p  (*** add description here ***)


Member Data Documentation

int m_ZoomLevel [private]

(*** add brief description here ***)

bool m_ShowGrid [private]

(*** add brief description here ***)

Console* m_pConsole [private]

(*** add brief description here ***)

unsigned char* m_pData[MAPVIEW_LAYERS] [private]

(*** add brief description here ***)

int m_DataWidth [private]

(*** add brief description here ***)

int m_DataHeight [private]

(*** add brief description here ***)

int m_ImageWidth [private]

(*** add brief description here ***)

int m_ImageHeight [private]

(*** add brief description here ***)

gui::Surface* m_pTile[MAPVIEW_MAXTILE] [private]

(*** add brief description here ***)

bool m_Dragging [private]

(*** add brief description here ***)

(*** add brief description here ***)

gui::Point m_DragEnd [private]

(*** add brief description here ***)

int m_DebugRects [private]

(*** add brief description here ***)

const int ZOOM_LEVELS = 3 [static, private]

(*** add brief description here ***)

const TileInfo s_TileInfo [static, private]

Initial value:

{
    {"Tile16.bmp", 19, 17, 14, 16, 0,  8, "Unit24.bmp", 18, 24},
    {"Tile28.bmp", 33, 29, 25, 28, 0, 14, "Unit42.bmp", 32, 42},
    {"Tile48.bmp", 57, 49, 44, 48, 0, 24, "Unit72.bmp", 56, 72}
}
(*** add brief description here ***)

Full Description
(*** add full description here ***)


The documentation for this class was generated from the following files: