Change CallingConvention for better compatibility.

This commit is contained in:
Razmoth
2022-10-04 21:59:53 +04:00
parent aa92d76e64
commit 68952f0e17
3 changed files with 87 additions and 87 deletions

View File

@@ -6,10 +6,10 @@ namespace AssetStudio
partial class Fbx partial class Fbx
{ {
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsUtilQuaternionToEuler(float qx, float qy, float qz, float qw, out float vx, out float vy, out float vz); private static extern void AsUtilQuaternionToEuler(float qx, float qy, float qz, float qw, out float vx, out float vy, out float vz);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsUtilEulerToQuaternion(float vx, float vy, float vz, out float qx, out float qy, out float qz, out float qw); private static extern void AsUtilEulerToQuaternion(float vx, float vy, float vz, out float qx, out float qy, out float qz, out float qw);
} }

View File

@@ -7,7 +7,7 @@ namespace AssetStudio.FbxInterop
partial class FbxExporterContext partial class FbxExporterContext
{ {
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr AsFbxCreateContext(); private static extern IntPtr AsFbxCreateContext();
private static bool AsFbxInitializeContext(IntPtr context, string fileName, float scaleFactor, int versionIndex, bool isAscii, bool is60Fps, out string errorMessage) private static bool AsFbxInitializeContext(IntPtr context, string fileName, float scaleFactor, int versionIndex, bool isAscii, bool is60Fps, out string errorMessage)
@@ -26,11 +26,11 @@ namespace AssetStudio.FbxInterop
} }
// Do not free the pointer strErrorMessage // Do not free the pointer strErrorMessage
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool AsFbxInitializeContext(IntPtr context, IntPtr strFileName, float scaleFactor, int versionIndex, [MarshalAs(UnmanagedType.Bool)] bool isAscii, [MarshalAs(UnmanagedType.Bool)] bool is60Fps, out IntPtr strErrorMessage); private static extern bool AsFbxInitializeContext(IntPtr context, IntPtr strFileName, float scaleFactor, int versionIndex, [MarshalAs(UnmanagedType.Bool)] bool isAscii, [MarshalAs(UnmanagedType.Bool)] bool is60Fps, out IntPtr strErrorMessage);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxDisposeContext(ref IntPtr ppContext); private static extern void AsFbxDisposeContext(ref IntPtr ppContext);
private static void AsFbxSetFramePaths(IntPtr context, string[] framePaths) private static void AsFbxSetFramePaths(IntPtr context, string[] framePaths)
@@ -71,13 +71,13 @@ namespace AssetStudio.FbxInterop
} }
} }
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxSetFramePaths(IntPtr context, [MarshalAs(UnmanagedType.LPArray)] IntPtr[] strFramePaths, int count); private static extern void AsFbxSetFramePaths(IntPtr context, [MarshalAs(UnmanagedType.LPArray)] IntPtr[] strFramePaths, int count);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxExportScene(IntPtr context); private static extern void AsFbxExportScene(IntPtr context);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr AsFbxGetSceneRootNode(IntPtr context); private static extern IntPtr AsFbxGetSceneRootNode(IntPtr context);
private static IntPtr AsFbxExportSingleFrame(IntPtr context, IntPtr parentNode, string framePath, string frameName, in Vector3 localPosition, in Vector3 localRotation, in Vector3 localScale) private static IntPtr AsFbxExportSingleFrame(IntPtr context, IntPtr parentNode, string framePath, string frameName, in Vector3 localPosition, in Vector3 localRotation, in Vector3 localScale)
@@ -91,19 +91,19 @@ namespace AssetStudio.FbxInterop
} }
} }
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr AsFbxExportSingleFrame(IntPtr context, IntPtr parentNode, IntPtr strFramePath, IntPtr strFrameName, float localPositionX, float localPositionY, float localPositionZ, float localRotationX, float localRotationY, float localRotationZ, float localScaleX, float localScaleY, float localScaleZ); private static extern IntPtr AsFbxExportSingleFrame(IntPtr context, IntPtr parentNode, IntPtr strFramePath, IntPtr strFrameName, float localPositionX, float localPositionY, float localPositionZ, float localRotationX, float localRotationY, float localRotationZ, float localScaleX, float localScaleY, float localScaleZ);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxSetJointsNode_CastToBone(IntPtr context, IntPtr node, float boneSize); private static extern void AsFbxSetJointsNode_CastToBone(IntPtr context, IntPtr node, float boneSize);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxSetJointsNode_BoneInPath(IntPtr context, IntPtr node, float boneSize); private static extern void AsFbxSetJointsNode_BoneInPath(IntPtr context, IntPtr node, float boneSize);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxSetJointsNode_Generic(IntPtr context, IntPtr node); private static extern void AsFbxSetJointsNode_Generic(IntPtr context, IntPtr node);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxPrepareMaterials(IntPtr context, int materialCount, int textureCount); private static extern void AsFbxPrepareMaterials(IntPtr context, int materialCount, int textureCount);
private static IntPtr AsFbxCreateTexture(IntPtr context, string matTexName) private static IntPtr AsFbxCreateTexture(IntPtr context, string matTexName)
@@ -114,46 +114,46 @@ namespace AssetStudio.FbxInterop
} }
} }
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr AsFbxCreateTexture(IntPtr context, IntPtr strMatTexName); private static extern IntPtr AsFbxCreateTexture(IntPtr context, IntPtr strMatTexName);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxLinkTexture(int dest, IntPtr texture, IntPtr material, float offsetX, float offsetY, float scaleX, float scaleY); private static extern void AsFbxLinkTexture(int dest, IntPtr texture, IntPtr material, float offsetX, float offsetY, float scaleX, float scaleY);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr AsFbxMeshCreateClusterArray(int boneCount); private static extern IntPtr AsFbxMeshCreateClusterArray(int boneCount);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMeshDisposeClusterArray(ref IntPtr ppArray); private static extern void AsFbxMeshDisposeClusterArray(ref IntPtr ppArray);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr AsFbxMeshCreateCluster(IntPtr context, IntPtr boneNode); private static extern IntPtr AsFbxMeshCreateCluster(IntPtr context, IntPtr boneNode);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMeshAddCluster(IntPtr array, IntPtr cluster); private static extern void AsFbxMeshAddCluster(IntPtr array, IntPtr cluster);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr AsFbxMeshCreateMesh(IntPtr context, IntPtr frameNode); private static extern IntPtr AsFbxMeshCreateMesh(IntPtr context, IntPtr frameNode);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMeshInitControlPoints(IntPtr mesh, int vertexCount); private static extern void AsFbxMeshInitControlPoints(IntPtr mesh, int vertexCount);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMeshCreateElementNormal(IntPtr mesh); private static extern void AsFbxMeshCreateElementNormal(IntPtr mesh);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMeshCreateDiffuseUV(IntPtr mesh, int uv); private static extern void AsFbxMeshCreateDiffuseUV(IntPtr mesh, int uv);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMeshCreateNormalMapUV(IntPtr mesh, int uv); private static extern void AsFbxMeshCreateNormalMapUV(IntPtr mesh, int uv);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMeshCreateElementTangent(IntPtr mesh); private static extern void AsFbxMeshCreateElementTangent(IntPtr mesh);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMeshCreateElementVertexColor(IntPtr mesh); private static extern void AsFbxMeshCreateElementVertexColor(IntPtr mesh);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMeshCreateElementMaterial(IntPtr mesh); private static extern void AsFbxMeshCreateElementMaterial(IntPtr mesh);
private static IntPtr AsFbxCreateMaterial(IntPtr pContext, string matName, in Color diffuse, in Color ambient, in Color emissive, in Color specular, in Color reflection, float shininess, float transparency) private static IntPtr AsFbxCreateMaterial(IntPtr pContext, string matName, in Color diffuse, in Color ambient, in Color emissive, in Color specular, in Color reflection, float shininess, float transparency)
@@ -164,7 +164,7 @@ namespace AssetStudio.FbxInterop
} }
} }
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr AsFbxCreateMaterial(IntPtr pContext, IntPtr pMatName, private static extern IntPtr AsFbxCreateMaterial(IntPtr pContext, IntPtr pMatName,
float diffuseR, float diffuseG, float diffuseB, float diffuseR, float diffuseG, float diffuseB,
float ambientR, float ambientG, float ambientB, float ambientR, float ambientG, float ambientB,
@@ -173,53 +173,53 @@ namespace AssetStudio.FbxInterop
float reflectR, float reflectG, float reflectB, float reflectR, float reflectG, float reflectB,
float shininess, float transparency); float shininess, float transparency);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern int AsFbxAddMaterialToFrame(IntPtr frameNode, IntPtr material); private static extern int AsFbxAddMaterialToFrame(IntPtr frameNode, IntPtr material);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxSetFrameShadingModeToTextureShading(IntPtr frameNode); private static extern void AsFbxSetFrameShadingModeToTextureShading(IntPtr frameNode);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMeshSetControlPoint(IntPtr mesh, int index, float x, float y, float z); private static extern void AsFbxMeshSetControlPoint(IntPtr mesh, int index, float x, float y, float z);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMeshAddPolygon(IntPtr mesh, int materialIndex, int index0, int index1, int index2); private static extern void AsFbxMeshAddPolygon(IntPtr mesh, int materialIndex, int index0, int index1, int index2);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMeshElementNormalAdd(IntPtr mesh, int elementIndex, float x, float y, float z); private static extern void AsFbxMeshElementNormalAdd(IntPtr mesh, int elementIndex, float x, float y, float z);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMeshElementUVAdd(IntPtr mesh, int elementIndex, float u, float v); private static extern void AsFbxMeshElementUVAdd(IntPtr mesh, int elementIndex, float u, float v);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMeshElementTangentAdd(IntPtr mesh, int elementIndex, float x, float y, float z, float w); private static extern void AsFbxMeshElementTangentAdd(IntPtr mesh, int elementIndex, float x, float y, float z, float w);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMeshElementVertexColorAdd(IntPtr mesh, int elementIndex, float r, float g, float b, float a); private static extern void AsFbxMeshElementVertexColorAdd(IntPtr mesh, int elementIndex, float r, float g, float b, float a);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMeshSetBoneWeight(IntPtr pClusterArray, int boneIndex, int vertexIndex, float weight); private static extern void AsFbxMeshSetBoneWeight(IntPtr pClusterArray, int boneIndex, int vertexIndex, float weight);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr AsFbxMeshCreateSkinContext(IntPtr context, IntPtr frameNode); private static extern IntPtr AsFbxMeshCreateSkinContext(IntPtr context, IntPtr frameNode);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMeshDisposeSkinContext(ref IntPtr ppSkinContext); private static extern void AsFbxMeshDisposeSkinContext(ref IntPtr ppSkinContext);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool FbxClusterArray_HasItemAt(IntPtr pClusterArray, int index); private static extern bool FbxClusterArray_HasItemAt(IntPtr pClusterArray, int index);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private unsafe static extern void AsFbxMeshSkinAddCluster(IntPtr pSkinContext, IntPtr pClusterArray, int index, float* pBoneMatrix); private unsafe static extern void AsFbxMeshSkinAddCluster(IntPtr pSkinContext, IntPtr pClusterArray, int index, float* pBoneMatrix);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMeshAddDeformer(IntPtr pSkinContext, IntPtr pMesh); private static extern void AsFbxMeshAddDeformer(IntPtr pSkinContext, IntPtr pMesh);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr AsFbxAnimCreateContext([MarshalAs(UnmanagedType.Bool)] bool eulerFilter); private static extern IntPtr AsFbxAnimCreateContext([MarshalAs(UnmanagedType.Bool)] bool eulerFilter);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxAnimDisposeContext(ref IntPtr ppAnimContext); private static extern void AsFbxAnimDisposeContext(ref IntPtr ppAnimContext);
private static void AsFbxAnimPrepareStackAndLayer(IntPtr pContext, IntPtr pAnimContext, string takeName) private static void AsFbxAnimPrepareStackAndLayer(IntPtr pContext, IntPtr pAnimContext, string takeName)
@@ -230,31 +230,31 @@ namespace AssetStudio.FbxInterop
} }
} }
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxAnimPrepareStackAndLayer(IntPtr pContext, IntPtr pAnimContext, IntPtr strTakeName); private static extern void AsFbxAnimPrepareStackAndLayer(IntPtr pContext, IntPtr pAnimContext, IntPtr strTakeName);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxAnimLoadCurves(IntPtr pNode, IntPtr pAnimContext); private static extern void AsFbxAnimLoadCurves(IntPtr pNode, IntPtr pAnimContext);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxAnimBeginKeyModify(IntPtr pAnimContext); private static extern void AsFbxAnimBeginKeyModify(IntPtr pAnimContext);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxAnimEndKeyModify(IntPtr pAnimContext); private static extern void AsFbxAnimEndKeyModify(IntPtr pAnimContext);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxAnimAddScalingKey(IntPtr pAnimContext, float time, float x, float y, float z); private static extern void AsFbxAnimAddScalingKey(IntPtr pAnimContext, float time, float x, float y, float z);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxAnimAddRotationKey(IntPtr pAnimContext, float time, float x, float y, float z); private static extern void AsFbxAnimAddRotationKey(IntPtr pAnimContext, float time, float x, float y, float z);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxAnimAddTranslationKey(IntPtr pAnimContext, float time, float x, float y, float z); private static extern void AsFbxAnimAddTranslationKey(IntPtr pAnimContext, float time, float x, float y, float z);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxAnimApplyEulerFilter(IntPtr pAnimContext, float filterPrecision); private static extern void AsFbxAnimApplyEulerFilter(IntPtr pAnimContext, float filterPrecision);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern int AsFbxAnimGetCurrentBlendShapeChannelCount(IntPtr pAnimContext, IntPtr pNode); private static extern int AsFbxAnimGetCurrentBlendShapeChannelCount(IntPtr pAnimContext, IntPtr pNode);
private static bool AsFbxAnimIsBlendShapeChannelMatch(IntPtr pAnimContext, int channelIndex, string channelName) private static bool AsFbxAnimIsBlendShapeChannelMatch(IntPtr pAnimContext, int channelIndex, string channelName)
@@ -265,26 +265,26 @@ namespace AssetStudio.FbxInterop
} }
} }
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool AsFbxAnimIsBlendShapeChannelMatch(IntPtr pAnimContext, int channelIndex, IntPtr strChannelName); private static extern bool AsFbxAnimIsBlendShapeChannelMatch(IntPtr pAnimContext, int channelIndex, IntPtr strChannelName);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxAnimBeginBlendShapeAnimCurve(IntPtr pAnimContext, int channelIndex); private static extern void AsFbxAnimBeginBlendShapeAnimCurve(IntPtr pAnimContext, int channelIndex);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxAnimEndBlendShapeAnimCurve(IntPtr pAnimContext); private static extern void AsFbxAnimEndBlendShapeAnimCurve(IntPtr pAnimContext);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxAnimAddBlendShapeKeyframe(IntPtr pAnimContext, float time, float value); private static extern void AsFbxAnimAddBlendShapeKeyframe(IntPtr pAnimContext, float time, float value);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr AsFbxMorphCreateContext(); private static extern IntPtr AsFbxMorphCreateContext();
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMorphInitializeContext(IntPtr pContext, IntPtr pMorphContext, IntPtr pNode); private static extern void AsFbxMorphInitializeContext(IntPtr pContext, IntPtr pMorphContext, IntPtr pNode);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMorphDisposeContext(ref IntPtr ppMorphContext); private static extern void AsFbxMorphDisposeContext(ref IntPtr ppMorphContext);
private static void AsFbxMorphAddBlendShapeChannel(IntPtr pContext, IntPtr pMorphContext, string channelName) private static void AsFbxMorphAddBlendShapeChannel(IntPtr pContext, IntPtr pMorphContext, string channelName)
@@ -295,7 +295,7 @@ namespace AssetStudio.FbxInterop
} }
} }
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMorphAddBlendShapeChannel(IntPtr pContext, IntPtr pMorphContext, IntPtr strChannelName); private static extern void AsFbxMorphAddBlendShapeChannel(IntPtr pContext, IntPtr pMorphContext, IntPtr strChannelName);
private static void AsFbxMorphAddBlendShapeChannelShape(IntPtr pContext, IntPtr pMorphContext, float weight, string shapeName) private static void AsFbxMorphAddBlendShapeChannelShape(IntPtr pContext, IntPtr pMorphContext, float weight, string shapeName)
@@ -306,19 +306,19 @@ namespace AssetStudio.FbxInterop
} }
} }
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMorphAddBlendShapeChannelShape(IntPtr pContext, IntPtr pMorphContext, float weight, IntPtr strShapeName); private static extern void AsFbxMorphAddBlendShapeChannelShape(IntPtr pContext, IntPtr pMorphContext, float weight, IntPtr strShapeName);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMorphCopyBlendShapeControlPoints(IntPtr pMorphContext); private static extern void AsFbxMorphCopyBlendShapeControlPoints(IntPtr pMorphContext);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMorphSetBlendShapeVertex(IntPtr pMorphContext, uint index, float x, float y, float z); private static extern void AsFbxMorphSetBlendShapeVertex(IntPtr pMorphContext, uint index, float x, float y, float z);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMorphCopyBlendShapeControlPointsNormal(IntPtr pMorphContext); private static extern void AsFbxMorphCopyBlendShapeControlPointsNormal(IntPtr pMorphContext);
[DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(FbxDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void AsFbxMorphSetBlendShapeVertexNormal(IntPtr pMorphContext, uint index, float x, float y, float z); private static extern void AsFbxMorphSetBlendShapeVertexNormal(IntPtr pMorphContext, uint index, float x, float y, float z);
} }

