_________ __ __
/ _____// |_____________ _/ |______ ____ __ __ ______
\_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
/ \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \
/_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
\/ \/ \//_____/ \/
______________________ ______________________
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.
85 return this->FogSurface;
103 void Restrict(
int &screenPosX,
int &screenPosY)
const;
108 return CViewport::ShowGrid;
113 CViewport::ShowGrid = value;
124 void DrawMapGridInViewport()
const;
126 void DrawMapBackgroundInViewport()
const;
128 void DrawMapFogOfWar();
130 void AdjustFogSurface();
147 SDL_Surface *FogSurface {
nullptr };
148 static bool ShowGrid;
const PixelPos & GetBottomRightPos() const
Definition: viewport.h:119
int MapHeight
Width in map tiles.
Definition: viewport.h:143
void Set(const Vec2i &tilePos, const PixelDiff &offset)
Set the current map view to x,y(upper,left corner)
Definition: map_draw.cpp:202
PixelPos BottomRightPos
Screen pixel top-left corner.
Definition: viewport.h:137
int MapWidth
Offset within MapX, MapY.
Definition: viewport.h:142
CViewport()
Definition: map_draw.cpp:52
SDL_Surface * GetFogSurface()
Definition: viewport.h:84
void SetClipping() const
Definition: map_draw.cpp:83
static bool isGridEnabled()
Definition: viewport.h:106
bool IsInsideMapArea(const PixelPos &screenPixelPos) const
Check if pos pixels are within map area.
Definition: map_draw.cpp:109
PixelPos TilePosToScreen_TopLeft(const Vec2i &tilePos) const
convert tilepos coordonates into screen (take the top left of the tile)
Definition: map_draw.cpp:143
bool Contains(const PixelPos &screenPos) const
Definition: map_draw.cpp:65
Definition: viewport.h:63
bool AnyMapAreaVisibleInViewport(const Vec2i &boxmin, const Vec2i &boxmax) const
Check if any part of an area is visible in viewport.
Definition: map_draw.cpp:96
PixelSize GetPixelSize() const
Definition: map_draw.cpp:78
void DrawBorder() const
Definition: map_draw.cpp:529
void Restrict(int &screenPosX, int &screenPosY) const
Definition: map_draw.cpp:72
static void EnableGrid(const bool value)
Definition: viewport.h:111
PixelPos TilePosToScreen_Center(const Vec2i &tilePos) const
convert tilepos coordonates into screen (take the center of the tile)
Definition: map_draw.cpp:151
PixelPos ScreenToMapPixelPos(const PixelPos &screenPixelPos) const
Convert screen coordinates into map pixel coordinates.
Definition: map_draw.cpp:117
PixelDiff Offset
Map tile left-upper corner.
Definition: viewport.h:141
CUnit * Unit
Height in map tiles.
Definition: viewport.h:145
PixelPos MapToScreenPixelPos(const PixelPos &mapPixelPos) const
Definition: map_draw.cpp:126
void Clean()
Definition: map_fog.cpp:442
Vec2i MapPos
Screen pixel bottom-right corner.
Definition: viewport.h:140
Vec2i ScreenToTilePos(const PixelPos &screenPixelPos) const
convert screen coordinate into tilepos
Definition: map_draw.cpp:134
~CViewport()
Definition: map_draw.cpp:60
void Center(const PixelPos &mapPixelPos)
Center map on point in viewport.
Definition: map_draw.cpp:214
PixelPos TopLeftPos
Definition: viewport.h:136
The big unit structure.
Definition: unit.h:135
void Draw()
Draw the full Viewport.
Definition: map_draw.cpp:382
const PixelPos & GetTopLeftPos() const
Definition: viewport.h:118
(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.