From: Christian Costa titan.costa@gmail.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- I have been unable to determine an application that requires this.
dlls/d3dx9_36/surface.c | 14 ++++++++++++++ dlls/d3dx9_36/tests/surface.c | 2 ++ 2 files changed, 16 insertions(+)
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 29325d5c0a2..42e7bf16f1f 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -111,6 +111,7 @@ static const GUID *d3dformat_to_wic_guid(D3DFORMAT format) #define DDS_PF_RGB 0x40 #define DDS_PF_YUV 0x200 #define DDS_PF_LUMINANCE 0x20000 +#define DDS_PF_BUMPLUMINANCE 0x40000 #define DDS_PF_BUMPDUDV 0x80000
struct dds_pixel_format @@ -360,6 +361,17 @@ static D3DFORMAT dds_bump_to_d3dformat(const struct dds_pixel_format *pixel_form return D3DFMT_UNKNOWN; }
+static D3DFORMAT dds_bump_luminance_to_d3dformat(const struct dds_pixel_format *pixel_format) +{ + if (pixel_format->bpp == 32 && pixel_format->rmask == 0x000000ff && pixel_format->gmask == 0x0000ff00 + && pixel_format->bmask == 0x00ff0000) + return D3DFMT_X8L8V8U8; + + WARN("Unknown bump pixel format (%u, %#x, %#x, %#x, %#x).\n", pixel_format->bpp, + pixel_format->rmask, pixel_format->gmask, pixel_format->bmask, pixel_format->amask); + return D3DFMT_UNKNOWN; +} + static D3DFORMAT dds_pixel_format_to_d3dformat(const struct dds_pixel_format *pixel_format) { TRACE("pixel_format: size %u, flags %#x, fourcc %#x, bpp %u.\n", pixel_format->size, @@ -377,6 +389,8 @@ static D3DFORMAT dds_pixel_format_to_d3dformat(const struct dds_pixel_format *pi return dds_alpha_to_d3dformat(pixel_format); if (pixel_format->flags & DDS_PF_BUMPDUDV) return dds_bump_to_d3dformat(pixel_format); + if (pixel_format->flags & DDS_PF_BUMPLUMINANCE) + return dds_bump_luminance_to_d3dformat(pixel_format);
WARN("Unknown pixel format (flags %#x, fourcc %#x, bpp %u, r %#x, g %#x, b %#x, a %#x)\n", pixel_format->flags, pixel_format->fourcc, pixel_format->bpp, diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 1a39d82961d..d5d3d6d2112 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -235,6 +235,7 @@ static HRESULT create_file(const char *filename, const unsigned char *data, cons #define DDS_PF_FOURCC 0x00000004 #define DDS_PF_RGB 0x00000040 #define DDS_PF_LUMINANCE 0x00020000 +#define DDS_PF_BUMPLUMINANCE 0x00040000 #define DDS_PF_BUMPDUDV 0x00080000
struct dds_pixel_format @@ -703,6 +704,7 @@ static void test_D3DXGetImageInfo(void) check_dds_pixel_format(DDS_PF_LUMINANCE | DDS_PF_ALPHA, 0, 8, 0x0f, 0, 0, 0xf0, D3DFMT_A4L4); check_dds_pixel_format(DDS_PF_BUMPDUDV, 0, 16, 0x00ff, 0xff00, 0, 0, D3DFMT_V8U8); check_dds_pixel_format(DDS_PF_BUMPDUDV, 0, 32, 0x0000ffff, 0xffff0000, 0, 0, D3DFMT_V16U16); + check_dds_pixel_format(DDS_PF_BUMPLUMINANCE, 0, 32, 0x0000ff, 0x00ff00, 0xff0000, 0, D3DFMT_X8L8V8U8);
test_dds_header_handling();
With the subject prefix changed to "d3dx9:" this is Signed-off-by: Matteo Bruni mbruni@codeweavers.com
From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45481 Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- Supersedes patch 177798.
dlls/d3dx9_36/animation.c | 419 ++++++++++++++++++++++++++++++++++++- dlls/d3dx9_36/tests/mesh.c | 27 +++ 2 files changed, 443 insertions(+), 3 deletions(-)
diff --git a/dlls/d3dx9_36/animation.c b/dlls/d3dx9_36/animation.c index de6d69d383a..d0c7c069f35 100644 --- a/dlls/d3dx9_36/animation.c +++ b/dlls/d3dx9_36/animation.c @@ -468,14 +468,427 @@ HRESULT WINAPI D3DXCreateAnimationController(UINT max_outputs, UINT max_sets, return D3D_OK; }
+struct d3dx9_keyframed_animation_set +{ + ID3DXKeyframedAnimationSet ID3DXKeyframedAnimationSet_iface; + LONG ref; + + const char *name; + double ticks_per_second; + D3DXPLAYBACK_TYPE playback_type; + unsigned int animation_count; + unsigned int callback_key_count; + const D3DXKEY_CALLBACK *callback_keys; +}; + +static inline struct d3dx9_keyframed_animation_set *impl_from_ID3DXKeyframedAnimationSet(ID3DXKeyframedAnimationSet *iface) +{ + return CONTAINING_RECORD(iface, struct d3dx9_keyframed_animation_set, ID3DXKeyframedAnimationSet_iface); +} + +static HRESULT WINAPI d3dx9_keyframed_animation_QueryInterface(ID3DXKeyframedAnimationSet *iface, + REFIID riid, void **obj) +{ + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), obj); + + if (IsEqualGUID(riid, &IID_IUnknown) + || IsEqualGUID(riid, &IID_ID3DXAnimationSet) + || IsEqualGUID(riid, &IID_ID3DXKeyframedAnimationSet)) + { + iface->lpVtbl->AddRef(iface); + *obj = iface; + return D3D_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI d3dx9_keyframed_animation_AddRef(ID3DXKeyframedAnimationSet *iface) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + ULONG refcount = InterlockedIncrement(&set->ref); + + TRACE("%p increasing refcount to %u.\n", set, refcount); + + return refcount; +} + +static ULONG WINAPI d3dx9_keyframed_animation_Release(ID3DXKeyframedAnimationSet *iface) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + ULONG refcount = InterlockedDecrement(&set->ref); + + TRACE("%p decreasing refcount to %u.\n", set, refcount); + + if (!refcount) + { + heap_free((char *)set->name); + heap_free(set); + } + + return refcount; +} + +static const char * WINAPI d3dx9_keyframed_animation_GetName(ID3DXKeyframedAnimationSet *iface) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + TRACE("set %p.\n", set); + return set->name; +} + +static double WINAPI d3dx9_keyframed_animation_GetPeriod(ID3DXKeyframedAnimationSet *iface) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p stub.\n", set); + return 0.0; +} + +static double WINAPI d3dx9_keyframed_animation_GetPeriodicPosition(ID3DXKeyframedAnimationSet *iface, double position) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, position %.16e stub.\n", set, position); + return 0.0; +} + +static UINT WINAPI d3dx9_keyframed_animation_GetNumAnimations(ID3DXKeyframedAnimationSet *iface) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p stub.\n", set); + return 0; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_GetAnimationNameByIndex(ID3DXKeyframedAnimationSet *iface, + UINT index, const char **name) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, index %u, name %p stub.\n", set, index, name); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_GetAnimationIndexByName(ID3DXKeyframedAnimationSet *iface, + const char *name, UINT *index) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, name %s, index %p stub.\n", set, debugstr_a(name), index); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_GetSRT(ID3DXKeyframedAnimationSet *iface, double periodic_position, + UINT animation, D3DXVECTOR3 *scale, D3DXQUATERNION *rotation, D3DXVECTOR3 *translation) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, periodic_position %.16e, animation %u, scale %p, rotation %p, translation %p stub.\n", + set, periodic_position, animation, scale, rotation, translation); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_GetCallback(ID3DXKeyframedAnimationSet *iface, double position, + DWORD flags, double *callback_position, void **callback_data) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, position %.16e, flags %#x, callback_position %p, callback_data %p stub.\n", + set, position, flags, callback_position, callback_data); + return E_NOTIMPL; +} + +static D3DXPLAYBACK_TYPE WINAPI d3dx9_keyframed_animation_GetPlaybackType(ID3DXKeyframedAnimationSet *iface) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + TRACE("set %p.\n", set); + return set->playback_type; +} + +static double WINAPI d3dx9_keyframed_animation_GetSourceTicksPerSecond(ID3DXKeyframedAnimationSet *iface) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + TRACE("set %p.\n", set); + return set->ticks_per_second; +} + +static UINT WINAPI d3dx9_keyframed_animation_GetNumScaleKeys(ID3DXKeyframedAnimationSet *iface, UINT keys) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, keys %u stub.\n", set, keys); + return 0; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_GetScaleKeys(ID3DXKeyframedAnimationSet *iface, UINT animation, + D3DXKEY_VECTOR3 *scale_keys) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, animation %u, scale_keys %p stub.\n", set, animation, scale_keys); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_GetScaleKey(ID3DXKeyframedAnimationSet *iface, UINT animation, + UINT key, D3DXKEY_VECTOR3 *scale_key) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, animation %u, key %u, scale_key %p stub.\n", set, animation, key, scale_key); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_SetScaleKey(ID3DXKeyframedAnimationSet *iface, UINT animation, + UINT key, D3DXKEY_VECTOR3 *scale_key) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, animation %u, key %u, scale_key %p stub.\n", set, animation, key, scale_key); + return E_NOTIMPL; +} + +static UINT WINAPI d3dx9_keyframed_animation_GetNumRotationKeys(ID3DXKeyframedAnimationSet *iface, UINT animation) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, animation %u stub.\n", set, animation); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_GetRotationKeys(ID3DXKeyframedAnimationSet *iface, + UINT animation, D3DXKEY_QUATERNION *rotation_keys) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, animation %u, rotation_keys %p stub.\n", set, animation, rotation_keys); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_GetRotationKey(ID3DXKeyframedAnimationSet *iface, + UINT animation, UINT key, D3DXKEY_QUATERNION *rotation_key) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, animation %u, key %u, rotation_key %p stub.\n", set, animation, key, rotation_key); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_SetRotationKey(ID3DXKeyframedAnimationSet *iface, + UINT animation, UINT key, D3DXKEY_QUATERNION *rotation_key) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, animation %u, key %u, rotation_key %p stub.\n", set, animation, key, rotation_key); + return E_NOTIMPL; +} + +static UINT WINAPI d3dx9_keyframed_animation_GetNumTranslationKeys(ID3DXKeyframedAnimationSet *iface, UINT animation) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, animation %u stub.\n", set, animation); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_GetTranslationKeys(ID3DXKeyframedAnimationSet *iface, + UINT animation, D3DXKEY_VECTOR3 *translation_keys) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, animation %u, translation_keys %p stub.\n", set, animation, translation_keys); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_GetTranslationKey(ID3DXKeyframedAnimationSet *iface, + UINT animation, UINT key, D3DXKEY_VECTOR3 *translation_key) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, animation %u, key %u, translation_key %p stub.\n", set, animation, key, translation_key); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_SetTranslationKey(ID3DXKeyframedAnimationSet *iface, + UINT animation, UINT key, D3DXKEY_VECTOR3 *translation_key) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, animation %u, key %u, translation_key %p stub.\n", set, animation, key, translation_key); + return E_NOTIMPL; +} + +static UINT WINAPI d3dx9_keyframed_animation_GetNumCallbackKeys(ID3DXKeyframedAnimationSet *iface) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p stub.\n", set); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_GetCallbackKeys(ID3DXKeyframedAnimationSet *iface, + D3DXKEY_CALLBACK *callback_keys) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, callback_keys %p stub.\n", set, callback_keys); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_GetCallbackKey(ID3DXKeyframedAnimationSet *iface, + UINT key, D3DXKEY_CALLBACK *callback_key) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, key %u, callback_key %p stub.\n", set, key, callback_key); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_SetCallbackKey(ID3DXKeyframedAnimationSet *iface, + UINT key, D3DXKEY_CALLBACK *callback_key) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, key %u, callback_key %p stub.\n", set, key, callback_key); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_UnregisterScaleKey(ID3DXKeyframedAnimationSet *iface, + UINT animation, UINT key) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, animation %u, key %u stub.\n", set, animation, key); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_UnregisterRotationKey(ID3DXKeyframedAnimationSet *iface, + UINT animation, UINT key) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, animation %u, key %u stub.\n", set, animation, key); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_UnregisterTranslationKey(ID3DXKeyframedAnimationSet *iface, + UINT animation, UINT key) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, animation %u, key %u stub.\n", set, animation, key); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_RegisterAnimationSRTKeys(ID3DXKeyframedAnimationSet *iface, + const char *name, UINT scale_keys_count, UINT rotation_keys_count, UINT translation_keys_count, + const D3DXKEY_VECTOR3 *scale_keys, const D3DXKEY_QUATERNION *rotation_keys, + const D3DXKEY_VECTOR3 *translation_keys, DWORD *animation_index) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, name %s, scale_keys_count %u, rotation_keys_count %u, translation_keys_count %u, " + "scale_keys %p, rotation_keys %p, translation_keys %p, animation_index %p stub.\n", + set, debugstr_a(name), scale_keys_count, rotation_keys_count, translation_keys_count, + scale_keys, rotation_keys, translation_keys, animation_index); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_Compress(ID3DXKeyframedAnimationSet *iface, + DWORD flags, float lossiness, D3DXFRAME *hierarchy, ID3DXBuffer **compressed_data) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, flags %#x, lossiness %.8e, hierarchy %p, compressed_data %p stub.\n", + set, flags, lossiness, hierarchy, compressed_data); + return E_NOTIMPL; +} + +static HRESULT WINAPI d3dx9_keyframed_animation_UnregisterAnimation(ID3DXKeyframedAnimationSet *iface, UINT index) +{ + struct d3dx9_keyframed_animation_set *set = impl_from_ID3DXKeyframedAnimationSet(iface); + + FIXME("set %p, index %u stub.\n", set, index); + return E_NOTIMPL; +} + +static const struct ID3DXKeyframedAnimationSetVtbl d3dx9_keyframed_animation_vtbl = +{ + d3dx9_keyframed_animation_QueryInterface, + d3dx9_keyframed_animation_AddRef, + d3dx9_keyframed_animation_Release, + d3dx9_keyframed_animation_GetName, + d3dx9_keyframed_animation_GetPeriod, + d3dx9_keyframed_animation_GetPeriodicPosition, + d3dx9_keyframed_animation_GetNumAnimations, + d3dx9_keyframed_animation_GetAnimationNameByIndex, + d3dx9_keyframed_animation_GetAnimationIndexByName, + d3dx9_keyframed_animation_GetSRT, + d3dx9_keyframed_animation_GetCallback, + d3dx9_keyframed_animation_GetPlaybackType, + d3dx9_keyframed_animation_GetSourceTicksPerSecond, + d3dx9_keyframed_animation_GetNumScaleKeys, + d3dx9_keyframed_animation_GetScaleKeys, + d3dx9_keyframed_animation_GetScaleKey, + d3dx9_keyframed_animation_SetScaleKey, + d3dx9_keyframed_animation_GetNumRotationKeys, + d3dx9_keyframed_animation_GetRotationKeys, + d3dx9_keyframed_animation_GetRotationKey, + d3dx9_keyframed_animation_SetRotationKey, + d3dx9_keyframed_animation_GetNumTranslationKeys, + d3dx9_keyframed_animation_GetTranslationKeys, + d3dx9_keyframed_animation_GetTranslationKey, + d3dx9_keyframed_animation_SetTranslationKey, + d3dx9_keyframed_animation_GetNumCallbackKeys, + d3dx9_keyframed_animation_GetCallbackKeys, + d3dx9_keyframed_animation_GetCallbackKey, + d3dx9_keyframed_animation_SetCallbackKey, + d3dx9_keyframed_animation_UnregisterScaleKey, + d3dx9_keyframed_animation_UnregisterRotationKey, + d3dx9_keyframed_animation_UnregisterTranslationKey, + d3dx9_keyframed_animation_RegisterAnimationSRTKeys, + d3dx9_keyframed_animation_Compress, + d3dx9_keyframed_animation_UnregisterAnimation +}; + HRESULT WINAPI D3DXCreateKeyframedAnimationSet(const char *name, double ticks_per_second, D3DXPLAYBACK_TYPE playback_type, UINT animation_count, UINT callback_key_count, const D3DXKEY_CALLBACK *callback_keys, ID3DXKeyframedAnimationSet **animation_set) { - FIXME("name %s, ticks_per_second %.16e, playback_type %u, animation_count %u, " - "callback_key_count %u, callback_keys %p, animation_set %p stub.\n", + struct d3dx9_keyframed_animation_set *object; + char *string; + + TRACE("name %s, ticks_per_second %.16e, playback_type %u, animation_count %u, " + "callback_key_count %u, callback_keys %p, animation_set %p.\n", debugstr_a(name), ticks_per_second, playback_type, animation_count, callback_key_count, callback_keys, animation_set);
- return E_NOTIMPL; + if (!animation_count) + return D3DERR_INVALIDCALL; + + if (!(object = heap_alloc(sizeof(*object)))) + return E_OUTOFMEMORY; + + object->ID3DXKeyframedAnimationSet_iface.lpVtbl = &d3dx9_keyframed_animation_vtbl; + object->ref = 1; + if (!(string = heap_alloc(strlen(name) + 1))) + { + heap_free(object); + return E_OUTOFMEMORY; + } + strcpy(string, name); + object->name = string; + object->ticks_per_second = ticks_per_second; + object->playback_type = playback_type; + object->animation_count = animation_count; + object->callback_key_count = callback_key_count; + object->callback_keys = callback_keys; + + *animation_set = &object->ID3DXKeyframedAnimationSet_iface; + + return D3D_OK; } diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c index 3882bb404a4..ae7c5f2010c 100644 --- a/dlls/d3dx9_36/tests/mesh.c +++ b/dlls/d3dx9_36/tests/mesh.c @@ -11119,6 +11119,32 @@ static void D3DXCreateAnimationControllerTest(void) animation->lpVtbl->Release(animation); }
+static void D3DXCreateKeyframedAnimationSetTest(void) +{ + ID3DXKeyframedAnimationSet *set; + D3DXPLAYBACK_TYPE type; + unsigned int count; + const char *name; + HRESULT hr; + + hr = D3DXCreateKeyframedAnimationSet("wine_bottle", 5.0, D3DXPLAY_LOOP, 0, 0, NULL, &set); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + hr = D3DXCreateKeyframedAnimationSet("wine_bottle", 5.0, D3DXPLAY_LOOP, 10, 0, NULL, &set); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + name = set->lpVtbl->GetName(set); + ok(!strcmp(name, "wine_bottle"), "Got unexpected name %s.\n", debugstr_a(name)); + + type = set->lpVtbl->GetPlaybackType(set); + ok(type == D3DXPLAY_LOOP, "Got unexpected value %u.\n", type); + + count = set->lpVtbl->GetNumAnimations(set); + ok(!count, "Got unexpected value %u.\n", count); + + set->lpVtbl->Release(set); +} + static void test_D3DXFrameFind(void) { static char n1[] = "name1"; @@ -11387,6 +11413,7 @@ START_TEST(mesh) D3DXCreateTextTest(); D3DXCreateTorusTest(); D3DXCreateAnimationControllerTest(); + D3DXCreateKeyframedAnimationSetTest(); test_get_decl_length(); test_get_decl_vertex_size(); test_fvf_decl_conversion();
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64925
Your paranoid android.
=== wxppro (32 bit report) ===
=== w8 (32 bit report) ===
=== w8adm (32 bit report) ===
=== w864 (32 bit report) ===
Report validation errors: d3dx9_36:mesh has no test summary line (early exit of the main process?)
=== w1064v1507 (32 bit report) ===
=== w1064v1809 (32 bit report) ===
=== w1064v1809_2scr (32 bit report) ===
=== w1064v1809_ar (32 bit report) ===
=== w1064v1809_he (32 bit report) ===
Report validation errors: d3dx9_36:mesh has no test summary line (early exit of the main process?)
=== w1064v1809_ja (32 bit report) ===
Report validation errors: d3dx9_36:mesh has no test summary line (early exit of the main process?)
=== w1064v1809_zh_CN (32 bit report) ===
=== w864 (64 bit report) ===
=== w1064v1507 (64 bit report) ===
=== w1064v1809 (64 bit report) ===
=== debian10 (32 bit report) ===
=== debian10 (32 bit French report) ===
=== debian10 (32 bit Japanese:Japan report) ===
=== debian10 (32 bit Chinese:China report) ===
=== debian10 (32 bit WoW report) ===
=== debian10 (64 bit WoW report) ===