From 9d9e0e15291ef48af7fac9b797a12505b5af6857 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 19 Feb 2014 00:07:22 +0100 Subject: [PATCH] Add sheets packer tool for CTimeDateSeasonManager --- .../time_weather_season/time_date_season_manager.cpp | 9 ++++++--- .../time_weather_season/time_date_season_manager.h | 1 + .../tools/sheets_packer_shard/sheets_packer_shard.cpp | 8 +++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/code/ryzom/common/src/game_share/time_weather_season/time_date_season_manager.cpp b/code/ryzom/common/src/game_share/time_weather_season/time_date_season_manager.cpp index 5ce57fced..12eebd0fd 100644 --- a/code/ryzom/common/src/game_share/time_weather_season/time_date_season_manager.cpp +++ b/code/ryzom/common/src/game_share/time_weather_season/time_date_season_manager.cpp @@ -42,9 +42,12 @@ std::map< NLMISC::CSheetId, CStaticLightCycle > CTimeDateSeasonManager::_StaticL void CTimeDateSeasonManager::init( uint32 /* startDay */, float /* startTime */) { // load light cycle sheet - string lightCycleFile = IService::getInstance()->WriteFilesDirectory; - lightCycleFile = lightCycleFile + string("light_cycles.packed_sheets"); - loadForm( "light_cycle", lightCycleFile, _StaticLightCyclesHours ); + packSheets(IService::getInstance()->WriteFilesDirectory); +} + +void CTimeDateSeasonManager::packSheets(const std::string &writeDirectory) +{ + loadForm("light_cycle", writeDirectory + "light_cycles.packed_sheets", _StaticLightCyclesHours); } diff --git a/code/ryzom/common/src/game_share/time_weather_season/time_date_season_manager.h b/code/ryzom/common/src/game_share/time_weather_season/time_date_season_manager.h index 1a0bd32bc..62b988ad7 100644 --- a/code/ryzom/common/src/game_share/time_weather_season/time_date_season_manager.h +++ b/code/ryzom/common/src/game_share/time_weather_season/time_date_season_manager.h @@ -36,6 +36,7 @@ class CTimeDateSeasonManager public: // init RyzomTime, date, weather static void init( uint32 startDay = RYZOM_START_DAY, float startTime = RYZOM_START_HOUR ); + static void packSheets(const std::string &writeDirectory); // tick update => update ryzom time static void tickUpdate(); diff --git a/code/ryzom/tools/sheets_packer_shard/sheets_packer_shard.cpp b/code/ryzom/tools/sheets_packer_shard/sheets_packer_shard.cpp index 3d3372302..eb735e02e 100644 --- a/code/ryzom/tools/sheets_packer_shard/sheets_packer_shard.cpp +++ b/code/ryzom/tools/sheets_packer_shard/sheets_packer_shard.cpp @@ -37,6 +37,7 @@ #include #include #include +#include // Project includes // ... @@ -68,7 +69,7 @@ int main(int nNbArg, char **ppArgs) // verify all params if (nNbArg < 6) { - // >sheets_packer_shard.exe L:\leveldesign L:\leveldesign\DFN R:\code\ryzom\server\data_shard\mirror_sheets T:\export\common\leveldesign\visual_slot_tab T:\test_shard + // sheets_packer_shard.exe L:\leveldesign L:\leveldesign\DFN R:\code\ryzom\server\data_shard\mirror_sheets T:\export\common\leveldesign\visual_slot_tab T:\test_shard nlinfo("ERROR : Wrong number of arguments\n"); nlinfo("USAGE : sheets_packer_shard \n"); nlinfo(" : Directory containing visual_slots.tab"); @@ -154,6 +155,11 @@ int main(int nNbArg, char **ppArgs) { CSheets::init(); } + + // CTimeDateSeasonManager + { + CTimeDateSeasonManager::packSheets(s_WriteDirectory); + } // and that's all folks return EXIT_SUCCESS;