ManaPlus
Public Member Functions | Data Fields | Protected Member Functions | Static Protected Member Functions | Private Member Functions | Private Attributes | Friends
Viewport Class Reference

#include <viewport.h>

Inheritance diagram for Viewport:
WindowContainer MouseListener ConfigListener Container BasicContainer2 BasicContainer Widget WidgetDeathListener Widget2

Public Member Functions

 Viewport ()
 
 ~Viewport ()
 
void setMap (Map *const map)
 
void draw (Graphics *const graphics)
 
void safeDraw (Graphics *const graphics)
 
void logic ()
 
void toggleMapDrawType ()
 
void toggleCameraMode ()
 
void mousePressed (MouseEvent &event)
 
void mouseDragged (MouseEvent &event)
 
void mouseReleased (MouseEvent &event)
 
void mouseMoved (MouseEvent &event)
 
void optionChanged (const std::string &name)
 
int getCameraX () const
 
int getCameraY () const
 
void scrollBy (const int x, const int y)
 
void cleanHoverItems ()
 
MapgetMap () const
 
void moveCamera (const int dx, const int dy)
 
int getCameraRelativeX () const
 
int getCameraRelativeY () const
 
void setCameraRelativeX (const int n)
 
void setCameraRelativeY (const int n)
 
void videoResized ()
 
 Viewport ()
 
 ~Viewport ()
 
void setMap (Map *const map)
 
void draw (Graphics *const graphics)
 
void safeDraw (Graphics *const graphics)
 
void logic ()
 
void toggleMapDrawType ()
 
void toggleCameraMode ()
 
void mousePressed (MouseEvent &event)
 
void mouseDragged (MouseEvent &event)
 
void mouseReleased (MouseEvent &event)
 
void mouseMoved (MouseEvent &event)
 
void optionChanged (const std::string &name)
 
int getCameraX () const
 
int getCameraY () const
 
void scrollBy (const int x, const int y)
 
void cleanHoverItems ()
 
MapgetMap () const
 
void moveCamera (const int dx, const int dy)
 
int getCameraRelativeX () const
 
int getCameraRelativeY () const
 
void setCameraRelativeX (const int n)
 
void setCameraRelativeY (const int n)
 
void moveCameraToActor (const BeingId actorId, const int x, const int y)
 
void moveCameraToPosition (const int x, const int y)
 
void moveCameraRelative (const int x, const int y)
 
void returnCamera ()
 
void getMouseTile (int &destX, int &destY) const
 
void videoResized ()
 
- Public Member Functions inherited from WindowContainer
 WindowContainer (const Widget2 *const widget)
 
void slowLogic ()
 
void scheduleDelete (Widget *const widget)
 
void adjustAfterResize (const int oldScreenWidth, const int oldScreenHeight)
 
void moveWidgetAfter (Widget *const before, Widget *const widget)
 
- Public Member Functions inherited from Container
 Container (const Widget2 *const widget)
 
 ~Container ()
 
bool safeRemove (Widget *const widget)
 
void removeControls ()
 
- Public Member Functions inherited from BasicContainer2
 BasicContainer2 (const Widget2 *const widget)
 
 ~BasicContainer2 ()
 
void setOpaque (Opaque opaque)
 
bool isOpaque () const
 
virtual void add (Widget *const widget)
 
void addXY (Widget *const widget, const int x, const int y)
 
- Public Member Functions inherited from BasicContainer
 BasicContainer (const Widget2 *const widget)
 
 ~BasicContainer ()
 
void showWidgetPart (Widget *const widget, const Rect &area)
 
void moveToTop (Widget *const widget)
 
void moveToBottom (Widget *const widget)
 
Rect getChildrenArea ()
 
void focusNext ()
 
void focusPrevious ()
 
void setFocusHandler (FocusHandler *const focusHandler)
 
void setInternalFocusHandler (FocusHandler *const focusHandler)
 
WidgetgetWidgetAt (int x, int y)
 
void death (const Event &event)
 
WidgetfindFirstWidget (const std::set< Widget * > &list)
 
void add (Widget *const widget)
 
virtual void remove (Widget *const widget)
 
virtual void clear ()
 
- Public Member Functions inherited from Widget
 Widget (const Widget2 *const widget)
 
 ~Widget ()
 
virtual void drawFrame (Graphics *graphics)
 
virtual void safeDrawFrame (Graphics *graphics)
 
void setFrameSize (const unsigned int frameSize)
 
unsigned int getFrameSize () const
 
WidgetgetParent () const
 
void setWidth (const int width)
 
int getWidth () const
 
void setHeight (const int height)
 
int getHeight () const
 
void setSize (const int width, const int height)
 
void setX (const int x)
 
int getX () const
 
void setY (const int y)
 
int getY () const
 
void setPosition (const int x, const int y)
 
void setDimension (const Rect &dimension)
 
const RectgetDimension () const
 
void setFocusable (const bool focusable)
 
bool isFocusable () const
 
virtual bool isFocused () const
 
void setEnabled (const bool enabled)
 
bool isEnabled () const
 
void setVisible (Visible visible)
 
bool isVisible () const
 
void setBaseColor (const Color &color)
 
const ColorgetBaseColor () const
 
void setForegroundColor (const Color &color)
 
const ColorgetForegroundColor () const
 
void setBackgroundColor (const Color &color)
 
const ColorgetBackgroundColor () const
 
virtual void requestFocus ()
 
virtual void requestMoveToTop ()
 
virtual void requestMoveToBottom ()
 
FocusHandlergetFocusHandler ()
 
void addActionListener (ActionListener *const actionListener)
 
void removeActionListener (ActionListener *const actionListener)
 
void addDeathListener (WidgetDeathListener *const deathListener)
 
void removeDeathListener (WidgetDeathListener *const deathListener)
 
void addMouseListener (MouseListener *const mouseListener)
 
void removeMouseListener (MouseListener *const mouseListener)
 
void addKeyListener (KeyListener *const keyListener)
 
void removeKeyListener (KeyListener *const keyListener)
 
void addFocusListener (FocusListener *const focusListener)
 
void removeFocusListener (FocusListener *const focusListener)
 
void addWidgetListener (WidgetListener *const widgetListener)
 
void removeWidgetListener (WidgetListener *const widgetListener)
 
void setActionEventId (const std::string &actionEventId)
 
const std::string & getActionEventId () const
 
virtual void getAbsolutePosition (int &x, int &y) const
 
virtual void setParent (Widget *parent)
 
FontgetFont () const
 
void setFont (Font *const font)
 
virtual void fontChanged ()
 
bool isTabInEnabled () const
 
void setTabInEnabled (const bool enabled)
 
bool isTabOutEnabled () const
 
void setTabOutEnabled (const bool enabled)
 
