本文整理汇总了C++中CTexture::setChecksum方法的典型用法代码示例。如果您正苦于以下问题:C++ CTexture::setChecksum方法的具体用法?C++ CTexture::setChecksum怎么用?C++ CTexture::setChecksum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTexture
的用法示例。
在下文中一共展示了CTexture::setChecksum方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gen_import_cubemap
bool gen_import_cubemap(ImportOptions* opts) {
CTexture *tex = new CTexture();
ImportOptions pngOpts;
memset(&pngOpts, 0, sizeof(ImportOptions));
pngOpts.exporter = gen_import_cubemap_process_image;
pngOpts.outpath = opts->outpath;
pngOpts.expArgs = opts->expArgs;
pngOpts.path = opts->path;
char search_path[FILENAME_MAX];
memset(&search_path, 0, sizeof(search_path));
strcpy(search_path, opts->path);
if(opts->path[strlen(opts->path)] != '/')
strcat(search_path, "//");
CubemapParams params;
params.tex = tex;
pngOpts.extra = (void *)¶ms;
FileSearcher *searcher = new FileSearcher(opts->path, cubemap_on_found_file, &pngOpts);
searcher->run();
delete searcher;
uint32_t checksum = crc32(0, opts->path, strlen(opts->path));
printf("%08X path\n", checksum);
tex->setChecksum(checksum);
CTextureCollection *tex_col = new CTextureCollection();
tex_col->AddTexture(tex);
ExportOptions expOpts;
memset(&expOpts, 0, sizeof(expOpts));
expOpts.path = opts->outpath;
expOpts.srcPath = opts->path;
expOpts.dataClass = (void *)tex_col;
expOpts.extra = opts->extra;
expOpts.args = opts->expArgs;
opts->exporter(&expOpts);
//TODO: delete the textures inside :C
delete tex;
return true;
}