$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

src/include/map.h File Reference

#include <string>
#include <vector>
#include <algorithm>
#include "unit_cache.h"
#include "iocompat.h"
#include "tileset.h"
#include "player.h"
#include "vec2i.h"

Go to the source code of this file.


Classes

class  CMapInfo
class  CMap
 Describes the world map. More...

map.h - The map headerfile.

#define MaxMapWidth   256
#define MaxMapHeight   256
#define MapFieldSpeedMask   0x0007
#define MapFieldHuman   0x0008
#define MapFieldLandAllowed   0x0010
#define MapFieldCoastAllowed   0x0020
#define MapFieldWaterAllowed   0x0040
#define MapFieldNoBuilding   0x0080
#define MapFieldUnpassable   0x0100
#define MapFieldLandUnit   0x1000
#define MapFieldAirUnit   0x2000
#define MapFieldSeaUnit   0x4000
#define MapFieldBuilding   0x8000
#define MARKER_ON_INDEX
CMap Map
char CurrentMapPath [1024]
 The current map.
int FogOfWarOpacity
 Path to the current map.
int FogOfWarColor [3]
 RGB triplet (0-255) of fog of war color.
int ForestRegeneration
 Forest regeneration.
int FlagRevealMap
 Flag must reveal the map.
int ReplayRevealMap
 Flag must reveal map when in replay.
MapMarkerFunc MapMarkTileSight
 Mark a tile for normal sight.
MapMarkerFunc MapUnmarkTileSight
 Unmark a tile for normal sight.
MapMarkerFunc MapMarkTileDetectCloak
 Mark a tile for cloak detection.
MapMarkerFunc MapUnmarkTileDetectCloak
 Unmark a tile for cloak detection.
MapMarkerFunc MapMarkTileRadar
 Mark a tile as radar visible, or incrase radar vision.
MapMarkerFunc MapUnmarkTileRadar
 Unmark a tile as radar visible, decrease is visible by other radar.
MapMarkerFunc MapMarkTileRadarJammer
 Mark a tile as radar jammed, or incrase radar jamming'ness.
MapMarkerFunc MapUnmarkTileRadarJammer
 Unmark a tile as jammed, decrease is jamming'ness.
typedef void MapMarkerFunc (const CPlayer &player, const unsigned int index)
 Function to (un)mark the vision table.
int MapFogFilterFlags (CPlayer &player, const Vec2i &pos, int mask)
 Filter map flags through fog.
int MapFogFilterFlags (CPlayer &player, const unsigned int index, int mask)
void MapSight (const CPlayer &player, const Vec2i &pos, int w, int h, int range, MapMarkerFunc *marker)
 Mark sight changes.
void UpdateFogOfWarChange ()
 Update fog of war.
void MapFixSeenWallTile (const Vec2i &pos)
 Correct the seen wall field, depending on the surrounding.
void MapFixSeenWallNeighbors (const Vec2i &pos)
 Correct the surrounding seen wall fields.
void MapFixWallTile (const Vec2i &pos)
 Correct the real wall field, depending on the surrounding.
void SetTile (int tile, const Vec2i &pos, int value=0)
 Set a tile.
void SetTile (int tile, int x, int y, int value=0)
void MapCclRegister ()
 register ccl features
int SaveStratagusMap (const std::string &filename, CMap &map, int writeTerrain)
 Save a stratagus map (smp format).
void LoadStratagusMapInfo (const std::string &mapname)
 Load map presentation.
