1
0
mirror of synced 2024-11-12 02:00:50 +01:00

Try to dispose rarc properly

This commit is contained in:
KillzXGaming 2019-07-28 12:45:39 -04:00
parent 83e1911f3c
commit 9011f2a4c7
8 changed files with 12 additions and 8 deletions

Binary file not shown.

View File

@ -361,6 +361,9 @@ namespace FirstPlugin
{
writer.Write((uint)_exportStringTable.Count);
}
writer.Dispose();
GC.SuppressFinalize(writer);
}
private void WriteDirectories()

View File

@ -434,7 +434,6 @@ namespace FirstPlugin
LoadComponents(Format);
uint ImageSize = reader.ReadUInt32();
Console.WriteLine(ImageSize);
reader.Position = 0;
ImageData = reader.ReadBytes((int)ImageSize);
@ -567,8 +566,6 @@ namespace FirstPlugin
public override byte[] GetImageData(int ArrayLevel = 0, int MipLevel = 0)
{
uint bpp = GetBytesPerPixel(Format);
if (image.Is3DS)
{
PlatformSwizzle = PlatformSwizzle.Platform_3DS;
@ -576,6 +573,8 @@ namespace FirstPlugin
}
else
{
uint bpp = GetBytesPerPixel(Format);
GX2.GX2Surface surf = new GX2.GX2Surface();
surf.bpp = bpp;
surf.height = image.Height;

View File

@ -497,7 +497,7 @@ namespace Toolbox.Library
short SmoothIndex, short RigidIndex, bool IsRoot, ref Assimp.Matrix4x4 rootTransform)
{
Matrix4x4 trafo = node.Transform;
Matrix4x4 world = trafo * rootTransform;
Matrix4x4 world = trafo;
var transformMat = AssimpHelper.TKMatrix(world);
int matchedBoneIndex = skeleton.bones.FindIndex(item => item.Name == node.Name);
@ -508,6 +508,7 @@ namespace Toolbox.Library
STBone bone = new STBone();
bone.skeletonParent = skeleton;
bone.RotationType = STBone.BoneRotationType.Euler;
skeleton.bones.Add(bone);
if (DaeHelper.IDMapToName.ContainsKey(node.Name))
@ -545,11 +546,11 @@ namespace Toolbox.Library
var rotation = transformMat.ExtractRotation();
var position = transformMat.ExtractTranslation();
var rotEular = AssimpHelper.ToEular(rotation);
var rotEular = STMath.ToEulerAngles(rotation);
bone.position = new float[] { position.X, position.Y, position.Z };
bone.scale = new float[] { scale.X, scale.Y, scale.Z };
bone.rotation = new float[] { rotEular.X, rotEular.Y, rotEular.Z, 0 };
bone.rotation = new float[] { rotEular.X, rotEular.Y, rotEular.Z, 1 };
}
else
{

View File

@ -116,7 +116,8 @@ namespace Toolbox.Library
input.A3, input.B3, input.C3, input.D3,
input.A4, input.B4, input.C4, input.D4);
}
public static Vector3 ToEular(OpenTK.Quaternion q)
public static Vector3 ToEulerAngles(OpenTK.Quaternion q)
{
Matrix4 mat = Matrix4.CreateFromQuaternion(q);
float x, y, z;

View File

@ -936,7 +936,7 @@ namespace ColladaHelper
mat.ClearTranslation();
mat.Invert();
var quat = mat.ExtractRotation();
rot = Toolbox.Library.AssimpHelper.ToEular(quat);
rot = Toolbox.Library.AssimpHelper.ToEulerAngles(quat);
if (float.IsNaN(rot.X)) rot.X = 0;
if (float.IsNaN(rot.Y)) rot.Y = 0;
if (float.IsNaN(rot.Z)) rot.Z = 0;