d3dx9: Fix some spec file entries.
[wine.git] / dlls / d3dx9_36 / animation.c
blobde6d69d383a0ae8196988634a3c6188d3c2b949b
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
22 #include "d3dx9_private.h"
24 WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
26 struct d3dx9_animation_controller
28 ID3DXAnimationController ID3DXAnimationController_iface;
29 LONG ref;
31 UINT max_outputs;
32 UINT max_sets;
33 UINT max_tracks;
34 UINT max_events;
37 static inline struct d3dx9_animation_controller *impl_from_ID3DXAnimationController(ID3DXAnimationController *iface)
39 return CONTAINING_RECORD(iface, struct d3dx9_animation_controller, ID3DXAnimationController_iface);
42 static HRESULT WINAPI d3dx9_animation_controller_QueryInterface(ID3DXAnimationController *iface, REFIID riid, void **out)
44 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
46 if (IsEqualGUID(riid, &IID_IUnknown) ||
47 IsEqualGUID(riid, &IID_ID3DXAnimationController))
49 iface->lpVtbl->AddRef(iface);
50 *out = iface;
51 return D3D_OK;
54 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
55 *out = NULL;
56 return E_NOINTERFACE;
59 static ULONG WINAPI d3dx9_animation_controller_AddRef(ID3DXAnimationController *iface)
61 struct d3dx9_animation_controller *animation = impl_from_ID3DXAnimationController(iface);
62 ULONG refcount = InterlockedIncrement(&animation->ref);
64 TRACE("%p increasing refcount to %u.\n", animation, refcount);
66 return refcount;
69 static ULONG WINAPI d3dx9_animation_controller_Release(ID3DXAnimationController *iface)
71 struct d3dx9_animation_controller *animation = impl_from_ID3DXAnimationController(iface);
72 ULONG refcount = InterlockedDecrement(&animation->ref);
74 TRACE("%p decreasing refcount to %u.\n", animation, refcount);
76 if (!refcount)
78 HeapFree(GetProcessHeap(), 0, animation);
81 return refcount;
84 static UINT WINAPI d3dx9_animation_controller_GetMaxNumAnimationOutputs(ID3DXAnimationController *iface)
86 struct d3dx9_animation_controller *animation = impl_from_ID3DXAnimationController(iface);
88 TRACE("iface %p.\n", iface);
90 return animation->max_outputs;
93 static UINT WINAPI d3dx9_animation_controller_GetMaxNumAnimationSets(ID3DXAnimationController *iface)
95 struct d3dx9_animation_controller *animation = impl_from_ID3DXAnimationController(iface);
97 TRACE("iface %p.\n", iface);
99 return animation->max_sets;
102 static UINT WINAPI d3dx9_animation_controller_GetMaxNumTracks(ID3DXAnimationController *iface)
104 struct d3dx9_animation_controller *animation = impl_from_ID3DXAnimationController(iface);
106 TRACE("iface %p.\n", iface);
108 return animation->max_tracks;
111 static UINT WINAPI d3dx9_animation_controller_GetMaxNumEvents(ID3DXAnimationController *iface)
113 struct d3dx9_animation_controller *animation = impl_from_ID3DXAnimationController(iface);
115 TRACE("iface %p.\n", iface);
117 return animation->max_events;
120 static HRESULT WINAPI d3dx9_animation_controller_RegisterAnimationOutput(ID3DXAnimationController *iface,
121 const char *name, D3DXMATRIX *matrix, D3DXVECTOR3 *scale, D3DXQUATERNION *rotation, D3DXVECTOR3 *translation)
123 FIXME("iface %p, name %s, matrix %p, scale %p, rotation %p, translation %p stub.\n", iface, debugstr_a(name),
124 matrix, scale, rotation, translation);
126 return E_NOTIMPL;
129 static HRESULT WINAPI d3dx9_animation_controller_RegisterAnimationSet(ID3DXAnimationController *iface,
130 ID3DXAnimationSet *anim_set)
132 FIXME("iface %p, anim_set %p stub.\n", iface, anim_set);
134 return E_NOTIMPL;
137 static HRESULT WINAPI d3dx9_animation_controller_UnregisterAnimationSet(ID3DXAnimationController *iface,
138 ID3DXAnimationSet *anim_set)
140 FIXME("iface %p, anim_set %p stub.\n", iface, anim_set);
142 return E_NOTIMPL;
145 static UINT WINAPI d3dx9_animation_controller_GetNumAnimationSets(ID3DXAnimationController *iface)
147 FIXME("iface %p stub.\n", iface);
149 return 0;
152 static HRESULT WINAPI d3dx9_animation_controller_GetAnimationSet(ID3DXAnimationController *iface,
153 UINT index, ID3DXAnimationSet **anim_set)
155 FIXME("iface %p, index %u, anim_set %p stub.\n", iface, index, anim_set);
157 return E_NOTIMPL;
160 static HRESULT WINAPI d3dx9_animation_controller_GetAnimationSetByName(ID3DXAnimationController *iface,
161 const char *name, ID3DXAnimationSet **anim_set)
163 FIXME("iface %p, name %s, anim_set %p stub.\n", iface, debugstr_a(name), anim_set);
165 return E_NOTIMPL;
168 static HRESULT WINAPI d3dx9_animation_controller_AdvanceTime(ID3DXAnimationController *iface, double time_delta,
169 ID3DXAnimationCallbackHandler *callback_handler)
171 FIXME("iface %p, time_delta %.16e, callback_handler %p stub.\n", iface, time_delta, callback_handler);
173 return E_NOTIMPL;
176 static HRESULT WINAPI d3dx9_animation_controller_Reset(ID3DXAnimationController *iface)
178 FIXME("iface %p stub.\n", iface);
180 return E_NOTIMPL;
183 static double WINAPI d3dx9_animation_controller_GetTime(ID3DXAnimationController *iface)
185 FIXME("iface %p stub.\n", iface);
187 return 0.0;
190 static HRESULT WINAPI d3dx9_animation_controller_SetTrackAnimationSet(ID3DXAnimationController *iface,
191 UINT track, ID3DXAnimationSet *anim_set)
193 FIXME("iface %p, track %u, anim_set %p stub.\n", iface, track, anim_set);
195 return E_NOTIMPL;
198 static HRESULT WINAPI d3dx9_animation_controller_GetTrackAnimationSet(ID3DXAnimationController *iface,
199 UINT track, ID3DXAnimationSet **anim_set)
201 FIXME("iface %p, track %u, anim_set %p stub.\n", iface, track, anim_set);
203 return E_NOTIMPL;
206 static HRESULT WINAPI d3dx9_animation_controller_SetTrackPriority(ID3DXAnimationController *iface,
207 UINT track, D3DXPRIORITY_TYPE priority)
209 FIXME("iface %p, track %u, priority %u stub.\n", iface, track, priority);
211 return E_NOTIMPL;
214 static HRESULT WINAPI d3dx9_animation_controller_SetTrackSpeed(ID3DXAnimationController *iface,
215 UINT track, float speed)
217 FIXME("iface %p, track %u, speed %.8e stub.\n", iface, track, speed);
219 return E_NOTIMPL;
222 static HRESULT WINAPI d3dx9_animation_controller_SetTrackWeight(ID3DXAnimationController *iface,
223 UINT track, float weight)
225 FIXME("iface %p, track %u, weight %.8e stub.\n", iface, track, weight);
227 return E_NOTIMPL;
230 static HRESULT WINAPI d3dx9_animation_controller_SetTrackPosition(ID3DXAnimationController *iface,
231 UINT track, double position)
233 FIXME("iface %p, track %u, position %.16e stub.\n", iface, track, position);
235 return E_NOTIMPL;
238 static HRESULT WINAPI d3dx9_animation_controller_SetTrackEnable(ID3DXAnimationController *iface,
239 UINT track, BOOL enable)
241 FIXME("iface %p, track %u, enable %#x stub.\n", iface, track, enable);
243 return E_NOTIMPL;
246 static HRESULT WINAPI d3dx9_animation_controller_SetTrackDesc(ID3DXAnimationController *iface,
247 UINT track, D3DXTRACK_DESC *desc)
249 FIXME("iface %p, track %u, desc %p stub.\n", iface, track, desc);
251 return E_NOTIMPL;
254 static HRESULT WINAPI d3dx9_animation_controller_GetTrackDesc(ID3DXAnimationController *iface,
255 UINT track, D3DXTRACK_DESC *desc)
257 FIXME("iface %p, track %u, desc %p stub.\n", iface, track, desc);
259 return E_NOTIMPL;
262 static HRESULT WINAPI d3dx9_animation_controller_SetPriorityBlend(ID3DXAnimationController *iface,
263 float blend_weight)
265 FIXME("iface %p, blend_weight %.8e stub.\n", iface, blend_weight);
267 return E_NOTIMPL;
270 static float WINAPI d3dx9_animation_controller_GetPriorityBlend(ID3DXAnimationController *iface)
272 FIXME("iface %p stub.\n", iface);
274 return 0.0f;
277 static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_KeyTrackSpeed(ID3DXAnimationController *iface,
278 UINT track, float new_speed, double start_time, double duration, D3DXTRANSITION_TYPE transition)
280 FIXME("iface %p, track %u, new_speed %.8e, start_time %.16e, duration %.16e, transition %u stub.\n", iface,
281 track, new_speed, start_time, duration, transition);
283 return 0;
286 static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_KeyTrackWeight(ID3DXAnimationController *iface,
287 UINT track, float new_weight, double start_time, double duration, D3DXTRANSITION_TYPE transition)
289 FIXME("iface %p, track %u, new_weight %.8e, start_time %.16e, duration %.16e, transition %u stub.\n", iface,
290 track, new_weight, start_time, duration, transition);
292 return 0;
295 static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_KeyTrackPosition(ID3DXAnimationController *iface,
296 UINT track, double new_position, double start_time)
298 FIXME("iface %p, track %u, new_position %.16e, start_time %.16e stub.\n", iface,
299 track, new_position, start_time);
301 return 0;
304 static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_KeyTrackEnable(ID3DXAnimationController *iface,
305 UINT track, BOOL new_enable, double start_time)
307 FIXME("iface %p, track %u, new_enable %#x, start_time %.16e stub.\n", iface,
308 track, new_enable, start_time);
310 return 0;
313 static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_KeyTrackBlend(ID3DXAnimationController *iface,
314 float new_blend_weight, double start_time, double duration, D3DXTRANSITION_TYPE transition)
316 FIXME("iface %p, new_blend_weight %.8e, start_time %.16e, duration %.16e, transition %u stub.\n", iface,
317 new_blend_weight, start_time, duration, transition);
319 return 0;
322 static HRESULT WINAPI d3dx9_animation_controller_UnkeyEvent(ID3DXAnimationController *iface, D3DXEVENTHANDLE event)
324 FIXME("iface %p, event %u stub.\n", iface, event);
326 return E_NOTIMPL;
329 static HRESULT WINAPI d3dx9_animation_controller_UnkeyAllTrackEvents(ID3DXAnimationController *iface, UINT track)
331 FIXME("iface %p, track %u stub.\n", iface, track);
333 return E_NOTIMPL;
336 static HRESULT WINAPI d3dx9_animation_controller_UnkeyAllPriorityBlends(ID3DXAnimationController *iface)
338 FIXME("iface %p stub.\n", iface);
340 return E_NOTIMPL;
343 static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_GetCurrentTrackEvent(ID3DXAnimationController *iface,
344 UINT track, D3DXEVENT_TYPE event_type)
346 FIXME("iface %p, track %u, event_type %u stub.\n", iface, track, event_type);
348 return 0;
351 static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_GetCurrentPriorityBlend(ID3DXAnimationController *iface)
353 FIXME("iface %p stub.\n", iface);
355 return 0;
358 static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_GetUpcomingTrackEvent(ID3DXAnimationController *iface,
359 UINT track, D3DXEVENTHANDLE event)
361 FIXME("iface %p, track %u, event %u stub.\n", iface, track, event);
363 return 0;
366 static D3DXEVENTHANDLE WINAPI d3dx9_animation_controller_GetUpcomingPriorityBlend(ID3DXAnimationController *iface,
367 D3DXEVENTHANDLE event)
369 FIXME("iface %p, event %u stub.\n", iface, event);
371 return 0;
374 static HRESULT WINAPI d3dx9_animation_controller_ValidateEvent(ID3DXAnimationController *iface, D3DXEVENTHANDLE event)
376 FIXME("iface %p, event %u stub.\n", iface, event);
378 return E_NOTIMPL;
381 static HRESULT WINAPI d3dx9_animation_controller_GetEventDesc(ID3DXAnimationController *iface,
382 D3DXEVENTHANDLE event, D3DXEVENT_DESC *desc)
384 FIXME("iface %p, event %u, desc %p stub.\n", iface, event, desc);
386 return E_NOTIMPL;
389 static HRESULT WINAPI d3dx9_animation_controller_CloneAnimationController(ID3DXAnimationController *iface, UINT max_outputs,
390 UINT max_sets, UINT max_tracks, UINT max_events, ID3DXAnimationController **anim_controller)
392 FIXME("iface %p, max_outputs %u, max_sets %u, max_tracks %u, max_events %u, anim_controller %p stub.\n",
393 iface, max_outputs, max_sets, max_tracks, max_events, anim_controller);
395 return E_NOTIMPL;
398 static const struct ID3DXAnimationControllerVtbl d3dx9_animation_controller_vtbl =
400 d3dx9_animation_controller_QueryInterface,
401 d3dx9_animation_controller_AddRef,
402 d3dx9_animation_controller_Release,
403 d3dx9_animation_controller_GetMaxNumAnimationOutputs,
404 d3dx9_animation_controller_GetMaxNumAnimationSets,
405 d3dx9_animation_controller_GetMaxNumTracks,
406 d3dx9_animation_controller_GetMaxNumEvents,
407 d3dx9_animation_controller_RegisterAnimationOutput,
408 d3dx9_animation_controller_RegisterAnimationSet,
409 d3dx9_animation_controller_UnregisterAnimationSet,
410 d3dx9_animation_controller_GetNumAnimationSets,
411 d3dx9_animation_controller_GetAnimationSet,
412 d3dx9_animation_controller_GetAnimationSetByName,
413 d3dx9_animation_controller_AdvanceTime,
414 d3dx9_animation_controller_Reset,
415 d3dx9_animation_controller_GetTime,
416 d3dx9_animation_controller_SetTrackAnimationSet,
417 d3dx9_animation_controller_GetTrackAnimationSet,
418 d3dx9_animation_controller_SetTrackPriority,
419 d3dx9_animation_controller_SetTrackSpeed,
420 d3dx9_animation_controller_SetTrackWeight,
421 d3dx9_animation_controller_SetTrackPosition,
422 d3dx9_animation_controller_SetTrackEnable,
423 d3dx9_animation_controller_SetTrackDesc,
424 d3dx9_animation_controller_GetTrackDesc,
425 d3dx9_animation_controller_SetPriorityBlend,
426 d3dx9_animation_controller_GetPriorityBlend,
427 d3dx9_animation_controller_KeyTrackSpeed,
428 d3dx9_animation_controller_KeyTrackWeight,
429 d3dx9_animation_controller_KeyTrackPosition,
430 d3dx9_animation_controller_KeyTrackEnable,
431 d3dx9_animation_controller_KeyTrackBlend,
432 d3dx9_animation_controller_UnkeyEvent,
433 d3dx9_animation_controller_UnkeyAllTrackEvents,
434 d3dx9_animation_controller_UnkeyAllPriorityBlends,
435 d3dx9_animation_controller_GetCurrentTrackEvent,
436 d3dx9_animation_controller_GetCurrentPriorityBlend,
437 d3dx9_animation_controller_GetUpcomingTrackEvent,
438 d3dx9_animation_controller_GetUpcomingPriorityBlend,
439 d3dx9_animation_controller_ValidateEvent,
440 d3dx9_animation_controller_GetEventDesc,
441 d3dx9_animation_controller_CloneAnimationController
444 HRESULT WINAPI D3DXCreateAnimationController(UINT max_outputs, UINT max_sets,
445 UINT max_tracks, UINT max_events, ID3DXAnimationController **controller)
447 struct d3dx9_animation_controller *object;
449 TRACE("max_outputs %u, max_sets %u, max_tracks %u, max_events %u, controller %p.\n",
450 max_outputs, max_sets, max_tracks, max_events, controller);
452 if (!max_outputs || !max_sets || !max_tracks || !max_events || !controller)
453 return D3D_OK;
455 object = HeapAlloc(GetProcessHeap(), 0, sizeof(*object));
456 if (!object)
457 return E_OUTOFMEMORY;
459 object->ID3DXAnimationController_iface.lpVtbl = &d3dx9_animation_controller_vtbl;
460 object->ref = 1;
461 object->max_outputs = max_outputs;
462 object->max_sets = max_sets;
463 object->max_tracks = max_tracks;
464 object->max_events = max_events;
466 *controller = &object->ID3DXAnimationController_iface;
468 return D3D_OK;
471 HRESULT WINAPI D3DXCreateKeyframedAnimationSet(const char *name, double ticks_per_second,
472 D3DXPLAYBACK_TYPE playback_type, UINT animation_count, UINT callback_key_count,
473 const D3DXKEY_CALLBACK *callback_keys, ID3DXKeyframedAnimationSet **animation_set)
475 FIXME("name %s, ticks_per_second %.16e, playback_type %u, animation_count %u, "
476 "callback_key_count %u, callback_keys %p, animation_set %p stub.\n",
477 debugstr_a(name), ticks_per_second, playback_type, animation_count,
478 callback_key_count, callback_keys, animation_set);
480 return E_NOTIMPL;