VeRegion.cs 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #region License information
  2. // ----------------------------------------------------------------------------
  3. //
  4. // libeq2 - A library for analyzing the Everquest II File Format
  5. // Blaz (blaz@blazlabs.com)
  6. //
  7. // This program is free software; you can redistribute it and/or
  8. // modify it under the terms of the GNU General Public License
  9. // as published by the Free Software Foundation; either version 2
  10. // of the License, or (at your option) any later version.
  11. //
  12. // This program is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. // GNU General Public License for more details.
  16. //
  17. // You should have received a copy of the GNU General Public License
  18. // along with this program; if not, write to the Free Software
  19. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  20. //
  21. // ( The full text of the license can be found in the License.txt file )
  22. //
  23. // ----------------------------------------------------------------------------
  24. #endregion
  25. #region Using directives
  26. using System;
  27. #endregion
  28. namespace Everquest2.Visualization {
  29. public class VeRegion : VeBase {
  30. public VeRegion() {
  31. }
  32. /// <summary>
  33. /// Special constructor used when deserializing the instance of the class.
  34. /// </summary>
  35. /// <param name="reader">Reader used to read the instance data.</param>
  36. protected VeRegion(Util.Eq2Reader reader, Util.StreamingContext context)
  37. : base(reader, context) {
  38. byte classVersion = context.ClassVersions[typeof(VeRegion)];
  39. if (classVersion == 0) unk0 = reader.ReadSingle();
  40. ushort count = reader.ReadUInt16();
  41. unk1 = new float[count, 3];
  42. unk2 = new float[count];
  43. unk3 = new short[count, 2];
  44. for (ushort i = 0; i < count; ++i) {
  45. unk1[i, 0] = reader.ReadSingle();
  46. unk1[i, 1] = reader.ReadSingle();
  47. unk1[i, 2] = reader.ReadSingle();
  48. unk2[i] = reader.ReadSingle();
  49. unk3[i, 0] = reader.ReadInt16();
  50. unk3[i, 1] = reader.ReadInt16();
  51. }
  52. if (classVersion >= 2) {
  53. uint unkcount = reader.ReadUInt32();
  54. float[,] unk6 = new float[unkcount, 4];
  55. for (int i = 0; i < unkcount; i++) {
  56. unk6[i, 0] = reader.ReadSingle();
  57. unk6[i, 1] = reader.ReadSingle();
  58. unk6[i, 2] = reader.ReadSingle();
  59. unk6[i, 3] = reader.ReadSingle();
  60. }
  61. }
  62. unk4[0] = reader.ReadSingle();
  63. unk4[1] = reader.ReadSingle();
  64. unk4[2] = reader.ReadSingle();
  65. unk5 = reader.ReadSingle();
  66. }
  67. private float unk0;
  68. private float[,] unk1;
  69. private float[] unk2;
  70. private short[,] unk3;
  71. private float[] unk4 = new float[3];
  72. private float unk5;
  73. }
  74. }