Add sheets packer tool for shard GPMS and CContinentContainer

This commit is contained in:
kaetemi 2014-02-18 22:37:21 +01:00
parent a3830705ef
commit 116e3440c8
4 changed files with 32 additions and 3 deletions

View file

@ -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; _GridWidth = gridWidth;
_GridHeight = gridHeight; _GridHeight = gridHeight;
@ -56,6 +56,12 @@ void CContinentContainer::init(uint gridWidth, uint gridHeight, double primitive
_CellSize = cellSize; _CellSize = cellSize;
_LoadPacsPrims = loadPacsPrims; _LoadPacsPrims = loadPacsPrims;
buildSheets(packedSheetsDirectory);
}
//
void CContinentContainer::buildSheets(const string &packedSheetsDirectory)
{
std::vector<std::string> filters; std::vector<std::string> filters;
filters.push_back("continent"); filters.push_back("continent");
loadForm(filters, packedSheetsDirectory+"continents.packed_sheets", _SheetMap); loadForm(filters, packedSheetsDirectory+"continents.packed_sheets", _SheetMap);

View file

@ -161,7 +161,10 @@ public:
CContinentContainer(); CContinentContainer();
/// Init whole continent container /// 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 /// Init pacs prims
void initPacsPrim(const std::string &path = std::string("landscape_col_prim_pacs_list.txt")); void initPacsPrim(const std::string &path = std::string("landscape_col_prim_pacs_list.txt"));

View file

@ -2,11 +2,14 @@ FILE(GLOB SRC *.cpp *.h)
ADD_EXECUTABLE(sheets_packer_shard ${SRC} 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_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) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/ryzom/common/src ${CMAKE_SOURCE_DIR}/ryzom/server/src)
TARGET_LINK_LIBRARIES(sheets_packer_shard TARGET_LINK_LIBRARIES(sheets_packer_shard
ryzom_gameshare ryzom_gameshare
ryzom_servershare
nelmisc nelmisc
nelgeorges nelgeorges
nelnet nelnet

View file

@ -33,6 +33,8 @@
#include <nel/georges/load_form.h> #include <nel/georges/load_form.h>
#include <game_share/data_set_base.h> #include <game_share/data_set_base.h>
#include <input_output_service/string_manager.h> #include <input_output_service/string_manager.h>
#include <gpm_service/sheets.h>
#include <server_share/continent_container.h>
// Project includes // Project includes
// ... // ...
@ -108,6 +110,21 @@ int main(int nNbArg, char **ppArgs)
exts.push_back("race_stats"); exts.push_back("race_stats");
loadForm(exts, exportDir + "/ios_sheets.packed_sheets", container); loadForm(exts, exportDir + "/ios_sheets.packed_sheets", container);
} }
// GPMS
{
std::map<NLMISC::CSheetId, CSheets::CSheet> container;
std::vector<std::string> 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 // and that's all folks
return EXIT_SUCCESS; return EXIT_SUCCESS;