aboutsummaryrefslogtreecommitdiff
path: root/src/client/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/main.cpp')
-rw-r--r--src/client/main.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/client/main.cpp b/src/client/main.cpp
index b10b8ef..63b7131 100644
--- a/src/client/main.cpp
+++ b/src/client/main.cpp
@@ -19,6 +19,7 @@ extern "C" {
#include "lua_api/load_scene.hpp"
#include "lua_api/load_phys.hpp"
#include "lua_api/load_video.hpp"
+#include "lua_api/load_io.hpp"
#include "callbackhandeler.hpp"
#include <shared/lua_api/common.hpp>
@@ -52,6 +53,7 @@ void loadIrrLibs(lua_State* L, IrrlichtDevice* device){
printf("Loading videofuncs...");
load_videofuncs(L);
printf("[OK]\n");
+ load_iofuncs(L);
}
void RemoveISceneNode(btRigidBody* rb){
@@ -113,7 +115,7 @@ int main(int argc, char *argv[]){
//Create a new lua state, this gets shared everywhere
//Set the path for lua
- putenv("LUA_PATH=../data/?.lua");
+ putenv("LUA_PATH=?.lua");
lua_State *state = luaL_newstate();
L = state;
printf("Created lua state at %p\n",L);
@@ -125,19 +127,20 @@ int main(int argc, char *argv[]){
printf("Failed to initalize device\n");
return 1;
}
- ILogger* log = device->getLogger();
- log->setLogLevel(ELL_NONE);
+ device->getFileSystem()->changeWorkingDirectoryTo("../data");
+ //ILogger* log = device->getLogger();
+ //log->setLogLevel(ELL_NONE);
//Loads libraries for interfaceing with irrlicht
+ luaL_openlibs(state);
loadIrrLibs(state,device);
loadNetLibs(state);
- luaL_openlibs(state);
printf("Loadded irr libs...\n");
//Sets the global event handeler
printf("Creating event receiver\n");
GlobalEventReceiver ger = GlobalEventReceiver(device);
printf("Created event receiver\n");
device->setEventReceiver(&ger);
- int iErr = luaL_dofile(state,"../data/init.lua");
+ int iErr = luaL_dofile(state,"init.lua");
if(iErr != 0){
printf("Failed to open lua file:../data/init.lua\n");
lua_error(state);