Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit 0315afe

Browse files
authored
Merge pull request #7 from Pro-Swapper/dev
update 0.9.7
2 parents 0143f7a + d65e0ef commit 0315afe

665 files changed

Lines changed: 19259 additions & 17496 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 398 additions & 11 deletions
Large diffs are not rendered by default.

Bunifu_UI_v1.52.dll

-221 KB
Binary file not shown.

CUE4Parse/.gitignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

CUE4Parse/ACL/ACLException.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using System;
2+
3+
namespace CUE4Parse.ACL
4+
{
5+
public class ACLException : Exception
6+
{
7+
public ACLException(string? message) : base(message) { }
8+
}
9+
}

CUE4Parse/ACL/ACLNative.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using System.Runtime.InteropServices;
3+
4+
namespace CUE4Parse.ACL
5+
{
6+
public static class ACLNative
7+
{
8+
public const string LIB_NAME = "CUE4Parse-Natives";
9+
10+
[DllImport(LIB_NAME)]
11+
public static extern IntPtr nAllocate(int size, int alignment = 16);
12+
13+
[DllImport(LIB_NAME)]
14+
public static extern void nDeallocate(IntPtr ptr, int size);
15+
16+
// pure c# way:
17+
//var rawPtr = Marshal.AllocHGlobal(size + 8);
18+
//var aligned = new IntPtr(16 * (((long) rawPtr + 15) / 16));
19+
}
20+
}

CUE4Parse/ACL/CompressedHeaders.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System.Runtime.CompilerServices;
2+
3+
namespace CUE4Parse.ACL
4+
{
5+
public struct RawBufferHeader
6+
{
7+
public uint Size;
8+
public uint Hash;
9+
}
10+
11+
public struct TracksHeader
12+
{
13+
public uint Tag;
14+
public ushort Version;
15+
public byte AlgorithmType;
16+
public byte TrackType;
17+
public uint NumTracks;
18+
public uint NumSamples;
19+
public float SampleRate;
20+
public uint MiscPacked;
21+
22+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
23+
public bool GetHasScale() => (MiscPacked & 1) != 0;
24+
}
25+
}

CUE4Parse/ACL/CompressedTracks.cs

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
using System;
2+
using System.Runtime.InteropServices;
3+
using static CUE4Parse.ACL.ACLNative;
4+
5+
namespace CUE4Parse.ACL
6+
{
7+
public class CompressedTracks
8+
{
9+
public IntPtr Handle { get; private set; }
10+
private readonly int _bufferLength;
11+
12+
public CompressedTracks(byte[] buffer)
13+
{
14+
_bufferLength = buffer.Length;
15+
Handle = nAllocate(_bufferLength);
16+
Marshal.Copy(buffer, 0, Handle, buffer.Length);
17+
var error = IsValid(false);
18+
if (error != null)
19+
{
20+
nDeallocate(Handle, _bufferLength);
21+
Handle = IntPtr.Zero;
22+
throw new ACLException(error);
23+
}
24+
}
25+
26+
public CompressedTracks(IntPtr existing)
27+
{
28+
_bufferLength = -1;
29+
Handle = existing;
30+
}
31+
32+
~CompressedTracks()
33+
{
34+
if (_bufferLength >= 0 && Handle != IntPtr.Zero)
35+
{
36+
nDeallocate(Handle, _bufferLength);
37+
Handle = IntPtr.Zero;
38+
}
39+
}
40+
41+
public string? IsValid(bool checkHash)
42+
{
43+
var error = Marshal.PtrToStringAnsi(nCompressedTracks_IsValid(Handle, checkHash))!;
44+
return error.Length > 0 ? error : null;
45+
}
46+
47+
public TracksHeader GetTracksHeader() => Marshal.PtrToStructure<TracksHeader>(Handle + Marshal.SizeOf<RawBufferHeader>());
48+
49+
[DllImport(LIB_NAME)]
50+
private static extern IntPtr nCompressedTracks_IsValid(IntPtr handle, bool checkHash);
51+
}
52+
}

CUE4Parse/CUE4Parse-Conversion/CUE4Parse-Conversion.csproj

Lines changed: 0 additions & 29 deletions
This file was deleted.

CUE4Parse/CUE4Parse-Conversion/IExporter.cs

Lines changed: 0 additions & 58 deletions
This file was deleted.

CUE4Parse/CUE4Parse-Conversion/Materials/MaterialExporter.cs

Lines changed: 0 additions & 125 deletions
This file was deleted.

0 commit comments

Comments
 (0)