From 19e12305515d958c5de586c2a409979b3d193ce6 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 31 May 2009 15:09:00 -0500 Subject: [7913] Fixed vmap_assambler sources. Updated binary. Author: VladimirMangos * Fixed week ago added bugs into vmap code that break vmap_assambler sources work. Note: vmap_assambler binary not updated from nov 2008 until this commit and it has been correct working. * Add to vmap assambler process show output and add appropriate error messages output. * vmap_assambler binary updated. --HG-- branch : trunk --- contrib/vmap_assembler/vmap_assembler.cpp | 58 ++++++++++++++++--------------- 1 file changed, 30 insertions(+), 28 deletions(-) (limited to 'contrib/vmap_assembler/vmap_assembler.cpp') diff --git a/contrib/vmap_assembler/vmap_assembler.cpp b/contrib/vmap_assembler/vmap_assembler.cpp index bf720099788..e6a3089f328 100644 --- a/contrib/vmap_assembler/vmap_assembler.cpp +++ b/contrib/vmap_assembler/vmap_assembler.cpp @@ -78,42 +78,44 @@ bool readConfigFile(char *pConffile, VMAP::TileAssembler* pTa) //======================================================= int main(int argc, char* argv[]) { - if(argc == 3 || argc == 4) + if(argc != 3 && argc != 4) { - bool ok = true; - char *src = argv[1]; - char *dest = argv[2]; - char *conffile = NULL; - if(argc >= 4) { - conffile = argv[3]; - } - VMAP::TileAssembler* ta = new VMAP::TileAssembler(std::string(src), std::string(dest)); - ta->setModelNameFilterMethod(modelNameFilter); + printf("\nusage: %s [config file name]\n", argv[0]); + return 1; + } - /* - All the names in the list are considered to be world maps or huge instances. - These maps will be spilt into tiles in the vmap assemble process - */ - if(conffile != NULL) { - ok = readConfigFile(conffile, ta); - if(!ok) { - printf("Can not open file config file: %s\n", conffile); - } - } - if(ok) { ok = ta->convertWorld(); } - if(ok) { - printf("Ok, all done\n"); - } else { - printf("exit with errors\n"); + char *src = argv[1]; + char *dest = argv[2]; + char *conffile = NULL; + if(argc >= 4) + conffile = argv[3]; + + VMAP::TileAssembler* ta = new VMAP::TileAssembler(std::string(src), std::string(dest)); + ta->setModelNameFilterMethod(modelNameFilter); + + /* + All the names in the list are considered to be world maps or huge instances. + These maps will be spilt into tiles in the vmap assemble process + */ + if(conffile != NULL) + { + if(!readConfigFile(conffile, ta)) + { + printf("Can not open file config file: %s\n", conffile); + delete ta; return 1; } - delete ta; } - else + + if(!ta->convertWorld()) { - printf("\nusage: %s [config file name]\n", argv[0]); + printf("exit with errors\n"); + delete ta; return 1; } + + delete ta; + printf("Ok, all done\n"); return 0; } -- cgit v1.2.3