reg/tests: Test import with non-standard registry file headers.
[wine.git] / dlls / d3dx9_36 / animation.c
blob818bd7ab10387f70e17c6ffa1e55000111393f98
1 /*
2 * Animation Controller operations specific to D3DX9.
4 * Copyright (C) 2015 Christian Costa
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.
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.
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
21 #include "config.h"
22 #include "wine/port.h"
24 #include "d3dx9_private.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
28 struct d3dx9_animation_controller
30 ID3DXAnimationController ID3DXAnimationController_iface;
31 LONG ref;
33 UINT max_outputs;
34 UINT max_sets;
35 UINT max_tracks;
36 UINT max_events;
39 static inline struct d3dx9_animation_controller *impl_from_ID3DXAnimationController(ID3DXAnimationController *iface)
41 return CONTAINING_RECORD(iface, struct d3dx9_animation_controller, ID3DXAnimationController_iface);
44 static HRESULT WINAPI d3dx9_animation_controller_QueryInterface(ID3DXAnimationController *iface, REFIID riid, void **out)
46 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
48 if (IsEqualGUID(riid, &IID_IUnknown) ||
49 IsEqualGUID(riid, &IID_ID3DXAnimationController))
51 iface->lpVtbl->AddRef(iface);
52 *out = iface;
53 return D3D_OK;
56 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
57 *out = NULL;
58 return E_NOINTERFACE;
61 static ULONG WINAPI d3dx9_animation_controller_AddRef(ID3DXAnimationController *iface)
63 struct d3dx9_animation_controller *animation = impl_from_ID3DXAnimationController(iface);
64 ULONG refcount = InterlockedIncrement(&animation->ref);
66 TRACE("%p increasing refcount to %u.\n", animation, refcount);
68 return refcount;
71 static ULONG WINAPI d3dx9_animation_controller_Release(ID3DXAnimationController *iface)
73 struct d3dx9_animation_controller *animation = impl_from_ID3DXAnimationController(iface);
74 ULONG refcount = InterlockedDecrement(&animation->ref);
76 TRACE("%p decreasing refcount to %u.\n", animation, refcount);
78 if (!refcount)
80 HeapFree(GetProcessHeap(), 0, animation);
83 return refcount;
86 static UINT WINAPI d3dx9_animation_controller_GetMaxNumAnimationOutputs(ID3DXAnimationController *iface)
88 struct d3dx9_animation_controller *animation = impl_from_ID3DXAnimationController(iface);
90 TRACE("iface %p.\n", iface);
92 return animation->max_outputs;
95 static UINT WINAPI d3dx9_animation_controller_GetMaxNumAnimationSets(ID3DXAnimationController *iface)
97 struct d3dx9_animation_controller *animation = impl_from_ID3DXAnimationController(iface);
99 TRACE("iface %p.\n", iface);
101 return animation->max_sets;
104 static UINT WINAPI d3dx9_animation_controller_GetMaxNumTracks(ID3DXAnimationController *iface)
106 struct d3dx9_animation_controller *animation = impl_from_ID3DXAnimationController(iface);
108 TRACE("iface %p.\n", iface);
110 return animation->max_tracks;
113 static UINT WINAPI d3dx9_animation_controller_GetMaxNumEvents(ID3DXAnimationController *iface)
115 struct d3dx9_animation_controller *animation = impl_from_ID3DXAnimationController(iface);
117 TRACE("iface %p.\n", iface);
119 return animation->max_events;
122 static HRESULT WINAPI d3dx9_animation_controller_RegisterAnimationOutput(ID3DXAnimationController *iface,
123 const char *name, D3DXMATRIX *matrix, D3DXVECTOR3 *scale, D3DXQUATERNION *rotation, D3DXVECTOR3 *translation)
125 FIXME("iface %p, name %s, matrix %p, scale %p, rotation %p, translation %p stub.\n", iface, debugstr_a(name),
126 matrix, scale, rotation, translation);
128 return E_NOTIMPL;
131 static HRESULT WINAPI d3dx9_animation_controller_RegisterAnimationSet(ID3DXAnimationController *iface,
132 ID3DXAnimationSet *anim_set)
134 FIXME("iface %p, anim_set %p stub.\n", iface, anim_set);
136 return E_NOTIMPL;
139 static HRESULT WINAPI d3dx9_animation_controller_UnregisterAnimationSet(ID3DXAnimationController *iface,
140 ID3DXAnimationSet *anim_set)
142 FIXME("iface %p, anim_set %p stub.\n", iface, anim_set);
144 return E_NOTIMPL;
147 static UINT WINAPI d3dx9_animation_controller_GetNumAnimationSets(ID3DXAnimationController *iface)
149 FIXME("iface %p stub.\n", iface);
151 return 0;
154 static HRESULT WINAPI d3dx9_animation_controller_GetAnimationSet(ID3DXAnimationController *iface,
155 UINT index, ID3DXAnimationSet **anim_set)
157 FIXME("iface %p, index %u, anim_set %p stub.\n", iface, index, anim_set);
159 return E_NOTIMPL;
162 static HRESULT WINAPI d3dx9_animation_controller_GetAnimationSetByName(ID3DXAnimationController *iface,
163 const char *name, ID3DXAnimationSet **anim_set)
165 FIXME("iface %p, name %s, anim_set %p stub.\n", iface, debugstr_a(name), anim_set);
167 return E_NOTIMPL;
170 static HRESULT WINAPI d3dx9_animation_controller_AdvanceTime(ID3DXAnimationController *iface, double time_delta,
171 ID3DXAnimationCallbackHandler *callback_handler)
173 FIXME("iface %p, time_delta %.16e, callback_handler %p stub.\n", iface, time_delta, callback_handler);
175 return E_NOTIMPL;
178 static HRESULT WINAPI d3dx9_animation_controller_Reset(ID3DXAnimationController *iface)
180 FIXME("iface %p stub.\n", iface);
182 return E_NOTIMPL;
185 static double WINAPI d3dx9_animation_controller_GetTime(ID3DXAnimationController *iface)
187 FIXME("iface %p stub.\n", iface);
189 return 0.0;
192 static HRESULT WINAPI d3dx9_animation_controller_SetTrackAnimationSet(ID3DXAnimationController *iface,
193 UINT track, ID3DXAnimationSet *anim_set)
195 FIXME("iface %p, track %u, anim_set %p stub.\n", iface, track, anim_set);
197 return E_NOTIMPL;
200 static HRESULT WINAPI d3dx9_animation_controller_GetTrackAnimationSet(ID3DXAnimationController *iface,
201 UINT track, ID3DXAnimationSet **anim_set)
203 FIXME("iface %p, track %u, anim_set %p stub.\n", iface, track, anim_set);
205 return E_NOTIMPL;
208 static HRESULT WINAPI d3dx9_animation_controller_SetTrackPriority(ID3DXAnimationController *iface,
209 UINT track, D3DXPRIORITY_TYPE priority)
211 FIXME("iface %p, track %u, priority %u stub.\n", iface, track, priority);
213 return E_NOTIMPL;
216 static HRESULT WINAPI d3dx9_animation_controller_SetTrackSpeed(ID3DXAnimationController *iface,
217 UINT track, float speed)
219 FIXME("iface %p, track %u, speed %.8e stub.\n", iface, track, speed);
221 return E_NOTIMPL;
224 static HRESULT WINAPI d3dx9_animation_controller_SetTrackWeight(ID3DXAnimationController *iface,
225 UINT track, float weight)
227 FIXME("iface %p, track %u, weight %.8e stub.\n", iface, track, weight);
229 return E_NOTIMPL;
232 static HRESULT WINAPI d3dx9_animation_controller_SetTrackPosition(ID3DXAnimationController *iface,
233 UINT track, double position)
235 FIXME("iface %p, track %u, position %.16e stub.\n", iface, track, position);
237 return E_NOTIMPL;
240 static HRESULT WINAPI d3dx9_animation_controller_SetTrackEnable(ID3DXAnimationController *iface,
241 UINT track, BOOL enable)
243 FIXME("iface %p, track %u, enable %#x stub.\n", iface, track, enable);
245 return E_NOTIMPL;
248 static HRESULT WINAPI d3dx9_animation_controller_SetTrackDesc(ID3DXAnimationController *iface,
249 UINT track, D3DXTRACK_DESC *desc)
251 FIXME("iface %p, track %u, desc %p stub.\n", iface, track, desc);
253 return E_NOTIMPL;
256 static HRESULT WINAPI d3dx9_animation_controller_GetTrackDesc(ID3DXAnimationController *iface,
257 UINT track, D3DXTRACK_DESC *desc)
259 FIXME("iface %p, track %u, desc %p stub.\n", iface, track, desc);
261 return E_NOTIMPL;
264 static HRESULT WINAPI d3dx9_animation_controller_SetPriorityBlend(ID3DXAnimationController *iface,
265 float blend_weight)
267 FIXME("iface %p, blend_weight %.8e stub.\n", iface, blend_weight);
269 return E_NOTIMPL;
272 static float WINAPI d3dx9_animation_controller_GetPriorityBlend(ID3DXAnimationController *iface)
274 FIXME("iface %p stub.\n", iface);
276 return 0.0f;
279 static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_KeyTrackSpeed(ID3DXAnimationController *iface,
280 UINT track, float new_speed, double start_time, double duration, D3DXTRANSITION_TYPE transition)
282 FIXME("iface %p, track %u, new_speed %.8e, start_time %.16e, duration %.16e, transition %u stub.\n", iface,
283 track, new_speed, start_time, duration, transition);
285 return 0;
288 static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_KeyTrackWeight(ID3DXAnimationController *iface,
289 UINT track, float new_weight, double start_time, double duration, D3DXTRANSITION_TYPE transition)
291 FIXME("iface %p, track %u, new_weight %.8e, start_time %.16e, duration %.16e, transition %u stub.\n", iface,
292 track, new_weight, start_time, duration, transition);
294 return 0;
297 static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_KeyTrackPosition(ID3DXAnimationController *iface,
298 UINT track, double new_position, double start_time)
300 FIXME("iface %p, track %u, new_position %.16e, start_time %.16e stub.\n", iface,
301 track, new_position, start_time);
303 return 0;
306 static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_KeyTrackEnable(ID3DXAnimationController *iface,
307 UINT track, BOOL new_enable, double start_time)
309 FIXME("iface %p, track %u, new_enable %#x, start_time %.16e stub.\n", iface,
310 track, new_enable, start_time);
312 return 0;
315 static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_KeyTrackBlend(ID3DXAnimationController *iface,
316 float new_blend_weight, double start_time, double duration, D3DXTRANSITION_TYPE transition)
318 FIXME("iface %p, new_blend_weight %.8e, start_time %.16e, duration %.16e, transition %u stub.\n", iface,
319 new_blend_weight, start_time, duration, transition);
321 return 0;
324 static HRESULT WINAPI d3dx9_animation_controller_UnkeyEvent(ID3DXAnimationController *iface, D3DXEVENTHANDLE event)
326 FIXME("iface %p, event %u stub.\n", iface, event);
328 return E_NOTIMPL;
331 static HRESULT WINAPI d3dx9_animation_controller_UnkeyAllTrackEvents(ID3DXAnimationController *iface, UINT track)
333 FIXME("iface %p, track %u stub.\n", iface, track);
335 return E_NOTIMPL;
338 static HRESULT WINAPI d3dx9_animation_controller_UnkeyAllPriorityBlends(ID3DXAnimationController *iface)
340 FIXME("iface %p stub.\n", iface);
342 return E_NOTIMPL;
345 static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_GetCurrentTrackEvent(ID3DXAnimationController *iface,
346 UINT track, D3DXEVENT_TYPE event_type)
348 FIXME("iface %p, track %u, event_type %u stub.\n", iface, track, event_type);
350 return 0;
353 static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_GetCurrentPriorityBlend(ID3DXAnimationController *iface)
355 FIXME("iface %p stub.\n", iface);
357 return 0;
360 static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_GetUpcomingTrackEvent(ID3DXAnimationController *iface,
361 UINT track, D3DXEVENTHANDLE event)
363 FIXME("iface %p, track %u, event %u stub.\n", iface, track, event);
365 return 0;
368 static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_GetUpcomingPriorityBlend(ID3DXAnimationController *iface,
369 D3DXEVENTHANDLE event)
371 FIXME("iface %p, event %u stub.\n", iface, event);
373 return 0;
376 static HRESULT WINAPI d3dx9_animation_controller_ValidateEvent(ID3DXAnimationController *iface, D3DXEVENTHANDLE event)
378 FIXME("iface %p, event %u stub.\n", iface, event);
380 return E_NOTIMPL;
383 static HRESULT WINAPI d3dx9_animation_controller_GetEventDesc(ID3DXAnimationController *iface,
384 D3DXEVENTHANDLE event, D3DXEVENT_DESC *desc)
386 FIXME("iface %p, event %u, desc %p stub.\n", iface, event, desc);
388 return E_NOTIMPL;
391 static HRESULT WINAPI d3dx9_animation_controller_CloneAnimationController(ID3DXAnimationController *iface, UINT max_outputs,
392 UINT max_sets, UINT max_tracks, UINT max_events, ID3DXAnimationController **anim_controller)
394 FIXME("iface %p, max_outputs %u, max_sets %u, max_tracks %u, max_events %u, anim_controller %p stub.\n",
395 iface, max_outputs, max_sets, max_tracks, max_events, anim_controller);
397 return E_NOTIMPL;
400 static const struct ID3DXAnimationControllerVtbl d3dx9_animation_controller_vtbl =
402 d3dx9_animation_controller_QueryInterface,
403 d3dx9_animation_controller_AddRef,
404 d3dx9_animation_controller_Release,
405 d3dx9_animation_controller_GetMaxNumAnimationOutputs,
406 d3dx9_animation_controller_GetMaxNumAnimationSets,
407 d3dx9_animation_controller_GetMaxNumTracks,
408 d3dx9_animation_controller_GetMaxNumEvents,
409 d3dx9_animation_controller_RegisterAnimationOutput,
410 d3dx9_animation_controller_RegisterAnimationSet,
411 d3dx9_animation_controller_UnregisterAnimationSet,
412 d3dx9_animation_controller_GetNumAnimationSets,
413 d3dx9_animation_controller_GetAnimationSet,
414 d3dx9_animation_controller_GetAnimationSetByName,
415 d3dx9_animation_controller_AdvanceTime,
416 d3dx9_animation_controller_Reset,
417 d3dx9_animation_controller_GetTime,
418 d3dx9_animation_controller_SetTrackAnimationSet,
419 d3dx9_animation_controller_GetTrackAnimationSet,
420 d3dx9_animation_controller_SetTrackPriority,
421 d3dx9_animation_controller_SetTrackSpeed,
422 d3dx9_animation_controller_SetTrackWeight,
423 d3dx9_animation_controller_SetTrackPosition,
424 d3dx9_animation_controller_SetTrackEnable,
425 d3dx9_animation_controller_SetTrackDesc,
426 d3dx9_animation_controller_GetTrackDesc,
427 d3dx9_animation_controller_SetPriorityBlend,
428 d3dx9_animation_controller_GetPriorityBlend,
429 d3dx9_animation_controller_KeyTrackSpeed,
430 d3dx9_animation_controller_KeyTrackWeight,
431 d3dx9_animation_controller_KeyTrackPosition,
432 d3dx9_animation_controller_KeyTrackEnable,
433 d3dx9_animation_controller_KeyTrackBlend,
434 d3dx9_animation_controller_UnkeyEvent,
435 d3dx9_animation_controller_UnkeyAllTrackEvents,
436 d3dx9_animation_controller_UnkeyAllPriorityBlends,
437 d3dx9_animation_controller_GetCurrentTrackEvent,
438 d3dx9_animation_controller_GetCurrentPriorityBlend,
439 d3dx9_animation_controller_GetUpcomingTrackEvent,
440 d3dx9_animation_controller_GetUpcomingPriorityBlend,
441 d3dx9_animation_controller_ValidateEvent,
442 d3dx9_animation_controller_GetEventDesc,
443 d3dx9_animation_controller_CloneAnimationController
446 HRESULT WINAPI D3DXCreateAnimationController(UINT max_outputs, UINT max_sets,
447 UINT max_tracks, UINT max_events, ID3DXAnimationController **controller)
449 struct d3dx9_animation_controller *object;
451 TRACE("max_outputs %u, max_sets %u, max_tracks %u, max_events %u, controller %p.\n",
452 max_outputs, max_sets, max_tracks, max_events, controller);
454 if (!max_outputs || !max_sets || !max_tracks || !max_events || !controller)
455 return D3D_OK;
457 object = HeapAlloc(GetProcessHeap(), 0, sizeof(*object));
458 if (!object)
459 return E_OUTOFMEMORY;
461 object->ID3DXAnimationController_iface.lpVtbl = &d3dx9_animation_controller_vtbl;
462 object->ref = 1;
463 object->max_outputs = max_outputs;
464 object->max_sets = max_sets;
465 object->max_tracks = max_tracks;
466 object->max_events = max_events;
468 *controller = &object->ID3DXAnimationController_iface;
470 return D3D_OK;