_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
Describes the world map. More...
#include <map.h>
Public Member Functions | |
unsigned int | getIndex (int x, int y) const |
unsigned int | getIndex (const Vec2i &pos) const |
CMapField * | Field (unsigned int index) const |
CMapField * | Field (int x, int y) const |
Get the MapField at location x,y. More... | |
CMapField * | Field (const Vec2i &pos) const |
void | FixSelectionArea (Vec2i &minpos, Vec2i &maxpos) |
map_wall.cpp - The map wall handling. | |
void | HitWall (const Vec2i &pos, unsigned damage) |
Wall is hit. More... | |
void | RemoveWall (const Vec2i &pos) |
Set wall on field. More... | |
void | SetWall (const Vec2i &pos, bool humanwall) |
Set wall on field. More... | |
unit_cache.cpp - The unit cache. | |
void | Insert (CUnit &unit) |
Insert new unit into cache. More... | |
void | Remove (CUnit &unit) |
Remove unit from cache. More... | |
void | Clamp (Vec2i &pos) const |
Public Attributes | |
CMapField * | Fields |
bool | NoFogOfWar |
fields on map More... | |
CTileset * | Tileset |
fog of war disabled More... | |
std::string | TileModelsFileName |
tileset data More... | |
CGraphic * | TileGraphic |
lua filename that loads all tilemodels More... | |
CMapInfo | Info |
graphic for fog of war More... | |
map.cpp - The map. | |
CMap () | |
~CMap () | |
void | Create () |
Alocate and initialise map table. More... | |
void | Init () |
Build tables for map. More... | |
void | Clean () |
Clean the map. More... | |
void | ClearWoodTile (const Vec2i &pos) |
Remove wood from the map. More... | |
void | ClearRockTile (const Vec2i &pos) |
Remove rock from the map. More... | |
Vec2i | MapPixelPosToTilePos (const PixelPos &mapPos) const |
convert map pixelpos coordonates into tilepos More... | |
PixelPos | TilePosToMapPixelPos_TopLeft (const Vec2i &tilePos) const |
convert tilepos coordonates into map pixel pos (take the top left of the tile) More... | |
PixelPos | TilePosToMapPixelPos_Center (const Vec2i &tilePos) const |
convert tilepos coordonates into map pixel pos (take the center of the tile) More... | |
void | MarkSeenTile (CMapField &mf) |
Mark a tile as seen by the player. More... | |
void | RegenerateForest () |
Regenerate the forest. More... | |
void | Reveal () |
Reveal the complete map, make everything known. More... | |
void | Save (CFile &file) const |
Save the map. More... | |
bool | WallOnMap (const Vec2i &pos) const |
Returns true, if wall on the map tile field. More... | |
bool | HumanWallOnMap (const Vec2i &pos) const |
Returns true, if human wall on the map tile field. More... | |
bool | OrcWallOnMap (const Vec2i &pos) const |
Returns true, if orc wall on the map tile field. More... | |
map_fog.cpp - The map fog of war handling. | |
static CGraphic * | FogGraphic |
graphic for all the tiles More... | |
void | CleanFogOfWar () |
Cleanup memory for fog of war tables. More... | |
Describes the world map.
#include "map.h"
This class contains all information about a Stratagus map. A map is a rectangle of any size.
The map class members:
An array CMap::Info::Width * CMap::Info::Height of all fields belonging to this map.
Flag if true, the fog of war is disabled.
Tileset data for the map. See CTileset. This contains all information about the tile.
Lua filename that loads all tilemodels
Graphic for all the tiles
Graphic for fog of war
Descriptive information of the map. See CMapInfo.
CMap::CMap | ( | ) |
CMap::~CMap | ( | ) |
void CMap::Clamp | ( | Vec2i & | pos | ) | const |
void CMap::Clean | ( | ) |
Clean the map.
Cleanup the map module.
void CMap::CleanFogOfWar | ( | ) |
Cleanup memory for fog of war tables.
Cleanup the fog of war.
void CMap::ClearRockTile | ( | const Vec2i & | pos | ) |
Remove rock from the map.
void CMap::ClearWoodTile | ( | const Vec2i & | pos | ) |
Remove wood from the map.
void CMap::Create | ( | ) |
Alocate and initialise map table.
Alocate and initialise map table
|
inline |
|
inline |
Get the MapField at location x,y.
|
inline |
|
inline |
void CMap::HitWall | ( | const Vec2i & | pos, |
unsigned | damage | ||
) |
Wall is hit.
Wall is hit with damage.
pos | Map tile-position of wall. |
damage | Damage done to wall. |
bool CMap::HumanWallOnMap | ( | const Vec2i & | pos | ) | const |
Returns true, if human wall on the map tile field.
Human wall on map tile.
pos | map tile position. |
void CMap::Init | ( | ) |
Build tables for map.
Initialize the fog of war. Build tables, setup functions.
void CMap::Insert | ( | CUnit & | unit | ) |
Insert new unit into cache.
Insert new unit into cache.
unit | Unit pointer to place in cache. |
convert map pixelpos coordonates into tilepos
void CMap::MarkSeenTile | ( | CMapField & | mf | ) |
Mark a tile as seen by the player.
Path of the current map.
Marks seen tile – used mainly for the Fog Of War
mf | MapField-position. |
bool CMap::OrcWallOnMap | ( | const Vec2i & | pos | ) | const |
Returns true, if orc wall on the map tile field.
Orc wall on map tile.
pos | map tile position. |
void CMap::RegenerateForest | ( | ) |
Regenerate the forest.
Regenerate forest.
void CMap::Remove | ( | CUnit & | unit | ) |
Remove unit from cache.
Remove unit from cache.
unit | Unit pointer to remove from cache. |
void CMap::RemoveWall | ( | const Vec2i & | pos | ) |
Set wall on field.
Remove wall from the map.
pos | Map position. |
FIXME: support more walls of different races.
void CMap::Reveal | ( | ) |
Reveal the complete map, make everything known.
Reveal the entire map.
void CMap::Save | ( | CFile & | file | ) | const |
Save the map.
Save the complete map.
file | Output file. |
void CMap::SetWall | ( | const Vec2i & | pos, |
bool | humanwall | ||
) |
Set wall on field.
Set wall onto the map.
pos | Map position. |
humanwall | Flag, if true set a human wall. |
convert tilepos coordonates into map pixel pos (take the center of the tile)
convert tilepos coordonates into map pixel pos (take the top left of the tile)
bool CMap::WallOnMap | ( | const Vec2i & | pos | ) | const |
Returns true, if wall on the map tile field.
Wall on map tile.
pos | map tile position. |
CMapField* CMap::Fields |
|
static |
graphic for all the tiles
CMapInfo CMap::Info |
graphic for fog of war
bool CMap::NoFogOfWar |
fields on map
CGraphic* CMap::TileGraphic |
lua filename that loads all tilemodels
std::string CMap::TileModelsFileName |
tileset data
CTileset* CMap::Tileset |
fog of war disabled