po: Update simplified Chinese translation.
[wine/multimedia.git] / dlls / d3drm / meshbuilder.c
blobcea7da0320ff86fe0dabd1a443bf36ed8d034117
1 /*
2 * Implementation of IDirect3DRMMeshBuilder2 Interface
4 * Copyright 2010 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 typedef struct {
36 D3DVALUE u;
37 D3DVALUE v;
38 } Coords2d;
40 typedef struct {
41 IDirect3DRMMeshBuilder2 IDirect3DRMMeshBuilder2_iface;
42 IDirect3DRMMeshBuilder3 IDirect3DRMMeshBuilder3_iface;
43 LONG ref;
44 DWORD nb_vertices;
45 D3DVECTOR* pVertices;
46 DWORD nb_normals;
47 D3DVECTOR* pNormals;
48 DWORD nb_faces;
49 DWORD face_data_size;
50 LPVOID pFaceData;
51 DWORD nb_coords2d;
52 Coords2d* pCoords2d;
53 } IDirect3DRMMeshBuilderImpl;
55 typedef struct {
56 WORD major;
57 WORD minor;
58 DWORD flags;
59 } Header;
61 static char templates[] = {
62 "xof 0302txt 0064"
63 "template Header"
64 "{"
65 "<3D82AB43-62DA-11CF-AB39-0020AF71E433>"
66 "WORD major;"
67 "WORD minor;"
68 "DWORD flags;"
69 "}"
70 "template Vector"
71 "{"
72 "<3D82AB5E-62DA-11CF-AB39-0020AF71E433>"
73 "FLOAT x;"
74 "FLOAT y;"
75 "FLOAT z;"
76 "}"
77 "template Coords2d"
78 "{"
79 "<F6F23F44-7686-11CF-8F52-0040333594A3>"
80 "FLOAT u;"
81 "FLOAT v;"
82 "}"
83 "template Matrix4x4"
84 "{"
85 "<F6F23F45-7686-11CF-8F52-0040333594A3>"
86 "array FLOAT matrix[16];"
87 "}"
88 "template ColorRGBA"
89 "{"
90 "<35FF44E0-6C7C-11CF-8F52-0040333594A3>"
91 "FLOAT red;"
92 "FLOAT green;"
93 "FLOAT blue;"
94 "FLOAT alpha;"
95 "}"
96 "template ColorRGB"
97 "{"
98 "<D3E16E81-7835-11CF-8F52-0040333594A3>"
99 "FLOAT red;"
100 "FLOAT green;"
101 "FLOAT blue;"
103 "template IndexedColor"
105 "<1630B820-7842-11CF-8F52-0040333594A3>"
106 "DWORD index;"
107 "ColorRGBA indexColor;"
109 "template Boolean"
111 "<537DA6A0-CA37-11D0-941C-0080C80CFA7B>"
112 "DWORD truefalse;"
114 "template Boolean2d"
116 "<4885AE63-78E8-11CF-8F52-0040333594A3>"
117 "Boolean u;"
118 "Boolean v;"
120 "template MaterialWrap"
122 "<4885AE60-78E8-11CF-8F52-0040333594A3>"
123 "Boolean u;"
124 "Boolean v;"
126 "template TextureFilename"
128 "<A42790E1-7810-11CF-8F52-0040333594A3>"
129 "STRING filename;"
131 "template Material"
133 "<3D82AB4D-62DA-11CF-AB39-0020AF71E433>"
134 "ColorRGBA faceColor;"
135 "FLOAT power;"
136 "ColorRGB specularColor;"
137 "ColorRGB emissiveColor;"
138 "[...]"
140 "template MeshFace"
142 "<3D82AB5F-62DA-11CF-AB39-0020AF71E433>"
143 "DWORD nFaceVertexIndices;"
144 "array DWORD faceVertexIndices[nFaceVertexIndices];"
146 "template MeshFaceWraps"
148 "<ED1EC5C0-C0A8-11D0-941C-0080C80CFA7B>"
149 "DWORD nFaceWrapValues;"
150 "array Boolean2d faceWrapValues[nFaceWrapValues];"
152 "template MeshTextureCoords"
154 "<F6F23F40-7686-11CF-8F52-0040333594A3>"
155 "DWORD nTextureCoords;"
156 "array Coords2d textureCoords[nTextureCoords];"
158 "template MeshMaterialList"
160 "<F6F23F42-7686-11CF-8F52-0040333594A3>"
161 "DWORD nMaterials;"
162 "DWORD nFaceIndexes;"
163 "array DWORD faceIndexes[nFaceIndexes];"
164 "[Material]"
166 "template MeshNormals"
168 "<F6F23F43-7686-11CF-8F52-0040333594A3>"
169 "DWORD nNormals;"
170 "array Vector normals[nNormals];"
171 "DWORD nFaceNormals;"
172 "array MeshFace faceNormals[nFaceNormals];"
174 "template MeshVertexColors"
176 "<1630B821-7842-11CF-8F52-0040333594A3>"
177 "DWORD nVertexColors;"
178 "array IndexedColor vertexColors[nVertexColors];"
180 "template Mesh"
182 "<3D82AB44-62DA-11CF-AB39-0020AF71E433>"
183 "DWORD nVertices;"
184 "array Vector vertices[nVertices];"
185 "DWORD nFaces;"
186 "array MeshFace faces[nFaces];"
187 "[...]"
189 "template FrameTransformMatrix"
191 "<F6F23F41-7686-11CF-8F52-0040333594A3>"
192 "Matrix4x4 frameMatrix;"
194 "template Frame"
196 "<3D82AB46-62DA-11CF-AB39-0020AF71E433>"
197 "[...]"
199 "template FloatKeys"
201 "<10DD46A9-775B-11CF-8F52-0040333594A3>"
202 "DWORD nValues;"
203 "array FLOAT values[nValues];"
205 "template TimedFloatKeys"
207 "<F406B180-7B3B-11CF-8F52-0040333594A3>"
208 "DWORD time;"
209 "FloatKeys tfkeys;"
211 "template AnimationKey"
213 "<10DD46A8-775B-11CF-8F52-0040333594A3>"
214 "DWORD keyType;"
215 "DWORD nKeys;"
216 "array TimedFloatKeys keys[nKeys];"
218 "template AnimationOptions"
220 "<E2BF56C0-840F-11CF-8F52-0040333594A3>"
221 "DWORD openclosed;"
222 "DWORD positionquality;"
224 "template Animation"
226 "<3D82AB4F-62DA-11CF-AB39-0020AF71E433>"
227 "[...]"
229 "template AnimationSet"
231 "<3D82AB50-62DA-11CF-AB39-0020AF71E433>"
232 "[Animation]"
234 "template InlineData"
236 "<3A23EEA0-94B1-11D0-AB39-0020AF71E433>"
237 "[BINARY]"
239 "template Url"
241 "<3A23EEA1-94B1-11D0-AB39-0020AF71E433>"
242 "DWORD nUrls;"
243 "array STRING urls[nUrls];"
245 "template ProgressiveMesh"
247 "<8A63C360-997D-11D0-941C-0080C80CFA7B>"
248 "[Url,InlineData]"
250 "template Guid"
252 "<A42790E0-7810-11CF-8F52-0040333594A3>"
253 "DWORD data1;"
254 "WORD data2;"
255 "WORD data3;"
256 "array UCHAR data4[8];"
258 "template StringProperty"
260 "<7F0F21E0-BFE1-11D1-82C0-00A0C9697271>"
261 "STRING key;"
262 "STRING value;"
264 "template PropertyBag"
266 "<7F0F21E1-BFE1-11D1-82C0-00A0C9697271>"
267 "[StringProperty]"
269 "template ExternalVisual"
271 "<98116AA0-BDBA-11D1-82C0-00A0C9697271>"
272 "Guid guidExternalVisual;"
273 "[...]"
275 "template RightHanded"
277 "<7F5D5EA0-D53A-11D1-82C0-00A0C9697271>"
278 "DWORD bRightHanded;"
282 static inline IDirect3DRMMeshBuilderImpl *impl_from_IDirect3DRMMeshBuilder2(IDirect3DRMMeshBuilder2 *iface)
284 return CONTAINING_RECORD(iface, IDirect3DRMMeshBuilderImpl, IDirect3DRMMeshBuilder2_iface);
287 static inline IDirect3DRMMeshBuilderImpl *impl_from_IDirect3DRMMeshBuilder3(IDirect3DRMMeshBuilder3 *iface)
289 return CONTAINING_RECORD(iface, IDirect3DRMMeshBuilderImpl, IDirect3DRMMeshBuilder3_iface);
292 /*** IUnknown methods ***/
293 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_QueryInterface(IDirect3DRMMeshBuilder2* iface,
294 REFIID riid, void** ppvObject)
296 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
298 TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppvObject);
300 *ppvObject = NULL;
302 if(IsEqualGUID(riid, &IID_IUnknown) ||
303 IsEqualGUID(riid, &IID_IDirect3DRMMeshBuilder) ||
304 IsEqualGUID(riid, &IID_IDirect3DRMMeshBuilder2))
306 *ppvObject = &This->IDirect3DRMMeshBuilder2_iface;
308 else if(IsEqualGUID(riid, &IID_IDirect3DRMMeshBuilder3))
310 *ppvObject = &This->IDirect3DRMMeshBuilder3_iface;
312 else
314 FIXME("interface %s not implemented\n", debugstr_guid(riid));
315 return E_NOINTERFACE;
318 IDirect3DRMMeshBuilder_AddRef(iface);
319 return S_OK;
322 static ULONG WINAPI IDirect3DRMMeshBuilder2Impl_AddRef(IDirect3DRMMeshBuilder2* iface)
324 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
326 TRACE("(%p)\n", This);
328 return InterlockedIncrement(&This->ref);
331 static ULONG WINAPI IDirect3DRMMeshBuilder2Impl_Release(IDirect3DRMMeshBuilder2* iface)
333 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
334 ULONG ref = InterlockedDecrement(&This->ref);
336 TRACE("(%p)\n", This);
338 if (!ref)
340 HeapFree(GetProcessHeap(), 0, This->pVertices);
341 HeapFree(GetProcessHeap(), 0, This->pNormals);
342 HeapFree(GetProcessHeap(), 0, This->pFaceData);
343 HeapFree(GetProcessHeap(), 0, This);
346 return ref;
349 /*** IDirect3DRMObject methods ***/
350 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_Clone(IDirect3DRMMeshBuilder2* iface,
351 LPUNKNOWN pUnkOuter, REFIID riid,
352 LPVOID *ppvObj)
354 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
356 FIXME("(%p)->(%p,%s,%p): stub\n", This, pUnkOuter, debugstr_guid(riid), ppvObj);
358 return E_NOTIMPL;
361 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_AddDestroyCallback(IDirect3DRMMeshBuilder2* iface,
362 D3DRMOBJECTCALLBACK cb,
363 LPVOID argument)
365 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
367 FIXME("(%p)->(%p,%p): stub\n", This, cb, argument);
369 return E_NOTIMPL;
372 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_DeleteDestroyCallback(IDirect3DRMMeshBuilder2* iface,
373 D3DRMOBJECTCALLBACK cb,
374 LPVOID argument)
376 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
378 FIXME("(%p)->(%p,%p): stub\n", This, cb, argument);
380 return E_NOTIMPL;
383 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetAppData(IDirect3DRMMeshBuilder2* iface,
384 DWORD data)
386 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
388 FIXME("(%p)->(%u): stub\n", This, data);
390 return E_NOTIMPL;
393 static DWORD WINAPI IDirect3DRMMeshBuilder2Impl_GetAppData(IDirect3DRMMeshBuilder2* iface)
395 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
397 FIXME("(%p)->(): stub\n", This);
399 return 0;
402 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetName(IDirect3DRMMeshBuilder2* iface,
403 LPCSTR pName)
405 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
407 FIXME("(%p)->(%s): stub\n", This, pName);
409 return E_NOTIMPL;
412 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetName(IDirect3DRMMeshBuilder2* iface,
413 LPDWORD lpdwSize, LPSTR lpName)
415 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
417 FIXME("(%p)->(%p,%p): stub\n", This, lpdwSize, lpName);
419 return E_NOTIMPL;
422 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetClassName(IDirect3DRMMeshBuilder2* iface,
423 LPDWORD lpdwSize, LPSTR lpName)
425 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
427 FIXME("(%p)->(%p,%p): stub\n", This, lpdwSize, lpName);
429 return E_NOTIMPL;
432 /*** IDirect3DRMMeshBuilder2 methods ***/
433 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_Load(IDirect3DRMMeshBuilder2* iface,
434 LPVOID filename, LPVOID name,
435 D3DRMLOADOPTIONS loadflags,
436 D3DRMLOADTEXTURECALLBACK cb, LPVOID arg)
438 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
440 TRACE("(%p)->(%p,%p,%x,%p,%p): partial stub\n", This, filename, name, loadflags, cb, arg);
442 return IDirect3DRMMeshBuilder3_Load(&This->IDirect3DRMMeshBuilder3_iface, filename, name,
443 loadflags, (D3DRMLOADTEXTURE3CALLBACK)cb, arg);
446 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_Save(IDirect3DRMMeshBuilder2* iface,
447 const char *filename, D3DRMXOFFORMAT format,
448 D3DRMSAVEOPTIONS save)
450 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
452 FIXME("(%p)->(%s,%d,%d): stub\n", This, filename, format, save);
454 return E_NOTIMPL;
457 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_Scale(IDirect3DRMMeshBuilder2* iface,
458 D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
460 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
462 FIXME("(%p)->(%f,%f,%f): stub\n", This, sx, sy, sz);
464 return E_NOTIMPL;
467 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_Translate(IDirect3DRMMeshBuilder2* iface,
468 D3DVALUE tx, D3DVALUE ty, D3DVALUE tz)
470 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
472 FIXME("(%p)->(%f,%f,%f): stub\n", This, tx, ty, tz);
474 return E_NOTIMPL;
477 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetColorSource(IDirect3DRMMeshBuilder2* iface,
478 D3DRMCOLORSOURCE color)
480 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
482 FIXME("(%p)->(%x): stub\n", This, color);
484 return E_NOTIMPL;
487 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetBox(IDirect3DRMMeshBuilder2* iface,
488 D3DRMBOX *pBox)
490 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
492 FIXME("(%p)->(%p): stub\n", This, pBox);
494 return E_NOTIMPL;
497 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GenerateNormals(IDirect3DRMMeshBuilder2* iface)
499 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
501 FIXME("(%p)->(): stub\n", This);
503 return E_NOTIMPL;
506 static D3DRMCOLORSOURCE WINAPI IDirect3DRMMeshBuilder2Impl_GetColorSource(IDirect3DRMMeshBuilder2* iface)
508 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
510 FIXME("(%p)->(): stub\n", This);
512 return E_NOTIMPL;
515 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_AddMesh(IDirect3DRMMeshBuilder2* iface,
516 LPDIRECT3DRMMESH pMesh)
518 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
520 FIXME("(%p)->(%p): stub\n", This, pMesh);
522 return E_NOTIMPL;
525 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_AddMeshBuilder(IDirect3DRMMeshBuilder2* iface,
526 LPDIRECT3DRMMESHBUILDER pMeshBuilder)
528 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
530 FIXME("(%p)->(%p): stub\n", This, pMeshBuilder);
532 return E_NOTIMPL;
535 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_AddFrame(IDirect3DRMMeshBuilder2* iface,
536 LPDIRECT3DRMFRAME pFrame)
538 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
540 FIXME("(%p)->(%p): stub\n", This, pFrame);
542 return E_NOTIMPL;
545 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_AddFace(IDirect3DRMMeshBuilder2* iface,
546 LPDIRECT3DRMFACE pFace)
548 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
550 FIXME("(%p)->(%p): stub\n", This, pFace);
552 return E_NOTIMPL;
555 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_AddFaces(IDirect3DRMMeshBuilder2* iface,
556 DWORD vcount, D3DVECTOR *vertices,
557 DWORD ncount, D3DVECTOR *normals,
558 DWORD *data,
559 LPDIRECT3DRMFACEARRAY* pFaceArray)
561 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
563 FIXME("(%p)->(%d,%p,%d,%p,%p,%p): stub\n", This, vcount, vertices, ncount, normals, data, pFaceArray);
565 return E_NOTIMPL;
568 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_ReserveSpace(IDirect3DRMMeshBuilder2* iface,
569 DWORD vertex_Count,
570 DWORD normal_count,
571 DWORD face_count)
573 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
575 FIXME("(%p)->(%d,%d,%d): stub\n", This, vertex_Count, normal_count, face_count);
577 return E_NOTIMPL;
580 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetColorRGB(IDirect3DRMMeshBuilder2* iface,
581 D3DVALUE red, D3DVALUE green,
582 D3DVALUE blue)
584 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
586 FIXME("(%p)->(%f,%f,%f): stub\n", This, red, green, blue);
588 return E_NOTIMPL;
591 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetColor(IDirect3DRMMeshBuilder2* iface,
592 D3DCOLOR color)
594 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
596 FIXME("(%p)->(%x): stub\n", This, color);
598 return E_NOTIMPL;
601 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetTexture(IDirect3DRMMeshBuilder2* iface,
602 LPDIRECT3DRMTEXTURE pTexture)
604 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
606 FIXME("(%p)->(%p): stub\n", This, pTexture);
608 return E_NOTIMPL;
611 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetMaterial(IDirect3DRMMeshBuilder2* iface,
612 LPDIRECT3DRMMATERIAL pMaterial)
614 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
616 FIXME("(%p)->(%p): stub\n", This, pMaterial);
618 return E_NOTIMPL;
621 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetTextureTopology(IDirect3DRMMeshBuilder2* iface,
622 BOOL wrap_u, BOOL wrap_v)
624 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
626 FIXME("(%p)->(%d,%d): stub\n", This, wrap_u, wrap_v);
628 return E_NOTIMPL;
631 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetQuality(IDirect3DRMMeshBuilder2* iface,
632 D3DRMRENDERQUALITY quality)
634 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
636 FIXME("(%p)->(%d): stub\n", This, quality);
638 return E_NOTIMPL;
641 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetPerspective(IDirect3DRMMeshBuilder2* iface,
642 BOOL enable)
644 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
646 FIXME("(%p)->(%d): stub\n", This, enable);
648 return E_NOTIMPL;
651 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetVertex(IDirect3DRMMeshBuilder2* iface,
652 DWORD index,
653 D3DVALUE x, D3DVALUE y, D3DVALUE z)
655 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
657 FIXME("(%p)->(%f,%f,%f): stub\n", This, x, y, z);
659 return E_NOTIMPL;
662 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetNormal(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_SetTextureCoordinates(IDirect3DRMMeshBuilder2* iface,
674 DWORD index,
675 D3DVALUE u, D3DVALUE v)
677 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
679 FIXME("(%p)->(%f,%f): stub\n", This, u, v);
681 return E_NOTIMPL;
684 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetVertexColor(IDirect3DRMMeshBuilder2* iface,
685 DWORD index, D3DCOLOR color)
687 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
689 FIXME("(%p)->(%d,%x): stub\n", This, index, color);
691 return E_NOTIMPL;
694 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetVertexColorRGB(IDirect3DRMMeshBuilder2* iface,
695 DWORD index, D3DVALUE red,
696 D3DVALUE green, D3DVALUE blue)
698 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
700 FIXME("(%p)->(%d,%f,%f,%f): stub\n", This, index, red, green, blue);
702 return E_NOTIMPL;
705 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetFaces(IDirect3DRMMeshBuilder2* iface,
706 LPDIRECT3DRMFACEARRAY* pFaceArray)
708 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
710 FIXME("(%p)->(%p): stub\n", This, pFaceArray);
712 return E_NOTIMPL;
715 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetVertices(IDirect3DRMMeshBuilder2* iface,
716 DWORD *vcount, D3DVECTOR *vertices,
717 DWORD *ncount, D3DVECTOR *normals,
718 DWORD *face_data_size,
719 DWORD *face_data)
721 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
723 TRACE("(%p)->(%p,%p,%p,%p,%p,%p)\n", This, vcount, vertices, ncount, normals, face_data_size, face_data);
725 if (vcount)
726 *vcount = This->nb_vertices;
727 if (vertices && This->nb_vertices)
728 memcpy(vertices, This->pVertices, This->nb_vertices * sizeof(D3DVECTOR));
729 if (ncount)
730 *ncount = This->nb_normals;
731 if (normals && This->nb_normals)
732 memcpy(normals, This->pNormals, This->nb_normals * sizeof(D3DVECTOR));
733 if (face_data_size)
734 *face_data_size = This->face_data_size;
735 if (face_data && This->face_data_size)
736 memcpy(face_data, This->pFaceData, This->face_data_size);
738 return D3DRM_OK;
741 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetTextureCoordinates(IDirect3DRMMeshBuilder2* iface,
742 DWORD index,
743 D3DVALUE *u, D3DVALUE *v)
745 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
747 TRACE("(%p)->(%d,%p,%p)\n", This, index, u, v);
749 return IDirect3DRMMeshBuilder3_GetTextureCoordinates(&This->IDirect3DRMMeshBuilder3_iface,
750 index, u, v);
753 static int WINAPI IDirect3DRMMeshBuilder2Impl_AddVertex(IDirect3DRMMeshBuilder2* iface,
754 D3DVALUE x, D3DVALUE y, D3DVALUE z)
756 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
758 FIXME("(%p)->(%f,%f,%f): stub\n", This, x, y, z);
760 return 0;
763 static int WINAPI IDirect3DRMMeshBuilder2Impl_AddNormal(IDirect3DRMMeshBuilder2* iface,
764 D3DVALUE x, D3DVALUE y, D3DVALUE z)
766 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
768 FIXME("(%p)->(%f,%f,%f): stub\n", This, x, y, z);
770 return 0;
773 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_CreateFace(IDirect3DRMMeshBuilder2* iface,
774 LPDIRECT3DRMFACE* ppFace)
776 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
778 FIXME("(%p)->(%p): stub\n", This, ppFace);
780 return E_NOTIMPL;
783 static D3DRMRENDERQUALITY WINAPI IDirect3DRMMeshBuilder2Impl_GetQuality(IDirect3DRMMeshBuilder2* iface)
785 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
787 FIXME("(%p)->(): stub\n", This);
789 return 0;
792 static BOOL WINAPI IDirect3DRMMeshBuilder2Impl_GetPerspective(IDirect3DRMMeshBuilder2* iface)
794 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
796 FIXME("(%p)->(): stub\n", This);
798 return FALSE;
801 static int WINAPI IDirect3DRMMeshBuilder2Impl_GetFaceCount(IDirect3DRMMeshBuilder2* iface)
803 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
805 TRACE("(%p)->()\n", This);
807 return This->nb_faces;
810 static int WINAPI IDirect3DRMMeshBuilder2Impl_GetVertexCount(IDirect3DRMMeshBuilder2* iface)
812 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
814 TRACE("(%p)->()\n", This);
816 return This->nb_vertices;
819 static D3DCOLOR WINAPI IDirect3DRMMeshBuilder2Impl_GetVertexColor(IDirect3DRMMeshBuilder2* iface,
820 DWORD index)
822 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
824 FIXME("(%p)->(%d): stub\n", This, index);
826 return 0;
829 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_CreateMesh(IDirect3DRMMeshBuilder2* iface,
830 LPDIRECT3DRMMESH* ppMesh)
832 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
834 FIXME("(%p)->(%p): stub\n", This, ppMesh);
836 return E_NOTIMPL;
839 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GenerateNormals2(IDirect3DRMMeshBuilder2* iface,
840 D3DVALUE crease, DWORD dwFlags)
842 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
844 FIXME("(%p)->(%f,%u): stub\n", This, crease, dwFlags);
846 return E_NOTIMPL;
849 static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GetFace(IDirect3DRMMeshBuilder2* iface,
850 DWORD index, LPDIRECT3DRMFACE* ppFace)
852 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
854 FIXME("(%p)->(%u,%p): stub\n", This, index, ppFace);
856 return E_NOTIMPL;
859 static const struct IDirect3DRMMeshBuilder2Vtbl Direct3DRMMeshBuilder2_Vtbl =
861 /*** IUnknown methods ***/
862 IDirect3DRMMeshBuilder2Impl_QueryInterface,
863 IDirect3DRMMeshBuilder2Impl_AddRef,
864 IDirect3DRMMeshBuilder2Impl_Release,
865 /*** IDirect3DRMObject methods ***/
866 IDirect3DRMMeshBuilder2Impl_Clone,
867 IDirect3DRMMeshBuilder2Impl_AddDestroyCallback,
868 IDirect3DRMMeshBuilder2Impl_DeleteDestroyCallback,
869 IDirect3DRMMeshBuilder2Impl_SetAppData,
870 IDirect3DRMMeshBuilder2Impl_GetAppData,
871 IDirect3DRMMeshBuilder2Impl_SetName,
872 IDirect3DRMMeshBuilder2Impl_GetName,
873 IDirect3DRMMeshBuilder2Impl_GetClassName,
874 /*** IDirect3DRMMeshBuilder methods ***/
875 IDirect3DRMMeshBuilder2Impl_Load,
876 IDirect3DRMMeshBuilder2Impl_Save,
877 IDirect3DRMMeshBuilder2Impl_Scale,
878 IDirect3DRMMeshBuilder2Impl_Translate,
879 IDirect3DRMMeshBuilder2Impl_SetColorSource,
880 IDirect3DRMMeshBuilder2Impl_GetBox,
881 IDirect3DRMMeshBuilder2Impl_GenerateNormals,
882 IDirect3DRMMeshBuilder2Impl_GetColorSource,
883 IDirect3DRMMeshBuilder2Impl_AddMesh,
884 IDirect3DRMMeshBuilder2Impl_AddMeshBuilder,
885 IDirect3DRMMeshBuilder2Impl_AddFrame,
886 IDirect3DRMMeshBuilder2Impl_AddFace,
887 IDirect3DRMMeshBuilder2Impl_AddFaces,
888 IDirect3DRMMeshBuilder2Impl_ReserveSpace,
889 IDirect3DRMMeshBuilder2Impl_SetColorRGB,
890 IDirect3DRMMeshBuilder2Impl_SetColor,
891 IDirect3DRMMeshBuilder2Impl_SetTexture,
892 IDirect3DRMMeshBuilder2Impl_SetMaterial,
893 IDirect3DRMMeshBuilder2Impl_SetTextureTopology,
894 IDirect3DRMMeshBuilder2Impl_SetQuality,
895 IDirect3DRMMeshBuilder2Impl_SetPerspective,
896 IDirect3DRMMeshBuilder2Impl_SetVertex,
897 IDirect3DRMMeshBuilder2Impl_SetNormal,
898 IDirect3DRMMeshBuilder2Impl_SetTextureCoordinates,
899 IDirect3DRMMeshBuilder2Impl_SetVertexColor,
900 IDirect3DRMMeshBuilder2Impl_SetVertexColorRGB,
901 IDirect3DRMMeshBuilder2Impl_GetFaces,
902 IDirect3DRMMeshBuilder2Impl_GetVertices,
903 IDirect3DRMMeshBuilder2Impl_GetTextureCoordinates,
904 IDirect3DRMMeshBuilder2Impl_AddVertex,
905 IDirect3DRMMeshBuilder2Impl_AddNormal,
906 IDirect3DRMMeshBuilder2Impl_CreateFace,
907 IDirect3DRMMeshBuilder2Impl_GetQuality,
908 IDirect3DRMMeshBuilder2Impl_GetPerspective,
909 IDirect3DRMMeshBuilder2Impl_GetFaceCount,
910 IDirect3DRMMeshBuilder2Impl_GetVertexCount,
911 IDirect3DRMMeshBuilder2Impl_GetVertexColor,
912 IDirect3DRMMeshBuilder2Impl_CreateMesh,
913 /*** IDirect3DRMMeshBuilder2 methods ***/
914 IDirect3DRMMeshBuilder2Impl_GenerateNormals2,
915 IDirect3DRMMeshBuilder2Impl_GetFace
919 /*** IUnknown methods ***/
920 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_QueryInterface(IDirect3DRMMeshBuilder3* iface,
921 REFIID riid, void** ppvObject)
923 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
924 return IDirect3DRMMeshBuilder2_QueryInterface(&This->IDirect3DRMMeshBuilder2_iface, riid, ppvObject);
927 static ULONG WINAPI IDirect3DRMMeshBuilder3Impl_AddRef(IDirect3DRMMeshBuilder3* iface)
929 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
930 return IDirect3DRMMeshBuilder2_AddRef(&This->IDirect3DRMMeshBuilder2_iface);
933 static ULONG WINAPI IDirect3DRMMeshBuilder3Impl_Release(IDirect3DRMMeshBuilder3* iface)
935 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
936 return IDirect3DRMMeshBuilder2_Release(&This->IDirect3DRMMeshBuilder2_iface);
939 /*** IDirect3DRMObject methods ***/
940 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Clone(IDirect3DRMMeshBuilder3* iface,
941 LPUNKNOWN pUnkOuter, REFIID riid,
942 LPVOID *ppvObj)
944 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
946 FIXME("(%p)->(%p,%s,%p): stub\n", This, pUnkOuter, debugstr_guid(riid), ppvObj);
948 return E_NOTIMPL;
951 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_AddDestroyCallback(IDirect3DRMMeshBuilder3* iface,
952 D3DRMOBJECTCALLBACK cb,
953 LPVOID argument)
955 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
957 FIXME("(%p)->(%p,%p): stub\n", This, cb, argument);
959 return E_NOTIMPL;
962 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_DeleteDestroyCallback(IDirect3DRMMeshBuilder3* iface,
963 D3DRMOBJECTCALLBACK cb,
964 LPVOID argument)
966 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
968 FIXME("(%p)->(%p,%p): stub\n", This, cb, argument);
970 return E_NOTIMPL;
973 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetAppData(IDirect3DRMMeshBuilder3* iface,
974 DWORD data)
976 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
978 FIXME("(%p)->(%u): stub\n", This, data);
980 return E_NOTIMPL;
983 static DWORD WINAPI IDirect3DRMMeshBuilder3Impl_GetAppData(IDirect3DRMMeshBuilder3* iface)
985 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
987 FIXME("(%p)->(): stub\n", This);
989 return 0;
992 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetName(IDirect3DRMMeshBuilder3* iface,
993 LPCSTR pName)
995 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
997 FIXME("(%p)->(%s): stub\n", This, pName);
999 return E_NOTIMPL;
1002 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetName(IDirect3DRMMeshBuilder3* iface,
1003 LPDWORD lpdwSize, LPSTR lpName)
1005 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1007 FIXME("(%p)->(%p,%p): stub\n", This, lpdwSize, lpName);
1009 return E_NOTIMPL;
1012 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetClassName(IDirect3DRMMeshBuilder3* iface,
1013 LPDWORD lpdwSize, LPSTR lpName)
1015 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1017 FIXME("(%p)->(%p,%p): stub\n", This, lpdwSize, lpName);
1019 return E_NOTIMPL;
1022 /*** IDirect3DRMMeshBuilder3 methods ***/
1023 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Load(IDirect3DRMMeshBuilder3* iface,
1024 LPVOID filename, LPVOID name,
1025 D3DRMLOADOPTIONS loadflags,
1026 D3DRMLOADTEXTURE3CALLBACK cb, LPVOID arg)
1028 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1029 DXFILELOADOPTIONS load_options;
1030 LPDIRECTXFILE pDXFile = NULL;
1031 LPDIRECTXFILEENUMOBJECT pEnumObject = NULL;
1032 LPDIRECTXFILEDATA pData = NULL;
1033 LPDIRECTXFILEOBJECT pObject = NULL;
1034 LPDIRECTXFILEDATA pData2 = NULL;
1035 const GUID* pGuid;
1036 DWORD size;
1037 Header* pHeader;
1038 LPBYTE ptr;
1039 HRESULT hr;
1040 HRESULT ret = D3DRMERR_BADOBJECT;
1042 FIXME("(%p)->(%p,%p,%x,%p,%p): partial stub\n", This, filename, name, loadflags, cb, arg);
1044 /* First free allocated buffers of previous mesh data */
1045 HeapFree(GetProcessHeap(), 0, This->pVertices);
1046 This->pVertices = NULL;
1047 HeapFree(GetProcessHeap(), 0, This->pNormals);
1048 This->pNormals = NULL;
1049 HeapFree(GetProcessHeap(), 0, This->pFaceData);
1050 This->pFaceData = NULL;
1051 HeapFree(GetProcessHeap(), 0, This->pCoords2d);
1052 This->pCoords2d = NULL;
1054 if (loadflags == D3DRMLOAD_FROMMEMORY)
1056 load_options = DXFILELOAD_FROMMEMORY;
1058 else
1060 FIXME("Load options %d not supported yet\n", loadflags);
1061 return E_NOTIMPL;
1064 hr = DirectXFileCreate(&pDXFile);
1065 if (hr != DXFILE_OK)
1066 goto end;
1068 hr = IDirectXFile_RegisterTemplates(pDXFile, templates, strlen(templates));
1069 if (hr != DXFILE_OK)
1070 goto end;
1072 hr = IDirectXFile_CreateEnumObject(pDXFile, filename, load_options, &pEnumObject);
1073 if (hr != DXFILE_OK)
1074 goto end;
1076 hr = IDirectXFileEnumObject_GetNextDataObject(pEnumObject, &pData);
1077 if (hr != DXFILE_OK)
1078 goto end;
1080 hr = IDirectXFileData_GetType(pData, &pGuid);
1081 if (hr != DXFILE_OK)
1082 goto end;
1084 TRACE("Found object type whose GUID = %s\n", debugstr_guid(pGuid));
1086 if (!IsEqualGUID(pGuid, &TID_DXFILEHeader))
1088 ret = D3DRMERR_BADFILE;
1089 goto end;
1092 hr = IDirectXFileData_GetData(pData, NULL, &size, (void**)&pHeader);
1093 if ((hr != DXFILE_OK) || (size != sizeof(Header)))
1094 goto end;
1096 TRACE("Version is %d %d %d\n", pHeader->major, pHeader->minor, pHeader->flags);
1098 /* Version must be 1.0.x */
1099 if ((pHeader->major != 1) || (pHeader->minor != 0))
1101 ret = D3DRMERR_BADFILE;
1102 goto end;
1105 IDirectXFileData_Release(pData);
1106 pData = NULL;
1108 hr = IDirectXFileEnumObject_GetNextDataObject(pEnumObject, &pData);
1109 if (hr != DXFILE_OK)
1111 ret = D3DRMERR_NOTFOUND;
1112 goto end;
1115 hr = IDirectXFileData_GetType(pData, &pGuid);
1116 if (hr != DXFILE_OK)
1117 goto end;
1119 TRACE("Found object type whose GUID = %s\n", debugstr_guid(pGuid));
1121 if (!IsEqualGUID(pGuid, &TID_D3DRMMesh))
1123 ret = D3DRMERR_NOTFOUND;
1124 goto end;
1127 hr = IDirectXFileData_GetData(pData, NULL, &size, (void**)&ptr);
1128 if (hr != DXFILE_OK)
1129 goto end;
1131 This->nb_vertices = *(DWORD*)ptr;
1132 This->nb_faces = *(DWORD*)(ptr + sizeof(DWORD) + This->nb_vertices * sizeof(D3DVECTOR));
1133 This->face_data_size = size - sizeof(DWORD) - This->nb_vertices * sizeof(D3DVECTOR) - sizeof(DWORD);
1135 TRACE("Mesh: nb_vertices = %d, nb_faces = %d, face_data_size = %d\n", This->nb_vertices, This->nb_faces, This->face_data_size);
1137 This->pVertices = HeapAlloc(GetProcessHeap(), 0, This->nb_vertices * sizeof(D3DVECTOR));
1138 memcpy(This->pVertices, ptr + sizeof(DWORD), This->nb_vertices * sizeof(D3DVECTOR));
1140 This->pFaceData = HeapAlloc(GetProcessHeap(), 0, This->face_data_size);
1141 memcpy(This->pFaceData, ptr + sizeof(DWORD) + This->nb_vertices * sizeof(D3DVECTOR) + sizeof(DWORD), This->face_data_size);
1143 while (1)
1145 hr = IDirectXFileData_GetNextObject(pData, &pObject);
1146 if (hr == DXFILEERR_NOMOREOBJECTS)
1148 FIXME("no more object\n");
1149 break;
1151 if (hr != DXFILE_OK)
1152 goto end;
1154 hr = IDirectXFileObject_QueryInterface(pObject, &IID_IDirectXFileData, (void**)&pData2);
1155 IDirectXFileObject_Release(pObject);
1156 if (hr != DXFILE_OK)
1157 goto end;
1159 hr = IDirectXFileData_GetType(pData2, &pGuid);
1160 if (hr != DXFILE_OK)
1162 IDirectXFileData_Release(pData2);
1163 goto end;
1166 FIXME("Found object type whose GUID = %s\n", debugstr_guid(pGuid));
1168 if (!IsEqualGUID(pGuid, &TID_D3DRMMeshNormals))
1170 DWORD tmp;
1172 hr = IDirectXFileData_GetData(pData, NULL, &size, (void**)&ptr);
1173 if (hr != DXFILE_OK)
1174 goto end;
1176 This->nb_normals = *(DWORD*)ptr;
1177 tmp = *(DWORD*)(ptr + sizeof(DWORD) + This->nb_normals * sizeof(D3DVECTOR));
1179 FIXME("MeshNormals: nb_normals = %d, nb_faces_normals = %d\n", This->nb_normals, tmp);
1181 This->pNormals = HeapAlloc(GetProcessHeap(), 0, This->nb_normals * sizeof(D3DVECTOR));
1182 memcpy(This->pNormals, ptr + sizeof(DWORD), This->nb_normals * sizeof(D3DVECTOR));
1184 else if(!IsEqualGUID(pGuid, &TID_D3DRMMeshTextureCoords))
1186 hr = IDirectXFileData_GetData(pData, NULL, &size, (void**)&ptr);
1187 if (hr != DXFILE_OK)
1188 goto end;
1190 This->nb_coords2d = *(DWORD*)ptr;
1192 FIXME("MeshTextureCoords: nb_coords2d = %d\n", This->nb_coords2d);
1194 This->pCoords2d = HeapAlloc(GetProcessHeap(), 0, This->nb_coords2d * sizeof(Coords2d));
1195 memcpy(This->pCoords2d, ptr + sizeof(DWORD), This->nb_coords2d * sizeof(Coords2d));
1198 else if(!IsEqualGUID(pGuid, &TID_D3DRMMeshMaterialList))
1200 FIXME("MeshMaterialList not supported yet, ignoring...\n");
1202 else
1204 FIXME("Unknown GUID %s, ignoring...\n", debugstr_guid(pGuid));
1207 IDirectXFileData_Release(pData2);
1210 ret = D3DRM_OK;
1212 end:
1213 if (pData)
1214 IDirectXFileData_Release(pData);
1215 if (pEnumObject)
1216 IDirectXFileEnumObject_Release(pEnumObject);
1217 if (pDXFile)
1218 IDirectXFile_Release(pDXFile);
1220 if (ret != D3DRM_OK)
1222 /* Clean mesh data */
1223 This->nb_vertices = 0;
1224 This->nb_normals = 0;
1225 This->nb_faces = 0;
1226 This->face_data_size = 0;
1227 This->nb_coords2d = 0;
1228 HeapFree(GetProcessHeap(), 0, This->pVertices);
1229 This->pVertices = NULL;
1230 HeapFree(GetProcessHeap(), 0, This->pNormals);
1231 This->pNormals = NULL;
1232 HeapFree(GetProcessHeap(), 0, This->pFaceData);
1233 This->pFaceData = NULL;
1234 HeapFree(GetProcessHeap(), 0, This->pCoords2d);
1235 This->pCoords2d = NULL;
1238 return ret;
1241 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Save(IDirect3DRMMeshBuilder3* iface,
1242 const char* filename, D3DRMXOFFORMAT format,
1243 D3DRMSAVEOPTIONS save)
1245 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1247 FIXME("(%p)->(%s,%d,%d): stub\n", This, filename, format, save);
1249 return E_NOTIMPL;
1252 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Scale(IDirect3DRMMeshBuilder3* iface,
1253 D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1255 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1257 FIXME("(%p)->(%f,%f,%f): stub\n", This, sx, sy, sz);
1259 return E_NOTIMPL;
1262 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Translate(IDirect3DRMMeshBuilder3* iface,
1263 D3DVALUE tx, D3DVALUE ty, D3DVALUE tz)
1265 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1267 FIXME("(%p)->(%f,%f,%f): stub\n", This, tx, ty, tz);
1269 return E_NOTIMPL;
1272 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetColorSource(IDirect3DRMMeshBuilder3* iface,
1273 D3DRMCOLORSOURCE color)
1275 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1277 FIXME("(%p)->(%x): stub\n", This, color);
1279 return E_NOTIMPL;
1282 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetBox(IDirect3DRMMeshBuilder3* iface,
1283 D3DRMBOX* box)
1285 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1287 FIXME("(%p)->(%p): stub\n", This, box);
1289 return E_NOTIMPL;
1292 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GenerateNormals(IDirect3DRMMeshBuilder3* iface,
1293 D3DVALUE crease, DWORD flags)
1295 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1297 FIXME("(%p)->(%f,%u): stub\n", This, crease, flags);
1299 return E_NOTIMPL;
1302 static D3DRMCOLORSOURCE WINAPI IDirect3DRMMeshBuilder3Impl_GetColorSource(IDirect3DRMMeshBuilder3* iface)
1304 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1306 FIXME("(%p)->(): stub\n", This);
1308 return E_NOTIMPL;
1311 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_AddMesh(IDirect3DRMMeshBuilder3* iface,
1312 LPDIRECT3DRMMESH Mesh)
1314 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1316 FIXME("(%p)->(%p): stub\n", This, Mesh);
1318 return E_NOTIMPL;
1321 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_AddMeshBuilder(IDirect3DRMMeshBuilder3* iface,
1322 LPDIRECT3DRMMESHBUILDER3 MeshBuilder,
1323 DWORD flags)
1325 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1327 FIXME("(%p)->(%p,%u): stub\n", This, MeshBuilder, flags);
1329 return E_NOTIMPL;
1332 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_AddFrame(IDirect3DRMMeshBuilder3* iface,
1333 LPDIRECT3DRMFRAME3 Frame)
1335 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1337 FIXME("(%p)->(%p): stub\n", This, Frame);
1339 return E_NOTIMPL;
1342 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_AddFace(IDirect3DRMMeshBuilder3* iface,
1343 LPDIRECT3DRMFACE2 Face)
1345 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1347 FIXME("(%p)->(%p): stub\n", This, Face);
1349 return E_NOTIMPL;
1352 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_AddFaces(IDirect3DRMMeshBuilder3* iface,
1353 DWORD vcount, D3DVECTOR* vertices,
1354 DWORD ncount, D3DVECTOR* normals,
1355 DWORD* data,
1356 LPDIRECT3DRMFACEARRAY* FaceArray)
1358 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1360 FIXME("(%p)->(%d,%p,%d,%p,%p,%p): stub\n", This, vcount, vertices, ncount,
1361 normals, data, FaceArray);
1363 return E_NOTIMPL;
1366 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_ReserveSpace(IDirect3DRMMeshBuilder3* iface,
1367 DWORD vertex_Count,
1368 DWORD normal_count,
1369 DWORD face_count)
1371 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1373 FIXME("(%p)->(%d,%d,%d): stub\n", This, vertex_Count, normal_count, face_count);
1375 return E_NOTIMPL;
1378 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetColorRGB(IDirect3DRMMeshBuilder3* iface,
1379 D3DVALUE red, D3DVALUE green,
1380 D3DVALUE blue)
1382 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1384 FIXME("(%p)->(%f,%f,%f): stub\n", This, red, green, blue);
1386 return E_NOTIMPL;
1389 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetColor(IDirect3DRMMeshBuilder3* iface,
1390 D3DCOLOR color)
1392 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1394 FIXME("(%p)->(%x): stub\n", This, color);
1396 return E_NOTIMPL;
1399 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetTexture(IDirect3DRMMeshBuilder3* iface,
1400 LPDIRECT3DRMTEXTURE3 texture)
1402 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1404 FIXME("(%p)->(%p): stub\n", This, texture);
1406 return E_NOTIMPL;
1409 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetMaterial(IDirect3DRMMeshBuilder3* iface,
1410 LPDIRECT3DRMMATERIAL2 material)
1412 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1414 FIXME("(%p)->(%p): stub\n", This, material);
1416 return E_NOTIMPL;
1419 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetTextureTopology(IDirect3DRMMeshBuilder3* iface,
1420 BOOL wrap_u, BOOL wrap_v)
1422 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1424 FIXME("(%p)->(%d,%d): stub\n", This, wrap_u, wrap_v);
1426 return E_NOTIMPL;
1429 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetQuality(IDirect3DRMMeshBuilder3* iface,
1430 D3DRMRENDERQUALITY quality)
1432 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1434 FIXME("(%p)->(%d): stub\n", This, quality);
1436 return E_NOTIMPL;
1439 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetPerspective(IDirect3DRMMeshBuilder3* iface,
1440 BOOL enable)
1442 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1444 FIXME("(%p)->(%d): stub\n", This, enable);
1446 return E_NOTIMPL;
1449 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetVertex(IDirect3DRMMeshBuilder3* iface,
1450 DWORD index,
1451 D3DVALUE x, D3DVALUE y, D3DVALUE z)
1453 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1455 FIXME("(%p)->(%f,%f,%f): stub\n", This, x, y, z);
1457 return E_NOTIMPL;
1460 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetNormal(IDirect3DRMMeshBuilder3* iface,
1461 DWORD index,
1462 D3DVALUE x, D3DVALUE y, D3DVALUE z)
1464 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1466 FIXME("(%p)->(%f,%f,%f): stub\n", This, x, y, z);
1468 return E_NOTIMPL;
1471 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetTextureCoordinates(IDirect3DRMMeshBuilder3* iface,
1472 DWORD index, D3DVALUE u,
1473 D3DVALUE v)
1475 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1477 FIXME("(%p)->(%f,%f): stub\n", This, u, v);
1479 return E_NOTIMPL;
1482 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetVertexColor(IDirect3DRMMeshBuilder3* iface,
1483 DWORD index, D3DCOLOR color)
1485 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1487 FIXME("(%p)->(%d,%x): stub\n", This, index, color);
1489 return E_NOTIMPL;
1492 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetVertexColorRGB(IDirect3DRMMeshBuilder3* iface,
1493 DWORD index,
1494 D3DVALUE red, D3DVALUE green,
1495 D3DVALUE blue)
1497 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1499 FIXME("(%p)->(%d,%f,%f,%f): stub\n", This, index, red, green, blue);
1501 return E_NOTIMPL;
1504 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetFaces(IDirect3DRMMeshBuilder3* iface,
1505 LPDIRECT3DRMFACEARRAY* FaceArray)
1507 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1509 FIXME("(%p)->(%p): stub\n", This, FaceArray);
1511 return E_NOTIMPL;
1514 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetGeometry(IDirect3DRMMeshBuilder3* iface,
1515 DWORD* vcount, D3DVECTOR* vertices,
1516 DWORD* ncount, D3DVECTOR* normals,
1517 DWORD* face_data_size,
1518 DWORD* face_data)
1520 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1522 FIXME("(%p)->(%p,%p,%p,%p,%p,%p): stub\n", This, vcount, vertices, ncount, normals,
1523 face_data_size, face_data);
1525 return E_NOTIMPL;
1528 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetTextureCoordinates(IDirect3DRMMeshBuilder3* iface,
1529 DWORD index, D3DVALUE* u,
1530 D3DVALUE* v)
1532 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1534 TRACE("(%p)->(%d,%p,%p)\n", This, index, u, v);
1536 if (index >= This->nb_coords2d)
1537 return D3DRMERR_NOTFOUND;
1539 *u = This->pCoords2d[index].u;
1540 *v = This->pCoords2d[index].v;
1542 return D3DRM_OK;
1546 static int WINAPI IDirect3DRMMeshBuilder3Impl_AddVertex(IDirect3DRMMeshBuilder3* iface,
1547 D3DVALUE x, D3DVALUE y, D3DVALUE z)
1549 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1551 FIXME("(%p)->(%f,%f,%f): stub\n", This, x, y, z);
1553 return 0;
1556 static int WINAPI IDirect3DRMMeshBuilder3Impl_AddNormal(IDirect3DRMMeshBuilder3* iface,
1557 D3DVALUE x, D3DVALUE y, D3DVALUE z)
1559 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1561 FIXME("(%p)->(%f,%f,%f): stub\n", This, x, y, z);
1563 return 0;
1566 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_CreateFace(IDirect3DRMMeshBuilder3* iface,
1567 LPDIRECT3DRMFACE2* Face)
1569 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1571 FIXME("(%p)->(%p): stub\n", This, Face);
1573 return E_NOTIMPL;
1576 static D3DRMRENDERQUALITY WINAPI IDirect3DRMMeshBuilder3Impl_GetQuality(IDirect3DRMMeshBuilder3* iface)
1578 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1580 FIXME("(%p)->(): stub\n", This);
1582 return 0;
1585 static BOOL WINAPI IDirect3DRMMeshBuilder3Impl_GetPerspective(IDirect3DRMMeshBuilder3* iface)
1587 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1589 FIXME("(%p)->(): stub\n", This);
1591 return FALSE;
1594 static int WINAPI IDirect3DRMMeshBuilder3Impl_GetFaceCount(IDirect3DRMMeshBuilder3* iface)
1596 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1598 TRACE("(%p)->()\n", This);
1600 return This->nb_faces;
1603 static int WINAPI IDirect3DRMMeshBuilder3Impl_GetVertexCount(IDirect3DRMMeshBuilder3* iface)
1605 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1607 TRACE("(%p)->()\n", This);
1609 return This->nb_vertices;
1612 static D3DCOLOR WINAPI IDirect3DRMMeshBuilder3Impl_GetVertexColor(IDirect3DRMMeshBuilder3* iface,
1613 DWORD index)
1615 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1617 FIXME("(%p)->(%d): stub\n", This, index);
1619 return 0;
1622 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_CreateMesh(IDirect3DRMMeshBuilder3* iface,
1623 LPDIRECT3DRMMESH* Mesh)
1625 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1627 FIXME("(%p)->(%p): stub\n", This, Mesh);
1629 return E_NOTIMPL;
1632 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetFace(IDirect3DRMMeshBuilder3* iface,
1633 DWORD index, LPDIRECT3DRMFACE2* Face)
1635 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1637 FIXME("(%p)->(%u,%p): stub\n", This, index, Face);
1639 return E_NOTIMPL;
1642 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetVertex(IDirect3DRMMeshBuilder3* iface,
1643 DWORD index, LPD3DVECTOR vector)
1645 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1647 FIXME("(%p)->(%u,%p): stub\n", This, index, vector);
1649 return E_NOTIMPL;
1652 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetNormal(IDirect3DRMMeshBuilder3* iface,
1653 DWORD index, LPD3DVECTOR vector)
1655 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1657 FIXME("(%p)->(%u,%p): stub\n", This, index, vector);
1659 return E_NOTIMPL;
1662 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_DeleteVertices(IDirect3DRMMeshBuilder3* iface,
1663 DWORD IndexFirst, DWORD count)
1665 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1667 FIXME("(%p)->(%u,%u): stub\n", This, IndexFirst, count);
1669 return E_NOTIMPL;
1672 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_DeleteNormals(IDirect3DRMMeshBuilder3* iface,
1673 DWORD IndexFirst, DWORD count)
1675 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1677 FIXME("(%p)->(%u,%u): stub\n", This, IndexFirst, count);
1679 return E_NOTIMPL;
1682 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_DeleteFace(IDirect3DRMMeshBuilder3* iface,
1683 LPDIRECT3DRMFACE2 Face)
1685 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1687 FIXME("(%p)->(%p): stub\n", This, Face);
1689 return E_NOTIMPL;
1692 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Empty(IDirect3DRMMeshBuilder3* iface, DWORD flags)
1694 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1696 FIXME("(%p)->(%u): stub\n", This, flags);
1698 return E_NOTIMPL;
1701 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Optimize(IDirect3DRMMeshBuilder3* iface,
1702 DWORD flags)
1704 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1706 FIXME("(%p)->(%u): stub\n", This, flags);
1708 return E_NOTIMPL;
1711 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_AddFacesIndexed(IDirect3DRMMeshBuilder3* iface,
1712 DWORD flags, DWORD* indices,
1713 DWORD* IndexFirst, DWORD* count)
1715 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1717 FIXME("(%p)->(%u,%p,%p,%p): stub\n", This, flags, indices, IndexFirst, count);
1719 return E_NOTIMPL;
1722 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_CreateSubMesh(IDirect3DRMMeshBuilder3* iface,
1723 LPUNKNOWN *unkwn)
1725 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1727 FIXME("(%p)->(%p): stub\n", This, unkwn);
1729 return E_NOTIMPL;
1732 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetParentMesh(IDirect3DRMMeshBuilder3* iface,
1733 DWORD flags, LPUNKNOWN *unkwn)
1735 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1737 FIXME("(%p)->(%u,%p): stub\n", This, flags, unkwn);
1739 return E_NOTIMPL;
1742 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetSubMeshes(IDirect3DRMMeshBuilder3* iface,
1743 LPDWORD count, LPUNKNOWN *unkwn)
1745 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1747 FIXME("(%p)->(%p,%p): stub\n", This, count, unkwn);
1749 return E_NOTIMPL;
1752 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_DeleteSubMesh(IDirect3DRMMeshBuilder3* iface,
1753 LPUNKNOWN unkwn)
1755 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1757 FIXME("(%p)->(%p): stub\n", This, unkwn);
1759 return E_NOTIMPL;
1762 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Enable(IDirect3DRMMeshBuilder3* iface,
1763 DWORD index)
1765 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1767 FIXME("(%p)->(%u): stub\n", This, index);
1769 return E_NOTIMPL;
1772 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetEnable(IDirect3DRMMeshBuilder3* iface,
1773 DWORD* indices)
1775 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1777 FIXME("(%p)->(%p): stub\n", This, indices);
1779 return E_NOTIMPL;
1782 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_AddTriangles(IDirect3DRMMeshBuilder3* iface,
1783 DWORD flags, DWORD format,
1784 DWORD VertexCount, LPVOID data)
1786 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1788 FIXME("(%p)->(%u,%u,%u,%p): stub\n", This, flags, format, VertexCount, data);
1790 return E_NOTIMPL;
1793 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetVertices(IDirect3DRMMeshBuilder3* iface,
1794 DWORD IndexFirst, DWORD count,
1795 LPD3DVECTOR vector)
1797 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1799 FIXME("(%p)->(%u,%u,%p): stub\n", This, IndexFirst, count, vector);
1801 return E_NOTIMPL;
1804 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetVertices(IDirect3DRMMeshBuilder3* iface,
1805 DWORD IndexFirst, LPDWORD vcount,
1806 LPD3DVECTOR vertices)
1808 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1809 DWORD count = This->nb_vertices - IndexFirst;
1811 TRACE("(%p)->(%u,%p,%p)\n", This, IndexFirst, vcount, vertices);
1813 if (vcount)
1814 *vcount = count;
1815 if (vertices && This->nb_vertices)
1816 memcpy(vertices, This->pVertices + IndexFirst, count * sizeof(D3DVECTOR));
1818 return D3DRM_OK;
1821 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetNormals(IDirect3DRMMeshBuilder3* iface,
1822 DWORD IndexFirst, DWORD count,
1823 LPD3DVECTOR vector)
1825 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1827 FIXME("(%p)->(%u,%u,%p): stub\n", This, IndexFirst, count, vector);
1829 return E_NOTIMPL;
1832 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetNormals(IDirect3DRMMeshBuilder3* iface,
1833 DWORD IndexFirst, LPDWORD count,
1834 LPD3DVECTOR vector)
1836 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1838 FIXME("(%p)->(%u,%p,%p): stub\n", This, IndexFirst, count, vector);
1840 return E_NOTIMPL;
1843 static int WINAPI IDirect3DRMMeshBuilder3Impl_GetNormalCount(IDirect3DRMMeshBuilder3* iface)
1845 IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
1847 FIXME("(%p)->(): stub\n", This);
1849 return E_NOTIMPL;
1852 static const struct IDirect3DRMMeshBuilder3Vtbl Direct3DRMMeshBuilder3_Vtbl =
1854 /*** IUnknown methods ***/
1855 IDirect3DRMMeshBuilder3Impl_QueryInterface,
1856 IDirect3DRMMeshBuilder3Impl_AddRef,
1857 IDirect3DRMMeshBuilder3Impl_Release,
1858 /*** IDirect3DRMObject methods ***/
1859 IDirect3DRMMeshBuilder3Impl_Clone,
1860 IDirect3DRMMeshBuilder3Impl_AddDestroyCallback,
1861 IDirect3DRMMeshBuilder3Impl_DeleteDestroyCallback,
1862 IDirect3DRMMeshBuilder3Impl_SetAppData,
1863 IDirect3DRMMeshBuilder3Impl_GetAppData,
1864 IDirect3DRMMeshBuilder3Impl_SetName,
1865 IDirect3DRMMeshBuilder3Impl_GetName,
1866 IDirect3DRMMeshBuilder3Impl_GetClassName,
1867 /*** IDirect3DRMMeshBuilder3 methods ***/
1868 IDirect3DRMMeshBuilder3Impl_Load,
1869 IDirect3DRMMeshBuilder3Impl_Save,
1870 IDirect3DRMMeshBuilder3Impl_Scale,
1871 IDirect3DRMMeshBuilder3Impl_Translate,
1872 IDirect3DRMMeshBuilder3Impl_SetColorSource,
1873 IDirect3DRMMeshBuilder3Impl_GetBox,
1874 IDirect3DRMMeshBuilder3Impl_GenerateNormals,
1875 IDirect3DRMMeshBuilder3Impl_GetColorSource,
1876 IDirect3DRMMeshBuilder3Impl_AddMesh,
1877 IDirect3DRMMeshBuilder3Impl_AddMeshBuilder,
1878 IDirect3DRMMeshBuilder3Impl_AddFrame,
1879 IDirect3DRMMeshBuilder3Impl_AddFace,
1880 IDirect3DRMMeshBuilder3Impl_AddFaces,
1881 IDirect3DRMMeshBuilder3Impl_ReserveSpace,
1882 IDirect3DRMMeshBuilder3Impl_SetColorRGB,
1883 IDirect3DRMMeshBuilder3Impl_SetColor,
1884 IDirect3DRMMeshBuilder3Impl_SetTexture,
1885 IDirect3DRMMeshBuilder3Impl_SetMaterial,
1886 IDirect3DRMMeshBuilder3Impl_SetTextureTopology,
1887 IDirect3DRMMeshBuilder3Impl_SetQuality,
1888 IDirect3DRMMeshBuilder3Impl_SetPerspective,
1889 IDirect3DRMMeshBuilder3Impl_SetVertex,
1890 IDirect3DRMMeshBuilder3Impl_SetNormal,
1891 IDirect3DRMMeshBuilder3Impl_SetTextureCoordinates,
1892 IDirect3DRMMeshBuilder3Impl_SetVertexColor,
1893 IDirect3DRMMeshBuilder3Impl_SetVertexColorRGB,
1894 IDirect3DRMMeshBuilder3Impl_GetFaces,
1895 IDirect3DRMMeshBuilder3Impl_GetGeometry,
1896 IDirect3DRMMeshBuilder3Impl_GetTextureCoordinates,
1897 IDirect3DRMMeshBuilder3Impl_AddVertex,
1898 IDirect3DRMMeshBuilder3Impl_AddNormal,
1899 IDirect3DRMMeshBuilder3Impl_CreateFace,
1900 IDirect3DRMMeshBuilder3Impl_GetQuality,
1901 IDirect3DRMMeshBuilder3Impl_GetPerspective,
1902 IDirect3DRMMeshBuilder3Impl_GetFaceCount,
1903 IDirect3DRMMeshBuilder3Impl_GetVertexCount,
1904 IDirect3DRMMeshBuilder3Impl_GetVertexColor,
1905 IDirect3DRMMeshBuilder3Impl_CreateMesh,
1906 IDirect3DRMMeshBuilder3Impl_GetFace,
1907 IDirect3DRMMeshBuilder3Impl_GetVertex,
1908 IDirect3DRMMeshBuilder3Impl_GetNormal,
1909 IDirect3DRMMeshBuilder3Impl_DeleteVertices,
1910 IDirect3DRMMeshBuilder3Impl_DeleteNormals,
1911 IDirect3DRMMeshBuilder3Impl_DeleteFace,
1912 IDirect3DRMMeshBuilder3Impl_Empty,
1913 IDirect3DRMMeshBuilder3Impl_Optimize,
1914 IDirect3DRMMeshBuilder3Impl_AddFacesIndexed,
1915 IDirect3DRMMeshBuilder3Impl_CreateSubMesh,
1916 IDirect3DRMMeshBuilder3Impl_GetParentMesh,
1917 IDirect3DRMMeshBuilder3Impl_GetSubMeshes,
1918 IDirect3DRMMeshBuilder3Impl_DeleteSubMesh,
1919 IDirect3DRMMeshBuilder3Impl_Enable,
1920 IDirect3DRMMeshBuilder3Impl_GetEnable,
1921 IDirect3DRMMeshBuilder3Impl_AddTriangles,
1922 IDirect3DRMMeshBuilder3Impl_SetVertices,
1923 IDirect3DRMMeshBuilder3Impl_GetVertices,
1924 IDirect3DRMMeshBuilder3Impl_SetNormals,
1925 IDirect3DRMMeshBuilder3Impl_GetNormals,
1926 IDirect3DRMMeshBuilder3Impl_GetNormalCount
1929 HRESULT Direct3DRMMeshBuilder_create(REFIID riid, IUnknown** ppObj)
1931 IDirect3DRMMeshBuilderImpl* object;
1933 TRACE("(%p)\n", ppObj);
1935 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMMeshBuilderImpl));
1936 if (!object)
1938 ERR("Out of memory\n");
1939 return E_OUTOFMEMORY;
1942 object->IDirect3DRMMeshBuilder2_iface.lpVtbl = &Direct3DRMMeshBuilder2_Vtbl;
1943 object->IDirect3DRMMeshBuilder3_iface.lpVtbl = &Direct3DRMMeshBuilder3_Vtbl;
1944 object->ref = 1;
1946 if (IsEqualGUID(riid, &IID_IDirect3DRMMeshBuilder3))
1947 *ppObj = (IUnknown*)&object->IDirect3DRMMeshBuilder3_iface;
1948 else
1949 *ppObj = (IUnknown*)&object->IDirect3DRMMeshBuilder2_iface;
1951 return S_OK;