cmd: Convert wcmd_for to use WCMD_parameter.
[wine] / dlls / d3drm / texture.c
1 /*
2  * Implementation of IDirect3DRMTextureX interfaces
3  *
4  * Copyright 2012 Christian Costa
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #include "wine/debug.h"
22
23 #define COBJMACROS
24
25 #include "winbase.h"
26 #include "wingdi.h"
27
28 #include "d3drm_private.h"
29
30 WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
31
32 typedef struct {
33     IDirect3DRMTexture2 IDirect3DRMTexture2_iface;
34     IDirect3DRMTexture3 IDirect3DRMTexture3_iface;
35     LONG ref;
36 } IDirect3DRMTextureImpl;
37
38 static inline IDirect3DRMTextureImpl *impl_from_IDirect3DRMTexture2(IDirect3DRMTexture2 *iface)
39 {
40     return CONTAINING_RECORD(iface, IDirect3DRMTextureImpl, IDirect3DRMTexture2_iface);
41 }
42
43 static inline IDirect3DRMTextureImpl *impl_from_IDirect3DRMTexture3(IDirect3DRMTexture3 *iface)
44 {
45     return CONTAINING_RECORD(iface, IDirect3DRMTextureImpl, IDirect3DRMTexture3_iface);
46 }
47
48 /*** IUnknown methods ***/
49 static HRESULT WINAPI IDirect3DRMTexture2Impl_QueryInterface(IDirect3DRMTexture2* iface,
50                                                              REFIID riid, void** object)
51 {
52     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
53
54     TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), object);
55
56     *object = NULL;
57
58     if (IsEqualGUID(riid, &IID_IUnknown) ||
59         IsEqualGUID(riid, &IID_IDirect3DRMTexture) ||
60         IsEqualGUID(riid, &IID_IDirect3DRMTexture2))
61     {
62         *object = &This->IDirect3DRMTexture2_iface;
63     }
64     else if IsEqualGUID(riid, &IID_IDirect3DRMTexture3)
65     {
66         *object = &This->IDirect3DRMTexture3_iface;
67     }
68     else
69     {
70         FIXME("Interface %s not implemented\n", debugstr_guid(riid));
71         return E_NOINTERFACE;
72     }
73
74     IDirect3DRMTexture3_AddRef(iface);
75
76     return S_OK;
77 }
78
79 static ULONG WINAPI IDirect3DRMTexture2Impl_AddRef(IDirect3DRMTexture2* iface)
80 {
81     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
82     ULONG ref = InterlockedIncrement(&This->ref);
83
84     TRACE("(%p)->(): new ref = %d\n", iface, ref);
85
86     return ref;
87 }
88
89 static ULONG WINAPI IDirect3DRMTexture2Impl_Release(IDirect3DRMTexture2* iface)
90 {
91     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
92     ULONG ref = InterlockedDecrement(&This->ref);
93
94     TRACE("(%p)->(): new ref = %d\n", iface, ref);
95
96     if (!ref)
97         HeapFree(GetProcessHeap(), 0, This);
98
99     return ref;
100 }
101
102 /*** IDirect3DRMObject methods ***/
103 static HRESULT WINAPI IDirect3DRMTexture2Impl_Clone(IDirect3DRMTexture2* iface,
104                                                     LPUNKNOWN unknown, REFIID riid,
105                                                     LPVOID* object)
106 {
107     FIXME("(%p)->(%p, %s, %p): stub\n", iface, unknown, debugstr_guid(riid), object);
108
109     return E_NOTIMPL;
110 }
111
112 static HRESULT WINAPI IDirect3DRMTexture2Impl_AddDestroyCallback(IDirect3DRMTexture2* iface,
113                                                                  D3DRMOBJECTCALLBACK cb,
114                                                                  LPVOID argument)
115 {
116     FIXME("(%p)->(%p, %p): stub\n", iface, cb, argument);
117
118     return E_NOTIMPL;
119 }
120
121 static HRESULT WINAPI IDirect3DRMTexture2Impl_DeleteDestroyCallback(IDirect3DRMTexture2* iface,
122                                                                     D3DRMOBJECTCALLBACK cb,
123                                                                     LPVOID argument)
124 {
125     FIXME("(%p)->(%p, %p): stub\n", iface, cb, argument);
126
127     return E_NOTIMPL;
128 }
129
130 static HRESULT WINAPI IDirect3DRMTexture2Impl_SetAppData(IDirect3DRMTexture2* iface,
131                                                           DWORD data)
132 {
133     FIXME("(%p)->(%u): stub\n", iface, data);
134
135     return E_NOTIMPL;
136 }
137
138 static DWORD WINAPI IDirect3DRMTexture2Impl_GetAppData(IDirect3DRMTexture2* iface)
139 {
140     FIXME("(%p)->(): stub\n", iface);
141
142     return 0;
143 }
144
145 static HRESULT WINAPI IDirect3DRMTexture2Impl_SetName(IDirect3DRMTexture2* iface, LPCSTR name)
146 {
147     FIXME("(%p)->(%s): stub\n", iface, name);
148
149     return E_NOTIMPL;
150 }
151
152 static HRESULT WINAPI IDirect3DRMTexture2Impl_GetName(IDirect3DRMTexture2* iface,
153                                                       LPDWORD size, LPSTR name)
154 {
155     FIXME("(%p)->(%p, %p): stub\n", iface, size, name);
156
157     return E_NOTIMPL;
158 }
159
160 static HRESULT WINAPI IDirect3DRMTexture2Impl_GetClassName(IDirect3DRMTexture2* iface,
161                                                            LPDWORD size, LPSTR name)
162 {
163     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
164
165     TRACE("(%p/%p)->(%p, %p)\n", iface, This, size, name);
166
167     return IDirect3DRMTexture3_GetClassName(&This->IDirect3DRMTexture3_iface, size, name);
168 }
169
170 /*** IDirect3DRMTexture3 methods ***/
171 static HRESULT WINAPI IDirect3DRMTexture2Impl_InitFromFile(IDirect3DRMTexture2* iface, const char *filename)
172 {
173     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
174
175     FIXME("(%p/%p)->(%s): stub\n", iface, This, debugstr_a(filename));
176
177     return E_NOTIMPL;
178 }
179
180 static HRESULT WINAPI IDirect3DRMTexture2Impl_InitFromSurface(IDirect3DRMTexture2* iface, LPDIRECTDRAWSURFACE surface)
181 {
182     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
183
184     FIXME("(%p/%p)->(%p): stub\n", iface, This, surface);
185
186     return E_NOTIMPL;
187 }
188
189 static HRESULT WINAPI IDirect3DRMTexture2Impl_InitFromResource(IDirect3DRMTexture2* iface, HRSRC resource)
190 {
191     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
192
193     FIXME("(%p/%p)->(%p): stub\n", iface, This, resource);
194
195     return E_NOTIMPL;
196 }
197
198 static HRESULT WINAPI IDirect3DRMTexture2Impl_Changed(IDirect3DRMTexture2* iface, BOOL pixels, BOOL palette)
199 {
200     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
201
202     FIXME("(%p/%p)->(%u, %u): stub\n", iface, This, pixels, palette);
203
204     return E_NOTIMPL;
205 }
206
207 static HRESULT WINAPI IDirect3DRMTexture2Impl_SetColors(IDirect3DRMTexture2* iface, DWORD max_colors)
208 {
209     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
210
211     FIXME("(%p/%p)->(%u): stub\n", iface, This, max_colors);
212
213     return E_NOTIMPL;
214 }
215
216 static HRESULT WINAPI IDirect3DRMTexture2Impl_SetShades(IDirect3DRMTexture2* iface, DWORD max_shades)
217 {
218     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
219
220     FIXME("(%p/%p)->(%u): stub\n", iface, This, max_shades);
221
222     return E_NOTIMPL;
223 }
224
225 static HRESULT WINAPI IDirect3DRMTexture2Impl_SetDecalSize(IDirect3DRMTexture2* iface, D3DVALUE width, D3DVALUE height)
226 {
227     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
228
229     FIXME("(%p/%p)->(%f, %f): stub\n", iface, This, width, height);
230
231     return E_NOTIMPL;
232 }
233
234 static HRESULT WINAPI IDirect3DRMTexture2Impl_SetDecalOrigin(IDirect3DRMTexture2* iface, LONG x, LONG y)
235 {
236     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
237
238     FIXME("(%p/%p)->(%d, %d): stub\n", iface, This, x, y);
239
240     return E_NOTIMPL;
241 }
242
243 static HRESULT WINAPI IDirect3DRMTexture2Impl_SetDecalScale(IDirect3DRMTexture2* iface, DWORD scale)
244 {
245     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
246
247     FIXME("(%p/%p)->(%u): stub\n", iface, This, scale);
248
249     return E_NOTIMPL;
250 }
251
252 static HRESULT WINAPI IDirect3DRMTexture2Impl_SetDecalTransparency(IDirect3DRMTexture2* iface, BOOL transparency)
253 {
254     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
255
256     FIXME("(%p/%p)->(%u): stub\n", iface, This, transparency);
257
258     return E_NOTIMPL;
259 }
260
261 static HRESULT WINAPI IDirect3DRMTexture2Impl_SetDecalTransparentColor(IDirect3DRMTexture2* iface, D3DCOLOR color)
262 {
263     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
264
265     FIXME("(%p/%p)->(%x): stub\n", iface, This, color);
266
267     return E_NOTIMPL;
268 }
269
270 static HRESULT WINAPI IDirect3DRMTexture2Impl_GetDecalSize(IDirect3DRMTexture2* iface, D3DVALUE* width, D3DVALUE* height)
271 {
272     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
273
274     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, height, width);
275
276     return E_NOTIMPL;
277 }
278
279 static HRESULT WINAPI IDirect3DRMTexture2Impl_GetDecalOrigin(IDirect3DRMTexture2* iface, LONG* x, LONG* y)
280 {
281     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
282
283     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, x, y);
284
285     return E_NOTIMPL;
286 }
287
288 static D3DRMIMAGE* WINAPI IDirect3DRMTexture2Impl_GetImage(IDirect3DRMTexture2* iface)
289 {
290     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
291
292     FIXME("(%p/%p)->(): stub\n", iface, This);
293
294     return NULL;
295 }
296
297 static DWORD WINAPI IDirect3DRMTexture2Impl_GetShades(IDirect3DRMTexture2* iface)
298 {
299     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
300
301     FIXME("(%p/%p)->(): stub\n", iface, This);
302
303     return 0;
304 }
305
306 static DWORD WINAPI IDirect3DRMTexture2Impl_GetColors(IDirect3DRMTexture2* iface)
307 {
308     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
309
310     FIXME("(%p/%p)->(): stub\n", iface, This);
311
312     return 0;
313 }
314
315 static DWORD WINAPI IDirect3DRMTexture2Impl_GetDecalScale(IDirect3DRMTexture2* iface)
316 {
317     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
318
319     FIXME("(%p/%p)->(): stub\n", iface, This);
320
321     return 0;
322 }
323
324 static BOOL WINAPI IDirect3DRMTexture2Impl_GetDecalTransparency(IDirect3DRMTexture2* iface)
325 {
326     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
327
328     FIXME("(%p/%p)->(): stub\n", iface, This);
329
330     return FALSE;
331 }
332
333 static D3DCOLOR WINAPI IDirect3DRMTexture2Impl_GetDecalTransparentColor(IDirect3DRMTexture2* iface)
334 {
335     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
336
337     FIXME("(%p/%p)->(): stub\n", iface, This);
338
339     return 0;
340 }
341
342 /*** IDirect3DRMTexture2 methods ***/
343 static HRESULT WINAPI IDirect3DRMTexture2Impl_InitFromImage(IDirect3DRMTexture2* iface, LPD3DRMIMAGE image)
344 {
345     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
346
347     FIXME("(%p/%p)->(%p): stub\n", iface, This, image);
348
349     return E_NOTIMPL;
350 }
351
352 static HRESULT WINAPI IDirect3DRMTexture2Impl_InitFromResource2(IDirect3DRMTexture2* iface, HMODULE module,
353                                                                LPCSTR /* LPCTSTR */ name, LPCSTR /* LPCTSTR */ type)
354 {
355     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
356
357     FIXME("(%p/%p)->(%p, %s, %s): stub\n", iface, This, module, debugstr_a(name), debugstr_a(type));
358
359     return E_NOTIMPL;
360 }
361
362 static HRESULT WINAPI IDirect3DRMTexture2Impl_GenerateMIPMap(IDirect3DRMTexture2* iface, DWORD flags)
363 {
364     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
365
366     FIXME("(%p/%p)->(%x): stub\n", iface, This, flags);
367
368     return E_NOTIMPL;
369 }
370
371 static const struct IDirect3DRMTexture2Vtbl Direct3DRMTexture2_Vtbl =
372 {
373     /*** IUnknown methods ***/
374     IDirect3DRMTexture2Impl_QueryInterface,
375     IDirect3DRMTexture2Impl_AddRef,
376     IDirect3DRMTexture2Impl_Release,
377     /*** IDirect3DRMObject methods ***/
378     IDirect3DRMTexture2Impl_Clone,
379     IDirect3DRMTexture2Impl_AddDestroyCallback,
380     IDirect3DRMTexture2Impl_DeleteDestroyCallback,
381     IDirect3DRMTexture2Impl_SetAppData,
382     IDirect3DRMTexture2Impl_GetAppData,
383     IDirect3DRMTexture2Impl_SetName,
384     IDirect3DRMTexture2Impl_GetName,
385     IDirect3DRMTexture2Impl_GetClassName,
386     /*** IDirect3DRMTexture methods ***/
387     IDirect3DRMTexture2Impl_InitFromFile,
388     IDirect3DRMTexture2Impl_InitFromSurface,
389     IDirect3DRMTexture2Impl_InitFromResource,
390     IDirect3DRMTexture2Impl_Changed,
391     IDirect3DRMTexture2Impl_SetColors,
392     IDirect3DRMTexture2Impl_SetShades,
393     IDirect3DRMTexture2Impl_SetDecalSize,
394     IDirect3DRMTexture2Impl_SetDecalOrigin,
395     IDirect3DRMTexture2Impl_SetDecalScale,
396     IDirect3DRMTexture2Impl_SetDecalTransparency,
397     IDirect3DRMTexture2Impl_SetDecalTransparentColor,
398     IDirect3DRMTexture2Impl_GetDecalSize,
399     IDirect3DRMTexture2Impl_GetDecalOrigin,
400     IDirect3DRMTexture2Impl_GetImage,
401     IDirect3DRMTexture2Impl_GetShades,
402     IDirect3DRMTexture2Impl_GetColors,
403     IDirect3DRMTexture2Impl_GetDecalScale,
404     IDirect3DRMTexture2Impl_GetDecalTransparency,
405     IDirect3DRMTexture2Impl_GetDecalTransparentColor,
406     /*** IDirect3DRMTexture2 methods ***/
407     IDirect3DRMTexture2Impl_InitFromImage,
408     IDirect3DRMTexture2Impl_InitFromResource2,
409     IDirect3DRMTexture2Impl_GenerateMIPMap
410 };
411
412 /*** IUnknown methods ***/
413 static HRESULT WINAPI IDirect3DRMTexture3Impl_QueryInterface(IDirect3DRMTexture3* iface,
414                                                            REFIID riid, void** object)
415 {
416     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
417
418     TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), object);
419
420     *object = NULL;
421
422     if (IsEqualGUID(riid, &IID_IUnknown) ||
423         IsEqualGUID(riid, &IID_IDirect3DRMTexture) ||
424         IsEqualGUID(riid, &IID_IDirect3DRMTexture2))
425     {
426         *object = &This->IDirect3DRMTexture2_iface;
427     }
428     else if IsEqualGUID(riid, &IID_IDirect3DRMTexture3)
429     {
430         *object = &This->IDirect3DRMTexture3_iface;
431     }
432     else
433     {
434         FIXME("Interface %s not implemented\n", debugstr_guid(riid));
435         return E_NOINTERFACE;
436     }
437
438     IDirect3DRMTexture3_AddRef(iface);
439
440     return S_OK;
441 }
442
443 static ULONG WINAPI IDirect3DRMTexture3Impl_AddRef(IDirect3DRMTexture3* iface)
444 {
445     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
446     ULONG ref = InterlockedIncrement(&This->ref);
447
448     TRACE("(%p)->(): new ref = %d\n", iface, ref);
449
450     return ref;
451 }
452
453 static ULONG WINAPI IDirect3DRMTexture3Impl_Release(IDirect3DRMTexture3* iface)
454 {
455     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
456     ULONG ref = InterlockedDecrement(&This->ref);
457
458     TRACE("(%p)->(): new ref = %d\n", iface, ref);
459
460     if (!ref)
461         HeapFree(GetProcessHeap(), 0, This);
462
463     return ref;
464 }
465
466 /*** IDirect3DRMObject methods ***/
467 static HRESULT WINAPI IDirect3DRMTexture3Impl_Clone(IDirect3DRMTexture3* iface,
468                                                      LPUNKNOWN unknown, REFIID riid,
469                                                      LPVOID* object)
470 {
471     FIXME("(%p)->(%p, %s, %p): stub\n", iface, unknown, debugstr_guid(riid), object);
472
473     return E_NOTIMPL;
474 }
475
476 static HRESULT WINAPI IDirect3DRMTexture3Impl_AddDestroyCallback(IDirect3DRMTexture3* iface,
477                                                                   D3DRMOBJECTCALLBACK cb,
478                                                                   LPVOID argument)
479 {
480     FIXME("(%p)->(%p, %p): stub\n", iface, cb, argument);
481
482     return E_NOTIMPL;
483 }
484
485 static HRESULT WINAPI IDirect3DRMTexture3Impl_DeleteDestroyCallback(IDirect3DRMTexture3* iface,
486                                                                      D3DRMOBJECTCALLBACK cb,
487                                                                      LPVOID argument)
488 {
489     FIXME("(%p)->(%p, %p): stub\n", iface, cb, argument);
490
491     return E_NOTIMPL;
492 }
493
494 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetAppData(IDirect3DRMTexture3* iface,
495                                                           DWORD data)
496 {
497     FIXME("(%p)->(%u): stub\n", iface, data);
498
499     return E_NOTIMPL;
500 }
501
502 static DWORD WINAPI IDirect3DRMTexture3Impl_GetAppData(IDirect3DRMTexture3* iface)
503 {
504     FIXME("(%p)->(): stub\n", iface);
505
506     return 0;
507 }
508
509 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetName(IDirect3DRMTexture3* iface, LPCSTR name)
510 {
511     FIXME("(%p)->(%s): stub\n", iface, name);
512
513     return E_NOTIMPL;
514 }
515
516 static HRESULT WINAPI IDirect3DRMTexture3Impl_GetName(IDirect3DRMTexture3* iface,
517                                                        LPDWORD size, LPSTR name)
518 {
519     FIXME("(%p)->(%p, %p): stub\n", iface, size, name);
520
521     return E_NOTIMPL;
522 }
523
524 static HRESULT WINAPI IDirect3DRMTexture3Impl_GetClassName(IDirect3DRMTexture3* iface,
525                                                            LPDWORD size, LPSTR name)
526 {
527     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
528
529     TRACE("(%p/%p)->(%p, %p)\n", iface, This, size, name);
530
531     if (!size || *size < strlen("Texture") || !name)
532         return E_INVALIDARG;
533
534     strcpy(name, "Texture");
535     *size = sizeof("Texture");
536
537     return D3DRM_OK;
538 }
539
540 /*** IDirect3DRMTexture3 methods ***/
541 static HRESULT WINAPI IDirect3DRMTexture3Impl_InitFromFile(IDirect3DRMTexture3* iface, const char *filename)
542 {
543     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
544
545     FIXME("(%p/%p)->(%s): stub\n", iface, This, debugstr_a(filename));
546
547     return E_NOTIMPL;
548 }
549
550 static HRESULT WINAPI IDirect3DRMTexture3Impl_InitFromSurface(IDirect3DRMTexture3* iface, LPDIRECTDRAWSURFACE surface)
551 {
552     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
553
554     FIXME("(%p/%p)->(%p): stub\n", iface, This, surface);
555
556     return E_NOTIMPL;
557 }
558
559 static HRESULT WINAPI IDirect3DRMTexture3Impl_InitFromResource(IDirect3DRMTexture3* iface, HRSRC resource)
560 {
561     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
562
563     FIXME("(%p/%p)->(%p): stub\n", iface, This, resource);
564
565     return E_NOTIMPL;
566 }
567
568 static HRESULT WINAPI IDirect3DRMTexture3Impl_Changed(IDirect3DRMTexture3* iface, DWORD flags, DWORD nb_rects, LPRECT rects)
569 {
570     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
571
572     FIXME("(%p/%p)->(%x, %u, %p): stub\n", iface, This, flags, nb_rects, rects);
573
574     return E_NOTIMPL;
575 }
576
577 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetColors(IDirect3DRMTexture3* iface, DWORD max_colors)
578 {
579     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
580
581     FIXME("(%p/%p)->(%u): stub\n", iface, This, max_colors);
582
583     return E_NOTIMPL;
584 }
585
586 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetShades(IDirect3DRMTexture3* iface, DWORD max_shades)
587 {
588     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
589
590     FIXME("(%p/%p)->(%u): stub\n", iface, This, max_shades);
591
592     return E_NOTIMPL;
593 }
594
595 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetDecalSize(IDirect3DRMTexture3* iface, D3DVALUE width, D3DVALUE height)
596 {
597     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
598
599     FIXME("(%p/%p)->(%f, %f): stub\n", iface, This, width, height);
600
601     return E_NOTIMPL;
602 }
603
604 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetDecalOrigin(IDirect3DRMTexture3* iface, LONG x, LONG y)
605 {
606     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
607
608     FIXME("(%p/%p)->(%d, %d): stub\n", iface, This, x, y);
609
610     return E_NOTIMPL;
611 }
612
613 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetDecalScale(IDirect3DRMTexture3* iface, DWORD scale)
614 {
615     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
616
617     FIXME("(%p/%p)->(%u): stub\n", iface, This, scale);
618
619     return E_NOTIMPL;
620 }
621
622 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetDecalTransparency(IDirect3DRMTexture3* iface, BOOL transparency)
623 {
624     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
625
626     FIXME("(%p/%p)->(%u): stub\n", iface, This, transparency);
627
628     return E_NOTIMPL;
629 }
630
631 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetDecalTransparentColor(IDirect3DRMTexture3* iface, D3DCOLOR color)
632 {
633     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
634
635     FIXME("(%p/%p)->(%x): stub\n", iface, This, color);
636
637     return E_NOTIMPL;
638 }
639
640 static HRESULT WINAPI IDirect3DRMTexture3Impl_GetDecalSize(IDirect3DRMTexture3* iface, D3DVALUE* width, D3DVALUE* height)
641 {
642     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
643
644     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, height, width);
645
646     return E_NOTIMPL;
647 }
648
649 static HRESULT WINAPI IDirect3DRMTexture3Impl_GetDecalOrigin(IDirect3DRMTexture3* iface, LONG* x, LONG* y)
650 {
651     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
652
653     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, x, y);
654
655     return E_NOTIMPL;
656 }
657
658 static D3DRMIMAGE* WINAPI IDirect3DRMTexture3Impl_GetImage(IDirect3DRMTexture3* iface)
659 {
660     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
661
662     FIXME("(%p/%p)->(): stub\n", iface, This);
663
664     return NULL;
665 }
666
667 static DWORD WINAPI IDirect3DRMTexture3Impl_GetShades(IDirect3DRMTexture3* iface)
668 {
669     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
670
671     FIXME("(%p/%p)->(): stub\n", iface, This);
672
673     return 0;
674 }
675
676 static DWORD WINAPI IDirect3DRMTexture3Impl_GetColors(IDirect3DRMTexture3* iface)
677 {
678     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
679
680     FIXME("(%p/%p)->(): stub\n", iface, This);
681
682     return 0;
683 }
684
685 static DWORD WINAPI IDirect3DRMTexture3Impl_GetDecalScale(IDirect3DRMTexture3* iface)
686 {
687     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
688
689     FIXME("(%p/%p)->(): stub\n", iface, This);
690
691     return 0;
692 }
693
694 static BOOL WINAPI IDirect3DRMTexture3Impl_GetDecalTransparency(IDirect3DRMTexture3* iface)
695 {
696     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
697
698     FIXME("(%p/%p)->(): stub\n", iface, This);
699
700     return FALSE;
701 }
702
703 static D3DCOLOR WINAPI IDirect3DRMTexture3Impl_GetDecalTransparentColor(IDirect3DRMTexture3* iface)
704 {
705     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
706
707     FIXME("(%p/%p)->(): stub\n", iface, This);
708
709     return 0;
710 }
711
712 static HRESULT WINAPI IDirect3DRMTexture3Impl_InitFromImage(IDirect3DRMTexture3* iface, LPD3DRMIMAGE image)
713 {
714     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
715
716     FIXME("(%p/%p)->(%p): stub\n", iface, This, image);
717
718     return E_NOTIMPL;
719 }
720
721 static HRESULT WINAPI IDirect3DRMTexture3Impl_InitFromResource2(IDirect3DRMTexture3* iface, HMODULE module,
722                                                                LPCSTR /* LPCTSTR */ name, LPCSTR /* LPCTSTR */ type)
723 {
724     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
725
726     FIXME("(%p/%p)->(%p, %s, %s): stub\n", iface, This, module, debugstr_a(name), debugstr_a(type));
727
728     return E_NOTIMPL;
729 }
730
731 static HRESULT WINAPI IDirect3DRMTexture3Impl_GenerateMIPMap(IDirect3DRMTexture3* iface, DWORD flags)
732 {
733     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
734
735     FIXME("(%p/%p)->(%x): stub\n", iface, This, flags);
736
737     return E_NOTIMPL;
738 }
739
740 static HRESULT WINAPI IDirect3DRMTexture3Impl_GetSurface(IDirect3DRMTexture3* iface, DWORD flags, LPDIRECTDRAWSURFACE* surface)
741 {
742     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
743
744     FIXME("(%p/%p)->(%x, %p): stub\n", iface, This, flags, surface);
745
746     return E_NOTIMPL;
747 }
748
749 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetCacheOptions(IDirect3DRMTexture3* iface, LONG importance, DWORD flags)
750 {
751     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
752
753     FIXME("(%p/%p)->(%d, %x): stub\n", iface, This, importance, flags);
754
755     return E_NOTIMPL;
756 }
757
758 static HRESULT WINAPI IDirect3DRMTexture3Impl_GetCacheOptions(IDirect3DRMTexture3* iface, LPLONG importance, LPDWORD flags)
759 {
760     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
761
762     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, importance, flags);
763
764     return E_NOTIMPL;
765 }
766
767 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetDownsampleCallback(IDirect3DRMTexture3* iface, D3DRMDOWNSAMPLECALLBACK callback, LPVOID arg)
768 {
769     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
770
771     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, callback, arg);
772
773     return E_NOTIMPL;
774 }
775
776 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetValidationCallback(IDirect3DRMTexture3* iface, D3DRMVALIDATIONCALLBACK callback, LPVOID arg)
777 {
778     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
779
780     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, callback, arg);
781
782     return E_NOTIMPL;
783 }
784
785 static const struct IDirect3DRMTexture3Vtbl Direct3DRMTexture3_Vtbl =
786 {
787     /*** IUnknown methods ***/
788     IDirect3DRMTexture3Impl_QueryInterface,
789     IDirect3DRMTexture3Impl_AddRef,
790     IDirect3DRMTexture3Impl_Release,
791     /*** IDirect3DRMObject methods ***/
792     IDirect3DRMTexture3Impl_Clone,
793     IDirect3DRMTexture3Impl_AddDestroyCallback,
794     IDirect3DRMTexture3Impl_DeleteDestroyCallback,
795     IDirect3DRMTexture3Impl_SetAppData,
796     IDirect3DRMTexture3Impl_GetAppData,
797     IDirect3DRMTexture3Impl_SetName,
798     IDirect3DRMTexture3Impl_GetName,
799     IDirect3DRMTexture3Impl_GetClassName,
800     /*** IDirect3DRMTexture3 methods ***/
801     IDirect3DRMTexture3Impl_InitFromFile,
802     IDirect3DRMTexture3Impl_InitFromSurface,
803     IDirect3DRMTexture3Impl_InitFromResource,
804     IDirect3DRMTexture3Impl_Changed,
805     IDirect3DRMTexture3Impl_SetColors,
806     IDirect3DRMTexture3Impl_SetShades,
807     IDirect3DRMTexture3Impl_SetDecalSize,
808     IDirect3DRMTexture3Impl_SetDecalOrigin,
809     IDirect3DRMTexture3Impl_SetDecalScale,
810     IDirect3DRMTexture3Impl_SetDecalTransparency,
811     IDirect3DRMTexture3Impl_SetDecalTransparentColor,
812     IDirect3DRMTexture3Impl_GetDecalSize,
813     IDirect3DRMTexture3Impl_GetDecalOrigin,
814     IDirect3DRMTexture3Impl_GetImage,
815     IDirect3DRMTexture3Impl_GetShades,
816     IDirect3DRMTexture3Impl_GetColors,
817     IDirect3DRMTexture3Impl_GetDecalScale,
818     IDirect3DRMTexture3Impl_GetDecalTransparency,
819     IDirect3DRMTexture3Impl_GetDecalTransparentColor,
820     IDirect3DRMTexture3Impl_InitFromImage,
821     IDirect3DRMTexture3Impl_InitFromResource2,
822     IDirect3DRMTexture3Impl_GenerateMIPMap,
823     IDirect3DRMTexture3Impl_GetSurface,
824     IDirect3DRMTexture3Impl_SetCacheOptions,
825     IDirect3DRMTexture3Impl_GetCacheOptions,
826     IDirect3DRMTexture3Impl_SetDownsampleCallback,
827     IDirect3DRMTexture3Impl_SetValidationCallback
828 };
829
830 HRESULT Direct3DRMTexture_create(REFIID riid, IUnknown** ret_iface)
831 {
832     IDirect3DRMTextureImpl* object;
833
834     TRACE("(%p)\n", ret_iface);
835
836     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMTextureImpl));
837     if (!object)
838     {
839         ERR("Out of memory\n");
840         return E_OUTOFMEMORY;
841     }
842
843     object->IDirect3DRMTexture2_iface.lpVtbl = &Direct3DRMTexture2_Vtbl;
844     object->IDirect3DRMTexture3_iface.lpVtbl = &Direct3DRMTexture3_Vtbl;
845     object->ref = 1;
846
847     if (IsEqualGUID(riid, &IID_IDirect3DRMTexture3))
848         *ret_iface = (IUnknown*)&object->IDirect3DRMTexture3_iface;
849     else
850         *ret_iface = (IUnknown*)&object->IDirect3DRMTexture2_iface;
851
852     return S_OK;
853 }