void requestModalFocus ()
 
virtual void requestModalMouseInputFocus ()
 
virtual void releaseModalFocus ()
 
virtual void releaseModalMouseInputFocus ()
 
virtual bool isModalFocused () const
 
virtual bool isModalMouseInputFocused () const
 
const std::list< MouseListener * > & getMouseListeners () const A_CONST
 
const std::list< KeyListener * > & getKeyListeners () const A_CONST
 
const std::list< FocusListener * > & getFocusListeners () const A_CONST
 
virtual FocusHandlergetInternalFocusHandler ()
 
void setInternalFocusHandler (FocusHandler *const internalFocusHandler)
 
void setId (const std::string &id)
 
const std::string & getId () const
 
virtual void showPart (const Rect &rectangle)
 
bool isAllowLogic () const
 
void setMouseConsume (const bool b)
 
bool isMouseConsume () const
 
void setRedraw (const bool b)
 
virtual bool isSelectable () const
 
void setSelectable (const bool selectable)
 
void windowResized ()
 
virtual void postInit ()
 
- Public Member Functions inherited from Widget2
virtual ~Widget2 ()
 
const ColorgetThemeColor (const ThemeColorIdT type, const unsigned int alpha) const A_INLINE
 
const ColorgetThemeCharColor (const signed char c, bool &valid) const A_INLINE
 
virtual void setWidget2 (const Widget2 *const widget)
 
void setPalette (int palette)
 
void checkPalette ()
 
void setForegroundColor2 (const Color &color)
 
WidgetgetWindow () const
 
virtual void setWindow (Widget *const window)
 
- Public Member Functions inherited from WidgetDeathListener
virtual ~WidgetDeathListener ()
 
- Public Member Functions inherited from MouseListener
virtual ~MouseListener ()
 
virtual void mouseEntered (MouseEvent &event)
 
virtual void mouseExited (MouseEvent &event)
 
virtual void mouseClicked (MouseEvent &event)
 
virtual void mouseWheelMovedUp (MouseEvent &event)
 
virtual void mouseWheelMovedDown (MouseEvent &event)
 
- Public Member Functions inherited from ConfigListener
 ConfigListener ()
 
virtual ~ConfigListener ()
 

Data Fields

int mMouseX
 
int mMouseY
 
- Data Fields inherited from Widget
Visible mVisible
 

Protected Member Functions

void clearHover (const ActorSprite *const actor)
 Clears any matching hovers. More...
 
void updateMidVars ()
 
void updateMaxVars ()
 
- Protected Member Functions inherited from BasicContainer
virtual void drawChildren (Graphics *const graphics)
 
virtual void safeDrawChildren (Graphics *const graphics)
 
virtual void logicChildren ()
 
- Protected Member Functions inherited from Widget
void distributeActionEvent ()
 
void distributeResizedEvent ()
 
void distributeMovedEvent ()
 
void distributeHiddenEvent ()
 
void distributeShownEvent ()
 
- Protected Member Functions inherited from Widget2
 Widget2 (const Widget2 *const widget)
 
- Protected Member Functions inherited from WidgetDeathListener
 WidgetDeathListener ()
 
- Protected Member Functions inherited from MouseListener
 MouseListener ()
 

Static Protected Member Functions

static void validateSpeed ()
 

Private Member Functions

void drawDebugPath (Graphics *const graphics)
 
void drawPath (Graphics *const graphics, const Path &path, const Color &color) const
 
bool leftMouseAction ()
 
bool openContextMenu (const MouseEvent &event)
 
void walkByMouse (const MouseEvent &event)
 
void followMouse ()
 
void drawDebugPath (Graphics *const graphics)
 
void drawPath (Graphics *const graphics, const Path &path, const Color &color) const
 
bool leftMouseAction ()
 
bool openContextMenu (const MouseEvent &event)
 
void walkByMouse (const MouseEvent &event)
 
void getMouseTile (const int x, const int y, int &destX, int &destY) const
 
void followMouse ()
 

Private Attributes

MapmMap
 
BeingmHoverBeing
 
FloorItemmHoverItem
 
MapItemmHoverSign
 
int mScrollRadius
 
int mScrollLaziness
 
int mScrollCenterOffsetX
 
int mScrollCenterOffsetY
 
int mMousePressX
 
int mMousePressY
 
int mPixelViewX
 
int mPixelViewY
 
int mLocalWalkTime
 
int mCameraRelativeX
 
int mCameraRelativeY
 
bool mShowBeingPopup
 
bool mSelfMouseHeal
 
bool mEnableLazyScrolling
 
bool mMouseDirectionMove
 
bool mLongMouseClick
 
bool mMouseClicked
 
bool mPlayerFollowMouse
 
int mMidTileX
 
int mMidTileY
 
int mViewXmax
 
int mViewYmax
 
time_t mLocalWalkTime
 
bool mAllowMoveByMouse
 

Friends

class ActorManager
 

Additional Inherited Members

- Static Public Member Functions inherited from Widget
static void setGlobalFont (Font *const font)
 
static FontgetGloablFont ()
 
static void cleanGlobalFont ()
 
static bool widgetExists (const Widget *const widget)
 
static void distributeWindowResizeEvent ()
 
static WidgetcallPostInit (Widget *const widget)
 
- Protected Types inherited from BasicContainer
typedef std::vector< Widget * > WidgetList
 
typedef WidgetList::iterator WidgetListIterator
 
typedef WidgetList::const_iterator WidgetListConstIterator
 
typedef WidgetList::reverse_iterator WidgetListReverseIterator
 
typedef WidgetList::const_reverse_iterator WidgetListCReverseIterator
 
- Protected Types inherited from Widget
typedef std::list< MouseListener * > MouseListenerList
 
typedef MouseListenerList::iterator MouseListenerIterator
 
typedef std::list< KeyListener * > KeyListenerList
 
typedef KeyListenerList::iterator KeyListenerIterator
 
typedef std::list< ActionListener * > ActionListenerList
 
typedef ActionListenerList::iterator ActionListenerIterator
 
typedef std::list< WidgetDeathListener * > WidgetDeathListenerList
 
typedef WidgetDeathListenerList::iterator WidgetDeathListenerIterator
 
typedef std::list< FocusListener * > FocusListenerList
 
typedef FocusListenerList::iterator FocusListenerIterator
 
typedef std::list< WidgetListener * > WidgetListenerList
 
typedef WidgetListenerList::iterator WidgetListenerIterator
 
- Protected Attributes inherited from BasicContainer2
Opaque mOpaque
 
- Protected Attributes inherited from BasicContainer
WidgetList mWidgets
 
WidgetList mLogicWidgets
 
- Protected Attributes inherited from Widget
MouseListenerList mMouseListeners
 
KeyListenerList mKeyListeners
 
