Otclient  14/8/2020
MapView Class Reference

#include <mapview.h>

Inheritance diagram for MapView:
Collaboration diagram for MapView:

Public Types

enum  ViewMode { NEAR_VIEW, MID_VIEW, FAR_VIEW, HUGE_VIEW }
 

Public Member Functions

 MapView ()
 
 ~MapView ()
 
void draw (const Rect &rect)
 
void lockFirstVisibleFloor (int firstVisibleFloor)
 
void unlockFirstVisibleFloor ()
 
int getLockedFirstVisibleFloor ()
 
void setMultifloor (bool enable)
 
bool isMultifloor ()
 
void setVisibleDimension (const Size &visibleDimension)
 
Size getVisibleDimension ()
 
int getTileSize ()
 
Point getVisibleCenterOffset ()
 
int getCachedFirstVisibleFloor ()
 
int getCachedLastVisibleFloor ()
 
void setViewMode (ViewMode viewMode)
 
ViewMode getViewMode ()
 
void optimizeForSize (const Size &visibleSize)
 
void setAutoViewMode (bool enable)
 
bool isAutoViewModeEnabled ()
 
void followCreature (const CreaturePtr &creature)
 
CreaturePtr getFollowingCreature ()
 
bool isFollowingCreature ()
 
void setCameraPosition (const Position &pos)
 
Position getCameraPosition ()
 
void setMinimumAmbientLight (float intensity)
 
float getMinimumAmbientLight ()
 
void setDrawFlags (Otc::DrawFlags drawFlags)
 
Otc::DrawFlags getDrawFlags ()
 
void setDrawTexts (bool enable)
 
bool isDrawingTexts ()
 
void setDrawNames (bool enable)
 
bool isDrawingNames ()
 
void setDrawHealthBars (bool enable)
 
bool isDrawingHealthBars ()
 
void setDrawLights (bool enable)
 
bool isDrawingLights ()
 
void setDrawManaBar (bool enable)
 
bool isDrawingManaBar ()
 
void move (int x, int y)
 
void setAnimated (bool animated)
 
bool isAnimating ()
 
void setAddLightMethod (bool add)
 
void setShader (const PainterShaderProgramPtr &shader, float fadein, float fadeout)
 
PainterShaderProgramPtr getShader ()
 
Position getPosition (const Point &point, const Size &mapSize)
 
MapViewPtr asMapView ()
 
- Public Member Functions inherited from LuaObject
 LuaObject ()
 
virtual ~LuaObject ()
 
template<typename T >
void connectLuaField (const std::string &field, const std::function< T > &f, bool pushFront=false)
 
template<typename... T>
int luaCallLuaField (const std::string &field, const T &... args)
 
template<typename R , typename... T>
callLuaField (const std::string &field, const T &... args)
 
template<typename... T>
void callLuaField (const std::string &field, const T &... args)
 
bool hasLuaField (const std::string &field)
 Returns true if the lua field exists. More...
 
template<typename T >
void setLuaField (const std::string &key, const T &value)
 Sets a field in this lua object. More...
 
template<typename T >
getLuaField (const std::string &key)
 Gets a field from this lua object. More...
 
void releaseLuaFieldsTable ()
 Release fields table reference. More...
 
void luaSetField (const std::string &key)
 Sets a field from this lua object, the value must be on the stack. More...
 
void luaGetField (const std::string &key)
 Gets a field from this lua object, the result is pushed onto the stack. More...
 
void luaGetMetatable ()
 Get object's metatable. More...
 
void luaGetFieldsTable ()
 Gets the table containing all stored fields of this lua object, the result is pushed onto the stack. More...
 
int getUseCount ()
 
std::string getClassName ()
 Returns the derived class name, its the same name used in Lua. More...
 
LuaObjectPtr asLuaObject ()
 
void operator= (const LuaObject &)
 
- Public Member Functions inherited from stdext::shared_object
 shared_object ()
 
virtual ~shared_object ()
 
void add_ref ()
 
void dec_ref ()
 
refcount_t ref_count ()
 
