_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
CMinimap Class Reference

#include <minimap.h>

Public Member Functions

 CMinimap ()
 
void UpdateSeenXY (const Vec2i &)
 

Public Attributes

int X
 
int Y
 
int W
 
int H
 
int XOffset
 
int YOffset
 
bool WithTerrain
 
bool ShowSelected
 
bool Transparent
 
bool UpdateCache
 

minimap.cpp - The minimap.

void UpdateXY (const Vec2i &pos)
 
void Update ()
 
void Create ()
 
void FreeOpenGL ()
 
void Reload ()
 
void Destroy ()
 
void Draw () const
 
void DrawViewportArea (const CViewport &viewport) const
 
void AddEvent (const Vec2i &pos, IntColor color)
 
Vec2i ScreenToTilePos (const PixelPos &screenPos) const
 
PixelPos TilePosToScreenPos (const Vec2i &tilePos) const
 
bool Contains (const PixelPos &screenPos) const
 

Constructor & Destructor Documentation

CMinimap::CMinimap ( )
inline

Member Function Documentation

void CMinimap::AddEvent ( const Vec2i pos,
IntColor  color 
)

Add a minimap event

Parameters
posMap tile position
bool CMinimap::Contains ( const PixelPos screenPos) const
void CMinimap::Create ( )

Create a mini-map from the tiles of the map.

Todo:
Scaling and scrolling the minmap is currently not supported.
void CMinimap::Destroy ( )

Destroy mini-map.

void CMinimap::Draw ( ) const

Draw the minimap on the screen

void CMinimap::DrawViewportArea ( const CViewport viewport) const

Draw viewport area contour.

void CMinimap::FreeOpenGL ( )

Free OpenGL minimap

void CMinimap::Reload ( )

Reload OpenGL minimap

Vec2i CMinimap::ScreenToTilePos ( const PixelPos screenPos) const

Convert screen position to tile map coordinate.

Parameters
screenPosScreen pixel coordinate.
Returns
Tile coordinate.
PixelPos CMinimap::TilePosToScreenPos ( const Vec2i tilePos) const

Convert tile map coordinate to screen position.

Parameters
tilePosTile coordinate.
Returns
Screen pixel coordinate.
void CMinimap::Update ( )

Update the minimap with the current game information

void CMinimap::UpdateSeenXY ( const Vec2i )
inline
void CMinimap::UpdateXY ( const Vec2i pos)

Update a single minimap tile after a change

Parameters
posThe map position to update in the minimap

Member Data Documentation

int CMinimap::H
bool CMinimap::ShowSelected
bool CMinimap::Transparent
bool CMinimap::UpdateCache
int CMinimap::W
bool CMinimap::WithTerrain
int CMinimap::X
int CMinimap::XOffset
int CMinimap::Y
int CMinimap::YOffset

The documentation for this class was generated from the following files:
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.