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

Classes
map_fog.cpp File Reference
#include <queue>
#include "stratagus.h"
#include "map.h"
#include "actions.h"
#include "fov.h"
#include "minimap.h"
#include "player.h"
#include "tileset.h"
#include "ui.h"
#include "unit.h"
#include "unit_manager.h"
#include "video.h"
#include "../video/intern_video.h"
#include "st_backtrace.h"

Classes

class  _filter_flags
 
class  _TileSeen< MARK >
 

map_fog.cpp - The map fog of war handling.

CFieldOfView FieldOfView
 
int MapFogFilterFlags (CPlayer &player, const unsigned int index, int mask)
 
int MapFogFilterFlags (CPlayer &player, const Vec2i &pos, int mask)
 Filter map flags through fog. More...
 
static void UnitsOnTileMarkSeen (const CPlayer &player, CMapField &mf, int cloak)
 
static void UnitsOnTileUnmarkSeen (const CPlayer &player, CMapField &mf, int cloak)
 
void MapMarkTileSight (const CPlayer &player, const unsigned int index)
 
void MapMarkTileSight (const CPlayer &player, const Vec2i &pos)
 
void MapUnmarkTileSight (const CPlayer &player, const unsigned int index)
 
void MapUnmarkTileSight (const CPlayer &player, const Vec2i &pos)
 
void MapMarkTileDetectCloak (const CPlayer &player, const unsigned int index)
 
void MapMarkTileDetectCloak (const CPlayer &player, const Vec2i &pos)
 
void MapUnmarkTileDetectCloak (const CPlayer &player, const unsigned int index)
 
void MapUnmarkTileDetectCloak (const CPlayer &player, const Vec2i &pos)
 
void MapSight (const CPlayer &player, const CUnit &unit, const Vec2i &pos, int w, int h, int range, MapMarkerFunc *marker)
 Mark sight changes. More...
 
void UpdateFogOfWarChange ()
 Update fog of war. More...
 

Function Documentation

◆ MapFogFilterFlags() [1/2]

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

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

Parameters
playerplayer who is doing operation
indexmap location
maskinput mask to filter
Returns
Filtered mask after taking fog into account

◆ MapFogFilterFlags() [2/2]

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

Filter map flags through fog.

◆ MapMarkTileDetectCloak() [1/2]

void MapMarkTileDetectCloak ( const CPlayer player,
const unsigned int  index 
)

Mark a tile for cloak detection.

Parameters
playerPlayer to mark sight.
indexTile to mark.

◆ MapMarkTileDetectCloak() [2/2]

void MapMarkTileDetectCloak ( const CPlayer player,
const Vec2i pos 
)

◆ MapMarkTileSight() [1/2]

void MapMarkTileSight ( const CPlayer player,
const unsigned int  index 
)

Mark a tile's sight. (Explore and make visible.)

Parameters
playerPlayer to mark sight.
indextile to mark.

◆ MapMarkTileSight() [2/2]

void MapMarkTileSight ( const CPlayer player,
const Vec2i pos 
)

◆ MapSight()

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

Mark sight changes.

Mark the sight of unit. (Explore and make visible.)

Parameters
playerplayer to mark the sight for (not unit owner)
poslocation to mark
wwidth to mark, in square
hheight to mark, in square
rangeRadius to mark.
markerFunction to mark or unmark sight

◆ MapUnmarkTileDetectCloak() [1/2]

void MapUnmarkTileDetectCloak ( const CPlayer player,
const unsigned int  index 
)

Unmark a tile for cloak detection.

Parameters
playerPlayer to mark sight.
indextile to mark.

Assert(*v != 0); This could happen if shadow caster type of field of view is enabled, because of multiple calls for tiles in vertical/horizontal/diagonal lines

◆ MapUnmarkTileDetectCloak() [2/2]

void MapUnmarkTileDetectCloak ( const CPlayer player,
const Vec2i pos 
)

◆ MapUnmarkTileSight() [1/2]

void MapUnmarkTileSight ( const CPlayer player,
const unsigned int  index 
)

Unmark a tile's sight. (Explore and make visible.)

Parameters
playerPlayer to mark sight.
indexxtile to mark.

TODO: change ThisPlayer to currently rendered player/players #RenderTargets

◆ MapUnmarkTileSight() [2/2]

void MapUnmarkTileSight ( const CPlayer player,
const Vec2i pos 
)

◆ UnitsOnTileMarkSeen()

static void UnitsOnTileMarkSeen ( const CPlayer player,
CMapField mf,
int  cloak 
)
static

Mark all units on a tile as now visible.

Parameters
playerThe player this is for.
mffield location to check
cloakIf we mark cloaked units too.

◆ UnitsOnTileUnmarkSeen()

static void UnitsOnTileUnmarkSeen ( const CPlayer player,
CMapField mf,
int  cloak 
)
static

This function unmarks units on x, y as seen. It uses a reference count.

Parameters
playerThe player to mark for.
mffield to check if building is on, and mark as seen
cloakIf this is for cloaked units.

◆ UpdateFogOfWarChange()

void UpdateFogOfWarChange ( )

Update fog of war.

Update fog of war.

Variable Documentation

◆ FieldOfView

CFieldOfView FieldOfView
(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.