5 * Animation Controller operations specific to D3DX9.
7 * Copyright (C) 2015 Christian Costa
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #include "d3dx9_private.h"
26 #endif /* __REACTOS__ */
28 WINE_DEFAULT_DEBUG_CHANNEL(d3dx
);
30 struct d3dx9_animation_controller
32 ID3DXAnimationController ID3DXAnimationController_iface
;
41 static inline struct d3dx9_animation_controller
*impl_from_ID3DXAnimationController(ID3DXAnimationController
*iface
)
43 return CONTAINING_RECORD(iface
, struct d3dx9_animation_controller
, ID3DXAnimationController_iface
);
46 static HRESULT WINAPI
d3dx9_animation_controller_QueryInterface(ID3DXAnimationController
*iface
, REFIID riid
, void **out
)
48 TRACE("iface %p, riid %s, out %p.\n", iface
, debugstr_guid(riid
), out
);
50 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
51 IsEqualGUID(riid
, &IID_ID3DXAnimationController
))
53 iface
->lpVtbl
->AddRef(iface
);
58 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid
));
63 static ULONG WINAPI
d3dx9_animation_controller_AddRef(ID3DXAnimationController
*iface
)
65 struct d3dx9_animation_controller
*animation
= impl_from_ID3DXAnimationController(iface
);
66 ULONG refcount
= InterlockedIncrement(&animation
->ref
);
68 TRACE("%p increasing refcount to %u.\n", animation
, refcount
);
73 static ULONG WINAPI
d3dx9_animation_controller_Release(ID3DXAnimationController
*iface
)
75 struct d3dx9_animation_controller
*animation
= impl_from_ID3DXAnimationController(iface
);
76 ULONG refcount
= InterlockedDecrement(&animation
->ref
);
78 TRACE("%p decreasing refcount to %u.\n", animation
, refcount
);
82 HeapFree(GetProcessHeap(), 0, animation
);
88 static UINT WINAPI
d3dx9_animation_controller_GetMaxNumAnimationOutputs(ID3DXAnimationController
*iface
)
90 struct d3dx9_animation_controller
*animation
= impl_from_ID3DXAnimationController(iface
);
92 TRACE("iface %p.\n", iface
);
94 return animation
->max_outputs
;
97 static UINT WINAPI
d3dx9_animation_controller_GetMaxNumAnimationSets(ID3DXAnimationController
*iface
)
99 struct d3dx9_animation_controller
*animation
= impl_from_ID3DXAnimationController(iface
);
101 TRACE("iface %p.\n", iface
);
103 return animation
->max_sets
;
106 static UINT WINAPI
d3dx9_animation_controller_GetMaxNumTracks(ID3DXAnimationController
*iface
)
108 struct d3dx9_animation_controller
*animation
= impl_from_ID3DXAnimationController(iface
);
110 TRACE("iface %p.\n", iface
);
112 return animation
->max_tracks
;
115 static UINT WINAPI
d3dx9_animation_controller_GetMaxNumEvents(ID3DXAnimationController
*iface
)
117 struct d3dx9_animation_controller
*animation
= impl_from_ID3DXAnimationController(iface
);
119 TRACE("iface %p.\n", iface
);
121 return animation
->max_events
;
124 static HRESULT WINAPI
d3dx9_animation_controller_RegisterAnimationOutput(ID3DXAnimationController
*iface
,
125 const char *name
, D3DXMATRIX
*matrix
, D3DXVECTOR3
*scale
, D3DXQUATERNION
*rotation
, D3DXVECTOR3
*translation
)
127 FIXME("iface %p, name %s, matrix %p, scale %p, rotation %p, translation %p stub.\n", iface
, debugstr_a(name
),
128 matrix
, scale
, rotation
, translation
);
133 static HRESULT WINAPI
d3dx9_animation_controller_RegisterAnimationSet(ID3DXAnimationController
*iface
,
134 ID3DXAnimationSet
*anim_set
)
136 FIXME("iface %p, anim_set %p stub.\n", iface
, anim_set
);
141 static HRESULT WINAPI
d3dx9_animation_controller_UnregisterAnimationSet(ID3DXAnimationController
*iface
,
142 ID3DXAnimationSet
*anim_set
)
144 FIXME("iface %p, anim_set %p stub.\n", iface
, anim_set
);
149 static UINT WINAPI
d3dx9_animation_controller_GetNumAnimationSets(ID3DXAnimationController
*iface
)
151 FIXME("iface %p stub.\n", iface
);
156 static HRESULT WINAPI
d3dx9_animation_controller_GetAnimationSet(ID3DXAnimationController
*iface
,
157 UINT index
, ID3DXAnimationSet
**anim_set
)
159 FIXME("iface %p, index %u, anim_set %p stub.\n", iface
, index
, anim_set
);
164 static HRESULT WINAPI
d3dx9_animation_controller_GetAnimationSetByName(ID3DXAnimationController
*iface
,
165 const char *name
, ID3DXAnimationSet
**anim_set
)
167 FIXME("iface %p, name %s, anim_set %p stub.\n", iface
, debugstr_a(name
), anim_set
);
172 static HRESULT WINAPI
d3dx9_animation_controller_AdvanceTime(ID3DXAnimationController
*iface
, double time_delta
,
173 ID3DXAnimationCallbackHandler
*callback_handler
)
175 FIXME("iface %p, time_delta %.16e, callback_handler %p stub.\n", iface
, time_delta
, callback_handler
);
180 static HRESULT WINAPI
d3dx9_animation_controller_Reset(ID3DXAnimationController
*iface
)
182 FIXME("iface %p stub.\n", iface
);
187 static double WINAPI
d3dx9_animation_controller_GetTime(ID3DXAnimationController
*iface
)
189 FIXME("iface %p stub.\n", iface
);
194 static HRESULT WINAPI
d3dx9_animation_controller_SetTrackAnimationSet(ID3DXAnimationController
*iface
,
195 UINT track
, ID3DXAnimationSet
*anim_set
)
197 FIXME("iface %p, track %u, anim_set %p stub.\n", iface
, track
, anim_set
);
202 static HRESULT WINAPI
d3dx9_animation_controller_GetTrackAnimationSet(ID3DXAnimationController
*iface
,
203 UINT track
, ID3DXAnimationSet
**anim_set
)
205 FIXME("iface %p, track %u, anim_set %p stub.\n", iface
, track
, anim_set
);
210 static HRESULT WINAPI
d3dx9_animation_controller_SetTrackPriority(ID3DXAnimationController
*iface
,
211 UINT track
, D3DXPRIORITY_TYPE priority
)
213 FIXME("iface %p, track %u, priority %u stub.\n", iface
, track
, priority
);
218 static HRESULT WINAPI
d3dx9_animation_controller_SetTrackSpeed(ID3DXAnimationController
*iface
,
219 UINT track
, float speed
)
221 FIXME("iface %p, track %u, speed %.8e stub.\n", iface
, track
, speed
);
226 static HRESULT WINAPI
d3dx9_animation_controller_SetTrackWeight(ID3DXAnimationController
*iface
,
227 UINT track
, float weight
)
229 FIXME("iface %p, track %u, weight %.8e stub.\n", iface
, track
, weight
);
234 static HRESULT WINAPI
d3dx9_animation_controller_SetTrackPosition(ID3DXAnimationController
*iface
,
235 UINT track
, double position
)
237 FIXME("iface %p, track %u, position %.16e stub.\n", iface
, track
, position
);
242 static HRESULT WINAPI
d3dx9_animation_controller_SetTrackEnable(ID3DXAnimationController
*iface
,
243 UINT track
, BOOL enable
)
245 FIXME("iface %p, track %u, enable %#x stub.\n", iface
, track
, enable
);
250 static HRESULT WINAPI
d3dx9_animation_controller_SetTrackDesc(ID3DXAnimationController
*iface
,
251 UINT track
, D3DXTRACK_DESC
*desc
)
253 FIXME("iface %p, track %u, desc %p stub.\n", iface
, track
, desc
);
258 static HRESULT WINAPI
d3dx9_animation_controller_GetTrackDesc(ID3DXAnimationController
*iface
,
259 UINT track
, D3DXTRACK_DESC
*desc
)
261 FIXME("iface %p, track %u, desc %p stub.\n", iface
, track
, desc
);
266 static HRESULT WINAPI
d3dx9_animation_controller_SetPriorityBlend(ID3DXAnimationController
*iface
,
269 FIXME("iface %p, blend_weight %.8e stub.\n", iface
, blend_weight
);
274 static float WINAPI
d3dx9_animation_controller_GetPriorityBlend(ID3DXAnimationController
*iface
)
276 FIXME("iface %p stub.\n", iface
);
281 static D3DXEVENTHANDLE WINAPI
d3dx9_animation_controller_KeyTrackSpeed(ID3DXAnimationController
*iface
,
282 UINT track
, float new_speed
, double start_time
, double duration
, D3DXTRANSITION_TYPE transition
)
284 FIXME("iface %p, track %u, new_speed %.8e, start_time %.16e, duration %.16e, transition %u stub.\n", iface
,
285 track
, new_speed
, start_time
, duration
, transition
);
290 static D3DXEVENTHANDLE WINAPI
d3dx9_animation_controller_KeyTrackWeight(ID3DXAnimationController
*iface
,
291 UINT track
, float new_weight
, double start_time
, double duration
, D3DXTRANSITION_TYPE transition
)
293 FIXME("iface %p, track %u, new_weight %.8e, start_time %.16e, duration %.16e, transition %u stub.\n", iface
,
294 track
, new_weight
, start_time
, duration
, transition
);
299 static D3DXEVENTHANDLE WINAPI
d3dx9_animation_controller_KeyTrackPosition(ID3DXAnimationController
*iface
,
300 UINT track
, double new_position
, double start_time
)
302 FIXME("iface %p, track %u, new_position %.16e, start_time %.16e stub.\n", iface
,
303 track
, new_position
, start_time
);
308 static D3DXEVENTHANDLE WINAPI
d3dx9_animation_controller_KeyTrackEnable(ID3DXAnimationController
*iface
,
309 UINT track
, BOOL new_enable
, double start_time
)
311 FIXME("iface %p, track %u, new_enable %#x, start_time %.16e stub.\n", iface
,
312 track
, new_enable
, start_time
);
317 static D3DXEVENTHANDLE WINAPI
d3dx9_animation_controller_KeyTrackBlend(ID3DXAnimationController
*iface
,
318 float new_blend_weight
, double start_time
, double duration
, D3DXTRANSITION_TYPE transition
)
320 FIXME("iface %p, new_blend_weight %.8e, start_time %.16e, duration %.16e, transition %u stub.\n", iface
,
321 new_blend_weight
, start_time
, duration
, transition
);
326 static HRESULT WINAPI
d3dx9_animation_controller_UnkeyEvent(ID3DXAnimationController
*iface
, D3DXEVENTHANDLE event
)
328 FIXME("iface %p, event %u stub.\n", iface
, event
);
333 static HRESULT WINAPI
d3dx9_animation_controller_UnkeyAllTrackEvents(ID3DXAnimationController
*iface
, UINT track
)
335 FIXME("iface %p, track %u stub.\n", iface
, track
);
340 static HRESULT WINAPI
d3dx9_animation_controller_UnkeyAllPriorityBlends(ID3DXAnimationController
*iface
)
342 FIXME("iface %p stub.\n", iface
);
347 static D3DXEVENTHANDLE WINAPI
d3dx9_animation_controller_GetCurrentTrackEvent(ID3DXAnimationController
*iface
,
348 UINT track
, D3DXEVENT_TYPE event_type
)
350 FIXME("iface %p, track %u, event_type %u stub.\n", iface
, track
, event_type
);
355 static D3DXEVENTHANDLE WINAPI
d3dx9_animation_controller_GetCurrentPriorityBlend(ID3DXAnimationController
*iface
)
357 FIXME("iface %p stub.\n", iface
);
362 static D3DXEVENTHANDLE WINAPI
d3dx9_animation_controller_GetUpcomingTrackEvent(ID3DXAnimationController
*iface
,
363 UINT track
, D3DXEVENTHANDLE event
)
365 FIXME("iface %p, track %u, event %u stub.\n", iface
, track
, event
);
370 static D3DXEVENTHANDLE WINAPI
d3dx9_animation_controller_GetUpcomingPriorityBlend(ID3DXAnimationController
*iface
,
371 D3DXEVENTHANDLE event
)
373 FIXME("iface %p, event %u stub.\n", iface
, event
);
378 static HRESULT WINAPI
d3dx9_animation_controller_ValidateEvent(ID3DXAnimationController
*iface
, D3DXEVENTHANDLE event
)
380 FIXME("iface %p, event %u stub.\n", iface
, event
);
385 static HRESULT WINAPI
d3dx9_animation_controller_GetEventDesc(ID3DXAnimationController
*iface
,
386 D3DXEVENTHANDLE event
, D3DXEVENT_DESC
*desc
)
388 FIXME("iface %p, event %u, desc %p stub.\n", iface
, event
, desc
);
393 static HRESULT WINAPI
d3dx9_animation_controller_CloneAnimationController(ID3DXAnimationController
*iface
, UINT max_outputs
,
394 UINT max_sets
, UINT max_tracks
, UINT max_events
, ID3DXAnimationController
**anim_controller
)
396 FIXME("iface %p, max_outputs %u, max_sets %u, max_tracks %u, max_events %u, anim_controller %p stub.\n",
397 iface
, max_outputs
, max_sets
, max_tracks
, max_events
, anim_controller
);
402 static const struct ID3DXAnimationControllerVtbl d3dx9_animation_controller_vtbl
=
404 d3dx9_animation_controller_QueryInterface
,
405 d3dx9_animation_controller_AddRef
,
406 d3dx9_animation_controller_Release
,
407 d3dx9_animation_controller_GetMaxNumAnimationOutputs
,
408 d3dx9_animation_controller_GetMaxNumAnimationSets
,
409 d3dx9_animation_controller_GetMaxNumTracks
,
410 d3dx9_animation_controller_GetMaxNumEvents
,
411 d3dx9_animation_controller_RegisterAnimationOutput
,
412 d3dx9_animation_controller_RegisterAnimationSet
,
413 d3dx9_animation_controller_UnregisterAnimationSet
,
414 d3dx9_animation_controller_GetNumAnimationSets
,
415 d3dx9_animation_controller_GetAnimationSet
,
416 d3dx9_animation_controller_GetAnimationSetByName
,
417 d3dx9_animation_controller_AdvanceTime
,
418 d3dx9_animation_controller_Reset
,
419 d3dx9_animation_controller_GetTime
,
420 d3dx9_animation_controller_SetTrackAnimationSet
,
421 d3dx9_animation_controller_GetTrackAnimationSet
,
422 d3dx9_animation_controller_SetTrackPriority
,
423 d3dx9_animation_controller_SetTrackSpeed
,
424 d3dx9_animation_controller_SetTrackWeight
,
425 d3dx9_animation_controller_SetTrackPosition
,
426 d3dx9_animation_controller_SetTrackEnable
,
427 d3dx9_animation_controller_SetTrackDesc
,
428 d3dx9_animation_controller_GetTrackDesc
,
429 d3dx9_animation_controller_SetPriorityBlend
,
430 d3dx9_animation_controller_GetPriorityBlend
,
431 d3dx9_animation_controller_KeyTrackSpeed
,
432 d3dx9_animation_controller_KeyTrackWeight
,
433 d3dx9_animation_controller_KeyTrackPosition
,
434 d3dx9_animation_controller_KeyTrackEnable
,
435 d3dx9_animation_controller_KeyTrackBlend
,
436 d3dx9_animation_controller_UnkeyEvent
,
437 d3dx9_animation_controller_UnkeyAllTrackEvents
,
438 d3dx9_animation_controller_UnkeyAllPriorityBlends
,
439 d3dx9_animation_controller_GetCurrentTrackEvent
,
440 d3dx9_animation_controller_GetCurrentPriorityBlend
,
441 d3dx9_animation_controller_GetUpcomingTrackEvent
,
442 d3dx9_animation_controller_GetUpcomingPriorityBlend
,
443 d3dx9_animation_controller_ValidateEvent
,
444 d3dx9_animation_controller_GetEventDesc
,
445 d3dx9_animation_controller_CloneAnimationController
448 HRESULT WINAPI
D3DXCreateAnimationController(UINT max_outputs
, UINT max_sets
,
449 UINT max_tracks
, UINT max_events
, ID3DXAnimationController
**controller
)
451 struct d3dx9_animation_controller
*object
;
453 TRACE("max_outputs %u, max_sets %u, max_tracks %u, max_events %u, controller %p.\n",
454 max_outputs
, max_sets
, max_tracks
, max_events
, controller
);
456 if (!max_outputs
|| !max_sets
|| !max_tracks
|| !max_events
|| !controller
)
459 object
= HeapAlloc(GetProcessHeap(), 0, sizeof(*object
));
461 return E_OUTOFMEMORY
;
463 object
->ID3DXAnimationController_iface
.lpVtbl
= &d3dx9_animation_controller_vtbl
;
465 object
->max_outputs
= max_outputs
;
466 object
->max_sets
= max_sets
;
467 object
->max_tracks
= max_tracks
;
468 object
->max_events
= max_events
;
470 *controller
= &object
->ID3DXAnimationController_iface
;
475 struct d3dx9_keyframed_animation_set
477 ID3DXKeyframedAnimationSet ID3DXKeyframedAnimationSet_iface
;
481 double ticks_per_second
;
482 D3DXPLAYBACK_TYPE playback_type
;
483 unsigned int animation_count
;
484 unsigned int callback_key_count
;
485 const D3DXKEY_CALLBACK
*callback_keys
;
488 static inline struct d3dx9_keyframed_animation_set
*impl_from_ID3DXKeyframedAnimationSet(ID3DXKeyframedAnimationSet
*iface
)
490 return CONTAINING_RECORD(iface
, struct d3dx9_keyframed_animation_set
, ID3DXKeyframedAnimationSet_iface
);
493 static HRESULT WINAPI
d3dx9_keyframed_animation_QueryInterface(ID3DXKeyframedAnimationSet
*iface
,
494 REFIID riid
, void **obj
)
496 TRACE("iface %p, riid %s, out %p.\n", iface
, debugstr_guid(riid
), obj
);
498 if (IsEqualGUID(riid
, &IID_IUnknown
)
499 || IsEqualGUID(riid
, &IID_ID3DXAnimationSet
)
500 || IsEqualGUID(riid
, &IID_ID3DXKeyframedAnimationSet
))
502 iface
->lpVtbl
->AddRef(iface
);
507 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid
));
509 return E_NOINTERFACE
;
512 static ULONG WINAPI
d3dx9_keyframed_animation_AddRef(ID3DXKeyframedAnimationSet
*iface
)
514 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
515 ULONG refcount
= InterlockedIncrement(&set
->ref
);
517 TRACE("%p increasing refcount to %u.\n", set
, refcount
);
522 static ULONG WINAPI
d3dx9_keyframed_animation_Release(ID3DXKeyframedAnimationSet
*iface
)
524 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
525 ULONG refcount
= InterlockedDecrement(&set
->ref
);
527 TRACE("%p decreasing refcount to %u.\n", set
, refcount
);
531 heap_free((char *)set
->name
);
538 static const char * WINAPI
d3dx9_keyframed_animation_GetName(ID3DXKeyframedAnimationSet
*iface
)
540 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
542 TRACE("set %p.\n", set
);
546 static double WINAPI
d3dx9_keyframed_animation_GetPeriod(ID3DXKeyframedAnimationSet
*iface
)
548 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
550 FIXME("set %p stub.\n", set
);
554 static double WINAPI
d3dx9_keyframed_animation_GetPeriodicPosition(ID3DXKeyframedAnimationSet
*iface
, double position
)
556 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
558 FIXME("set %p, position %.16e stub.\n", set
, position
);
562 static UINT WINAPI
d3dx9_keyframed_animation_GetNumAnimations(ID3DXKeyframedAnimationSet
*iface
)
564 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
566 FIXME("set %p stub.\n", set
);
570 static HRESULT WINAPI
d3dx9_keyframed_animation_GetAnimationNameByIndex(ID3DXKeyframedAnimationSet
*iface
,
571 UINT index
, const char **name
)
573 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
575 FIXME("set %p, index %u, name %p stub.\n", set
, index
, name
);
579 static HRESULT WINAPI
d3dx9_keyframed_animation_GetAnimationIndexByName(ID3DXKeyframedAnimationSet
*iface
,
580 const char *name
, UINT
*index
)
582 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
584 FIXME("set %p, name %s, index %p stub.\n", set
, debugstr_a(name
), index
);
588 static HRESULT WINAPI
d3dx9_keyframed_animation_GetSRT(ID3DXKeyframedAnimationSet
*iface
, double periodic_position
,
589 UINT animation
, D3DXVECTOR3
*scale
, D3DXQUATERNION
*rotation
, D3DXVECTOR3
*translation
)
591 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
593 FIXME("set %p, periodic_position %.16e, animation %u, scale %p, rotation %p, translation %p stub.\n",
594 set
, periodic_position
, animation
, scale
, rotation
, translation
);
598 static HRESULT WINAPI
d3dx9_keyframed_animation_GetCallback(ID3DXKeyframedAnimationSet
*iface
, double position
,
599 DWORD flags
, double *callback_position
, void **callback_data
)
601 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
603 FIXME("set %p, position %.16e, flags %#x, callback_position %p, callback_data %p stub.\n",
604 set
, position
, flags
, callback_position
, callback_data
);
608 static D3DXPLAYBACK_TYPE WINAPI
d3dx9_keyframed_animation_GetPlaybackType(ID3DXKeyframedAnimationSet
*iface
)
610 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
612 TRACE("set %p.\n", set
);
613 return set
->playback_type
;
616 static double WINAPI
d3dx9_keyframed_animation_GetSourceTicksPerSecond(ID3DXKeyframedAnimationSet
*iface
)
618 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
620 TRACE("set %p.\n", set
);
621 return set
->ticks_per_second
;
624 static UINT WINAPI
d3dx9_keyframed_animation_GetNumScaleKeys(ID3DXKeyframedAnimationSet
*iface
, UINT keys
)
626 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
628 FIXME("set %p, keys %u stub.\n", set
, keys
);
632 static HRESULT WINAPI
d3dx9_keyframed_animation_GetScaleKeys(ID3DXKeyframedAnimationSet
*iface
, UINT animation
,
633 D3DXKEY_VECTOR3
*scale_keys
)
635 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
637 FIXME("set %p, animation %u, scale_keys %p stub.\n", set
, animation
, scale_keys
);
641 static HRESULT WINAPI
d3dx9_keyframed_animation_GetScaleKey(ID3DXKeyframedAnimationSet
*iface
, UINT animation
,
642 UINT key
, D3DXKEY_VECTOR3
*scale_key
)
644 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
646 FIXME("set %p, animation %u, key %u, scale_key %p stub.\n", set
, animation
, key
, scale_key
);
650 static HRESULT WINAPI
d3dx9_keyframed_animation_SetScaleKey(ID3DXKeyframedAnimationSet
*iface
, UINT animation
,
651 UINT key
, D3DXKEY_VECTOR3
*scale_key
)
653 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
655 FIXME("set %p, animation %u, key %u, scale_key %p stub.\n", set
, animation
, key
, scale_key
);
659 static UINT WINAPI
d3dx9_keyframed_animation_GetNumRotationKeys(ID3DXKeyframedAnimationSet
*iface
, UINT animation
)
661 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
663 FIXME("set %p, animation %u stub.\n", set
, animation
);
667 static HRESULT WINAPI
d3dx9_keyframed_animation_GetRotationKeys(ID3DXKeyframedAnimationSet
*iface
,
668 UINT animation
, D3DXKEY_QUATERNION
*rotation_keys
)
670 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
672 FIXME("set %p, animation %u, rotation_keys %p stub.\n", set
, animation
, rotation_keys
);
676 static HRESULT WINAPI
d3dx9_keyframed_animation_GetRotationKey(ID3DXKeyframedAnimationSet
*iface
,
677 UINT animation
, UINT key
, D3DXKEY_QUATERNION
*rotation_key
)
679 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
681 FIXME("set %p, animation %u, key %u, rotation_key %p stub.\n", set
, animation
, key
, rotation_key
);
685 static HRESULT WINAPI
d3dx9_keyframed_animation_SetRotationKey(ID3DXKeyframedAnimationSet
*iface
,
686 UINT animation
, UINT key
, D3DXKEY_QUATERNION
*rotation_key
)
688 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
690 FIXME("set %p, animation %u, key %u, rotation_key %p stub.\n", set
, animation
, key
, rotation_key
);
694 static UINT WINAPI
d3dx9_keyframed_animation_GetNumTranslationKeys(ID3DXKeyframedAnimationSet
*iface
, UINT animation
)
696 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
698 FIXME("set %p, animation %u stub.\n", set
, animation
);
702 static HRESULT WINAPI
d3dx9_keyframed_animation_GetTranslationKeys(ID3DXKeyframedAnimationSet
*iface
,
703 UINT animation
, D3DXKEY_VECTOR3
*translation_keys
)
705 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
707 FIXME("set %p, animation %u, translation_keys %p stub.\n", set
, animation
, translation_keys
);
711 static HRESULT WINAPI
d3dx9_keyframed_animation_GetTranslationKey(ID3DXKeyframedAnimationSet
*iface
,
712 UINT animation
, UINT key
, D3DXKEY_VECTOR3
*translation_key
)
714 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
716 FIXME("set %p, animation %u, key %u, translation_key %p stub.\n", set
, animation
, key
, translation_key
);
720 static HRESULT WINAPI
d3dx9_keyframed_animation_SetTranslationKey(ID3DXKeyframedAnimationSet
*iface
,
721 UINT animation
, UINT key
, D3DXKEY_VECTOR3
*translation_key
)
723 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
725 FIXME("set %p, animation %u, key %u, translation_key %p stub.\n", set
, animation
, key
, translation_key
);
729 static UINT WINAPI
d3dx9_keyframed_animation_GetNumCallbackKeys(ID3DXKeyframedAnimationSet
*iface
)
731 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
733 FIXME("set %p stub.\n", set
);
737 static HRESULT WINAPI
d3dx9_keyframed_animation_GetCallbackKeys(ID3DXKeyframedAnimationSet
*iface
,
738 D3DXKEY_CALLBACK
*callback_keys
)
740 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
742 FIXME("set %p, callback_keys %p stub.\n", set
, callback_keys
);
746 static HRESULT WINAPI
d3dx9_keyframed_animation_GetCallbackKey(ID3DXKeyframedAnimationSet
*iface
,
747 UINT key
, D3DXKEY_CALLBACK
*callback_key
)
749 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
751 FIXME("set %p, key %u, callback_key %p stub.\n", set
, key
, callback_key
);
755 static HRESULT WINAPI
d3dx9_keyframed_animation_SetCallbackKey(ID3DXKeyframedAnimationSet
*iface
,
756 UINT key
, D3DXKEY_CALLBACK
*callback_key
)
758 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
760 FIXME("set %p, key %u, callback_key %p stub.\n", set
, key
, callback_key
);
764 static HRESULT WINAPI
d3dx9_keyframed_animation_UnregisterScaleKey(ID3DXKeyframedAnimationSet
*iface
,
765 UINT animation
, UINT key
)
767 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
769 FIXME("set %p, animation %u, key %u stub.\n", set
, animation
, key
);
773 static HRESULT WINAPI
d3dx9_keyframed_animation_UnregisterRotationKey(ID3DXKeyframedAnimationSet
*iface
,
774 UINT animation
, UINT key
)
776 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
778 FIXME("set %p, animation %u, key %u stub.\n", set
, animation
, key
);
782 static HRESULT WINAPI
d3dx9_keyframed_animation_UnregisterTranslationKey(ID3DXKeyframedAnimationSet
*iface
,
783 UINT animation
, UINT key
)
785 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
787 FIXME("set %p, animation %u, key %u stub.\n", set
, animation
, key
);
791 static HRESULT WINAPI
d3dx9_keyframed_animation_RegisterAnimationSRTKeys(ID3DXKeyframedAnimationSet
*iface
,
792 const char *name
, UINT scale_keys_count
, UINT rotation_keys_count
, UINT translation_keys_count
,
793 const D3DXKEY_VECTOR3
*scale_keys
, const D3DXKEY_QUATERNION
*rotation_keys
,
794 const D3DXKEY_VECTOR3
*translation_keys
, DWORD
*animation_index
)
796 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
798 FIXME("set %p, name %s, scale_keys_count %u, rotation_keys_count %u, translation_keys_count %u, "
799 "scale_keys %p, rotation_keys %p, translation_keys %p, animation_index %p stub.\n",
800 set
, debugstr_a(name
), scale_keys_count
, rotation_keys_count
, translation_keys_count
,
801 scale_keys
, rotation_keys
, translation_keys
, animation_index
);
805 static HRESULT WINAPI
d3dx9_keyframed_animation_Compress(ID3DXKeyframedAnimationSet
*iface
,
806 DWORD flags
, float lossiness
, D3DXFRAME
*hierarchy
, ID3DXBuffer
**compressed_data
)
808 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
810 FIXME("set %p, flags %#x, lossiness %.8e, hierarchy %p, compressed_data %p stub.\n",
811 set
, flags
, lossiness
, hierarchy
, compressed_data
);
815 static HRESULT WINAPI
d3dx9_keyframed_animation_UnregisterAnimation(ID3DXKeyframedAnimationSet
*iface
, UINT index
)
817 struct d3dx9_keyframed_animation_set
*set
= impl_from_ID3DXKeyframedAnimationSet(iface
);
819 FIXME("set %p, index %u stub.\n", set
, index
);
823 static const struct ID3DXKeyframedAnimationSetVtbl d3dx9_keyframed_animation_vtbl
=
825 d3dx9_keyframed_animation_QueryInterface
,
826 d3dx9_keyframed_animation_AddRef
,
827 d3dx9_keyframed_animation_Release
,
828 d3dx9_keyframed_animation_GetName
,
829 d3dx9_keyframed_animation_GetPeriod
,
830 d3dx9_keyframed_animation_GetPeriodicPosition
,
831 d3dx9_keyframed_animation_GetNumAnimations
,
832 d3dx9_keyframed_animation_GetAnimationNameByIndex
,
833 d3dx9_keyframed_animation_GetAnimationIndexByName
,
834 d3dx9_keyframed_animation_GetSRT
,
835 d3dx9_keyframed_animation_GetCallback
,
836 d3dx9_keyframed_animation_GetPlaybackType
,
837 d3dx9_keyframed_animation_GetSourceTicksPerSecond
,
838 d3dx9_keyframed_animation_GetNumScaleKeys
,
839 d3dx9_keyframed_animation_GetScaleKeys
,
840 d3dx9_keyframed_animation_GetScaleKey
,
841 d3dx9_keyframed_animation_SetScaleKey
,
842 d3dx9_keyframed_animation_GetNumRotationKeys
,
843 d3dx9_keyframed_animation_GetRotationKeys
,
844 d3dx9_keyframed_animation_GetRotationKey
,
845 d3dx9_keyframed_animation_SetRotationKey
,
846 d3dx9_keyframed_animation_GetNumTranslationKeys
,
847 d3dx9_keyframed_animation_GetTranslationKeys
,
848 d3dx9_keyframed_animation_GetTranslationKey
,
849 d3dx9_keyframed_animation_SetTranslationKey
,
850 d3dx9_keyframed_animation_GetNumCallbackKeys
,
851 d3dx9_keyframed_animation_GetCallbackKeys
,
852 d3dx9_keyframed_animation_GetCallbackKey
,
853 d3dx9_keyframed_animation_SetCallbackKey
,
854 d3dx9_keyframed_animation_UnregisterScaleKey
,
855 d3dx9_keyframed_animation_UnregisterRotationKey
,
856 d3dx9_keyframed_animation_UnregisterTranslationKey
,
857 d3dx9_keyframed_animation_RegisterAnimationSRTKeys
,
858 d3dx9_keyframed_animation_Compress
,
859 d3dx9_keyframed_animation_UnregisterAnimation
862 HRESULT WINAPI
D3DXCreateKeyframedAnimationSet(const char *name
, double ticks_per_second
,
863 D3DXPLAYBACK_TYPE playback_type
, UINT animation_count
, UINT callback_key_count
,
864 const D3DXKEY_CALLBACK
*callback_keys
, ID3DXKeyframedAnimationSet
**animation_set
)
866 struct d3dx9_keyframed_animation_set
*object
;
869 TRACE("name %s, ticks_per_second %.16e, playback_type %u, animation_count %u, "
870 "callback_key_count %u, callback_keys %p, animation_set %p.\n",
871 debugstr_a(name
), ticks_per_second
, playback_type
, animation_count
,
872 callback_key_count
, callback_keys
, animation_set
);
874 if (!animation_count
)
875 return D3DERR_INVALIDCALL
;
877 if (!(object
= heap_alloc(sizeof(*object
))))
878 return E_OUTOFMEMORY
;
880 object
->ID3DXKeyframedAnimationSet_iface
.lpVtbl
= &d3dx9_keyframed_animation_vtbl
;
882 if (!(string
= heap_alloc(strlen(name
) + 1)))
885 return E_OUTOFMEMORY
;
887 strcpy(string
, name
);
888 object
->name
= string
;
889 object
->ticks_per_second
= ticks_per_second
;
890 object
->playback_type
= playback_type
;
891 object
->animation_count
= animation_count
;
892 object
->callback_key_count
= callback_key_count
;
893 object
->callback_keys
= callback_keys
;
895 *animation_set
= &object
->ID3DXKeyframedAnimationSet_iface
;