aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2018-03-09 23:55:49 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2018-03-09 23:55:49 -0500
commit2831e232b886c5e3b0791ea5192f9e5194e6abf3 (patch)
tree4fb9309d18f388673b7a21b8f0e927727006f585 /src/server
parent35b7c646fd7f80b64c1ef49b6d81f9df9bc1b940 (diff)
downloadbrokengine-2831e232b886c5e3b0791ea5192f9e5194e6abf3.tar.gz
brokengine-2831e232b886c5e3b0791ea5192f9e5194e6abf3.tar.bz2
brokengine-2831e232b886c5e3b0791ea5192f9e5194e6abf3.zip
Added IGUIImages
Added the ability to display itextures on the gui
Diffstat (limited to 'src/server')
-rw-r--r--src/server/main.cpp13
1 files changed, 13 insertions, 0 deletions
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);