R26_dev8 - First public commit

This commit is contained in:
dexyfex
2017-09-21 20:33:05 +10:00
Unverified
commit a8243c3e0e
391 changed files with 157678 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CodeWalker.GameFiles
{
public class YftFile : GameFile, PackedFile
{
public FragType Fragment { get; set; }
public YftFile() : base(null, GameFileType.Yft)
{
}
public YftFile(RpfFileEntry entry) : base(entry, GameFileType.Yft)
{
}
public void Load(byte[] data, RpfFileEntry entry)
{
Name = entry.Name;
RpfFileEntry = entry;
RpfResourceFileEntry resentry = entry as RpfResourceFileEntry;
if (resentry == null)
{
throw new Exception("File entry wasn't a resource! (is it binary data?)");
}
ResourceDataReader rd = new ResourceDataReader(resentry, data);
Fragment = rd.ReadBlock<FragType>();
if (Fragment.Drawable != null)
{
Fragment.Drawable.Owner = this;
}
if (Fragment.Unknown_F8h_Data != null)
{
Fragment.Unknown_F8h_Data.Owner = this;
}
Loaded = true;
}
}
}