| 682 | // *********************************************************************** |
| 683 | |
| 684 | void Tick(f32 deltaTime) { |
| 685 | FileWatcherProcessChanges(pState->pWatcher); |
| 686 | |
| 687 | if (!pState->appLoaded) return; |
| 688 | |
| 689 | lua_State* L = pState->pProgramState; |
| 690 | lua_getglobal(L, "update"); |
| 691 | if (lua_isfunction(L, -1)) { |
| 692 | lua_pushnumber(L, deltaTime); |
| 693 | if (lua_pcall(L, 1, 0, 0) != LUA_OK) { |
| 694 | Log::Warn("Lua Runtime Error: %s", lua_tostring(L, lua_gettop(L))); |
| 695 | lua_pop(L, 1); |
| 696 | } |
| 697 | } else { |
| 698 | lua_pop(L, 1); |
| 699 | } |
| 700 | } |
| 701 | |
| 702 | // *********************************************************************** |
| 703 | |