Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
409 changes: 398 additions & 11 deletions .gitignore

Large diffs are not rendered by default.

Binary file removed Bunifu_UI_v1.52.dll
Binary file not shown.
7 changes: 0 additions & 7 deletions CUE4Parse/.gitignore

This file was deleted.

9 changes: 9 additions & 0 deletions CUE4Parse/ACL/ACLException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System;

namespace CUE4Parse.ACL
{
public class ACLException : Exception
{
public ACLException(string? message) : base(message) { }
}
}
20 changes: 20 additions & 0 deletions CUE4Parse/ACL/ACLNative.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Runtime.InteropServices;

namespace CUE4Parse.ACL
{
public static class ACLNative
{
public const string LIB_NAME = "CUE4Parse-Natives";

[DllImport(LIB_NAME)]
public static extern IntPtr nAllocate(int size, int alignment = 16);

[DllImport(LIB_NAME)]
public static extern void nDeallocate(IntPtr ptr, int size);

// pure c# way:
//var rawPtr = Marshal.AllocHGlobal(size + 8);
//var aligned = new IntPtr(16 * (((long) rawPtr + 15) / 16));
}
}
25 changes: 25 additions & 0 deletions CUE4Parse/ACL/CompressedHeaders.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System.Runtime.CompilerServices;

namespace CUE4Parse.ACL
{
public struct RawBufferHeader
{
public uint Size;
public uint Hash;
}

public struct TracksHeader
{
public uint Tag;
public ushort Version;
public byte AlgorithmType;
public byte TrackType;
public uint NumTracks;
public uint NumSamples;
public float SampleRate;
public uint MiscPacked;

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool GetHasScale() => (MiscPacked & 1) != 0;
}
}
52 changes: 52 additions & 0 deletions CUE4Parse/ACL/CompressedTracks.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System;
using System.Runtime.InteropServices;
using static CUE4Parse.ACL.ACLNative;

namespace CUE4Parse.ACL
{
public class CompressedTracks
{
public IntPtr Handle { get; private set; }
private readonly int _bufferLength;

public CompressedTracks(byte[] buffer)
{
_bufferLength = buffer.Length;
Handle = nAllocate(_bufferLength);
Marshal.Copy(buffer, 0, Handle, buffer.Length);
var error = IsValid(false);
if (error != null)
{
nDeallocate(Handle, _bufferLength);
Handle = IntPtr.Zero;
throw new ACLException(error);
}
}

public CompressedTracks(IntPtr existing)
{
_bufferLength = -1;
Handle = existing;
}

~CompressedTracks()
{
if (_bufferLength >= 0 && Handle != IntPtr.Zero)
{
nDeallocate(Handle, _bufferLength);
Handle = IntPtr.Zero;
}
}

public string? IsValid(bool checkHash)
{
var error = Marshal.PtrToStringAnsi(nCompressedTracks_IsValid(Handle, checkHash))!;
return error.Length > 0 ? error : null;
}

public TracksHeader GetTracksHeader() => Marshal.PtrToStructure<TracksHeader>(Handle + Marshal.SizeOf<RawBufferHeader>());

[DllImport(LIB_NAME)]
private static extern IntPtr nCompressedTracks_IsValid(IntPtr handle, bool checkHash);
}
}
29 changes: 0 additions & 29 deletions CUE4Parse/CUE4Parse-Conversion/CUE4Parse-Conversion.csproj

This file was deleted.

58 changes: 0 additions & 58 deletions CUE4Parse/CUE4Parse-Conversion/IExporter.cs

This file was deleted.

125 changes: 0 additions & 125 deletions CUE4Parse/CUE4Parse-Conversion/Materials/MaterialExporter.cs

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions CUE4Parse/CUE4Parse-Conversion/Meshes/Common/VChunkHeader.cs

This file was deleted.

12 changes: 0 additions & 12 deletions CUE4Parse/CUE4Parse-Conversion/Meshes/ELodFormat.cs

This file was deleted.

Loading