ManaPlus
Public Member Functions | Static Public Member Functions | Protected Attributes
EventsManager Class Reference

#include <eventsmanager.h>

Inheritance diagram for EventsManager:
ConfigListener

Public Member Functions

 EventsManager ()
 
 ~EventsManager ()
 
void init ()
 
void enableEvents ()
 
void shutdown ()
 
bool handleEvents () const
 
bool handleCommonEvents (const SDL_Event &event) const
 
void handleGameEvents () const
 
void optionChanged (const std::string &name)
 
- Public Member Functions inherited from ConfigListener
 ConfigListener ()
 
virtual ~ConfigListener ()
 

Static Public Member Functions

static void handleActive (const SDL_Event &event)
 
static void logEvent (const SDL_Event &event)
 

Protected Attributes

bool mLogInput
 

Detailed Description

Definition at line 34 of file eventsmanager.h.

Constructor & Destructor Documentation

◆ EventsManager()

EventsManager::EventsManager ( )

Definition at line 57 of file eventsmanager.cpp.

57  :
59  mLogInput(false)
60 {
61 }

◆ ~EventsManager()

EventsManager::~EventsManager ( )

Definition at line 63 of file eventsmanager.cpp.

64 {
66 }
#define CHECKLISTENERS
Definition: localconsts.h:277

References CHECKLISTENERS.

Member Function Documentation

◆ enableEvents()

void EventsManager::enableEvents ( )

Definition at line 74 of file eventsmanager.cpp.

75 {
76  // disable unused SDL events
77 #ifndef USE_SDL2
78  SDL_EventState(SDL_VIDEOEXPOSE, SDL_IGNORE);
79 #endif // USE_SDL2
80 
81  SDL_EventState(SDL_SYSWMEVENT, mLogInput ? SDL_ENABLE : SDL_IGNORE);
82  SDL_EventState(SDL_USEREVENT, SDL_IGNORE);
83 }

References mLogInput.

Referenced by Client::gameInit().

◆ handleActive()

void EventsManager::handleActive ( const SDL_Event &  event)
static

< The application is active

< The app has input focus

< The app has mouse coverage

Definition at line 622 of file eventsmanager.cpp.

623 {
624 #ifndef DYECMD
625  int fpsLimit = 0;
626  const bool inGame = (client->getState() == State::GAME);
627 #endif // DYECMD
628 
629  if ((event.active.state & SDL_APPACTIVE) != 0)
630  {
631  if (event.active.gain != 0U)
632  { // window restore
634 #ifndef DYECMD
635  if (localPlayer != nullptr)
636  {
637  if (!settings.awayMode)
638  fpsLimit = config.getIntValue("fpslimit");
639  localPlayer->setHalfAway(false);
640  }
641 #endif // DYECMD
642 
643  setPriority(true);
644  }
645  else
646  { // window minimization
647 #ifdef ANDROID
649 #else // ANDROID
651 #ifndef DYECMD
652  if (localPlayer != nullptr && !settings.awayMode)
653  {
654  fpsLimit = config.getIntValue("altfpslimit");
655  localPlayer->setHalfAway(true);
656  }
657 #endif // DYECMD
658 
659  setPriority(false);
660 #endif // ANDROID
661  }
662 #ifndef DYECMD
663  if (inGame && (localPlayer != nullptr))
665 #endif // DYECMD
666  }
667 #ifndef DYECMD
668  if (inGame && (localPlayer != nullptr))
670 #endif // DYECMD
671 
672  if ((event.active.state & SDL_APPINPUTFOCUS) != 0)
673  {
674  settings.inputFocused = (event.active.gain != 0U) ?
676  }
677  if ((event.active.state & SDL_APPMOUSEFOCUS) != 0)
678  settings.mouseFocused = (event.active.gain != 0U);
679 #ifndef DYECMD
680  if (inGame)
681  Game::instance()->updateFrameRate(fpsLimit);
682 #endif // DYECMD
683 }
void updateName()
Definition: being.cpp:3425
void setState(const StateT state)
Definition: client.h:66
StateT getState() const
Definition: client.h:69
int getIntValue(const std::string &key) const
void updateFrameRate(int fpsLimit)
Definition: game.cpp:1032
static Game * instance()
Definition: game.h:82
void setHalfAway(const bool n)
Definition: localplayer.h:236
void updateStatus() const
bool awayMode
Definition: settings.h:158
bool mouseFocused
Definition: settings.h:156
KeyboardFocusT inputFocused
Definition: settings.h:155
Configuration config
Client * client
Definition: client.cpp:118
LocalPlayer * localPlayer
@ GAME
Definition: state.h:49
@ EXIT
Definition: state.h:67
void setIsMinimized(const bool n)
void setPriority(const bool big)
Definition: process.cpp:328
Settings settings
Definition: settings.cpp:32

