[PATCH] d3dx9: Add a stub for D3DXLoadSurfaceFromMemory

Tony Wasserka tony.wasserka at freenet.de
Mon Jun 22 10:45:27 CDT 2009


---
 dlls/d3dx9_36/d3dx9_36.spec |    2 +-
 dlls/d3dx9_36/surface.c     |   48 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 1 deletions(-)

diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec
index 9b22ba0..63c2fb3 100644
--- a/dlls/d3dx9_36/d3dx9_36.spec
+++ b/dlls/d3dx9_36/d3dx9_36.spec
@@ -185,7 +185,7 @@
 @ stdcall D3DXLoadSurfaceFromFileA(ptr ptr ptr str ptr long long ptr)
 @ stdcall D3DXLoadSurfaceFromFileInMemory(ptr ptr ptr ptr long ptr long long ptr)
 @ stdcall D3DXLoadSurfaceFromFileW(ptr ptr ptr wstr ptr long long ptr)
-@ stub D3DXLoadSurfaceFromMemory
+@ stdcall D3DXLoadSurfaceFromMemory(ptr ptr ptr ptr long long ptr ptr long long)
 @ stdcall D3DXLoadSurfaceFromResourceA(ptr ptr ptr ptr str ptr long long ptr)
 @ stdcall D3DXLoadSurfaceFromResourceW(ptr ptr ptr ptr wstr ptr long long ptr)
 @ stub D3DXLoadSurfaceFromSurface
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
index 7281d71..064958a 100644
--- a/dlls/d3dx9_36/surface.c
+++ b/dlls/d3dx9_36/surface.c
@@ -322,3 +322,51 @@ HRESULT WINAPI D3DXLoadSurfaceFromResourceW(LPDIRECT3DSURFACE9 pDestSurface,
     }
     return D3DXERR_INVALIDDATA;
 }
+
+/************************************************************
+ * D3DXLoadSurfaceFromMemory
+ *
+ * Loads data from a given memory chunk into a surface,
+ * applying any of the specified filters.
+ *
+ * PARAMS
+ *   pDestSurface [I] pointer to the surface
+ *   pDestPalette [I] palette to use
+ *   pDestRect    [I] to be filled area of the surface
+ *   pSrcMemory   [I] pointer to the source data
+ *   SrcFormat    [I] format of the source pixel data
+ *   SrcPitch     [I] number of bytes in a row
+ *   pSrcPalette  [I] palette used in the source image
+ *   pSrcRect     [I] area of the source data to load
+ *   dwFilter     [I] filter to apply on stretching
+ *   Colorkey     [I] colorkey
+ *
+ * RETURNS
+ *   Success: D3D_OK, if we successfully load the pixel data into our surface or
+ *                    if pSrcMemory is NULL but the other parameters are valid
+ *   Failure: D3DERR_INVALIDCALL, if pDestSurface, SrcPitch or pSrcRect are NULL or
+ *                                if SrcFormat is an invalid format (other than D3DFMT_UNKNOWN)
+ *            D3DXERR_INVALIDDATA, if we fail to lock pDestSurface
+ *            E_FAIL, if SrcFormat is D3DFMT_UNKNOWN or the dimensions of pSrcRect are invalid
+ *
+ * NOTES
+ *   pSrcRect specifies the dimensions of the source data
+ *
+ */
+HRESULT WINAPI D3DXLoadSurfaceFromMemory(LPDIRECT3DSURFACE9 pDestSurface,
+                                         CONST PALETTEENTRY *pDestPalette,
+                                         CONST RECT *pDestRect,
+                                         LPCVOID pSrcMemory,
+                                         D3DFORMAT SrcFormat,
+                                         UINT SrcPitch,
+                                         CONST PALETTEENTRY *pSrcPalette,
+                                         CONST RECT *pSrcRect,
+                                         DWORD dwFilter,
+                                         D3DCOLOR Colorkey)
+{
+    TRACE("stub\n");
+
+    if( !pDestSurface || !pSrcMemory || !pSrcRect ) return D3DERR_INVALIDCALL;
+    if(SrcFormat == D3DFMT_UNKNOWN || pSrcRect->left >= pSrcRect->right || pSrcRect->top >= pSrcRect->bottom) return E_FAIL;
+    return E_NOTIMPL;
+}
-- 
1.6.0.2


--------------070404040607060502010104--



More information about the wine-patches mailing list