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

Classes | 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 SetFogOpacityLevels (const uint8_t explored, const uint8_t revealed, const uint8_t unseen)
 
void UpdateXY (const Vec2i &pos)
 
void Update ()
 
void Create ()
 
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::CMinimap ( )
inline

Member Function Documentation

◆ AddEvent()

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

Add a minimap event

Parameters
posMap tile position

◆ Contains()

bool CMinimap::Contains ( const PixelPos screenPos) const

◆ Create()

void CMinimap::Create ( )

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

Todo:
Scaling and scrolling the minmap is currently not supported.

◆ Destroy()

void CMinimap::Destroy ( )

Destroy mini-map.

◆ Draw()

void CMinimap::Draw ( ) const

Draw the minimap on the screen

◆ DrawViewportArea()

void CMinimap::DrawViewportArea ( const CViewport viewport) const

Draw viewport area contour.

◆ ScreenToTilePos()

Vec2i CMinimap::ScreenToTilePos ( const PixelPos screenPos) const

Convert screen position to tile map coordinate.

Parameters
screenPosScreen pixel coordinate.
Returns
Tile coordinate.

◆ SetFogOpacityLevels()

void CMinimap::SetFogOpacityLevels ( const uint8_t  explored,
const uint8_t  revealed,
const uint8_t  unseen 
)

Set fog of war opacity (alpha chanel values) for different levels of visibility

Parameters
exploredalpha channel value for explored tiles
revealedalpha channel value for revealed tiles (when the map revealed)
unseenalpha channel value for unseen tiles

◆ TilePosToScreenPos()

PixelPos CMinimap::TilePosToScreenPos ( const Vec2i tilePos) const

Convert tile map coordinate to screen position.

Parameters
tilePosTile coordinate.
Returns
Screen pixel coordinate.

◆ Update()

void CMinimap::Update ( )

Update the minimap with the current game information

Alpha blending the fog of war texture to minimap TODO: switch to hardware rendering

◆ UpdateSeenXY()

void CMinimap::UpdateSeenXY ( const Vec2i )
inline

◆ UpdateXY()

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

◆ H

int CMinimap::H

◆ ShowSelected

bool CMinimap::ShowSelected

◆ Transparent

bool CMinimap::Transparent

◆ UpdateCache

bool CMinimap::UpdateCache

◆ W

int CMinimap::W

◆ WithTerrain

bool CMinimap::WithTerrain

◆ X

int CMinimap::X

◆ XOffset

int CMinimap::XOffset

◆ Y

int CMinimap::Y

◆ YOffset

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.