_________ __ __
/ _____// |_____________ _/ |______ ____ __ __ ______
\_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
/ \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \
/_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
\/ \/ \//_____/ \/
______________________ ______________________
T H E W A R B E G I N S
Stratagus - A free fantasy real time strategy game engine
Go to the documentation of this file.
88 #ifndef __MAP_TILE_H__
112 #define MaxMapWidth 256
113 #define MaxMapHeight 256
173 return &this->
Fields[index];
195 void Clean(
const bool isHardClean =
false);
246 minpos.
x = std::max<short>(0, minpos.
x);
247 minpos.
y = std::max<short>(0, minpos.
y);
255 void ClearWoodTile(
const Vec2i &pos);
257 void ClearRockTile(
const Vec2i &pos);
260 void FixNeighbors(
unsigned short type,
int seen,
const Vec2i &pos);
262 void FixTile(
unsigned short type,
int seen,
const Vec2i &pos);
265 void RegenerateForestTile(
const Vec2i &pos);
354 extern void SetTile(
unsigned int tile,
const Vec2i &pos,
int value = 0);
355 inline void SetTile(
unsigned int tile,
int x,
int y,
int value = 0)
357 const Vec2i pos(x, y);
369 Vec2i newSize = {0, 0},
Vec2i offset = {0, 0});
Diplomacy states for CommandDiplomacy.
Definition: player.h:83
MapMarkerFunc MapMarkTileRadar
Mark a tile as radar visible, or incrase radar vision.
void Clean(const bool isHardClean=false)
Clean the map.
Definition: map.cpp:359
void RegenerateForest()
Regenerate the forest.
Definition: map.cpp:676
void MapUnmarkRadarJammer(const CPlayer &player, const CUnit &unit, const Vec2i &pos, int w, int h, int range)
Definition: map.h:421
void MapFixSeenWallNeighbors(const Vec2i &pos)
Correct the surrounding seen wall fields.
Definition: map_wall.cpp:154
bool LoadStratagusMapInfo(const std::string &mapname)
Load map presentation.
Definition: map.cpp:699
MapMarkerFunc MapMarkTileRadarJammer
Mark a tile as radar jammed, or incrase radar jamming'ness.
std::string Preamble
Map filename.
Definition: map.h:140
int ReplayRevealMap
Flag must reveal map when in replay.
Definition: map.cpp:57
void Create()
Alocate and initialise map table.
Definition: map.cpp:339
CMapField * Field(int x, int y) const
Get the MapField at location x,y.
Definition: map.h:176
void MapMarkUnitSight(CUnit &unit)
Mark on vision table the Sight of the unit.
Definition: unit.cpp:873
void Remove(CUnit &unit)
Remove unit from cache.
Definition: unit_cache.cpp:76
MapMarkerFunc MapMarkTileSight
Mark a tile for normal sight.
void HitWall(const Vec2i &pos, unsigned damage)
Wall is hit.
Definition: map_wall.cpp:280
MapMarkerFunc MapUnmarkTileDetectCloak
Unmark a tile for cloak detection.
unsigned int getIndex(const Vec2i &pos) const
Definition: map.h:166
unsigned int ForestRegeneration
Path to the current map.
Definition: map.cpp:58
void Reveal(MapRevealModes mode=MapRevealModes::cKnown)
Set map reveal mode: hidden/known/fully explored.
Definition: map.cpp:133
PixelPos TilePosToMapPixelPos_Center(const Vec2i &tilePos) const
convert tilepos coordonates into map pixel pos (take the center of the tile)
Definition: map.cpp:187
int MapWidth
Map postamble script.
Definition: map.h:142
void MapMarkRadar(const CPlayer &player, const CUnit &unit, const Vec2i &pos, int w, int h, int range)
Handle Marking and Unmarking of radar vision.
Definition: map.h:408
bool NoFogOfWar
fields on map
Definition: map.h:269
int SaveStratagusMap(const std::string &filename, CMap &map, int writeTerrain, Vec2i newSize={0, 0}, Vec2i offset={0, 0})
Save a stratagus map (smp format)
Definition: game.cpp:542
int MapFogFilterFlags(CPlayer &player, const Vec2i &pos, int mask)
Filter map flags through fog.
Definition: map_fog.cpp:107
std::string Postamble
Map preamble script.
Definition: map.h:141
T y
Definition: vec2i.h:43
void AllocateTileset()
Definition: map.cpp:330
std::string Description
Definition: map.h:138
void Save(CFile &file) const
Save the map.
Definition: map.cpp:393
Definition: unittype.h:508
void MapMarkerFunc(const CPlayer &player, const unsigned int index)
Function to (un)mark the vision table.
Definition: map.h:303
void RemoveWall(const Vec2i &pos)
Set wall on field.
Definition: map_wall.cpp:216
PlayerTypes PlayerType[PlayerMax]
Map height.
Definition: map.h:144
Vec2i MapPixelPosToTilePos(const PixelPos &mapPos) const
convert map pixelpos coordonates into tilepos
Definition: map.cpp:173
bool CanMoveToMask(const Vec2i &pos, int mask)
Can a unit with 'mask' enter the field.
Definition: map.h:402
CMap()
Definition: map.cpp:321
MapRevealModes FlagRevealMap
Flag must reveal the map.
Definition: map.cpp:56
bool WallOnMap(const Vec2i &pos) const
Returns true, if wall on the map tile field.
Definition: map.cpp:199
CMapField * Field(unsigned int index) const
Definition: map.h:171
void MarkSeenTile(CMapField &mf)
Mark a tile as seen by the player.
Definition: map.cpp:71
void Clamp(Vec2i &pos) const
Definition: unit_cache.cpp:96
void Init()
Build tables for map.
Definition: map.cpp:350
void Clear()
Definition: map.cpp:311
void MapSight(const CPlayer &player, const CUnit &unit, const Vec2i &pos, int w, int h, int range, MapMarkerFunc *marker)
Mark sight changes.
Definition: map_fog.cpp:347
void MapFixWallTile(const Vec2i &pos)
Correct the real wall field, depending on the surrounding.
Definition: map_wall.cpp:168
constexpr unsigned char PlayerMax
Definition: settings.h:62
char CurrentMapPath[1024]
The current map.
Definition: map.cpp:60
void Insert(CUnit &unit)
Insert new unit into cache.
Definition: unit_cache.cpp:52
MapMarkerFunc MapUnmarkTileRadarJammer
Unmark a tile as jammed, decrease is jamming'ness.
int PlayerSide[PlayerMax]
Same player->Type.
Definition: map.h:145
bool isInitialized() const
Definition: map.h:185
void SetTile(unsigned int tile, const Vec2i &pos, int value=0)
Set a tile.
Definition: script_map.cpp:753
MapMarkerFunc MapUnmarkTileSight
Unmark a tile for normal sight.
CMapField * Fields
Definition: map.h:268
bool UnitTypeCanBeAt(const CUnitType &type, const Vec2i &pos)
Returns true, if the unit-type can enter the field.
Definition: map.cpp:252
ENUM_CLASS MapRevealModes
Definition: settings.h:209
void SetWall(const Vec2i &pos, bool humanwall)
Set wall on field.
Definition: map_wall.cpp:241
void MapUnmarkUnitSight(CUnit &unit)
Unmark on vision table the Sight of the unit.
Definition: unit.cpp:901
bool CheckedCanMoveToMask(const Vec2i &pos, int mask)
Returns true, if the unit-type(mask can enter field with bounds check.
Definition: map.cpp:239
w
Definition: update-images.py:53
MapMarkerFunc MapUnmarkTileRadar
Unmark a tile as radar visible, decrease is visible by other radar.
void MapCclRegister()
register ccl features
Definition: script_map.cpp:1000
bool CheckMask(int mask) const
Check if a field flags.
Definition: mapfield.cpp:256
ENUM_CLASS cKnown
Definition: settings.h:210
int ForestRegenerationFrequency
Forest regeneration.
Definition: map.cpp:59
~CMap()
Definition: map.cpp:325
bool OrcWallOnMap(const Vec2i &pos) const
Returns true, if orc wall on the map tile field.
Definition: map.cpp:225
unsigned int getIndex(int x, int y) const
Definition: map.h:162
bool UnitCanBeAt(const CUnit &unit, const Vec2i &pos)
Returns true, if the unit can enter the field.
Definition: map.cpp:279
Describes the world map.
Definition: map.h:154
void ClearTile(const Vec2i &tilePos)
Remove wood, rock or wall from the map and update nearby unit's vision if needed.
Definition: map.cpp:551
std::string TileModelsFileName
tileset data
Definition: map.h:272
CMapInfo Info
Definition: map.h:276
bool IsPointOnMap(int x, int y) const
Definition: map.h:125
bool IsPointOnMap(const Vec2i &pos) const
Definition: map.h:130
CMapField * Field(const Vec2i &pos) const
Definition: map.h:180
int MapHeight
Map width.
Definition: map.h:143
CGraphic * TileGraphic
lua filename that loads all tilemodels
Definition: map.h:273
T x
Definition: vec2i.h:42
MapMarkerFunc MapMarkTileDetectCloak
Mark a tile for cloak detection.
CTileset * Tileset
fog of war disabled
Definition: map.h:271
void MapMarkRadarJammer(const CPlayer &player, const CUnit &unit, const Vec2i &pos, int w, int h, int range)
Handle Marking and Unmarking of radar vision.
Definition: map.h:417
std::string Filename
Map description.
Definition: map.h:139
void MapFixSeenWallTile(const Vec2i &pos)
Correct the seen wall field, depending on the surrounding.
Definition: map_wall.cpp:124
void UpdateFogOfWarChange()
Update fog of war.
Definition: map_fog.cpp:355
h
Definition: update-images.py:53
void FixSelectionArea(Vec2i &minpos, Vec2i &maxpos)
Definition: map.h:244
bool HumanWallOnMap(const Vec2i &pos) const
Returns true, if human wall on the map tile field.
Definition: map.cpp:212
PixelPos TilePosToMapPixelPos_TopLeft(const Vec2i &tilePos) const
convert tilepos coordonates into map pixel pos (take the top left of the tile)
Definition: map.cpp:180
Tileset definition.
Definition: tileset.h:126
Describes a field of the map.
Definition: tile.h:186
bool isMapInitialized
graphic for all the tiles
Definition: map.h:274
ENUM_CLASS PlayerTypes
Special: Use map supplied.
Definition: settings.h:118
CMap Map
Definition: map.cpp:55
The big unit structure.
Definition: unit.h:135
unsigned int MapUID
Same player->Side.
Definition: map.h:146
void PreprocessMap()
Preprocess map, for internal use.
Definition: map.cpp:288
void MapUnmarkRadar(const CPlayer &player, const CUnit &unit, const Vec2i &pos, int w, int h, int range)
Definition: map.h:412
void MapRefreshUnitsSight(const Vec2i &tilePos, const bool resetSight=false)
Mark/Unmark on vision table the Sight for the units around the tilePos.
Definition: unit.cpp:934
(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.