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"
32 #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 const GUID GUID_Header
= { 0x3D82AB43, 0x62DA, 0x11CF, { 0xAB, 0x39, 0x00, 0x20, 0xAF, 0x71, 0xE4, 0x33 } };
65 static const GUID GUID_Mesh
= { 0x3D82AB44, 0x62DA, 0x11CF, { 0xAB, 0x39, 0x00, 0x20, 0xAF, 0x71, 0xE4, 0x33 } };
66 static const GUID GUID_MeshTextureCoords
= { 0xF6F23F40, 0x7686, 0x11CF, { 0x8F, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xA3 } };
67 static const GUID GUID_MeshMaterialList
= { 0xF6F23F42, 0x7686, 0x11CF, { 0x8F, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xA3 } };
68 static const GUID GUID_MeshNormals
= { 0xF6F23F43, 0x7686, 0x11CF, { 0x8F, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xA3 } };
70 static char templates
[] = {
74 "<3D82AB43-62DA-11CF-AB39-0020AF71E433>"
81 "<3D82AB5E-62DA-11CF-AB39-0020AF71E433>"
88 "<F6F23F44-7686-11CF-8F52-0040333594A3>"
94 "<F6F23F45-7686-11CF-8F52-0040333594A3>"
95 "array FLOAT matrix[16];"
99 "<35FF44E0-6C7C-11CF-8F52-0040333594A3>"
107 "<D3E16E81-7835-11CF-8F52-0040333594A3>"
112 "template IndexedColor"
114 "<1630B820-7842-11CF-8F52-0040333594A3>"
116 "ColorRGBA indexColor;"
120 "<537DA6A0-CA37-11D0-941C-0080C80CFA7B>"
125 "<4885AE63-78E8-11CF-8F52-0040333594A3>"
129 "template MaterialWrap"
131 "<4885AE60-78E8-11CF-8F52-0040333594A3>"
135 "template TextureFilename"
137 "<A42790E1-7810-11CF-8F52-0040333594A3>"
142 "<3D82AB4D-62DA-11CF-AB39-0020AF71E433>"
143 "ColorRGBA faceColor;"
145 "ColorRGB specularColor;"
146 "ColorRGB emissiveColor;"
151 "<3D82AB5F-62DA-11CF-AB39-0020AF71E433>"
152 "DWORD nFaceVertexIndices;"
153 "array DWORD faceVertexIndices[nFaceVertexIndices];"
155 "template MeshFaceWraps"
157 "<ED1EC5C0-C0A8-11D0-941C-0080C80CFA7B>"
158 "DWORD nFaceWrapValues;"
159 "array Boolean2d faceWrapValues[nFaceWrapValues];"
161 "template MeshTextureCoords"
163 "<F6F23F40-7686-11CF-8F52-0040333594A3>"
164 "DWORD nTextureCoords;"
165 "array Coords2d textureCoords[nTextureCoords];"
167 "template MeshMaterialList"
169 "<F6F23F42-7686-11CF-8F52-0040333594A3>"
171 "DWORD nFaceIndexes;"
172 "array DWORD faceIndexes[nFaceIndexes];"
175 "template MeshNormals"
177 "<F6F23F43-7686-11CF-8F52-0040333594A3>"
179 "array Vector normals[nNormals];"
180 "DWORD nFaceNormals;"
181 "array MeshFace faceNormals[nFaceNormals];"
183 "template MeshVertexColors"
185 "<1630B821-7842-11CF-8F52-0040333594A3>"
186 "DWORD nVertexColors;"
187 "array IndexedColor vertexColors[nVertexColors];"
191 "<3D82AB44-62DA-11CF-AB39-0020AF71E433>"
193 "array Vector vertices[nVertices];"
195 "array MeshFace faces[nFaces];"
198 "template FrameTransformMatrix"
200 "<F6F23F41-7686-11CF-8F52-0040333594A3>"
201 "Matrix4x4 frameMatrix;"
205 "<3D82AB46-62DA-11CF-AB39-0020AF71E433>"
210 "<10DD46A9-775B-11CF-8F52-0040333594A3>"
212 "array FLOAT values[nValues];"
214 "template TimedFloatKeys"
216 "<F406B180-7B3B-11CF-8F52-0040333594A3>"
220 "template AnimationKey"
222 "<10DD46A8-775B-11CF-8F52-0040333594A3>"
225 "array TimedFloatKeys keys[nKeys];"
227 "template AnimationOptions"
229 "<E2BF56C0-840F-11CF-8F52-0040333594A3>"
231 "DWORD positionquality;"
235 "<3D82AB4F-62DA-11CF-AB39-0020AF71E433>"
238 "template AnimationSet"
240 "<3D82AB50-62DA-11CF-AB39-0020AF71E433>"
243 "template InlineData"
245 "<3A23EEA0-94B1-11D0-AB39-0020AF71E433>"
250 "<3A23EEA1-94B1-11D0-AB39-0020AF71E433>"
252 "array STRING urls[nUrls];"
254 "template ProgressiveMesh"
256 "<8A63C360-997D-11D0-941C-0080C80CFA7B>"
261 "<A42790E0-7810-11CF-8F52-0040333594A3>"
265 "array UCHAR data4[8];"
267 "template StringProperty"
269 "<7F0F21E0-BFE1-11D1-82C0-00A0C9697271>"
273 "template PropertyBag"
275 "<7F0F21E1-BFE1-11D1-82C0-00A0C9697271>"
278 "template ExternalVisual"
280 "<98116AA0-BDBA-11D1-82C0-00A0C9697271>"
281 "Guid guidExternalVisual;"
284 "template RightHanded"
286 "<7F5D5EA0-D53A-11D1-82C0-00A0C9697271>"
287 "DWORD bRightHanded;"
291 HRESULT
Direct3DRMMeshBuilder_create(LPDIRECT3DRMMESHBUILDER
* ppMeshBuilder
)
293 IDirect3DRMMeshBuilderImpl
* object
;
295 TRACE("(%p)\n", ppMeshBuilder
);
297 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirect3DRMMeshBuilderImpl
));
300 ERR("Out of memory\n");
301 return E_OUTOFMEMORY
;
304 object
->lpVtbl
= &Direct3DRMMeshBuilder_Vtbl
;
307 *ppMeshBuilder
= (IDirect3DRMMeshBuilder
*)object
;
312 /*** IUnknown methods ***/
313 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_QueryInterface(IDirect3DRMMeshBuilder
* iface
, REFIID riid
, void** ppvObject
)
315 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
317 TRACE("(%p)->(%s,%p)\n", This
, debugstr_guid(riid
), ppvObject
);
319 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
320 IsEqualGUID(riid
, &IID_IDirect3DRMMeshBuilder
))
322 IClassFactory_AddRef(iface
);
327 ERR("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppvObject
);
328 return E_NOINTERFACE
;
331 static ULONG WINAPI
IDirect3DRMMeshBuilderImpl_AddRef(IDirect3DRMMeshBuilder
* iface
)
333 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
335 TRACE("(%p)\n", This
);
337 return InterlockedIncrement(&This
->ref
);
340 static ULONG WINAPI
IDirect3DRMMeshBuilderImpl_Release(IDirect3DRMMeshBuilder
* iface
)
342 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
343 ULONG ref
= InterlockedDecrement(&This
->ref
);
345 TRACE("(%p)\n", This
);
349 HeapFree(GetProcessHeap(), 0, This
->pVertices
);
350 HeapFree(GetProcessHeap(), 0, This
->pNormals
);
351 HeapFree(GetProcessHeap(), 0, This
->pFaceData
);
352 HeapFree(GetProcessHeap(), 0, This
);
358 /*** IDirect3DRMObject methods ***/
359 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_Clone(IDirect3DRMMeshBuilder
* iface
, LPUNKNOWN pUnkOuter
, REFIID riid
, LPVOID
*ppvObj
)
361 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
363 FIXME("(%p)->(%p,%s,%p): stub\n", This
, pUnkOuter
, debugstr_guid(riid
), ppvObj
);
368 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_AddDestroyCallback(IDirect3DRMMeshBuilder
* iface
, D3DRMOBJECTCALLBACK cb
, LPVOID argument
)
370 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
372 FIXME("(%p)->(%p,%p): stub\n", This
, cb
, argument
);
377 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_DeleteDestroyCallback(IDirect3DRMMeshBuilder
* iface
, D3DRMOBJECTCALLBACK cb
, LPVOID argument
)
379 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
381 FIXME("(%p)->(%p,%p): stub\n", This
, cb
, argument
);
386 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetAppData(IDirect3DRMMeshBuilder
* iface
, DWORD data
)
388 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
390 FIXME("(%p)->(%u): stub\n", This
, data
);
395 static DWORD WINAPI
IDirect3DRMMeshBuilderImpl_GetAppData(IDirect3DRMMeshBuilder
* iface
)
397 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
399 FIXME("(%p)->(): stub\n", This
);
404 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetName(IDirect3DRMMeshBuilder
* iface
, LPCSTR pName
)
406 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
408 FIXME("(%p)->(%s): stub\n", This
, pName
);
413 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_GetName(IDirect3DRMMeshBuilder
* iface
, LPDWORD lpdwSize
, LPSTR lpName
)
415 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
417 FIXME("(%p)->(%p,%p): stub\n", This
, lpdwSize
, lpName
);
422 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_GetClassName(IDirect3DRMMeshBuilder
* iface
, LPDWORD lpdwSize
, LPSTR lpName
)
424 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
426 FIXME("(%p)->(%p,%p): stub\n", This
, lpdwSize
, lpName
);
431 /*** IDirect3DRMMeshBuilder methods ***/
432 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_Load(IDirect3DRMMeshBuilder
* iface
, LPVOID filename
, LPVOID name
, D3DRMLOADOPTIONS loadflags
, D3DRMLOADTEXTURECALLBACK cb
, LPVOID pArg
)
434 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
435 DXFILELOADOPTIONS load_options
;
436 LPDIRECTXFILE pDXFile
= NULL
;
437 LPDIRECTXFILEENUMOBJECT pEnumObject
= NULL
;
438 LPDIRECTXFILEDATA pData
= NULL
;
439 LPDIRECTXFILEOBJECT pObject
= NULL
;
440 LPDIRECTXFILEDATA pData2
= NULL
;
446 HRESULT ret
= D3DRMERR_BADOBJECT
;
448 FIXME("(%p)->(%p,%p,%x,%p,%p): partial stub\n", This
, filename
, name
, loadflags
, cb
, pArg
);
450 /* First free allocated buffers of previous mesh data */
451 HeapFree(GetProcessHeap(), 0, This
->pVertices
);
452 This
->pVertices
= NULL
;
453 HeapFree(GetProcessHeap(), 0, This
->pNormals
);
454 This
->pNormals
= NULL
;
455 HeapFree(GetProcessHeap(), 0, This
->pFaceData
);
456 This
->pFaceData
= NULL
;
457 HeapFree(GetProcessHeap(), 0, This
->pCoords2d
);
458 This
->pCoords2d
= NULL
;
460 if (loadflags
== D3DRMLOAD_FROMMEMORY
)
462 load_options
= DXFILELOAD_FROMMEMORY
;
466 FIXME("Load options %d not supported yet\n", loadflags
);
470 hr
= DirectXFileCreate(&pDXFile
);
474 hr
= IDirectXFile_RegisterTemplates(pDXFile
, templates
, strlen(templates
));
478 hr
= IDirectXFile_CreateEnumObject(pDXFile
, filename
, load_options
, &pEnumObject
);
482 hr
= IDirectXFileEnumObject_GetNextDataObject(pEnumObject
, &pData
);
486 hr
= IDirectXFileData_GetType(pData
, &pGuid
);
490 TRACE("Found object type whose GUID = %s\n", debugstr_guid(pGuid
));
492 if (!IsEqualGUID(pGuid
, &GUID_Header
))
494 ret
= D3DRMERR_BADFILE
;
498 hr
= IDirectXFileData_GetData(pData
, NULL
, &size
, (void**)&pHeader
);
499 if ((hr
!= DXFILE_OK
) || (size
!= sizeof(Header
)))
502 TRACE("Version is %d %d %d\n", pHeader
->major
, pHeader
->minor
, pHeader
->flags
);
504 /* Version must be 1.0.x */
505 if ((pHeader
->major
!= 1) || (pHeader
->minor
!= 0))
507 ret
= D3DRMERR_BADFILE
;
511 IDirectXFileData_Release(pData
);
514 hr
= IDirectXFileEnumObject_GetNextDataObject(pEnumObject
, &pData
);
517 ret
= D3DRMERR_NOTFOUND
;
521 hr
= IDirectXFileData_GetType(pData
, &pGuid
);
525 TRACE("Found object type whose GUID = %s\n", debugstr_guid(pGuid
));
527 if (!IsEqualGUID(pGuid
, &GUID_Mesh
))
529 ret
= D3DRMERR_NOTFOUND
;
533 hr
= IDirectXFileData_GetData(pData
, NULL
, &size
, (void**)&ptr
);
537 This
->nb_vertices
= *(DWORD
*)ptr
;
538 This
->nb_faces
= *(DWORD
*)(ptr
+ sizeof(DWORD
) + This
->nb_vertices
* sizeof(D3DVECTOR
));
539 This
->face_data_size
= size
- sizeof(DWORD
) - This
->nb_vertices
* sizeof(D3DVECTOR
) - sizeof(DWORD
);
541 TRACE("Mesh: nb_vertices = %d, nb_faces = %d, face_data_size = %d\n", This
->nb_vertices
, This
->nb_faces
, This
->face_data_size
);
543 This
->pVertices
= HeapAlloc(GetProcessHeap(), 0, This
->nb_vertices
* sizeof(D3DVECTOR
));
544 memcpy(This
->pVertices
, ptr
+ sizeof(DWORD
), This
->nb_vertices
* sizeof(D3DVECTOR
));
546 This
->pFaceData
= HeapAlloc(GetProcessHeap(), 0, This
->face_data_size
);
547 memcpy(This
->pFaceData
, ptr
+ sizeof(DWORD
) + This
->nb_vertices
* sizeof(D3DVECTOR
) + sizeof(DWORD
), This
->face_data_size
);
551 hr
= IDirectXFileData_GetNextObject(pData
, &pObject
);
552 if (hr
== DXFILEERR_NOMOREOBJECTS
)
554 FIXME("no more object\n");
560 hr
= IDirectXFileObject_QueryInterface(pObject
, &IID_IDirectXFileData
, (void**)&pData2
);
561 IDirectXFileObject_Release(pObject
);
565 hr
= IDirectXFileData_GetType(pData2
, &pGuid
);
568 IDirectXFileData_Release(pData2
);
572 FIXME("toto: Found object type whose GUID = %s\n", debugstr_guid(pGuid
));
574 if (!IsEqualGUID(pGuid
, &GUID_MeshNormals
))
578 hr
= IDirectXFileData_GetData(pData
, NULL
, &size
, (void**)&ptr
);
582 This
->nb_normals
= *(DWORD
*)ptr
;
583 tmp
= *(DWORD
*)(ptr
+ sizeof(DWORD
) + This
->nb_normals
* sizeof(D3DVECTOR
));
585 FIXME("MeshNormals: nb_normals = %d, nb_faces_normals = %d\n", This
->nb_normals
, tmp
);
587 This
->pNormals
= HeapAlloc(GetProcessHeap(), 0, This
->nb_normals
* sizeof(D3DVECTOR
));
588 memcpy(This
->pNormals
, ptr
+ sizeof(DWORD
), This
->nb_normals
* sizeof(D3DVECTOR
));
590 else if(!IsEqualGUID(pGuid
, &GUID_MeshTextureCoords
))
592 hr
= IDirectXFileData_GetData(pData
, NULL
, &size
, (void**)&ptr
);
596 This
->nb_coords2d
= *(DWORD
*)ptr
;
598 FIXME("MeshTextureCoords: nb_coords2d = %d\n", This
->nb_coords2d
);
600 This
->pCoords2d
= HeapAlloc(GetProcessHeap(), 0, This
->nb_coords2d
* sizeof(Coords2d
));
601 memcpy(This
->pCoords2d
, ptr
+ sizeof(DWORD
), This
->nb_coords2d
* sizeof(Coords2d
));
604 else if(!IsEqualGUID(pGuid
, &GUID_MeshMaterialList
))
606 FIXME("MeshMaterialList not supported yet, ignoring...\n");
610 FIXME("Unknown GUID %s, ignoring...\n", debugstr_guid(pGuid
));
613 IDirectXFileData_Release(pData2
);
620 IDirectXFileData_Release(pData
);
622 IDirectXFileEnumObject_Release(pEnumObject
);
624 IDirectXFile_Release(pDXFile
);
628 /* Clean mesh data */
629 This
->nb_vertices
= 0;
630 This
->nb_normals
= 0;
632 This
->face_data_size
= 0;
633 This
->nb_coords2d
= 0;
634 HeapFree(GetProcessHeap(), 0, This
->pVertices
);
635 This
->pVertices
= NULL
;
636 HeapFree(GetProcessHeap(), 0, This
->pNormals
);
637 This
->pNormals
= NULL
;
638 HeapFree(GetProcessHeap(), 0, This
->pFaceData
);
639 This
->pFaceData
= NULL
;
640 HeapFree(GetProcessHeap(), 0, This
->pCoords2d
);
641 This
->pCoords2d
= NULL
;
647 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_Save(IDirect3DRMMeshBuilder
* iface
, const char *filename
, D3DRMXOFFORMAT format
, D3DRMSAVEOPTIONS save
)
649 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
651 FIXME("(%p)->(%s,%d,%d): stub\n", This
, filename
, format
, save
);
656 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_Scale(IDirect3DRMMeshBuilder
* iface
, D3DVALUE sx
, D3DVALUE sy
, D3DVALUE sz
)
658 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
660 FIXME("(%p)->(%f,%f,%f): stub\n", This
, sx
, sy
, sz
);
665 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_Translate(IDirect3DRMMeshBuilder
* iface
, D3DVALUE tx
, D3DVALUE ty
, D3DVALUE tz
)
667 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
669 FIXME("(%p)->(%f,%f,%f): stub\n", This
, tx
, ty
, tz
);
674 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetColorSource(IDirect3DRMMeshBuilder
* iface
, D3DRMCOLORSOURCE color
)
676 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
678 FIXME("(%p)->(%x): stub\n", This
, color
);
683 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_GetBox(IDirect3DRMMeshBuilder
* iface
, D3DRMBOX
*pBox
)
685 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
687 FIXME("(%p)->(%p): stub\n", This
, pBox
);
692 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_GenerateNormals(IDirect3DRMMeshBuilder
* iface
)
694 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
696 FIXME("(%p)->(): stub\n", This
);
701 static D3DRMCOLORSOURCE WINAPI
IDirect3DRMMeshBuilderImpl_GetColorSource(IDirect3DRMMeshBuilder
* iface
)
703 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
705 FIXME("(%p)->(): stub\n", This
);
710 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_AddMesh(IDirect3DRMMeshBuilder
* iface
, LPDIRECT3DRMMESH pMesh
)
712 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
714 FIXME("(%p)->(%p): stub\n", This
, pMesh
);
719 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_AddMeshBuilder(IDirect3DRMMeshBuilder
* iface
, LPDIRECT3DRMMESHBUILDER pMeshBuilder
)
721 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
723 FIXME("(%p)->(%p): stub\n", This
, pMeshBuilder
);
728 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_AddFrame(IDirect3DRMMeshBuilder
* iface
, LPDIRECT3DRMFRAME pFrame
)
730 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
732 FIXME("(%p)->(%p): stub\n", This
, pFrame
);
737 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_AddFace(IDirect3DRMMeshBuilder
* iface
, LPDIRECT3DRMFACE pFace
)
739 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
741 FIXME("(%p)->(%p): stub\n", This
, pFace
);
746 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_AddFaces(IDirect3DRMMeshBuilder
* iface
, DWORD vcount
, D3DVECTOR
*vertices
, DWORD ncount
, D3DVECTOR
*normals
, DWORD
*data
, LPDIRECT3DRMFACEARRAY
* pFaceArray
)
748 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
750 FIXME("(%p)->(%d,%p,%d,%p,%p,%p): stub\n", This
, vcount
, vertices
, ncount
, normals
, data
, pFaceArray
);
755 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_ReserveSpace(IDirect3DRMMeshBuilder
* iface
, DWORD vertex_Count
, DWORD normal_count
, DWORD face_count
)
757 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
759 FIXME("(%p)->(%d,%d,%d): stub\n", This
, vertex_Count
, normal_count
, face_count
);
764 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetColorRGB(IDirect3DRMMeshBuilder
* iface
, D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
)
766 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
768 FIXME("(%p)->(%f,%f,%f): stub\n", This
, red
, green
, blue
);
773 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetColor(IDirect3DRMMeshBuilder
* iface
, D3DCOLOR color
)
775 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
777 FIXME("(%p)->(%x): stub\n", This
, color
);
782 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetTexture(IDirect3DRMMeshBuilder
* iface
, LPDIRECT3DRMTEXTURE pTexture
)
784 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
786 FIXME("(%p)->(%p): stub\n", This
, pTexture
);
791 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetMaterial(IDirect3DRMMeshBuilder
* iface
, LPDIRECT3DRMMATERIAL pMaterial
)
793 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
795 FIXME("(%p)->(%p): stub\n", This
, pMaterial
);
800 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetTextureTopology(IDirect3DRMMeshBuilder
* iface
, BOOL wrap_u
, BOOL wrap_v
)
802 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
804 FIXME("(%p)->(%d,%d): stub\n", This
, wrap_u
, wrap_v
);
809 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetQuality(IDirect3DRMMeshBuilder
* iface
, D3DRMRENDERQUALITY quality
)
811 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
813 FIXME("(%p)->(%d): stub\n", This
, quality
);
818 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetPerspective(IDirect3DRMMeshBuilder
* iface
, BOOL enable
)
820 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
822 FIXME("(%p)->(%d): stub\n", This
, enable
);
827 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetVertex(IDirect3DRMMeshBuilder
* iface
, DWORD index
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
)
829 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
831 FIXME("(%p)->(%f,%f,%f): stub\n", This
, x
, y
, z
);
836 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetNormal(IDirect3DRMMeshBuilder
* iface
, DWORD index
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
)
838 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
840 FIXME("(%p)->(%f,%f,%f): stub\n", This
, x
, y
, z
);
845 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetTextureCoordinates(IDirect3DRMMeshBuilder
* iface
, DWORD index
, D3DVALUE u
, D3DVALUE v
)
847 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
849 FIXME("(%p)->(%f,%f): stub\n", This
, u
, v
);
854 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetVertexColor(IDirect3DRMMeshBuilder
* iface
, DWORD index
, D3DCOLOR color
)
856 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
858 FIXME("(%p)->(%d,%x): stub\n", This
, index
, color
);
863 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_SetVertexColorRGB(IDirect3DRMMeshBuilder
* iface
, DWORD index
, D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
)
865 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
867 FIXME("(%p)->(%d,%f,%f,%f): stub\n", This
, index
, red
, green
, blue
);
872 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_GetFaces(IDirect3DRMMeshBuilder
* iface
, LPDIRECT3DRMFACEARRAY
* pFaceArray
)
874 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
876 FIXME("(%p)->(%p): stub\n", This
, pFaceArray
);
881 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_GetVertices(IDirect3DRMMeshBuilder
* iface
, DWORD
*vcount
, D3DVECTOR
*vertices
, DWORD
*ncount
, D3DVECTOR
*normals
, DWORD
*face_data_size
, DWORD
*face_data
)
883 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
885 TRACE("(%p)->(%p,%p,%p,%p,%p,%p)\n", This
, vcount
, vertices
, ncount
, normals
, face_data_size
, face_data
);
888 *vcount
= This
->nb_vertices
;
889 if (vertices
&& This
->nb_vertices
)
890 memcpy(vertices
, This
->pVertices
, This
->nb_vertices
* sizeof(D3DVECTOR
));
892 *ncount
= This
->nb_normals
;
893 if (normals
&& This
->nb_normals
)
894 memcpy(normals
, This
->pNormals
, This
->nb_normals
* sizeof(D3DVECTOR
));
896 *face_data_size
= This
->face_data_size
;
897 if (face_data
&& This
->face_data_size
)
898 memcpy(face_data
, This
->pFaceData
, This
->face_data_size
);
903 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_GetTextureCoordinates(IDirect3DRMMeshBuilder
* iface
, DWORD index
, D3DVALUE
*u
, D3DVALUE
*v
)
905 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
907 FIXME("(%p)->(%d,%p,%p): stub\n", This
, index
, u
, v
);
909 if (index
>= This
->nb_coords2d
)
910 return D3DRMERR_NOTFOUND
;
912 *u
= This
->pCoords2d
[index
].u
;
913 *v
= This
->pCoords2d
[index
].v
;
918 static int WINAPI
IDirect3DRMMeshBuilderImpl_AddVertex(IDirect3DRMMeshBuilder
* iface
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
)
920 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
922 FIXME("(%p)->(%f,%f,%f): stub\n", This
, x
, y
, z
);
927 static int WINAPI
IDirect3DRMMeshBuilderImpl_AddNormal(IDirect3DRMMeshBuilder
* iface
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
)
929 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
931 FIXME("(%p)->(%f,%f,%f): stub\n", This
, x
, y
, z
);
936 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_CreateFace(IDirect3DRMMeshBuilder
* iface
, LPDIRECT3DRMFACE
* ppFace
)
938 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
940 FIXME("(%p)->(%p): stub\n", This
, ppFace
);
945 static D3DRMRENDERQUALITY WINAPI
IDirect3DRMMeshBuilderImpl_GetQuality(IDirect3DRMMeshBuilder
* iface
)
947 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
949 FIXME("(%p)->(): stub\n", This
);
954 static BOOL WINAPI
IDirect3DRMMeshBuilderImpl_GetPerspective(IDirect3DRMMeshBuilder
* iface
)
956 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
958 FIXME("(%p)->(): stub\n", This
);
963 static int WINAPI
IDirect3DRMMeshBuilderImpl_GetFaceCount(IDirect3DRMMeshBuilder
* iface
)
965 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
967 TRACE("(%p)->()\n", This
);
969 return This
->nb_faces
;
972 static int WINAPI
IDirect3DRMMeshBuilderImpl_GetVertexCount(IDirect3DRMMeshBuilder
* iface
)
974 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
976 TRACE("(%p)->()\n", This
);
978 return This
->nb_vertices
;
981 static D3DCOLOR WINAPI
IDirect3DRMMeshBuilderImpl_GetVertexColor(IDirect3DRMMeshBuilder
* iface
, DWORD index
)
983 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
985 FIXME("(%p)->(%d): stub\n", This
, index
);
990 static HRESULT WINAPI
IDirect3DRMMeshBuilderImpl_CreateMesh(IDirect3DRMMeshBuilder
* iface
, LPDIRECT3DRMMESH
* ppMesh
)
992 IDirect3DRMMeshBuilderImpl
*This
= (IDirect3DRMMeshBuilderImpl
*)iface
;
994 FIXME("(%p)->(%p): stub\n", This
, ppMesh
);
999 static const struct IDirect3DRMMeshBuilderVtbl Direct3DRMMeshBuilder_Vtbl
=
1001 /*** IUnknown methods ***/
1002 IDirect3DRMMeshBuilderImpl_QueryInterface
,
1003 IDirect3DRMMeshBuilderImpl_AddRef
,
1004 IDirect3DRMMeshBuilderImpl_Release
,
1005 /*** IDirect3DRMObject methods ***/
1006 IDirect3DRMMeshBuilderImpl_Clone
,
1007 IDirect3DRMMeshBuilderImpl_AddDestroyCallback
,
1008 IDirect3DRMMeshBuilderImpl_DeleteDestroyCallback
,
1009 IDirect3DRMMeshBuilderImpl_SetAppData
,
1010 IDirect3DRMMeshBuilderImpl_GetAppData
,
1011 IDirect3DRMMeshBuilderImpl_SetName
,
1012 IDirect3DRMMeshBuilderImpl_GetName
,
1013 IDirect3DRMMeshBuilderImpl_GetClassName
,
1014 /*** IDirect3DRMMeshBuilder methods ***/
1015 IDirect3DRMMeshBuilderImpl_Load
,
1016 IDirect3DRMMeshBuilderImpl_Save
,
1017 IDirect3DRMMeshBuilderImpl_Scale
,
1018 IDirect3DRMMeshBuilderImpl_Translate
,
1019 IDirect3DRMMeshBuilderImpl_SetColorSource
,
1020 IDirect3DRMMeshBuilderImpl_GetBox
,
1021 IDirect3DRMMeshBuilderImpl_GenerateNormals
,
1022 IDirect3DRMMeshBuilderImpl_GetColorSource
,
1023 IDirect3DRMMeshBuilderImpl_AddMesh
,
1024 IDirect3DRMMeshBuilderImpl_AddMeshBuilder
,
1025 IDirect3DRMMeshBuilderImpl_AddFrame
,
1026 IDirect3DRMMeshBuilderImpl_AddFace
,
1027 IDirect3DRMMeshBuilderImpl_AddFaces
,
1028 IDirect3DRMMeshBuilderImpl_ReserveSpace
,
1029 IDirect3DRMMeshBuilderImpl_SetColorRGB
,
1030 IDirect3DRMMeshBuilderImpl_SetColor
,
1031 IDirect3DRMMeshBuilderImpl_SetTexture
,
1032 IDirect3DRMMeshBuilderImpl_SetMaterial
,
1033 IDirect3DRMMeshBuilderImpl_SetTextureTopology
,
1034 IDirect3DRMMeshBuilderImpl_SetQuality
,
1035 IDirect3DRMMeshBuilderImpl_SetPerspective
,
1036 IDirect3DRMMeshBuilderImpl_SetVertex
,
1037 IDirect3DRMMeshBuilderImpl_SetNormal
,
1038 IDirect3DRMMeshBuilderImpl_SetTextureCoordinates
,
1039 IDirect3DRMMeshBuilderImpl_SetVertexColor
,
1040 IDirect3DRMMeshBuilderImpl_SetVertexColorRGB
,
1041 IDirect3DRMMeshBuilderImpl_GetFaces
,
1042 IDirect3DRMMeshBuilderImpl_GetVertices
,
1043 IDirect3DRMMeshBuilderImpl_GetTextureCoordinates
,
1044 IDirect3DRMMeshBuilderImpl_AddVertex
,
1045 IDirect3DRMMeshBuilderImpl_AddNormal
,
1046 IDirect3DRMMeshBuilderImpl_CreateFace
,
1047 IDirect3DRMMeshBuilderImpl_GetQuality
,
1048 IDirect3DRMMeshBuilderImpl_GetPerspective
,
1049 IDirect3DRMMeshBuilderImpl_GetFaceCount
,
1050 IDirect3DRMMeshBuilderImpl_GetVertexCount
,
1051 IDirect3DRMMeshBuilderImpl_GetVertexColor
,
1052 IDirect3DRMMeshBuilderImpl_CreateMesh