$treeview $search $mathjax
Stratagus
2.2.6
$projectbrief
|
$projectbrief
|
$searchbox |
_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include <map.h>
map_fog.cpp - The map fog of war handling. | |
static CGraphic * | FogGraphic |
graphic for all the tiles | |
void | CleanFogOfWar () |
Cleanup memory for fog of war tables. | |
map.cpp - The map. | |
void | Create () |
Alocate and initialise map table. | |
void | Init () |
Build tables for map. | |
void | Clean () |
Clean the map. | |
void | ClearTile (unsigned short type, const Vec2i &pos) |
Remove wood/rock from the map. | |
void | MarkSeenTile (const unsigned int index) |
Mark a tile as seen by the player. | |
void | RegenerateForest () |
Regenerate the forest. | |
void | Reveal () |
Reveal the complete map, make everything known. | |
bool | WallOnMap (const Vec2i &pos) const |
Returns true, if wall on the map tile field. | |
bool | HumanWallOnMap (const Vec2i &pos) const |
Returns true, if human wall on the map tile field. | |
bool | OrcWallOnMap (const Vec2i &pos) const |
Returns true, if orc wall on the map tile field. | |
Public Member Functions | |
unsigned int | getIndex (int x, int y) const |
unsigned int | getIndex (const Vec2i &pos) const |
CMapField * | Field (unsigned int index) const |
unsigned short | IsTileVisible (const CPlayer &player, const unsigned int index) const |
bool | CheckMask (const unsigned int index, const int mask) const |
Check if a field flags. | |
bool | CheckMask (const Vec2i &pos, int mask) const |
bool | IsFieldExplored (const CPlayer &player, const unsigned int index) const |
Check if a field for the user is explored. | |
bool | IsFieldVisible (const CPlayer &player, const unsigned int index) const |
Check if a field for the user is visible. | |
unsigned short | IsTileVisible (const CPlayer &player, const Vec2i &pos) const |
bool | IsFieldExplored (const CPlayer &player, const Vec2i &pos) |
Check if a field for the user is explored. | |
bool | IsFieldVisible (const CPlayer &player, const Vec2i &pos) |
Check if a field for the user is visible. | |
void | MarkSeenTile (const Vec2i &pos) |
Mark a tile as seen by the player. | |
CMapField * | Field (int x, int y) const |
Get the MapField at location x,y. | |
CMapField * | Field (const Vec2i &pos) const |
bool | WaterOnMap (const unsigned int index) const |
Returns true, if water on the map tile field. | |
bool | WaterOnMap (const Vec2i &pos) const |
bool | CoastOnMap (const unsigned int index) const |
Returns true, if coast on the map tile field. | |
bool | CoastOnMap (const Vec2i &pos) const |
bool | ForestOnMap (const unsigned int index) const |
Returns true, if forest on the map tile field. | |
bool | ForestOnMap (const Vec2i &pos) const |
bool | RockOnMap (const unsigned int index) const |
Returns true, if rock on the map tile field. | |
bool | RockOnMap (const Vec2i &pos) const |
void | FixSelectionArea (Vec2i &minpos, Vec2i &maxpos) |
map_save.cpp - Saving the map. | |
void | Save (CFile *file) const |
Save the map. | |
map_wall.cpp - The map wall handling. | |
void | HitWall (const Vec2i &pos, unsigned damage) |
Wall is hit. | |
void | RemoveWall (const Vec2i &pos) |
Set wall on field. | |
void | SetWall (const Vec2i &pos, int humanwall) |
Set wall on field. | |
unit_cache.cpp - The unit cache. | |
void | Insert (CUnit &unit) |
Insert new unit into cache. | |
void | Remove (CUnit &unit) |
Remove unit from cache. | |
int | Select (int x1, int y1, int x2, int y2, CUnit *table[], const int tablesize=UnitMax) |
Select units in rectange range. | |
int | SelectFixed (const Vec2i <pos, const Vec2i &rbpos, CUnit *table[], const int tablesize=UnitMax) |
int | Select (const Vec2i &pos, CUnit *table[], const int tablesize=UnitMax) |
Public Attributes | |
CMapField * | Fields |
bool | NoFogOfWar |
fields on map | |
CTileset | Tileset |
fog of war disabled | |
char | TileModelsFileName [PATH_MAX] |
tileset data | |
CGraphic * | TileGraphic |
lua filename that loads all tilemodels | |
CMapInfo | Info |
graphic for fog of war |
#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.
unsigned int CMap::getIndex | ( | int | x, | |
int | y | |||
) | const [inline] |
unsigned int CMap::getIndex | ( | const Vec2i & | pos | ) | const [inline] |
CMapField* CMap::Field | ( | unsigned int | index | ) | const [inline] |
void CMap::Create | ( | ) |
Alocate and initialise map table.
Alocate and initialise map table
void CMap::Init | ( | ) |
Build tables for map.
Initialize the fog of war. Build tables, setup functions.
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::ClearTile | ( | unsigned short | type, | |
const Vec2i & | pos | |||
) |
Remove wood/rock from the map.
Remove wood from the map.
type | TileType to clear | |
pos | Map tile-position. |
unsigned short CMap::IsTileVisible | ( | const CPlayer & | player, | |
const unsigned int | index | |||
) | const [inline] |
Find out if a field is seen (By player, or by shared vision) This function will return > 1 with no fog of war.
player | Player to check for. | |
index | flat tile index adress. |
bool CMap::CheckMask | ( | const unsigned int | index, | |
const int | mask | |||
) | const [inline] |
Check if a field flags.
bool CMap::CheckMask | ( | const Vec2i & | pos, | |
int | mask | |||
) | const [inline] |
bool CMap::IsFieldExplored | ( | const CPlayer & | player, | |
const unsigned int | index | |||
) | const [inline] |
Check if a field for the user is explored.
bool CMap::IsFieldVisible | ( | const CPlayer & | player, | |
const unsigned int | index | |||
) | const [inline] |
Check if a field for the user is visible.
Check if a field for the user is explored.
Check if a field for the user is visible.
void CMap::MarkSeenTile | ( | const unsigned int | index | ) |
Mark a tile as seen by the player.
Path of the current map.
Marks seen tile -- used mainly for the Fog Of War
x | Map X tile-position. | |
y | Map Y tile-position. |
void CMap::MarkSeenTile | ( | const Vec2i & | pos | ) | [inline] |
Mark a tile as seen by the player.
void CMap::RegenerateForest | ( | ) |
Regenerate the forest.
Regenerate forest.
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. |
CMapField* CMap::Field | ( | int | x, | |
int | y | |||
) | const [inline] |
Get the MapField at location x,y.
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. |
void CMap::RemoveWall | ( | const Vec2i & | pos | ) |
Set wall on field.
Remove wall from the map.
pos | Map position. |
void CMap::SetWall | ( | const Vec2i & | pos, | |
int | humanwall | |||
) |
Set wall on field.
Set wall onto the map.
pos | Map position. | |
humanwall | Flag, if true set a human wall. |
bool CMap::WallOnMap | ( | const Vec2i & | pos | ) | const |
Returns true, if wall on the map tile field.
Wall on map tile.
pos | map tile position. |
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. |
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. |
bool CMap::WaterOnMap | ( | const unsigned int | index | ) | const [inline] |
Returns true, if water on the map tile field.
bool CMap::WaterOnMap | ( | const Vec2i & | pos | ) | const [inline] |
Water on map tile.
pos | map tile position. |
bool CMap::CoastOnMap | ( | const unsigned int | index | ) | const [inline] |
Returns true, if coast on the map tile field.
bool CMap::CoastOnMap | ( | const Vec2i & | pos | ) | const [inline] |
Coast on map tile.
pos | map tile position. |
bool CMap::ForestOnMap | ( | const unsigned int | index | ) | const [inline] |
Returns true, if forest on the map tile field.
bool CMap::ForestOnMap | ( | const Vec2i & | pos | ) | const [inline] |
Forest on map tile.
pos | map tile position. |
bool CMap::RockOnMap | ( | const unsigned int | index | ) | const [inline] |
Returns true, if rock on the map tile field.
bool CMap::RockOnMap | ( | const Vec2i & | pos | ) | const [inline] |
Rock on map tile.
pos | map tile position. |
void CMap::Insert | ( | CUnit & | unit | ) |
Insert new unit into cache.
Insert new unit into cache.
unit | Unit pointer to place in cache. |
void CMap::Remove | ( | CUnit & | unit | ) |
Remove unit from cache.
Remove unit from cache.
unit | Unit pointer to remove from cache. |
int CMap::Select | ( | int | x1, | |
int | y1, | |||
int | x2, | |||
int | y2, | |||
CUnit * | table[], | |||
const int | tablesize = UnitMax | |||
) |
Select units in rectange range.
int CMap::SelectFixed | ( | const Vec2i & | ltpos, | |
const Vec2i & | rbpos, | |||
CUnit * | table[], | |||
const int | tablesize = UnitMax | |||
) |
Select units in rectangle range.
ltpos | Left Top position of selection rectangle | |
rbpos | Right Bottom position of selection rectangle | |
table | All units in the selection rectangle | |
tablesize | Size of table array |
Select units on map tile.
pos | Map tile position | |
table | All units in the selection rectangle | |
tablesize | Size of table array |
bool CMap::NoFogOfWar |
fields on map
fog of war disabled
char CMap::TileModelsFileName[PATH_MAX] |
tileset data
lua filename that loads all tilemodels
CGraphic * CMap::FogGraphic [static] |
graphic for all the tiles
graphic for fog of war