face.c 18 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
/*
 * Implementation of IDirect3DRMFace Interface
 *
 * Copyright 2013 André Hentschel
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

#include "d3drm_private.h"

WINE_DEFAULT_DEBUG_CHANNEL(d3drm);

25
static inline struct d3drm_face *impl_from_IDirect3DRMFace(IDirect3DRMFace *iface)
26
{
27
    return CONTAINING_RECORD(iface, struct d3drm_face, IDirect3DRMFace_iface);
28 29
}

30
static inline struct d3drm_face *impl_from_IDirect3DRMFace2(IDirect3DRMFace2 *iface)
31
{
32
    return CONTAINING_RECORD(iface, struct d3drm_face, IDirect3DRMFace2_iface);
33 34
}

35
static HRESULT WINAPI d3drm_face1_QueryInterface(IDirect3DRMFace *iface, REFIID riid, void **out)
36
{
37
    struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
38

39
    TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
40

41
    if (IsEqualGUID(riid, &IID_IDirect3DRMFace)
42
            || IsEqualGUID(riid, &IID_IDirect3DRMObject)
43
            || IsEqualGUID(riid, &IID_IUnknown))
44
    {
45
        *out = &face->IDirect3DRMFace_iface;
46
    }
47 48
    else if(IsEqualGUID(riid, &IID_IDirect3DRMFace2))
    {
49
        *out = &face->IDirect3DRMFace2_iface;
50
    }
51 52
    else
    {
53 54
        *out = NULL;
        WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
55 56 57
        return E_NOINTERFACE;
    }

58
    IUnknown_AddRef((IUnknown *)*out);
59 60 61
    return S_OK;
}

62
static ULONG WINAPI d3drm_face1_AddRef(IDirect3DRMFace *iface)
63
{
64 65
    struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
    ULONG refcount = InterlockedIncrement(&face->ref);
66

67
    TRACE("%p increasing refcount to %u.\n", iface, refcount);
68

69
    return refcount;
70 71
}

72
static ULONG WINAPI d3drm_face1_Release(IDirect3DRMFace *iface)
73
{
74 75
    struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
    ULONG refcount = InterlockedDecrement(&face->ref);
76

77
    TRACE("%p decreasing refcount to %u.\n", iface, refcount);
78

79
    if (!refcount)
80 81
    {
        d3drm_object_cleanup((IDirect3DRMObject *)iface, &face->obj);
82
        heap_free(face);
83
    }
84

85
    return refcount;
86 87
}

88
static HRESULT WINAPI d3drm_face1_Clone(IDirect3DRMFace *iface,
Henri Verbeet's avatar
Henri Verbeet committed
89
        IUnknown *outer, REFIID iid, void **out)
90
{
Henri Verbeet's avatar
Henri Verbeet committed
91
    FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
92 93 94 95

    return E_NOTIMPL;
}

96
static HRESULT WINAPI d3drm_face1_AddDestroyCallback(IDirect3DRMFace *iface,
Henri Verbeet's avatar
Henri Verbeet committed
97
        D3DRMOBJECTCALLBACK cb, void *ctx)
98
{
99
    struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
100

101 102 103
    TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);

    return IDirect3DRMFace2_AddDestroyCallback(&face->IDirect3DRMFace2_iface, cb, ctx);
104 105
}

106
static HRESULT WINAPI d3drm_face1_DeleteDestroyCallback(IDirect3DRMFace *iface,
Henri Verbeet's avatar
Henri Verbeet committed
107
        D3DRMOBJECTCALLBACK cb, void *ctx)
108
{
109
    struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
110

111 112 113
    TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);

    return IDirect3DRMFace2_DeleteDestroyCallback(&face->IDirect3DRMFace2_iface, cb, ctx);
114 115
}

116 117 118 119 120 121 122 123 124 125 126
static HRESULT WINAPI d3drm_face2_SetAppData(IDirect3DRMFace2 *iface, DWORD data)
{
    struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);

    TRACE("iface %p, data %#x.\n", iface, data);

    face->obj.appdata = data;

    return D3DRM_OK;
}

127
static HRESULT WINAPI d3drm_face1_SetAppData(IDirect3DRMFace *iface, DWORD data)
128
{
129 130 131 132 133 134 135 136 137 138
    struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);

    TRACE("iface %p, data %#x.\n", iface, data);

    return d3drm_face2_SetAppData(&face->IDirect3DRMFace2_iface, data);
}

static DWORD WINAPI d3drm_face2_GetAppData(IDirect3DRMFace2 *iface)
{
    struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
139

140 141 142
    TRACE("iface %p.\n", iface);

    return face->obj.appdata;
143 144
}

145
static DWORD WINAPI d3drm_face1_GetAppData(IDirect3DRMFace *iface)
146
{
147
    struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
148

149 150 151
    TRACE("iface %p.\n", iface);

    return d3drm_face2_GetAppData(&face->IDirect3DRMFace2_iface);
152 153
}

154 155 156 157 158 159 160 161 162
static HRESULT WINAPI d3drm_face2_SetName(IDirect3DRMFace2 *iface, const char *name)
{
    struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);

    TRACE("iface %p, name %s.\n", iface, debugstr_a(name));

    return d3drm_object_set_name(&face->obj, name);
}

163
static HRESULT WINAPI d3drm_face1_SetName(IDirect3DRMFace *iface, const char *name)
164
{
165
    struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
166

167 168 169 170 171 172 173 174 175 176 177 178
    TRACE("iface %p, name %s.\n", iface, debugstr_a(name));

    return d3drm_face2_SetName(&face->IDirect3DRMFace2_iface, name);
}

static HRESULT WINAPI d3drm_face2_GetName(IDirect3DRMFace2 *iface, DWORD *size, char *name)
{
    struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);

    TRACE("iface %p, size %p, name %p.\n", iface, size, name);

    return d3drm_object_get_name(&face->obj, size, name);
179 180
}

181
static HRESULT WINAPI d3drm_face1_GetName(IDirect3DRMFace *iface, DWORD *size, char *name)
182
{
183
    struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
184

185 186 187
    TRACE("iface %p, size %p, name %p.\n", iface, size, name);

    return d3drm_face2_GetName(&face->IDirect3DRMFace2_iface, size, name);
188 189
}

190
static HRESULT WINAPI d3drm_face1_GetClassName(IDirect3DRMFace *iface, DWORD *size, char *name)
191
{
192
    struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
193

Henri Verbeet's avatar
Henri Verbeet committed
194
    TRACE("iface %p, size %p, name %p.\n", iface, size, name);
195

Henri Verbeet's avatar
Henri Verbeet committed
196
    return IDirect3DRMFace2_GetClassName(&face->IDirect3DRMFace2_iface, size, name);
197 198
}

199
static HRESULT WINAPI d3drm_face1_AddVertex(IDirect3DRMFace *iface, D3DVALUE x, D3DVALUE y, D3DVALUE z)
200
{
201
    FIXME("iface %p, x %.8e, y %.8e, z %.8e stub!\n", iface, x, y, z);
202 203 204 205

    return E_NOTIMPL;
}

206 207
static HRESULT WINAPI d3drm_face1_AddVertexAndNormalIndexed(IDirect3DRMFace *iface,
        DWORD vertex, DWORD normal)
208
{
209
    FIXME("iface %p, vertex %u, normal %u stub!\n", iface, vertex, normal);
210 211 212 213

    return E_NOTIMPL;
}

214 215 216 217 218 219 220 221 222 223 224
static HRESULT WINAPI d3drm_face2_SetColorRGB(IDirect3DRMFace2 *iface, D3DVALUE red, D3DVALUE green, D3DVALUE blue)
{
    struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);

    TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);

    d3drm_set_color(&face->color, red, green, blue, 1.0f);

    return D3DRM_OK;
}

225
static HRESULT WINAPI d3drm_face1_SetColorRGB(IDirect3DRMFace *iface,
226
        D3DVALUE red, D3DVALUE green, D3DVALUE blue)
227
{
228
    struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
229

230 231 232 233 234 235 236 237 238 239 240 241 242 243
    TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);

    return d3drm_face2_SetColorRGB(&face->IDirect3DRMFace2_iface, red, green, blue);
}

static HRESULT WINAPI d3drm_face2_SetColor(IDirect3DRMFace2 *iface, D3DCOLOR color)
{
    struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);

    TRACE("iface %p, color 0x%08x.\n", iface, color);

    face->color = color;

    return D3DRM_OK;
244 245
}

246
static HRESULT WINAPI d3drm_face1_SetColor(IDirect3DRMFace *iface, D3DCOLOR color)
247
{
248
    struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
249

250 251 252
    TRACE("iface %p, color 0x%08x.\n", iface, color);

    return d3drm_face2_SetColor(&face->IDirect3DRMFace2_iface, color);
253 254
}

255
static HRESULT WINAPI d3drm_face1_SetTexture(IDirect3DRMFace *iface, IDirect3DRMTexture *texture)
256
{
257
    FIXME("iface %p, texture %p stub!\n", iface, texture);
258 259 260 261

    return E_NOTIMPL;
}

262 263
static HRESULT WINAPI d3drm_face1_SetTextureCoordinates(IDirect3DRMFace *iface,
        DWORD vertex, D3DVALUE u, D3DVALUE v)
264
{
265
    FIXME("iface %p, vertex %u, u %.8e, v %.8e stub!\n", iface, vertex, u, v);
266 267 268 269

    return E_NOTIMPL;
}

270
static HRESULT WINAPI d3drm_face1_SetMaterial(IDirect3DRMFace *iface, IDirect3DRMMaterial *material)
271
{
272
    FIXME("iface %p, material %p stub!\n", iface, material);
273 274 275 276

    return E_NOTIMPL;
}

277
static HRESULT WINAPI d3drm_face1_SetTextureTopology(IDirect3DRMFace *iface, BOOL wrap_u, BOOL wrap_v)
278
{
279
    FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v);
280 281 282 283

    return E_NOTIMPL;
}

284 285
static HRESULT WINAPI d3drm_face1_GetVertex(IDirect3DRMFace *iface,
        DWORD index, D3DVECTOR *vertex, D3DVECTOR *normal)
286
{
287
    FIXME("iface %p, index %u, vertex %p, normal %p stub!\n", iface, index, vertex, normal);
288 289 290 291

    return E_NOTIMPL;
}

292 293
static HRESULT WINAPI d3drm_face1_GetVertices(IDirect3DRMFace *iface,
        DWORD *vertex_count, D3DVECTOR *coords, D3DVECTOR *normals)
294
{
295 296
    FIXME("iface %p, vertex_count %p, coords %p, normals %p stub!\n",
            iface, vertex_count, coords, normals);
297 298 299 300

    return E_NOTIMPL;
}

301 302
static HRESULT WINAPI d3drm_face1_GetTextureCoordinates(IDirect3DRMFace *iface,
        DWORD vertex, D3DVALUE *u, D3DVALUE *v)
303
{
304
    FIXME("iface %p, vertex %u, u %p, v %p stub!\n", iface, vertex, u, v);
305 306 307 308

    return E_NOTIMPL;
}

309
static HRESULT WINAPI d3drm_face1_GetTextureTopology(IDirect3DRMFace *iface, BOOL *wrap_u, BOOL *wrap_v)
310
{
311
    FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v);
312 313 314 315

    return E_NOTIMPL;
}

316
static HRESULT WINAPI d3drm_face1_GetNormal(IDirect3DRMFace *iface, D3DVECTOR *normal)
317
{
318
    FIXME("iface %p, normal %p stub!\n", iface, normal);
319 320 321 322

    return E_NOTIMPL;
}

323
static HRESULT WINAPI d3drm_face1_GetTexture(IDirect3DRMFace *iface, IDirect3DRMTexture **texture)
324
{
325
    FIXME("iface %p, texture %p stub!\n", iface, texture);
326 327 328 329

    return E_NOTIMPL;
}

330
static HRESULT WINAPI d3drm_face1_GetMaterial(IDirect3DRMFace *iface, IDirect3DRMMaterial **material)
331
{
332
    FIXME("iface %p, material %p stub!\n", iface, material);
333 334 335 336

    return E_NOTIMPL;
}

337
static int WINAPI d3drm_face1_GetVertexCount(IDirect3DRMFace *iface)
338
{
339
    FIXME("iface %p stub!\n", iface);
340 341 342 343

    return 0;
}

344
static int WINAPI d3drm_face1_GetVertexIndex(IDirect3DRMFace *iface, DWORD which)
345
{
346
    FIXME("iface %p, which %u stub!\n", iface, which);
347 348 349 350

    return 0;
}

351
static int WINAPI d3drm_face1_GetTextureCoordinateIndex(IDirect3DRMFace *iface, DWORD which)
352
{
353
    FIXME("iface %p, which %u stub!\n", iface, which);
354 355 356 357

    return 0;
}

358 359 360 361 362 363 364 365 366
static D3DCOLOR WINAPI d3drm_face2_GetColor(IDirect3DRMFace2 *iface)
{
    struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);

    TRACE("iface %p.\n", iface);

    return face->color;
}

367
static D3DCOLOR WINAPI d3drm_face1_GetColor(IDirect3DRMFace *iface)
368
{
369
    struct d3drm_face *face = impl_from_IDirect3DRMFace(iface);
370

371 372 373
    TRACE("iface %p.\n", iface);

    return d3drm_face2_GetColor(&face->IDirect3DRMFace2_iface);
374 375
}

376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407
static const struct IDirect3DRMFaceVtbl d3drm_face1_vtbl =
{
    d3drm_face1_QueryInterface,
    d3drm_face1_AddRef,
    d3drm_face1_Release,
    d3drm_face1_Clone,
    d3drm_face1_AddDestroyCallback,
    d3drm_face1_DeleteDestroyCallback,
    d3drm_face1_SetAppData,
    d3drm_face1_GetAppData,
    d3drm_face1_SetName,
    d3drm_face1_GetName,
    d3drm_face1_GetClassName,
    d3drm_face1_AddVertex,
    d3drm_face1_AddVertexAndNormalIndexed,
    d3drm_face1_SetColorRGB,
    d3drm_face1_SetColor,
    d3drm_face1_SetTexture,
    d3drm_face1_SetTextureCoordinates,
    d3drm_face1_SetMaterial,
    d3drm_face1_SetTextureTopology,
    d3drm_face1_GetVertex,
    d3drm_face1_GetVertices,
    d3drm_face1_GetTextureCoordinates,
    d3drm_face1_GetTextureTopology,
    d3drm_face1_GetNormal,
    d3drm_face1_GetTexture,
    d3drm_face1_GetMaterial,
    d3drm_face1_GetVertexCount,
    d3drm_face1_GetVertexIndex,
    d3drm_face1_GetTextureCoordinateIndex,
    d3drm_face1_GetColor,
408 409
};

410
static HRESULT WINAPI d3drm_face2_QueryInterface(IDirect3DRMFace2 *iface, REFIID riid, void **out)
411
{
412 413 414
    struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);

    return d3drm_face1_QueryInterface(&face->IDirect3DRMFace_iface, riid, out);
415 416
}

417
static ULONG WINAPI d3drm_face2_AddRef(IDirect3DRMFace2 *iface)
418
{
419 420 421
    struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);

    return d3drm_face1_AddRef(&face->IDirect3DRMFace_iface);
422 423
}

424
static ULONG WINAPI d3drm_face2_Release(IDirect3DRMFace2 *iface)
425
{
426 427 428
    struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);

    return d3drm_face1_Release(&face->IDirect3DRMFace_iface);
429 430
}

431
static HRESULT WINAPI d3drm_face2_Clone(IDirect3DRMFace2 *iface,
Henri Verbeet's avatar
Henri Verbeet committed
432
        IUnknown *outer, REFIID iid, void **out)
433
{
Henri Verbeet's avatar
Henri Verbeet committed
434
    FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
435 436 437 438

    return E_NOTIMPL;
}

439
static HRESULT WINAPI d3drm_face2_AddDestroyCallback(IDirect3DRMFace2 *iface,
Henri Verbeet's avatar
Henri Verbeet committed
440
        D3DRMOBJECTCALLBACK cb, void *ctx)
441
{
442
    struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
443

444 445 446
    TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);

    return d3drm_object_add_destroy_callback(&face->obj, cb, ctx);
447 448
}

449
static HRESULT WINAPI d3drm_face2_DeleteDestroyCallback(IDirect3DRMFace2 *iface,
Henri Verbeet's avatar
Henri Verbeet committed
450
        D3DRMOBJECTCALLBACK cb, void *ctx)
451
{
452
    struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
453

454 455 456
    TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);

    return d3drm_object_delete_destroy_callback(&face->obj, cb, ctx);
457 458
}

459
static HRESULT WINAPI d3drm_face2_GetClassName(IDirect3DRMFace2 *iface, DWORD *size, char *name)
460
{
461
    struct d3drm_face *face = impl_from_IDirect3DRMFace2(iface);
462

463
    TRACE("iface %p, size %p, name %p.\n", iface, size, name);
464

465
    return d3drm_object_get_class_name(&face->obj, size, name);
466 467
}

468
static HRESULT WINAPI d3drm_face2_AddVertex(IDirect3DRMFace2 *iface, D3DVALUE x, D3DVALUE y, D3DVALUE z)
469
{
470
    FIXME("iface %p, x %.8e, y %.8e, z %.8e stub!\n", iface, x, y, z);
471 472 473 474

    return E_NOTIMPL;
}

475 476
static HRESULT WINAPI d3drm_face2_AddVertexAndNormalIndexed(IDirect3DRMFace2 *iface,
        DWORD vertex, DWORD normal)
477
{
478
    FIXME("iface %p, vertex %u, normal %u stub!\n", iface, vertex, normal);
479 480 481 482

    return E_NOTIMPL;
}

483
static HRESULT WINAPI d3drm_face2_SetTexture(IDirect3DRMFace2 *iface, IDirect3DRMTexture3 *texture)
484
{
485
    FIXME("iface %p, texture %p stub!\n", iface, texture);
486 487 488 489

    return E_NOTIMPL;
}

490 491
static HRESULT WINAPI d3drm_face2_SetTextureCoordinates(IDirect3DRMFace2 *iface,
        DWORD vertex, D3DVALUE u, D3DVALUE v)
492
{
493
    FIXME("iface %p, vertex %u, u %.8e, v %.8e stub!\n", iface, vertex, u, v);
494 495 496 497

    return E_NOTIMPL;
}

498
static HRESULT WINAPI d3drm_face2_SetMaterial(IDirect3DRMFace2 *iface, IDirect3DRMMaterial2 *material)
499
{
500
    FIXME("iface %p, material %p stub!\n", iface, material);
501 502 503 504

    return E_NOTIMPL;
}

505
static HRESULT WINAPI d3drm_face2_SetTextureTopology(IDirect3DRMFace2 *iface, BOOL wrap_u, BOOL wrap_v)
506
{
507
    FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v);
508 509 510 511

    return E_NOTIMPL;
}

512 513
static HRESULT WINAPI d3drm_face2_GetVertex(IDirect3DRMFace2 *iface,
        DWORD index, D3DVECTOR *vertex, D3DVECTOR *normal)
514
{
515
    FIXME("iface %p, index %u, vertex %p, normal %p stub!\n", iface, index, vertex, normal);
516 517 518 519

    return E_NOTIMPL;
}

520 521
static HRESULT WINAPI d3drm_face2_GetVertices(IDirect3DRMFace2 *iface,
        DWORD *vertex_count, D3DVECTOR *coords, D3DVECTOR *normals)
522
{
523 524
    FIXME("iface %p, vertex_count %p, coords %p, normals %p stub!\n",
            iface, vertex_count, coords, normals);
525 526 527 528

    return E_NOTIMPL;
}

529 530
static HRESULT WINAPI d3drm_face2_GetTextureCoordinates(IDirect3DRMFace2 *iface,
        DWORD vertex, D3DVALUE *u, D3DVALUE *v)
531
{
532
    FIXME("iface %p, vertex %u, u %p, v %p stub!\n", iface, vertex, u, v);
533 534 535 536

    return E_NOTIMPL;
}

537
static HRESULT WINAPI d3drm_face2_GetTextureTopology(IDirect3DRMFace2 *iface, BOOL *wrap_u, BOOL *wrap_v)
538
{
539
    FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v);
540 541 542 543

    return E_NOTIMPL;
}

544
static HRESULT WINAPI d3drm_face2_GetNormal(IDirect3DRMFace2 *iface, D3DVECTOR *normal)
545
{
546
    FIXME("iface %p, normal %p stub!\n", iface, normal);
547 548 549 550

    return E_NOTIMPL;
}

551
static HRESULT WINAPI d3drm_face2_GetTexture(IDirect3DRMFace2 *iface, IDirect3DRMTexture3 **texture)
552
{
553
    FIXME("iface %p, texture %p stub!\n", iface, texture);
554 555 556 557

    return E_NOTIMPL;
}

558
static HRESULT WINAPI d3drm_face2_GetMaterial(IDirect3DRMFace2 *iface, IDirect3DRMMaterial2 **material)
559
{
560
    FIXME("iface %p, material %p stub!\n", iface, material);
561 562 563 564

    return E_NOTIMPL;
}

565
static int WINAPI d3drm_face2_GetVertexCount(IDirect3DRMFace2 *iface)
566
{
567
    FIXME("iface %p stub!\n", iface);
568 569 570 571

    return 0;
}

572
static int WINAPI d3drm_face2_GetVertexIndex(IDirect3DRMFace2 *iface, DWORD which)
573
{
574
    FIXME("iface %p, which %u stub!\n", iface, which);
575 576 577 578

    return 0;
}

579
static int WINAPI d3drm_face2_GetTextureCoordinateIndex(IDirect3DRMFace2 *iface, DWORD which)
580
{
581
    FIXME("iface %p, which %u stub!\n", iface, which);
582 583 584 585

    return 0;
}

586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617
static const struct IDirect3DRMFace2Vtbl d3drm_face2_vtbl =
{
    d3drm_face2_QueryInterface,
    d3drm_face2_AddRef,
    d3drm_face2_Release,
    d3drm_face2_Clone,
    d3drm_face2_AddDestroyCallback,
    d3drm_face2_DeleteDestroyCallback,
    d3drm_face2_SetAppData,
    d3drm_face2_GetAppData,
    d3drm_face2_SetName,
    d3drm_face2_GetName,
    d3drm_face2_GetClassName,
    d3drm_face2_AddVertex,
    d3drm_face2_AddVertexAndNormalIndexed,
    d3drm_face2_SetColorRGB,
    d3drm_face2_SetColor,
    d3drm_face2_SetTexture,
    d3drm_face2_SetTextureCoordinates,
    d3drm_face2_SetMaterial,
    d3drm_face2_SetTextureTopology,
    d3drm_face2_GetVertex,
    d3drm_face2_GetVertices,
    d3drm_face2_GetTextureCoordinates,
    d3drm_face2_GetTextureTopology,
    d3drm_face2_GetNormal,
    d3drm_face2_GetTexture,
    d3drm_face2_GetMaterial,
    d3drm_face2_GetVertexCount,
    d3drm_face2_GetVertexIndex,
    d3drm_face2_GetTextureCoordinateIndex,
    d3drm_face2_GetColor,
618 619
};

620
HRESULT d3drm_face_create(struct d3drm_face **face)
621
{
622
    static const char classname[] = "Face";
623
    struct d3drm_face *object;
624

625
    TRACE("face %p.\n", face);
626

627
    if (!(object = heap_alloc_zero(sizeof(*object))))
628 629
        return E_OUTOFMEMORY;

630 631
    object->IDirect3DRMFace_iface.lpVtbl = &d3drm_face1_vtbl;
    object->IDirect3DRMFace2_iface.lpVtbl = &d3drm_face2_vtbl;
632 633
    object->ref = 1;

634 635
    d3drm_object_init(&object->obj, classname);

636
    *face = object;
637 638 639

    return S_OK;
}