[slimdx] r2202 committed - Fixed a bug in KeyframedAnimationSet.RegisterAnimationKeys that caused...

8 views
Skip to first unread message

sli...@googlecode.com

unread,
May 5, 2012, 12:51:52 AM5/5/12
to slimdx...@googlegroups.com
Revision: 2202
Author: mike.popoloski
Date: Fri May 4 21:51:40 2012
Log: Fixed a bug in KeyframedAnimationSet.RegisterAnimationKeys that
caused invalid values to be set. Resolves issue 862.
http://code.google.com/p/slimdx/source/detail?r=2202

Modified:
/trunk/build/ReleaseNotes.txt
/trunk/samples
/trunk/samples/Direct3D11/MiniTri11
/trunk/source/d3dcompiler/EnumsDC.h
/trunk/source/direct3d9/CallbackKey.h
/trunk/source/direct3d9/KeyframedAnimationSet.cpp

=======================================
--- /trunk/build/ReleaseNotes.txt Thu May 3 17:25:27 2012
+++ /trunk/build/ReleaseNotes.txt Fri May 4 21:51:40 2012
@@ -11,6 +11,9 @@
* Added lazy enumeration of adapters to Factory and Factory1.
* Added lazy enumeration of outputs to Adapter.

+Direct3D 9
+ * Fixed a bug in KeyframedAnimationSet.RegisterAnimationKeys that caused
invalid values to be set.
+
Direct3D 10
* Added missing StateBlockMask constructor.

=======================================
--- /trunk/source/d3dcompiler/EnumsDC.h Thu May 3 17:25:27 2012
+++ /trunk/source/d3dcompiler/EnumsDC.h Fri May 4 21:51:40 2012
@@ -610,7 +610,7 @@
/// <summary>
/// The shader resource is a typed read and write buffer..
/// </summary>
- RWTyped = D3D_SIT_UAV_RWTPYED,
+ RWTyped = D3D_SIT_UAV_RWTYPED,

/// <summary>
/// The shader resource is a structure buffer.
=======================================
--- /trunk/source/direct3d9/CallbackKey.h Sat Jan 28 10:03:11 2012
+++ /trunk/source/direct3d9/CallbackKey.h Fri May 4 21:51:40 2012
@@ -53,6 +53,7 @@

///<summary>Describes a quaternion rotation key for use in key frame
animation.</summary>
///<unmanaged>D3DXKEY_QUATERNION</unmanaged>
+
[System::Runtime::InteropServices::StructLayout(System::Runtime::InteropServices::LayoutKind::Sequential)]
public value class RotationKey : System::IEquatable<RotationKey>
{
internal:
@@ -73,6 +74,7 @@

///<summary>Describes a vector scale key for use in key frame
animation.</summary>
///<unmanaged>D3DXKEY_VECTOR3</unmanaged>
+
[System::Runtime::InteropServices::StructLayout(System::Runtime::InteropServices::LayoutKind::Sequential)]
public value class ScaleKey : System::IEquatable<ScaleKey>
{
internal:
@@ -93,6 +95,7 @@

///<summary>Describes a vector translation key for use in key frame
animation.</summary>
///<unmanaged>D3DXKEY_VECTOR3</unmanaged>
+
[System::Runtime::InteropServices::StructLayout(System::Runtime::InteropServices::LayoutKind::Sequential)]
public value class TranslationKey : System::IEquatable<TranslationKey>
{
internal:
=======================================
--- /trunk/source/direct3d9/KeyframedAnimationSet.cpp Sat Jan 28 10:03:11
2012
+++ /trunk/source/direct3d9/KeyframedAnimationSet.cpp Fri May 4 21:51:40
2012
@@ -285,22 +285,26 @@
array<RotationKey>^ rotationKeys, array<TranslationKey>^ translationKeys
)
{
DWORD result;
- int scaleCount = scaleKeys->Length;
- int rotateCount = rotationKeys->Length;
- int translateCount = translationKeys->Length;
-
- array<unsigned char>^ nameBytes =
System::Text::ASCIIEncoding::ASCII->GetBytes( name );
+
+ array<unsigned char>^ nameBytes =
System::Text::ASCIIEncoding::ASCII->GetBytes(name);
pin_ptr<unsigned char> pinnedName = &nameBytes[0];

- stack_array<D3DXKEY_VECTOR3> scales = stackalloc( D3DXKEY_VECTOR3,
scaleCount );
- stack_array<D3DXKEY_QUATERNION> rotations = stackalloc(
D3DXKEY_QUATERNION, rotateCount );
- stack_array<D3DXKEY_VECTOR3> translations = stackalloc( D3DXKEY_VECTOR3,
translateCount );
-
- HRESULT hr = InternalPointer->RegisterAnimationSRTKeys(
reinterpret_cast<LPCSTR>( pinnedName ), scaleCount, rotateCount,
- translateCount, &scales[0], &rotations[0], &translations[0], &result );
- RECORD_D3D9( hr );
-
- if( Result::Last.IsFailure )
+ pin_ptr<ScaleKey> scales = &scaleKeys[0];
+ pin_ptr<RotationKey> rotations = &rotationKeys[0];
+ pin_ptr<TranslationKey> translations = &translationKeys[0];
+
+ HRESULT hr = InternalPointer->RegisterAnimationSRTKeys(
+ reinterpret_cast<LPCSTR>(pinnedName),
+ scaleKeys->Length,
+ rotationKeys->Length,
+ translationKeys->Length,
+ reinterpret_cast<D3DXKEY_VECTOR3*>(scales),
+ reinterpret_cast<D3DXKEY_QUATERNION*>(rotations),
+ reinterpret_cast<D3DXKEY_VECTOR3*>(translations),
+ &result
+ );
+
+ if(RECORD_D3D9(hr).IsFailure)
return 0;

return result;
Reply all
Reply to author
Forward
0 new messages