From 78ee1357ccaf6c821f07db045841c18da0c2ab66 Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Sun, 18 Dec 2005 20:35:54 +0000 Subject: Added a map manager to load/unload/relod maps. --- src/main.cpp | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 419c00e2..f3064eda 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,28 +20,27 @@ * $Id$ */ - +#include #include - +#include #include #include -#include - #ifdef __USE_UNIX98 #include "../config.h" #endif -#include "netsession.h" -#include "connectionhandler.h" #include "accounthandler.h" -#include "gamehandler.h" #include "chathandler.h" -#include "storage.h" #include "configuration.h" -#include "state.h" - +#include "connectionhandler.h" +#include "gamehandler.h" +#include "mapmanager.h" +#include "netsession.h" +#include "resourcemanager.h" #include "skill.h" +#include "state.h" +#include "storage.h" #include "utils/logger.h" @@ -176,6 +175,14 @@ void initialize() config.init(configPath); LOG_INFO("Using Config File: " << configPath) LOG_INFO("Using Log File: " << LOG_FILE) + + // Initialize PhysicsFS + PHYSFS_init(""); + + // TODO: only a test, maps should be loaded as they are needed + tmwserv::MapManager::instance().loadMap("tulimshar.tmx.gz"); + tmwserv::MapManager::instance().reloadMap("tulimshar.tmx.gz"); + tmwserv::MapManager::instance().unloadMap("tulimshar.tmx.gz"); } @@ -206,6 +213,8 @@ void deinitialize() // Get rid of persistent data storage tmwserv::Storage::destroy(); + + PHYSFS_deinit(); } -- cgit v1.2.3-60-g2f50