mirror of
https://github.com/reactos/wine.git
synced 2024-11-28 22:20:26 +00:00
d3dx9_36: Implement D3DXGetFVFVertexSize.
This commit is contained in:
parent
e5425fc17b
commit
ca469499bb
@ -150,7 +150,7 @@
|
||||
@ stub D3DXGetDeclLength
|
||||
@ stub D3DXGetDeclVertexSize
|
||||
@ stdcall D3DXGetDriverLevel(ptr)
|
||||
@ stub D3DXGetFVFVertexSize
|
||||
@ stdcall D3DXGetFVFVertexSize(long)
|
||||
@ stdcall D3DXGetImageInfoFromFileA(ptr ptr) d3dx8.D3DXGetImageInfoFromFileA
|
||||
@ stdcall D3DXGetImageInfoFromFileInMemory(ptr long ptr) d3dx8.D3DXGetImageInfoFromFileInMemory
|
||||
@ stdcall D3DXGetImageInfoFromFileW(ptr ptr) d3dx8.D3DXGetImageInfoFromFileW
|
||||
|
@ -88,6 +88,45 @@ HRESULT WINAPI D3DXComputeBoundingSphere(CONST D3DXVECTOR3* pfirstposition, DWOR
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* D3DXGetFVFVertexSize
|
||||
*/
|
||||
static UINT Get_TexCoord_Size_From_FVF(DWORD FVF, int tex_num)
|
||||
{
|
||||
return (((((FVF) >> (16 + (2 * (tex_num)))) + 1) & 0x03) + 1);
|
||||
}
|
||||
|
||||
UINT WINAPI D3DXGetFVFVertexSize(DWORD FVF)
|
||||
{
|
||||
DWORD size = 0;
|
||||
UINT i;
|
||||
UINT numTextures = (FVF & D3DFVF_TEXCOUNT_MASK) >> D3DFVF_TEXCOUNT_SHIFT;
|
||||
|
||||
if (FVF & D3DFVF_NORMAL) size += sizeof(D3DXVECTOR3);
|
||||
if (FVF & D3DFVF_DIFFUSE) size += sizeof(DWORD);
|
||||
if (FVF & D3DFVF_SPECULAR) size += sizeof(DWORD);
|
||||
if (FVF & D3DFVF_PSIZE) size += sizeof(DWORD);
|
||||
|
||||
switch (FVF & D3DFVF_POSITION_MASK)
|
||||
{
|
||||
case D3DFVF_XYZ: size += sizeof(D3DXVECTOR3); break;
|
||||
case D3DFVF_XYZRHW: size += 4 * sizeof(FLOAT); break;
|
||||
case D3DFVF_XYZB1: size += 4 * sizeof(FLOAT); break;
|
||||
case D3DFVF_XYZB2: size += 5 * sizeof(FLOAT); break;
|
||||
case D3DFVF_XYZB3: size += 6 * sizeof(FLOAT); break;
|
||||
case D3DFVF_XYZB4: size += 7 * sizeof(FLOAT); break;
|
||||
case D3DFVF_XYZB5: size += 8 * sizeof(FLOAT); break;
|
||||
case D3DFVF_XYZW: size += 4 * sizeof(FLOAT); break;
|
||||
}
|
||||
|
||||
for (i = 0; i < numTextures; i++)
|
||||
{
|
||||
size += Get_TexCoord_Size_From_FVF(FVF, i) * sizeof(FLOAT);
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* D3DXIntersectTri
|
||||
*/
|
||||
|
@ -31,6 +31,7 @@ BOOL WINAPI D3DXBoxBoundProbe(CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, CONST
|
||||
BOOL WINAPI D3DXSphereBoundProbe(CONST D3DXVECTOR3 *,FLOAT,CONST D3DXVECTOR3 *,CONST D3DXVECTOR3 *);
|
||||
HRESULT WINAPI D3DXComputeBoundingBox(CONST D3DXVECTOR3 *, DWORD, DWORD, D3DXVECTOR3 *, D3DXVECTOR3 *);
|
||||
HRESULT WINAPI D3DXComputeBoundingSphere(CONST D3DXVECTOR3 *, DWORD, DWORD, D3DXVECTOR3 *, FLOAT *);
|
||||
UINT WINAPI D3DXGetFVFVertexSize(DWORD);
|
||||
BOOL WINAPI D3DXIntersectTri(CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, CONST D3DXVECTOR3*, FLOAT *, FLOAT *, FLOAT *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Loading…
Reference in New Issue
Block a user