diff options
| author | chai <chaifix@163.com> | 2018-08-24 20:05:03 +0800 | 
|---|---|---|
| committer | chai <chaifix@163.com> | 2018-08-24 20:05:03 +0800 | 
| commit | 731a1b930c4ca5c6494539877d56e01f90fce885 (patch) | |
| tree | c84a7f0523d225dffd4f2dc835730507b7973051 /src/libjin/core/game.cpp | |
| parent | e6e3c76c1f2829537d368501a74af0646f5559d4 (diff) | |
*remove nonsense macros
Diffstat (limited to 'src/libjin/core/game.cpp')
| -rw-r--r-- | src/libjin/core/game.cpp | 10 | 
1 files changed, 6 insertions, 4 deletions
| diff --git a/src/libjin/core/game.cpp b/src/libjin/core/game.cpp index b480b12..3f905f2 100644 --- a/src/libjin/core/game.cpp +++ b/src/libjin/core/game.cpp @@ -19,7 +19,8 @@ namespace core      void Game::run()      { -        SAFECALL(_onLoad); +		if (_onLoad != nullptr) +			_onLoad();          Window* wnd = Window::get();          const int FPS = wnd ? wnd->getFPS() : 60;          const int MS_PER_UPDATE = 1000.0f / FPS; @@ -31,11 +32,12 @@ namespace core          {              while (jin::input::pollEvent(&e))              { -                SAFECALL(_onEvent, &e); +				if (_onEvent != nullptr) +					_onEvent(&e);                  if (!_running) goto quitloop;              } -            SAFECALL(_onUpdate, dt); -            SAFECALL(_onDraw); +			if (_onUpdate != nullptr) _onUpdate(dt); +			if (_onDraw != nullptr) _onDraw();              wnd->swapBuffers();              const int current = getMilliSecond();              dt = current - previous; | 
