=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3dx9: Implement D3DXSaveTextureToFileInMemory.
Alexandre Julliard
julliard at winehq.org
Thu May 31 13:30:41 CDT 2012
Module: wine
Branch: master
Commit: 38b8949fea926a0afce627537f29df413397f34f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=38b8949fea926a0afce627537f29df413397f34f
Author: Józef Kucia <joseph.kucia at gmail.com>
Date: Tue May 29 11:29:24 2012 +0200
d3dx9: Implement D3DXSaveTextureToFileInMemory.
---
dlls/d3dx9_36/texture.c | 34 ++++++++++++++++++++++++++++++++--
1 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c
index 97d26d9..1e87a00 100644
--- a/dlls/d3dx9_36/texture.c
+++ b/dlls/d3dx9_36/texture.c
@@ -1660,10 +1660,40 @@ HRESULT WINAPI D3DXSaveTextureToFileW(const WCHAR *dst_filename, D3DXIMAGE_FILEF
HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE_FILEFORMAT file_format,
IDirect3DBaseTexture9 *src_texture, const PALETTEENTRY *src_palette)
{
- FIXME("(%p, %#x, %p, %p): stub\n",
+ HRESULT hr;
+ D3DRESOURCETYPE type;
+ IDirect3DSurface9 *surface;
+
+ TRACE("(%p, %#x, %p, %p)\n",
dst_buffer, file_format, src_texture, src_palette);
if (!dst_buffer || !src_texture) return D3DERR_INVALIDCALL;
- return E_NOTIMPL;
+ if (file_format == D3DXIFF_DDS)
+ {
+ FIXME("DDS file format isn't supported yet\n");
+ return E_NOTIMPL;
+ }
+
+ type = IDirect3DBaseTexture9_GetType(src_texture);
+ switch (type)
+ {
+ case D3DRTYPE_TEXTURE:
+ case D3DRTYPE_CUBETEXTURE:
+ hr = get_surface(type, src_texture, D3DCUBEMAP_FACE_POSITIVE_X, 0, &surface);
+ break;
+ case D3DRTYPE_VOLUMETEXTURE:
+ FIXME("Volume textures aren't supported yet\n");
+ return E_NOTIMPL;
+ default:
+ return D3DERR_INVALIDCALL;
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ hr = D3DXSaveSurfaceToFileInMemory(dst_buffer, file_format, surface, src_palette, NULL);
+ IDirect3DSurface9_Release(surface);
+ }
+
+ return hr;
}
More information about the wine-cvs
mailing list