示例#1
0
bool KeyedArchive::SaveToYamlFile(const FilePath & pathName)
{
    ScopedPtr<YamlNode> node( YamlNode::CreateMapNode() );
    node->Set(VariantType::TYPENAME_KEYED_ARCHIVE, VariantType(this));

    return YamlEmitter::SaveToYamlFile(pathName, node);
}
void RenderBatch::Save(KeyedArchive * archive, SceneFileV2* sceneFile)
{
	BaseObject::Save(archive);

	if(NULL != archive)
	{
		archive->SetUInt32("rb.type", type);
		archive->SetUInt32("rb.indexCount", indexCount);
		archive->SetUInt32("rb.startIndex", startIndex);
		archive->SetVariant("rb.aabbox", VariantType(aabbox));
		archive->SetVariant("rb.datasource", VariantType((uint64)dataSource));
		archive->SetVariant("rb.material", VariantType((uint64)GetMaterial()));
		
		KeyedArchive *mia = new KeyedArchive();
		materialInstance->Save(mia, sceneFile);
		archive->SetArchive("rb.matinst", mia);
		mia->Release();
	}
}
示例#3
0
void InstanceMaterialState::Save(KeyedArchive * archive, SceneFileV2 *sceneFile)
{
	if(NULL != archive)
	{
		archive->SetVector2("ims.uvoffset", uvOffset);
		archive->SetVector2("ims.uvscale", uvScale);
		archive->SetString("ims.lightmapname", lightmapName);
		archive->SetVariant("ims.lightmaptextute", VariantType(lightmapTexture));
	}
}
示例#4
0
void EditorScene::SetShadowColor( const Color &color )
{
	Entity *land = GetLandscapeNode(this);
	if(!land) return;

	KeyedArchive * props = land->GetCustomProperties();
	if(!props) return;
	
	props->SetVariant("ShadowColor", VariantType(color));

	UpdateShadowColorFromLandscape();
}
Command2* CustomColorsSystem::CreateSaveFileNameCommand(const String& filePath)
{
	KeyedArchive* customProps = drawSystem->GetLandscapeCustomProperties();
	bool keyExists = customProps->IsKeyExists(ResourceEditor::CUSTOM_COLOR_TEXTURE_PROP);

	Command2* command = NULL;
	if (keyExists)
	{
		String curPath = customProps->GetString(ResourceEditor::CUSTOM_COLOR_TEXTURE_PROP);
		if (curPath != filePath)
		{
			command = new KeyeadArchiveSetValueCommand(customProps, ResourceEditor::CUSTOM_COLOR_TEXTURE_PROP,
													   VariantType(filePath));
		}
	}
	else
	{
		command = new KeyedArchiveAddValueCommand(customProps, ResourceEditor::CUSTOM_COLOR_TEXTURE_PROP,
												  VariantType(filePath));
	}

	return command;
}
void CubeMapTextureBrowser::ReloadTexturesFromUI(QString& path)
{
	if(path.at(path.size() - 1) != QChar('/') &&
	   path.at(path.size() - 1) != QChar('\\'))
	{
		path += "/";
	}
	
	ui->textRootPath->setText(path);
	
	FilePath projectPath = path.toStdString();
	SettingsManager::SetValue(Settings::Internal_CubemapLastProjDir, VariantType(projectPath));
	
	ReloadTextures(path.toStdString());
}
示例#7
0
void UnpackHelpDoc()
{
	DAVA::String editorVer =SettingsManager::GetValue(Settings::Internal_EditorVersion).AsString();
	DAVA::FilePath docsPath = FilePath(ResourceEditor::DOCUMENTATION_PATH);
	if(editorVer != RESOURCE_EDITOR_VERSION || !docsPath.Exists())
	{
		DAVA::Logger::Info("Unpacking Help...");
		DAVA::ResourceArchive * helpRA = new DAVA::ResourceArchive();
		if(helpRA->Open("~res:/Help.docs"))
		{
			DAVA::FileSystem::Instance()->DeleteDirectory(docsPath);
			DAVA::FileSystem::Instance()->CreateDirectory(docsPath, true);
			helpRA->UnpackToFolder(docsPath);
		}
		DAVA::SafeRelease(helpRA);
	}
	SettingsManager::SetValue(Settings::Internal_EditorVersion, VariantType(String(RESOURCE_EDITOR_VERSION)));
}