From 2831e232b886c5e3b0791ea5192f9e5194e6abf3 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Fri, 9 Mar 2018 23:55:49 -0500 Subject: Added IGUIImages Added the ability to display itextures on the gui --- src/server/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/server/main.cpp') diff --git a/src/server/main.cpp b/src/server/main.cpp index 17fd535..94e0dbd 100644 --- a/src/server/main.cpp +++ b/src/server/main.cpp @@ -23,6 +23,7 @@ extern "C" { #include "../shared/lua_api/common.h" #include "../shared/lua_api/load_net.hpp" +#include "../shared/lua_api/load_phys.hpp" #include "../shared/phys/physcommon.hpp" using namespace std; @@ -38,9 +39,13 @@ int main (){ printf("Brok[en]gine Server\n"); L = luaL_newstate(); + lua_newtable(L); + lua_setglobal(L,"GAME"); + phys_genesis(); loadLLibs(L); loadNetLibs(L); + loadPhysLibs(L); int iErr = luaL_dofile(L,"../data/init.lua"); if(iErr != 0){ lua_error(L); @@ -49,6 +54,14 @@ int main (){ do{ gameloop(); std::this_thread::yield(); + lua_getglobal(L,"GAME");//{} + lua_getfield(L,-1,"tick");//{},function_tick() + if(!lua_isnil(L,-1)){ + lua_call(L,0,0); + lua_pop(L,1); + }else{ + lua_pop(L,2); + } }while(true); phys_shutdown(NULL); -- cgit v1.2.3-70-g09d2