bool CheckedCanMoveToMask (const Vec2i &pos, int mask)
 Returns true, if the unit-type(mask can enter field with bounds check.
bool UnitTypeCanBeAt (const CUnitType &type, const Vec2i &pos)
 Returns true, if the unit-type can enter the field.
bool UnitCanBeAt (const CUnit &unit, const Vec2i &pos)
 Returns true, if the unit can enter the field.
void PreprocessMap ()
 Preprocess map, for internal use.
void MapMarkUnitSight (CUnit &unit)
 Mark on vision table the Sight of the unit.
void MapUnmarkUnitSight (CUnit &unit)
 Unmark on vision table the Sight of the unit.
void MapMarkUnitGuard (CUnit &unit)
void MapUnmarkUnitGuard (CUnit &unit)
bool CanMoveToMask (const Vec2i &pos, int mask)
 Can a unit with 'mask' enter the field.
void MapMarkRadar (const CPlayer &player, const Vec2i &pos, int w, int h, int range)
 Handle Marking and Unmarking of radar vision.
void MapUnmarkRadar (const CPlayer &player, const Vec2i &pos, int w, int h, int range)
void MapMarkRadarJammer (const CPlayer &player, const Vec2i &pos, int w, int h, int range)
 Handle Marking and Unmarking of radar vision.
void MapUnmarkRadarJammer (const CPlayer &player, const Vec2i &pos, int w, int h, int range)

Define Documentation

#define MapFieldAirUnit   0x2000

#define MapFieldBuilding   0x8000

#define MapFieldCoastAllowed   0x0020

#define MapFieldHuman   0x0008

#define MapFieldLandAllowed   0x0010

#define MapFieldLandUnit   0x1000

#define MapFieldNoBuilding   0x0080

#define MapFieldSeaUnit   0x4000

#define MapFieldSpeedMask   0x0007

#define MapFieldUnpassable   0x0100

#define MapFieldWaterAllowed   0x0040

#define MARKER_ON_INDEX

#define MaxMapHeight   256

#define MaxMapWidth   256


Typedef Documentation

typedef void MapMarkerFunc(const CPlayer &player, const unsigned int index)

Function to (un)mark the vision table.


Function Documentation

bool CanMoveToMask ( const Vec2i pos,
int  mask 
) [inline]

Can a unit with 'mask' enter the field.

bool CheckedCanMoveToMask ( const Vec2i pos,
int  mask 
)

Returns true, if the unit-type(mask can enter field with bounds check.

void LoadStratagusMapInfo ( const std::string &  mapname  ) 

Load map presentation.

Load the map presentation

Parameters:
mapname map filename

void MapCclRegister (  ) 

register ccl features

Register CCL features for map.

void MapFixSeenWallNeighbors ( const Vec2i pos  ) 

Correct the surrounding seen wall fields.

void MapFixSeenWallTile ( const Vec2i pos  ) 

Correct the seen wall field, depending on the surrounding.

void MapFixWallTile ( const Vec2i pos  ) 

Correct the real wall field, depending on the surrounding.

int MapFogFilterFlags ( CPlayer player,
const unsigned int  index,
int  mask 
)

Find out what the tile flags are a tile is covered by fog

Parameters:
player player who is doing operation
x X map location
y Y map location
mask input mask to filter
Returns:
Filtered mask after taking fog into account

int MapFogFilterFlags ( CPlayer player,
const Vec2i pos,
int  mask 
)

Filter map flags through fog.

void MapMarkRadar ( const CPlayer player,
const Vec2i pos,
int  w,
int  h,
int  range 
) [inline]

Handle Marking and Unmarking of radar vision.

void MapMarkRadarJammer ( const CPlayer player,
const Vec2i pos,
int  w,
int  h,
int  range 
) [inline]

Handle Marking and Unmarking of radar vision.

void MapMarkUnitGuard ( CUnit unit  ) 

void MapMarkUnitSight ( CUnit unit  ) 

Mark on vision table the Sight of the unit.

Mark on vision table the Sight of the unit (and units inside for transporter)

Parameters:
unit unit to unmark its vision.
See also:
MapUnmarkUnitSight.

void MapSight ( const CPlayer player,
const Vec2i pos,
int  w,
int  h,
int  range,
MapMarkerFunc marker 
)

Mark sight changes.

void MapUnmarkRadar ( const CPlayer player,
const Vec2i pos,
int  w,
int  h,
int  range 
) [inline]

void MapUnmarkRadarJammer ( const CPlayer player,
const Vec2i pos,
int  w,
int  h,
int  range 
) [inline]

void MapUnmarkUnitGuard ( CUnit unit  ) 

void MapUnmarkUnitSight ( CUnit unit  ) 

Unmark on vision table the Sight of the unit.

Unmark on vision table the Sight of the unit (and units inside for transporter)

Parameters:
unit unit to unmark its vision.
See also:
MapMarkUnitSight.

void PreprocessMap (  ) 

Preprocess map, for internal use.

Fixes initially the wood and seen tiles.

int SaveStratagusMap ( const std::string &  mapName,
CMap map,
int  writeTerrain 
)

Save a stratagus map (smp format).

Save a Stratagus map.

Parameters:
mapName map filename
map map to save
writeTerrain write the tiles map in the .sms

void SetTile ( int  tile,
int  x,
int  y,
int  value = 0 
) [inline]

void SetTile ( int  tile,
const Vec2i pos,
int  value = 0 
)

Set a tile.

bool UnitCanBeAt ( const CUnit unit,
const Vec2i pos 
)

Returns true, if the unit can enter the field.

bool UnitTypeCanBeAt ( const CUnitType type,
const Vec2i pos 
)

Returns true, if the unit-type can enter the field.

void UpdateFogOfWarChange (  ) 

Update fog of war.

Update fog of war.


Variable Documentation

char CurrentMapPath[1024]

The current map.

Flag must reveal the map.

int FogOfWarColor[3]

RGB triplet (0-255) of fog of war color.

Path to the current map.

Contrast of fog of war

Forest regeneration.

MapMarkerFunc MapMarkTileDetectCloak

Mark a tile for cloak detection.

MapMarkerFunc MapMarkTileRadar

Mark a tile as radar visible, or incrase radar vision.

MapMarkerFunc MapMarkTileRadarJammer

Mark a tile as radar jammed, or incrase radar jamming'ness.

MapMarkerFunc MapMarkTileSight

Mark a tile for normal sight.

MapMarkerFunc MapUnmarkTileDetectCloak

Unmark a tile for cloak detection.

MapMarkerFunc MapUnmarkTileRadar

Unmark a tile as radar visible, decrease is visible by other radar.

MapMarkerFunc MapUnmarkTileRadarJammer

Unmark a tile as jammed, decrease is jamming'ness.

MapMarkerFunc MapUnmarkTileSight

Unmark a tile for normal sight.

Flag must reveal map when in replay.

(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.