本文整理汇总了C++中IReadFile::getFileName方法的典型用法代码示例。如果您正苦于以下问题:C++ IReadFile::getFileName方法的具体用法?C++ IReadFile::getFileName怎么用?C++ IReadFile::getFileName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IReadFile
的用法示例。
在下文中一共展示了IReadFile::getFileName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getTexture
//! loads a Texture
ITexture* CNullDriver::getTexture(const path& filename)
{
// Identify textures by their absolute filenames if possible.
const path absolutePath = FileSystem->getAbsolutePath(filename);
ITexture* texture = findTexture(absolutePath);
if (texture)
return texture;
// Then try the raw filename, which might be in an Archive
texture = findTexture(filename);
if (texture)
return texture;
// Now try to open the file using the complete path.
IReadFile* file = FileSystem->createAndOpenFile(absolutePath);
if (!file)
{
// Try to open it using the raw filename.
file = FileSystem->createAndOpenFile(filename);
}
if (file)
{
// Re-check name for actual archive names
texture = findTexture(file->getFileName());
if (texture)
{
file->releaseRef();
return texture;
}
texture = loadTextureFromFile(file);
file->releaseRef();
if (texture)
{
addTexture(texture);
texture->releaseRef(); // drop it because we created it, one grab too much
}
else
Printer::log("Could not load texture", filename, ELL_ERROR);
return texture;
}
else
{
Printer::log("Could not open file of texture", filename, ELL_WARNING);
return 0;
}
}