本文整理汇总了C++中FilePath::GetRelativePathname方法的典型用法代码示例。如果您正苦于以下问题:C++ FilePath::GetRelativePathname方法的具体用法?C++ FilePath::GetRelativePathname怎么用?C++ FilePath::GetRelativePathname使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FilePath
的用法示例。
在下文中一共展示了FilePath::GetRelativePathname方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetRelativePathToProjectPath
String CustomColorsSystem::GetRelativePathToProjectPath(const FilePath& absolutePath)
{
if(absolutePath.IsEmpty())
return String();
return absolutePath.GetRelativePathname(ProjectManager::Instance()->CurProjectPath());
}
示例2: ValidateTexture
void SceneValidator::ValidateTexture(Texture *texture, const FilePath &texturePathname, const String &validatedObjectName, Set<String> &errorsLog)
{
if(!texture) return;
String path = texturePathname.GetRelativePathname(pathForChecking);
String textureInfo = path + " for object: " + validatedObjectName;
if(texture->IsPinkPlaceholder())
{
errorsLog.insert("Can't load texture: " + textureInfo);
}
bool pathIsCorrect = ValidatePathname(texturePathname, validatedObjectName);
if(!pathIsCorrect)
{
errorsLog.insert("Wrong path of: " + textureInfo);
}
if(!IsPowerOf2(texture->GetWidth()) || !IsPowerOf2(texture->GetHeight()))
{
errorsLog.insert("Wrong size of " + textureInfo);
}
if(texture->GetWidth() > 2048 || texture->GetHeight() > 2048)
{
errorsLog.insert("Texture is too big. " + textureInfo);
}
}
示例3: CopyCustomColorTexture
void SceneSaver::CopyCustomColorTexture(Scene *scene, const FilePath & sceneFolder, Set<String> &errorLog)
{
Entity *land = FindLandscapeEntity(scene);
if(!land) return;
KeyedArchive* customProps = land->GetCustomProperties();
if(!customProps) return;
String pathname = customProps->GetString(ResourceEditor::CUSTOM_COLOR_TEXTURE_PROP);
if(pathname.empty()) return;
FilePath projectPath = CreateProjectPathFromPath(sceneFolder);
if(projectPath.IsEmpty())
{
Logger::Error("[SceneSaver::CopyCustomColorTexture] Can't copy custom colors texture (%s)", pathname.c_str());
return;
}
FilePath texPathname = projectPath + pathname;
sceneUtils.CopyFile(texPathname, errorLog);
FilePath newTexPathname = sceneUtils.GetNewFilePath(texPathname);
FilePath newProjectPathname = CreateProjectPathFromPath(sceneUtils.dataFolder);
if(newProjectPathname.IsEmpty())
{
Logger::Error("[SceneSaver::CopyCustomColorTexture] Can't save custom colors texture (%s)", pathname.c_str());
return;
}
//save new path to custom colors texture
customProps->SetString(ResourceEditor::CUSTOM_COLOR_TEXTURE_PROP, newTexPathname.GetRelativePathname(newProjectPathname));
}
示例4: GetRelativePathToScenePath
String CustomColorsSystem::GetRelativePathToScenePath(const FilePath &absolutePath)
{
if(absolutePath.IsEmpty())
return String();
return absolutePath.GetRelativePathname(GetScenePath());
}
示例5: GetRelativePathToProjectPath
String LandscapeEditorCustomColors::GetRelativePathToProjectPath(const FilePath& absolutePath)
{
if(absolutePath.IsEmpty())
return String();
return absolutePath.GetRelativePathname(EditorSettings::Instance()->GetProjectPath());
}
示例6: GetRelativePathToScenePath
String LandscapeEditorCustomColors::GetRelativePathToScenePath(const FilePath &absolutePath)
{
if(absolutePath.IsEmpty())
return String();
return absolutePath.GetRelativePathname(GetScenePath());
}
示例7: StoreSaveFileName
void LandscapeEditorCustomColors::StoreSaveFileName(const FilePath& fileName)
{
parent->GetSceneGraph()->UpdatePropertyPanel();
if(NULL != workingLandscapeEntity)
{
KeyedArchive* customProps = workingLandscapeEntity->GetCustomProperties();
FilePath projectPath = EditorSettings::Instance()->GetProjectPath();
customProps->SetString(ResourceEditor::CUSTOM_COLOR_TEXTURE_PROP, fileName.GetRelativePathname(projectPath));
}
}
示例8: CopyFile
bool SceneUtils::CopyFile(const FilePath &filePathname, Set<String> &errorLog)
{
String workingPathname = filePathname.GetRelativePathname(dataSourceFolder);
PrepareFolderForCopyFile(workingPathname, errorLog);
bool retCopy = FileSystem::Instance()->CopyFile(dataSourceFolder + workingPathname, dataFolder + workingPathname);
if(!retCopy)
{
errorLog.insert(String(Format("Can't copy %s from %s to %s",
workingPathname.c_str(),
dataSourceFolder.GetAbsolutePathname().c_str(),
dataFolder.GetAbsolutePathname().c_str())));
}
return retCopy;
}