Christian Costa : d3dx9_36: Detect and display message for all not yet supported file formats.

Alexandre Julliard julliard at winehq.org
Sat Feb 11 10:28:40 CST 2012


Module: wine
Branch: master
Commit: 39598b9c1e5b2bea4f248c3de6984cce4ee7ea07
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=39598b9c1e5b2bea4f248c3de6984cce4ee7ea07

Author: Christian Costa <titan.costa at gmail.com>
Date:   Fri Feb 10 14:18:39 2012 +0100

d3dx9_36: Detect and display message for all not yet supported file formats.

---

 dlls/d3dx9_36/surface.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
index 8049efc..ca1699b 100644
--- a/dlls/d3dx9_36/surface.c
+++ b/dlls/d3dx9_36/surface.c
@@ -62,8 +62,6 @@ HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(LPCVOID data, UINT datasize, D3D
 
     TRACE("(%p, %d, %p)\n", data, datasize, info);
 
-    /* TODO: Add support for (or at least detect) DDS, PPM and DIB */
-
     if (!data || !datasize)
         return D3DERR_INVALIDCALL;
 
@@ -82,6 +80,19 @@ HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(LPCVOID data, UINT datasize, D3D
         IWICImagingFactory_Release(factory);
     }
 
+    if (FAILED(hr)) {
+        if ((datasize >= 4) && !strncmp(data, "DDS ", 4))
+            FIXME("File type DDS is not supported yet\n");
+        else if ((datasize >= 2) && (!strncmp(data, "P3", 2) || !strncmp(data, "P6", 2)))
+            FIXME("File type PPM is not supported yet\n");
+        else if ((datasize >= 2) && !strncmp(data, "BM", 2))
+            FIXME("File type DIB is not supported yet\n");
+        else if ((datasize >= 10) && !strncmp(data, "#?RADIANCE", 10))
+            FIXME("File type HDR is not supported yet\n");
+        else if ((datasize >= 2) && (!strncmp(data, "PF", 2) || !strncmp(data, "Pf", 2)))
+            FIXME("File type PFM is not supported yet\n");
+    }
+
     if (SUCCEEDED(hr)) {
         GUID container_format;
         UINT frame_count;
@@ -161,8 +172,7 @@ HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(LPCVOID data, UINT datasize, D3D
         CoUninitialize();
 
     if (FAILED(hr)) {
-        /* Missing formats are not detected yet and will fail silently without the FIXME */
-        FIXME("Invalid or unsupported image file\n");
+        TRACE("Invalid or unsupported image file\n");
         return D3DXERR_INVALIDDATA;
     }
 




More information about the wine-cvs mailing list