/// <summary> /// Locate a VDX based on filename stored in the RL /// </summary> /// <param name="filename">Filename of the VDX to locate</param> /// <param name="vdxInfo">RL information about the VDX</param> /// <returns>Filestream to the VDX</returns> public BinaryReader getVDX(string filename, out RLData vdxInfo) { vdxInfo.length = 0; vdxInfo.filename = ""; vdxInfo.offset = 0; vdxInfo.number = 0; foreach (RLData rl in vdxMap.Values) { if (rl.filename == filename) { vdxInfo = rl; break; } } if (vdxInfo.length == 0) return null; stream.BaseStream.Seek(vdxInfo.offset, SeekOrigin.Begin); return stream; }
/// <summary> /// Locate a VDX based on index number within the GJD /// </summary> /// <param name="index">Index number of the VDX to get</param> /// <param name="vdxInfo">RL information about the VDX</param> /// <returns>Filestream to the VDX</returns> public BinaryReader getVDX(ushort index, out RLData vdxInfo) { if (!vdxMap.TryGetValue(index, out vdxInfo)) { return null; } stream.BaseStream.Seek(vdxInfo.offset, SeekOrigin.Begin); return stream; }