msxml3/tests: Correct variant type.
[wine/multimedia.git] / dlls / d3drm / meshbuilder.c
blob557a0286771266643900656ff1dff6276f8ed683
1 /*
2 * Implementation of IDirect3DRMMeshBuilder2 Interface
4 * Copyright 2010, 2012 Christian Costa
5 * Copyright 2011 André Hentschel
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "wine/debug.h"
24 #define COBJMACROS
26 #include "winbase.h"
27 #include "wingdi.h"
28 #include "dxfile.h"
29 #include "rmxfguid.h"
31 #include "d3drm_private.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
35 static HRESULT Direct3DRMMesh_create(IDirect3DRMMesh** obj);
37 typedef struct {
38 IDirect3DRMMesh IDirect3DRMMesh_iface;
39 LONG ref;
40 } IDirect3DRMMeshImpl;
42 typedef struct {
43 D3DVALUE u;
44 D3DVALUE v;
45 } Coords2d;
47 typedef struct {
48 IDirect3DRMMeshBuilder2 IDirect3DRMMeshBuilder2_iface;
49 IDirect3DRMMeshBuilder3 IDirect3DRMMeshBuilder3_iface;
50 LONG ref;
51 DWORD nb_vertices;
52 D3DVECTOR* pVertices;
53 DWORD nb_normals;
54 D3DVECTOR* pNormals;
55 DWORD nb_faces;
56 DWORD face_data_size;
57 LPVOID pFaceData;
58 DWORD nb_coords2d;
59 Coords2d* pCoords2d;
60 } IDirect3DRMMeshBuilderImpl;
62 char templates[] = {
63 "xof 0302txt 0064"
64 "template Header"
65 "{"
66 "<3D82AB43-62DA-11CF-AB39-0020AF71E433>"
67 "WORD major;"
68 "WORD minor;"
69 "DWORD flags;"
70 "}"
71 "template Vector"
72 "{"
73 "<3D82AB5E-62DA-11CF-AB39-0020AF71E433>"
74 "FLOAT x;"
75 "FLOAT y;"
76 "FLOAT z;"
77 "}"
78 "template Coords2d"
79 "{"
80 "<F6F23F44-7686-11CF-8F52-0040333594A3>"
81 "FLOAT u;"
82 "FLOAT v;"
83 "}"
84 "template Matrix4x4"
85 "{"
86 "<F6F23F45-7686-11CF-8F52-0040333594A3>"
87 "array FLOAT matrix[16];"
88 "}"
89 "template ColorRGBA"
90 "{"
91 "<35FF44E0-6C7C-11CF-8F52-0040333594A3>"
92 "FLOAT red;"
93 "FLOAT green;"
94 "FLOAT blue;"
95 "FLOAT alpha;"
96 "}"
97 "template ColorRGB"
98 "{"
99 "<D3E16E81-7835-11CF-8F52-0040333594A3>"
100 "FLOAT red;"
101 "FLOAT green;"
102 "FLOAT blue;"
104 "template IndexedColor"
106 "<1630B820-7842-11CF-8F52-0040333594A3>"
107 "DWORD index;"
108 "ColorRGBA indexColor;"
110 "template Boolean"
112 "<537DA6A0-CA37-11D0-941C-0080C80CFA7B>"
113 "DWORD truefalse;"
115 "template Boolean2d"
117 "<4885AE63-78E8-11CF-8F52-0040333594A3>"
118 "Boolean u;"
119 "Boolean v;"
121 "template MaterialWrap"
123 "<4885AE60-78E8-11CF-8F52-0040333594A3>"
124 "Boolean u;"
125 "Boolean v;"
127 "template TextureFilename"
129 "<A42790E1-7810-11CF-8F52-0040333594A3>"
130 "STRING filename;"
132 "template Material"
134 "<3D82AB4D-62DA-11CF-AB39-0020AF71E433>"
135 "ColorRGBA faceColor;"
136 "FLOAT power;"
137 "ColorRGB specularColor;"
138 "ColorRGB emissiveColor;"
139 "[...]"
141 "template MeshFace"
143 "<3D82AB5F-62DA-11CF-AB39-0020AF71E433>"
144 "DWORD nFaceVertexIndices;"
145 "array DWORD faceVertexIndices[nFaceVertexIndices];"
147 "template MeshFaceWraps"
149 "<ED1EC5C0-C0A8-11D0-941C-0080C80CFA7B>"
150 "DWORD nFaceWrapValues;"
151 "array Boolean2d faceWrapValues[nFaceWrapValues];"
153 "template MeshTextureCoords"
155 "<F6F23F40-7686-11CF-8F52-0040333594A3>"
156 "DWORD nTextureCoords;"
157 "array Coords2d textureCoords[nTextureCoords];"
159 "template MeshMaterialList"
161 "<F6F23F42-7686-11CF-8F52-0040333594A3>"
162 "DWORD nMaterials;"
163 "DWORD nFaceIndexes;"
164 "array DWORD faceIndexes[nFaceIndexes];"
165 "[Material]"
167 "template MeshNormals"
169 "<F6F23F43-7686-11CF-8F52-0040333594A3>"
170 "DWORD nNormals;"
171 "array Vector normals[nNormals];"
172 "DWORD nFaceNormals;"
173 "array MeshFace faceNormals[nFaceNormals];"
175 "template MeshVertexColors"
177 "<1630B821-7842-11CF-8F52-0040333594A3>"
178 "DWORD nVertexColors;"
179 "array IndexedColor vertexColors[nVertexColors];"
181 "template Mesh"
183 "<3D82AB44-62DA-11CF-AB39-0020AF71E433>"
184 "DWORD nVertices;"
185 "array Vector vertices[nVertices];"
186 "DWORD nFaces;"
187 "array MeshFace faces[nFaces];"
188 "[...]"
190 "template FrameTransformMatrix"
192 "<F6F23F41-7686-11CF-8F52-0040333594A3>"
193 "Matrix4x4 frameMatrix;"
195 "template Frame"
197 "<3D82AB46-62DA-11CF-AB39-0020AF71E433>"
198 "[...]"
200 "template FloatKeys"
202 "<10DD46A9-775B-11CF-8F52-0040333594A3>"
203 "DWORD nValues;"
204 "array FLOAT values[nValues];"
206 "template TimedFloatKeys"
208 "<F406B180-7B3B-11CF-8F52-0040333594A3>"
209 "DWORD time;"
210 "FloatKeys tfkeys;"
212 "template AnimationKey"
214 "<10DD46A8-775B-11CF-8F52-0040333594A3>"
215 "DWORD keyType;"
216 "DWORD nKeys;"
217 "array TimedFloatKeys keys[nKeys];"
219 "template AnimationOptions"
221 "<E2BF56C0-840F-11CF-8F52-0040333594A3>"
222 "DWORD openclosed;"
223 "DWORD positionquality;"
225 "template Animation"
227 "<3D82AB4F-62DA-11CF-AB39-0020AF71E433>"
228 "[...]"
230 "template AnimationSet"
232 "<3D82AB50-62DA-11CF-AB39-0020AF71E433>"
233 "[Animation]"
235 "template InlineData"
237 "<3A23EEA0-94B1-11D0-AB39-0020AF71E433>"
238 "[BINARY]"
240 "template Url"
242 "<3A23EEA1-94B1-11D0-AB39-0020AF71E433>"
243 "DWORD nUrls;"
244 "array STRING urls[nUrls];"
246 "template ProgressiveMesh"
248 "<8A63C360-997D-11D0-941C-0080C80CFA7B>"
249 "[Url,InlineData]"
251 "template Guid"
253 "<A42790E0-7810-11CF-8F52-0040333594A3>"
254 "DWORD data1;"
255 "WORD data2;"
256 "WORD data3;"
257 "array UCHAR data4[8];"
259 "template StringProperty"
261 "<7F0F21E0-BFE1-11D1-82C0-00A0C9697271>"
262 "STRING key;"
263 "STRING value;"
265 "template PropertyBag"
267 "<7F0F21E1-BFE1-11D1-82C0-00A0C9697271>"
268 "[StringProperty]"
270 "template ExternalVisual"
272 "<98116AA0-BDBA-11D1-82C0-00A0C9697271>"
273 "Guid guidExternalVisual;"
274 "[...]"
276 "template RightHanded"
278 "<7F5D5EA0-D53A-11D1-82C0-00A0C9697271>"
279 "DWORD bRightHanded;"
283 static inline IDirect3DRMMeshImpl *impl_from_IDirect3DRMMesh(IDirect3DRMMesh *iface)
285 return CONTAINING_RECORD(iface, IDirect3DRMMeshImpl, IDirect3DRMMesh_iface);
288 static inline IDirect3DRMMeshBuilderImpl *impl_from_IDirect3DRMMeshBuilder2(IDirect3DRMMeshBuilder2 *iface)
290 return CONTAINING_RECORD(iface, IDirect3DRMMeshBuilderImpl, IDirect3DRMMeshBuilder2_iface);
293 static inline IDirect3DRMMeshBuilderImpl *impl_from_IDirect3DRMMeshBuilder3(IDirect3DRMMeshBuilder3 *iface)
295 return CONTAINING_RECORD(iface, IDirect3DRMMeshBuilderImpl, IDirect3DRMMeshBuilder3_iface);
298 /*** IUnknown methods ***/
299 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_QueryInterface(IDirect3DRMMeshBuilder2* iface,
300 REFIID riid, void** ppvObject)
302 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
304 TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppvObject);
306 *ppvObject = NULL;
308 if(IsEqualGUID(riid, &IID_IUnknown) ||
309 IsEqualGUID(riid, &IID_IDirect3DRMMeshBuilder) ||
310 IsEqualGUID(riid, &IID_IDirect3DRMMeshBuilder2))
312 *ppvObject = &This->IDirect3DRMMeshBuilder2_iface;
314 else if(IsEqualGUID(riid, &IID_IDirect3DRMMeshBuilder3))
316 *ppvObject = &This->IDirect3DRMMeshBuilder3_iface;
318 else
320 FIXME("interface %s not implemented\n", debugstr_guid(riid));
321 return E_NOINTERFACE;
324 IDirect3DRMMeshBuilder_AddRef(iface);
325 return S_OK;
328 static ULONG WINAPI IDirect3DRMMeshBuilder2Impl_AddRef(IDirect3DRMMeshBuilder2* iface)
330 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
331 ULONG ref = InterlockedIncrement(&This->ref);
333 TRACE("(%p)->(): new ref = %d\n", This, ref);
335 return ref;
338 static ULONG WINAPI IDirect3DRMMeshBuilder2Impl_Release(IDirect3DRMMeshBuilder2* iface)
340 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
341 ULONG ref = InterlockedDecrement(&This->ref);
343 TRACE("(%p)->(): new ref = %d\n", This, ref);
345 if (!ref)
347 HeapFree(GetProcessHeap(), 0, This->pVertices);
348 HeapFree(GetProcessHeap(), 0, This->pNormals);
349 HeapFree(GetProcessHeap(), 0, This->pFaceData);
350 HeapFree(GetProcessHeap(), 0, This->pCoords2d);
351 HeapFree(GetProcessHeap(), 0, This);
354 return ref;
357 /*** IDirect3DRMObject methods ***/
358 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_Clone(IDirect3DRMMeshBuilder2* iface,
359 LPUNKNOWN pUnkOuter, REFIID riid,
360 LPVOID *ppvObj)
362 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
364 FIXME("(%p)->(%p,%s,%p): stub\n", This, pUnkOuter, debugstr_guid(riid), ppvObj);
366 return E_NOTIMPL;
369 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_AddDestroyCallback(IDirect3DRMMeshBuilder2* iface,
370 D3DRMOBJECTCALLBACK cb,
371 LPVOID argument)
373 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
375 FIXME("(%p)->(%p,%p): stub\n", This, cb, argument);
377 return E_NOTIMPL;
380 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_DeleteDestroyCallback(IDirect3DRMMeshBuilder2* iface,
381 D3DRMOBJECTCALLBACK cb,
382 LPVOID argument)
384 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
386 FIXME("(%p)->(%p,%p): stub\n", This, cb, argument);
388 return E_NOTIMPL;
391 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetAppData(IDirect3DRMMeshBuilder2* iface,
392 DWORD data)
394 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
396 FIXME("(%p)->(%u): stub\n", This, data);
398 return E_NOTIMPL;
401 static DWORD WINAPI IDirect3DRMMeshBuilder2Impl_GetAppData(IDirect3DRMMeshBuilder2* iface)
403 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
405 FIXME("(%p)->(): stub\n", This);
407 return 0;
410 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetName(IDirect3DRMMeshBuilder2* iface,
411 LPCSTR pName)
413 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
415 FIXME("(%p)->(%s): stub\n", This, pName);
417 return E_NOTIMPL;
420 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetName(IDirect3DRMMeshBuilder2* iface,
421 LPDWORD lpdwSize, LPSTR lpName)
423 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
425 FIXME("(%p)->(%p,%p): stub\n", This, lpdwSize, lpName);
427 return E_NOTIMPL;
430 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetClassName(IDirect3DRMMeshBuilder2* iface,
431 LPDWORD lpdwSize, LPSTR lpName)
433 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
435 FIXME("(%p)->(%p,%p): stub\n", This, lpdwSize, lpName);
437 return E_NOTIMPL;
440 /*** IDirect3DRMMeshBuilder2 methods ***/
441 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_Load(IDirect3DRMMeshBuilder2* iface,
442 LPVOID filename, LPVOID name,
443 D3DRMLOADOPTIONS loadflags,
444 D3DRMLOADTEXTURECALLBACK cb, LPVOID arg)
446 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
448 TRACE("(%p)->(%p,%p,%x,%p,%p)\n", This, filename, name, loadflags, cb, arg);
450 if (cb)
451 FIXME("Texture callback is not yet supported\n");
453 return IDirect3DRMMeshBuilder3_Load(&This->IDirect3DRMMeshBuilder3_iface, filename, name,
454 loadflags, NULL, arg);
457 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_Save(IDirect3DRMMeshBuilder2* iface,
458 const char *filename, D3DRMXOFFORMAT format,
459 D3DRMSAVEOPTIONS save)
461 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
463 FIXME("(%p)->(%s,%d,%d): stub\n", This, filename, format, save);
465 return E_NOTIMPL;
468 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_Scale(IDirect3DRMMeshBuilder2* iface,
469 D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
471 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
473 FIXME("(%p)->(%f,%f,%f): stub\n", This, sx, sy, sz);
475 return D3DRM_OK;
478 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_Translate(IDirect3DRMMeshBuilder2* iface,
479 D3DVALUE tx, D3DVALUE ty, D3DVALUE tz)
481 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
483 FIXME("(%p)->(%f,%f,%f): stub\n", This, tx, ty, tz);
485 return E_NOTIMPL;
488 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetColorSource(IDirect3DRMMeshBuilder2* iface,
489 D3DRMCOLORSOURCE color)
491 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
493 FIXME("(%p)->(%x): stub\n", This, color);
495 return E_NOTIMPL;
498 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetBox(IDirect3DRMMeshBuilder2* iface,
499 D3DRMBOX *pBox)
501 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
503 FIXME("(%p)->(%p): stub\n", This, pBox);
505 return E_NOTIMPL;
508 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GenerateNormals(IDirect3DRMMeshBuilder2* iface)
510 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
512 FIXME("(%p)->(): stub\n", This);
514 return E_NOTIMPL;
517 static D3DRMCOLORSOURCE WINAPI IDirect3DRMMeshBuilder2Impl_GetColorSource(IDirect3DRMMeshBuilder2* iface)
519 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
521 FIXME("(%p)->(): stub\n", This);
523 return E_NOTIMPL;
526 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_AddMesh(IDirect3DRMMeshBuilder2* iface,
527 LPDIRECT3DRMMESH pMesh)
529 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
531 FIXME("(%p)->(%p): stub\n", This, pMesh);
533 return E_NOTIMPL;
536 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_AddMeshBuilder(IDirect3DRMMeshBuilder2* iface,
537 LPDIRECT3DRMMESHBUILDER pMeshBuilder)
539 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
541 FIXME("(%p)->(%p): stub\n", This, pMeshBuilder);
543 return E_NOTIMPL;
546 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_AddFrame(IDirect3DRMMeshBuilder2* iface,
547 LPDIRECT3DRMFRAME pFrame)
549 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
551 FIXME("(%p)->(%p): stub\n", This, pFrame);
553 return E_NOTIMPL;
556 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_AddFace(IDirect3DRMMeshBuilder2* iface,
557 LPDIRECT3DRMFACE pFace)
559 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
561 FIXME("(%p)->(%p): stub\n", This, pFace);
563 return E_NOTIMPL;
566 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_AddFaces(IDirect3DRMMeshBuilder2* iface,
567 DWORD vcount, D3DVECTOR *vertices,
568 DWORD ncount, D3DVECTOR *normals,
569 DWORD *data,
570 LPDIRECT3DRMFACEARRAY* pFaceArray)
572 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
574 FIXME("(%p)->(%d,%p,%d,%p,%p,%p): stub\n", This, vcount, vertices, ncount, normals, data, pFaceArray);
576 return E_NOTIMPL;
579 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_ReserveSpace(IDirect3DRMMeshBuilder2* iface,
580 DWORD vertex_Count,
581 DWORD normal_count,
582 DWORD face_count)
584 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
586 FIXME("(%p)->(%d,%d,%d): stub\n", This, vertex_Count, normal_count, face_count);
588 return E_NOTIMPL;
591 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetColorRGB(IDirect3DRMMeshBuilder2* iface,
592 D3DVALUE red, D3DVALUE green,
593 D3DVALUE blue)
595 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
597 FIXME("(%p)->(%f,%f,%f): stub\n", This, red, green, blue);
599 return E_NOTIMPL;
602 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetColor(IDirect3DRMMeshBuilder2* iface,
603 D3DCOLOR color)
605 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
607 FIXME("(%p)->(%x): stub\n", This, color);
609 return E_NOTIMPL;
612 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetTexture(IDirect3DRMMeshBuilder2* iface,
613 LPDIRECT3DRMTEXTURE pTexture)
615 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
617 FIXME("(%p)->(%p): stub\n", This, pTexture);
619 return E_NOTIMPL;
622 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetMaterial(IDirect3DRMMeshBuilder2* iface,
623 LPDIRECT3DRMMATERIAL pMaterial)
625 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
627 FIXME("(%p)->(%p): stub\n", This, pMaterial);
629 return E_NOTIMPL;
632 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetTextureTopology(IDirect3DRMMeshBuilder2* iface,
633 BOOL wrap_u, BOOL wrap_v)
635 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
637 FIXME("(%p)->(%d,%d): stub\n", This, wrap_u, wrap_v);
639 return E_NOTIMPL;
642 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetQuality(IDirect3DRMMeshBuilder2* iface,
643 D3DRMRENDERQUALITY quality)
645 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
647 FIXME("(%p)->(%d): stub\n", This, quality);
649 return E_NOTIMPL;
652 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetPerspective(IDirect3DRMMeshBuilder2* iface,
653 BOOL enable)
655 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
657 FIXME("(%p)->(%d): stub\n", This, enable);
659 return E_NOTIMPL;
662 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetVertex(IDirect3DRMMeshBuilder2* iface,
663 DWORD index,
664 D3DVALUE x, D3DVALUE y, D3DVALUE z)
666 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
668 FIXME("(%p)->(%f,%f,%f): stub\n", This, x, y, z);
670 return E_NOTIMPL;
673 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetNormal(IDirect3DRMMeshBuilder2* iface,
674 DWORD index,
675 D3DVALUE x, D3DVALUE y, D3DVALUE z)
677 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
679 FIXME("(%p)->(%f,%f,%f): stub\n", This, x, y, z);
681 return E_NOTIMPL;
684 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetTextureCoordinates(IDirect3DRMMeshBuilder2* iface,
685 DWORD index,
686 D3DVALUE u, D3DVALUE v)
688 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
690 TRACE("(%p)->(%u,%f,%f)\n", This, index, u, v);
692 return IDirect3DRMMeshBuilder3_SetTextureCoordinates(&This->IDirect3DRMMeshBuilder3_iface,
693 index, u, v);
696 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetVertexColor(IDirect3DRMMeshBuilder2* iface,
697 DWORD index, D3DCOLOR color)
699 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
701 FIXME("(%p)->(%d,%x): stub\n", This, index, color);
703 return E_NOTIMPL;
706 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetVertexColorRGB(IDirect3DRMMeshBuilder2* iface,
707 DWORD index, D3DVALUE red,
708 D3DVALUE green, D3DVALUE blue)
710 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
712 FIXME("(%p)->(%d,%f,%f,%f): stub\n", This, index, red, green, blue);
714 return E_NOTIMPL;
717 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetFaces(IDirect3DRMMeshBuilder2* iface,
718 LPDIRECT3DRMFACEARRAY* pFaceArray)
720 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
722 FIXME("(%p)->(%p): stub\n", This, pFaceArray);
724 return E_NOTIMPL;
727 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetVertices(IDirect3DRMMeshBuilder2* iface,
728 DWORD *vcount, D3DVECTOR *vertices,
729 DWORD *ncount, D3DVECTOR *normals,
730 DWORD *face_data_size,
731 DWORD *face_data)
733 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
735 TRACE("(%p)->(%p,%p,%p,%p,%p,%p)\n", This, vcount, vertices, ncount, normals, face_data_size, face_data);
737 if (vcount)
738 *vcount = This->nb_vertices;
739 if (vertices && This->nb_vertices)
740 memcpy(vertices, This->pVertices, This->nb_vertices * sizeof(D3DVECTOR));
741 if (ncount)
742 *ncount = This->nb_normals;
743 if (normals && This->nb_normals)
744 memcpy(normals, This->pNormals, This->nb_normals * sizeof(D3DVECTOR));
745 if (face_data_size)
746 *face_data_size = This->face_data_size;
747 if (face_data && This->face_data_size)
748 memcpy(face_data, This->pFaceData, This->face_data_size * sizeof(DWORD));
750 return D3DRM_OK;
753 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetTextureCoordinates(IDirect3DRMMeshBuilder2* iface,
754 DWORD index,
755 D3DVALUE *u, D3DVALUE *v)
757 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
759 TRACE("(%p)->(%u,%p,%p)\n", This, index, u, v);
761 return IDirect3DRMMeshBuilder3_GetTextureCoordinates(&This->IDirect3DRMMeshBuilder3_iface,
762 index, u, v);
765 static int WINAPI IDirect3DRMMeshBuilder2Impl_AddVertex(IDirect3DRMMeshBuilder2* iface,
766 D3DVALUE x, D3DVALUE y, D3DVALUE z)
768 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
770 FIXME("(%p)->(%f,%f,%f): stub\n", This, x, y, z);
772 return 0;
775 static int WINAPI IDirect3DRMMeshBuilder2Impl_AddNormal(IDirect3DRMMeshBuilder2* iface,
776 D3DVALUE x, D3DVALUE y, D3DVALUE z)
778 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
780 FIXME("(%p)->(%f,%f,%f): stub\n", This, x, y, z);
782 return 0;
785 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_CreateFace(IDirect3DRMMeshBuilder2* iface,
786 LPDIRECT3DRMFACE* ppFace)
788 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
790 FIXME("(%p)->(%p): stub\n", This, ppFace);
792 return E_NOTIMPL;
795 static D3DRMRENDERQUALITY WINAPI IDirect3DRMMeshBuilder2Impl_GetQuality(IDirect3DRMMeshBuilder2* iface)
797 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
799 FIXME("(%p)->(): stub\n", This);
801 return 0;
804 static BOOL WINAPI IDirect3DRMMeshBuilder2Impl_GetPerspective(IDirect3DRMMeshBuilder2* iface)
806 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
808 FIXME("(%p)->(): stub\n", This);
810 return FALSE;
813 static int WINAPI IDirect3DRMMeshBuilder2Impl_GetFaceCount(IDirect3DRMMeshBuilder2* iface)
815 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
817 TRACE("(%p)->()\n", This);
819 return This->nb_faces;
822 static int WINAPI IDirect3DRMMeshBuilder2Impl_GetVertexCount(IDirect3DRMMeshBuilder2* iface)
824 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
826 TRACE("(%p)->()\n", This);
828 return This->nb_vertices;
831 static D3DCOLOR WINAPI IDirect3DRMMeshBuilder2Impl_GetVertexColor(IDirect3DRMMeshBuilder2* iface,
832 DWORD index)
834 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
836 FIXME("(%p)->(%d): stub\n", This, index);
838 return 0;
841 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_CreateMesh(IDirect3DRMMeshBuilder2* iface,
842 LPDIRECT3DRMMESH* ppMesh)
844 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
846 TRACE("(%p)->(%p)\n", This, ppMesh);
848 return Direct3DRMMesh_create(ppMesh);
851 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GenerateNormals2(IDirect3DRMMeshBuilder2* iface,
852 D3DVALUE crease, DWORD dwFlags)
854 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
856 FIXME("(%p)->(%f,%u): stub\n", This, crease, dwFlags);
858 return E_NOTIMPL;
861 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetFace(IDirect3DRMMeshBuilder2* iface,
862 DWORD index, LPDIRECT3DRMFACE* ppFace)
864 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
866 FIXME("(%p)->(%u,%p): stub\n", This, index, ppFace);
868 return E_NOTIMPL;
871 static const struct IDirect3DRMMeshBuilder2Vtbl Direct3DRMMeshBuilder2_Vtbl =
873 /*** IUnknown methods ***/
874 IDirect3DRMMeshBuilder2Impl_QueryInterface,
875 IDirect3DRMMeshBuilder2Impl_AddRef,
876 IDirect3DRMMeshBuilder2Impl_Release,
877 /*** IDirect3DRMObject methods ***/
878 IDirect3DRMMeshBuilder2Impl_Clone,
879 IDirect3DRMMeshBuilder2Impl_AddDestroyCallback,
880 IDirect3DRMMeshBuilder2Impl_DeleteDestroyCallback,
881 IDirect3DRMMeshBuilder2Impl_SetAppData,
882 IDirect3DRMMeshBuilder2Impl_GetAppData,
883 IDirect3DRMMeshBuilder2Impl_SetName,
884 IDirect3DRMMeshBuilder2Impl_GetName,
885 IDirect3DRMMeshBuilder2Impl_GetClassName,
886 /*** IDirect3DRMMeshBuilder methods ***/
887 IDirect3DRMMeshBuilder2Impl_Load,
888 IDirect3DRMMeshBuilder2Impl_Save,
889 IDirect3DRMMeshBuilder2Impl_Scale,
890 IDirect3DRMMeshBuilder2Impl_Translate,
891 IDirect3DRMMeshBuilder2Impl_SetColorSource,
892 IDirect3DRMMeshBuilder2Impl_GetBox,
893 IDirect3DRMMeshBuilder2Impl_GenerateNormals,
894 IDirect3DRMMeshBuilder2Impl_GetColorSource,
895 IDirect3DRMMeshBuilder2Impl_AddMesh,
896 IDirect3DRMMeshBuilder2Impl_AddMeshBuilder,
897 IDirect3DRMMeshBuilder2Impl_AddFrame,
898 IDirect3DRMMeshBuilder2Impl_AddFace,
899 IDirect3DRMMeshBuilder2Impl_AddFaces,
900 IDirect3DRMMeshBuilder2Impl_ReserveSpace,
901 IDirect3DRMMeshBuilder2Impl_SetColorRGB,
902 IDirect3DRMMeshBuilder2Impl_SetColor,
903 IDirect3DRMMeshBuilder2Impl_SetTexture,
904 IDirect3DRMMeshBuilder2Impl_SetMaterial,
905 IDirect3DRMMeshBuilder2Impl_SetTextureTopology,
906 IDirect3DRMMeshBuilder2Impl_SetQuality,
907 IDirect3DRMMeshBuilder2Impl_SetPerspective,
908 IDirect3DRMMeshBuilder2Impl_SetVertex,
909 IDirect3DRMMeshBuilder2Impl_SetNormal,
910 IDirect3DRMMeshBuilder2Impl_SetTextureCoordinates,
911 IDirect3DRMMeshBuilder2Impl_SetVertexColor,
912 IDirect3DRMMeshBuilder2Impl_SetVertexColorRGB,
913 IDirect3DRMMeshBuilder2Impl_GetFaces,
914 IDirect3DRMMeshBuilder2Impl_GetVertices,
915 IDirect3DRMMeshBuilder2Impl_GetTextureCoordinates,
916 IDirect3DRMMeshBuilder2Impl_AddVertex,
917 IDirect3DRMMeshBuilder2Impl_AddNormal,
918 IDirect3DRMMeshBuilder2Impl_CreateFace,
919 IDirect3DRMMeshBuilder2Impl_GetQuality,
920 IDirect3DRMMeshBuilder2Impl_GetPerspective,
921 IDirect3DRMMeshBuilder2Impl_GetFaceCount,
922 IDirect3DRMMeshBuilder2Impl_GetVertexCount,
923 IDirect3DRMMeshBuilder2Impl_GetVertexColor,
924 IDirect3DRMMeshBuilder2Impl_CreateMesh,
925 /*** IDirect3DRMMeshBuilder2 methods ***/
926 IDirect3DRMMeshBuilder2Impl_GenerateNormals2,
927 IDirect3DRMMeshBuilder2Impl_GetFace
931 /*** IUnknown methods ***/
932 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_QueryInterface(IDirect3DRMMeshBuilder3* iface,
933 REFIID riid, void** ppvObject)
935 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
936 return IDirect3DRMMeshBuilder2_QueryInterface(&This->IDirect3DRMMeshBuilder2_iface, riid, ppvObject);
939 static ULONG WINAPI IDirect3DRMMeshBuilder3Impl_AddRef(IDirect3DRMMeshBuilder3* iface)
941 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
942 return IDirect3DRMMeshBuilder2_AddRef(&This->IDirect3DRMMeshBuilder2_iface);
945 static ULONG WINAPI IDirect3DRMMeshBuilder3Impl_Release(IDirect3DRMMeshBuilder3* iface)
947 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
948 return IDirect3DRMMeshBuilder2_Release(&This->IDirect3DRMMeshBuilder2_iface);
951 /*** IDirect3DRMObject methods ***/
952 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Clone(IDirect3DRMMeshBuilder3* iface,
953 LPUNKNOWN pUnkOuter, REFIID riid,
954 LPVOID *ppvObj)
956 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
958 FIXME("(%p)->(%p,%s,%p): stub\n", This, pUnkOuter, debugstr_guid(riid), ppvObj);
960 return E_NOTIMPL;
963 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_AddDestroyCallback(IDirect3DRMMeshBuilder3* iface,
964 D3DRMOBJECTCALLBACK cb,
965 LPVOID argument)
967 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
969 FIXME("(%p)->(%p,%p): stub\n", This, cb, argument);
971 return E_NOTIMPL;
974 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_DeleteDestroyCallback(IDirect3DRMMeshBuilder3* iface,
975 D3DRMOBJECTCALLBACK cb,
976 LPVOID argument)
978 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
980 FIXME("(%p)->(%p,%p): stub\n", This, cb, argument);
982 return E_NOTIMPL;
985 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetAppData(IDirect3DRMMeshBuilder3* iface,
986 DWORD data)
988 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
990 FIXME("(%p)->(%u): stub\n", This, data);
992 return E_NOTIMPL;
995 static DWORD WINAPI IDirect3DRMMeshBuilder3Impl_GetAppData(IDirect3DRMMeshBuilder3* iface)
997 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
999 FIXME("(%p)->(): stub\n", This);
1001 return 0;
1004 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetName(IDirect3DRMMeshBuilder3* iface,
1005 LPCSTR pName)
1007 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1009 FIXME("(%p)->(%s): stub\n", This, pName);
1011 return E_NOTIMPL;
1014 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetName(IDirect3DRMMeshBuilder3* iface,
1015 LPDWORD lpdwSize, LPSTR lpName)
1017 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1019 FIXME("(%p)->(%p,%p): stub\n", This, lpdwSize, lpName);
1021 return E_NOTIMPL;
1024 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetClassName(IDirect3DRMMeshBuilder3* iface,
1025 LPDWORD lpdwSize, LPSTR lpName)
1027 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1029 FIXME("(%p)->(%p,%p): stub\n", This, lpdwSize, lpName);
1031 return E_NOTIMPL;
1034 HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, LPDIRECTXFILEDATA pData)
1036 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1037 LPDIRECTXFILEOBJECT pObject = NULL;
1038 LPDIRECTXFILEDATA pData2 = NULL;
1039 const GUID* pGuid;
1040 DWORD size;
1041 LPBYTE ptr;
1042 HRESULT hr;
1043 HRESULT ret = D3DRMERR_BADOBJECT;
1044 DWORD* faces_vertex_idx_data = NULL;
1045 DWORD* faces_vertex_idx_ptr;
1046 DWORD faces_vertex_idx_size;
1047 DWORD* faces_normal_idx_data = NULL;
1048 DWORD* faces_normal_idx_ptr = NULL;
1049 DWORD* faces_data_ptr;
1050 DWORD faces_data_size = 0;
1051 DWORD i;
1053 TRACE("(%p)->(%p)\n", This, pData);
1055 hr = IDirectXFileData_GetData(pData, NULL, &size, (void**)&ptr);
1056 if (hr != DXFILE_OK)
1057 goto end;
1059 This->nb_vertices = *(DWORD*)ptr;
1060 This->nb_faces = *(DWORD*)(ptr + sizeof(DWORD) + This->nb_vertices * sizeof(D3DVECTOR));
1061 faces_vertex_idx_size = size - sizeof(DWORD) - This->nb_vertices * sizeof(D3DVECTOR) - sizeof(DWORD);
1062 faces_vertex_idx_ptr = (DWORD*)(ptr + sizeof(DWORD) + This->nb_vertices * sizeof(D3DVECTOR) + sizeof(DWORD));
1064 TRACE("Mesh: nb_vertices = %d, nb_faces = %d, faces_vertex_idx_size = %d\n", This->nb_vertices, This->nb_faces, faces_vertex_idx_size);
1066 This->pVertices = HeapAlloc(GetProcessHeap(), 0, This->nb_vertices * sizeof(D3DVECTOR));
1067 memcpy(This->pVertices, ptr + sizeof(DWORD), This->nb_vertices * sizeof(D3DVECTOR));
1069 faces_vertex_idx_ptr = faces_vertex_idx_data = HeapAlloc(GetProcessHeap(), 0, faces_vertex_idx_size);
1070 memcpy(faces_vertex_idx_data, ptr + sizeof(DWORD) + This->nb_vertices * sizeof(D3DVECTOR) + sizeof(DWORD), faces_vertex_idx_size);
1072 /* Each vertex index will have its normal index counterpart so just allocate twice the size */
1073 This->pFaceData = HeapAlloc(GetProcessHeap(), 0, faces_vertex_idx_size*2);
1074 faces_data_ptr = (DWORD*)This->pFaceData;
1076 while (1)
1078 hr = IDirectXFileData_GetNextObject(pData, &pObject);
1079 if (hr == DXFILEERR_NOMOREOBJECTS)
1081 TRACE("No more object\n");
1082 break;
1084 if (hr != DXFILE_OK)
1085 goto end;
1087 hr = IDirectXFileObject_QueryInterface(pObject, &IID_IDirectXFileData, (void**)&pData2);
1088 IDirectXFileObject_Release(pObject);
1089 if (hr != DXFILE_OK)
1090 goto end;
1092 hr = IDirectXFileData_GetType(pData2, &pGuid);
1093 if (hr != DXFILE_OK)
1094 goto end;
1096 TRACE("Found object type whose GUID = %s\n", debugstr_guid(pGuid));
1098 if (IsEqualGUID(pGuid, &TID_D3DRMMeshNormals))
1100 DWORD nb_faces_normals;
1101 DWORD faces_normal_idx_size;
1103 hr = IDirectXFileData_GetData(pData2, NULL, &size, (void**)&ptr);
1104 if (hr != DXFILE_OK)
1105 goto end;
1107 This->nb_normals = *(DWORD*)ptr;
1108 nb_faces_normals = *(DWORD*)(ptr + sizeof(DWORD) + This->nb_normals * sizeof(D3DVECTOR));
1110 TRACE("MeshNormals: nb_normals = %d, nb_faces_normals = %d\n", This->nb_normals, nb_faces_normals);
1111 if (nb_faces_normals != This->nb_faces)
1112 WARN("nb_face_normals (%d) != nb_faces (%d)\n", nb_faces_normals, This->nb_normals);
1114 This->pNormals = HeapAlloc(GetProcessHeap(), 0, This->nb_normals * sizeof(D3DVECTOR));
1115 memcpy(This->pNormals, ptr + sizeof(DWORD), This->nb_normals * sizeof(D3DVECTOR));
1117 faces_normal_idx_size = size - (2*sizeof(DWORD) + This->nb_normals * sizeof(D3DVECTOR));
1118 faces_normal_idx_ptr = faces_normal_idx_data = HeapAlloc(GetProcessHeap(), 0, faces_normal_idx_size);
1119 memcpy(faces_normal_idx_data, ptr + sizeof(DWORD) + This->nb_normals * sizeof(D3DVECTOR) + sizeof(DWORD), faces_normal_idx_size);
1121 else if (IsEqualGUID(pGuid, &TID_D3DRMMeshTextureCoords))
1123 hr = IDirectXFileData_GetData(pData2, NULL, &size, (void**)&ptr);
1124 if (hr != DXFILE_OK)
1125 goto end;
1127 This->nb_coords2d = *(DWORD*)ptr;
1129 TRACE("MeshTextureCoords: nb_coords2d = %d\n", This->nb_coords2d);
1131 This->pCoords2d = HeapAlloc(GetProcessHeap(), 0, This->nb_coords2d * sizeof(Coords2d));
1132 memcpy(This->pCoords2d, ptr + sizeof(DWORD), This->nb_coords2d * sizeof(Coords2d));
1135 else if (IsEqualGUID(pGuid, &TID_D3DRMMeshMaterialList))
1137 FIXME("MeshMaterialList not supported yet, ignoring...\n");
1139 else
1141 FIXME("Unknown GUID %s, ignoring...\n", debugstr_guid(pGuid));
1144 IDirectXFileData_Release(pData2);
1145 pData2 = NULL;
1148 for (i = 0; i < This->nb_faces; i++)
1150 DWORD j;
1151 DWORD nb_face_indexes;
1153 if (faces_vertex_idx_size < sizeof(DWORD))
1154 WARN("Not enough data to read number of indices of face %d\n", i);
1156 nb_face_indexes = *(faces_data_ptr + faces_data_size++) = *(faces_vertex_idx_ptr++);
1157 faces_vertex_idx_size--;
1158 if (faces_normal_idx_data && (*(faces_normal_idx_ptr++) != nb_face_indexes))
1159 WARN("Faces indices number mismatch\n");
1161 if (faces_vertex_idx_size < (nb_face_indexes * sizeof(DWORD)))
1162 WARN("Not enough data to read all indices of face %d\n", i);
1164 for (j = 0; j < nb_face_indexes; j++)
1166 /* Copy vertex index */
1167 *(faces_data_ptr + faces_data_size++) = *(faces_vertex_idx_ptr++);
1168 /* Copy normal index */
1169 if (faces_normal_idx_data)
1171 /* Read from x file */
1172 *(faces_data_ptr + faces_data_size++) = *(faces_normal_idx_ptr++);
1174 else
1176 FIXME("No normal available, generate a fake normal index\n");
1177 /* Must be generated, put 0 for now */
1178 *(faces_data_ptr + faces_data_size++) = 0;
1181 faces_vertex_idx_size -= nb_face_indexes;
1184 /* Last DWORD must be 0 */
1185 *(faces_data_ptr + faces_data_size++) = 0;
1187 /* Set size (in number of DWORD) of all faces data */
1188 This->face_data_size = faces_data_size;
1190 /* If there is no texture coordinates, generate default texture coordinates (0.0f, 0.0f) for each vertex */
1191 if (!This->pCoords2d)
1193 This->nb_coords2d = This->nb_vertices;
1194 This->pCoords2d = HeapAlloc(GetProcessHeap(), 0, This->nb_coords2d * sizeof(Coords2d));
1195 for (i = 0; i < This->nb_coords2d; i++)
1197 This->pCoords2d[i].u = 0.0f;
1198 This->pCoords2d[i].v = 0.0f;
1202 TRACE("Mesh data loaded successfully\n");
1204 ret = D3DRM_OK;
1206 end:
1208 HeapFree(GetProcessHeap(), 0, faces_normal_idx_data);
1209 HeapFree(GetProcessHeap(), 0, faces_vertex_idx_data);
1211 return ret;
1214 /*** IDirect3DRMMeshBuilder3 methods ***/
1215 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Load(IDirect3DRMMeshBuilder3* iface,
1216 LPVOID filename, LPVOID name,
1217 D3DRMLOADOPTIONS loadflags,
1218 D3DRMLOADTEXTURE3CALLBACK cb, LPVOID arg)
1220 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1221 DXFILELOADOPTIONS load_options;
1222 LPDIRECTXFILE pDXFile = NULL;
1223 LPDIRECTXFILEENUMOBJECT pEnumObject = NULL;
1224 LPDIRECTXFILEDATA pData = NULL;
1225 LPDIRECTXFILEDATA pData2 = NULL;
1226 const GUID* pGuid;
1227 DWORD size;
1228 Header* pHeader;
1229 HRESULT hr;
1230 HRESULT ret = D3DRMERR_BADOBJECT;
1232 TRACE("(%p)->(%p,%p,%x,%p,%p)\n", This, filename, name, loadflags, cb, arg);
1234 /* First free allocated buffers of previous mesh data */
1235 HeapFree(GetProcessHeap(), 0, This->pVertices);
1236 This->pVertices = NULL;
1237 HeapFree(GetProcessHeap(), 0, This->pNormals);
1238 This->pNormals = NULL;
1239 HeapFree(GetProcessHeap(), 0, This->pFaceData);
1240 This->pFaceData = NULL;
1241 HeapFree(GetProcessHeap(), 0, This->pCoords2d);
1242 This->pCoords2d = NULL;
1244 if (loadflags == D3DRMLOAD_FROMMEMORY)
1246 load_options = DXFILELOAD_FROMMEMORY;
1248 else
1250 FIXME("Load options %d not supported yet\n", loadflags);
1251 return E_NOTIMPL;
1254 hr = DirectXFileCreate(&pDXFile);
1255 if (hr != DXFILE_OK)
1256 goto end;
1258 hr = IDirectXFile_RegisterTemplates(pDXFile, templates, strlen(templates));
1259 if (hr != DXFILE_OK)
1260 goto end;
1262 hr = IDirectXFile_CreateEnumObject(pDXFile, filename, load_options, &pEnumObject);
1263 if (hr != DXFILE_OK)
1264 goto end;
1266 hr = IDirectXFileEnumObject_GetNextDataObject(pEnumObject, &pData);
1267 if (hr != DXFILE_OK)
1268 goto end;
1270 hr = IDirectXFileData_GetType(pData, &pGuid);
1271 if (hr != DXFILE_OK)
1272 goto end;
1274 TRACE("Found object type whose GUID = %s\n", debugstr_guid(pGuid));
1276 if (!IsEqualGUID(pGuid, &TID_DXFILEHeader))
1278 ret = D3DRMERR_BADFILE;
1279 goto end;
1282 hr = IDirectXFileData_GetData(pData, NULL, &size, (void**)&pHeader);
1283 if ((hr != DXFILE_OK) || (size != sizeof(Header)))
1284 goto end;
1286 TRACE("Version is %d %d %d\n", pHeader->major, pHeader->minor, pHeader->flags);
1288 /* Version must be 1.0.x */
1289 if ((pHeader->major != 1) || (pHeader->minor != 0))
1291 ret = D3DRMERR_BADFILE;
1292 goto end;
1295 IDirectXFileData_Release(pData);
1296 pData = NULL;
1298 hr = IDirectXFileEnumObject_GetNextDataObject(pEnumObject, &pData);
1299 if (hr != DXFILE_OK)
1301 ret = D3DRMERR_NOTFOUND;
1302 goto end;
1305 hr = IDirectXFileData_GetType(pData, &pGuid);
1306 if (hr != DXFILE_OK)
1307 goto end;
1309 TRACE("Found object type whose GUID = %s\n", debugstr_guid(pGuid));
1311 if (!IsEqualGUID(pGuid, &TID_D3DRMMesh))
1313 ret = D3DRMERR_NOTFOUND;
1314 goto end;
1317 hr = load_mesh_data(iface, pData);
1318 if (hr == S_OK)
1319 ret = D3DRM_OK;
1321 end:
1323 if (pData2)
1324 IDirectXFileData_Release(pData2);
1325 if (pData)
1326 IDirectXFileData_Release(pData);
1327 if (pEnumObject)
1328 IDirectXFileEnumObject_Release(pEnumObject);
1329 if (pDXFile)
1330 IDirectXFile_Release(pDXFile);
1332 if (ret != D3DRM_OK)
1334 /* Clean mesh data */
1335 This->nb_vertices = 0;
1336 This->nb_normals = 0;
1337 This->nb_faces = 0;
1338 This->face_data_size = 0;
1339 This->nb_coords2d = 0;
1340 HeapFree(GetProcessHeap(), 0, This->pVertices);
1341 This->pVertices = NULL;
1342 HeapFree(GetProcessHeap(), 0, This->pNormals);
1343 This->pNormals = NULL;
1344 HeapFree(GetProcessHeap(), 0, This->pFaceData);
1345 This->pFaceData = NULL;
1346 HeapFree(GetProcessHeap(), 0, This->pCoords2d);
1347 This->pCoords2d = NULL;
1350 return ret;
1353 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Save(IDirect3DRMMeshBuilder3* iface,
1354 const char* filename, D3DRMXOFFORMAT format,
1355 D3DRMSAVEOPTIONS save)
1357 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1359 FIXME("(%p)->(%s,%d,%d): stub\n", This, filename, format, save);
1361 return E_NOTIMPL;
1364 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Scale(IDirect3DRMMeshBuilder3* iface,
1365 D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1367 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1369 FIXME("(%p)->(%f,%f,%f): stub\n", This, sx, sy, sz);
1371 return E_NOTIMPL;
1374 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Translate(IDirect3DRMMeshBuilder3* iface,
1375 D3DVALUE tx, D3DVALUE ty, D3DVALUE tz)
1377 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1379 FIXME("(%p)->(%f,%f,%f): stub\n", This, tx, ty, tz);
1381 return E_NOTIMPL;
1384 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetColorSource(IDirect3DRMMeshBuilder3* iface,
1385 D3DRMCOLORSOURCE color)
1387 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1389 FIXME("(%p)->(%x): stub\n", This, color);
1391 return E_NOTIMPL;
1394 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetBox(IDirect3DRMMeshBuilder3* iface,
1395 D3DRMBOX* box)
1397 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1399 FIXME("(%p)->(%p): stub\n", This, box);
1401 return E_NOTIMPL;
1404 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GenerateNormals(IDirect3DRMMeshBuilder3* iface,
1405 D3DVALUE crease, DWORD flags)
1407 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1409 FIXME("(%p)->(%f,%u): stub\n", This, crease, flags);
1411 return E_NOTIMPL;
1414 static D3DRMCOLORSOURCE WINAPI IDirect3DRMMeshBuilder3Impl_GetColorSource(IDirect3DRMMeshBuilder3* iface)
1416 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1418 FIXME("(%p)->(): stub\n", This);
1420 return E_NOTIMPL;
1423 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_AddMesh(IDirect3DRMMeshBuilder3* iface,
1424 LPDIRECT3DRMMESH Mesh)
1426 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1428 FIXME("(%p)->(%p): stub\n", This, Mesh);
1430 return E_NOTIMPL;
1433 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_AddMeshBuilder(IDirect3DRMMeshBuilder3* iface,
1434 LPDIRECT3DRMMESHBUILDER3 MeshBuilder,
1435 DWORD flags)
1437 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1439 FIXME("(%p)->(%p,%u): stub\n", This, MeshBuilder, flags);
1441 return E_NOTIMPL;
1444 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_AddFrame(IDirect3DRMMeshBuilder3* iface,
1445 LPDIRECT3DRMFRAME3 Frame)
1447 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1449 FIXME("(%p)->(%p): stub\n", This, Frame);
1451 return E_NOTIMPL;
1454 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_AddFace(IDirect3DRMMeshBuilder3* iface,
1455 LPDIRECT3DRMFACE2 Face)
1457 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1459 FIXME("(%p)->(%p): stub\n", This, Face);
1461 return E_NOTIMPL;
1464 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_AddFaces(IDirect3DRMMeshBuilder3* iface,
1465 DWORD vcount, D3DVECTOR* vertices,
1466 DWORD ncount, D3DVECTOR* normals,
1467 DWORD* data,
1468 LPDIRECT3DRMFACEARRAY* FaceArray)
1470 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1472 FIXME("(%p)->(%d,%p,%d,%p,%p,%p): stub\n", This, vcount, vertices, ncount,
1473 normals, data, FaceArray);
1475 return E_NOTIMPL;
1478 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_ReserveSpace(IDirect3DRMMeshBuilder3* iface,
1479 DWORD vertex_Count,
1480 DWORD normal_count,
1481 DWORD face_count)
1483 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1485 FIXME("(%p)->(%d,%d,%d): stub\n", This, vertex_Count, normal_count, face_count);
1487 return E_NOTIMPL;
1490 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetColorRGB(IDirect3DRMMeshBuilder3* iface,
1491 D3DVALUE red, D3DVALUE green,
1492 D3DVALUE blue)
1494 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1496 FIXME("(%p)->(%f,%f,%f): stub\n", This, red, green, blue);
1498 return E_NOTIMPL;
1501 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetColor(IDirect3DRMMeshBuilder3* iface,
1502 D3DCOLOR color)
1504 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1506 FIXME("(%p)->(%x): stub\n", This, color);
1508 return E_NOTIMPL;
1511 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetTexture(IDirect3DRMMeshBuilder3* iface,
1512 LPDIRECT3DRMTEXTURE3 texture)
1514 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1516 FIXME("(%p)->(%p): stub\n", This, texture);
1518 return E_NOTIMPL;
1521 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetMaterial(IDirect3DRMMeshBuilder3* iface,
1522 LPDIRECT3DRMMATERIAL2 material)
1524 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1526 FIXME("(%p)->(%p): stub\n", This, material);
1528 return E_NOTIMPL;
1531 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetTextureTopology(IDirect3DRMMeshBuilder3* iface,
1532 BOOL wrap_u, BOOL wrap_v)
1534 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1536 FIXME("(%p)->(%d,%d): stub\n", This, wrap_u, wrap_v);
1538 return E_NOTIMPL;
1541 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetQuality(IDirect3DRMMeshBuilder3* iface,
1542 D3DRMRENDERQUALITY quality)
1544 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1546 FIXME("(%p)->(%d): stub\n", This, quality);
1548 return E_NOTIMPL;
1551 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetPerspective(IDirect3DRMMeshBuilder3* iface,
1552 BOOL enable)
1554 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1556 FIXME("(%p)->(%d): stub\n", This, enable);
1558 return E_NOTIMPL;
1561 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetVertex(IDirect3DRMMeshBuilder3* iface,
1562 DWORD index,
1563 D3DVALUE x, D3DVALUE y, D3DVALUE z)
1565 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1567 FIXME("(%p)->(%f,%f,%f): stub\n", This, x, y, z);
1569 return E_NOTIMPL;
1572 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetNormal(IDirect3DRMMeshBuilder3* iface,
1573 DWORD index,
1574 D3DVALUE x, D3DVALUE y, D3DVALUE z)
1576 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1578 FIXME("(%p)->(%f,%f,%f): stub\n", This, x, y, z);
1580 return E_NOTIMPL;
1583 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetTextureCoordinates(IDirect3DRMMeshBuilder3* iface,
1584 DWORD index, D3DVALUE u,
1585 D3DVALUE v)
1587 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1589 TRACE("(%p)->(%u,%f,%f)\n", This, index, u, v);
1591 if (index >= This->nb_coords2d)
1592 return D3DRMERR_BADVALUE;
1594 This->pCoords2d[index].u = u;
1595 This->pCoords2d[index].v = v;
1597 return D3DRM_OK;
1600 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetVertexColor(IDirect3DRMMeshBuilder3* iface,
1601 DWORD index, D3DCOLOR color)
1603 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1605 FIXME("(%p)->(%d,%x): stub\n", This, index, color);
1607 return E_NOTIMPL;
1610 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetVertexColorRGB(IDirect3DRMMeshBuilder3* iface,
1611 DWORD index,
1612 D3DVALUE red, D3DVALUE green,
1613 D3DVALUE blue)
1615 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1617 FIXME("(%p)->(%d,%f,%f,%f): stub\n", This, index, red, green, blue);
1619 return E_NOTIMPL;
1622 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetFaces(IDirect3DRMMeshBuilder3* iface,
1623 LPDIRECT3DRMFACEARRAY* FaceArray)
1625 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1627 FIXME("(%p)->(%p): stub\n", This, FaceArray);
1629 return E_NOTIMPL;
1632 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetGeometry(IDirect3DRMMeshBuilder3* iface,
1633 DWORD* vcount, D3DVECTOR* vertices,
1634 DWORD* ncount, D3DVECTOR* normals,
1635 DWORD* face_data_size,
1636 DWORD* face_data)
1638 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1640 FIXME("(%p)->(%p,%p,%p,%p,%p,%p): stub\n", This, vcount, vertices, ncount, normals,
1641 face_data_size, face_data);
1643 return E_NOTIMPL;
1646 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetTextureCoordinates(IDirect3DRMMeshBuilder3* iface,
1647 DWORD index, D3DVALUE* u,
1648 D3DVALUE* v)
1650 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1652 TRACE("(%p)->(%d,%p,%p)\n", This, index, u, v);
1654 if (index >= This->nb_coords2d)
1655 return D3DRMERR_BADVALUE;
1657 *u = This->pCoords2d[index].u;
1658 *v = This->pCoords2d[index].v;
1660 return D3DRM_OK;
1664 static int WINAPI IDirect3DRMMeshBuilder3Impl_AddVertex(IDirect3DRMMeshBuilder3* iface,
1665 D3DVALUE x, D3DVALUE y, D3DVALUE z)
1667 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1669 FIXME("(%p)->(%f,%f,%f): stub\n", This, x, y, z);
1671 return 0;
1674 static int WINAPI IDirect3DRMMeshBuilder3Impl_AddNormal(IDirect3DRMMeshBuilder3* iface,
1675 D3DVALUE x, D3DVALUE y, D3DVALUE z)
1677 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1679 FIXME("(%p)->(%f,%f,%f): stub\n", This, x, y, z);
1681 return 0;
1684 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_CreateFace(IDirect3DRMMeshBuilder3* iface,
1685 LPDIRECT3DRMFACE2* Face)
1687 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1689 FIXME("(%p)->(%p): stub\n", This, Face);
1691 return E_NOTIMPL;
1694 static D3DRMRENDERQUALITY WINAPI IDirect3DRMMeshBuilder3Impl_GetQuality(IDirect3DRMMeshBuilder3* iface)
1696 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1698 FIXME("(%p)->(): stub\n", This);
1700 return 0;
1703 static BOOL WINAPI IDirect3DRMMeshBuilder3Impl_GetPerspective(IDirect3DRMMeshBuilder3* iface)
1705 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1707 FIXME("(%p)->(): stub\n", This);
1709 return FALSE;
1712 static int WINAPI IDirect3DRMMeshBuilder3Impl_GetFaceCount(IDirect3DRMMeshBuilder3* iface)
1714 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1716 TRACE("(%p)->()\n", This);
1718 return This->nb_faces;
1721 static int WINAPI IDirect3DRMMeshBuilder3Impl_GetVertexCount(IDirect3DRMMeshBuilder3* iface)
1723 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1725 TRACE("(%p)->()\n", This);
1727 return This->nb_vertices;
1730 static D3DCOLOR WINAPI IDirect3DRMMeshBuilder3Impl_GetVertexColor(IDirect3DRMMeshBuilder3* iface,
1731 DWORD index)
1733 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1735 FIXME("(%p)->(%d): stub\n", This, index);
1737 return 0;
1740 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_CreateMesh(IDirect3DRMMeshBuilder3* iface,
1741 LPDIRECT3DRMMESH* Mesh)
1743 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1745 TRACE("(%p)->(%p)\n", This, Mesh);
1747 return Direct3DRMMesh_create(Mesh);
1750 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetFace(IDirect3DRMMeshBuilder3* iface,
1751 DWORD index, LPDIRECT3DRMFACE2* Face)
1753 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1755 FIXME("(%p)->(%u,%p): stub\n", This, index, Face);
1757 return E_NOTIMPL;
1760 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetVertex(IDirect3DRMMeshBuilder3* iface,
1761 DWORD index, LPD3DVECTOR vector)
1763 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1765 FIXME("(%p)->(%u,%p): stub\n", This, index, vector);
1767 return E_NOTIMPL;
1770 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetNormal(IDirect3DRMMeshBuilder3* iface,
1771 DWORD index, LPD3DVECTOR vector)
1773 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1775 FIXME("(%p)->(%u,%p): stub\n", This, index, vector);
1777 return E_NOTIMPL;
1780 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_DeleteVertices(IDirect3DRMMeshBuilder3* iface,
1781 DWORD IndexFirst, DWORD count)
1783 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1785 FIXME("(%p)->(%u,%u): stub\n", This, IndexFirst, count);
1787 return E_NOTIMPL;
1790 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_DeleteNormals(IDirect3DRMMeshBuilder3* iface,
1791 DWORD IndexFirst, DWORD count)
1793 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1795 FIXME("(%p)->(%u,%u): stub\n", This, IndexFirst, count);
1797 return E_NOTIMPL;
1800 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_DeleteFace(IDirect3DRMMeshBuilder3* iface,
1801 LPDIRECT3DRMFACE2 Face)
1803 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1805 FIXME("(%p)->(%p): stub\n", This, Face);
1807 return E_NOTIMPL;
1810 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Empty(IDirect3DRMMeshBuilder3* iface, DWORD flags)
1812 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1814 FIXME("(%p)->(%u): stub\n", This, flags);
1816 return E_NOTIMPL;
1819 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Optimize(IDirect3DRMMeshBuilder3* iface,
1820 DWORD flags)
1822 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1824 FIXME("(%p)->(%u): stub\n", This, flags);
1826 return E_NOTIMPL;
1829 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_AddFacesIndexed(IDirect3DRMMeshBuilder3* iface,
1830 DWORD flags, DWORD* indices,
1831 DWORD* IndexFirst, DWORD* count)
1833 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1835 FIXME("(%p)->(%u,%p,%p,%p): stub\n", This, flags, indices, IndexFirst, count);
1837 return E_NOTIMPL;
1840 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_CreateSubMesh(IDirect3DRMMeshBuilder3* iface,
1841 LPUNKNOWN *unkwn)
1843 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1845 FIXME("(%p)->(%p): stub\n", This, unkwn);
1847 return E_NOTIMPL;
1850 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetParentMesh(IDirect3DRMMeshBuilder3* iface,
1851 DWORD flags, LPUNKNOWN *unkwn)
1853 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1855 FIXME("(%p)->(%u,%p): stub\n", This, flags, unkwn);
1857 return E_NOTIMPL;
1860 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetSubMeshes(IDirect3DRMMeshBuilder3* iface,
1861 LPDWORD count, LPUNKNOWN *unkwn)
1863 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1865 FIXME("(%p)->(%p,%p): stub\n", This, count, unkwn);
1867 return E_NOTIMPL;
1870 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_DeleteSubMesh(IDirect3DRMMeshBuilder3* iface,
1871 LPUNKNOWN unkwn)
1873 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1875 FIXME("(%p)->(%p): stub\n", This, unkwn);
1877 return E_NOTIMPL;
1880 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Enable(IDirect3DRMMeshBuilder3* iface,
1881 DWORD index)
1883 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1885 FIXME("(%p)->(%u): stub\n", This, index);
1887 return E_NOTIMPL;
1890 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetEnable(IDirect3DRMMeshBuilder3* iface,
1891 DWORD* indices)
1893 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1895 FIXME("(%p)->(%p): stub\n", This, indices);
1897 return E_NOTIMPL;
1900 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_AddTriangles(IDirect3DRMMeshBuilder3* iface,
1901 DWORD flags, DWORD format,
1902 DWORD VertexCount, LPVOID data)
1904 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1906 FIXME("(%p)->(%u,%u,%u,%p): stub\n", This, flags, format, VertexCount, data);
1908 return E_NOTIMPL;
1911 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetVertices(IDirect3DRMMeshBuilder3* iface,
1912 DWORD IndexFirst, DWORD count,
1913 LPD3DVECTOR vector)
1915 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1917 FIXME("(%p)->(%u,%u,%p): stub\n", This, IndexFirst, count, vector);
1919 return E_NOTIMPL;
1922 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetVertices(IDirect3DRMMeshBuilder3* iface,
1923 DWORD IndexFirst, LPDWORD vcount,
1924 LPD3DVECTOR vertices)
1926 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1927 DWORD count = This->nb_vertices - IndexFirst;
1929 TRACE("(%p)->(%u,%p,%p)\n", This, IndexFirst, vcount, vertices);
1931 if (vcount)
1932 *vcount = count;
1933 if (vertices && This->nb_vertices)
1934 memcpy(vertices, This->pVertices + IndexFirst, count * sizeof(D3DVECTOR));
1936 return D3DRM_OK;
1939 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetNormals(IDirect3DRMMeshBuilder3* iface,
1940 DWORD IndexFirst, DWORD count,
1941 LPD3DVECTOR vector)
1943 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1945 FIXME("(%p)->(%u,%u,%p): stub\n", This, IndexFirst, count, vector);
1947 return E_NOTIMPL;
1950 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetNormals(IDirect3DRMMeshBuilder3* iface,
1951 DWORD IndexFirst, LPDWORD count,
1952 LPD3DVECTOR vector)
1954 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1956 FIXME("(%p)->(%u,%p,%p): stub\n", This, IndexFirst, count, vector);
1958 return E_NOTIMPL;
1961 static int WINAPI IDirect3DRMMeshBuilder3Impl_GetNormalCount(IDirect3DRMMeshBuilder3* iface)
1963 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1965 FIXME("(%p)->(): stub\n", This);
1967 return E_NOTIMPL;
1970 static const struct IDirect3DRMMeshBuilder3Vtbl Direct3DRMMeshBuilder3_Vtbl =
1972 /*** IUnknown methods ***/
1973 IDirect3DRMMeshBuilder3Impl_QueryInterface,
1974 IDirect3DRMMeshBuilder3Impl_AddRef,
1975 IDirect3DRMMeshBuilder3Impl_Release,
1976 /*** IDirect3DRMObject methods ***/
1977 IDirect3DRMMeshBuilder3Impl_Clone,
1978 IDirect3DRMMeshBuilder3Impl_AddDestroyCallback,
1979 IDirect3DRMMeshBuilder3Impl_DeleteDestroyCallback,
1980 IDirect3DRMMeshBuilder3Impl_SetAppData,
1981 IDirect3DRMMeshBuilder3Impl_GetAppData,
1982 IDirect3DRMMeshBuilder3Impl_SetName,
1983 IDirect3DRMMeshBuilder3Impl_GetName,
1984 IDirect3DRMMeshBuilder3Impl_GetClassName,
1985 /*** IDirect3DRMMeshBuilder3 methods ***/
1986 IDirect3DRMMeshBuilder3Impl_Load,
1987 IDirect3DRMMeshBuilder3Impl_Save,
1988 IDirect3DRMMeshBuilder3Impl_Scale,
1989 IDirect3DRMMeshBuilder3Impl_Translate,
1990 IDirect3DRMMeshBuilder3Impl_SetColorSource,
1991 IDirect3DRMMeshBuilder3Impl_GetBox,
1992 IDirect3DRMMeshBuilder3Impl_GenerateNormals,
1993 IDirect3DRMMeshBuilder3Impl_GetColorSource,
1994 IDirect3DRMMeshBuilder3Impl_AddMesh,
1995 IDirect3DRMMeshBuilder3Impl_AddMeshBuilder,
1996 IDirect3DRMMeshBuilder3Impl_AddFrame,
1997 IDirect3DRMMeshBuilder3Impl_AddFace,
1998 IDirect3DRMMeshBuilder3Impl_AddFaces,
1999 IDirect3DRMMeshBuilder3Impl_ReserveSpace,
2000 IDirect3DRMMeshBuilder3Impl_SetColorRGB,
2001 IDirect3DRMMeshBuilder3Impl_SetColor,
2002 IDirect3DRMMeshBuilder3Impl_SetTexture,
2003 IDirect3DRMMeshBuilder3Impl_SetMaterial,
2004 IDirect3DRMMeshBuilder3Impl_SetTextureTopology,
2005 IDirect3DRMMeshBuilder3Impl_SetQuality,
2006 IDirect3DRMMeshBuilder3Impl_SetPerspective,
2007 IDirect3DRMMeshBuilder3Impl_SetVertex,
2008 IDirect3DRMMeshBuilder3Impl_SetNormal,
2009 IDirect3DRMMeshBuilder3Impl_SetTextureCoordinates,
2010 IDirect3DRMMeshBuilder3Impl_SetVertexColor,
2011 IDirect3DRMMeshBuilder3Impl_SetVertexColorRGB,
2012 IDirect3DRMMeshBuilder3Impl_GetFaces,
2013 IDirect3DRMMeshBuilder3Impl_GetGeometry,
2014 IDirect3DRMMeshBuilder3Impl_GetTextureCoordinates,
2015 IDirect3DRMMeshBuilder3Impl_AddVertex,
2016 IDirect3DRMMeshBuilder3Impl_AddNormal,
2017 IDirect3DRMMeshBuilder3Impl_CreateFace,
2018 IDirect3DRMMeshBuilder3Impl_GetQuality,
2019 IDirect3DRMMeshBuilder3Impl_GetPerspective,
2020 IDirect3DRMMeshBuilder3Impl_GetFaceCount,
2021 IDirect3DRMMeshBuilder3Impl_GetVertexCount,
2022 IDirect3DRMMeshBuilder3Impl_GetVertexColor,
2023 IDirect3DRMMeshBuilder3Impl_CreateMesh,
2024 IDirect3DRMMeshBuilder3Impl_GetFace,
2025 IDirect3DRMMeshBuilder3Impl_GetVertex,
2026 IDirect3DRMMeshBuilder3Impl_GetNormal,
2027 IDirect3DRMMeshBuilder3Impl_DeleteVertices,
2028 IDirect3DRMMeshBuilder3Impl_DeleteNormals,
2029 IDirect3DRMMeshBuilder3Impl_DeleteFace,
2030 IDirect3DRMMeshBuilder3Impl_Empty,
2031 IDirect3DRMMeshBuilder3Impl_Optimize,
2032 IDirect3DRMMeshBuilder3Impl_AddFacesIndexed,
2033 IDirect3DRMMeshBuilder3Impl_CreateSubMesh,
2034 IDirect3DRMMeshBuilder3Impl_GetParentMesh,
2035 IDirect3DRMMeshBuilder3Impl_GetSubMeshes,
2036 IDirect3DRMMeshBuilder3Impl_DeleteSubMesh,
2037 IDirect3DRMMeshBuilder3Impl_Enable,
2038 IDirect3DRMMeshBuilder3Impl_GetEnable,
2039 IDirect3DRMMeshBuilder3Impl_AddTriangles,
2040 IDirect3DRMMeshBuilder3Impl_SetVertices,
2041 IDirect3DRMMeshBuilder3Impl_GetVertices,
2042 IDirect3DRMMeshBuilder3Impl_SetNormals,
2043 IDirect3DRMMeshBuilder3Impl_GetNormals,
2044 IDirect3DRMMeshBuilder3Impl_GetNormalCount
2047 HRESULT Direct3DRMMeshBuilder_create(REFIID riid, IUnknown** ppObj)
2049 IDirect3DRMMeshBuilderImpl* object;
2051 TRACE("(%p)\n", ppObj);
2053 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMMeshBuilderImpl));
2054 if (!object)
2056 ERR("Out of memory\n");
2057 return E_OUTOFMEMORY;
2060 object->IDirect3DRMMeshBuilder2_iface.lpVtbl = &Direct3DRMMeshBuilder2_Vtbl;
2061 object->IDirect3DRMMeshBuilder3_iface.lpVtbl = &Direct3DRMMeshBuilder3_Vtbl;
2062 object->ref = 1;
2064 if (IsEqualGUID(riid, &IID_IDirect3DRMMeshBuilder3))
2065 *ppObj = (IUnknown*)&object->IDirect3DRMMeshBuilder3_iface;
2066 else
2067 *ppObj = (IUnknown*)&object->IDirect3DRMMeshBuilder2_iface;
2069 return S_OK;
2072 /*** IUnknown methods ***/
2073 static HRESULT WINAPI IDirect3DRMMeshImpl_QueryInterface(IDirect3DRMMesh* iface,
2074 REFIID riid, void** ppvObject)
2076 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2078 TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppvObject);
2080 *ppvObject = NULL;
2082 if (IsEqualGUID(riid, &IID_IUnknown) ||
2083 IsEqualGUID(riid, &IID_IDirect3DRMMesh))
2085 *ppvObject = &This->IDirect3DRMMesh_iface;
2087 else
2089 FIXME("interface %s not implemented\n", debugstr_guid(riid));
2090 return E_NOINTERFACE;
2093 IDirect3DRMMesh_AddRef(iface);
2094 return S_OK;
2097 static ULONG WINAPI IDirect3DRMMeshImpl_AddRef(IDirect3DRMMesh* iface)
2099 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2100 ULONG ref = InterlockedIncrement(&This->ref);
2102 TRACE("(%p): AddRef from %d\n", This, ref - 1);
2104 return ref;
2107 static ULONG WINAPI IDirect3DRMMeshImpl_Release(IDirect3DRMMesh* iface)
2109 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2110 ULONG ref = InterlockedDecrement(&This->ref);
2112 TRACE("(%p): ReleaseRef to %d\n", This, ref);
2114 if (!ref)
2115 HeapFree(GetProcessHeap(), 0, This);
2117 return ref;
2120 /*** IDirect3DRMObject methods ***/
2121 static HRESULT WINAPI IDirect3DRMMeshImpl_Clone(IDirect3DRMMesh* iface,
2122 LPUNKNOWN pUnkOuter, REFIID riid,
2123 LPVOID *ppvObj)
2125 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2127 FIXME("(%p)->(%p,%s,%p): stub\n", This, pUnkOuter, debugstr_guid(riid), ppvObj);
2129 return E_NOTIMPL;
2132 static HRESULT WINAPI IDirect3DRMMeshImpl_AddDestroyCallback(IDirect3DRMMesh* iface,
2133 D3DRMOBJECTCALLBACK cb,
2134 LPVOID argument)
2136 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2138 FIXME("(%p)->(%p,%p): stub\n", This, cb, argument);
2140 return E_NOTIMPL;
2143 static HRESULT WINAPI IDirect3DRMMeshImpl_DeleteDestroyCallback(IDirect3DRMMesh* iface,
2144 D3DRMOBJECTCALLBACK cb,
2145 LPVOID argument)
2147 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2149 FIXME("(%p)->(%p,%p): stub\n", This, cb, argument);
2151 return E_NOTIMPL;
2154 static HRESULT WINAPI IDirect3DRMMeshImpl_SetAppData(IDirect3DRMMesh* iface,
2155 DWORD data)
2157 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2159 FIXME("(%p)->(%u): stub\n", This, data);
2161 return E_NOTIMPL;
2164 static DWORD WINAPI IDirect3DRMMeshImpl_GetAppData(IDirect3DRMMesh* iface)
2166 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2168 FIXME("(%p)->(): stub\n", This);
2170 return 0;
2173 static HRESULT WINAPI IDirect3DRMMeshImpl_SetName(IDirect3DRMMesh* iface,
2174 LPCSTR pName)
2176 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2178 FIXME("(%p)->(%s): stub\n", This, pName);
2180 return E_NOTIMPL;
2183 static HRESULT WINAPI IDirect3DRMMeshImpl_GetName(IDirect3DRMMesh* iface,
2184 LPDWORD lpdwSize, LPSTR lpName)
2186 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2188 FIXME("(%p)->(%p,%p): stub\n", This, lpdwSize, lpName);
2190 return E_NOTIMPL;
2193 static HRESULT WINAPI IDirect3DRMMeshImpl_GetClassName(IDirect3DRMMesh* iface,
2194 LPDWORD lpdwSize, LPSTR lpName)
2196 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2198 FIXME("(%p)->(%p,%p): stub\n", This, lpdwSize, lpName);
2200 return E_NOTIMPL;
2203 /*** IDirect3DRMMesh methods ***/
2204 static HRESULT WINAPI IDirect3DRMMeshImpl_Scale(IDirect3DRMMesh* iface,
2205 D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
2207 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2209 FIXME("(%p)->(%f,%f,%f): stub\n", This, sx, sy,sz);
2211 return E_NOTIMPL;
2214 static HRESULT WINAPI IDirect3DRMMeshImpl_Translate(IDirect3DRMMesh* iface,
2215 D3DVALUE tx, D3DVALUE ty, D3DVALUE tz)
2217 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2219 FIXME("(%p)->(%f,%f,%f): stub\n", This, tx, ty,tz);
2221 return E_NOTIMPL;
2224 static HRESULT WINAPI IDirect3DRMMeshImpl_GetBox(IDirect3DRMMesh* iface,
2225 D3DRMBOX * box)
2227 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2229 FIXME("(%p)->(%p): stub\n", This, box);
2231 return E_NOTIMPL;
2234 static HRESULT WINAPI IDirect3DRMMeshImpl_AddGroup(IDirect3DRMMesh* iface,
2235 unsigned vCount, unsigned fCount, unsigned vPerFace,
2236 unsigned *fData, D3DRMGROUPINDEX *returnId)
2238 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2240 FIXME("(%p)->(%u,%u,%u,%p,%p): stub\n", This, vCount, fCount, vPerFace, fData, returnId);
2242 return E_NOTIMPL;
2245 static HRESULT WINAPI IDirect3DRMMeshImpl_SetVertices(IDirect3DRMMesh* iface,
2246 D3DRMGROUPINDEX id, unsigned index, unsigned count,
2247 D3DRMVERTEX *values)
2249 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2251 FIXME("(%p)->(%u,%u,%u,%p): stub\n", This, id, index, count, values);
2253 return E_NOTIMPL;
2256 static HRESULT WINAPI IDirect3DRMMeshImpl_SetGroupColor(IDirect3DRMMesh* iface,
2257 D3DRMGROUPINDEX id, D3DCOLOR value)
2259 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2261 FIXME("(%p)->(%u,%x): stub\n", This, id, value);
2263 return E_NOTIMPL;
2266 static HRESULT WINAPI IDirect3DRMMeshImpl_SetGroupColorRGB(IDirect3DRMMesh* iface,
2267 D3DRMGROUPINDEX id, D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2269 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2271 FIXME("(%p)->(%u,%f,%f,%f): stub\n", This, id, red, green, blue);
2273 return E_NOTIMPL;
2276 static HRESULT WINAPI IDirect3DRMMeshImpl_SetGroupMapping(IDirect3DRMMesh* iface,
2277 D3DRMGROUPINDEX id, D3DRMMAPPING value)
2279 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2281 FIXME("(%p)->(%u,%u): stub\n", This, id, value);
2283 return E_NOTIMPL;
2286 static HRESULT WINAPI IDirect3DRMMeshImpl_SetGroupQuality(IDirect3DRMMesh* iface,
2287 D3DRMGROUPINDEX id, D3DRMRENDERQUALITY value)
2289 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2291 FIXME("(%p)->(%u,%u): stub\n", This, id, value);
2293 return E_NOTIMPL;
2296 static HRESULT WINAPI IDirect3DRMMeshImpl_SetGroupMaterial(IDirect3DRMMesh* iface,
2297 D3DRMGROUPINDEX id, LPDIRECT3DRMMATERIAL value)
2299 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2301 FIXME("(%p)->(%u,%p): stub\n", This, id, value);
2303 return E_NOTIMPL;
2306 static HRESULT WINAPI IDirect3DRMMeshImpl_SetGroupTexture(IDirect3DRMMesh* iface,
2307 D3DRMGROUPINDEX id, LPDIRECT3DRMTEXTURE value)
2309 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2311 FIXME("(%p)->(%u,%p): stub\n", This, id, value);
2313 return E_NOTIMPL;
2316 static DWORD WINAPI IDirect3DRMMeshImpl_GetGroupCount(IDirect3DRMMesh* iface)
2318 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2320 FIXME("(%p)->(): stub\n", This);
2322 return 0;
2325 static HRESULT WINAPI IDirect3DRMMeshImpl_GetGroup(IDirect3DRMMesh* iface,
2326 D3DRMGROUPINDEX id, unsigned *vCount, unsigned *fCount, unsigned *vPerFace,
2327 DWORD *fDataSize, unsigned *fData)
2329 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2331 FIXME("(%p)->(%u,%p,%p,%p,%p,%p): stub\n", This, id, vCount, fCount, vPerFace, fDataSize, fData);
2333 return E_NOTIMPL;
2336 static HRESULT WINAPI IDirect3DRMMeshImpl_GetVertices(IDirect3DRMMesh* iface,
2337 D3DRMGROUPINDEX id, DWORD index, DWORD count, D3DRMVERTEX *returnPtr)
2339 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2341 FIXME("(%p)->(%u,%u,%u,%p): stub\n", This, id, index, count, returnPtr);
2343 return E_NOTIMPL;
2346 static D3DCOLOR WINAPI IDirect3DRMMeshImpl_GetGroupColor(IDirect3DRMMesh* iface, D3DRMGROUPINDEX id)
2348 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2350 FIXME("(%p)->(%u): stub\n", This, id);
2352 return 0;
2355 static D3DRMMAPPING WINAPI IDirect3DRMMeshImpl_GetGroupMapping(IDirect3DRMMesh* iface, D3DRMGROUPINDEX id)
2357 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2359 FIXME("(%p)->(%u): stub\n", This, id);
2361 return 0;
2363 static D3DRMRENDERQUALITY WINAPI IDirect3DRMMeshImpl_GetGroupQuality(IDirect3DRMMesh* iface, D3DRMGROUPINDEX id)
2365 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2367 FIXME("(%p)->(%u): stub\n", This, id);
2369 return 0;
2372 static HRESULT WINAPI IDirect3DRMMeshImpl_GetGroupMaterial(IDirect3DRMMesh* iface,
2373 D3DRMGROUPINDEX id, LPDIRECT3DRMMATERIAL *returnPtr)
2375 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2377 FIXME("(%p)->(%u,%p): stub\n", This, id, returnPtr);
2379 return E_NOTIMPL;
2382 static HRESULT WINAPI IDirect3DRMMeshImpl_GetGroupTexture(IDirect3DRMMesh* iface,
2383 D3DRMGROUPINDEX id, LPDIRECT3DRMTEXTURE *returnPtr)
2385 IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
2387 FIXME("(%p)->(%u,%p): stub\n", This, id, returnPtr);
2389 return E_NOTIMPL;
2392 static const struct IDirect3DRMMeshVtbl Direct3DRMMesh_Vtbl =
2394 /*** IUnknown methods ***/
2395 IDirect3DRMMeshImpl_QueryInterface,
2396 IDirect3DRMMeshImpl_AddRef,
2397 IDirect3DRMMeshImpl_Release,
2398 /*** IDirect3DRMObject methods ***/
2399 IDirect3DRMMeshImpl_Clone,
2400 IDirect3DRMMeshImpl_AddDestroyCallback,
2401 IDirect3DRMMeshImpl_DeleteDestroyCallback,
2402 IDirect3DRMMeshImpl_SetAppData,
2403 IDirect3DRMMeshImpl_GetAppData,
2404 IDirect3DRMMeshImpl_SetName,
2405 IDirect3DRMMeshImpl_GetName,
2406 IDirect3DRMMeshImpl_GetClassName,
2407 /*** IDirect3DRMMesh methods ***/
2408 IDirect3DRMMeshImpl_Scale,
2409 IDirect3DRMMeshImpl_Translate,
2410 IDirect3DRMMeshImpl_GetBox,
2411 IDirect3DRMMeshImpl_AddGroup,
2412 IDirect3DRMMeshImpl_SetVertices,
2413 IDirect3DRMMeshImpl_SetGroupColor,
2414 IDirect3DRMMeshImpl_SetGroupColorRGB,
2415 IDirect3DRMMeshImpl_SetGroupMapping,
2416 IDirect3DRMMeshImpl_SetGroupQuality,
2417 IDirect3DRMMeshImpl_SetGroupMaterial,
2418 IDirect3DRMMeshImpl_SetGroupTexture,
2419 IDirect3DRMMeshImpl_GetGroupCount,
2420 IDirect3DRMMeshImpl_GetGroup,
2421 IDirect3DRMMeshImpl_GetVertices,
2422 IDirect3DRMMeshImpl_GetGroupColor,
2423 IDirect3DRMMeshImpl_GetGroupMapping,
2424 IDirect3DRMMeshImpl_GetGroupQuality,
2425 IDirect3DRMMeshImpl_GetGroupMaterial,
2426 IDirect3DRMMeshImpl_GetGroupTexture
2429 static HRESULT Direct3DRMMesh_create(IDirect3DRMMesh** obj)
2431 IDirect3DRMMeshImpl* object;
2433 TRACE("(%p)\n", obj);
2435 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMMeshImpl));
2436 if (!object)
2438 ERR("Out of memory\n");
2439 return E_OUTOFMEMORY;
2442 object->IDirect3DRMMesh_iface.lpVtbl = &Direct3DRMMesh_Vtbl;
2443 object->ref = 1;
2445 *obj = &object->IDirect3DRMMesh_iface;
2447 return S_OK;