View File

@@ -5,85 +5,85 @@ namespace Texture2DDecoder
unsafe partial class TextureDecoder unsafe partial class TextureDecoder
{ {
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DecodeDXT1(void* data, int width, int height, void* image); private static extern bool DecodeDXT1(void* data, int width, int height, void* image);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DecodeDXT5(void* data, int width, int height, void* image); private static extern bool DecodeDXT5(void* data, int width, int height, void* image);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DecodePVRTC(void* data, int width, int height, void* image, [MarshalAs(UnmanagedType.Bool)] bool is2bpp); private static extern bool DecodePVRTC(void* data, int width, int height, void* image, [MarshalAs(UnmanagedType.Bool)] bool is2bpp);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DecodeETC1(void* data, int width, int height, void* image); private static extern bool DecodeETC1(void* data, int width, int height, void* image);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DecodeETC2(void* data, int width, int height, void* image); private static extern bool DecodeETC2(void* data, int width, int height, void* image);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DecodeETC2A1(void* data, int width, int height, void* image); private static extern bool DecodeETC2A1(void* data, int width, int height, void* image);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DecodeETC2A8(void* data, int width, int height, void* image); private static extern bool DecodeETC2A8(void* data, int width, int height, void* image);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DecodeEACR(void* data, int width, int height, void* image); private static extern bool DecodeEACR(void* data, int width, int height, void* image);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DecodeEACRSigned(void* data, int width, int height, void* image); private static extern bool DecodeEACRSigned(void* data, int width, int height, void* image);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DecodeEACRG(void* data, int width, int height, void* image); private static extern bool DecodeEACRG(void* data, int width, int height, void* image);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DecodeEACRGSigned(void* data, int width, int height, void* image); private static extern bool DecodeEACRGSigned(void* data, int width, int height, void* image);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DecodeBC4(void* data, int width, int height, void* image); private static extern bool DecodeBC4(void* data, int width, int height, void* image);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DecodeBC5(void* data, int width, int height, void* image); private static extern bool DecodeBC5(void* data, int width, int height, void* image);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DecodeBC6(void* data, int width, int height, void* image); private static extern bool DecodeBC6(void* data, int width, int height, void* image);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DecodeBC7(void* data, int width, int height, void* image); private static extern bool DecodeBC7(void* data, int width, int height, void* image);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DecodeATCRGB4(void* data, int width, int height, void* image); private static extern bool DecodeATCRGB4(void* data, int width, int height, void* image);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DecodeATCRGBA8(void* data, int width, int height, void* image); private static extern bool DecodeATCRGBA8(void* data, int width, int height, void* image);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DecodeASTC(void* data, int width, int height, int blockWidth, int blockHeight, void* image); private static extern bool DecodeASTC(void* data, int width, int height, int blockWidth, int blockHeight, void* image);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void DisposeBuffer(ref void* ppBuffer); private static extern void DisposeBuffer(ref void* ppBuffer);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void UnpackCrunch(void* data, uint dataSize, out void* result, out uint resultSize); private static extern void UnpackCrunch(void* data, uint dataSize, out void* result, out uint resultSize);
[DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Winapi)] [DllImport(T2DDll.DllName, CallingConvention = CallingConvention.Cdecl)]
private static extern void UnpackUnityCrunch(void* data, uint dataSize, out void* result, out uint resultSize); private static extern void UnpackUnityCrunch(void* data, uint dataSize, out void* result, out uint resultSize);
} }