From 731a1b930c4ca5c6494539877d56e01f90fce885 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 24 Aug 2018 20:05:03 +0800 Subject: *remove nonsense macros --- src/libjin/Core/Game.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/libjin/Core/Game.cpp') 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; -- cgit v1.1-26-g67d0