void Purity::PhysicsSystem::runUpdateScripts() { LuaManager* luaManager = LuaManager::getManager(); std::string physicsUpdateScript = mCurrentScene->getLuaPhysicsUpdatePath(); luaManager->doFile(physicsUpdateScript); }
void Purity::PhysicsSystem::handleInput() { std::string luaEventHandlerFileName = mCurrentScene->getLuaEventHandlerPath(); std::string luaEventHandlerFunction = mCurrentScene->getLuaEventHandlerFunctionName(); LuaManager* luaManager = LuaManager::getManager(); lua_State* luaState = luaManager->getState(); while (!mInputQueue->empty()) { sf::Event event = mInputQueue->front(); mInputQueue->pop(); luaManager->doFile(luaEventHandlerFileName); luabind::call_function<void>(luaState, luaEventHandlerFunction.c_str(), event); } }