Commit f12d5b24 authored by Raphael Junqueira's avatar Raphael Junqueira Committed by Alexandre Julliard

- fix typo in wined3d_interface.h

- add needed defines in wined3d_interface.h - add IWineD3DVertexDeclarationImpl_ParseToken9 for debug traces - fix ParseDeclaration9 - limit flood of traces (single shot traces)
parent 5bef7704
......@@ -3546,6 +3546,9 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclaration(IWineD3DDevice* iface,
IWineD3DVertexDeclarationImpl* object = NULL;
HRESULT hr = D3D_OK;
TRACE("(%p) : iDeclVersion=%u, pFunction=%p, ppDecl=%p\n", This, iDeclVersion, pDeclaration, ppDecl);
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IWineD3DVertexDeclarationImpl));
object->lpVtbl = &IWineD3DVertexDeclaration_Vtbl;
......@@ -3582,7 +3585,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetVertexDeclaration(IWineD3DDevice* iface, IW
HRESULT WINAPI IWineD3DDeviceImpl_GetVertexDeclaration(IWineD3DDevice* iface, IWineD3DVertexDeclaration** ppDecl) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
TRACE("(%p) : pDecl=%p\n", This, ppDecl);
TRACE("(%p) : ppDecl=%p\n", This, ppDecl);
*ppDecl = This->updateStateBlock->vertexDecl;
if (NULL != *ppDecl) IWineD3DVertexDeclaration_AddRef(*ppDecl);
......
......@@ -850,8 +850,12 @@ HRESULT WINAPI IWineD3DImpl_CheckDeviceMultiSampleType(IWineD3D *iface,
}
if (pQualityLevels != NULL) {
static int s_single_shot = 0;
if (!s_single_shot) {
FIXME("Quality levels unsupported at present\n");
*pQualityLevels = 1; /* Guess at a value! */
s_single_shot = 1;
}
*pQualityLevels = 1; /* Guess at a value! */
}
if (D3DMULTISAMPLE_NONE == MultiSampleType)
......
......@@ -485,6 +485,24 @@ static CONST char* VertexDecl9_DeclTypes[] = {
NULL
};
DWORD IWineD3DVertexDeclarationImpl_ParseToken9(const D3DVERTEXELEMENT9* pToken) {
DWORD tokenlen = 1;
if (0xFF != pToken->Stream) {
TRACE(" D3DDECL(%u, %u, %s, %s, %s, %u)\n",
pToken->Stream,
pToken->Offset,
VertexDecl9_DeclTypes[pToken->Type],
VertexDecl9_DeclMethods[pToken->Method],
VertexDecl9_DeclUsages[pToken->Usage],
pToken->UsageIndex
);
} else {
TRACE(" D3DDECL_END()\n" );
}
return tokenlen;
}
HRESULT IWineD3DVertexDeclarationImpl_ParseDeclaration9(IWineD3DDeviceImpl* This, const D3DVERTEXELEMENT9* pDecl, IWineD3DVertexDeclarationImpl* object) {
const D3DVERTEXELEMENT9* pToken = pDecl;
DWORD fvf = 0;
......@@ -500,6 +518,8 @@ HRESULT IWineD3DVertexDeclarationImpl_ParseDeclaration9(IWineD3DDeviceImpl* This
DWORD oldStream = stream;
stream = pToken->Stream;
IWineD3DVertexDeclarationImpl_ParseToken9(pToken);
if (D3DDECLMETHOD_DEFAULT != pToken->Method) {
WARN(
"%s register: Unsupported Method of %s (only D3DDECLMETHOD_DEFAULT for now) for VertexDeclaration (type %s)\n",
......@@ -530,7 +550,9 @@ HRESULT IWineD3DVertexDeclarationImpl_ParseDeclaration9(IWineD3DDeviceImpl* This
case D3DDECLUSAGE_POSITION:
if (0 < pToken->UsageIndex) {
invalid_fvf = TRUE;
TRACE("Mismatched UsageIndex (%u) in VertexDeclaration for D3DDECLUSAGE_POSITION register: unsupported type %s\n", pToken->UsageIndex, VertexDecl9_DeclTypes[type]);
TRACE("Mismatched UsageIndex (%u) in VertexDeclaration for D3DDECLUSAGE_POSITION register: unsupported type %s\n",
pToken->UsageIndex, VertexDecl9_DeclTypes[type]);
break;
}
switch (type) {
case D3DDECLTYPE_FLOAT3: fvf |= D3DFVF_XYZ; break;
......@@ -568,7 +590,9 @@ HRESULT IWineD3DVertexDeclarationImpl_ParseDeclaration9(IWineD3DDeviceImpl* This
case D3DDECLUSAGE_NORMAL:
if (0 < pToken->UsageIndex) {
invalid_fvf = TRUE;
TRACE("Mismatched UsageIndex (%u) in VertexDeclaration for D3DDECLUSAGE_NORMAL register: unsupported type %s\n", pToken->UsageIndex, VertexDecl9_DeclTypes[type]);
TRACE("Mismatched UsageIndex (%u) in VertexDeclaration for D3DDECLUSAGE_NORMAL register: unsupported type %s\n",
pToken->UsageIndex, VertexDecl9_DeclTypes[type]);
break;
}
switch (type) {
case D3DDECLTYPE_FLOAT3: fvf |= D3DFVF_NORMAL; break;
......@@ -619,6 +643,7 @@ HRESULT IWineD3DVertexDeclarationImpl_ParseDeclaration9(IWineD3DDeviceImpl* This
invalid_fvf = TRUE;
TRACE("Mismatched use in VertexDeclaration of D3DDECLUSAGE_COLOR[%lu] unsupported COLOR register\n", colorNo);
}
break;
default:
/** Mismatched use of a register, invalid for fixed function fvf computing (ok for VS) */
invalid_fvf = TRUE;
......@@ -658,9 +683,12 @@ HRESULT IWineD3DVertexDeclarationImpl_ParseDeclaration9(IWineD3DDeviceImpl* This
/* compute size */
object->declaration9NumElements = len;
/* copy the declaration */
object->pDeclaration8 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len * sizeof(D3DVERTEXELEMENT9));
object->pDeclaration9 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len * sizeof(D3DVERTEXELEMENT9));
memcpy(object->pDeclaration9, pDecl, len * sizeof(D3DVERTEXELEMENT9));
/* returns */
TRACE("Returns allFVF = %lx\n", object->allFVF);
return D3D_OK;
}
......
......@@ -343,6 +343,9 @@ DECLARE_INTERFACE_(IWineD3DDevice,IUnknown)
#define IWineD3DDevice_DrawIndexedPrimitive(p,a,b,c,d,e,f) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f)
#define IWineD3DDevice_DrawPrimitiveUP(p,a,b,c,d) (p)->lpVtbl->DrawPrimitiveUP(p,a,b,c,d)
#define IWineD3DDevice_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h)
#define IWineD3DDevice_CreateVertexDeclaration(p,a,b,c) (p)->lpVtbl->CreateVertexDeclaration(p,a,b,c)
#define IWineD3DDevice_SetVertexDeclaration(p,a) (p)->lpVtbl->SetVertexDeclaration(p,a)
#define IWineD3DDevice_GetVertexDeclaration(p,a) (p)->lpVtbl->GetVertexDeclaration(p,a)
#define IWineD3DDevice_SetupTextureStates(p,a,b) (p)->lpVtbl->SetupTextureStates(p,a,b)
#endif
......@@ -887,7 +890,7 @@ DECLARE_INTERFACE_(IWineD3DVertexDeclaration,IUnknown)
#define IWineD3DVertexDeclaration_Release(p) (p)->lpVtbl->Release(p)
/*** IWineD3DVertexDeclaration methods ***/
#define IWineD3DVertexDeclaration_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a)
#define IWineD3DVertexDeclaration_GetDeclaration(p,a,b,c) (p)->lpVtbl->GetDeclaration8(p,a,b,c)
#define IWineD3DVertexDeclaration_GetDeclaration(p,a,b,c) (p)->lpVtbl->GetDeclaration(p,a,b,c)
#endif
/*****************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment