public static byte[] GetBinaryFile(string archiveName, string fileName) { byte[] isComp = GetBin(Extended.GetUnixFullPath(archiveName), fileName); if (isComp == null) { throw new FileNotFoundException($"Searched {archiveName} and could not find {fileName}.", fileName); } if (_compressed) { isComp = isComp.Skip(4).ToArray(); } return(isComp == null ? null : _compressed?LZSS.DecompressAllNew(isComp) : isComp); }
public static void Init(GraphicsDeviceManager graphics, SpriteBatch spriteBatch, ContentManager content) { FF8DIRdata = Extended.GetUnixFullPath(Path.Combine(FF8DIR, "Data")); string testdir = Extended.GetUnixFullPath(Path.Combine(FF8DIRdata, "lang-en")); FF8DIRdata_lang = Directory.Exists(testdir) ? testdir : FF8DIRdata; Memory.graphics = graphics; Memory.spriteBatch = spriteBatch; Memory.content = content; Memory.DirtyEncoding = new DirtyEncoding(); Memory.FieldHolder.FieldMemory = new int[1024]; InitTask = new Task(InitTaskMethod); InitTask.Start(); }
public ArchiveWorker(string path) { _path = Extended.GetUnixFullPath(path); string root = Path.GetDirectoryName(_path); string file = Path.GetFileNameWithoutExtension(_path); string fi = Extended.GetUnixFullPath($"{Path.Combine(root, file)}{Memory.Archives.B_FileIndex}"); string fl = Extended.GetUnixFullPath($"{Path.Combine(root, file)}{Memory.Archives.B_FileList}"); if (!File.Exists(fi)) { throw new Exception($"There is no {file}.fi file!\nExiting..."); } if (!File.Exists(fl)) { throw new Exception($"There is no {file}.fl file!\nExiting..."); } FileList = ProduceFileLists(); }
public static void Init() { movieDirs = new string[] { Extended.GetUnixFullPath(Path.Combine(Memory.FF8DIRdata, "movies")), //this folder has most movies Extended.GetUnixFullPath(Path.Combine(Memory.FF8DIRdata_lang, "movies")) //this folder has rest of movies }; _movies = new List <string>(); foreach (string s in movieDirs) { if (Directory.Exists(s)) { _movies.AddRange(Directory.GetFiles(s, "*", SearchOption.AllDirectories).Where(x => x.EndsWith(".avi", StringComparison.OrdinalIgnoreCase) || x.EndsWith(".mkv", StringComparison.OrdinalIgnoreCase) || x.EndsWith(".bik", StringComparison.OrdinalIgnoreCase))); } } ReturnState = Memory.MODULE_MAINMENU_DEBUG; }