template<typename T >
stdext::shared_object_ptr< T > static_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > dynamic_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > const_self_cast ()
 

Protected Member Functions

void onTileUpdate (const Position &pos)
 
void onMapCenterChange (const Position &pos)
 

Friends

class Map
 

Detailed Description

Definition at line 34 of file mapview.h.

Member Enumeration Documentation

◆ ViewMode

Enumerator
NEAR_VIEW 
MID_VIEW 
FAR_VIEW 
HUGE_VIEW 

Definition at line 37 of file mapview.h.

Constructor & Destructor Documentation

◆ MapView()

MapView::MapView ( )

Definition at line 53 of file mapview.cpp.

Here is the call graph for this function:

◆ ~MapView()

MapView::~MapView ( )

Definition at line 71 of file mapview.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ asMapView()

MapViewPtr MapView::asMapView ( )
inline

Definition at line 126 of file mapview.h.

◆ draw()

void MapView::draw ( const Rect rect)

Definition at line 78 of file mapview.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ followCreature()

void MapView::followCreature ( const CreaturePtr creature)

Definition at line 540 of file mapview.cpp.

Here is the caller graph for this function:

◆ getCachedFirstVisibleFloor()

int MapView::getCachedFirstVisibleFloor ( )
inline

Definition at line 73 of file mapview.h.

Here is the caller graph for this function:

◆ getCachedLastVisibleFloor()

int MapView::getCachedLastVisibleFloor ( )
inline

Definition at line 74 of file mapview.h.

◆ getCameraPosition()

Position MapView::getCameraPosition ( )

Definition at line 708 of file mapview.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDrawFlags()

Otc::DrawFlags MapView::getDrawFlags ( )
inline

Definition at line 97 of file mapview.h.

Here is the caller graph for this function:

◆ getFollowingCreature()

CreaturePtr MapView::getFollowingCreature ( )
inline

Definition at line 86 of file mapview.h.

Here is the caller graph for this function:

◆ getLockedFirstVisibleFloor()

int MapView::getLockedFirstVisibleFloor ( )
inline

Definition at line 63 of file mapview.h.

◆ getMinimumAmbientLight()

float MapView::getMinimumAmbientLight ( )
inline

Definition at line 93 of file mapview.h.

Here is the caller graph for this function:

◆ getPosition()

Position MapView::getPosition ( const Point point,
const Size mapSize 
)

Definition at line 554 of file mapview.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getShader()

PainterShaderProgramPtr MapView::getShader ( )
inline

Definition at line 122 of file mapview.h.

Here is the caller graph for this function:

◆ getTileSize()

int MapView::getTileSize ( )
inline

Definition at line 71 of file mapview.h.

◆ getViewMode()

ViewMode MapView::getViewMode ( )
inline

Definition at line 78 of file mapview.h.

Here is the caller graph for this function:

◆ getVisibleCenterOffset()

Point MapView::getVisibleCenterOffset ( )
inline

Definition at line 72 of file mapview.h.

Here is the caller graph for this function:

◆ getVisibleDimension()

Size MapView::getVisibleDimension ( )
inline

Definition at line 70 of file mapview.h.

Here is the caller graph for this function:

◆ isAnimating()

bool MapView::isAnimating ( )
inline

Definition at line 117 of file mapview.h.

Here is the caller graph for this function:

◆ isAutoViewModeEnabled()

bool MapView::isAutoViewModeEnabled ( )
inline

Definition at line 82 of file mapview.h.

Here is the caller graph for this function:

◆ isDrawingHealthBars()

bool MapView::isDrawingHealthBars ( )
inline

Definition at line 106 of file mapview.h.

Here is the caller graph for this function:

◆ isDrawingLights()

bool MapView::isDrawingLights ( )
inline

Definition at line 109 of file mapview.h.

Here is the caller graph for this function:

◆ isDrawingManaBar()

bool MapView::isDrawingManaBar ( )
inline

Definition at line 112 of file mapview.h.

Here is the caller graph for this function:

◆ isDrawingNames()

bool MapView::isDrawingNames ( )
inline

