本文整理汇总了C++中FilePath::IsEqualToExtension方法的典型用法代码示例。如果您正苦于以下问题:C++ FilePath::IsEqualToExtension方法的具体用法?C++ FilePath::IsEqualToExtension怎么用?C++ FilePath::IsEqualToExtension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FilePath
的用法示例。
在下文中一共展示了FilePath::IsEqualToExtension方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EnumerateSceneTextures
uint32 TextureHelper::EnumerateSceneTextures(DAVA::Scene* scene)
{
Map<String, Texture *> textureMap;
EnumerateTextures(scene, textureMap);
uint32 sceneTextureMemory = 0;
for(Map<String, Texture *>::const_iterator it = textureMap.begin(); it != textureMap.end(); ++it)
{
Texture *t = it->second;
//We need real info about textures size. In Editor on desktop pvr textures are decompressed to RGBA8888, so they have not real size.
TextureDescriptor *descriptor = TextureDescriptor::CreateFromFile(t->GetPathname());
if(descriptor)
{
FilePath imageFileName = GPUFamilyDescriptor::CreatePathnameForGPU(descriptor, (eGPUFamily)descriptor->exportedAsGpuFamily);
if(imageFileName.IsEqualToExtension(".pvr"))
{
sceneTextureMemory += LibPVRHelper::GetDataSize(imageFileName);
}
else if(imageFileName.IsEqualToExtension(".dds"))
{
sceneTextureMemory += LibDxtHelper::GetDataSize(imageFileName);
}
else
{
sceneTextureMemory += t->GetDataSize();
}
delete descriptor;
}
}
return sceneTextureMemory;
}
示例2: ValidateCustomColorsTexture
void SceneValidator::ValidateCustomColorsTexture(Entity *landscapeEntity, Set<String> &errorsLog)
{
KeyedArchive* customProps = landscapeEntity->GetCustomProperties();
if(customProps->IsKeyExists(ResourceEditor::CUSTOM_COLOR_TEXTURE_PROP))
{
String currentSaveName = customProps->GetString(ResourceEditor::CUSTOM_COLOR_TEXTURE_PROP);
FilePath path = "/" + currentSaveName;
if(!path.IsEqualToExtension(".png"))
{
errorsLog.insert("Custom colors texture has to have .png extension.");
}
String::size_type foundPos = currentSaveName.find("DataSource/3d/");
if(String::npos == foundPos)
{
errorsLog.insert("Custom colors texture has to begin from DataSource/3d/.");
}
}
}
示例3: IsTextureDescriptorPath
bool SceneValidator::IsTextureDescriptorPath(const FilePath &path)
{
return path.IsEqualToExtension(TextureDescriptor::GetDescriptorExtension());
}
示例4: OpenScene
int32 ScenePreviewControl::OpenScene(const FilePath &pathToFile)
{
ReleaseScene();
RecreateScene();
int32 retError = SceneFileV2::ERROR_NO_ERROR;
if(pathToFile.IsEqualToExtension(".sce"))
{
SceneFile *file = new SceneFile();
file->SetDebugLog(true);
if(!file->LoadScene(pathToFile, editorScene))
{
retError = ERROR_CANNOT_OPEN_FILE;
}
SafeRelease(file);
}
else if(pathToFile.IsEqualToExtension(".sc2"))
{
SceneFileV2 *file = new SceneFileV2();
file->EnableDebugLog(true);
retError = file->LoadScene(pathToFile, editorScene);
SafeRelease(file);
}
else
{
retError = ERROR_WRONG_EXTENSION;
}
if(SceneFileV2::ERROR_NO_ERROR == retError)
{
rootNode = editorScene->GetRootNode(pathToFile);
if(rootNode)
{
currentScenePath = pathToFile;
editorScene->AddNode(rootNode);
needSetCamera = true;
Camera *cam = editorScene->GetCamera(0);
if(!cam)
{
Camera * cam = new Camera();
//cam->SetDebugFlags(Entity::DEBUG_DRAW_ALL);
cam->SetUp(Vector3(0.0f, 0.0f, 1.0f));
cam->SetPosition(Vector3(0.0f, 0.0f, 0.0f));
cam->SetTarget(Vector3(0.0f, 1.0f, 0.0f));
cam->SetupPerspective(70.0f, 320.0f / 480.0f, 1.0f, 5000.0f);
ScopedPtr<Entity> node(new Entity());
node->SetName("preview-camera");
node->AddComponent(new CameraComponent(cam));
editorScene->AddNode(node);
editorScene->AddCamera(cam);
editorScene->SetCurrentCamera(cam);
cameraController->SetScene(editorScene);
SafeRelease(cam);
sceCamera = false;
}
else
{
sceCamera = true;
}
}
}
SceneValidator::Instance()->ValidateSceneAndShowErrors(editorScene);
return retError;
}
示例5: IsDescriptorPathname
bool TextureDescriptorUtils::IsDescriptorPathname( const FilePath &pathname )
{
return pathname.IsEqualToExtension(TextureDescriptor::GetDescriptorExtension());
}