_________ __ __
/ _____// |_____________ _/ |______ ____ __ __ ______
\_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
/ \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \
/_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
\/ \/ \//_____/ \/
______________________ ______________________
T H E W A R B E G I N S
Stratagus - A free fantasy real time strategy game engine
Select algorithm for field of view. More...
#include <fov.h>
Public Member Functions | |
| void | Clean () |
fov.cpp - The field of view handling. | |
| void | Refresh (const CPlayer &player, const CUnit &unit, const Vec2i &pos, const uint16_t width, const uint16_t height, const uint16_t range, MapMarkerFunc *marker) |
| Refresh field of view. More... | |
| bool | SetType (const FieldOfViewTypes fov_type) |
| FieldOfViewTypes | GetType () const |
| void | SetOpaqueFields (const uint16_t flags) |
| Set opaque map field flags (which fields will be opaque) More... | |
| uint16_t | GetOpaqueFields () const |
| void | ResetAdditionalOpaqueFields () |
| Reset opaque flags to default (MapFieldOpaque) More... | |
Select algorithm for field of view.
|
inline |
| uint16_t CFieldOfView::GetOpaqueFields | ( | ) | const |
Returns current set of opaque map field flags
| FieldOfViewTypes CFieldOfView::GetType | ( | ) | const |
Returns used type of Field of View
| void CFieldOfView::Refresh | ( | const CPlayer & | player, |
| const CUnit & | unit, | ||
| const Vec2i & | pos, | ||
| const uint16_t | width, | ||
| const uint16_t | height, | ||
| const uint16_t | range, | ||
| MapMarkerFunc * | marker | ||
| ) |
Refresh field of view.
Refresh the whole field of view for unit (Explore and make visible.)
| player | player to mark the sight for |
| unit | unit to mark the sight for |
| pos | location to mark |
| width | width to mark, in square |
| height | height to mark, in square |
| range | Radius to mark. |
| marker | Function to mark or unmark sight |
FIXME: sometimes when quit from game this assert is triggered
FIXME: add high-/lowground
because of rocks-flag is used as an obstacle for ranged attackers
| void CFieldOfView::ResetAdditionalOpaqueFields | ( | ) |
Reset opaque flags to default (MapFieldOpaque)
Reset opaque map field flags to default (MapfieldOpaque)
| void CFieldOfView::SetOpaqueFields | ( | const uint16_t | flags | ) |
Set opaque map field flags (which fields will be opaque)
Set additional opaque map field flags (which terrains will be opaque)
| flags | Terrain flags to set as opaque (MapField*) |
Unmark sight for all units
Mark sight with new fov type for all units
| bool CFieldOfView::SetType | ( | const FieldOfViewTypes | fov_type | ) |
Select which type of Field of View to use
| fov_type | type to set |
Unmark sight for all units
Mark sight with new fov type for all units
1.8.17
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.