Definition at line 103 of file mapview.h.

Here is the caller graph for this function:

◆ isDrawingTexts()

bool MapView::isDrawingTexts ( )
inline

Definition at line 100 of file mapview.h.

Here is the caller graph for this function:

◆ isFollowingCreature()

bool MapView::isFollowingCreature ( )
inline

Definition at line 87 of file mapview.h.

Here is the caller graph for this function:

◆ isMultifloor()

bool MapView::isMultifloor ( )
inline

Definition at line 66 of file mapview.h.

Here is the caller graph for this function:

◆ lockFirstVisibleFloor()

void MapView::lockFirstVisibleFloor ( int  firstVisibleFloor)

Definition at line 492 of file mapview.cpp.

Here is the caller graph for this function:

◆ move()

void MapView::move ( int  x,
int  y 
)

Definition at line 581 of file mapview.cpp.

Here is the caller graph for this function:

◆ onMapCenterChange()

void MapView::onMapCenterChange ( const Position pos)
protected

Definition at line 487 of file mapview.cpp.

◆ onTileUpdate()

void MapView::onTileUpdate ( const Position pos)
protected

Definition at line 482 of file mapview.cpp.

◆ optimizeForSize()

void MapView::optimizeForSize ( const Size visibleSize)

Definition at line 535 of file mapview.cpp.

◆ setAddLightMethod()

void MapView::setAddLightMethod ( bool  add)
inline

Definition at line 119 of file mapview.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAnimated()

void MapView::setAnimated ( bool  animated)
inline

Definition at line 116 of file mapview.h.

Here is the caller graph for this function:

◆ setAutoViewMode()

void MapView::setAutoViewMode ( bool  enable)

Definition at line 528 of file mapview.cpp.

Here is the caller graph for this function:

◆ setCameraPosition()

void MapView::setCameraPosition ( const Position pos)

Definition at line 547 of file mapview.cpp.

Here is the caller graph for this function:

◆ setDrawFlags()

void MapView::setDrawFlags ( Otc::DrawFlags  drawFlags)
inline

Definition at line 96 of file mapview.h.

Here is the caller graph for this function:

◆ setDrawHealthBars()

void MapView::setDrawHealthBars ( bool  enable)
inline

Definition at line 105 of file mapview.h.

Here is the caller graph for this function:

◆ setDrawLights()

void MapView::setDrawLights ( bool  enable)

Definition at line 735 of file mapview.cpp.

Here is the caller graph for this function:

◆ setDrawManaBar()

void MapView::setDrawManaBar ( bool  enable)
inline

Definition at line 111 of file mapview.h.

Here is the caller graph for this function:

◆ setDrawNames()

void MapView::setDrawNames ( bool  enable)
inline

Definition at line 102 of file mapview.h.

Here is the caller graph for this function:

◆ setDrawTexts()

void MapView::setDrawTexts ( bool  enable)
inline

Definition at line 99 of file mapview.h.

Here is the caller graph for this function:

◆ setMinimumAmbientLight()

void MapView::setMinimumAmbientLight ( float  intensity)
inline

Definition at line 92 of file mapview.h.

Here is the caller graph for this function:

◆ setMultifloor()

void MapView::setMultifloor ( bool  enable)
inline

Definition at line 65 of file mapview.h.

Here is the caller graph for this function:

◆ setShader()

void MapView::setShader ( const PainterShaderProgramPtr shader,
float  fadein,
float  fadeout 
)

Definition at line 716 of file mapview.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setViewMode()

void MapView::setViewMode ( MapView::ViewMode  viewMode)

Definition at line 522 of file mapview.cpp.

Here is the caller graph for this function:

◆ setVisibleDimension()

void MapView::setVisibleDimension ( const Size visibleDimension)

Definition at line 504 of file mapview.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unlockFirstVisibleFloor()

void MapView::unlockFirstVisibleFloor ( )

Definition at line 498 of file mapview.cpp.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ Map

friend class Map
friend

Definition at line 57 of file mapview.h.


The documentation for this class was generated from the following files: