/*
* IDirect3DVertexDeclaration9 implementation
*
* Copyright 2002-2003 Raphael Junqueira
* Jason Edmeades
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Oracle elects to use only
* the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
* a choice of LGPL license versions is made available with the language indicating
* that LGPLv2 or any later version may be used, or where a choice of which version
* of the LGPL is applied is otherwise unspecified.
*/
#include "config.h"
#include "d3d9_private.h"
typedef struct _D3DDECLTYPE_INFO {
int size;
int typesize;
unsigned int offset;
(fvf & D3DFVF_LASTBETA_D3DCOLOR) ||
(fvf & D3DFVF_LASTBETA_UBYTE4));
unsigned int size;
if (has_blend_idx) num_blends--;
/* Compute declaration size */
/* convert the declaration */
if (!elements) return D3DERR_OUTOFVIDEOMEMORY;
idx = 0;
if (has_pos) {
}
}
else {
}
idx++;
}
if (has_blend && (num_blends > 0)) {
else {
switch(num_blends) {
default:
}
}
idx++;
}
if (has_blend_idx) {
if (fvf & D3DFVF_LASTBETA_UBYTE4 ||
else if (fvf & D3DFVF_LASTBETA_D3DCOLOR)
else
idx++;
}
if (has_normal) {
idx++;
}
if (has_psize) {
idx++;
}
if (has_diffuse) {
idx++;
}
if (has_specular) {
idx++;
}
switch (numcoords) {
case D3DFVF_TEXTUREFORMAT1:
break;
case D3DFVF_TEXTUREFORMAT2:
break;
case D3DFVF_TEXTUREFORMAT3:
break;
case D3DFVF_TEXTUREFORMAT4:
break;
}
idx++;
}
/* Now compute offsets, and initialize the rest of the fields */
}
return D3D_OK;
}
/* IDirect3DVertexDeclaration9 IUnknown parts follow: */
static HRESULT WINAPI IDirect3DVertexDeclaration9Impl_QueryInterface(LPDIRECT3DVERTEXDECLARATION9 iface, REFIID riid, LPVOID* ppobj) {
return S_OK;
}
return E_NOINTERFACE;
}
if(ref == 1) {
{
}
}
return ref;
}
/* Should not happen unless wine has a bug or the application releases references it does not own */
ERR("Destroying vdecl with ref != 0\n");
}
}
if (ref == 0) {
}
/* Release the device last, as it may cause the device to be destroyed. */
}
return ref;
}
/* IDirect3DVertexDeclaration9 Interface follow: */
{
return D3D_OK;
}
static HRESULT WINAPI IDirect3DVertexDeclaration9Impl_GetDeclaration(LPDIRECT3DVERTEXDECLARATION9 iface, D3DVERTEXELEMENT9* pDecl, UINT* pNumElements) {
/* Passing a NULL pDecl is used to just retrieve the number of elements */
if (!pDecl) {
TRACE("NULL pDecl passed. Returning D3D_OK.\n");
return D3D_OK;
}
return D3D_OK;
}
{
/* IUnknown */
/* IDirect3DVertexDeclaration9 */
};
{
}
{
};
{
UINT i;
/* Skip the END element */
--count;
if (!*wined3d_elements) {
FIXME("Memory allocation failed\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
for (i = 0; i < count; ++i)
{
{
return E_FAIL;
}
(*wined3d_elements)[i].output_slot = ~0U;
}
*element_count = count;
return D3D_OK;
}
{
{
return hr;
}
declaration->elements = HeapAlloc(GetProcessHeap(), 0, element_count * sizeof(*declaration->elements));
if (!declaration->elements)
{
ERR("Failed to allocate vertex declaration elements memory.\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
hr = IWineD3DDevice_CreateVertexDeclaration(device->WineD3DDevice, &declaration->wineD3DVertexDeclaration,
{
return hr;
}
return D3D_OK;
}
HRESULT WINAPI IDirect3DDevice9Impl_SetVertexDeclaration(LPDIRECT3DDEVICE9EX iface, IDirect3DVertexDeclaration9* pDecl) {
hr = IWineD3DDevice_SetVertexDeclaration(This->WineD3DDevice, pDeclImpl == NULL ? NULL : pDeclImpl->wineD3DVertexDeclaration);
return hr;
}
HRESULT WINAPI IDirect3DDevice9Impl_GetVertexDeclaration(LPDIRECT3DDEVICE9EX iface, IDirect3DVertexDeclaration9** ppDecl) {
return D3DERR_INVALIDCALL;
}
} else {
}
return hr;
}