References Settings::awayMode, client, config, State::EXIT, KeyboardFocus::Focused, State::GAME, Configuration::getIntValue(), Client::getState(), Settings::inputFocused, Game::instance(), localPlayer, Settings::mouseFocused, LocalPlayer::setHalfAway(), WindowManager::setIsMinimized(), setPriority(), Client::setState(), settings, KeyboardFocus::Unfocused, Game::updateFrameRate(), Being::updateName(), and LocalPlayer::updateStatus().

Referenced by handleCommonEvents().

◆ handleCommonEvents()

bool EventsManager::handleCommonEvents ( const SDL_Event &  event) const

Definition at line 90 of file eventsmanager.cpp.

91 {
92  BLOCK_START("EventsManager::handleCommonEvents")
93  if (mLogInput)
94  logEvent(event);
95 
96  switch (event.type)
97  {
98  case SDL_QUIT:
100  logger->log1("force exit");
101  BLOCK_END("EventsManager::handleCommonEvents")
102  return true;
103 #ifdef USE_SDL2
104  case SDL_WINDOWEVENT:
105  handleSDL2WindowEvent(event);
106  BLOCK_END("EventsManager::handleCommonEvents")
107  return true;
108 #else // USE_SDL2
109  case SDL_VIDEORESIZE:
110  WindowManager::resizeVideo(event.resize.w,
111  event.resize.h,
112  false);
113  BLOCK_END("EventsManager::handleCommonEvents")
114  return true;
115  case SDL_ACTIVEEVENT:
116  handleActive(event);
118  return true;
119 #ifdef ANDROID
120  case SDL_KEYBOARDSHOW:
121  WindowManager::updateScreenKeyboard(event.user.code);
122  BLOCK_END("EventsManager::handleCommonEvents")
123  return true;
124  case SDL_ACCELEROMETER:
125  break;
126 #endif // ANDROID
127 #endif // USE_SDL2
128  default:
129  break;
130  }
131 
132  if (inputManager.handleEvent(event))
133  {
134  BLOCK_END("EventsManager::handleCommonEvents")
135  return true;
136  }
137 
139  return false;
140 }
bool handleCommonEvents(const SDL_Event &event) const
static void logEvent(const SDL_Event &event)
static void handleActive(const SDL_Event &event)
bool handleEvent(const SDL_Event &event)
void log1(const char *const log_text)
Definition: logger.cpp:238
if(!vert) return
InputManager inputManager
Logger * logger
Definition: logger.cpp:89
void updateScreenKeyboard(const int height)
void resizeVideo(int actualWidth, int actualHeight, const bool always)
#define BLOCK_END(name)
Definition: perfomance.h:80
#define BLOCK_START(name)
Definition: perfomance.h:79

References BLOCK_END, BLOCK_START, client, State::EXIT, handleActive(), InputManager::handleEvent(), inputManager, Logger::log1(), logEvent(), logger, mLogInput, WindowManager::resizeVideo(), Client::setState(), and WindowManager::updateScreenKeyboard().

Referenced by handleEvents(), and handleGameEvents().

◆ handleEvents()

bool EventsManager::handleEvents ( ) const

Definition at line 142 of file eventsmanager.cpp.

