本文整理汇总了C++中WDT_file类的典型用法代码示例。如果您正苦于以下问题:C++ WDT_file类的具体用法?C++ WDT_file怎么用?C++ WDT_file使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WDT_file类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ExtractMapsFromMpq
void ExtractMapsFromMpq(uint32 build, const int locale)
{
char mpq_filename[1024];
char output_filename[1024];
char mpq_map_name[1024];
printf("\nExtracting maps...\n");
if (build==17520)
{
build = 18273;
}
uint32 map_count = ReadMapDBC(locale);
ReadAreaTableDBC(locale);
ReadLiquidTypeTableDBC(locale);
std::string path = output_path;
path += "/maps/";
CreateDir(path);
printf("Convert map files\n");
for (uint32 z = 0; z < map_count; ++z)
{
printf("Extract %s (%d/%d) \n", map_ids[z].name, z + 1, map_count);
// Loadup map grid data
sprintf(mpq_map_name, "World\\Maps\\%s\\%s.wdt", map_ids[z].name, map_ids[z].name);
WDT_file wdt;
if (!wdt.loadFile(mpq_map_name, false))
continue;
for (uint32 y = 0; y < WDT_MAP_SIZE; ++y)
{
for (uint32 x = 0; x < WDT_MAP_SIZE; ++x)
{
if (!wdt.main->adt_list[y][x].exist)
continue;
sprintf(mpq_filename, "World\\Maps\\%s\\%s_%u_%u.adt", map_ids[z].name, map_ids[z].name, x, y);
sprintf(output_filename, "%s/maps/%03u%02u%02u.map", output_path, map_ids[z].id, y, x);
ConvertADT(mpq_filename, output_filename, y, x, build);
}
// draw progress bar
printf("Processing........................%d%%\r", (100 * (y + 1)) / WDT_MAP_SIZE);
}
}
delete [] areas;
delete [] map_ids;
}
开发者ID:Chuck5ta,项目名称:server-4,代码行数:49,代码来源:System.cpp
示例2: ExtractMapsFromMpq
void ExtractMapsFromMpq(uint32 build)
{
std::string mpqFileName;
std::string outputFileName;
std::string mpqMapName;
printf("Extracting maps...\n");
uint32 map_count = ReadMapDBC();
ReadLiquidTypeTableDBC();
std::string path = output_path;
path += "/maps/";
CreateDir(path);
printf("Convert map files\n");
for(uint32 z = 0; z < map_count; ++z)
{
printf("Extract %s (%d/%u) \n", map_ids[z].name, z+1, map_count);
// Loadup map grid data
mpqMapName = Trinity::StringFormat("World\\Maps\\%s\\%s.wdt", map_ids[z].name, map_ids[z].name);
WDT_file wdt;
if (!wdt.loadFile(mpqMapName, false))
{
// printf("Error loading %s map wdt data\n", map_ids[z].name);
continue;
}
for(uint32 y = 0; y < WDT_MAP_SIZE; ++y)
{
for(uint32 x = 0; x < WDT_MAP_SIZE; ++x)
{
if (!wdt.main->adt_list[y][x].exist)
continue;
mpqFileName = Trinity::StringFormat("World\\Maps\\%s\\%s_%u_%u.adt", map_ids[z].name, map_ids[z].name, x, y);
outputFileName = Trinity::StringFormat("%s/maps/%03u%02u%02u.map", output_path, map_ids[z].id, y, x);
ConvertADT(mpqFileName, outputFileName, y, x, build);
}
// draw progress bar
printf("Processing........................%d%%\r", (100 * (y+1)) / WDT_MAP_SIZE);
}
}
printf("\n");
delete[] map_ids;
}
开发者ID:martial69320,项目名称:cerberus,代码行数:48,代码来源:System.cpp
注:本文中的WDT_file类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论