diff --git a/client/client_application.cpp b/client/client_application.cpp index 267440c..b9a31bd 100644 --- a/client/client_application.cpp +++ b/client/client_application.cpp @@ -51,7 +51,11 @@ void ClientApplication::Init(int argc, char** argv) { if (SDL_Init(SDL_INIT_VIDEO)) { throw(std::runtime_error("Failed to initialize SDL")); } - BaseScene::SetScreen(config.Int("screen.w"), config.Int("screen.h"), 0, (config.Bool("screen.f")) ? SDL_HWSURFACE|SDL_DOUBLEBUF|SDL_FULLSCREEN : SDL_HWSURFACE|SDL_DOUBLEBUF); + int w = config.Int("client.screen.w"); + int h = config.Int("client.screen.h"); + int f = config.Bool("client.screen.f") ? SDL_HWSURFACE|SDL_DOUBLEBUF|SDL_FULLSCREEN : SDL_HWSURFACE|SDL_DOUBLEBUF; + + BaseScene::SetScreen(w ? w : 800, h ? h : 600, 0, f); //initialize SDL_net if (SDLNet_Init()) { diff --git a/client/options_menu.hpp b/client/options_menu.hpp index 94008d3..37e4e64 100644 --- a/client/options_menu.hpp +++ b/client/options_menu.hpp @@ -29,6 +29,7 @@ #include "raster_font.hpp" #include "button.hpp" +//TODO: The options screen needs to be USED class OptionsMenu : public BaseScene { public: //Public access members diff --git a/client/restart.cpp b/client/restart.cpp index 91f266e..66377c1 100644 --- a/client/restart.cpp +++ b/client/restart.cpp @@ -89,6 +89,10 @@ void Restart::Update(double delta) { if (std::chrono::steady_clock::now() - startTick > std::chrono::duration(10)) { QuitEvent(); } + + while(network.Receive()) { + //EAT INCOMING PACKETS + } } void Restart::RenderFrame() { diff --git a/common/map/region.hpp b/common/map/region.hpp index d45628f..560161b 100644 --- a/common/map/region.hpp +++ b/common/map/region.hpp @@ -28,7 +28,7 @@ class Region { public: - typedef unsigned short type_t; + typedef unsigned char type_t; Region() = delete; Region(int x, int y); diff --git a/rsc/config.cfg b/rsc/config.cfg index b93fe60..b2f34d9 100644 --- a/rsc/config.cfg +++ b/rsc/config.cfg @@ -1,13 +1,18 @@ #configuration of the programs + +#server specific settings server.host = 255.255.255.255 server.port = 21795 server.name = local server.dbname = database.db -screen.w = 800 -screen.h = 600 -screen.f = false +#client specific settings +client.screen.f = false + +client.username = Kayne Ruse +client.handle = Ratstail91 +client.avatar = elliot2.bmp #directories dir.fonts = rsc/graphics/fonts/ @@ -16,15 +21,9 @@ dir.sprites = rsc/graphics/sprites/ dir.tilesets = rsc/graphics/tilesets/ dir.interface = rsc/graphics/interface/ dir.scripts = rsc/scripts/ +dir.maps = rsc/maps/ #map system -map.pager.width = 20 -map.pager.height = 20 -map.pager.depth = 3 - -#player options -client.username = Kayne Ruse -client.handle = Ratstail91 -client.avatar = elliot2.bmp +map.savename = servermap #debugging diff --git a/rsc/graphics/tilesets/blank.bmp b/rsc/graphics/tilesets/blank.bmp new file mode 100644 index 0000000..44b11c7 Binary files /dev/null and b/rsc/graphics/tilesets/blank.bmp differ diff --git a/server/server_internals.cpp b/server/server_internals.cpp index 1cfeb4c..4ee835f 100644 --- a/server/server_internals.cpp +++ b/server/server_internals.cpp @@ -78,8 +78,7 @@ void ServerApplication::Init(int argc, char** argv) { //setup the map object regionPager.GetAllocator()->SetLuaState(luaState); regionPager.GetFormat()->SetLuaState(luaState); - //TODO: config parameter - regionPager.GetFormat()->SetSaveDir("save/mapname/"); + regionPager.GetFormat()->SetSaveDir(config["dir.maps"] + config["map.savename"]); std::cout << "Prepared the map system" << std::endl; //push the pager onto the lua registry