mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-16 14:04:51 +08:00
R26_dev8 - First public commit
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CodeWalker.GameFiles
|
||||
{
|
||||
public class YtdFile : GameFile, PackedFile
|
||||
{
|
||||
public TextureDictionary TextureDict { get; set; }
|
||||
|
||||
|
||||
public YtdFile() : base(null, GameFileType.Ytd)
|
||||
{
|
||||
}
|
||||
public YtdFile(RpfFileEntry entry) : base(entry, GameFileType.Ytd)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public void Load(byte[] data, RpfFileEntry entry)
|
||||
{
|
||||
Name = entry.Name;
|
||||
|
||||
|
||||
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);
|
||||
|
||||
|
||||
TextureDict = rd.ReadBlock<TextureDictionary>();
|
||||
|
||||
//MemoryUsage = 0; //uses decompressed file size now..
|
||||
//if (TextureDict != null)
|
||||
//{
|
||||
// MemoryUsage += TextureDict.MemoryUsage;
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user