st/nine: Return E_FAIL for unused vertexdeclaration type

Add returncode E_FAIL.
Return E_FAIL for any vertexdeclaration element with type unused.

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
This commit is contained in:
Patrick Rudolph
2015-01-15 09:43:33 +01:00
committed by Axel Davy
parent faf94f6eea
commit 33617ef296
2 changed files with 5 additions and 3 deletions

View File

@@ -50,6 +50,7 @@
#define E_OUTOFMEMORY MAKE_HRESULT(1, 0x007, 14)
#define E_NOINTERFACE MAKE_HRESULT(1, 0x000, 0x4002)
#define E_POINTER MAKE_HRESULT(1, 0x000, 0x4003)
#define E_FAIL MAKE_HRESULT(1, 0x000, 0x4005)
#define S_OK ((HRESULT)0)
#define S_FALSE ((HRESULT)1)

View File

@@ -181,10 +181,11 @@ NineVertexDeclaration9_ctor( struct NineVertexDeclaration9 *This,
HRESULT hr = NineUnknown_ctor(&This->base, pParams);
if (FAILED(hr)) { return hr; }
/* wine */
for (This->nelems = 0;
pElements[This->nelems].Type != D3DDECLTYPE_UNUSED &&
pElements[This->nelems].Stream != 0xFF; /* wine */
++This->nelems);
pElements[This->nelems].Stream != 0xFF;
++This->nelems)
user_assert(pElements[This->nelems].Type != D3DDECLTYPE_UNUSED, E_FAIL);
caps = NineDevice9_GetCaps(This->base.device);
user_assert(This->nelems <= caps->MaxStreams, D3DERR_INVALIDCALL);