ActionListenerList mActionListeners
 
WidgetDeathListenerList mDeathListeners
 
FocusListenerList mFocusListeners
 
WidgetListenerList mWidgetListeners
 
Color mForegroundColor
 
Color mBackgroundColor
 
Color mBaseColor
 
Rect mDimension
 
std::string mActionEventId
 
std::string mId
 
FocusHandlermFocusHandler
 
FocusHandlermInternalFocusHandler
 
WidgetmParent
 
FontmCurrentFont
 
unsigned int mFrameSize
 
bool mFocusable
 
bool mTabIn
 
bool mTabOut
 
bool mEnabled
 
bool mAllowLogic
 
bool mMouseConsume
 
bool mRedraw
 
bool mSelectable
 
- Protected Attributes inherited from Widget2
int mPaletteOffset
 
WidgetmWindow
 
Color mForegroundColor2
 
- Static Protected Attributes inherited from Widget
static FontmGlobalFont = 0
 

Detailed Description

The viewport on the map. Displays the current map and handles mouse input and the popup menu.

Definition at line 43 of file viewport.h.

Constructor & Destructor Documentation

◆ Viewport() [1/2]

Viewport::Viewport ( )

Constructor.

Definition at line 39 of file viewport.cpp.

39  :
40  WindowContainer(nullptr),
41  MouseListener(),
43  mMouseX(0),
44  mMouseY(0),
45  mMap(nullptr),
46  mHoverBeing(nullptr),
47  mHoverItem(nullptr),
48  mHoverSign(nullptr),
49  mScrollRadius(config.getIntValue("ScrollRadius")),
50  mScrollLaziness(config.getIntValue("ScrollLaziness")),
51  mScrollCenterOffsetX(config.getIntValue("ScrollCenterOffsetX")),
52  mScrollCenterOffsetY(config.getIntValue("ScrollCenterOffsetY")),
53  mMousePressX(0),
54  mMousePressY(0),
55  mPixelViewX(0),
56  mPixelViewY(0),
57  mLocalWalkTime(-1),
60  mShowBeingPopup(config.getBoolValue("showBeingPopup")),
61  mSelfMouseHeal(config.getBoolValue("selfMouseHeal")),
62  mEnableLazyScrolling(config.getBoolValue("enableLazyScrolling")),
63  mMouseDirectionMove(config.getBoolValue("mouseDirectionMove")),
64  mLongMouseClick(config.getBoolValue("longmouseclick")),
65  mMouseClicked(false),
66  mPlayerFollowMouse(false)
67 {
69  addMouseListener(this);
70 
71  config.addListener("ScrollLaziness", this);
72  config.addListener("ScrollRadius", this);
73  config.addListener("showBeingPopup", this);
74  config.addListener("selfMouseHeal", this);
75  config.addListener("enableLazyScrolling", this);
76  config.addListener("mouseDirectionMove", this);
77  config.addListener("longmouseclick", this);
78 
79  setFocusable(true);
80 }

References Configuration::addListener(), Widget::addMouseListener(), config, Opaque_false, Widget::setFocusable(), and BasicContainer2::setOpaque().

◆ ~Viewport() [1/2]

Viewport::~Viewport ( )

Destructor.

Definition at line 82 of file viewport.cpp.

83 {
84  config.removeListeners(this);
86 }

References CHECKLISTENERS, config, and Configuration::removeListeners().

◆ Viewport() [2/2]

Viewport::Viewport ( )

Constructor.

◆ ~Viewport() [2/2]

Viewport::~Viewport ( )

Destructor.

Member Function Documentation

◆ cleanHoverItems() [1/2]

void Viewport::cleanHoverItems ( )

Clear all hover item, being etc

Definition at line 258 of file viewport.cpp.

259 {
260  mHoverBeing = nullptr;
261  mHoverItem = nullptr;
262  mHoverSign = nullptr;
263 }

References mHoverBeing, mHoverItem, and mHoverSign.

Referenced by Game::changeMap().

◆ cleanHoverItems() [2/2]

void Viewport::cleanHoverItems ( )

Clear all hover item, being etc

◆ clearHover()

void Viewport::clearHover ( const ActorSprite *const  actor)
protected

Clears any matching hovers.

Definition at line 1053 of file viewport.cpp.

1054 {
1055  if (mHoverBeing == actor)
1056  mHoverBeing = nullptr;
1057 
1058  if (mHoverItem == actor)
1059  mHoverItem = nullptr;
1060 }

References mHoverBeing, and mHoverItem.

Referenced by ActorManager::logic().

◆ draw() [1/2]

void Viewport::draw ( Graphics *const  graphics)
virtual

Draws the viewport.

Reimplemented from BasicContainer2.

Definition at line 92 of file viewport.cpp.

93 {
94  BLOCK_START("Viewport::draw 1")
95  static int lastTick = tick_time;
96 
97  graphics->setColor(Color(64, 64, 64, 255));
98  graphics->fillRectangle(
99  Rect(0, 0, getWidth(), getHeight()));
100 
101  // Avoid freaking out when tick_time overflows
102  if (tick_time < lastTick)
103  lastTick = tick_time;
104 
105  // Draw contained widgets
106  WindowContainer::draw(graphics);
107  BLOCK_END("Viewport::draw 1")
108 }

References BLOCK_END, BLOCK_START, BasicContainer2::draw(), Graphics::fillRectangle(), Widget::getHeight(), Widget::getWidth(), Graphics::setColor(), and tick_time.

Referenced by safeDraw().

◆ draw() [2/2]

void Viewport::draw ( Graphics *const  graphics)
virtual

Draws the viewport.

Reimplemented from BasicContainer2.

◆ drawDebugPath() [1/2]

void Viewport::drawDebugPath ( Graphics *const  graphics)
private

Finds a path from the player to the mouse, and draws it. This is for debug purposes.

Definition at line 128 of file viewport.cpp.

129 {
130 }

◆ drawDebugPath() [2/2]

void Viewport::drawDebugPath ( Graphics *const  graphics)
private

Finds a path from the player to the mouse, and draws it. This is for debug purposes.

◆ drawPath() [1/2]

void Viewport::drawPath ( Graphics *const  graphics,
const Path path,
const Color color 
) const
private

Draws the given path.

Definition at line 353 of file viewport.cpp.

356 {
357  graphics->setColor(color);
358  Font *const font = getFont();
359 
360  int cnt = 1;
361  FOR_EACH (Path::const_iterator, i, path)
362  {
363  const int squareX = i->x * mapTileSize - mPixelViewX + 12;
364  const int squareY = i->y * mapTileSize - mPixelViewY + 12;
365 
366  graphics->fillRectangle(Rect(squareX, squareY, 8, 8));
367  if (mMap != nullptr)
368  {
369  const std::string str = toString(cnt);
370  font->drawString(graphics,
371  color, color,
372  str,
373  squareX + 4 - font->getWidth(str) / 2,
374  squareY + 12);
375  }
376  cnt ++;
377  }
378 }

References Font::drawString(), Graphics::fillRectangle(), FOR_EACH, Widget::getFont(), Font::getWidth(), mapTileSize, mMap, mPixelViewX, mPixelViewY, Graphics::setColor(), and Catch::toString().

◆ drawPath() [2/2]

void Viewport::drawPath ( Graphics *const  graphics,
const Path path,
const Color color 
) const
private

Draws the given path.

◆ followMouse() [1/2]

void Viewport::followMouse ( )
private

Make the player go to the mouse position.

Definition at line 124 of file viewport.cpp.

125 {
126 }

◆ followMouse() [2/2]

void Viewport::followMouse ( )
private

Make the player go to the mouse position.

◆ getCameraRelativeX() [1/2]

int Viewport::getCameraRelativeX ( ) const
inline

Definition at line 139 of file viewport.h.

140  { return mCameraRelativeX; }

References mCameraRelativeX.

Referenced by Minimap::draw2(), and NpcDialog::saveCamera().

◆ getCameraRelativeX() [2/2]

int Viewport::getCameraRelativeX ( ) const
inline

Definition at line 141 of file viewport.h.

142  { return mCameraRelativeX; }

References mCameraRelativeX.

◆ getCameraRelativeY() [1/2]

int Viewport::getCameraRelativeY ( ) const
inline

Definition at line 142 of file viewport.h.

143  { return mCameraRelativeY; }

References mCameraRelativeY.

Referenced by Minimap::draw2(), and NpcDialog::saveCamera().

◆ getCameraRelativeY() [2/2]

int Viewport::getCameraRelativeY ( ) const
inline

Definition at line 144 of file viewport.h.

145  { return mCameraRelativeY; }

References mCameraRelativeY.

◆ getCameraX() [1/2]

int Viewport::getCameraX ( ) const
inline

Returns camera x offset in pixels.

Definition at line 114 of file viewport.h.

115  { return mPixelViewX; }

References mPixelViewX.

Referenced by MapDebugTab::logic(), and ParticleEngine::update().

◆ getCameraX() [2/2]

int Viewport::getCameraX ( ) const
inline

Returns camera x offset in pixels.

Definition at line 116 of file viewport.h.

117  { return mPixelViewX; }

References mPixelViewX.

◆ getCameraY() [1/2]

int Viewport::getCameraY ( ) const
inline

Returns camera y offset in pixels.

Definition at line 120 of file viewport.h.

121  { return mPixelViewY; }

References mPixelViewY.

Referenced by MapDebugTab::logic(), and ParticleEngine::update().

◆ getCameraY() [2/2]

int Viewport::getCameraY ( ) const
inline

Returns camera y offset in pixels.

Definition at line 122 of file viewport.h.

123  { return mPixelViewY; }

References mPixelViewY.

◆ getMap() [1/2]

Map* Viewport::getMap ( ) const
inline

◆ getMap() [2/2]

Map* Viewport::getMap ( ) const
inline

Definition at line 136 of file viewport.h.

137  { return mMap; }

References mMap.

◆ getMouseTile() [1/2]

void Viewport::getMouseTile ( const int  x,
const int  y,
int &  destX,
int &  destY 
) const
private

Definition at line 618 of file viewport.cpp.

