Is ther eany problem with this patch?

---
dlls/d3dx8/d3dx8_main.c | 59 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 57 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dx8/d3dx8_main.c b/dlls/d3dx8/d3dx8_main.c
index ee897a8..a1d37b8 100644
--- a/dlls/d3dx8/d3dx8_main.c
+++ b/dlls/d3dx8/d3dx8_main.c
@@ -61,8 +61,63 @@ HRESULT WINAPI D3DXCreateFont(LPDIRECT3DDEVICE8 pDevice, HFONT hFont, LPD3DXFONT
 }
 
 UINT WINAPI D3DXGetFVFVertexSize(DWORD FVF) {
-  FIXME("(void): stub\n");
-  return 0;
+  UINT size=0;
+  UINT i;
+  UINT texture;
+  switch (FVF & D3DFVF_XYZB5) {
+     case D3DFVF_XYZ:
+        size=12;
+        break;
+     case D3DFVF_XYZRHW:
+        size=16;
+        break;
+     case D3DFVF_XYZB1:
+        size=16;
+        break;
+     case D3DFVF_XYZB2:
+        size=20;
+        break;
+     case D3DFVF_XYZB3:
+        size=24;
+        break;
+     case D3DFVF_XYZB4:
+        size=28;
+        break;
+     case D3DFVF_XYZB5:
+        size=32;
+        break;
+     default:
+        FIXME("Not Implemented.");
+        break;
+    }
+  if (FVF & D3DFVF_NORMAL)
+     size=size + 12;
+  if (FVF & D3DFVF_PSIZE)
+     size=size + 4;
+  if (FVF & D3DFVF_DIFFUSE)
+     size=size + 4;
+  if (FVF & D3DFVF_SPECULAR)
+     size=size + 4;
+  texture = FVF >> 16;
+  for (i=0;i<((FVF&0x0f00) >> 16);i++) {
+     switch (texture && 3) {
+      case D3DFVF_TEXTUREFORMAT1:
+        size=size + 4;
+        break;
+      case D3DFVF_TEXTUREFORMAT2:
+        size=size + 8;
+        break;
+      case D3DFVF_TEXTUREFORMAT3:
+        size=size + 12;
+        break;
+      case D3DFVF_TEXTUREFORMAT4:
+        size=size + 16;
+        break;
+      }
+     texture = FVF >>2;
+   }
+
+  return size;
 }
 
 HRESULT WINAPI D3DXAssembleShader(LPCVOID pSrcData, UINT SrcDataLen, DWORD Flags, 



Reply via email to