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 IDirect3DRMMeshBuilder IDirect3DRMMeshBuilder_iface;
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 static inline IDirect3DRMMeshBuilderImpl *impl_from_IDirect3DRMMeshBuilder(IDirect3DRMMeshBuilder *iface)
287 return CONTAINING_RECORD(iface, IDirect3DRMMeshBuilderImpl, IDirect3DRMMeshBuilder_iface);
290 HRESULT Direct3DRMMeshBuilder_create(LPDIRECT3DRMMESHBUILDER* ppMeshBuilder)
292 IDirect3DRMMeshBuilderImpl* object;
294 TRACE("(%p)\n", ppMeshBuilder);
296 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMMeshBuilderImpl));
299 ERR("Out of memory\n");
300 return E_OUTOFMEMORY;
303 object->IDirect3DRMMeshBuilder_iface.lpVtbl = &Direct3DRMMeshBuilder_Vtbl;
306 *ppMeshBuilder = (IDirect3DRMMeshBuilder*)object;
311 /*** IUnknown methods ***/
312 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_QueryInterface(IDirect3DRMMeshBuilder* iface, REFIID riid, void** ppvObject)
314 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
316 TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppvObject);
318 if (IsEqualGUID(riid, &IID_IUnknown) ||
319 IsEqualGUID(riid, &IID_IDirect3DRMMeshBuilder))
321 IClassFactory_AddRef(iface);
326 ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
327 return E_NOINTERFACE;
330 static ULONG WINAPI IDirect3DRMMeshBuilderImpl_AddRef(IDirect3DRMMeshBuilder* iface)
332 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
334 TRACE("(%p)\n", This);
336 return InterlockedIncrement(&This->ref);
339 static ULONG WINAPI IDirect3DRMMeshBuilderImpl_Release(IDirect3DRMMeshBuilder* iface)
341 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
342 ULONG ref = InterlockedDecrement(&This->ref);
344 TRACE("(%p)\n", This);
348 HeapFree(GetProcessHeap(), 0, This->pVertices);
349 HeapFree(GetProcessHeap(), 0, This->pNormals);
350 HeapFree(GetProcessHeap(), 0, This->pFaceData);
351 HeapFree(GetProcessHeap(), 0, This);
357 /*** IDirect3DRMObject methods ***/
358 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_Clone(IDirect3DRMMeshBuilder* iface, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj)
360 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
362 FIXME("(%p)->(%p,%s,%p): stub\n", This, pUnkOuter, debugstr_guid(riid), ppvObj);
367 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_AddDestroyCallback(IDirect3DRMMeshBuilder* iface, D3DRMOBJECTCALLBACK cb, LPVOID argument)
369 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
371 FIXME("(%p)->(%p,%p): stub\n", This, cb, argument);
376 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_DeleteDestroyCallback(IDirect3DRMMeshBuilder* iface, D3DRMOBJECTCALLBACK cb, LPVOID argument)
378 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
380 FIXME("(%p)->(%p,%p): stub\n", This, cb, argument);
385 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_SetAppData(IDirect3DRMMeshBuilder* iface, DWORD data)
387 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
389 FIXME("(%p)->(%u): stub\n", This, data);
394 static DWORD WINAPI IDirect3DRMMeshBuilderImpl_GetAppData(IDirect3DRMMeshBuilder* iface)
396 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
398 FIXME("(%p)->(): stub\n", This);
403 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_SetName(IDirect3DRMMeshBuilder* iface, LPCSTR pName)
405 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
407 FIXME("(%p)->(%s): stub\n", This, pName);
412 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_GetName(IDirect3DRMMeshBuilder* iface, LPDWORD lpdwSize, LPSTR lpName)
414 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
416 FIXME("(%p)->(%p,%p): stub\n", This, lpdwSize, lpName);
421 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_GetClassName(IDirect3DRMMeshBuilder* iface, LPDWORD lpdwSize, LPSTR lpName)
423 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
425 FIXME("(%p)->(%p,%p): stub\n", This, lpdwSize, lpName);
430 /*** IDirect3DRMMeshBuilder methods ***/
431 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_Load(IDirect3DRMMeshBuilder* iface, LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK cb, LPVOID pArg)
433 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
434 DXFILELOADOPTIONS load_options;
435 LPDIRECTXFILE pDXFile = NULL;
436 LPDIRECTXFILEENUMOBJECT pEnumObject = NULL;
437 LPDIRECTXFILEDATA pData = NULL;
438 LPDIRECTXFILEOBJECT pObject = NULL;
439 LPDIRECTXFILEDATA pData2 = NULL;
445 HRESULT ret = D3DRMERR_BADOBJECT;
447 FIXME("(%p)->(%p,%p,%x,%p,%p): partial stub\n", This, filename, name, loadflags, cb, pArg);
449 /* First free allocated buffers of previous mesh data */
450 HeapFree(GetProcessHeap(), 0, This->pVertices);
451 This->pVertices = NULL;
452 HeapFree(GetProcessHeap(), 0, This->pNormals);
453 This->pNormals = NULL;
454 HeapFree(GetProcessHeap(), 0, This->pFaceData);
455 This->pFaceData = NULL;
456 HeapFree(GetProcessHeap(), 0, This->pCoords2d);
457 This->pCoords2d = NULL;
459 if (loadflags == D3DRMLOAD_FROMMEMORY)
461 load_options = DXFILELOAD_FROMMEMORY;
465 FIXME("Load options %d not supported yet\n", loadflags);
469 hr = DirectXFileCreate(&pDXFile);
473 hr = IDirectXFile_RegisterTemplates(pDXFile, templates, strlen(templates));
477 hr = IDirectXFile_CreateEnumObject(pDXFile, filename, load_options, &pEnumObject);
481 hr = IDirectXFileEnumObject_GetNextDataObject(pEnumObject, &pData);
485 hr = IDirectXFileData_GetType(pData, &pGuid);
489 TRACE("Found object type whose GUID = %s\n", debugstr_guid(pGuid));
491 if (!IsEqualGUID(pGuid, &TID_DXFILEHeader))
493 ret = D3DRMERR_BADFILE;
497 hr = IDirectXFileData_GetData(pData, NULL, &size, (void**)&pHeader);
498 if ((hr != DXFILE_OK) || (size != sizeof(Header)))
501 TRACE("Version is %d %d %d\n", pHeader->major, pHeader->minor, pHeader->flags);
503 /* Version must be 1.0.x */
504 if ((pHeader->major != 1) || (pHeader->minor != 0))
506 ret = D3DRMERR_BADFILE;
510 IDirectXFileData_Release(pData);
513 hr = IDirectXFileEnumObject_GetNextDataObject(pEnumObject, &pData);
516 ret = D3DRMERR_NOTFOUND;
520 hr = IDirectXFileData_GetType(pData, &pGuid);
524 TRACE("Found object type whose GUID = %s\n", debugstr_guid(pGuid));
526 if (!IsEqualGUID(pGuid, &TID_D3DRMMesh))
528 ret = D3DRMERR_NOTFOUND;
532 hr = IDirectXFileData_GetData(pData, NULL, &size, (void**)&ptr);
536 This->nb_vertices = *(DWORD*)ptr;
537 This->nb_faces = *(DWORD*)(ptr + sizeof(DWORD) + This->nb_vertices * sizeof(D3DVECTOR));
538 This->face_data_size = size - sizeof(DWORD) - This->nb_vertices * sizeof(D3DVECTOR) - sizeof(DWORD);
540 TRACE("Mesh: nb_vertices = %d, nb_faces = %d, face_data_size = %d\n", This->nb_vertices, This->nb_faces, This->face_data_size);
542 This->pVertices = HeapAlloc(GetProcessHeap(), 0, This->nb_vertices * sizeof(D3DVECTOR));
543 memcpy(This->pVertices, ptr + sizeof(DWORD), This->nb_vertices * sizeof(D3DVECTOR));
545 This->pFaceData = HeapAlloc(GetProcessHeap(), 0, This->face_data_size);
546 memcpy(This->pFaceData, ptr + sizeof(DWORD) + This->nb_vertices * sizeof(D3DVECTOR) + sizeof(DWORD), This->face_data_size);
550 hr = IDirectXFileData_GetNextObject(pData, &pObject);
551 if (hr == DXFILEERR_NOMOREOBJECTS)
553 FIXME("no more object\n");
559 hr = IDirectXFileObject_QueryInterface(pObject, &IID_IDirectXFileData, (void**)&pData2);
560 IDirectXFileObject_Release(pObject);
564 hr = IDirectXFileData_GetType(pData2, &pGuid);
567 IDirectXFileData_Release(pData2);
571 FIXME("Found object type whose GUID = %s\n", debugstr_guid(pGuid));
573 if (!IsEqualGUID(pGuid, &TID_D3DRMMeshNormals))
577 hr = IDirectXFileData_GetData(pData, NULL, &size, (void**)&ptr);
581 This->nb_normals = *(DWORD*)ptr;
582 tmp = *(DWORD*)(ptr + sizeof(DWORD) + This->nb_normals * sizeof(D3DVECTOR));
584 FIXME("MeshNormals: nb_normals = %d, nb_faces_normals = %d\n", This->nb_normals, tmp);
586 This->pNormals = HeapAlloc(GetProcessHeap(), 0, This->nb_normals * sizeof(D3DVECTOR));
587 memcpy(This->pNormals, ptr + sizeof(DWORD), This->nb_normals * sizeof(D3DVECTOR));
589 else if(!IsEqualGUID(pGuid, &TID_D3DRMMeshTextureCoords))
591 hr = IDirectXFileData_GetData(pData, NULL, &size, (void**)&ptr);
595 This->nb_coords2d = *(DWORD*)ptr;
597 FIXME("MeshTextureCoords: nb_coords2d = %d\n", This->nb_coords2d);
599 This->pCoords2d = HeapAlloc(GetProcessHeap(), 0, This->nb_coords2d * sizeof(Coords2d));
600 memcpy(This->pCoords2d, ptr + sizeof(DWORD), This->nb_coords2d * sizeof(Coords2d));
603 else if(!IsEqualGUID(pGuid, &TID_D3DRMMeshMaterialList))
605 FIXME("MeshMaterialList not supported yet, ignoring...\n");
609 FIXME("Unknown GUID %s, ignoring...\n", debugstr_guid(pGuid));
612 IDirectXFileData_Release(pData2);
619 IDirectXFileData_Release(pData);
621 IDirectXFileEnumObject_Release(pEnumObject);
623 IDirectXFile_Release(pDXFile);
627 /* Clean mesh data */
628 This->nb_vertices = 0;
629 This->nb_normals = 0;
631 This->face_data_size = 0;
632 This->nb_coords2d = 0;
633 HeapFree(GetProcessHeap(), 0, This->pVertices);
634 This->pVertices = NULL;
635 HeapFree(GetProcessHeap(), 0, This->pNormals);
636 This->pNormals = NULL;
637 HeapFree(GetProcessHeap(), 0, This->pFaceData);
638 This->pFaceData = NULL;
639 HeapFree(GetProcessHeap(), 0, This->pCoords2d);
640 This->pCoords2d = NULL;
646 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_Save(IDirect3DRMMeshBuilder* iface, const char *filename, D3DRMXOFFORMAT format, D3DRMSAVEOPTIONS save)
648 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
650 FIXME("(%p)->(%s,%d,%d): stub\n", This, filename, format, save);
655 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_Scale(IDirect3DRMMeshBuilder* iface, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
657 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
659 FIXME("(%p)->(%f,%f,%f): stub\n", This, sx, sy, sz);
664 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_Translate(IDirect3DRMMeshBuilder* iface, D3DVALUE tx, D3DVALUE ty, D3DVALUE tz)
666 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
668 FIXME("(%p)->(%f,%f,%f): stub\n", This, tx, ty, tz);
673 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_SetColorSource(IDirect3DRMMeshBuilder* iface, D3DRMCOLORSOURCE color)
675 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
677 FIXME("(%p)->(%x): stub\n", This, color);
682 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_GetBox(IDirect3DRMMeshBuilder* iface, D3DRMBOX *pBox)
684 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
686 FIXME("(%p)->(%p): stub\n", This, pBox);
691 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_GenerateNormals(IDirect3DRMMeshBuilder* iface)
693 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
695 FIXME("(%p)->(): stub\n", This);
700 static D3DRMCOLORSOURCE WINAPI IDirect3DRMMeshBuilderImpl_GetColorSource(IDirect3DRMMeshBuilder* iface)
702 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
704 FIXME("(%p)->(): stub\n", This);
709 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_AddMesh(IDirect3DRMMeshBuilder* iface, LPDIRECT3DRMMESH pMesh)
711 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
713 FIXME("(%p)->(%p): stub\n", This, pMesh);
718 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_AddMeshBuilder(IDirect3DRMMeshBuilder* iface, LPDIRECT3DRMMESHBUILDER pMeshBuilder)
720 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
722 FIXME("(%p)->(%p): stub\n", This, pMeshBuilder);
727 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_AddFrame(IDirect3DRMMeshBuilder* iface, LPDIRECT3DRMFRAME pFrame)
729 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
731 FIXME("(%p)->(%p): stub\n", This, pFrame);
736 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_AddFace(IDirect3DRMMeshBuilder* iface, LPDIRECT3DRMFACE pFace)
738 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
740 FIXME("(%p)->(%p): stub\n", This, pFace);
745 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_AddFaces(IDirect3DRMMeshBuilder* iface, DWORD vcount, D3DVECTOR *vertices, DWORD ncount, D3DVECTOR *normals, DWORD *data, LPDIRECT3DRMFACEARRAY* pFaceArray)
747 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
749 FIXME("(%p)->(%d,%p,%d,%p,%p,%p): stub\n", This, vcount, vertices, ncount, normals, data, pFaceArray);
754 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_ReserveSpace(IDirect3DRMMeshBuilder* iface, DWORD vertex_Count, DWORD normal_count, DWORD face_count)
756 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
758 FIXME("(%p)->(%d,%d,%d): stub\n", This, vertex_Count, normal_count, face_count);
763 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_SetColorRGB(IDirect3DRMMeshBuilder* iface, D3DVALUE red, D3DVALUE green, D3DVALUE blue)
765 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
767 FIXME("(%p)->(%f,%f,%f): stub\n", This, red, green, blue);
772 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_SetColor(IDirect3DRMMeshBuilder* iface, D3DCOLOR color)
774 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
776 FIXME("(%p)->(%x): stub\n", This, color);
781 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_SetTexture(IDirect3DRMMeshBuilder* iface, LPDIRECT3DRMTEXTURE pTexture)
783 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
785 FIXME("(%p)->(%p): stub\n", This, pTexture);
790 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_SetMaterial(IDirect3DRMMeshBuilder* iface, LPDIRECT3DRMMATERIAL pMaterial)
792 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
794 FIXME("(%p)->(%p): stub\n", This, pMaterial);
799 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_SetTextureTopology(IDirect3DRMMeshBuilder* iface, BOOL wrap_u, BOOL wrap_v)
801 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
803 FIXME("(%p)->(%d,%d): stub\n", This, wrap_u, wrap_v);
808 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_SetQuality(IDirect3DRMMeshBuilder* iface, D3DRMRENDERQUALITY quality)
810 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
812 FIXME("(%p)->(%d): stub\n", This, quality);
817 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_SetPerspective(IDirect3DRMMeshBuilder* iface, BOOL enable)
819 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
821 FIXME("(%p)->(%d): stub\n", This, enable);
826 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_SetVertex(IDirect3DRMMeshBuilder* iface, DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z)
828 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
830 FIXME("(%p)->(%f,%f,%f): stub\n", This, x, y, z);
835 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_SetNormal(IDirect3DRMMeshBuilder* iface, DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z)
837 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
839 FIXME("(%p)->(%f,%f,%f): stub\n", This, x, y, z);
844 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_SetTextureCoordinates(IDirect3DRMMeshBuilder* iface, DWORD index, D3DVALUE u, D3DVALUE v)
846 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
848 FIXME("(%p)->(%f,%f): stub\n", This, u, v);
853 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_SetVertexColor(IDirect3DRMMeshBuilder* iface, DWORD index, D3DCOLOR color)
855 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
857 FIXME("(%p)->(%d,%x): stub\n", This, index, color);
862 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_SetVertexColorRGB(IDirect3DRMMeshBuilder* iface, DWORD index, D3DVALUE red, D3DVALUE green, D3DVALUE blue)
864 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
866 FIXME("(%p)->(%d,%f,%f,%f): stub\n", This, index, red, green, blue);
871 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_GetFaces(IDirect3DRMMeshBuilder* iface, LPDIRECT3DRMFACEARRAY* pFaceArray)
873 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
875 FIXME("(%p)->(%p): stub\n", This, pFaceArray);
880 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_GetVertices(IDirect3DRMMeshBuilder* iface, DWORD *vcount, D3DVECTOR *vertices, DWORD *ncount, D3DVECTOR *normals, DWORD *face_data_size, DWORD *face_data)
882 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
884 TRACE("(%p)->(%p,%p,%p,%p,%p,%p)\n", This, vcount, vertices, ncount, normals, face_data_size, face_data);
887 *vcount = This->nb_vertices;
888 if (vertices && This->nb_vertices)
889 memcpy(vertices, This->pVertices, This->nb_vertices * sizeof(D3DVECTOR));
891 *ncount = This->nb_normals;
892 if (normals && This->nb_normals)
893 memcpy(normals, This->pNormals, This->nb_normals * sizeof(D3DVECTOR));
895 *face_data_size = This->face_data_size;
896 if (face_data && This->face_data_size)
897 memcpy(face_data, This->pFaceData, This->face_data_size);
902 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_GetTextureCoordinates(IDirect3DRMMeshBuilder* iface, DWORD index, D3DVALUE *u, D3DVALUE *v)
904 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
906 FIXME("(%p)->(%d,%p,%p): stub\n", This, index, u, v);
908 if (index >= This->nb_coords2d)
909 return D3DRMERR_NOTFOUND;
911 *u = This->pCoords2d[index].u;
912 *v = This->pCoords2d[index].v;
917 static int WINAPI IDirect3DRMMeshBuilderImpl_AddVertex(IDirect3DRMMeshBuilder* iface, D3DVALUE x, D3DVALUE y, D3DVALUE z)
919 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
921 FIXME("(%p)->(%f,%f,%f): stub\n", This, x, y, z);
926 static int WINAPI IDirect3DRMMeshBuilderImpl_AddNormal(IDirect3DRMMeshBuilder* iface, D3DVALUE x, D3DVALUE y, D3DVALUE z)
928 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
930 FIXME("(%p)->(%f,%f,%f): stub\n", This, x, y, z);
935 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_CreateFace(IDirect3DRMMeshBuilder* iface, LPDIRECT3DRMFACE* ppFace)
937 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
939 FIXME("(%p)->(%p): stub\n", This, ppFace);
944 static D3DRMRENDERQUALITY WINAPI IDirect3DRMMeshBuilderImpl_GetQuality(IDirect3DRMMeshBuilder* iface)
946 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
948 FIXME("(%p)->(): stub\n", This);
953 static BOOL WINAPI IDirect3DRMMeshBuilderImpl_GetPerspective(IDirect3DRMMeshBuilder* iface)
955 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
957 FIXME("(%p)->(): stub\n", This);
962 static int WINAPI IDirect3DRMMeshBuilderImpl_GetFaceCount(IDirect3DRMMeshBuilder* iface)
964 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
966 TRACE("(%p)->()\n", This);
968 return This->nb_faces;
971 static int WINAPI IDirect3DRMMeshBuilderImpl_GetVertexCount(IDirect3DRMMeshBuilder* iface)
973 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
975 TRACE("(%p)->()\n", This);
977 return This->nb_vertices;
980 static D3DCOLOR WINAPI IDirect3DRMMeshBuilderImpl_GetVertexColor(IDirect3DRMMeshBuilder* iface, DWORD index)
982 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
984 FIXME("(%p)->(%d): stub\n", This, index);
989 static HRESULT WINAPI IDirect3DRMMeshBuilderImpl_CreateMesh(IDirect3DRMMeshBuilder* iface, LPDIRECT3DRMMESH* ppMesh)
991 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder(iface);
993 FIXME("(%p)->(%p): stub\n", This, ppMesh);
998 static const struct IDirect3DRMMeshBuilderVtbl Direct3DRMMeshBuilder_Vtbl =
1000 /*** IUnknown methods ***/
1001 IDirect3DRMMeshBuilderImpl_QueryInterface,
1002 IDirect3DRMMeshBuilderImpl_AddRef,
1003 IDirect3DRMMeshBuilderImpl_Release,
1004 /*** IDirect3DRMObject methods ***/
1005 IDirect3DRMMeshBuilderImpl_Clone,
1006 IDirect3DRMMeshBuilderImpl_AddDestroyCallback,
1007 IDirect3DRMMeshBuilderImpl_DeleteDestroyCallback,
1008 IDirect3DRMMeshBuilderImpl_SetAppData,
1009 IDirect3DRMMeshBuilderImpl_GetAppData,
1010 IDirect3DRMMeshBuilderImpl_SetName,
1011 IDirect3DRMMeshBuilderImpl_GetName,
1012 IDirect3DRMMeshBuilderImpl_GetClassName,
1013 /*** IDirect3DRMMeshBuilder methods ***/
1014 IDirect3DRMMeshBuilderImpl_Load,
1015 IDirect3DRMMeshBuilderImpl_Save,
1016 IDirect3DRMMeshBuilderImpl_Scale,
1017 IDirect3DRMMeshBuilderImpl_Translate,
1018 IDirect3DRMMeshBuilderImpl_SetColorSource,
1019 IDirect3DRMMeshBuilderImpl_GetBox,
1020 IDirect3DRMMeshBuilderImpl_GenerateNormals,
1021 IDirect3DRMMeshBuilderImpl_GetColorSource,
1022 IDirect3DRMMeshBuilderImpl_AddMesh,
1023 IDirect3DRMMeshBuilderImpl_AddMeshBuilder,
1024 IDirect3DRMMeshBuilderImpl_AddFrame,
1025 IDirect3DRMMeshBuilderImpl_AddFace,
1026 IDirect3DRMMeshBuilderImpl_AddFaces,
1027 IDirect3DRMMeshBuilderImpl_ReserveSpace,
1028 IDirect3DRMMeshBuilderImpl_SetColorRGB,
1029 IDirect3DRMMeshBuilderImpl_SetColor,
1030 IDirect3DRMMeshBuilderImpl_SetTexture,
1031 IDirect3DRMMeshBuilderImpl_SetMaterial,
1032 IDirect3DRMMeshBuilderImpl_SetTextureTopology,
1033 IDirect3DRMMeshBuilderImpl_SetQuality,
1034 IDirect3DRMMeshBuilderImpl_SetPerspective,
1035 IDirect3DRMMeshBuilderImpl_SetVertex,
1036 IDirect3DRMMeshBuilderImpl_SetNormal,
1037 IDirect3DRMMeshBuilderImpl_SetTextureCoordinates,
1038 IDirect3DRMMeshBuilderImpl_SetVertexColor,
1039 IDirect3DRMMeshBuilderImpl_SetVertexColorRGB,
1040 IDirect3DRMMeshBuilderImpl_GetFaces,
1041 IDirect3DRMMeshBuilderImpl_GetVertices,
1042 IDirect3DRMMeshBuilderImpl_GetTextureCoordinates,
1043 IDirect3DRMMeshBuilderImpl_AddVertex,
1044 IDirect3DRMMeshBuilderImpl_AddNormal,
1045 IDirect3DRMMeshBuilderImpl_CreateFace,
1046 IDirect3DRMMeshBuilderImpl_GetQuality,
1047 IDirect3DRMMeshBuilderImpl_GetPerspective,
1048 IDirect3DRMMeshBuilderImpl_GetFaceCount,
1049 IDirect3DRMMeshBuilderImpl_GetVertexCount,
1050 IDirect3DRMMeshBuilderImpl_GetVertexColor,
1051 IDirect3DRMMeshBuilderImpl_CreateMesh