本文整理汇总了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();
}
}
示例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();
}
示例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);
}
}