本文整理汇总了C++中MediaList::dump方法的典型用法代码示例。如果您正苦于以下问题:C++ MediaList::dump方法的具体用法?C++ MediaList::dump怎么用?C++ MediaList::dump使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaList
的用法示例。
在下文中一共展示了MediaList::dump方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compile
void compile (char * inName, char * dir, MediaList &includeMedia, bool verbose) {
char * orgName = inName;
MultiPathFile::addPath (inName, true); // main path is set as last path
int cd = open (".", O_RDONLY);
int i = lastIndexOf (inName, '/');
if (i >= 0) {
inName [i] = '\0';
chdir (inName);
//MultiPathFile::addPath (inName);
inName += i+1;
}
char * binName = strdup (inName);
strcpy (binName+strlen(binName)-3, "m4m");
printf ("compile %s -> %s/%s\n", orgName, dir, binName);
Scene scene (binName, verbose);
FILE * in = fopen (inName, "rb");
if (in == NULL) {
fprintf (myStderr, "cannot open %s", inName);
exit (1);
}
printf (">> Compiling scene %s\n", inName);
scene.parse (inName, in, verbose);
fchdir (cd);
char * outName = (char *)malloc (strlen (binName)+strlen(dir)+2);
sprintf (outName, "%s/%s", dir, binName);
FILE * out = fopen (outName, "wb");
if (out == NULL) {
fprintf (myStderr, "Cannot open %s for writing, please check if path exists\n", outName);
exit (1);
}
int total = includeMedia.dump (out);
total += scene.encode (out, verbose);
total += FontManager::dumpAll (execPath, out);
write (out, 0xFFFF); // final end of file
printf ("<< End of scene %s [%d B]\n", inName, total);
fclose (in);
fclose (out);
LocaleManager::checkMissingTranslations();
}