当前位置: 首页>>代码示例>>C++>>正文


C++ Texture::CreateImageFromMemory方法代码示例

本文整理汇总了C++中Texture::CreateImageFromMemory方法的典型用法代码示例。如果您正苦于以下问题:C++ Texture::CreateImageFromMemory方法的具体用法?C++ Texture::CreateImageFromMemory怎么用?C++ Texture::CreateImageFromMemory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Texture的用法示例。


在下文中一共展示了Texture::CreateImageFromMemory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SaveTileMaskTexture

void LandscapeEditorDrawSystem::SaveTileMaskTexture()
{
	if (!baseLandscape)
	{
		return;
	}

	if (!GetLandscapeProxy()->IsTilemaskChanged())
	{
		return;
	}

	Texture* texture = baseLandscape->GetTexture(Landscape::TEXTURE_TILE_MASK);

	if (texture)
	{
		FilePath texturePathname = baseLandscape->GetTextureName(Landscape::TEXTURE_TILE_MASK);

		if (texturePathname.IsEmpty())
		{
			return;
		}

		texturePathname.ReplaceExtension(".png");

		eBlendMode srcBlend = RenderManager::Instance()->GetSrcBlend();
		eBlendMode dstBlend = RenderManager::Instance()->GetDestBlend();
		RenderManager::Instance()->SetBlendMode(BLEND_ONE, BLEND_ZERO);
		Image *image = texture->CreateImageFromMemory();
		RenderManager::Instance()->SetBlendMode(srcBlend, dstBlend);

		if(image)
		{
			ImageLoader::Save(image, texturePathname);
			SafeRelease(image);
		}

		FilePath descriptorPathname = TextureDescriptor::GetDescriptorPathname(texturePathname);
		TextureDescriptor *descriptor = TextureDescriptor::CreateFromFile(descriptorPathname);
		if(!descriptor)
		{
			descriptor = new TextureDescriptor();
			descriptor->pathname = descriptorPathname;
			descriptor->Save();
		}

		SafeRelease(descriptor);

		GetLandscapeProxy()->ResetTilemaskChanged();
	}
}
开发者ID:droidenko,项目名称:dava.framework,代码行数:51,代码来源:LandscapeEditorDrawSystem.cpp

示例2: SaveTexture

void CustomColorsSystem::SaveTexture(const DAVA::FilePath &filePath)
{
	if(filePath.IsEmpty())
		return;

	Sprite* customColorsSprite = drawSystem->GetCustomColorsProxy()->GetSprite();
	Texture* customColorsTexture = customColorsSprite->GetTexture();

	Image* image = customColorsTexture->CreateImageFromMemory(RenderState::RENDERSTATE_2D_BLEND);
    ImageSystem::Instance()->Save(filePath, image);
	SafeRelease(image);

	StoreSaveFileName(filePath);
	drawSystem->GetCustomColorsProxy()->ResetChanges();
}
开发者ID:galek,项目名称:dava.framework,代码行数:15,代码来源:CustomColorsSystem.cpp

示例3: CreateCopyPasteUndo

void LandscapeEditorHeightmap::CreateCopyPasteUndo()
{
	if (oldHeightmap && oldTilemap)
	{
		workingLandscape->UpdateFullTiledTexture();
		Texture* texture = tilemaskTexture;
		Image* image = texture->CreateImageFromMemory();

		CommandsManager::Instance()->ExecuteAndRelease(new CommandCopyPasteHeightmap(currentTool->copyHeightmap,
																					 currentTool->copyTilemask,
																					 oldHeightmap,
																					 GetHeightmap(),
																					 oldTilemap,
																					 image,
																					 tilemaskPathname));
		SafeRelease(oldHeightmap);
		SafeRelease(oldTilemap);
		SafeRelease(image);
	}
}
开发者ID:vilonosec,项目名称:dava.framework,代码行数:20,代码来源:LandscapeEditorHeightmap.cpp


注:本文中的Texture::CreateImageFromMemory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。