143 {
144  BLOCK_START("EventsManager::handleEvents")
145 #ifndef DYECMD
146  if (Game::instance() != nullptr)
147  {
148  // Let the game handle the events while it is active
150  }
151  else
152 #endif // DYECMD
153  {
154  SDL_Event event;
155  // Handle SDL events
156  while (SDL::PollEvent(&event))
157  {
158  if (!handleCommonEvents(event))
159  {
160 #ifdef ANDROID
161 #ifndef USE_SDL2
162  switch (event.type)
163  {
164  case SDL_ACTIVEEVENT:
165  if ((event.active.state & SDL_APPACTIVE)
166  && !event.active.gain)
167  {
169  logger->log1("exit on lost focus");
170  }
171  break;
172 
173  default:
174  break;
175  }
176 #endif // USE_SDL2
177 #endif // ANDROID
178  }
179 
180 #ifdef USE_MUMBLE
181  if (localPlayer && mumbleManager)
182  {
183  mumbleManager->setPos(localPlayer->getTileX(),
185  }
186 #endif // USE_MUMBLE
187  }
188  if (client->getState() == State::EXIT)
189  {
190  BLOCK_END("EventsManager::handleEvents")
191  return true;
192  }
193  }
195  return false;
196 }
int getTileX() const
Definition: being.h:168
uint8_t getDirection() const
Definition: being.h:494
int getTileY() const
Definition: being.h:174
bool handleEvents() const
void handleInput()
Definition: game.cpp:1060
bool PollEvent(SDL_Event *event)
Definition: sdlhelper.cpp:201

References BLOCK_END, BLOCK_START, client, State::EXIT, Being::getDirection(), Client::getState(), Being::getTileX(), Being::getTileY(), handleCommonEvents(), Game::handleInput(), Game::instance(), localPlayer, Logger::log1(), logger, SDL::PollEvent(), and Client::setState().

Referenced by Client::gameExec().

◆ handleGameEvents()

void EventsManager::handleGameEvents ( ) const

Definition at line 198 of file eventsmanager.cpp.

199 {
200  BLOCK_START("EventsManager::handleGameEvents")
201 #ifndef DYECMD
202  Game *const game = Game::instance();
203 
204  // Events
205  SDL_Event event;
206  while (SDL::PollEvent(&event))
207  {
208  if (event.type == SDL_KEYDOWN || event.type == SDL_KEYUP)
209  game->updateHistory(event);
210  game->checkKeys();
211 
212  if (handleCommonEvents(event))
213  break;
214  } // End while
215 #endif // DYECMD
216 
217  BLOCK_END("EventsManager::handleGameEvents")
218 }
Definition: game.h:64

References BLOCK_END, BLOCK_START, handleCommonEvents(), Game::instance(), and SDL::PollEvent().

Referenced by Game::handleInput().

◆ init()

void EventsManager::init ( )

Definition at line 68 of file eventsmanager.cpp.

69 {
70  mLogInput = config.getBoolValue("logInput");
71  config.addListener("logInput", this);
72 }
bool getBoolValue(const std::string &key) const
void addListener(const std::string &key, ConfigListener *const listener)

References Configuration::addListener(), config, Configuration::getBoolValue(), and mLogInput.

Referenced by Client::gameInit().

◆ logEvent()

void EventsManager::logEvent ( const SDL_Event &  event)
static

Definition at line 226 of file eventsmanager.cpp.

227 {
228  switch (event.type)
229  {
230 #ifdef USE_SDL2
231 #define winEventLog(name, name2) \
232  case name: \
233  str = name2; \
234  break
235 
236  case SDL_MOUSEMOTION:
237  logger->log("event: SDL_MOUSEMOTION: %u, %d,%d, %d,%d",
238  event.motion.state,
239  event.motion.x,
240  event.motion.y,
241  event.motion.xrel,
242  event.motion.yrel);
243  break;
244  case SDL_FINGERDOWN:
245  {
246  const SDL_TouchFingerEvent &touch = event.tfinger;
247  const int w = mainGraphics->mWidth;
248  const int h = mainGraphics->mHeight;
249  logger->log("event: SDL_FINGERDOWN: %u,%u (%f,%f) (%f,%f) %f",
250  CAST_U32(touch.touchId),
251  CAST_U32(touch.fingerId),
252  touch.x * w, touch.y * w,
253  touch.dx * w, touch.dy * h,
254  touch.pressure);
255  break;
256  }
257  case SDL_FINGERUP:
258  {
259  const SDL_TouchFingerEvent &touch = event.tfinger;
260  const int w = mainGraphics->mWidth;
261  const int h = mainGraphics->mHeight;
262  logger->log("event: SDL_FINGERUP: %u,%u (%f,%f) (%f,%f) %f",
263  CAST_U32(touch.touchId),
264  CAST_U32(touch.fingerId),
265  touch.x * w, touch.y * w,
266  touch.dx * w, touch.dy * h,
267  touch.pressure);
268  break;
269  }
270  case SDL_FINGERMOTION:
271  {
272  const SDL_TouchFingerEvent &touch = event.tfinger;
273  const int w = mainGraphics->mWidth;
274  const int h = mainGraphics->mHeight;
275  logger->log("event: SDL_FINGERMOTION: %u,%u (%f,%f) (%f,%f) %f",
276  CAST_U32(touch.touchId),
277  CAST_U32(touch.fingerId),
278  touch.x * w, touch.y * h,
279  touch.dx * w, touch.dy * h,
280  touch.pressure);
281  break;
282  }
283  case SDL_MULTIGESTURE:
284  {
285  const SDL_MultiGestureEvent &gesture = event.mgesture;
286  const int w = mainGraphics->mWidth;
287  const int h = mainGraphics->mHeight;
288  logger->log("event: SDL_MULTIGESTURE: %u %f,%f (%f,%f) %d",
289  CAST_U32(gesture.touchId),
290  gesture.dTheta, gesture.dDist,
291  gesture.x * w, gesture.y * h,
292  CAST_S32(gesture.numFingers));
293  break;
294  }
295  case SDL_KEYDOWN:
296  logger->log("event: SDL_KEYDOWN: %s(%d) %s(%d) %d,%d,%u",
297  SDL_GetScancodeName(event.key.keysym.scancode),
298  event.key.keysym.scancode,
299  SDL_GetKeyName(event.key.keysym.sym),
300  event.key.keysym.sym,
301  event.key.state,
302  event.key.repeat,
303  CAST_U32(event.key.keysym.mod));
304  break;
305  case SDL_KEYUP:
306  logger->log("event: SDL_KEYUP: %s(%d) %s(%d) %d,%d,%u",
307  SDL_GetScancodeName(event.key.keysym.scancode),
308  event.key.keysym.scancode,
309  SDL_GetKeyName(event.key.keysym.sym),
310  event.key.keysym.sym,
311  event.key.state,
312  event.key.repeat,
313  CAST_U32(event.key.keysym.mod));
314  break;
315  case SDL_WINDOWEVENT:
316  {
317  const int data1 = event.window.data1;
318  const int data2 = event.window.data2;
319  std::string str;
320  switch (event.window.event)
321  {
322  winEventLog(SDL_WINDOWEVENT_NONE, "SDL_WINDOWEVENT_NONE");
323  winEventLog(SDL_WINDOWEVENT_SHOWN, "SDL_WINDOWEVENT_SHOWN");
324  winEventLog(SDL_WINDOWEVENT_HIDDEN, "SDL_WINDOWEVENT_HIDDEN");
325  winEventLog(SDL_WINDOWEVENT_EXPOSED,
326  "SDL_WINDOWEVENT_EXPOSED");
327  winEventLog(SDL_WINDOWEVENT_MOVED, "SDL_WINDOWEVENT_MOVED");
328  winEventLog(SDL_WINDOWEVENT_RESIZED,
329  "SDL_WINDOWEVENT_RESIZED");
330  winEventLog(SDL_WINDOWEVENT_SIZE_CHANGED,
331  "SDL_WINDOWEVENT_SIZE_CHANGED");
332  winEventLog(SDL_WINDOWEVENT_MINIMIZED,
333  "SDL_WINDOWEVENT_MINIMIZED");
334  winEventLog(SDL_WINDOWEVENT_MAXIMIZED,
335  "SDL_WINDOWEVENT_MAXIMIZED");
336  winEventLog(SDL_WINDOWEVENT_RESTORED,
337  "SDL_WINDOWEVENT_RESTORED");
338  winEventLog(SDL_WINDOWEVENT_ENTER, "SDL_WINDOWEVENT_ENTER");
339  winEventLog(SDL_WINDOWEVENT_LEAVE, "SDL_WINDOWEVENT_LEAVE");
340  winEventLog(SDL_WINDOWEVENT_FOCUS_GAINED,
341  "SDL_WINDOWEVENT_FOCUS_GAINED");
342  winEventLog(SDL_WINDOWEVENT_FOCUS_LOST,
343  "SDL_WINDOWEVENT_FOCUS_LOST");
344  winEventLog(SDL_WINDOWEVENT_CLOSE, "SDL_WINDOWEVENT_CLOSE");
345 #if SDL_VERSION_ATLEAST(2, 0, 5)
346  winEventLog(SDL_WINDOWEVENT_TAKE_FOCUS,
347  "SDL_WINDOWEVENT_TAKE_FOCUS");
348  winEventLog(SDL_WINDOWEVENT_HIT_TEST,
349  "SDL_WINDOWEVENT_HIT_TEST");
350 #endif // SDL_VERSION_ATLEAST(2, 0, 5)
351  default:
352  str = strprintf("unknown: %d",
353  event.window.event);
354  break;
355  }
356  logger->log("event: SDL_WINDOWEVENT: %s: %d,%d",
357  str.c_str(), data1, data2);
358  break;
359  }
360  case SDL_TEXTINPUT:
361  {
362  const char *const text = event.text.text;
363  logger->log("event: SDL_TEXTINPUT: %s", text);
364  const size_t sz = strlen(event.text.text);
365  for (size_t f = 0; f < sz; f ++)
366  logger->log("dec: %d", text[f]);
367  break;
368  }
369  case SDL_APP_TERMINATING:
370  logger->log("SDL_APP_TERMINATING");
371  break;
372  case SDL_APP_LOWMEMORY:
373  logger->log("SDL_APP_LOWMEMORY");
374  break;
375  case SDL_APP_WILLENTERBACKGROUND:
376  logger->log("SDL_APP_WILLENTERBACKGROUND");
377  break;
378  case SDL_APP_WILLENTERFOREGROUND:
379  logger->log("SDL_APP_WILLENTERFOREGROUND");
380  break;
381  case SDL_APP_DIDENTERFOREGROUND:
382  logger->log("SDL_APP_DIDENTERFOREGROUND");
383  break;
384  case SDL_APP_DIDENTERBACKGROUND:
385  logger->log("SDL_APP_DIDENTERBACKGROUND");
386  break;
387  case SDL_MOUSEWHEEL:
388 #if SDL_VERSION_ATLEAST(2, 0, 4)
389  logger->log("event: SDL_MOUSEWHEEL: %u,%u, %d,%d, %u",
390  event.wheel.windowID,
391  event.wheel.which,
392  event.wheel.x,
393  event.wheel.y,
394  event.wheel.direction);
395 #else // SDL_VERSION_ATLEAST(2, 0, 4)
396 
397  logger->log("event: SDL_MOUSEWHEEL: %u,%u, %d,%d",
398  event.wheel.windowID,
399  event.wheel.which,
400  event.wheel.x,
401  event.wheel.y);
402 #endif // SDL_VERSION_ATLEAST(2, 0, 4)
403  break;
404 #if SDL_VERSION_ATLEAST(2, 0, 4)
405  case SDL_AUDIODEVICEADDED:
406  logger->log("event: SDL_AUDIODEVICEADDED: %u,%u",
407  event.adevice.which,
408  event.adevice.iscapture);
409  break;
410  case SDL_KEYMAPCHANGED:
411  logger->log("event: SDL_KEYMAPCHANGED");
412  break;
413 #endif // SDL_VERSION_ATLEAST(2, 0, 4)
414  case SDL_MOUSEBUTTONDOWN:
415  logger->log("event: SDL_MOUSEBUTTONDOWN: %u,%u,%u, %d,%d",
416  event.button.which,
417  CAST_U32(event.button.button),
418  CAST_U32(event.button.state),
419  event.button.x,
420  event.button.y);
421  break;
422  case SDL_MOUSEBUTTONUP:
423  logger->log("event: SDL_MOUSEBUTTONUP: %u,%u,%u, %d,%d",
424  event.button.which,
425  CAST_U32(event.button.button),
426  CAST_U32(event.button.state),
427  event.button.x,
428  event.button.y);
429  break;
430  case SDL_JOYDEVICEADDED:
431  logger->log("event: SDL_JOYDEVICEADDED: %d",
432  event.jdevice.which);
433  break;
434  case SDL_JOYDEVICEREMOVED:
435  logger->log("event: SDL_JOYDEVICEREMOVED: %d",
436  event.jdevice.which);
437  break;
438 #else // USE_SDL2
439 
440  case SDL_MOUSEMOTION:
441  logger->log("event: SDL_MOUSEMOTION: %u,%d,%d",
442  event.motion.state, event.motion.x, event.motion.y);
443  break;
444  case SDL_KEYDOWN:
445  logger->log("event: SDL_KEYDOWN: %s(%d),%d,%d,%d",
446  SDL_GetKeyName(event.key.keysym.sym),
447  event.key.keysym.sym,
448  event.key.keysym.scancode,
449  event.key.state,
450  event.key.keysym.unicode);
451  break;
452  case SDL_KEYUP:
453  logger->log("event: SDL_KEYUP: %s(%d),%d,%d,%d",
454  SDL_GetKeyName(event.key.keysym.sym),
455  event.key.keysym.sym,
456  event.key.keysym.scancode,
457  event.key.state,
458  event.key.keysym.unicode);
459  break;
460  case SDL_VIDEORESIZE:
461  logger->log("event: SDL_VIDEORESIZE");
462  break;
463  case SDL_VIDEOEXPOSE:
464  logger->log("event: SDL_VIDEOEXPOSE");
465  break;
466  case SDL_ACTIVEEVENT:
467  logger->log("event: SDL_ACTIVEEVENT: %d %d",
468  event.active.state, event.active.gain);
469  break;
470  case SDL_MOUSEBUTTONDOWN:
471  logger->log("event: SDL_MOUSEBUTTONDOWN: %d,%d, %d,%d",
472  event.button.button,
473  event.button.state,
474  event.button.x,
475  event.button.y);
476  break;
477  case SDL_MOUSEBUTTONUP:
478  logger->log("event: SDL_MOUSEBUTTONUP: %d,%d,%d,%d",
479  event.button.button,
480  event.button.state,
481  event.button.x,
482  event.button.y);
483  break;
484 #endif // USE_SDL2
485 
486  case SDL_JOYAXISMOTION:
487  logger->log("event: SDL_JOYAXISMOTION: %d,%d,%d",
488  event.jaxis.which, event.jaxis.axis, event.jaxis.value);
489  break;
490  case SDL_JOYBALLMOTION:
491  logger->log("event: SDL_JOYBALLMOTION: %d,%d,%d,%d",
492  event.jball.which, event.jball.ball,
493  event.jball.xrel, event.jball.yrel);
494  break;
495  case SDL_JOYHATMOTION:
496  logger->log("event: SDL_JOYHATMOTION: %d,%d,%d", event.jhat.which,
497  event.jhat.hat, event.jhat.value);
498  break;
499  case SDL_JOYBUTTONDOWN:
500  logger->log("event: SDL_JOYBUTTONDOWN: %d,%d,%d",
501  event.jbutton.which, event.jbutton.button,
502  event.jbutton.state);
503  break;
504  case SDL_JOYBUTTONUP:
505  logger->log("event: SDL_JOYBUTTONUP: %d,%d,%d",
506  event.jbutton.which, event.jbutton.button,
507  event.jbutton.state);
508  break;
509  case SDL_QUIT:
510  logger->log("event: SDL_QUIT");
511  break;
512  case SDL_SYSWMEVENT:
513  {
514 #ifdef USE_X11
515  const bool res = X11Logger::logEvent(event);
516  if (res == false)
517  logger->assertLog("event: SDL_SYSWMEVENT: not supported:");
518 #else // USE_X11
519 
520  logger->assertLog("event: SDL_SYSWMEVENT: not supported:");
521 #endif // USE_X11
522 
523  break;
524  }
525  case SDL_USEREVENT:
526  logger->log("event: SDL_USEREVENT: %d",
527  event.user.code);
528  break;
529 #ifdef ANDROID
530 #ifndef USE_SDL2
531  case SDL_ACCELEROMETER:
532  logger->log("event: SDL_ACCELEROMETER");
533  break;
534 #endif // USE_SDL2
535 #endif // ANDROID
536 
537  default:
538  logger->assertLog("event: other: %u",
539  CAST_U32(event.type));
540  break;
541  }
542 }
#define CAST_S32
Definition: cast.h:30
#define CAST_U32
Definition: cast.h:31
int mWidth
Definition: graphics.h:484
int mHeight
Definition: graphics.h:485
void log(const char *const log_text,...)
Definition: logger.cpp:269
void assertLog(const char *const log_text,...)
Definition: logger.cpp:316
Graphics * mainGraphics
Definition: graphics.cpp:109
std::string strprintf(const char *const format,...)

References Logger::assertLog(), CAST_S32, CAST_U32, Logger::log(), logger, mainGraphics, Graphics::mHeight, Graphics::mWidth, and strprintf().

Referenced by handleCommonEvents().

◆ optionChanged()

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

Called when an option changed. The config listener will have to be registered to the option name first.

Implements ConfigListener.

Definition at line 220 of file eventsmanager.cpp.

221 {
222  if (name == "logInput")
223  mLogInput = config.getBoolValue("logInput");
224 }

References config, Configuration::getBoolValue(), and mLogInput.

◆ shutdown()

void EventsManager::shutdown ( )

Definition at line 85 of file eventsmanager.cpp.

86 {
87  config.removeListeners(this);
88 }
void removeListeners(ConfigListener *const listener)

References config, and Configuration::removeListeners().

Referenced by Client::gameClear().

Field Documentation

◆ mLogInput

bool EventsManager::mLogInput
protected

Definition at line 67 of file eventsmanager.h.

Referenced by enableEvents(), handleCommonEvents(), init(), and optionChanged().


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