From 116e3440c826f1e11d040d7ddde1b2d792559416 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 18 Feb 2014 22:37:21 +0100 Subject: [PATCH] Add sheets packer tool for shard GPMS and CContinentContainer --- .../src/server_share/continent_container.cpp | 8 +++++++- .../src/server_share/continent_container.h | 5 ++++- .../tools/sheets_packer_shard/CMakeLists.txt | 5 ++++- .../sheets_packer_shard/sheets_packer_shard.cpp | 17 +++++++++++++++++ 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/code/ryzom/server/src/server_share/continent_container.cpp b/code/ryzom/server/src/server_share/continent_container.cpp index d94c0f9e8..dc3d1ccc4 100644 --- a/code/ryzom/server/src/server_share/continent_container.cpp +++ b/code/ryzom/server/src/server_share/continent_container.cpp @@ -47,7 +47,7 @@ CContinentContainer::CContinentContainer() } // -void CContinentContainer::init(uint gridWidth, uint gridHeight, double primitiveMaxSize, uint nbWorldImages, const string packedSheetsDirectory, double cellSize, bool loadPacsPrims) +void CContinentContainer::init(uint gridWidth, uint gridHeight, double primitiveMaxSize, uint nbWorldImages, const string &packedSheetsDirectory, double cellSize, bool loadPacsPrims) { _GridWidth = gridWidth; _GridHeight = gridHeight; @@ -56,6 +56,12 @@ void CContinentContainer::init(uint gridWidth, uint gridHeight, double primitive _CellSize = cellSize; _LoadPacsPrims = loadPacsPrims; + buildSheets(packedSheetsDirectory); +} + +// +void CContinentContainer::buildSheets(const string &packedSheetsDirectory) +{ std::vector filters; filters.push_back("continent"); loadForm(filters, packedSheetsDirectory+"continents.packed_sheets", _SheetMap); diff --git a/code/ryzom/server/src/server_share/continent_container.h b/code/ryzom/server/src/server_share/continent_container.h index f6f33f890..7edfb0c96 100644 --- a/code/ryzom/server/src/server_share/continent_container.h +++ b/code/ryzom/server/src/server_share/continent_container.h @@ -161,7 +161,10 @@ public: CContinentContainer(); /// Init whole continent container - void init(uint gridWidth, uint gridHeight, double primitiveMaxSize, uint nbWorldImages, const std::string packedSheetsDirectory, double cellSize=0.0, bool loadPacsPrims = true); + void init(uint gridWidth, uint gridHeight, double primitiveMaxSize, uint nbWorldImages, const std::string &packedSheetsDirectory, double cellSize=0.0, bool loadPacsPrims = true); + + /// Build sheets + void buildSheets(const std::string &packedSheetsDirectory); /// Init pacs prims void initPacsPrim(const std::string &path = std::string("landscape_col_prim_pacs_list.txt")); diff --git a/code/ryzom/tools/sheets_packer_shard/CMakeLists.txt b/code/ryzom/tools/sheets_packer_shard/CMakeLists.txt index bd568121a..5b8d6b181 100644 --- a/code/ryzom/tools/sheets_packer_shard/CMakeLists.txt +++ b/code/ryzom/tools/sheets_packer_shard/CMakeLists.txt @@ -2,11 +2,14 @@ FILE(GLOB SRC *.cpp *.h) ADD_EXECUTABLE(sheets_packer_shard ${SRC} ${CMAKE_SOURCE_DIR}/ryzom/server/src/input_output_service/string_manager_sheet.cpp - ${CMAKE_SOURCE_DIR}/ryzom/server/src/input_output_service/string_manager.h) + ${CMAKE_SOURCE_DIR}/ryzom/server/src/input_output_service/string_manager.h + ${CMAKE_SOURCE_DIR}/ryzom/server/src/gpm_service/sheets.cpp + ${CMAKE_SOURCE_DIR}/ryzom/server/src/gpm_service/sheets.h) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/ryzom/common/src ${CMAKE_SOURCE_DIR}/ryzom/server/src) TARGET_LINK_LIBRARIES(sheets_packer_shard ryzom_gameshare + ryzom_servershare nelmisc nelgeorges nelnet 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 3f0333a85..2fc2a9a4c 100644 --- a/code/ryzom/tools/sheets_packer_shard/sheets_packer_shard.cpp +++ b/code/ryzom/tools/sheets_packer_shard/sheets_packer_shard.cpp @@ -33,6 +33,8 @@ #include #include #include +#include +#include // Project includes // ... @@ -108,6 +110,21 @@ int main(int nNbArg, char **ppArgs) exts.push_back("race_stats"); loadForm(exts, exportDir + "/ios_sheets.packed_sheets", container); } + + // GPMS + { + std::map container; + std::vector filters; + filters.push_back("creature"); + filters.push_back("player"); + loadForm(filters, exportDir + "/gpms.packed_sheets", container); + } + + // CContinentContainer + { + CContinentContainer continents; + continents.buildSheets(exportDir + "/"); + } // and that's all folks return EXIT_SUCCESS;