virtual file system migration.

This commit is contained in:
morkt
2015-09-01 14:20:18 +04:00
parent ddfd5a117d
commit 4d48b25512
10 changed files with 32 additions and 33 deletions

View File

@@ -45,10 +45,9 @@ namespace GameRes.Formats.BlackCyc
if (!file.Name.EndsWith (".gpk", StringComparison.InvariantCultureIgnoreCase))
return null;
var gtb_name = Path.ChangeExtension (file.Name, "gtb");
var gtb_info = new FileInfo (gtb_name);
if (!gtb_info.Exists)
if (!VFS.FileExists (gtb_name))
return null;
using (var gtb = new ArcView (gtb_name))
using (var gtb = VFS.OpenView (gtb_name))
{
int count = gtb.View.ReadInt32 (0);
if (!IsSaneCount (count))

View File

@@ -45,14 +45,14 @@ namespace GameRes.Formats.BlackCyc
if (!file.Name.EndsWith (".vpk", StringComparison.InvariantCultureIgnoreCase))
return null;
var vtb_name = Path.ChangeExtension (file.Name, "vtb");
var vtb_info = new FileInfo (vtb_name);
if (!vtb_info.Exists)
if (!VFS.FileExists (vtb_name))
return null;
int count = (int)(vtb_info.Length / 0x0C) - 1;
var vtb_entry = VFS.FindFile (vtb_name);
int count = (int)(vtb_entry.Size / 0x0C) - 1;
if (!IsSaneCount (count))
return null;
using (var vtb = new ArcView (vtb_name))
using (var vtb = VFS.OpenView (vtb_entry))
{
vtb.View.Reserve (0, (uint)vtb.MaxOffset);
uint index_offset = 0;