temp script changes

This commit is contained in:
Kayne Ruse
2014-11-06 01:21:37 +11:00
parent a4ed23f6c7
commit daa38413f3
6 changed files with 9 additions and 12 deletions
+1
View File
@@ -0,0 +1 @@
--TODO: create a flexible saving & loading system
View File
+4 -5
View File
@@ -2,11 +2,10 @@ print("Lua script check")
mapMaker = require "map_maker" mapMaker = require "map_maker"
mapSaver = require "map_saver" mapSaver = require "map_saver"
roomSystem = require "room_system"
--BUG: #35 The server fails without at least one room --create the overworld, set it's generator, loader & saver
--TODO: Create rooms with names? local overworld = roomSystem.CreateRoom("overworld", "overworld.bmp")
newRoom = RoomManager.CreateRoom("overworld", "overworld.bmp") roomSystem.SetOnLoad(overworld, mapMaker.debugIsland, mapSaver.load, mapSaver.save)
pager = Room.GetPager(newRoom)
RegionPager.SetOnCreate(pager, mapMaker.debugIsland)
print("Finished the lua script") print("Finished the lua script")
+2 -6
View File
@@ -40,9 +40,7 @@
#include "lua.hpp" #include "lua.hpp"
#endif #endif
#include "region_api.hpp" #include "map_system_api.hpp"
#include "region_pager_api.hpp"
#include "tile_sheet_api.hpp"
#include "room_api.hpp" #include "room_api.hpp"
#include "room_manager_api.hpp" #include "room_manager_api.hpp"
@@ -61,9 +59,6 @@ static const luaL_Reg loadedlibs[] = {
{LUA_DBLIBNAME, luaopen_debug}, {LUA_DBLIBNAME, luaopen_debug},
//Tortuga's API //Tortuga's API
{TORTUGA_REGION_NAME, openRegionAPI},
{TORTUGA_REGION_PAGER_NAME, openRegionPagerAPI},
{TORTUGA_TILE_SHEET_NAME, openTileSheetAPI},
{TORTUGA_ROOM_NAME, openRoomAPI}, {TORTUGA_ROOM_NAME, openRoomAPI},
{TORTUGA_ROOM_MANAGER_NAME, openRoomManagerAPI}, {TORTUGA_ROOM_MANAGER_NAME, openRoomManagerAPI},
@@ -73,6 +68,7 @@ static const luaL_Reg loadedlibs[] = {
//these libs are preloaded and must be required before used //these libs are preloaded and must be required before used
static const luaL_Reg preloadedlibs[] = { static const luaL_Reg preloadedlibs[] = {
{TORTUGA_MAP_SYSTEM_API, openMapSystemAPI},
{NULL, NULL} {NULL, NULL}
}; };
-1
View File
@@ -58,7 +58,6 @@ private:
std::list<Entity*> entityList; std::list<Entity*> entityList;
//lua references //lua references
int createRef = LUA_NOREF;
int loadRef = LUA_NOREF; int loadRef = LUA_NOREF;
int unloadRef = LUA_NOREF; int unloadRef = LUA_NOREF;
}; };
+2
View File
@@ -35,6 +35,8 @@
//public methods //public methods
//------------------------- //-------------------------
//BUG: #35 The server fails without at least one room
void ServerApplication::Init(int argc, char* argv[]) { void ServerApplication::Init(int argc, char* argv[]) {
//NOTE: I might need to rearrange the init process so that lua & SQL can interact with the map system as needed. //NOTE: I might need to rearrange the init process so that lua & SQL can interact with the map system as needed.
std::cout << "Beginning " << argv[0] << std::endl; std::cout << "Beginning " << argv[0] << std::endl;