2 * Implementation of IDirect3DRMMeshBuilder Interface
4 * Copyright 2010 Christian Costa
6 * This file contains the (internal) driver registration functions,
7 * driver enumeration APIs and DirectDraw creation functions.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #include "wine/debug.h"
33 #include "d3drm_private.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(d3drm
);
43 const IDirect3DRMMeshBuilderVtbl
*lpVtbl
;
54 } IDirect3DRMMeshBuilderImpl
;
62 static const struct IDirect3DRMMeshBuilderVtbl Direct3DRMMeshBuilder_Vtbl
;
64 static char templates
[] = {
68 "<3D82AB43-62DA-11CF-AB39-0020AF71E433>"
75 "<3D82AB5E-62DA-11CF-AB39-0020AF71E433>"
82 "<F6F23F44-7686-11CF-8F52-0040333594A3>"
88 "<F6F23F45-7686-11CF-8F52-0040333594A3>"
89 "array FLOAT matrix[16];"
93 "<35FF44E0-6C7C-11CF-8F52-0040333594A3>"
101 "<D3E16E81-7835-11CF-8F52-0040333594A3>"
106 "template IndexedColor"
108 "<1630B820-7842-11CF-8F52-0040333594A3>"
110 "ColorRGBA indexColor;"
114 "<537DA6A0-CA37-11D0-941C-0080C80CFA7B>"
119 "<4885AE63-78E8-11CF-8F52-0040333594A3>"
123 "template MaterialWrap"
125 "<4885AE60-78E8-11CF-8F52-0040333594A3>"
129 "template TextureFilename"
131 "<A42790E1-7810-11CF-8F52-0040333594A3>"
136 "<3D82AB4D-62DA-11CF-AB39-0020AF71E433>"
137 "ColorRGBA faceColor;"
139 "ColorRGB specularColor;"
140 "ColorRGB emissiveColor;"
145 "<3D82AB5F-62DA-11CF-AB39-0020AF71E433>"
146 "DWORD nFaceVertexIndices;"
147 "array DWORD faceVertexIndices[nFaceVertexIndices];"
149 "template MeshFaceWraps"
151 "<ED1EC5C0-C0A8-11D0-941C-0080C80CFA7B>"
152 "DWORD nFaceWrapValues;"
153 "array Boolean2d faceWrapValues[nFaceWrapValues];"
155 "template MeshTextureCoords"
157 "<F6F23F40-7686-11CF-8F52-0040333594A3>"
158 "DWORD nTextureCoords;"
159 "array Coords2d textureCoords[nTextureCoords];"
161 "template MeshMaterialList"
163 "<F6F23F42-7686-11CF-8F52-0040333594A3>"
165 "DWORD nFaceIndexes;"
166 "array DWORD faceIndexes[nFaceIndexes];"
169 "template MeshNormals"
171 "<F6F23F43-7686-11CF-8F52-0040333594A3>"
173 "array Vector normals[nNormals];"
174 "DWORD nFaceNormals;"
175 "array MeshFace faceNormals[nFaceNormals];"
177 "template MeshVertexColors"
179 "<1630B821-7842-11CF-8F52-0040333594A3>"
180 "DWORD nVertexColors;"
181 "array IndexedColor vertexColors[nVertexColors];"
185 "<3D82AB44-62DA-11CF-AB39-0020AF71E433>"
187 "array Vector vertices[nVertices];"
189 "array MeshFace faces[nFaces];"
192 "template FrameTransformMatrix"
194 "<F6F23F41-7686-11CF-8F52-0040333594A3>"
195 "Matrix4x4 frameMatrix;"
199 "<3D82AB46-62DA-11CF-AB39-0020AF71E433>"
204 "<10DD46A9-775B-11CF-8F52-0040333594A3>"
206 "array FLOAT values[nValues];"
208 "template TimedFloatKeys"
210 "<F406B180-7B3B-11CF-8F52-0040333594A3>"
214 "template AnimationKey"
216 "<10DD46A8-775B-11CF-8F52-0040333594A3>"
219 "array TimedFloatKeys keys[nKeys];"
221 "template AnimationOptions"
223 "<E2BF56C0-840F-11CF-8F52-0040333594A3>"
225 "DWORD positionquality;"
229 "<3D82AB4F-62DA-11CF-AB39-0020AF71E433>"
232 "template AnimationSet"
234 "<3D82AB50-62DA-11CF-AB39-0020AF71E433>"
237 "template InlineData"
239 "<3A23EEA0-94B1-11D0-AB39-0020AF71E433>"
244 "<3A23EEA1-94B1-11D0-AB39-0020AF71E433>"
246 "array STRING urls[nUrls];"
248 "template ProgressiveMesh"
250 "<8A63C360-997D-11D0-941C-0080C80CFA7B>"
255 "<A42790E0-7810-11CF-8F52-0040333594A3>"
259 "array UCHAR data4[8];"
261 "template StringProperty"
263 "<7F0F21E0-BFE1-11D1-82C0-00A0C9697271>"
267 "template PropertyBag"
269 "<7F0F21E1-BFE1-11D1-82C0-00A0C9697271>"
272 "template ExternalVisual"
274 "<98116AA0-BDBA-11D1-82C0-00A0C9697271>"
275 "Guid guidExternalVisual;"
278 "template RightHanded"
280 "<7F5D5EA0-D53A-11D1-82C0-00A0C9697271>"
281 "DWORD bRightHanded;"
285 HRESULT
Direct3DRMMeshBuilder_create(LPDIRECT3DRMMESHBUILDER
* ppMeshBuilder
)
287 IDirect3DRMMeshBuilderImpl
* object
;
289 TRACE("(%p)\n", ppMeshBuilder
);
291 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirect3DRMMeshBuilderImpl
));
294 ERR("Out of memory\n");
295 return E_OUTOFMEMORY
;
298 object
->lpVtbl
= &Direct3DRMMeshBuilder_Vtbl
;
301 *ppMeshBuilder
= (IDirect3DRMMeshBuilder
*)object
;
306 /*** IUnknown methods ***/
307 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_QueryInterface(IDirect3DRMMeshBuilder
* iface
, REFIID riid
, void** ppvObject
)
309 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
311 TRACE("(%p)->(%s,%p)\n", This
, debugstr_guid(riid
), ppvObject
);
313 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
314 IsEqualGUID(riid
, &IID_IDirect3DRMMeshBuilder
))
316 IClassFactory_AddRef(iface
);
321 ERR("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppvObject
);
322 return E_NOINTERFACE
;
325 static ULONG WINAPI
IDirect3DRMMeshBuilderImpl_AddRef(IDirect3DRMMeshBuilder
* iface
)
327 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
329 TRACE("(%p)\n", This
);
331 return InterlockedIncrement(&This
->ref
);
334 static ULONG WINAPI
IDirect3DRMMeshBuilderImpl_Release(IDirect3DRMMeshBuilder
* iface
)
336 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
337 ULONG ref
= InterlockedDecrement(&This
->ref
);
339 TRACE("(%p)\n", This
);
343 HeapFree(GetProcessHeap(), 0, This
->pVertices
);
344 HeapFree(GetProcessHeap(), 0, This
->pNormals
);
345 HeapFree(GetProcessHeap(), 0, This
->pFaceData
);
346 HeapFree(GetProcessHeap(), 0, This
);
352 /*** IDirect3DRMObject methods ***/
353 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_Clone(IDirect3DRMMeshBuilder
* iface
, LPUNKNOWN pUnkOuter
, REFIID riid
, LPVOID
*ppvObj
)
355 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
357 FIXME("(%p)->(%p,%s,%p): stub\n", This
, pUnkOuter
, debugstr_guid(riid
), ppvObj
);
362 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_AddDestroyCallback(IDirect3DRMMeshBuilder
* iface
, D3DRMOBJECTCALLBACK cb
, LPVOID argument
)
364 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
366 FIXME("(%p)->(%p,%p): stub\n", This
, cb
, argument
);
371 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_DeleteDestroyCallback(IDirect3DRMMeshBuilder
* iface
, D3DRMOBJECTCALLBACK cb
, LPVOID argument
)
373 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
375 FIXME("(%p)->(%p,%p): stub\n", This
, cb
, argument
);
380 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetAppData(IDirect3DRMMeshBuilder
* iface
, DWORD data
)
382 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
384 FIXME("(%p)->(%u): stub\n", This
, data
);
389 static DWORD WINAPI
IDirect3DRMMeshBuilderImpl_GetAppData(IDirect3DRMMeshBuilder
* iface
)
391 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
393 FIXME("(%p)->(): stub\n", This
);
398 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetName(IDirect3DRMMeshBuilder
* iface
, LPCSTR pName
)
400 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
402 FIXME("(%p)->(%s): stub\n", This
, pName
);
407 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_GetName(IDirect3DRMMeshBuilder
* iface
, LPDWORD lpdwSize
, LPSTR lpName
)
409 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
411 FIXME("(%p)->(%p,%p): stub\n", This
, lpdwSize
, lpName
);
416 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_GetClassName(IDirect3DRMMeshBuilder
* iface
, LPDWORD lpdwSize
, LPSTR lpName
)
418 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
420 FIXME("(%p)->(%p,%p): stub\n", This
, lpdwSize
, lpName
);
425 /*** IDirect3DRMMeshBuilder methods ***/
426 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_Load(IDirect3DRMMeshBuilder
* iface
, LPVOID filename
, LPVOID name
, D3DRMLOADOPTIONS loadflags
, D3DRMLOADTEXTURECALLBACK cb
, LPVOID pArg
)
428 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
429 DXFILELOADOPTIONS load_options
;
430 LPDIRECTXFILE pDXFile
= NULL
;
431 LPDIRECTXFILEENUMOBJECT pEnumObject
= NULL
;
432 LPDIRECTXFILEDATA pData
= NULL
;
433 LPDIRECTXFILEOBJECT pObject
= NULL
;
434 LPDIRECTXFILEDATA pData2
= NULL
;
440 HRESULT ret
= D3DRMERR_BADOBJECT
;
442 FIXME("(%p)->(%p,%p,%x,%p,%p): partial stub\n", This
, filename
, name
, loadflags
, cb
, pArg
);
444 /* First free allocated buffers of previous mesh data */
445 HeapFree(GetProcessHeap(), 0, This
->pVertices
);
446 This
->pVertices
= NULL
;
447 HeapFree(GetProcessHeap(), 0, This
->pNormals
);
448 This
->pNormals
= NULL
;
449 HeapFree(GetProcessHeap(), 0, This
->pFaceData
);
450 This
->pFaceData
= NULL
;
451 HeapFree(GetProcessHeap(), 0, This
->pCoords2d
);
452 This
->pCoords2d
= NULL
;
454 if (loadflags
== D3DRMLOAD_FROMMEMORY
)
456 load_options
= DXFILELOAD_FROMMEMORY
;
460 FIXME("Load options %d not supported yet\n", loadflags
);
464 hr
= DirectXFileCreate(&pDXFile
);
468 hr
= IDirectXFile_RegisterTemplates(pDXFile
, templates
, strlen(templates
));
472 hr
= IDirectXFile_CreateEnumObject(pDXFile
, filename
, load_options
, &pEnumObject
);
476 hr
= IDirectXFileEnumObject_GetNextDataObject(pEnumObject
, &pData
);
480 hr
= IDirectXFileData_GetType(pData
, &pGuid
);
484 TRACE("Found object type whose GUID = %s\n", debugstr_guid(pGuid
));
486 if (!IsEqualGUID(pGuid
, &TID_DXFILEHeader
))
488 ret
= D3DRMERR_BADFILE
;
492 hr
= IDirectXFileData_GetData(pData
, NULL
, &size
, (void**)&pHeader
);
493 if ((hr
!= DXFILE_OK
) || (size
!= sizeof(Header
)))
496 TRACE("Version is %d %d %d\n", pHeader
->major
, pHeader
->minor
, pHeader
->flags
);
498 /* Version must be 1.0.x */
499 if ((pHeader
->major
!= 1) || (pHeader
->minor
!= 0))
501 ret
= D3DRMERR_BADFILE
;
505 IDirectXFileData_Release(pData
);
508 hr
= IDirectXFileEnumObject_GetNextDataObject(pEnumObject
, &pData
);
511 ret
= D3DRMERR_NOTFOUND
;
515 hr
= IDirectXFileData_GetType(pData
, &pGuid
);
519 TRACE("Found object type whose GUID = %s\n", debugstr_guid(pGuid
));
521 if (!IsEqualGUID(pGuid
, &TID_D3DRMMesh
))
523 ret
= D3DRMERR_NOTFOUND
;
527 hr
= IDirectXFileData_GetData(pData
, NULL
, &size
, (void**)&ptr
);
531 This
->nb_vertices
= *(DWORD
*)ptr
;
532 This
->nb_faces
= *(DWORD
*)(ptr
+ sizeof(DWORD
) + This
->nb_vertices
* sizeof(D3DVECTOR
));
533 This
->face_data_size
= size
- sizeof(DWORD
) - This
->nb_vertices
* sizeof(D3DVECTOR
) - sizeof(DWORD
);
535 TRACE("Mesh: nb_vertices = %d, nb_faces = %d, face_data_size = %d\n", This
->nb_vertices
, This
->nb_faces
, This
->face_data_size
);
537 This
->pVertices
= HeapAlloc(GetProcessHeap(), 0, This
->nb_vertices
* sizeof(D3DVECTOR
));
538 memcpy(This
->pVertices
, ptr
+ sizeof(DWORD
), This
->nb_vertices
* sizeof(D3DVECTOR
));
540 This
->pFaceData
= HeapAlloc(GetProcessHeap(), 0, This
->face_data_size
);
541 memcpy(This
->pFaceData
, ptr
+ sizeof(DWORD
) + This
->nb_vertices
* sizeof(D3DVECTOR
) + sizeof(DWORD
), This
->face_data_size
);
545 hr
= IDirectXFileData_GetNextObject(pData
, &pObject
);
546 if (hr
== DXFILEERR_NOMOREOBJECTS
)
548 FIXME("no more object\n");
554 hr
= IDirectXFileObject_QueryInterface(pObject
, &IID_IDirectXFileData
, (void**)&pData2
);
555 IDirectXFileObject_Release(pObject
);
559 hr
= IDirectXFileData_GetType(pData2
, &pGuid
);
562 IDirectXFileData_Release(pData2
);
566 FIXME("Found object type whose GUID = %s\n", debugstr_guid(pGuid
));
568 if (!IsEqualGUID(pGuid
, &TID_D3DRMMeshNormals
))
572 hr
= IDirectXFileData_GetData(pData
, NULL
, &size
, (void**)&ptr
);
576 This
->nb_normals
= *(DWORD
*)ptr
;
577 tmp
= *(DWORD
*)(ptr
+ sizeof(DWORD
) + This
->nb_normals
* sizeof(D3DVECTOR
));
579 FIXME("MeshNormals: nb_normals = %d, nb_faces_normals = %d\n", This
->nb_normals
, tmp
);
581 This
->pNormals
= HeapAlloc(GetProcessHeap(), 0, This
->nb_normals
* sizeof(D3DVECTOR
));
582 memcpy(This
->pNormals
, ptr
+ sizeof(DWORD
), This
->nb_normals
* sizeof(D3DVECTOR
));
584 else if(!IsEqualGUID(pGuid
, &TID_D3DRMMeshTextureCoords
))
586 hr
= IDirectXFileData_GetData(pData
, NULL
, &size
, (void**)&ptr
);
590 This
->nb_coords2d
= *(DWORD
*)ptr
;
592 FIXME("MeshTextureCoords: nb_coords2d = %d\n", This
->nb_coords2d
);
594 This
->pCoords2d
= HeapAlloc(GetProcessHeap(), 0, This
->nb_coords2d
* sizeof(Coords2d
));
595 memcpy(This
->pCoords2d
, ptr
+ sizeof(DWORD
), This
->nb_coords2d
* sizeof(Coords2d
));
598 else if(!IsEqualGUID(pGuid
, &TID_D3DRMMeshMaterialList
))
600 FIXME("MeshMaterialList not supported yet, ignoring...\n");
604 FIXME("Unknown GUID %s, ignoring...\n", debugstr_guid(pGuid
));
607 IDirectXFileData_Release(pData2
);
614 IDirectXFileData_Release(pData
);
616 IDirectXFileEnumObject_Release(pEnumObject
);
618 IDirectXFile_Release(pDXFile
);
622 /* Clean mesh data */
623 This
->nb_vertices
= 0;
624 This
->nb_normals
= 0;
626 This
->face_data_size
= 0;
627 This
->nb_coords2d
= 0;
628 HeapFree(GetProcessHeap(), 0, This
->pVertices
);
629 This
->pVertices
= NULL
;
630 HeapFree(GetProcessHeap(), 0, This
->pNormals
);
631 This
->pNormals
= NULL
;
632 HeapFree(GetProcessHeap(), 0, This
->pFaceData
);
633 This
->pFaceData
= NULL
;
634 HeapFree(GetProcessHeap(), 0, This
->pCoords2d
);
635 This
->pCoords2d
= NULL
;
641 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_Save(IDirect3DRMMeshBuilder
* iface
, const char *filename
, D3DRMXOFFORMAT format
, D3DRMSAVEOPTIONS save
)
643 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
645 FIXME("(%p)->(%s,%d,%d): stub\n", This
, filename
, format
, save
);
650 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_Scale(IDirect3DRMMeshBuilder
* iface
, D3DVALUE sx
, D3DVALUE sy
, D3DVALUE sz
)
652 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
654 FIXME("(%p)->(%f,%f,%f): stub\n", This
, sx
, sy
, sz
);
659 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_Translate(IDirect3DRMMeshBuilder
* iface
, D3DVALUE tx
, D3DVALUE ty
, D3DVALUE tz
)
661 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
663 FIXME("(%p)->(%f,%f,%f): stub\n", This
, tx
, ty
, tz
);
668 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetColorSource(IDirect3DRMMeshBuilder
* iface
, D3DRMCOLORSOURCE color
)
670 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
672 FIXME("(%p)->(%x): stub\n", This
, color
);
677 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_GetBox(IDirect3DRMMeshBuilder
* iface
, D3DRMBOX
*pBox
)
679 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
681 FIXME("(%p)->(%p): stub\n", This
, pBox
);
686 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_GenerateNormals(IDirect3DRMMeshBuilder
* iface
)
688 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
690 FIXME("(%p)->(): stub\n", This
);
695 static D3DRMCOLORSOURCE WINAPI
IDirect3DRMMeshBuilderImpl_GetColorSource(IDirect3DRMMeshBuilder
* iface
)
697 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
699 FIXME("(%p)->(): stub\n", This
);
704 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_AddMesh(IDirect3DRMMeshBuilder
* iface
, LPDIRECT3DRMMESH pMesh
)
706 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
708 FIXME("(%p)->(%p): stub\n", This
, pMesh
);
713 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_AddMeshBuilder(IDirect3DRMMeshBuilder
* iface
, LPDIRECT3DRMMESHBUILDER pMeshBuilder
)
715 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
717 FIXME("(%p)->(%p): stub\n", This
, pMeshBuilder
);
722 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_AddFrame(IDirect3DRMMeshBuilder
* iface
, LPDIRECT3DRMFRAME pFrame
)
724 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
726 FIXME("(%p)->(%p): stub\n", This
, pFrame
);
731 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_AddFace(IDirect3DRMMeshBuilder
* iface
, LPDIRECT3DRMFACE pFace
)
733 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
735 FIXME("(%p)->(%p): stub\n", This
, pFace
);
740 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_AddFaces(IDirect3DRMMeshBuilder
* iface
, DWORD vcount
, D3DVECTOR
*vertices
, DWORD ncount
, D3DVECTOR
*normals
, DWORD
*data
, LPDIRECT3DRMFACEARRAY
* pFaceArray
)
742 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
744 FIXME("(%p)->(%d,%p,%d,%p,%p,%p): stub\n", This
, vcount
, vertices
, ncount
, normals
, data
, pFaceArray
);
749 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_ReserveSpace(IDirect3DRMMeshBuilder
* iface
, DWORD vertex_Count
, DWORD normal_count
, DWORD face_count
)
751 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
753 FIXME("(%p)->(%d,%d,%d): stub\n", This
, vertex_Count
, normal_count
, face_count
);
758 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetColorRGB(IDirect3DRMMeshBuilder
* iface
, D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
)
760 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
762 FIXME("(%p)->(%f,%f,%f): stub\n", This
, red
, green
, blue
);
767 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetColor(IDirect3DRMMeshBuilder
* iface
, D3DCOLOR color
)
769 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
771 FIXME("(%p)->(%x): stub\n", This
, color
);
776 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetTexture(IDirect3DRMMeshBuilder
* iface
, LPDIRECT3DRMTEXTURE pTexture
)
778 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
780 FIXME("(%p)->(%p): stub\n", This
, pTexture
);
785 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetMaterial(IDirect3DRMMeshBuilder
* iface
, LPDIRECT3DRMMATERIAL pMaterial
)
787 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
789 FIXME("(%p)->(%p): stub\n", This
, pMaterial
);
794 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetTextureTopology(IDirect3DRMMeshBuilder
* iface
, BOOL wrap_u
, BOOL wrap_v
)
796 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
798 FIXME("(%p)->(%d,%d): stub\n", This
, wrap_u
, wrap_v
);
803 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetQuality(IDirect3DRMMeshBuilder
* iface
, D3DRMRENDERQUALITY quality
)
805 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
807 FIXME("(%p)->(%d): stub\n", This
, quality
);
812 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetPerspective(IDirect3DRMMeshBuilder
* iface
, BOOL enable
)
814 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
816 FIXME("(%p)->(%d): stub\n", This
, enable
);
821 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetVertex(IDirect3DRMMeshBuilder
* iface
, DWORD index
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
)
823 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
825 FIXME("(%p)->(%f,%f,%f): stub\n", This
, x
, y
, z
);
830 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetNormal(IDirect3DRMMeshBuilder
* iface
, DWORD index
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
)
832 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
834 FIXME("(%p)->(%f,%f,%f): stub\n", This
, x
, y
, z
);
839 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetTextureCoordinates(IDirect3DRMMeshBuilder
* iface
, DWORD index
, D3DVALUE u
, D3DVALUE v
)
841 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
843 FIXME("(%p)->(%f,%f): stub\n", This
, u
, v
);
848 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetVertexColor(IDirect3DRMMeshBuilder
* iface
, DWORD index
, D3DCOLOR color
)
850 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
852 FIXME("(%p)->(%d,%x): stub\n", This
, index
, color
);
857 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetVertexColorRGB(IDirect3DRMMeshBuilder
* iface
, DWORD index
, D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
)
859 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
861 FIXME("(%p)->(%d,%f,%f,%f): stub\n", This
, index
, red
, green
, blue
);
866 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_GetFaces(IDirect3DRMMeshBuilder
* iface
, LPDIRECT3DRMFACEARRAY
* pFaceArray
)
868 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
870 FIXME("(%p)->(%p): stub\n", This
, pFaceArray
);
875 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_GetVertices(IDirect3DRMMeshBuilder
* iface
, DWORD
*vcount
, D3DVECTOR
*vertices
, DWORD
*ncount
, D3DVECTOR
*normals
, DWORD
*face_data_size
, DWORD
*face_data
)
877 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
879 TRACE("(%p)->(%p,%p,%p,%p,%p,%p)\n", This
, vcount
, vertices
, ncount
, normals
, face_data_size
, face_data
);
882 *vcount
= This
->nb_vertices
;
883 if (vertices
&& This
->nb_vertices
)
884 memcpy(vertices
, This
->pVertices
, This
->nb_vertices
* sizeof(D3DVECTOR
));
886 *ncount
= This
->nb_normals
;
887 if (normals
&& This
->nb_normals
)
888 memcpy(normals
, This
->pNormals
, This
->nb_normals
* sizeof(D3DVECTOR
));
890 *face_data_size
= This
->face_data_size
;
891 if (face_data
&& This
->face_data_size
)
892 memcpy(face_data
, This
->pFaceData
, This
->face_data_size
);
897 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_GetTextureCoordinates(IDirect3DRMMeshBuilder
* iface
, DWORD index
, D3DVALUE
*u
, D3DVALUE
*v
)
899 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
901 FIXME("(%p)->(%d,%p,%p): stub\n", This
, index
, u
, v
);
903 if (index
>= This
->nb_coords2d
)
904 return D3DRMERR_NOTFOUND
;
906 *u
= This
->pCoords2d
[index
].u
;
907 *v
= This
->pCoords2d
[index
].v
;
912 static int WINAPI
IDirect3DRMMeshBuilderImpl_AddVertex(IDirect3DRMMeshBuilder
* iface
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
)
914 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
916 FIXME("(%p)->(%f,%f,%f): stub\n", This
, x
, y
, z
);
921 static int WINAPI
IDirect3DRMMeshBuilderImpl_AddNormal(IDirect3DRMMeshBuilder
* iface
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
)
923 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
925 FIXME("(%p)->(%f,%f,%f): stub\n", This
, x
, y
, z
);
930 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_CreateFace(IDirect3DRMMeshBuilder
* iface
, LPDIRECT3DRMFACE
* ppFace
)
932 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
934 FIXME("(%p)->(%p): stub\n", This
, ppFace
);
939 static D3DRMRENDERQUALITY WINAPI
IDirect3DRMMeshBuilderImpl_GetQuality(IDirect3DRMMeshBuilder
* iface
)
941 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
943 FIXME("(%p)->(): stub\n", This
);
948 static BOOL WINAPI
IDirect3DRMMeshBuilderImpl_GetPerspective(IDirect3DRMMeshBuilder
* iface
)
950 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
952 FIXME("(%p)->(): stub\n", This
);
957 static int WINAPI
IDirect3DRMMeshBuilderImpl_GetFaceCount(IDirect3DRMMeshBuilder
* iface
)
959 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
961 TRACE("(%p)->()\n", This
);
963 return This
->nb_faces
;
966 static int WINAPI
IDirect3DRMMeshBuilderImpl_GetVertexCount(IDirect3DRMMeshBuilder
* iface
)
968 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
970 TRACE("(%p)->()\n", This
);
972 return This
->nb_vertices
;
975 static D3DCOLOR WINAPI
IDirect3DRMMeshBuilderImpl_GetVertexColor(IDirect3DRMMeshBuilder
* iface
, DWORD index
)
977 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
979 FIXME("(%p)->(%d): stub\n", This
, index
);
984 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_CreateMesh(IDirect3DRMMeshBuilder
* iface
, LPDIRECT3DRMMESH
* ppMesh
)
986 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
988 FIXME("(%p)->(%p): stub\n", This
, ppMesh
);
993 static const struct IDirect3DRMMeshBuilderVtbl Direct3DRMMeshBuilder_Vtbl
=
995 /*** IUnknown methods ***/
996 IDirect3DRMMeshBuilderImpl_QueryInterface
,
997 IDirect3DRMMeshBuilderImpl_AddRef
,
998 IDirect3DRMMeshBuilderImpl_Release
,
999 /*** IDirect3DRMObject methods ***/
1000 IDirect3DRMMeshBuilderImpl_Clone
,
1001 IDirect3DRMMeshBuilderImpl_AddDestroyCallback
,
1002 IDirect3DRMMeshBuilderImpl_DeleteDestroyCallback
,
1003 IDirect3DRMMeshBuilderImpl_SetAppData
,
1004 IDirect3DRMMeshBuilderImpl_GetAppData
,
1005 IDirect3DRMMeshBuilderImpl_SetName
,
1006 IDirect3DRMMeshBuilderImpl_GetName
,
1007 IDirect3DRMMeshBuilderImpl_GetClassName
,
1008 /*** IDirect3DRMMeshBuilder methods ***/
1009 IDirect3DRMMeshBuilderImpl_Load
,
1010 IDirect3DRMMeshBuilderImpl_Save
,
1011 IDirect3DRMMeshBuilderImpl_Scale
,
1012 IDirect3DRMMeshBuilderImpl_Translate
,
1013 IDirect3DRMMeshBuilderImpl_SetColorSource
,
1014 IDirect3DRMMeshBuilderImpl_GetBox
,
1015 IDirect3DRMMeshBuilderImpl_GenerateNormals
,
1016 IDirect3DRMMeshBuilderImpl_GetColorSource
,
1017 IDirect3DRMMeshBuilderImpl_AddMesh
,
1018 IDirect3DRMMeshBuilderImpl_AddMeshBuilder
,
1019 IDirect3DRMMeshBuilderImpl_AddFrame
,
1020 IDirect3DRMMeshBuilderImpl_AddFace
,
1021 IDirect3DRMMeshBuilderImpl_AddFaces
,
1022 IDirect3DRMMeshBuilderImpl_ReserveSpace
,
1023 IDirect3DRMMeshBuilderImpl_SetColorRGB
,
1024 IDirect3DRMMeshBuilderImpl_SetColor
,
1025 IDirect3DRMMeshBuilderImpl_SetTexture
,
1026 IDirect3DRMMeshBuilderImpl_SetMaterial
,
1027 IDirect3DRMMeshBuilderImpl_SetTextureTopology
,
1028 IDirect3DRMMeshBuilderImpl_SetQuality
,
1029 IDirect3DRMMeshBuilderImpl_SetPerspective
,
1030 IDirect3DRMMeshBuilderImpl_SetVertex
,
1031 IDirect3DRMMeshBuilderImpl_SetNormal
,
1032 IDirect3DRMMeshBuilderImpl_SetTextureCoordinates
,
1033 IDirect3DRMMeshBuilderImpl_SetVertexColor
,
1034 IDirect3DRMMeshBuilderImpl_SetVertexColorRGB
,
1035 IDirect3DRMMeshBuilderImpl_GetFaces
,
1036 IDirect3DRMMeshBuilderImpl_GetVertices
,
1037 IDirect3DRMMeshBuilderImpl_GetTextureCoordinates
,
1038 IDirect3DRMMeshBuilderImpl_AddVertex
,
1039 IDirect3DRMMeshBuilderImpl_AddNormal
,
1040 IDirect3DRMMeshBuilderImpl_CreateFace
,
1041 IDirect3DRMMeshBuilderImpl_GetQuality
,
1042 IDirect3DRMMeshBuilderImpl_GetPerspective
,
1043 IDirect3DRMMeshBuilderImpl_GetFaceCount
,
1044 IDirect3DRMMeshBuilderImpl_GetVertexCount
,
1045 IDirect3DRMMeshBuilderImpl_GetVertexColor
,
1046 IDirect3DRMMeshBuilderImpl_CreateMesh