/// <summary> /// Loads a Hues object from a file /// </summary> /// <param name="FileName">The hues.mul file to read from</param> /// <returns>A Hues object</returns> public static Hues Load(string FileName) { if (!File.Exists(FileName)) { return(null); } try { var stream = new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); var reader = new BinaryReader(stream, Encoding.ASCII); var hues = new Hues(); for (var i = 0; i < 375; i++) { hues.m_Groups[i] = HueGroup.Read(reader); } stream.Close(); return(hues); } catch { return(null); } }
/// <summary> /// Reads a HueGroup /// </summary> /// <param name="reader">The reader of the data stream</param> /// <returns>A HueGroupd item</returns> public static HueGroup Read(BinaryReader reader) { var group = new HueGroup(); group.m_Header = reader.ReadInt32(); group.HueList = new Hue[8]; for (var i = 0; i < 8; i++) { group.HueList[i] = Hue.Read(reader); } return(group); }
/// <summary> /// Reads a HueGroup /// </summary> /// <param name="reader">The reader of the data stream</param> /// <returns>A HueGroupd item</returns> public static HueGroup Read(BinaryReader reader) { HueGroup group = new HueGroup(); group.m_Header = reader.ReadInt32(); group.m_Hues = new Hue[8]; for (int i = 0; i < 8; i++) { group.m_Hues[i] = Hue.Read(reader); } return(group); }
/// <summary> /// Reads a HueGroup /// </summary> /// <param name="reader">The reader of the data stream</param> /// <returns>A HueGroupd item</returns> public static HueGroup Read( BinaryReader reader ) { HueGroup group = new HueGroup(); group.m_Header = reader.ReadInt32(); group.m_Hues = new Hue[ 8 ]; for ( int i = 0; i < 8; i++ ) group.m_Hues[ i ] = Hue.Read( reader ); return group; }