public static void CopyCharInfo( DRFontChar CopyFrom, DRFontChar CopyTo ) { CopyTo.Width = CopyFrom.Width; CopyTo.Height = CopyFrom.Height; CopyTo.XOffset = CopyFrom.XOffset; CopyTo.YOffset = CopyFrom.YOffset; CopyTo.Unk1 = CopyFrom.Unk1; CopyTo.Unk2 = CopyFrom.Unk2; CopyTo.Unk3 = CopyFrom.Unk3; }
public static void CopyCharInfo(DRFontChar CopyFrom, DRFontChar CopyTo) { CopyTo.Width = CopyFrom.Width; CopyTo.Height = CopyFrom.Height; CopyTo.XOffset = CopyFrom.XOffset; CopyTo.YOffset = CopyFrom.YOffset; CopyTo.Unk1 = CopyFrom.Unk1; CopyTo.Unk2 = CopyFrom.Unk2; CopyTo.Unk3 = CopyFrom.Unk3; }
private DRFontChar GetCharFromRaw(int id) { if (id >= this.InfoCount) { id = 0; } DRFontChar c = new DRFontChar(); c.Character = BitConverter.ToUInt16(file, InfoLocation + (id * InfoLength) + 0x00); c.XOffset = BitConverter.ToUInt16(file, InfoLocation + (id * InfoLength) + 0x02); c.YOffset = BitConverter.ToUInt16(file, InfoLocation + (id * InfoLength) + 0x04); c.Width = BitConverter.ToUInt16(file, InfoLocation + (id * InfoLength) + 0x06); c.Height = BitConverter.ToUInt16(file, InfoLocation + (id * InfoLength) + 0x08); c.Unk1 = BitConverter.ToUInt16(file, InfoLocation + (id * InfoLength) + 0x0A); c.Unk2 = BitConverter.ToUInt16(file, InfoLocation + (id * InfoLength) + 0x0C); c.Unk3 = BitConverter.ToUInt16(file, InfoLocation + (id * InfoLength) + 0x0E); return(c); }
public void ImportExternalCharacter(DRFontChar fc) { DRFontChar mine = GetCharViaCharacter(fc.Character); if (mine == null) { this.Chars.Add(fc); this.Chars.Sort(DRFontChar.Compare); } else { mine.Character = fc.Character; mine.XOffset = fc.XOffset; mine.YOffset = fc.YOffset; mine.Width = fc.Width; mine.Height = fc.Height; mine.Unk1 = fc.Unk1; mine.Unk2 = fc.Unk2; mine.Unk3 = fc.Unk3; } }
void Initialize() { this.InfoLength = 0x10; this.Magic = BitConverter.ToInt32(file, 0x00); this.Unknown1 = BitConverter.ToInt32(file, 0x04); this.InfoCount = BitConverter.ToInt32(file, 0x08); this.InfoLocation = BitConverter.ToInt32(file, 0x0C); this.LookupTableLength = BitConverter.ToInt32(file, 0x10); this.LookupTableLocation = BitConverter.ToInt32(file, 0x14); this.Unknown2 = BitConverter.ToInt32(file, 0x18); this.Unknown3 = BitConverter.ToInt32(file, 0x1C); Chars = new List <DRFontChar>(InfoCount); for (int i = 0; i < InfoCount; ++i) { DRFontChar c = GetCharFromRaw(i); Chars.Add(c); } return; }
public void CopyInfoFrom(DRFontInfo f2) { foreach (DRFontChar fc in f2.Chars) { DRFontChar mine = GetCharViaCharacter(fc.Character); if (mine == null) { this.Chars.Add(fc); } else { mine.Character = fc.Character; mine.XOffset = fc.XOffset; mine.YOffset = fc.YOffset; mine.Width = fc.Width; mine.Height = fc.Height; mine.Unk1 = fc.Unk1; mine.Unk2 = fc.Unk2; mine.Unk3 = fc.Unk3; } } this.Chars.Sort(DRFontChar.Compare); }
public static int Compare( DRFontChar one, DRFontChar other ) { return one.Character - other.Character; }
private DRFontChar GetCharFromRaw( int id ) { if ( id >= this.InfoCount ) id = 0; DRFontChar c = new DRFontChar(); c.Character = BitConverter.ToUInt16( file, InfoLocation + ( id * InfoLength ) + 0x00 ); c.XOffset = BitConverter.ToUInt16( file, InfoLocation + ( id * InfoLength ) + 0x02 ); c.YOffset = BitConverter.ToUInt16( file, InfoLocation + ( id * InfoLength ) + 0x04 ); c.Width = BitConverter.ToUInt16( file, InfoLocation + ( id * InfoLength ) + 0x06 ); c.Height = BitConverter.ToUInt16( file, InfoLocation + ( id * InfoLength ) + 0x08 ); c.Unk1 = BitConverter.ToUInt16( file, InfoLocation + ( id * InfoLength ) + 0x0A ); c.Unk2 = BitConverter.ToUInt16( file, InfoLocation + ( id * InfoLength ) + 0x0C ); c.Unk3 = BitConverter.ToUInt16( file, InfoLocation + ( id * InfoLength ) + 0x0E ); return c; }
public void ImportExternalCharacter( DRFontChar fc ) { DRFontChar mine = GetCharViaCharacter( fc.Character ); if ( mine == null ) { this.Chars.Add( fc ); this.Chars.Sort( DRFontChar.Compare ); } else { mine.Character = fc.Character; mine.XOffset = fc.XOffset; mine.YOffset = fc.YOffset; mine.Width = fc.Width; mine.Height = fc.Height; mine.Unk1 = fc.Unk1; mine.Unk2 = fc.Unk2; mine.Unk3 = fc.Unk3; } }
static public int Compare(DRFontChar one, DRFontChar other) { return(one.Character - other.Character); }