DatFile.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. using Microsoft.Xna.Framework;
  2. using Microsoft.Xna.Framework.Graphics;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.IO;
  6. using System.Linq;
  7. namespace OpenVIII.Battle.Dat
  8. {
  9. public abstract class DatFile
  10. {
  11. #region Fields
  12. public const float ScaleHelper = 2048.0f;
  13. public int Frame;
  14. protected const float BaseLineMaxYFilter = 10f;
  15. private readonly string _prefix;
  16. private Vector3 _indicatorPoint;
  17. #endregion Fields
  18. #region Constructors
  19. protected DatFile(int fileId, EntityType entityType, int additionalFileId = -1, DatFile skeletonReference = null, Sections flags = Sections.All)
  20. {
  21. Flags = flags;
  22. ID = fileId;
  23. AltID = additionalFileId;
  24. var middle = string.Empty;
  25. switch (entityType)
  26. {
  27. case EntityType.Monster:
  28. _prefix = "c0m";
  29. FileName = $"{_prefix}{ID:D03}";
  30. break;
  31. case EntityType.Character:
  32. case EntityType.Weapon:
  33. _prefix = "d";
  34. middle = entityType == EntityType.Character ? "c" : "w";
  35. FileName = $"{_prefix}{ID:x}{middle}{AltID:D03}";
  36. break;
  37. default:
  38. throw new ArgumentOutOfRangeException(nameof(entityType), entityType, null);
  39. }
  40. Memory.Log.WriteLine($"{nameof(DatFile)} Creating new BattleDat with {fileId},{entityType},{additionalFileId}");
  41. var aw = ArchiveWorker.Load(Memory.Archives.A_BATTLE);
  42. EntityType = entityType;
  43. string path;
  44. var search = "";
  45. if (!string.IsNullOrWhiteSpace(middle))
  46. {
  47. search = $"d{fileId:x}{middle}";
  48. IEnumerable<string> test = aw.GetListOfFiles()
  49. .Where(x => x.IndexOf(search, StringComparison.OrdinalIgnoreCase) >= 0).ToArray();
  50. path = test.FirstOrDefault(x => x.ToLower().Contains(FileName));
  51. if (string.IsNullOrWhiteSpace(path) && test.Any() && entityType == EntityType.Character)
  52. path = test.First();
  53. }
  54. else path = aw.GetListOfFiles().FirstOrDefault(x => x.ToLower().Contains(FileName));
  55. if (!string.IsNullOrWhiteSpace(path))
  56. Buffer = aw.GetBinaryFile(path);
  57. if (Buffer == null || Buffer.Length < 0)
  58. {
  59. Memory.Log.WriteLine($"Search String: {search} Not Found skipping {entityType}; So resulting file buffer is null.");
  60. return;
  61. }
  62. ExportFile();
  63. using (Br = new BinaryReader(new MemoryStream(Buffer)))
  64. {
  65. DatHeader = DatHeader.CreateInstance(Br);
  66. }
  67. LoadFile(skeletonReference);
  68. FindAllLowHighPoints();
  69. }
  70. #endregion Constructors
  71. #region Properties
  72. public int AltID { get; }
  73. public AnimationData Animations { get; private set; }
  74. public DatHeader DatHeader { get; }
  75. public EntityType EntityType { get; }
  76. public string FileName { get; }
  77. public Sections Flags { get; }
  78. /// <summary>
  79. /// Section 2: Model Geometry
  80. /// </summary>
  81. /// <see cref="http://wiki.ffrtt.ru/index.php?title=FF8/FileFormat_DAT#Section_2:_Model_geometry"/>
  82. public Geometry Geometry { get; private set; }
  83. public int GetId => ID;
  84. public int ID { get; }
  85. public Information Information { get; private set; }
  86. public IReadOnlyList<AnimationSequence> Sequences { get; private set; }
  87. public Skeleton Skeleton { get; private set; }
  88. public Textures Textures { get; private set; }
  89. protected List<AnimationYOffset> AnimationYOffsets { get; private set; }
  90. protected BinaryReader Br { get; private set; }
  91. protected byte[] Buffer { get; }
  92. protected float OffsetYLow { get; private set; }
  93. private float OffsetY { get; set; }
  94. private Vector3 OffsetYVector => new Vector3(0f, OffsetY, 0f);
  95. #endregion Properties
  96. ///// <summary>
  97. ///// Creates new instance of DAT class that provides every sections parsed into structs and
  98. ///// helper functions for renderer
  99. ///// </summary>
  100. ///// <param name="fileId">This number is used in c0m(fileId) or d(fileId)cXYZ</param>
  101. ///// <param name="entityType">Supply Monster, character or weapon (0,1,2)</param>
  102. ///// <param name="additionalFileId">Used only in character or weapon to supply for d(fileId)[c/w](additionalFileId)</param>
  103. #region Methods
  104. public static Vector3 TransformVertex(Vector3 vertex, Vector3 localTranslate, Quaternion rotation) =>
  105. Vector3.Transform(Vector3.Transform(vertex, rotation), Matrix.CreateTranslation(localTranslate));
  106. /// <summary>
  107. /// This method returns geometry data AFTER animation matrix translations, local
  108. /// position/rotation translations. This is the final step of calculation. This data should
  109. /// be used only by Renderer. Any translations/vertices manipulation should happen inside
  110. /// this method or earlier
  111. /// </summary>
  112. /// <param name="objectId">
  113. /// Monsters can have more than one object. Treat it like multi-model geometry. They are all
  114. /// needed to build whole model
  115. /// </param>
  116. /// <param name="position">a Vector3 to set global position</param>
  117. /// <param name="rotation">a Quaternion to set the correct rotation. 1=90, 2=180 ...</param>
  118. /// <param name="animationId">an animation pointer. Animation 0 is always idle</param>
  119. /// <param name="animationFrame">
  120. /// an animation currentFrame from animation ID. You should pass incrementing currentFrame and reset to 0
  121. /// when frameCount max is hit
  122. /// </param>
  123. /// <param name="step">
  124. /// FEATURE: This float (0.0 - 1.0) is used in Linear interpolation in animation frames
  125. /// blending. 0.0 means frameN, 1.0 means FrameN+1. Usually this should be a result of
  126. /// deltaTime to see if computer is capable of rendering smooth animations rather than
  127. /// constant 15 FPS
  128. /// </param>
  129. /// <returns></returns>
  130. public VertexPositionTexturePointersGRP GetVertexPositions(int objectId, ref Vector3 translationPosition, Quaternion rotation, ref AnimationSystem refAnimationSystem, double step)
  131. {
  132. if (refAnimationSystem.AnimationFrame >= Animations[refAnimationSystem.AnimationId].Count || refAnimationSystem.AnimationFrame < 0)
  133. refAnimationSystem.AnimationFrame = 0;
  134. var nextFrame = Animations[refAnimationSystem.AnimationId][refAnimationSystem.AnimationFrame];
  135. var lastAnimationFrame = refAnimationSystem.LastAnimationFrame;
  136. IReadOnlyList<AnimationFrame> lastAnimationFrames = Animations[refAnimationSystem.LastAnimationId];
  137. lastAnimationFrame = lastAnimationFrames.Count > lastAnimationFrame ? lastAnimationFrame : lastAnimationFrames.Count - 1;
  138. var animationFrame = lastAnimationFrames[lastAnimationFrame];
  139. var obj = Geometry.Objects[objectId];
  140. var i = 0;
  141. var vectorBoneGroups = GetVertices(obj, animationFrame, nextFrame, step);
  142. //float minY = vertices.Min(x => x.Y);
  143. //Vector2 HLPTS = FindLowHighPoints(translationPosition, rotation, currentFrame, nextFrame, step);
  144. var texturePointers = new byte[obj.CTriangles + obj.CQuads * 2];
  145. var vpt = new List<VertexPositionTexture>(texturePointers.Length * 3);
  146. if (objectId == 0)
  147. {
  148. var animationSystem = refAnimationSystem;
  149. var lastOffsets = AnimationYOffsets?.First(x =>
  150. x.ID == animationSystem.LastAnimationId &&
  151. x.Frame == lastAnimationFrame) ?? default;
  152. var nextOffsets = AnimationYOffsets?.First(x =>
  153. x.ID == animationSystem.AnimationId &&
  154. x.Frame == animationSystem.AnimationFrame) ?? default;
  155. OffsetYLow = MathHelper.Lerp(lastOffsets.LowY, nextOffsets.LowY, (float)step);
  156. _indicatorPoint.X = MathHelper.Lerp(lastOffsets.MidX, nextOffsets.MidX, (float)step);
  157. _indicatorPoint.Y = MathHelper.Lerp(lastOffsets.HighY, nextOffsets.HighY, (float)step);
  158. _indicatorPoint.Z = MathHelper.Lerp(lastOffsets.MidZ, nextOffsets.MidZ, (float)step);
  159. // Move All Y axis down to 0 based on Lowest Y axis in Animation ID 0.
  160. if (OffsetY < 0)
  161. {
  162. translationPosition.Y += OffsetY;
  163. }
  164. // If any Y axis readings are lower than 0 in Animation ID >0. Bring it up to zero.
  165. }
  166. //Triangle parsing
  167. for (; i < obj.CTriangles; i++)
  168. {
  169. var preVarTex = Textures[obj.Triangles[i].TextureIndex];
  170. vpt.AddRange(obj.Triangles[i].GenerateVPT(vectorBoneGroups, rotation, translationPosition, preVarTex));
  171. texturePointers[i] = obj.Triangles[i].TextureIndex;
  172. }
  173. //Quad parsing
  174. for (i = 0; i < obj.CQuads; i++)
  175. {
  176. var preVarTex = Textures[obj.Quads[i].TextureIndex];
  177. vpt.AddRange(obj.Quads[i].GenerateVPT(vectorBoneGroups, rotation, translationPosition, preVarTex));
  178. texturePointers[obj.CTriangles + i * 2] = obj.Quads[i].TextureIndex;
  179. texturePointers[obj.CTriangles + i * 2 + 1] = obj.Quads[i].TextureIndex;
  180. }
  181. return new VertexPositionTexturePointersGRP(vpt.ToArray(), texturePointers);
  182. }
  183. public Vector3 IndicatorPoint(Vector3 translationPosition)
  184. {
  185. if (OffsetYLow < 0)
  186. translationPosition.Y -= OffsetYLow;
  187. return _indicatorPoint + translationPosition;
  188. }
  189. /// <summary>
  190. /// Complex function that provides linear interpolation between two matrices of actual
  191. /// to-render animation currentFrame and next currentFrame data for blending
  192. /// </summary>
  193. /// <param name="vectorBoneGRP">the tuple that contains vertex and bone ident</param>
  194. /// <param name="currentFrame">current animation currentFrame to render</param>
  195. /// <param name="nextFrame">
  196. /// animation currentFrame to render that is AFTER the actual one. If last currentFrame, then usually 0 is
  197. /// the 'next' currentFrame
  198. /// </param>
  199. /// <param name="step">
  200. /// step is variable used to determinate the progress for linear interpolation. I.e. 0 for
  201. /// current currentFrame and 1 for next currentFrame; 0.5 for blend of two frames
  202. /// </param>
  203. /// <returns></returns>
  204. private VectorBoneGRP CalculateFrame(VectorBoneGRP vectorBoneGRP, AnimationFrame currentFrame,
  205. AnimationFrame nextFrame, double step)
  206. {
  207. Vector3 getVector(Matrix matrix)
  208. {
  209. var r = new Vector3(
  210. matrix.M11 * vectorBoneGRP.X + matrix.M41 + matrix.M12 * vectorBoneGRP.Z + matrix.M13 * -vectorBoneGRP.Y,
  211. matrix.M21 * vectorBoneGRP.X + matrix.M42 + matrix.M22 * vectorBoneGRP.Z + matrix.M23 * -vectorBoneGRP.Y,
  212. matrix.M31 * vectorBoneGRP.X + matrix.M43 + matrix.M32 * vectorBoneGRP.Z + matrix.M33 * -vectorBoneGRP.Y);
  213. r = Vector3.Transform(r, Matrix.CreateScale(Skeleton.GetScale));
  214. return r;
  215. }
  216. var rootFramePos = getVector(currentFrame.BoneMatrix[vectorBoneGRP.BoneID]); //get's bone matrix
  217. if (!(step > 0f)) return new VectorBoneGRP(rootFramePos, vectorBoneGRP.BoneID);
  218. var nextFramePos = getVector(nextFrame.BoneMatrix[vectorBoneGRP.BoneID]);
  219. rootFramePos = Vector3.Lerp(rootFramePos, nextFramePos, (float)step);
  220. return new VectorBoneGRP(rootFramePos, vectorBoneGRP.BoneID);
  221. }
  222. private void ExportFile()
  223. {
  224. try
  225. {
  226. const string target = @"d:\";
  227. if (!Directory.Exists(target)) return;
  228. var drive = DriveInfo.GetDrives().Where(x =>
  229. x.Name.IndexOf(Path.GetPathRoot(target), StringComparison.OrdinalIgnoreCase) >= 0).ToArray();
  230. var di = new DirectoryInfo(target);
  231. if (!di.Attributes.HasFlag(FileAttributes.ReadOnly) && drive.Count() == 1 && drive[0].DriveType == DriveType.Fixed)
  232. Extended.DumpBuffer(Buffer, Path.Combine(target, "out.dat"));
  233. }
  234. catch (IOException)
  235. {
  236. }
  237. }
  238. private void FindAllLowHighPoints()
  239. {
  240. if (EntityType != EntityType.Character && EntityType != EntityType.Monster) return;
  241. // Get baseline from running function on only Animation 0;
  242. if (Animations.Count == 0)
  243. return;
  244. var baseline = Animations[0].Select(x => FindLowHighPoints(Vector3.Zero, Quaternion.Identity, x, x, 0f)).ToList();
  245. //X is lowY, Y is high Y, Z is mid x, W is mid z
  246. (var baselineLowY, var baselineHighY) = (baseline.Min(x => x.X), baseline.Max(x => x.Y));
  247. OffsetY = 0f;
  248. if (Math.Abs(baselineLowY) < BaseLineMaxYFilter)
  249. {
  250. OffsetY -= baselineLowY;
  251. baselineHighY += OffsetY;
  252. }
  253. // Default indicator point
  254. _indicatorPoint = new Vector3(0, baselineHighY, 0);
  255. // Need to add this later to bring baseline low to 0.
  256. //OffsetY = offsetY;
  257. // Brings all Y values less than baseline low to baseline low
  258. AnimationYOffsets = Animations.SelectMany((animation, animationID) =>
  259. animation.Select((animationFrame, animationFrameNumber) =>
  260. new AnimationYOffset(animationID, animationFrameNumber, FindLowHighPoints(OffsetYVector, Quaternion.Identity, animationFrame, animationFrame, 0f)))).ToList();
  261. }
  262. private Vector4 FindLowHighPoints(Vector3 translationPosition, Quaternion rotation, AnimationFrame currentFrame,
  263. AnimationFrame nextFrame, double step)
  264. {
  265. var vertices =
  266. Geometry.Objects.SelectMany(@object => GetVertices(@object, currentFrame, nextFrame, step)).ToList();
  267. if (translationPosition == Vector3.Zero && rotation == Quaternion.Identity)
  268. return new Vector4(vertices.Min(x => x.Y), vertices.Max(x => x.Y),
  269. (vertices.Min(x => x.X) + vertices.Max(x => x.X)) / 2f,
  270. (vertices.Min(x => x.Z) + vertices.Max(x => x.Z)) / 2f);
  271. {
  272. IEnumerable<Vector3> enumVertices = vertices
  273. .Select(vertex => TransformVertex(vertex, translationPosition, rotation)).ToArray();
  274. // midpoints
  275. return new Vector4(enumVertices.Min(x => x.Y), enumVertices.Max(x => x.Y),
  276. (enumVertices.Min(x => x.X) + enumVertices.Max(x => x.X)) / 2f,
  277. (enumVertices.Min(x => x.Z) + enumVertices.Max(x => x.Z)) / 2f);
  278. }
  279. }
  280. private List<VectorBoneGRP>
  281. GetVertices(Object @object, AnimationFrame currentFrame, AnimationFrame nextFrame, double step) => @object
  282. .VertexData.SelectMany(vertexData => vertexData.Vertices.Select(vertex =>
  283. CalculateFrame(new VectorBoneGRP(vertex, vertexData.BoneId), currentFrame, nextFrame, step))).ToList();
  284. private void LoadCharacter()
  285. {
  286. if (Flags.HasFlag(Sections.Skeleton))
  287. ReadSection1(DatHeader[0]);
  288. if (Flags.HasFlag(Sections.ModelAnimation))
  289. ReadSection3(DatHeader[2]);
  290. if (Flags.HasFlag(Sections.ModelGeometry))
  291. ReadSection2(DatHeader[1]);
  292. if (ID == 7 && EntityType == EntityType.Character) // edna has no weapons.
  293. {
  294. if (Flags.HasFlag(Sections.Textures))
  295. ReadSection11(DatHeader[8]);
  296. if (Flags.HasFlag(Sections.AnimationSequences))
  297. ReadSection5(DatHeader[5], DatHeader[6]);
  298. }
  299. else if (Flags.HasFlag(Sections.Textures))
  300. ReadSection11(DatHeader[5]);
  301. }
  302. private void LoadFile(DatFile skeletonReference)
  303. {
  304. using (Br = new BinaryReader(new MemoryStream(Buffer)))
  305. {
  306. if (Br.BaseStream.Length - Br.BaseStream.Position < 4) return;
  307. switch (EntityType)
  308. {
  309. case EntityType.Monster:
  310. LoadMonster();
  311. return;
  312. case EntityType.Character:
  313. LoadCharacter();
  314. return;
  315. case EntityType.Weapon:
  316. LoadWeapon(skeletonReference);
  317. return;
  318. default:
  319. throw new ArgumentOutOfRangeException();
  320. }
  321. }
  322. }
  323. private void LoadMonster()
  324. {
  325. if (ID == 127)
  326. {
  327. // per wiki 127 only have 7 & 8
  328. if (Flags.HasFlag(Sections.Information))
  329. ReadSection7(DatHeader[0]);
  330. //if (Flags.HasFlag(Sections.Scripts))
  331. // ReadSection8(datFile.pSections[7]);
  332. return;
  333. }
  334. if (Flags.HasFlag(Sections.Skeleton))
  335. ReadSection1(DatHeader[0]);
  336. if (Flags.HasFlag(Sections.ModelAnimation))
  337. ReadSection3(DatHeader[2]); // animation data
  338. if (Flags.HasFlag(Sections.ModelGeometry))
  339. ReadSection2(DatHeader[1]);
  340. //if (Flags.HasFlag(Sections.Section4_Unknown))
  341. // ReadSection4(datFile.pSections[3]);
  342. if (Flags.HasFlag(Sections.AnimationSequences))
  343. ReadSection5(DatHeader[4], DatHeader[5]);
  344. //if (Flags.HasFlag(Sections.Section6_Unknown))
  345. // ReadSection6(datFile.pSections[5]);
  346. if (Flags.HasFlag(Sections.Information))
  347. ReadSection7(DatHeader[6]);
  348. //if (Flags.HasFlag(Sections.Scripts))
  349. //ReadSection8(datFile.pSections[7]); // battle scripts/ai
  350. //if (Flags.HasFlag(Sections.Sounds))
  351. // ReadSection9(datFile.pSections[8], datFile.pSections[9]); //AKAO sounds
  352. //if (Flags.HasFlag(Sections.Sounds_Unknown))
  353. // ReadSection10(datFile.pSections[9], datFile.pSections[10], br, fileName);
  354. if (Flags.HasFlag(Sections.Textures))
  355. ReadSection11(DatHeader[10]);
  356. }
  357. private void LoadWeapon(DatFile skeletonReference)
  358. {
  359. if (ID != 1 && ID != 9)
  360. {
  361. if (Flags.HasFlag(Sections.Skeleton))
  362. ReadSection1(DatHeader[0]);
  363. if (Flags.HasFlag(Sections.ModelAnimation))
  364. ReadSection3(DatHeader[2]);
  365. if (Flags.HasFlag(Sections.ModelGeometry))
  366. ReadSection2(DatHeader[1]);
  367. if (Flags.HasFlag(Sections.AnimationSequences))
  368. ReadSection5(DatHeader[3], DatHeader[4]);
  369. if (Flags.HasFlag(Sections.Textures))
  370. ReadSection11(DatHeader[6]);
  371. }
  372. else if (skeletonReference != null)
  373. {
  374. Skeleton = skeletonReference.Skeleton;
  375. Animations = skeletonReference.Animations;
  376. if (Flags.HasFlag(Sections.ModelGeometry))
  377. ReadSection2(DatHeader[0]);
  378. if (Flags.HasFlag(Sections.AnimationSequences))
  379. ReadSection5(DatHeader[1], DatHeader[2]);
  380. if (Flags.HasFlag(Sections.Textures))
  381. ReadSection11(DatHeader[4]);
  382. }
  383. }
  384. /// <summary>
  385. /// Skeleton data section
  386. /// </summary>
  387. /// <param name="start"></param>
  388. private void ReadSection1(uint start) => Skeleton = Skeleton.CreateInstance(Br, start);
  389. /// <summary>
  390. /// TIM - Textures
  391. /// </summary>
  392. /// <param name="start"></param>
  393. /// <param name="br"></param>
  394. /// <param name="fileName"></param>
  395. private void ReadSection11(uint start)
  396. {
  397. var local = FileName;
  398. switch (EntityType)
  399. {
  400. case EntityType.Monster:
  401. var id = ID;
  402. switch (id)
  403. {
  404. //blue
  405. case 71:
  406. case 73:
  407. case 76:
  408. case 134:
  409. case 143:
  410. id = 73;
  411. break;
  412. //red
  413. case 64:
  414. case 72:
  415. case 74:
  416. case 135:
  417. id = 74;
  418. break;
  419. }
  420. local = $"{_prefix}{id:D03}";
  421. break;
  422. case EntityType.Character:
  423. case EntityType.Weapon:
  424. // local = $"{_prefix}{ID:x}{_middle}{AltID:D03}";
  425. break;
  426. default:
  427. throw new ArgumentOutOfRangeException(nameof(EntityType), EntityType, null);
  428. }
  429. Textures = Textures.CreateInstance(Buffer, start, local);
  430. }
  431. /// <summary>
  432. /// Model Geometry section
  433. /// </summary>
  434. /// <param name="start"></param>
  435. /// <param name="br"></param>
  436. /// <param name="fileName"></param>
  437. private void ReadSection2(uint start) => Geometry = Geometry.CreateInstance(Br, start);
  438. /// <summary>
  439. /// Model Animation section
  440. /// </summary>
  441. /// <param name="start"></param>
  442. /// <param name="br"></param>
  443. /// <param name="fileName"></param>
  444. private void ReadSection3(uint start) => Animations = AnimationData.CreateInstance(Br, start, Skeleton);
  445. /// <summary>
  446. /// Animation Sequences
  447. /// </summary>
  448. /// <param name="start"></param>
  449. /// <param name="end"></param>
  450. /// <param name="br"></param>
  451. /// <param name="fileName"></param>
  452. /// <see cref="http://forums.qhimm.com/index.php?topic=19362.msg270092"/>
  453. private void ReadSection5(uint start, uint end) =>
  454. Sequences = AnimationSequence.CreateInstances(Br, start, end);
  455. /// <summary>
  456. /// Information
  457. /// </summary>
  458. /// <param name="start"></param>
  459. /// <param name="br"></param>
  460. /// <param name="fileName"></param>
  461. private void ReadSection7(uint start) => Information = Information.CreateInstance(Br, start);
  462. #endregion Methods
  463. }
  464. }