620 {
621  if (mMap == nullptr)
622  return;
623  const int tw = mMap->getTileWidth();
624  const int th = mMap->getTileHeight();
625  destX = CAST_S32(x + mPixelViewX)
626  / static_cast<float>(tw);
627 
628  if (mMap->isHeightsPresent())
629  {
630  const int th2 = th / 2;
631  const int clickY = y + mPixelViewY - th2;
632  destY = y + mPixelViewY;
633  int newDiffY = 1000000;
634  const int heightTiles = mainGraphics->mHeight / th;
635  const int tileViewY = mPixelViewY / th;
636  for (int f = tileViewY; f < tileViewY + heightTiles; f ++)
637  {
638  if (!mMap->getWalk(destX,
639  f,
644  {
645  continue;
646  }
647 
648  const int offset = mMap->getHeightOffset(
649  destX, f) * th2;
650  const int pixelF = f * th;
651  const int diff = abs(clickY + offset - pixelF);
652  if (diff < newDiffY)
653  {
654  destY = pixelF;
655  newDiffY = diff;
656  }
657  }
658  destY /= 32;
659  }
660  else
661  {
662  destY = CAST_S32((y + mPixelViewY) / static_cast<float>(th));
663  }
664 }

References BlockMask::AIR, CAST_S32, Map::getHeightOffset(), Map::getTileHeight(), Map::getTileWidth(), Map::getWalk(), Map::isHeightsPresent(), mainGraphics, Graphics::mHeight, mMap, mPixelViewX, mPixelViewY, BlockMask::PLAYERWALL, BlockMask::WALL, BlockMask::WATER, x, and y.

◆ getMouseTile() [2/2]

void Viewport::getMouseTile ( int &  destX,
int &  destY 
) const

Definition at line 613 of file viewport.cpp.

614 {
615  getMouseTile(mMouseX, mMouseY, destX, destY);
616 }

References mMouseX, and mMouseY.

Referenced by SkillDialog::useSkill(), and SkillDialog::useSkillDefault().

◆ leftMouseAction() [1/2]

bool Viewport::leftMouseAction ( )
private

Definition at line 265 of file viewport.cpp.

266 {
267  return false;
268 }

Referenced by mousePressed(), and mouseReleased().

◆ leftMouseAction() [2/2]

bool Viewport::leftMouseAction ( )
private

◆ logic() [1/2]

void Viewport::logic ( )
virtual

Implements player to keep following mouse.

Reimplemented from BasicContainer.

Definition at line 115 of file viewport.cpp.

116 {
117  BLOCK_START("Viewport::logic")
118  // Make the player follow the mouse position
119  // if the mouse is dragged elsewhere than in a window.
120  Gui::getMouseState(mMouseX, mMouseY);
122 }

References BLOCK_END, BLOCK_START, Gui::getMouseState(), mMouseX, and mMouseY.

◆ logic() [2/2]

void Viewport::logic ( )
virtual

Implements player to keep following mouse.

Reimplemented from BasicContainer.

◆ mouseDragged() [1/2]

void Viewport::mouseDragged ( MouseEvent event)
virtual

Handles mouse move on map

Reimplemented from MouseListener.

Definition at line 178 of file viewport.cpp.

179 {
180  if (event.getSource() != this || event.isConsumed())
181  {
182  mPlayerFollowMouse = false;
183  return;
184  }
185  if (mMouseClicked)
186  {
187  if (abs(event.getX() - mMousePressX) > 32
188  || abs(event.getY() - mMousePressY) > 32)
189  {
190  mPlayerFollowMouse = true;
191  }
192  }
193 
194  walkByMouse(event);
195 }

References Event::getSource(), MouseEvent::getX(), MouseEvent::getY(), InputGuiEvent::isConsumed(), mMouseClicked, mMousePressX, mMousePressY, mPlayerFollowMouse, and walkByMouse().

◆ mouseDragged() [2/2]

void Viewport::mouseDragged ( MouseEvent event)
virtual

Handles mouse move on map

Reimplemented from MouseListener.

◆ mouseMoved() [1/2]

void Viewport::mouseMoved ( MouseEvent event)
virtual

Handles mouse move on map.

Reimplemented from MouseListener.

Definition at line 246 of file viewport.cpp.

247 {
248 }

◆ mouseMoved() [2/2]

void Viewport::mouseMoved ( MouseEvent event)
virtual

Handles mouse move on map.

Reimplemented from MouseListener.

◆ mousePressed() [1/2]

void Viewport::mousePressed ( MouseEvent event)
virtual

Handles mouse press on map.

Reimplemented from MouseListener.

Definition at line 137 of file viewport.cpp.

138 {
139  if (event.getSource() != this || event.isConsumed())
140  return;
141 
142  mMouseClicked = true;
143 
144  mMousePressX = event.getX();
145  mMousePressY = event.getY();
146  const MouseButtonT eventButton = event.getButton();
147 
148  // Right click might open a popup
149  if (eventButton == MouseButton::RIGHT)
150  {
151  if (openContextMenu(event))
152  return;
153  }
154 
155  // If a popup is active, just remove it
157  {
158  mPlayerFollowMouse = false;
160  return;
161  }
162 
163  // Left click can cause different actions
164  if (!mLongMouseClick && eventButton == MouseButton::LEFT)
165  {
166  if (leftMouseAction())
167  {
168  mPlayerFollowMouse = false;
169  return;
170  }
171  }
172 }

References Event::getSource(), PopupManager::hidePopupMenu(), InputGuiEvent::isConsumed(), PopupManager::isPopupMenuVisible(), MouseButton::LEFT, leftMouseAction(), mLongMouseClick, mMouseClicked, mMousePressX, mMousePressY, mPlayerFollowMouse, openContextMenu(), and MouseButton::RIGHT.

◆ mousePressed() [2/2]

void Viewport::mousePressed ( MouseEvent event)
virtual

Handles mouse press on map.

Reimplemented from MouseListener.

◆ mouseReleased() [1/2]

void Viewport::mouseReleased ( MouseEvent event)
virtual

Handles mouse button release on map.

Reimplemented from MouseListener.

Definition at line 197 of file viewport.cpp.

198 {
199  mPlayerFollowMouse = false;
200  mLocalWalkTime = -1;
202  {
203  mMouseClicked = false;
204  if (event.getSource() != this || event.isConsumed())
205  return;
206  const MouseButtonT eventButton = event.getButton();
207  if (eventButton == MouseButton::LEFT)
208  {
209  // long button press
210  if ((gui != nullptr) && gui->isLongPress())
211  {
212  if (openContextMenu(event))
213  {
214  gui->resetClickCount();
215  return;
216  }
217  }
218  else
219  {
220  if (leftMouseAction())
221  return;
222  }
223  walkByMouse(event);
224  }
225  }
226 }

References Event::getSource(), gui, InputGuiEvent::isConsumed(), Gui::isLongPress(), MouseButton::LEFT, leftMouseAction(), mLocalWalkTime, mLongMouseClick, mMouseClicked, mPlayerFollowMouse, openContextMenu(), Gui::resetClickCount(), and walkByMouse().

◆ mouseReleased() [2/2]

void Viewport::mouseReleased ( MouseEvent event)
virtual

Handles mouse button release on map.

Reimplemented from MouseListener.

◆ moveCamera() [1/2]

void Viewport::moveCamera ( const int  dx,
const int  dy 
)

Definition at line 1069 of file viewport.cpp.

1070 {
1071  mCameraRelativeX += dx;
1072  mCameraRelativeY += dy;
1073  updateMidVars();
1074 }

References mCameraRelativeX, mCameraRelativeY, and updateMidVars().

Referenced by Game::moveInDirection().

◆ moveCamera() [2/2]

void Viewport::moveCamera ( const int  dx,
const int  dy 
)

◆ moveCameraRelative()

void Viewport::moveCameraRelative ( const int  x,
const int  y 
)

Definition at line 1102 of file viewport.cpp.

1103 {
1104  settings.cameraMode = 1;
1105  mCameraRelativeX += x;
1106  mCameraRelativeY += y;
1107  updateMidVars();
1108 }

References Settings::cameraMode, mCameraRelativeX, mCameraRelativeY, settings, updateMidVars(), x, and y.

Referenced by Ea::NpcRecv::processNpcCommand().

◆ moveCameraToActor()

void Viewport::moveCameraToActor ( const BeingId  actorId,
const int  x,
const int  y 
)

Definition at line 1076 of file viewport.cpp.

1078 {
1079  if ((localPlayer == nullptr) || (actorManager == nullptr))
1080  return;
1081 
1082  const Actor *const actor = actorManager->findBeing(actorId);
1083  if (actor == nullptr)
1084  return;
1085  settings.cameraMode = 1;
1088  updateMidVars();
1089 }

References actorManager, Settings::cameraMode, ActorManager::findBeing(), localPlayer, mCameraRelativeX, mCameraRelativeY, Actor::mPixelX, Actor::mPixelY, settings, updateMidVars(), x, and y.

Referenced by Ea::NpcRecv::processNpcCommand().

◆ moveCameraToPosition()

void Viewport::moveCameraToPosition ( const int  x,
const int  y 
)

Definition at line 1091 of file viewport.cpp.

1092 {
1093  if (localPlayer == nullptr)
1094  return;
1095 
1096  settings.cameraMode = 1;
1099  updateMidVars();
1100 }

References Settings::cameraMode, localPlayer, mCameraRelativeX, mCameraRelativeY, Actor::mPixelX, Actor::mPixelY, settings, updateMidVars(), x, and y.

Referenced by Ea::NpcRecv::processNpcCommand().

◆ openContextMenu() [1/2]

bool Viewport::openContextMenu ( const MouseEvent event)
private

Definition at line 132 of file viewport.cpp.

133 {
134  return false;
135 }

Referenced by mousePressed(), and mouseReleased().

◆ openContextMenu() [2/2]

bool Viewport::openContextMenu ( const MouseEvent event)
private

◆ optionChanged() [1/2]

void Viewport::optionChanged ( const std::string &  name)
virtual

A relevant config option changed.

Implements ConfigListener.

Definition at line 228 of file viewport.cpp.

229 {
230  if (name == "ScrollLaziness")
231  mScrollLaziness = config.getIntValue("ScrollLaziness");
232  else if (name == "ScrollRadius")
233  mScrollRadius = config.getIntValue("ScrollRadius");
234  else if (name == "showBeingPopup")
235  mShowBeingPopup = config.getBoolValue("showBeingPopup");
236  else if (name == "selfMouseHeal")
237  mSelfMouseHeal = config.getBoolValue("selfMouseHeal");
238  else if (name == "enableLazyScrolling")
239  mEnableLazyScrolling = config.getBoolValue("enableLazyScrolling");
240  else if (name == "mouseDirectionMove")
241  mMouseDirectionMove = config.getBoolValue("mouseDirectionMove");
242  else if (name == "longmouseclick")
243  mLongMouseClick = config.getBoolValue("longmouseclick");
244 }

References config, Configuration::getBoolValue(), Configuration::getIntValue(), mEnableLazyScrolling, mLongMouseClick, mMouseDirectionMove, mScrollLaziness, mScrollRadius, mSelfMouseHeal, and mShowBeingPopup.

◆ optionChanged() [2/2]

void Viewport::optionChanged ( const std::string &  name)
virtual

A relevant config option changed.

Implements ConfigListener.

◆ returnCamera()

void Viewport::returnCamera ( )

◆ safeDraw() [1/2]

void Viewport::safeDraw ( Graphics *const  graphics)
virtual

Reimplemented from BasicContainer2.

Definition at line 110 of file viewport.cpp.

111 {
112  Viewport::draw(graphics);
113 }

References draw().

◆ safeDraw() [2/2]

void Viewport::safeDraw ( Graphics *const  graphics)
virtual

Reimplemented from BasicContainer2.

◆ scrollBy() [1/2]

void Viewport::scrollBy ( const int  x,
const int  y 
)
inline

Changes viewpoint by relative pixel coordinates.

Definition at line 126 of file viewport.h.

127  { mPixelViewX += x; mPixelViewY += y; }

References mPixelViewX, mPixelViewY, x, and y.

Referenced by Ea::PlayerRecv::processPlayerWarp().

◆ scrollBy() [2/2]

void Viewport::scrollBy ( const int  x,
const int  y 
)
inline

Changes viewpoint by relative pixel coordinates.

Definition at line 128 of file viewport.h.

129  { mPixelViewX += x; mPixelViewY += y; }

References mPixelViewX, mPixelViewY, x, and y.

◆ setCameraRelativeX() [1/2]

void Viewport::setCameraRelativeX ( const int  n)
inline

Definition at line 145 of file viewport.h.

146  { mCameraRelativeX = n; }

References mCameraRelativeX.

Referenced by NpcDialog::restoreCamera().

◆ setCameraRelativeX() [2/2]

void Viewport::setCameraRelativeX ( const int  n)
inline

Definition at line 147 of file viewport.h.

148  { mCameraRelativeX = n; updateMidVars(); }

References mCameraRelativeX, and updateMidVars().

◆ setCameraRelativeY() [1/2]

void Viewport::setCameraRelativeY ( const int  n)
inline

Definition at line 148 of file viewport.h.

149  { mCameraRelativeY = n; }

References mCameraRelativeY.

Referenced by NpcDialog::restoreCamera().

◆ setCameraRelativeY() [2/2]

void Viewport::setCameraRelativeY ( const int  n)
inline

Definition at line 150 of file viewport.h.

151  { mCameraRelativeY = n; updateMidVars(); }

References mCameraRelativeY, and updateMidVars().

◆ setMap() [1/2]

void Viewport::setMap ( Map *const  map)

Sets the map displayed by the viewport.

Definition at line 88 of file viewport.cpp.

89 {
90 }

Referenced by Game::changeMap().

◆ setMap() [2/2]

void Viewport::setMap ( Map *const  map)

Sets the map displayed by the viewport.

◆ toggleCameraMode() [1/2]

void Viewport::toggleCameraMode ( )

◆ toggleCameraMode() [2/2]

void Viewport::toggleCameraMode ( )

◆ toggleMapDrawType() [1/2]

void Viewport::toggleMapDrawType ( )

Toggles whether the path debug graphics are shown. normal, debug with all images and grid, debug with out big images and with out grid.

Definition at line 250 of file viewport.cpp.

251 {
252 }

Referenced by GameModifiers::changeMapDrawType().

◆ toggleMapDrawType() [2/2]

void Viewport::toggleMapDrawType ( )

Toggles whether the path debug graphics are shown. normal, debug with all images and grid, debug with out big images and with out grid.

◆ updateMaxVars()

void Viewport::updateMaxVars ( )
protected

Definition at line 1136 of file viewport.cpp.

1137 {
1138  if (mMap == nullptr)
1139  return;
1141  - mainGraphics->mWidth;
1143  - mainGraphics->mHeight;
1144 }

References Map::getHeight(), Map::getTileHeight(), Map::getTileWidth(), Map::getWidth(), mainGraphics, Graphics::mHeight, mMap, mViewXmax, mViewYmax, and Graphics::mWidth.

◆ updateMidVars()

void Viewport::updateMidVars ( )
protected

◆ validateSpeed()

void Viewport::validateSpeed ( )
staticprotected

◆ videoResized() [1/2]

void Viewport::videoResized ( )

Definition at line 270 of file viewport.cpp.

271 {
272 }

Referenced by Gui::videoResized().

◆ videoResized() [2/2]

void Viewport::videoResized ( )

◆ walkByMouse() [1/2]

void Viewport::walkByMouse ( const MouseEvent event)
private

Definition at line 174 of file viewport.cpp.

175 {
176 }

Referenced by mouseDragged(), and mouseReleased().

◆ walkByMouse() [2/2]

void Viewport::walkByMouse ( const MouseEvent event)
private

Friends And Related Function Documentation

◆ ActorManager

friend class ActorManager
friend

Definition at line 171 of file viewport.h.

Field Documentation

◆ mAllowMoveByMouse

bool Viewport::mAllowMoveByMouse
private

Definition at line 242 of file viewport.h.

◆ mCameraRelativeX

int Viewport::mCameraRelativeX
private

◆ mCameraRelativeY

int Viewport::mCameraRelativeY
private

◆ mEnableLazyScrolling

bool Viewport::mEnableLazyScrolling
private

Definition at line 204 of file viewport.h.

Referenced by optionChanged().

◆ mHoverBeing

Being * Viewport::mHoverBeing
private

Being mouse is currently over.

Definition at line 184 of file viewport.h.

Referenced by cleanHoverItems(), and clearHover().

◆ mHoverItem

FloorItem * Viewport::mHoverItem
private

FloorItem mouse is currently over.

Definition at line 185 of file viewport.h.

Referenced by cleanHoverItems(), and clearHover().

◆ mHoverSign

MapItem * Viewport::mHoverSign
private

Map sign mouse is currently over.

Definition at line 186 of file viewport.h.

Referenced by cleanHoverItems().

◆ mLocalWalkTime [1/2]

int Viewport::mLocalWalkTime
private

Timestamp before the next walk can be sent.

Definition at line 197 of file viewport.h.

Referenced by mouseReleased().

◆ mLocalWalkTime [2/2]

time_t Viewport::mLocalWalkTime
private

Definition at line 232 of file viewport.h.

◆ mLongMouseClick

bool Viewport::mLongMouseClick
private

Definition at line 206 of file viewport.h.

Referenced by mousePressed(), mouseReleased(), and optionChanged().

◆ mMap

Map * Viewport::mMap
private

The current map.

Definition at line 182 of file viewport.h.

Referenced by drawPath(), getMap(), getMouseTile(), and updateMaxVars().

◆ mMidTileX

int Viewport::mMidTileX
private

Definition at line 227 of file viewport.h.

Referenced by updateMidVars().

◆ mMidTileY

int Viewport::mMidTileY
private

Definition at line 228 of file viewport.h.

Referenced by updateMidVars().

◆ mMouseClicked

bool Viewport::mMouseClicked
private

Definition at line 207 of file viewport.h.

Referenced by mouseDragged(), mousePressed(), and mouseReleased().

◆ mMouseDirectionMove

bool Viewport::mMouseDirectionMove
private

Definition at line 205 of file viewport.h.

Referenced by optionChanged().

◆ mMousePressX

int Viewport::mMousePressX
private

Definition at line 192 of file viewport.h.

Referenced by mouseDragged(), and mousePressed().

◆ mMousePressY

int Viewport::mMousePressY
private

Definition at line 193 of file viewport.h.

Referenced by mouseDragged(), and mousePressed().

◆ mMouseX

int Viewport::mMouseX

◆ mMouseY

int Viewport::mMouseY

◆ mPixelViewX

int Viewport::mPixelViewX
private

Current viewpoint in pixels.

Definition at line 194 of file viewport.h.

Referenced by drawPath(), getCameraX(), getMouseTile(), and scrollBy().

◆ mPixelViewY

int Viewport::mPixelViewY
private

Current viewpoint in pixels.

Definition at line 195 of file viewport.h.

Referenced by drawPath(), getCameraY(), getMouseTile(), and scrollBy().

◆ mPlayerFollowMouse

bool Viewport::mPlayerFollowMouse
private

Definition at line 208 of file viewport.h.

Referenced by mouseDragged(), mousePressed(), and mouseReleased().

◆ mScrollCenterOffsetX

int Viewport::mScrollCenterOffsetX
private

Definition at line 190 of file viewport.h.

Referenced by updateMidVars().

◆ mScrollCenterOffsetY

int Viewport::mScrollCenterOffsetY
private

Definition at line 191 of file viewport.h.

Referenced by updateMidVars().

◆ mScrollLaziness

int Viewport::mScrollLaziness
private

Definition at line 189 of file viewport.h.

Referenced by optionChanged().

◆ mScrollRadius

int Viewport::mScrollRadius
private

Definition at line 188 of file viewport.h.

Referenced by optionChanged().

◆ mSelfMouseHeal

bool Viewport::mSelfMouseHeal
private

Definition at line 203 of file viewport.h.

Referenced by optionChanged().

◆ mShowBeingPopup

bool Viewport::mShowBeingPopup
private

Definition at line 202 of file viewport.h.

Referenced by optionChanged().

◆ mViewXmax

int Viewport::mViewXmax
private

Definition at line 229 of file viewport.h.

Referenced by updateMaxVars().

◆ mViewYmax

int Viewport::mViewYmax
private

Definition at line 230 of file viewport.h.

Referenced by updateMaxVars().


The documentation for this class was generated from the following files:
Viewport::mPixelViewX
int mPixelViewX
Definition: viewport.h:194
CHECKLISTENERS
#define CHECKLISTENERS
Definition: localconsts.h:276
Viewport::mLongMouseClick
bool mLongMouseClick
Definition: viewport.h:206
tick_time
volatile int tick_time
Definition: timer.cpp:52
MouseButton::RIGHT
@ RIGHT
Definition: mousebutton.h:74
Widget::getFont
Font * getFont() const
Definition: widget.cpp:330
Map::getWidth
int getWidth() const
Definition: map.h:165
ConfigListener::ConfigListener
ConfigListener()
Definition: configlistener.h:39
Viewport::mScrollRadius
int mScrollRadius
Definition: viewport.h:188
Viewport::mScrollCenterOffsetX
int mScrollCenterOffsetX
Definition: viewport.h:190
Viewport::mScrollLaziness
int mScrollLaziness
Definition: viewport.h:189
fillRectangle
void fillRectangle(const Rect &restrict rect) restrict2 override final
settings
Settings settings
Definition: settings.cpp:31
Viewport::mMousePressY
int mMousePressY
Definition: viewport.h:193
Map::isHeightsPresent
bool isHeightsPresent() const
Definition: map.h:361
Viewport
Definition: viewport.h:43
Viewport::mShowBeingPopup
bool mShowBeingPopup
Definition: viewport.h:202
actorManager
ActorManager * actorManager
Definition: actormanager.cpp:80
Viewport::mMouseClicked
bool mMouseClicked
Definition: viewport.h:207
Gui
Definition: gui.h:115
Game::instance
static Game * instance()
Definition: game.h:81
Map::getWalk
bool getWalk(const int x, const int y, const unsigned char blockWalkMask) const
Definition: map.cpp:784
Actor
Definition: actor.h:40
Viewport::mCameraRelativeY
int mCameraRelativeY
Definition: viewport.h:200
BlockMask::WATER
@ WATER
Definition: blockmask.h:32
Viewport::mMouseY
int mMouseY
Definition: viewport.h:154
Settings::cameraMode
unsigned int cameraMode
Definition: settings.h:143
Configuration::addListener
void addListener(const std::string &key, ConfigListener *const listener)
Definition: configuration.cpp:905
Catch::toString
std::string toString(T const &value)
converts any type to a string
Definition: catch.hpp:1774
if
if(!vert) return
MouseEvent::getY
int getY() const
Definition: mouseevent.h:137
Gui::isLongPress
bool isLongPress() const
Definition: gui.h:308
ActorManager::findBeing
Being * findBeing(const BeingId id) const
Definition: actormanager.cpp:422
localPlayer
LocalPlayer * localPlayer
Definition: localplayer.cpp:108
Font::drawString
void drawString(Graphics *const graphics, Color col, const Color &col2, const std::string &text, const int x, const int y)
Definition: font.cpp:253
Event::getSource
Widget * getSource() const
Definition: event.h:103
Actor::mPixelY
int mPixelY
Definition: actor.h:133
Map::getHeightOffset
uint8_t getHeightOffset(const int x, const int y) const
Definition: map.cpp:1630
InputAction::ATTACK
@ ATTACK
Definition: inputaction.h:48
Viewport::mMidTileY
int mMidTileY
Definition: viewport.h:228
InputAction::TARGET_ATTACK
@ TARGET_ATTACK
Definition: inputaction.h:49
Viewport::mEnableLazyScrolling
bool mEnableLazyScrolling
Definition: viewport.h:204
inputManager
InputManager inputManager
Definition: inputmanager.cpp:68
InputGuiEvent::isConsumed
bool isConsumed() const
Definition: inputguievent.h:109
Viewport::mLocalWalkTime
int mLocalWalkTime
Definition: viewport.h:197
Widget::addMouseListener
void addMouseListener(MouseListener *const mouseListener)
Definition: widget.cpp:291
Map::getTileWidth
int getTileWidth() const
Definition: map.h:177
Viewport::mHoverSign
MapItem * mHoverSign
Definition: viewport.h:186
Gui::resetClickCount
void resetClickCount()
Definition: gui.cpp:979
gui
Gui * gui
Definition: gui.cpp:110
InputManager::isActionActive
bool isActionActive(const InputActionT index) const
Definition: inputmanager.cpp:364
Viewport::mMouseX
int mMouseX
Definition: viewport.h:153
MouseEvent::getX
int getX() const
Definition: mouseevent.h:126
BlockMask::WALL
@ WALL
Definition: blockmask.h:30
Widget::getWidth
int getWidth() const
Definition: widget.h:220
Actor::mPixelX
int mPixelX
Definition: actor.h:132
Viewport::mSelfMouseHeal
bool mSelfMouseHeal
Definition: viewport.h:203
mainGraphics
Graphics * mainGraphics
Definition: graphics.cpp:108
x
x
Definition: graphics_calcImageRect.hpp:72
Font
Definition: font.h:88
MouseListener::MouseListener
MouseListener()
Definition: mouselistener.h:181
WindowContainer
Definition: windowcontainer.h:34
Viewport::getMouseTile
void getMouseTile(int &destX, int &destY) const
Definition: viewport.cpp:613
Font::getWidth
int getWidth(const std::string &text) const
Definition: font.cpp:333
Viewport::mViewYmax
int mViewYmax
Definition: viewport.h:230
Opaque_false
const bool Opaque_false
Definition: opaque.h:29
BlockMask::PLAYERWALL
@ PLAYERWALL
Definition: blockmask.h:35
Configuration::getIntValue
int getIntValue(const std::string &key) const
Definition: configuration.cpp:403
setColor
void setColor(const Color &restrict color) override final
Definition: openglgraphicsdef1.hpp:26
Game::setValidSpeed
void setValidSpeed()
Definition: game.cpp:1272
Widget::getHeight
int getHeight() const
Definition: widget.h:239
Viewport::mMousePressX
int mMousePressX
Definition: viewport.h:192
Viewport::mPlayerFollowMouse
bool mPlayerFollowMouse
Definition: viewport.h:208
Viewport::leftMouseAction
bool leftMouseAction()
Definition: viewport.cpp:265
config
Configuration config
Definition: configuration.cpp:51
WindowContainer::WindowContainer
WindowContainer(const Widget2 *const widget)
Definition: windowcontainer.cpp:35
Graphics::mHeight
int mHeight
Definition: graphics.h:484
Viewport::mMidTileX
int mMidTileX
Definition: viewport.h:227
Map::getHeight
int getHeight() const
Definition: map.h:171
Graphics::setColor
virtual void setColor(const Color &color)
Definition: graphics.h:319
Viewport::mMap
Map * mMap
Definition: viewport.h:182
Viewport::updateMidVars
void updateMidVars()
Definition: viewport.cpp:1128
Viewport::mPixelViewY
int mPixelViewY
Definition: viewport.h:195
Viewport::mScrollCenterOffsetY
int mScrollCenterOffsetY
Definition: viewport.h:191
Configuration::removeListeners
void removeListeners(ConfigListener *const listener)
Definition: configuration.cpp:938
BlockMask::AIR
@ AIR
Definition: blockmask.h:31
PopupManager::hidePopupMenu
static void hidePopupMenu()
Definition: popupmanager.cpp:68
Rect
Definition: rect.h:72
Viewport::logic
void logic()
Definition: viewport.cpp:115
MouseButtonT
MouseButton ::T MouseButtonT
Definition: mousebutton.h:77
Viewport::mHoverItem
FloorItem * mHoverItem
Definition: viewport.h:185
Map::getTileHeight
int getTileHeight() const
Definition: map.h:183
BLOCK_START
#define BLOCK_START(name)
Definition: perfomance.h:78
Widget::setFocusable
void setFocusable(const bool focusable)
Definition: widget.cpp:191
BLOCK_END
#define BLOCK_END(name)
Definition: perfomance.h:79
CAST_S32
#define CAST_S32
Definition: cast.h:29
Graphics::fillRectangle
virtual void fillRectangle(const Rect &rectangle)=0
Viewport::walkByMouse
void walkByMouse(const MouseEvent &event)
Definition: viewport.cpp:174
Viewport::mMouseDirectionMove
bool mMouseDirectionMove
Definition: viewport.h:205
BasicContainer2::setOpaque
void setOpaque(Opaque opaque)
Definition: basiccontainer2.h:109
Viewport::draw
void draw(Graphics *const graphics)
Definition: viewport.cpp:92
Viewport::mCameraRelativeX
int mCameraRelativeX
Definition: viewport.h:199
Color
Definition: color.h:74
y
y
Definition: graphics_calcImageRect.hpp:72
Viewport::mHoverBeing
Being * mHoverBeing
Definition: viewport.h:184
FOR_EACH
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
mapTileSize
static const int mapTileSize
Definition: map.h:26
Viewport::openContextMenu
bool openContextMenu(const MouseEvent &event)
Definition: viewport.cpp:132
PopupManager::isPopupMenuVisible
static bool isPopupMenuVisible()
Definition: popupmanager.cpp:84
Configuration::getBoolValue
bool getBoolValue(const std::string &key) const
Definition: configuration.cpp:596
Graphics::mWidth
int mWidth
Definition: graphics.h:483
Viewport::mViewXmax
int mViewXmax
Definition: viewport.h:229
MouseButton::LEFT
@ LEFT
Definition: mousebutton.h:73