using System; using System.IO; using System.Collections.Generic; using System.Linq;…
- User
using System; using System.IO; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ZstdSharp;
namespace NJJM { // class containing data formats and processing code for asset bundles namespace Starlite { // struct for a compressed zstd frame public struct ZstdChunkFrame { // this should be 0x0000ffff or 0x00010000 if new asset // if magic_number is not equal the values above, treat that as asset with more than 1 chunk public uint magic_number;
// zstd frame stuff public uint frame_length; public byte[] frame; public ZstdChunkFrame(BinaryReader reader) { this.magic_number = reader.ReadUInt32(); this.frame_length = reader.ReadUInt32(); reader.BaseStream.Seek(8, SeekOrigin.Current); this.frame = reader.ReadBytes((int)this.frame_length); } } } // asset exporting class. programmer is asleep namespace AssetProcessor { // this processes the zstd frames into raw asset blocks public class BinParse { public void ParseMain(List<NJJM.Starlite.ZstdChunkFrame> frames, List<NJJM.AssetProcessor.DataBlock> output) { // the zstd Decompressor The Squeakuel ! Decompressor decompressor = new Decompressor(); // file buffer for output List<byte> buffer = new List<byte>(); // sort blocks into assets here. programmer is asleep } public void CombineBlocks(List<NJJM.Starlite.ZstdChunkFrame> input, byte[] output) { } } // generic type for a block of raw asset data public struct DataBlock { public byte[] bytes; public DataBlock(byte[] bytez) { this.bytes = bytez; } } }}
- Assistant
- User
how can i do the asset sorting
- Assistant
- User
0x0000ffff and 0x00010000 mark new assets and the assets can contain more than 1 frame
- Assistant
- User
i want it to be able to handle multiple frame assets (if the magic number of the frame is NOT 0x0000ffff or 0x00010000 then it can be anything)
- Assistant
- User
the 'binparser' is for sorting the zstd frames into assets. this code is for extracting Outfit7's Starlite game engine in-place AssetBundle files (root.assets)
- Assistant