MediaDataInstaller.cpp 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579
  1. /*
  2. * Copyright (C) 2022 The V-Gears Team
  3. *
  4. * This file is part of V-Gears
  5. *
  6. * V-Gears is free software: you can redistribute it and/or modify it under
  7. * terms of the GNU General Public License as published by the Free Software
  8. * Foundation, version 3.0 (GPLv3) of the License.
  9. *
  10. * V-Gears is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #include <string>
  16. #include <iostream>
  17. #include <cstdio>
  18. #include <OgreDataStream.h>
  19. #include <OgreResourceGroupManager.h>
  20. #include <OgreImage.h>
  21. #include <OgreColourValue.h>
  22. #include <boost/format.hpp>
  23. #include <boost/algorithm/string.hpp>
  24. #include <boost/predef/os.h>
  25. #include <boost/filesystem.hpp>
  26. #include <tinyxml.h>
  27. #include "MediaDataInstaller.h"
  28. #include "data/VGearsLGPArchive.h"
  29. #include "data/VGearsTexFile.h"
  30. #include "TexFile.h"
  31. #if (BOOST_OS_WINDOWS)
  32. #include <stdlib>
  33. #elif (BOOST_OS_SOLARIS)
  34. #include <stdlib>
  35. #include <limits>
  36. #elif (BOOST_OS_LINUX)
  37. #include <unistd.h>
  38. #include <limits.h>
  39. #elif (BOOST_OS_MACOS)
  40. #include <mach-o/dyld.h>
  41. #elif (BOOST_OS_BSD_FREE)
  42. #include <sys/types>
  43. #include <sys/sysctl>
  44. #endif
  45. int MediaDataInstaller::TOTAL_SOUNDS = 750;
  46. MediaDataInstaller::MediaDataInstaller(
  47. const std::string input_dir, const std::string output_dir, const bool keep_originals,
  48. const bool no_ffmpeg, const bool no_timidity
  49. ):
  50. input_dir_(input_dir), output_dir_(output_dir), keep_originals_(keep_originals),
  51. no_ffmpeg_(no_ffmpeg), no_timidity_(no_timidity),
  52. menu_(input_dir + "data/menu/menu_us.lgp", "LGP"), window_(input_dir + "data/kernel/WINDOW.BIN"),
  53. midi_(input_dir + "data/midi/midi.lgp", "LGP")
  54. {PopulateMaps();}
  55. std::string MediaDataInstaller::GetExecutablePath(){
  56. #if (BOOST_OS_WINDOWS)
  57. char *exe_path;
  58. if (_get_pgmptr(&exe_path) != 0) exe_path = "";
  59. #elif (BOOST_OS_SOLARIS)
  60. char exe_path[PATH_MAX];
  61. if (realpath(getexecname(), exe_path) == NULL) exe_path[0] = '\0';
  62. #elif (BOOST_OS_LINUX)
  63. char exe_path[PATH_MAX];
  64. ssize_t len = ::readlink("/proc/self/exe", exe_path, sizeof(exe_path));
  65. if (len == -1 || len == sizeof(exe_path)) len = 0;
  66. exe_path[len] = '\0';
  67. #elif (BOOST_OS_MACOS)
  68. char exe_path[PATH_MAX];
  69. uint32_t len = sizeof(exe_path);
  70. if (_NSGetExecutablePath(exe_path, &len) != 0){
  71. exe_path[0] = '\0'; // buffer too small (!)
  72. }
  73. else {
  74. // resolve symlinks, ., .. if possible
  75. char *canonical_path = realpath(exe_path, NULL);
  76. if (canonical_path != NULL){
  77. strncpy(exe_path,canonical_path,len);
  78. free(canonical_path);
  79. }
  80. }
  81. #elif (BOOST_OS_BSD_FREE)
  82. char exe_path[2048];
  83. int mib[4];
  84. mib[0] = CTL_KERN;
  85. mib[1] = KERN_PROC;
  86. mib[2] = KERN_PROC_PATHNAME;
  87. mib[3] = -1;
  88. size_t len = sizeof(exe_path);
  89. if (sysctl(mib, 4, exe_path, &len, NULL, 0) != 0) exe_path[0] = '\0';
  90. #endif
  91. return
  92. strlen(exe_path) > 0
  93. ? boost::filesystem::path(exe_path).remove_filename().make_preferred().string()
  94. : std::string();
  95. }
  96. void MediaDataInstaller::PopulateMaps(){
  97. // Most data here comes from https://forums.qhimm.com/index.php?topic=15786.0
  98. sound_map_[0] = "Cursor";
  99. sound_description_[0] = "Cursor movement in windows and menus.";
  100. sound_map_[1] = "Window|SaveReady";
  101. sound_description_[1] = "Opening some windows, memory cards available on the save menu.";
  102. sound_map_[2] = "Error|InvalidChoice";
  103. sound_description_[2] = "Failure or error, selecting a greyed out option in a choice list.";
  104. sound_map_[3] = "Back|Cancel";
  105. sound_description_[3] = "Cancel button on choices, closing menus.";
  106. sound_map_[4] = "Miss";
  107. sound_description_[4] = "Hit miss during battle.";
  108. sound_map_[5] = "Cure|Potion";
  109. sound_description_[5] = "Cure spell or Potion during battle.";
  110. sound_map_[6] = "HighPotion";
  111. sound_description_[6] = "Hi-Potion during battle.";
  112. sound_map_[7] = "Cure2|XPotion";
  113. sound_description_[7] = "Cure2 or X-Potion during battle.";
  114. sound_map_[8] = "Fire";
  115. sound_description_[8] = "Fire spell.";
  116. sound_map_[9] = "Fire2";
  117. sound_description_[9] = "Fire 2 spell.";
  118. sound_map_[10] = "Bolt";
  119. sound_description_[10] = "Bolt spell.";
  120. sound_map_[11] = "Bolt2|Thunder";
  121. sound_description_[11] = "Bolt2 spell, sometimes thunder on fields (eg HoneyBee inn).";
  122. sound_map_[12] = "MagicPrep";
  123. sound_description_[12] = "Light that envolves a character when casting magic, summon...";
  124. sound_map_[13] = "LeviathanWave";
  125. sound_description_[13] = "Part of Leviathan summoning.";
  126. sound_map_[14] = "GunHit";
  127. sound_description_[14] = "Gun sound, heard on fields and battles.";
  128. sound_map_[15] = "BarretShoot";
  129. sound_description_[15] = "Barrets chain gun.";
  130. sound_map_[16] = "LeviathanScream";
  131. sound_description_[16] = "Part of Leviathan summoning.";
  132. sound_map_[17] = "CloudHit";
  133. sound_description_[17] = "Cloud sword hit.";
  134. sound_map_[18] = "";
  135. sound_description_[18] = "";
  136. sound_map_[19] = "Grenade";
  137. sound_description_[19] = "Grenade item in battle.";
  138. sound_map_[20] = "Ladder|BattleItem";
  139. sound_description_[20]
  140. = "Character grabbing a ladder on the fields, character reaching for an item during battle";
  141. sound_map_[21] = "EnemyDeath";
  142. sound_description_[21] = "When most enemies die.";
  143. sound_map_[22] = "AeriCriticalHit";
  144. sound_description_[22] = "Aeris staff critical hit.";
  145. sound_map_[23] = "Ice";
  146. sound_description_[23] = "Ice spell";
  147. sound_map_[24] = "Bite";
  148. sound_description_[24] = "enemy bite-type attack, dogs or behemoths. Similar to 399.";
  149. sound_map_[25] = "Flee";
  150. sound_description_[25] = "Footsteps escaping from battle.";
  151. sound_map_[26] = "CloudCriticalHit";
  152. sound_description_[26] = "Cloud sword critical hit";
  153. sound_map_[27] = "FieldPunch";
  154. sound_description_[27] = "Punch sound on fields.";
  155. sound_map_[28] = "Ice3";
  156. sound_description_[28] = "Ice3 spell.";
  157. sound_map_[29] = "Demi";
  158. sound_description_[29] = "Demi sound after dark matter launched.";
  159. sound_map_[30] = "";
  160. sound_description_[30] = "";
  161. sound_map_[31] = "GateDecipher";
  162. sound_description_[31] = "Part of Jessie opening the deciphered gate (second half).";
  163. sound_map_[32] = "MeteoStrike";
  164. sound_description_[32] = "Tifas Meteo Strike limit.";
  165. sound_map_[33] = "HealingWind";
  166. sound_description_[33] = "Aeris Healing Wind limit.";
  167. sound_map_[34] = "Punch";
  168. sound_description_[34] = "Enemy punch-type attack";
  169. sound_map_[35] = "LimitAura";
  170. sound_description_[35] = "Before any limit, the orange aura sound.";
  171. sound_map_[36] = "ReactorCore";
  172. sound_description_[36] = "Background ambient sound in deeper reactor areas.";
  173. sound_map_[37] = "ReactorBackground";
  174. sound_description_[37] = "Background ambient sound in less deep reactor areas.";
  175. sound_map_[38] = "UnderwaterReactor";
  176. sound_description_[38] = "Background ambient sound in the underwater reactor.";
  177. sound_map_[39] = "BigShot";
  178. sound_description_[39] = "Barrets Big Shot limit.";
  179. sound_map_[40] = "SummonVanish";
  180. sound_description_[40] = "When about to summon the party disappears.";
  181. sound_map_[41] = "Elevator";
  182. sound_description_[41] = "Elevator moving.";
  183. sound_map_[42] = "BattleSwirl";
  184. sound_description_[42] = "Sound during battle swirling before battles.";
  185. sound_map_[43] = "ReelStop";
  186. sound_description_[43] = "When a reel slot stops during battle (limits, arena...)";
  187. sound_map_[44] = "Load";
  188. sound_description_[44] = "Loading game?";
  189. sound_map_[45] = "BarretCriticalHit";
  190. sound_description_[45] = "Barrets critical gun hit.";
  191. sound_map_[46] = "BarretMiss|StealMiss";
  192. sound_description_[46] = "Barret missing hit, unsuccessful steal.";
  193. sound_map_[47] = "BoostedJump";
  194. sound_description_[47] = "Some kind of boosted jump, battles and/or fields?";
  195. sound_map_[48] = "SmokeShot";
  196. sound_description_[48] = "Enemy Smoke shot (and similar) attacks.";
  197. sound_map_[49] = "AerisHit";
  198. sound_description_[49] = "Aeris staff hit.";
  199. sound_map_[50] = "On";
  200. sound_description_[50] = "Switching something on";
  201. sound_map_[51] = "GateUnlocked";
  202. sound_description_[51] = "Part of Jessie opening the deciphered gate (second half).";
  203. sound_map_[52] = "TrainDoor";
  204. sound_description_[52] = "Train door sound.";
  205. sound_map_[53] = "ReinforcedDoor.";
  206. sound_description_[53] = "Some reinforced doors. In reactors?";
  207. sound_map_[54] = "Jump";
  208. sound_description_[54] = "Character jump on fields.";
  209. sound_map_[55] = "Land";
  210. sound_description_[55] = "Character landing after a jump on fields.";
  211. sound_map_[56] = "Charge";
  212. sound_description_[56] = "Enemy charge-type attack.";
  213. sound_map_[57] = "Laser";
  214. sound_description_[57] = "enemy laser-type attack.";
  215. sound_map_[58] = "Beep";
  216. sound_description_[58] = "Computer or machine beep sound.";
  217. sound_map_[59] = "Alert";
  218. sound_description_[59] = "Alarm sound.";
  219. sound_map_[60] = "Computer|SetBomb";
  220. sound_description_[60] = "operating some computers, setting Jessies bomb.";
  221. sound_map_[61] = "Dodge";
  222. sound_description_[61] = "Dodging an attack.";
  223. sound_map_[62] = "Bio";
  224. sound_description_[62] = "Bio spell.";
  225. sound_map_[63] = "UNKNOWN63";
  226. sound_description_[63] = "";
  227. sound_map_[64] = "Slow";
  228. sound_description_[64] = "Slow spell.";
  229. sound_map_[65] = "Berserk";
  230. sound_description_[65] = "Berserk spell.";
  231. sound_map_[66] = "Shell";
  232. sound_description_[66] = "Shell spell.";
  233. sound_map_[67] = "Wall";
  234. sound_description_[67] = "Wall spell.";
  235. sound_map_[68] = "Cure3|Elixir";
  236. sound_description_[68] = "Cure3 or Elixir during battle.";
  237. sound_map_[69] = "Bol3";
  238. sound_description_[69] = "Bolt3 spell.";
  239. sound_map_[70] = "Quake";
  240. sound_description_[70] = "Quake spell.";
  241. sound_map_[71] = "Reflect";
  242. sound_description_[71] = "Reflect spell.";
  243. sound_map_[72] = "Sleepel";
  244. sound_description_[72] = "Sleepel spell.";
  245. sound_map_[73] = "Demi3";
  246. sound_description_[73] = "Demi 3 spell, after the dark matter is launched.";
  247. sound_map_[74] = "Demi2";
  248. sound_description_[74] = "Demi 2 spell, after the dark matter is launched.";
  249. sound_map_[75] = "Comet";
  250. sound_description_[75] = "Comet spell.";
  251. sound_map_[76] = "";
  252. sound_description_[76] = "";
  253. sound_map_[77] = "Tornado";
  254. sound_description_[77] = "tornado spell.";
  255. sound_map_[78] = "";
  256. sound_description_[78] = "";
  257. sound_map_[79] = "DemiShot";
  258. sound_description_[79] = "Demi/2/3, before 29, 74 or 73.";
  259. sound_map_[80] = "";
  260. sound_description_[80] = "";
  261. sound_map_[81] = "";
  262. sound_description_[81] = "";
  263. sound_map_[82] = "Haste";
  264. sound_description_[82] = "Haste spell.";
  265. sound_map_[83] = "Silence";
  266. sound_description_[83] = "Silence spell.";
  267. sound_map_[84] = "Break";
  268. sound_description_[84] = "Break spell.";
  269. sound_map_[85] = "Bolt3";
  270. sound_description_[85] = "Bolt3 spell. All?";
  271. sound_map_[86] = "Stop";
  272. sound_description_[86] = "Stop spell.";
  273. sound_map_[87] = "Quake3";
  274. sound_description_[87] = "Quake3 spell.";
  275. sound_map_[88] = "";
  276. sound_description_[88] = "";
  277. sound_map_[89] = "Bio2|Bio3";
  278. sound_description_[89] = "Bio2 and Bio3 spells.";
  279. sound_map_[90] = "Regen";
  280. sound_description_[90] = "Regen spell.";
  281. sound_map_[91] = "PoisonNull";
  282. sound_description_[91] = "PoisonNull spell.";
  283. sound_map_[92] = "";
  284. sound_description_[92] = "";
  285. sound_map_[93] = "Protect";
  286. sound_description_[93] = "Protect spell.";
  287. sound_map_[94] = "Wind";
  288. sound_description_[94] = "Wind sound as background for some maps.";
  289. sound_map_[95] = "";
  290. sound_description_[95] = "";
  291. sound_map_[96] = "Aparition";
  292. sound_description_[96] = "Aparition of someone in fields?";
  293. sound_map_[97] = "SearchScope";
  294. sound_description_[97] = "Guard Scorpion Search Scope attack.";
  295. sound_map_[98] = "100Needles";
  296. sound_description_[98] = "100 Needles enemy skill.";
  297. sound_map_[99] = "Seed";
  298. sound_description_[99] = "Enemy seed-type attack.";
  299. sound_map_[100] = "BeamGun";
  300. sound_description_[100] = "Enemy beam-gun-type attack.";
  301. sound_map_[101] = "";
  302. sound_description_[101] = "";
  303. sound_map_[102] = "";
  304. sound_description_[102] = "";
  305. sound_map_[103] = "";
  306. sound_description_[103] = "Rage";
  307. sound_map_[104] = "Enemy rage-type attack.";
  308. sound_description_[104] = "";
  309. sound_map_[105] = "";
  310. sound_description_[105] = "";
  311. sound_map_[106] = "RedLight|EnemyFlash";
  312. sound_description_[106] = "Jenovas Red Light attack, enemy Flash attack.";
  313. sound_map_[107] = "TetraLaser";
  314. sound_description_[107] = "Enemy TetraLaser (and similar) attacks.";
  315. sound_map_[108] = "RedXIIIHit";
  316. sound_description_[108] = "RedXIII attack hit.";
  317. sound_map_[109] = "";
  318. sound_description_[109] = "Unknown ambient sound.";
  319. sound_map_[110] = "";
  320. sound_description_[110] = "Unknown ambient sound.";
  321. sound_map_[111] = "";
  322. sound_description_[111] = "Unknown ambient sound.";
  323. sound_map_[112] = "";
  324. sound_description_[112] = "Unknown ambient sound.";
  325. sound_map_[113] = "";
  326. sound_description_[113] = "Unknown ambient sound.";
  327. sound_map_[114] = "";
  328. sound_description_[114] = "Unknown ambient sound.";
  329. sound_map_[115] = "";
  330. sound_description_[115] = "Unknown ambient sound.";
  331. sound_map_[116] = "";
  332. sound_description_[116] = "Unknown ambient sound.";
  333. sound_map_[117] = "Slap";
  334. sound_description_[117] = "Slapping sound. Tifa vs Scarlet?";
  335. sound_map_[118] = "Flush";
  336. sound_description_[118] = "Enemy flush-type attack.";
  337. sound_map_[119] = "DiamondFlash";
  338. sound_description_[119] = "Enemy DiamondFlash attack. Diamond Weapon?";
  339. sound_map_[120] = "";
  340. sound_description_[120] = "";
  341. sound_map_[121] = "DoorOpen";
  342. sound_description_[121] = "Door opening";
  343. sound_map_[122] = "VincentHit";
  344. sound_description_[122] = "Vincent gun hit.";
  345. sound_map_[123] = "";
  346. sound_description_[123] = "";
  347. sound_map_[124] = "Fascination";
  348. sound_description_[124] = "Enemy Fascination attack.";
  349. sound_map_[125] = "Drain|VampireTooth";
  350. sound_description_[125] = "Drain spell, probably Vampire Tooth?";
  351. sound_map_[126] = "DeBarrier";
  352. sound_description_[126] = "DeBarrier spell.";
  353. sound_map_[127] = "Resist";
  354. sound_description_[127] = "Resist spell.";
  355. sound_map_[128] = "WhiteWind";
  356. sound_description_[128] = "White Wind enemy skill.";
  357. sound_map_[129] = "MatraMagic";
  358. sound_description_[129] = "Matra magic enemy skill.";
  359. sound_map_[130] = "FlyingSickle";
  360. sound_description_[130] = "Enemy Flying Sickle (and similar) attacks.";
  361. sound_map_[131] = "Drums";
  362. sound_description_[131] = "Sound of drums, when chocobo race prices are about to be revealed.";
  363. sound_map_[132] = "Fall";
  364. sound_description_[132] = "Falling sound.";
  365. sound_map_[133] = "Despell";
  366. sound_description_[133] = "Despell spell.";
  367. sound_map_[134] = "Faint";
  368. sound_description_[134] = "Fainting sound.";
  369. sound_map_[135] = "NibelBurning";
  370. sound_description_[135] = "Nibelheim burning sound.";
  371. sound_map_[136] = "";
  372. sound_description_[136] = "";
  373. sound_map_[137] = "InkAttack";
  374. sound_description_[137] = "Enemy Ink (and similar) attacks.";
  375. sound_map_[138] = "Esuna";
  376. sound_description_[138] = "Esuna spell.";
  377. sound_map_[139] = "Beta";
  378. sound_description_[139] = "Beta enemy skill.";
  379. sound_map_[140] = "";
  380. sound_description_[140] = "";
  381. sound_map_[141] = "Fire3";
  382. sound_description_[141] = "Fire3 spell.";
  383. sound_map_[142] = "JunonAlarm";
  384. sound_description_[142] = "Junon alarm.";
  385. sound_map_[143] = "Electricity.";
  386. sound_description_[143] = "Electricity effect, for example, in Sector 8 after bombing.";
  387. sound_map_[144] = "BarrelLand";
  388. sound_description_[144] = "Barrel landing effect in Sector 5 church.";
  389. sound_map_[145] = "BarrelRoll";
  390. sound_description_[145] = "Barrel rolling effect in Sector 5 church.";
  391. sound_map_[146] = "";
  392. sound_description_[146] = "";
  393. sound_map_[147] = "Comet2";
  394. sound_description_[147] = "Comet2 spell.";
  395. sound_map_[148] = "Ailment";
  396. sound_description_[148] = "Status ailment inflicted.";
  397. sound_map_[149] = "Sensor";
  398. sound_description_[149]
  399. = "Sensors or lasers on some fields, like the red ones blocking the party on the plate.";
  400. sound_map_[150] = "TV";
  401. sound_description_[150] = "Television transmitting.";
  402. sound_map_[151] = "AribusterExplode";
  403. sound_description_[151] = "Airbuster explosion on the field?";
  404. sound_map_[152] = "CorneoSurprise";
  405. sound_description_[152] = "Don Corneo surprised?";
  406. sound_map_[153] = "Train";
  407. sound_description_[153] = "Train running.";
  408. sound_map_[154] = "FrogSong";
  409. sound_description_[154] = "Frog Song enemy skill.";
  410. sound_map_[155] = "MagicBreath";
  411. sound_description_[155] = "MagicBreath enemy skill.";
  412. sound_map_[156] = "AquaLung";
  413. sound_description_[156] = "AquaLung enemy skill, and some similar enemy attacks.";
  414. sound_map_[157] = "GoblinPunch";
  415. sound_description_[157] = "Goblin Punch enemy skill.";
  416. sound_map_[158] = "PresidentSteps";
  417. sound_description_[158] = "President ShinRa footsteps on Reactor 5.";
  418. sound_map_[159] = "Trine";
  419. sound_description_[159] = "Trine enemy skill.";
  420. sound_map_[160] = "PresidentFinger";
  421. sound_description_[160] = "President ShinRa fingersnap.";
  422. sound_map_[161] = "BadBreath1";
  423. sound_description_[161] = "First part of Bad Breath enemy skill.";
  424. sound_map_[162] = "BadBreath2";
  425. sound_description_[162] = "Second part of Bad Breath enemy skill.";
  426. sound_map_[163] = "MagicHammer";
  427. sound_description_[163] = "MagicHammer enemy skill.";
  428. sound_map_[164] = "Elevator2";
  429. sound_description_[164] = "Other type of elevator: flipper, prison.";
  430. sound_map_[165] = "";
  431. sound_description_[165] = "";
  432. sound_map_[166] = "";
  433. sound_description_[166] = "";
  434. sound_map_[167] = "RunLoud";
  435. sound_description_[167] = "Loud footsteps running, like Barrets.";
  436. sound_map_[168] = "Fire3All";
  437. sound_description_[168] = "Fire3 spell, all targets.";
  438. sound_map_[169] = "DrainingTentacles";
  439. sound_description_[169] = "Enemy Draining Tentacles (and similar) attacks.";
  440. sound_map_[170] = "Coin";
  441. sound_description_[170] = "Coin sound. In fields, when somebody is paid, a coin inserted...";
  442. sound_map_[171] = "Impact";
  443. sound_description_[171] = "Some kind of impact?";
  444. sound_map_[172] = "";
  445. sound_description_[172] = "";
  446. sound_map_[173] = "Monitor";
  447. sound_description_[173] = "Some kind of monitor?";
  448. sound_map_[174] = "";
  449. sound_description_[174] = "";
  450. sound_map_[175] = "ColdBreath";
  451. sound_description_[175] = "Enemy Cold Breath attack.";
  452. sound_map_[176] = "Mini";
  453. sound_description_[176] = "Mini spell.";
  454. sound_map_[177] = "PoisonBreath";
  455. sound_description_[177] = "Enemy poison breath attack.";
  456. sound_map_[178] = "";
  457. sound_description_[178] = "";
  458. sound_map_[179] = "WardDoor";
  459. sound_description_[179] = "WardDoor?";
  460. sound_map_[180] = "ElevatorRing";
  461. sound_description_[180] = "Elevator button ring.";
  462. sound_map_[181] = "RedCaravan";
  463. sound_description_[181] = "Red caravan?";
  464. sound_map_[182] = "MansionDoor";
  465. sound_description_[182] = "Door in mansion?";
  466. sound_map_[183] = "TrainWhistle";
  467. sound_description_[183] = "Train whistle sound.";
  468. sound_map_[184] = "IceCubes";
  469. sound_description_[184] = "Ice cubes?";
  470. sound_map_[185] = "Refuse";
  471. sound_description_[185] = "Enemy Refuse attack.";
  472. sound_map_[186] = "Shake";
  473. sound_description_[186] = "Shake effect, like Tifa shaking a drink.";
  474. sound_map_[187] = "";
  475. sound_description_[187] = "";
  476. sound_map_[188] = "";
  477. sound_description_[188] = "";
  478. sound_map_[189] = "Curtain";
  479. sound_description_[189] = "Curtain slipping, as in the dress shop in Wall Market.";
  480. sound_map_[190] = "MateriaGlow";
  481. sound_description_[190] = "Materia glow effect.";
  482. sound_map_[191] = "Helicopter";
  483. sound_description_[191] = "Helicopters on fields";
  484. sound_map_[192] = "Unlock";
  485. sound_description_[192] = "Some king of unlock sound.";
  486. sound_map_[193] = "Birdies";
  487. sound_description_[193] = "Birdies of Mt. Corel, up close";
  488. sound_map_[194] = "Boulder";
  489. sound_description_[194] = "Boulder rolling.";
  490. sound_map_[195] = "";
  491. sound_description_[195] = "";
  492. sound_map_[196] = "Chirping";
  493. sound_description_[196] = "Birds chirping in Mt. Corel heard from the tracks.";
  494. sound_map_[197] = "Appear";
  495. sound_description_[197] = "Someone is appearing?";
  496. sound_map_[198] = "BreakOpen";
  497. sound_description_[198] = "Break open sound?";
  498. sound_map_[199] = "AirBuster";
  499. sound_description_[199] = "AirBuster humming sound?";
  500. sound_map_[200] = "";
  501. sound_description_[200] = "";
  502. sound_map_[201] = "";
  503. sound_description_[201] = "";
  504. sound_map_[202] = "Collapse";
  505. sound_description_[202] = "Collapsing, as in the Great glacier.";
  506. sound_map_[203] = "";
  507. sound_description_[203] = "";
  508. sound_map_[204] = "BiggsThrown";
  509. sound_description_[204] = "Biggs thrown away by Barret in the hideout.";
  510. sound_map_[205] = "";
  511. sound_description_[205] = "";
  512. sound_map_[206] = "SaveLaunched";
  513. sound_description_[206] = "Game loaded?";
  514. sound_map_[207] = "";
  515. sound_description_[207] = "";
  516. sound_map_[208] = "TrainIgnite";
  517. sound_description_[208] = "Train ignition sound.";
  518. sound_map_[209] = "";
  519. sound_description_[209] = "";
  520. sound_map_[210] = "";
  521. sound_description_[210] = "";
  522. sound_map_[211] = "";
  523. sound_description_[211] = "";
  524. sound_map_[212] = "";
  525. sound_description_[212] = "";
  526. sound_map_[213] = "";
  527. sound_description_[213] = "";
  528. sound_map_[214] = "";
  529. sound_description_[214] = "";
  530. sound_map_[215] = "JunonElevator";
  531. sound_description_[215] = "Elevator in Junon. Which one?";
  532. sound_map_[216] = "Leap";
  533. sound_description_[216] = "A leap?";
  534. sound_map_[217] = "Snoring";
  535. sound_description_[217] = "People snoring in fields.";
  536. sound_map_[218] = "TentacleHit";
  537. sound_description_[218] = "enemy tentacle hit, ie: The dogs with a tentacle.";
  538. sound_map_[219] = "";
  539. sound_description_[219] = "";
  540. sound_map_[220] = "";
  541. sound_description_[220] = "";
  542. sound_map_[221] = "";
  543. sound_description_[221] = "";
  544. sound_map_[222] = "PunchCritical";
  545. sound_description_[222] = "Enemy punch-type critical attack.";
  546. sound_map_[223] = "Claw";
  547. sound_description_[223] = "Enemy claw-type attack.";
  548. sound_map_[224] = "Horn";
  549. sound_description_[224] = "Enemy horn-type attack.";
  550. sound_map_[225] = "Sting";
  551. sound_description_[225] = "enemy sting-type attack.";
  552. sound_map_[226] = "";
  553. sound_description_[226] = "";
  554. sound_map_[227] = "";
  555. sound_description_[227] = "";
  556. sound_map_[228] = "";
  557. sound_description_[228] = "";
  558. sound_map_[229] = "";
  559. sound_description_[229] = "";
  560. sound_map_[230] = "";
  561. sound_description_[230] = "RapidMove";
  562. sound_map_[231] = "Like Cloud dodging Barret in 7th Heaven.";
  563. sound_description_[231] = "";
  564. sound_map_[232] = "WaterGun";
  565. sound_description_[232] = "Enemy water gun and similar attacks.";
  566. sound_map_[233] = "Crazy";
  567. sound_description_[233] = "When Cloud loses his mind.";
  568. sound_map_[234] = "";
  569. sound_description_[234] = "";
  570. sound_map_[235] = "";
  571. sound_description_[235] = "";
  572. sound_map_[236] = "";
  573. sound_description_[236] = "";
  574. sound_map_[237] = "";
  575. sound_description_[237] = "";
  576. sound_map_[238] = "";
  577. sound_description_[238] = "";
  578. sound_map_[239] = "Crowd";
  579. sound_description_[239] = "Crowd yelling, as in the Junon Parade.";
  580. sound_map_[240] = "";
  581. sound_description_[240] = "";
  582. sound_map_[241] = "UnderwaterElevator";
  583. sound_description_[241] = "Junon underwater reactor elevator.";
  584. sound_map_[242] = "HiTechDoor";
  585. sound_description_[242] = "Some hi-tech door. Hojos lab?";
  586. sound_map_[243] = "";
  587. sound_description_[243] = "Moogle";
  588. sound_map_[244] = "Moogle Kupo sound";
  589. sound_description_[244] = "Bark";
  590. sound_map_[245] = "Dog barking on the fields.";
  591. sound_description_[245] = "";
  592. sound_map_[246] = "";
  593. sound_description_[246] = "";
  594. sound_map_[247] = "BigBomber";
  595. sound_description_[247] = "Enemy Big Bomber and similar attacks.";
  596. sound_map_[248] = "DoorClose";
  597. sound_description_[248] = "Some door closing?";
  598. sound_map_[249] = "Shower";
  599. sound_description_[249] = "Shower sound on the fields.";
  600. sound_map_[250] = "Price";
  601. sound_description_[250] = "Winning a price, like in Gold Saucer.";
  602. sound_map_[251] = "";
  603. sound_description_[251] = "";
  604. sound_map_[252] = "";
  605. sound_description_[252] = "";
  606. sound_map_[253] = "Chest";
  607. sound_description_[253] = "Treasure chest opening";
  608. sound_map_[254] = "Clothes";
  609. sound_description_[254] = "Changing clothes.";
  610. sound_map_[255] = "";
  611. sound_description_[255] = "";
  612. sound_map_[256] = "";
  613. sound_description_[256] = "";
  614. sound_map_[257] = "";
  615. sound_description_[257] = "";
  616. sound_map_[258] = "";
  617. sound_description_[258] = "";
  618. sound_map_[259] = "";
  619. sound_description_[259] = "";
  620. sound_map_[260] = "MenuCure";
  621. sound_description_[260] = "Curing while on the menu, magic or items.";
  622. sound_map_[261] = "Buy";
  623. sound_description_[261] = "Buying something in shops.";
  624. sound_map_[262] = "PlanetCry";
  625. sound_description_[262] = "Cry of the planet.";
  626. sound_map_[263] = "LifeStreamExit";
  627. sound_description_[263] = "When Cloud exits the LifeStream?";
  628. sound_map_[264] = "Springs";
  629. sound_description_[264] = "Springs in battle? in the Great Glacier?";
  630. sound_map_[265] = "";
  631. sound_description_[265] = "";
  632. sound_map_[266] = "MachineReact";
  633. sound_description_[266] = "Some machine reacting.";
  634. sound_map_[267] = "";
  635. sound_description_[267] = "";
  636. sound_map_[268] = "";
  637. sound_description_[268] = "";
  638. sound_map_[269] = "LongGunning";
  639. sound_description_[269] = "When Barrett aims at the ruins of Sector 7. Identical to 304.";
  640. sound_map_[270] = "";
  641. sound_description_[270] = "";
  642. sound_map_[271] = "VincentCriticalHit";
  643. sound_description_[271] = "Vincent gun critical hit.";
  644. sound_map_[272] = "ChocoboSad";
  645. sound_description_[272] = "Chocobo battle sad sound.";
  646. sound_map_[273] = "chocoboHappy";
  647. sound_description_[273] = "Chocobo battle happy sound.";
  648. sound_map_[274] = "ChocoboAngry";
  649. sound_description_[274] = "Chocobo battle angry sound.";
  650. sound_map_[275] = "";
  651. sound_description_[275] = "";
  652. sound_map_[276] = "RubyFlameThrower";
  653. sound_description_[276] = "Ruby Weapon Flame Thrower attack.";
  654. sound_map_[277] = "";
  655. sound_description_[277] = "";
  656. sound_map_[278] = "BeamGun2";
  657. sound_description_[278] = "Part of an enemy beam gun attack?";
  658. sound_map_[279] = "";
  659. sound_description_[279] = "";
  660. sound_map_[280] = "JunonElevatorAlt";
  661. sound_description_[280] = "Another elevator at Junon?";
  662. sound_map_[281] = "";
  663. sound_description_[281] = "";
  664. sound_map_[282] = "";
  665. sound_description_[282] = "";
  666. sound_map_[283] = "";
  667. sound_description_[283] = "";
  668. sound_map_[284] = "";
  669. sound_description_[284] = "";
  670. sound_map_[285] = "";
  671. sound_description_[285] = "";
  672. sound_map_[286] = "";
  673. sound_description_[286] = "";
  674. sound_map_[287] = "";
  675. sound_description_[287] = "";
  676. sound_map_[288] = "SouthernCross";
  677. sound_description_[288] = "Enemy Southern Cross attack.";
  678. sound_map_[289] = "TifaHit";
  679. sound_description_[289] = "Tifa hit sound.";
  680. sound_map_[290] = "Somersault";
  681. sound_description_[290] = "Tifas Somersault limit";
  682. sound_map_[291] = "";
  683. sound_description_[291] = "";
  684. sound_map_[292] = "";
  685. sound_description_[292] = "";
  686. sound_map_[293] = "";
  687. sound_description_[293] = "";
  688. sound_map_[294] = "";
  689. sound_description_[294] = "";
  690. sound_map_[295] = "";
  691. sound_description_[295] = "";
  692. sound_map_[296] = "";
  693. sound_description_[296] = "";
  694. sound_map_[297] = "";
  695. sound_description_[297] = "";
  696. sound_map_[298] = "";
  697. sound_description_[298] = "";
  698. sound_map_[299] = "";
  699. sound_description_[299] = "";
  700. sound_map_[300] = "";
  701. sound_description_[300] = "";
  702. sound_map_[301] = "DragonForce";
  703. sound_description_[301] = "Dragon Force enemy skill.";
  704. sound_map_[302] = "";
  705. sound_description_[302] = "";
  706. sound_map_[303] = "Tsunami";
  707. sound_description_[303] = "Enemy Sewer Tsunami (and similar) attacks.";
  708. sound_map_[304] = "LongGunningAlt";
  709. sound_description_[304] = "When Barrett aims at the ruins of Sector 7. Identical to 269.";
  710. sound_map_[305] = "";
  711. sound_description_[305] = "";
  712. sound_map_[306] = "";
  713. sound_description_[306] = "";
  714. sound_map_[307] = "Ultima";
  715. sound_description_[307] = "Ultima spell.";
  716. sound_map_[308] = "";
  717. sound_description_[308] = "";
  718. sound_map_[309] = "";
  719. sound_description_[309] = "";
  720. sound_map_[310] = "";
  721. sound_description_[310] = "";
  722. sound_map_[311] = "";
  723. sound_description_[311] = "";
  724. sound_map_[312] = "";
  725. sound_description_[312] = "";
  726. sound_map_[313] = "";
  727. sound_description_[313] = "";
  728. sound_map_[314] = "";
  729. sound_description_[314] = "";
  730. sound_map_[315] = "";
  731. sound_description_[315] = "";
  732. sound_map_[316] = "";
  733. sound_description_[316] = "";
  734. sound_map_[317] = "";
  735. sound_description_[317] = "";
  736. sound_map_[318] = "";
  737. sound_description_[318] = "";
  738. sound_map_[319] = "";
  739. sound_description_[319] = "";
  740. sound_map_[320] = "";
  741. sound_description_[320] = "";
  742. sound_map_[321] = "";
  743. sound_description_[321] = "";
  744. sound_map_[322] = "";
  745. sound_description_[322] = "";
  746. sound_map_[323] = "";
  747. sound_description_[323] = "";
  748. sound_map_[324] = "";
  749. sound_description_[324] = "";
  750. sound_map_[325] = "";
  751. sound_description_[325] = "";
  752. sound_map_[326] = "";
  753. sound_description_[326] = "";
  754. sound_map_[327] = "";
  755. sound_description_[327] = "";
  756. sound_map_[328] = "";
  757. sound_description_[328] = "";
  758. sound_map_[329] = "";
  759. sound_description_[329] = "";
  760. sound_map_[330] = "";
  761. sound_description_[330] = "";
  762. sound_map_[331] = "";
  763. sound_description_[331] = "";
  764. sound_map_[332] = "";
  765. sound_description_[332] = "";
  766. sound_map_[333] = "";
  767. sound_description_[333] = "";
  768. sound_map_[334] = "";
  769. sound_description_[334] = "";
  770. sound_map_[335] = "";
  771. sound_description_[335] = "";
  772. sound_map_[336] = "";
  773. sound_description_[336] = "";
  774. sound_map_[337] = "";
  775. sound_description_[337] = "";
  776. sound_map_[338] = "";
  777. sound_description_[338] = "Masamune";
  778. sound_map_[339] = "Masamune sound?";
  779. sound_description_[339] = "";
  780. sound_map_[340] = "";
  781. sound_description_[340] = "";
  782. sound_map_[341] = "";
  783. sound_description_[341] = "";
  784. sound_map_[342] = "YuffieHit";
  785. sound_description_[342] = "Yuffie shuriken hit.";
  786. sound_map_[343] = "";
  787. sound_description_[343] = "";
  788. sound_map_[344] = "";
  789. sound_description_[344] = "";
  790. sound_map_[345] = "LenoHit";
  791. sound_description_[345] = "Leno rod hit.";
  792. sound_map_[346] = "";
  793. sound_description_[346] = "";
  794. sound_map_[347] = "TifaCriticalHit";
  795. sound_description_[347] = "Tifa critical hit.";
  796. sound_map_[348] = "";
  797. sound_description_[348] = "";
  798. sound_map_[349] = "";
  799. sound_description_[349] = "";
  800. sound_map_[350] = "";
  801. sound_description_[350] = "";
  802. sound_map_[351] = "";
  803. sound_description_[351] = "";
  804. sound_map_[352] = "";
  805. sound_description_[352] = "";
  806. sound_map_[353] = "";
  807. sound_description_[353] = "";
  808. sound_map_[354] = "";
  809. sound_description_[354] = "";
  810. sound_map_[355] = "";
  811. sound_description_[355] = "";
  812. sound_map_[356] = "SavePoint";
  813. sound_description_[356] = "Save point sound.";
  814. sound_map_[357] = "Obtain";
  815. sound_description_[357] = "Obtained something.";
  816. sound_map_[358] = "DeathForce";
  817. sound_description_[358] = "Death Force enemy skill.";
  818. sound_map_[359] = "";
  819. sound_description_[359] = "";
  820. sound_map_[360] = "";
  821. sound_description_[360] = "";
  822. sound_map_[361] = "";
  823. sound_description_[361] = "";
  824. sound_map_[362] = "";
  825. sound_description_[362] = "Shield";
  826. sound_map_[363] = "Shield spell.";
  827. sound_description_[363] = "";
  828. sound_map_[364] = "";
  829. sound_description_[364] = "";
  830. sound_map_[365] = "BigGuard";
  831. sound_description_[365] = "Big Guard enemy skill.";
  832. sound_map_[366] = "Heartbeat";
  833. sound_description_[366]
  834. = "ShinRa mansion heartbeat background effects. Heard in other places too.";
  835. sound_map_[367] = "";
  836. sound_description_[367] = "";
  837. sound_map_[368] = "BladeBeam";
  838. sound_description_[368] = "Clouds Blade Beam limit.";
  839. sound_map_[369] = "FlareFirst";
  840. sound_description_[369] = "First part of the Flare spell.";
  841. sound_map_[370] = "FlareSecond";
  842. sound_description_[370] = "Second part of the flare spell.";
  843. sound_map_[371] = "";
  844. sound_description_[371] = "";
  845. sound_map_[372] = "";
  846. sound_description_[372] = "";
  847. sound_map_[373] = "MasamuneField";
  848. sound_description_[373] = "The masamune used on fields.";
  849. sound_map_[374] = "DemonLaugh";
  850. sound_description_[374] = "Demon laugh heard on Gold Saucer.";
  851. sound_map_[375] = "";
  852. sound_description_[375] = "";
  853. sound_map_[376] = "InnkeeperScream";
  854. sound_description_[376] = "Gold Saucer innkeeper scream.";
  855. sound_map_[377] = "";
  856. sound_description_[377] = "";
  857. sound_map_[378] = "Ocean";
  858. sound_description_[378] = "Ocean sound?";
  859. sound_map_[379] = "PhoenixTail";
  860. sound_description_[379] = "Phoenix Tail used in battle.";
  861. sound_map_[380] = "";
  862. sound_description_[380] = "";
  863. sound_map_[381] = "LimitLearned";
  864. sound_description_[381] = "4th limit level learned.";
  865. sound_map_[382] = "";
  866. sound_description_[382] = "";
  867. sound_map_[383] = "";
  868. sound_description_[383] = "";
  869. sound_map_[384] = "";
  870. sound_description_[384] = "";
  871. sound_map_[385] = "";
  872. sound_description_[385] = "";
  873. sound_map_[386] = "";
  874. sound_description_[386] = "";
  875. sound_map_[387] = "";
  876. sound_description_[387] = "";
  877. sound_map_[388] = "";
  878. sound_description_[388] = "";
  879. sound_map_[389] = "AirBusterBreak";
  880. sound_description_[389] = "AirBuster malfunction sound.";
  881. sound_map_[390] = "";
  882. sound_description_[390] = "";
  883. sound_map_[391] = "";
  884. sound_description_[391] = "";
  885. sound_map_[392] = "";
  886. sound_description_[392] = "";
  887. sound_map_[393] = "";
  888. sound_description_[393] = "";
  889. sound_map_[394] = "";
  890. sound_description_[394] = "";
  891. sound_map_[395] = "";
  892. sound_description_[395] = "";
  893. sound_map_[396] = "";
  894. sound_description_[396] = "";
  895. sound_map_[397] = "";
  896. sound_description_[397] = "";
  897. sound_map_[398] = "";
  898. sound_description_[398] = "";
  899. sound_map_[399] = "";
  900. sound_description_[399] = "";
  901. sound_map_[400] = "Whistle";
  902. sound_description_[400] = "Heard when practicing for Junon parade.";
  903. sound_map_[401] = "";
  904. sound_description_[401] = "";
  905. sound_map_[402] = "Sonar";
  906. sound_description_[402] = "Submarine sonar.";
  907. sound_map_[403] = "";
  908. sound_description_[403] = "";
  909. sound_map_[404] = "";
  910. sound_description_[404] = "";
  911. sound_map_[405] = "";
  912. sound_description_[405] = "";
  913. sound_map_[406] = "";
  914. sound_description_[406] = "";
  915. sound_map_[407] = "";
  916. sound_description_[407] = "";
  917. sound_map_[408] = "";
  918. sound_description_[408] = "";
  919. sound_map_[409] = "";
  920. sound_description_[409] = "";
  921. sound_map_[410] = "";
  922. sound_description_[410] = "";
  923. sound_map_[411] = "";
  924. sound_description_[411] = "";
  925. sound_map_[412] = "";
  926. sound_description_[412] = "";
  927. sound_map_[413] = "";
  928. sound_description_[413] = "";
  929. sound_map_[414] = "";
  930. sound_description_[414] = "";
  931. sound_map_[415] = "";
  932. sound_description_[415] = "";
  933. sound_map_[416] = "";
  934. sound_description_[416] = "";
  935. sound_map_[417] = "";
  936. sound_description_[417] = "";
  937. sound_map_[418] = "";
  938. sound_description_[418] = "";
  939. sound_map_[419] = "";
  940. sound_description_[419] = "";
  941. sound_map_[420] = "Life2";
  942. sound_description_[420] = "Life2 spell.";
  943. sound_map_[421] = "";
  944. sound_description_[421] = "";
  945. sound_map_[422] = "";
  946. sound_description_[422] = "";
  947. sound_map_[423] = "";
  948. sound_description_[423] = "";
  949. sound_map_[424] = "";
  950. sound_description_[424] = "";
  951. sound_map_[425] = "";
  952. sound_description_[425] = "";
  953. sound_map_[426] = "";
  954. sound_description_[426] = "";
  955. sound_map_[427] = "";
  956. sound_description_[427] = "";
  957. sound_map_[428] = "";
  958. sound_description_[428] = "";
  959. sound_map_[429] = "";
  960. sound_description_[429] = "";
  961. sound_map_[430] = "";
  962. sound_description_[430] = "";
  963. sound_map_[431] = "";
  964. sound_description_[431] = "";
  965. sound_map_[432] = "";
  966. sound_description_[432] = "";
  967. sound_map_[433] = "";
  968. sound_description_[433] = "";
  969. sound_map_[434] = "";
  970. sound_description_[434] = "";
  971. sound_map_[435] = "";
  972. sound_description_[435] = "";
  973. sound_map_[436] = "";
  974. sound_description_[436] = "";
  975. sound_map_[437] = "";
  976. sound_description_[437] = "";
  977. sound_map_[438] = "Applauses";
  978. sound_description_[438] = "Applauses effect.";
  979. sound_map_[439] = "";
  980. sound_description_[439] = "";
  981. sound_map_[440] = "";
  982. sound_description_[440] = "";
  983. sound_map_[441] = "";
  984. sound_description_[441] = "";
  985. sound_map_[442] = "";
  986. sound_description_[442] = "";
  987. sound_map_[443] = "";
  988. sound_description_[443] = "";
  989. sound_map_[444] = "MenuEquip";
  990. sound_description_[444] = "Equipping something in menus.";
  991. sound_map_[445] = "BossDeath";
  992. sound_description_[445] = "A boss dying.";
  993. sound_map_[446] = "";
  994. sound_description_[446] = "";
  995. sound_map_[447] = "Announcement.";
  996. sound_description_[447] = "Anouncement sound, ie Gold Saucer PA calling jockeys.";
  997. sound_map_[448] = "PHS";
  998. sound_description_[448] = "PHS ringing.";
  999. sound_map_[449] = "Freeze";
  1000. sound_description_[449] = "Freeze spell.";
  1001. sound_map_[450] = "";
  1002. sound_description_[450] = "";
  1003. sound_map_[451] = "";
  1004. sound_description_[451] = "";
  1005. sound_map_[452] = "Meow";
  1006. sound_description_[452] = "Meow spell.";
  1007. sound_map_[453] = "";
  1008. sound_description_[453] = "";
  1009. sound_map_[454] = "";
  1010. sound_description_[454] = "";
  1011. sound_map_[455] = "SadDog";
  1012. sound_description_[455] = "Sad dog sound.";
  1013. sound_map_[456] = "";
  1014. sound_description_[456] = "";
  1015. sound_map_[457] = "";
  1016. sound_description_[457] = "";
  1017. sound_map_[458] = "";
  1018. sound_description_[458] = "";
  1019. sound_map_[459] = "";
  1020. sound_description_[459] = "";
  1021. sound_map_[460] = "";
  1022. sound_description_[460] = "";
  1023. sound_map_[461] = "";
  1024. sound_description_[461] = "";
  1025. sound_map_[462] = "";
  1026. sound_description_[462] = "";
  1027. sound_map_[463] = "";
  1028. sound_description_[463] = "";
  1029. sound_map_[464] = "Slots";
  1030. sound_description_[464] = "Slots rolling.";
  1031. sound_map_[465] = "Truck";
  1032. sound_description_[465] = "A truck like the one Cloud and Zack ride.";
  1033. sound_map_[466] = "";
  1034. sound_description_[466] = "";
  1035. sound_map_[467] = "";
  1036. sound_description_[467] = "";
  1037. sound_map_[468] = "";
  1038. sound_description_[468] = "";
  1039. sound_map_[469] = "";
  1040. sound_description_[469] = "";
  1041. sound_map_[470] = "";
  1042. sound_description_[470] = "";
  1043. sound_map_[471] = "";
  1044. sound_description_[471] = "";
  1045. sound_map_[472] = "";
  1046. sound_description_[472] = "";
  1047. sound_map_[473] = "";
  1048. sound_description_[473] = "";
  1049. sound_map_[474] = "";
  1050. sound_description_[474] = "";
  1051. sound_map_[475] = "";
  1052. sound_description_[475] = "";
  1053. sound_map_[476] = "";
  1054. sound_description_[476] = "";
  1055. sound_map_[477] = "";
  1056. sound_description_[477] = "";
  1057. sound_map_[478] = "";
  1058. sound_description_[478] = "";
  1059. sound_map_[479] = "";
  1060. sound_description_[479] = "";
  1061. sound_map_[480] = "";
  1062. sound_description_[480] = "";
  1063. sound_map_[481] = "";
  1064. sound_description_[481] = "";
  1065. sound_map_[482] = "";
  1066. sound_description_[482] = "";
  1067. sound_map_[483] = "";
  1068. sound_description_[483] = "";
  1069. sound_map_[484] = "";
  1070. sound_description_[484] = "";
  1071. sound_map_[485] = "Point";
  1072. sound_description_[485] = "Earning points/GP.";
  1073. sound_map_[486] = "";
  1074. sound_description_[486] = "";
  1075. sound_map_[487] = "";
  1076. sound_description_[487] = "";
  1077. sound_map_[488] = "";
  1078. sound_description_[488] = "";
  1079. sound_map_[489] = "";
  1080. sound_description_[489] = "";
  1081. sound_map_[490] = "";
  1082. sound_description_[490] = "";
  1083. sound_map_[491] = "";
  1084. sound_description_[491] = "";
  1085. sound_map_[492] = "";
  1086. sound_description_[492] = "";
  1087. sound_map_[493] = "";
  1088. sound_description_[493] = "";
  1089. sound_map_[494] = "";
  1090. sound_description_[494] = "";
  1091. sound_map_[495] = "";
  1092. sound_description_[495] = "";
  1093. sound_map_[496] = "";
  1094. sound_description_[496] = "";
  1095. sound_map_[497] = "";
  1096. sound_description_[497] = "";
  1097. sound_map_[498] = "";
  1098. sound_description_[498] = "";
  1099. sound_map_[499] = "";
  1100. sound_description_[499] = "";
  1101. sound_map_[506] = "Do";
  1102. sound_description_[506] = "Piano Do note.";
  1103. sound_map_[507] = "Re";
  1104. sound_description_[507] = "Piano Re note.";
  1105. sound_map_[508] = "Mi";
  1106. sound_description_[508] = "Piano Mi note.";
  1107. sound_map_[509] = "Fa";
  1108. sound_description_[509] = "Piano Fa note.";
  1109. sound_map_[510] = "Sol";
  1110. sound_description_[510] = "Piano Sol note.";
  1111. sound_map_[511] = "La";
  1112. sound_description_[511] = "Piano La note.";
  1113. sound_map_[512] = "Si";
  1114. sound_description_[512] = "Piano Si note.";
  1115. sound_map_[513] = "DoP";
  1116. sound_description_[513] = "Piano Do up note.";
  1117. sound_map_[514] = "SolP";
  1118. sound_description_[514] = "Piano Sol up note.";
  1119. sound_map_[515] = "LaP";
  1120. sound_description_[515] = "Piano La up note.";
  1121. sound_map_[516] = "SiP";
  1122. sound_description_[516] = "Piano Si up note.";
  1123. // TODO: Fill this list with somewhat descriptive names.
  1124. }
  1125. MediaDataInstaller::~MediaDataInstaller(){}
  1126. void MediaDataInstaller::InstallSprites(){
  1127. // Actually open the lgp as a file for reading
  1128. File menu(input_dir_ + "data/menu/menu_us.lgp");
  1129. // Also, open it as a LGP archive.
  1130. menu_.open(input_dir_ + "data/menu/menu_us.lgp", true);
  1131. menu_.load();
  1132. Ogre::StringVectorPtr file_list = menu_.list(true, true);
  1133. //std::cout << " " << file_list << " files \n";
  1134. VGears::LGPArchive::FileList files = menu_.GetFiles();
  1135. for (int i = 0; i < file_list->size(); i ++){
  1136. VGears::LGPArchive::FileEntry f = files.at(i);
  1137. if (
  1138. f.file_name != "barre.tex"
  1139. && f.file_name != "bins.tex"
  1140. && f.file_name != "cido.tex"
  1141. && f.file_name != "cloud.tex"
  1142. && f.file_name != "earith.tex"
  1143. && f.file_name != "ketc.tex"
  1144. && f.file_name != "pcefi.tex"
  1145. && f.file_name != "pcloud.tex"
  1146. && f.file_name != "red.tex"
  1147. && f.file_name != "tifa.tex"
  1148. && f.file_name != "yufi.tex"
  1149. && f.file_name != "buster.tex"
  1150. && f.file_name != "choco.tex"
  1151. && f.file_name != "btl_win_c_l.tex"
  1152. && f.file_name != "btl_win_a_h.tex"
  1153. && f.file_name != "btl_win_b_h.tex"
  1154. && f.file_name != "btl_win_b_l.tex"
  1155. ){
  1156. continue;
  1157. }
  1158. // Save the TEX File
  1159. std::fstream out;
  1160. out.open(output_dir_ + "images/" + f.file_name, std::ios::out);
  1161. menu.SetOffset(f.data_offset);
  1162. for (int j = 0; j < f.data_size; j ++) out << menu.readU8();
  1163. out.close();
  1164. // Open the TEX file and save PNGs.
  1165. std::string img_dir = output_dir_ + "images/";
  1166. TexFile tex(output_dir_ + "images/" + f.file_name);
  1167. if (f.file_name == "barre.tex")
  1168. tex.SavePng(img_dir + "characters/1.png", 0, 0, 83, 95, 0);
  1169. else if (f.file_name == "bins.tex")
  1170. tex.SavePng(img_dir + "characters/7.png", 0, 0, 83, 95, 0);
  1171. else if (f.file_name == "cido.tex")
  1172. tex.SavePng(img_dir + "characters/8.png", 0, 0, 83, 95, 0);
  1173. else if (f.file_name == "cloud.tex")
  1174. tex.SavePng(img_dir + "characters/0.png", 0, 0, 83, 95, 0);
  1175. else if (f.file_name == "earith.tex")
  1176. tex.SavePng(img_dir + "characters/3.png", 0, 0, 83, 95, 0);
  1177. else if (f.file_name == "ketc.tex")
  1178. tex.SavePng(img_dir + "characters/6.png", 0, 0, 83, 95, 0);
  1179. else if (f.file_name == "pcefi.tex")
  1180. tex.SavePng(img_dir + "characters/10.png", 0, 0, 83, 95, 0);
  1181. else if (f.file_name == "pcloud.tex")
  1182. tex.SavePng(img_dir + "characters/9.png", 0, 0, 83, 95, 0);
  1183. else if (f.file_name == "red.tex")
  1184. tex.SavePng(img_dir + "characters/4.png", 0, 0, 83, 95, 0);
  1185. else if (f.file_name == "tifa.tex")
  1186. tex.SavePng(img_dir + "characters/2.png", 0, 0, 83, 95, 0);
  1187. else if (f.file_name == "yufi.tex")
  1188. tex.SavePng(img_dir + "characters/5.png", 0, 0, 83, 95, 0);
  1189. else if (f.file_name == "buster.tex")
  1190. tex.SavePng(img_dir + "other/begin_menu.png", 0, 0, 150, 150, 0);
  1191. else if (f.file_name == "choco.tex")
  1192. tex.SavePng(img_dir + "other/choco.png", 0, 0, 83, 95, 0);
  1193. else if (f.file_name == "btl_win_c_l.tex"){
  1194. // Weapon (no index 0), armor, accessory icons, palette 1.
  1195. tex.SavePng(img_dir + "icons/item_weapon_1.png", 192, 0, 32, 32, 1);
  1196. tex.SavePng(img_dir + "icons/item_weapon_2.png", 224, 0, 32, 32, 1);
  1197. tex.SavePng(img_dir + "icons/item_weapon_3.png", 192, 32, 32, 32, 1);
  1198. tex.SavePng(img_dir + "icons/item_weapon_4.png", 224, 32, 32, 32, 1);
  1199. tex.SavePng(img_dir + "icons/item_weapon_5.png", 192, 64, 32, 32, 1);
  1200. tex.SavePng(img_dir + "icons/item_weapon_6.png", 224, 64, 32, 32, 1);
  1201. tex.SavePng(img_dir + "icons/item_weapon_7.png", 192, 96, 32, 32, 1);
  1202. tex.SavePng(img_dir + "icons/item_weapon_8.png", 224, 96, 32, 32, 1);
  1203. tex.SavePng(img_dir + "icons/item_armor.png", 192, 128, 32, 32, 1);
  1204. tex.SavePng(img_dir + "icons/item_accessory.png", 224, 128, 32, 32, 1);
  1205. // Status effects battle animations, palette 1.
  1206. tex.SavePng(img_dir + "icons/status_2_0.png", 128, 188, 32, 32, 1);
  1207. tex.SavePng(img_dir + "icons/status_2_1.png", 160, 188, 32, 32, 1);
  1208. tex.SavePng(img_dir + "icons/status_2_2.png", 192, 188, 32, 32, 1);
  1209. tex.SavePng(img_dir + "icons/status_2_3.png", 224, 188, 32, 32, 1);
  1210. tex.SavePng(img_dir + "icons/status_7_0.png", 128, 219, 32, 32, 1);
  1211. tex.SavePng(img_dir + "icons/status_7_1.png", 160, 219, 32, 32, 1);
  1212. tex.SavePng(img_dir + "icons/status_7_2.png", 192, 219, 32, 32, 1);
  1213. tex.SavePng(img_dir + "icons/status_7_3.png", 224, 219, 32, 32, 1);
  1214. // Door arrows, palette 9.
  1215. tex.SavePng(img_dir + "icons/pointer_gateway_0.png", 96, 160, 18, 12, 9);
  1216. tex.SavePng(img_dir + "icons/pointer_gateway_1.png", 128, 160, 18, 12, 9);
  1217. tex.SavePng(img_dir + "icons/pointer_gateway_1.png", 160, 160, 18, 12, 9);
  1218. tex.SavePng(img_dir + "icons/pointer_gateway_3.png", 192, 160, 18, 12, 9);
  1219. tex.SavePng(img_dir + "icons/pointer_gateway_4.png", 224, 160, 18, 12, 9);
  1220. // Ladder arrows, palette 4.
  1221. tex.SavePng(img_dir + "icons/pointer_ladder_0.png", 96, 160, 18, 12, 4);
  1222. tex.SavePng(img_dir + "icons/pointer_ladder_1.png", 128, 160, 18, 12, 4);
  1223. tex.SavePng(img_dir + "icons/pointer_ladder_1.png", 160, 160, 18, 12, 4);
  1224. tex.SavePng(img_dir + "icons/pointer_ladder_3.png", 192, 160, 18, 12, 4);
  1225. tex.SavePng(img_dir + "icons/pointer_ladder_4.png", 224, 160, 18, 12, 4);
  1226. // Recovery word, palette 4.
  1227. tex.SavePng(img_dir + "icons/battle_recovery.png", 64, 64, 212, 232, 64, 36, 20, 4);
  1228. // Death word, palette 2.
  1229. tex.SavePng(img_dir + "icons/battle_death.png", 64, 192, 64, 20, 2);
  1230. // Window borders and corners, palette 0
  1231. tex.SavePng(img_dir + "window/b_t.png", 0, 192, 32, 16, 0);
  1232. tex.SavePng(img_dir + "window/b_b.png", 32, 208, 32, 16, 0);
  1233. tex.SavePng(img_dir + "window/b_l.png", 0, 224, 16, 32, 0);
  1234. tex.SavePng(img_dir + "window/b_r.png", 48, 224, 16, 32, 0);
  1235. tex.SavePng(img_dir + "window/c_tl.png", 0, 208, 16, 16, 0);
  1236. tex.SavePng(img_dir + "window/c_tr.png", 16, 208, 16, 16, 0);
  1237. tex.SavePng(img_dir + "window/c_bl.png", 32, 192, 16, 16, 0);
  1238. tex.SavePng(img_dir + "window/c_br.png", 48, 192, 16, 16, 0);
  1239. }
  1240. else if (f.file_name == "btl_win_a_h.tex"){
  1241. // Items and weapon 0, palette 1.
  1242. tex.SavePng(img_dir + "icons/item_item.png", 192, 223, 32, 32, 1);
  1243. tex.SavePng(img_dir + "icons/item_weapon_0.png", 220, 223, 32, 32, 1);
  1244. // Battle bar and texts, palette 1.
  1245. tex.SavePng(img_dir + "icons/battle_bar.png", 32, 0, 76, 18, 1);
  1246. tex.SavePng(img_dir + "icons/battle_limit.png", 112, 0, 48, 10, 1);
  1247. tex.SavePng(img_dir + "icons/battle_hp.png", 160, 0, 28, 10, 1);
  1248. tex.SavePng(img_dir + "icons/battle_mp.png", 192, 0, 30, 10, 1);
  1249. tex.SavePng(img_dir + "icons/battle_time.png", 224, 162, 0, 16, 32, 14, 10, 1);
  1250. tex.SavePng(img_dir + "icons/battle_barrier.png", 112, 16, 76, 10, 1);
  1251. tex.SavePng(img_dir + "icons/battle_wait.png", 192, 16, 44, 10, 1);
  1252. tex.SavePng(img_dir + "icons/battle_1.png", 130, 34, 10, 12, 1);
  1253. tex.SavePng(img_dir + "icons/battle_2.png", 146, 34, 10, 12, 1);
  1254. tex.SavePng(img_dir + "icons/battle_3.png", 162, 34, 10, 12, 1);
  1255. tex.SavePng(img_dir + "icons/battle_4.png", 178, 34, 10, 12, 1);
  1256. tex.SavePng(img_dir + "icons/battle_5.png", 194, 34, 10, 12, 1);
  1257. tex.SavePng(img_dir + "icons/battle_mp_needed.png", 0, 40, 80, 24, 1);
  1258. // Some other battle text, palette 7.
  1259. tex.SavePng(img_dir + "icons/battle_all.png", 240, 32, 16, 16, 7);
  1260. tex.SavePng(img_dir + "icons/battle_x.png", 240, 16, 16, 16, 7);
  1261. // No growth materia slot and linker, palette 1.
  1262. tex.SavePng(img_dir + "icons/materia_slot_no_growth.png", 224, 63, 24, 24, 1);
  1263. tex.SavePng(img_dir + "icons/materia_slot_link.png", 227, 95, 14, 24, 1);
  1264. // Buttons, palette 7.
  1265. tex.SavePng(img_dir + "icons/bt_up.png", 160, 70, 26, 20, 7);
  1266. tex.SavePng(img_dir + "icons/bt_down.png", 192, 70, 26, 20, 7);
  1267. tex.SavePng(img_dir + "icons/bt_right.png", 160, 102, 26, 20, 7);
  1268. tex.SavePng(img_dir + "icons/bt_left.png", 192, 102, 26, 20, 7);
  1269. tex.SavePng(img_dir + "icons/bt_3.png", 192, 134, 26, 20, 7);
  1270. tex.SavePng(img_dir + "icons/bt_2.png", 224, 134, 26, 20, 7);
  1271. tex.SavePng(img_dir + "icons/bt_6.png", 192, 166, 26, 20, 7);
  1272. tex.SavePng(img_dir + "icons/bt_8.png", 224, 166, 26, 20, 7);
  1273. tex.SavePng(img_dir + "icons/bt_9.png", 192, 198, 26, 20, 7);
  1274. tex.SavePng(img_dir + "icons/bt_10.png", 224, 198, 26, 20, 7);
  1275. // Crossed out cursor, palette 7.
  1276. tex.SavePng(img_dir + "icons/cursor_crossed.png", 80, 32, 48, 32, 7);
  1277. // Sound settings, palette 1.
  1278. tex.SavePng(img_dir + "icons/settings_music.png", 101, 131, 30, 30, 1);
  1279. tex.SavePng(img_dir + "icons/settings_fx.png", 133, 131, 30, 30, 1);
  1280. }
  1281. else if (f.file_name == "btl_win_b_h.tex"){
  1282. // Don't take cursors fom here, they don't have shadows and are too narrow.
  1283. // Take them from btl_win_b_l.tex
  1284. // Menu and battle text, palette 1.
  1285. tex.SavePng(img_dir + "icons/slash.png", 176, 0, 8, 16, 1);
  1286. tex.SavePng(img_dir + "icons/battle_name.png", 0, 32, 52, 10, 1);
  1287. tex.SavePng(img_dir + "icons/battle_status.png", 0, 48, 64, 10, 1);
  1288. tex.SavePng(img_dir + "icons/battle_status.png", 144, 48, 52, 10, 1);
  1289. // Up/Down pointers, palette 1.
  1290. tex.SavePng(img_dir + "icons/pointer_up.png", 198, 0, 22, 16, 1);
  1291. tex.SavePng(img_dir + "icons/pointer_down.png", 230, 0, 22, 16, 1);
  1292. // Materia slot, palette 1.
  1293. tex.SavePng(img_dir + "icons/materia_slot.png", 0, 95, 24, 24, 1);
  1294. // Materia stuff, several plettes.
  1295. tex.SavePng(img_dir + "icons/materia_1.png", 3, 67, 18, 18, 4);
  1296. tex.SavePng(img_dir + "icons/materia_2.png", 3, 67, 18, 18, 5);
  1297. tex.SavePng(img_dir + "icons/materia_3.png", 3, 67, 18, 18, 8);
  1298. tex.SavePng(img_dir + "icons/materia_4.png", 3, 67, 18, 18, 9);
  1299. tex.SavePng(img_dir + "icons/materia_5.png", 3, 67, 18, 18, 10);
  1300. tex.SavePng(img_dir + "icons/materia_star_1.png", 32, 64, 23, 26, 4);
  1301. tex.SavePng(img_dir + "icons/materia_star_2.png", 32, 64, 23, 26, 5);
  1302. tex.SavePng(img_dir + "icons/materia_star_3.png", 32, 64, 23, 26, 8);
  1303. tex.SavePng(img_dir + "icons/materia_star_4.png", 32, 64, 23, 26, 9);
  1304. tex.SavePng(img_dir + "icons/materia_star_5.png", 32, 64, 23, 26, 10);
  1305. tex.SavePng(img_dir + "icons/materia_star_empty_1.png", 32, 96, 23, 26, 4);
  1306. tex.SavePng(img_dir + "icons/materia_star_empty_2.png", 32, 96, 23, 26, 5);
  1307. tex.SavePng(img_dir + "icons/materia_star_empty_3.png", 32, 96, 23, 26, 8);
  1308. tex.SavePng(img_dir + "icons/materia_star_empty_4.png", 32, 96, 23, 26, 9);
  1309. tex.SavePng(img_dir + "icons/materia_star_empty_5.png", 32, 96, 23, 26, 10);
  1310. // Buttons, palette 7.
  1311. tex.SavePng(img_dir + "icons/bt_1.png", 0, 134, 26, 20, 7);
  1312. tex.SavePng(img_dir + "icons/bt_4.png", 32, 134, 26, 20, 7);
  1313. tex.SavePng(img_dir + "icons/bt_5.png", 0, 166, 26, 20, 7);
  1314. tex.SavePng(img_dir + "icons/bt_7.png", 32, 16, 26, 20, 7);
  1315. // Some other battle text, palette 7.
  1316. tex.SavePng(img_dir + "icons/battle_inf.png", 36, 194, 26, 14, 7);
  1317. // Right pointer, palette 7.
  1318. tex.SavePng(img_dir + "icons/pointer_right.png", 4, 16, 10, 16, 7);
  1319. // Battle and menu bars, palette 1.
  1320. tex.SavePng(img_dir + "icons/battle_bar_barriers.png", 64, 32, 76, 24, 1);
  1321. tex.SavePng(img_dir + "icons/menu_bar.png", 16, 16, 126, 16, 1);
  1322. // Fonts, save all palettes, make one default.
  1323. for (int p = 0; p < 16; p ++){
  1324. // Digits font. Default palette 7.
  1325. tex.SavePng(
  1326. img_dir + "fonts/digits_" + std::to_string(p) + ".png", 16, 0, 156, 16, p
  1327. );
  1328. if (p == 7) tex.SavePng(img_dir + "fonts/digits.png", 16, 0, 156, 16, p);
  1329. }
  1330. for (int p = 0; p < 16; p ++){
  1331. // Time font. Default palette 12.
  1332. tex.SavePng(
  1333. img_dir + "fonts/timer_" + std::to_string(p) + ".png", 32, 160, 224, 90, p
  1334. );
  1335. if (p == 12) tex.SavePng(img_dir + "fonts/timer.png", 32, 160, 224, 90, p);
  1336. }
  1337. // Reels, palete 11.
  1338. tex.SavePng(img_dir + "reels/yeah.png", 64, 64, 64, 30, 11);
  1339. tex.SavePng(img_dir + "reels/luck.png", 64, 98, 64, 30, 11);
  1340. tex.SavePng(img_dir + "reels/hit.png", 128, 64, 64, 30, 11);
  1341. tex.SavePng(img_dir + "reels/bar.png", 128, 97, 64, 30, 11);
  1342. tex.SavePng(img_dir + "reels/miss.png", 192, 64, 64, 30, 11);
  1343. tex.SavePng(img_dir + "reels/choso.png", 192, 98, 64, 30, 11);
  1344. }
  1345. else if (f.file_name == "btl_win_b_l.tex"){
  1346. // Cursors, palette 1.
  1347. tex.SavePng(img_dir + "icons/cursor.png", 192, 16, 48, 32, 1);
  1348. tex.SavePng(img_dir + "icons/cursor_left.png", 144, 16, 48, 32, 1);
  1349. tex.SavePng(img_dir + "icons/pointer_position.png", 0, 192, 32, 26, 1);
  1350. }
  1351. // TODO: Extract arena reels from coloa.tex, colob.tex and coloc.tex
  1352. // Delete Tex file.
  1353. if (!keep_originals_) std::remove((output_dir_ + "images/" + f.file_name).c_str());
  1354. }
  1355. }
  1356. int MediaDataInstaller::InstallSoundsInit(){
  1357. // SFXDump handles the wav conversion
  1358. std::string command = (boost::format(
  1359. "%1%/sfxdump %2%data/sound/audio.fmt %2%data/sound/audio.dat %3%audio/sounds/"
  1360. ) % GetExecutablePath() % input_dir_ % output_dir_).str();
  1361. std::system(command.c_str());
  1362. processed_sounds_ = 0;
  1363. return TOTAL_SOUNDS;
  1364. }
  1365. bool MediaDataInstaller::InstallSounds(){
  1366. if (!no_ffmpeg_){
  1367. std::string f_path
  1368. = output_dir_ + "audio/sounds/" + std::to_string(processed_sounds_) + ".wav";
  1369. std::ifstream file(f_path);
  1370. if (file.is_open()){
  1371. file.close();
  1372. std::string command = (boost::format(
  1373. "ffmpeg -hide_banner -loglevel panic -y "
  1374. "-i %1%audio/sounds/%2%.wav %1%audio/sounds/%2%.ogg"
  1375. ) % output_dir_ % processed_sounds_).str();
  1376. std::system(command.c_str());
  1377. //std::cout << " ADD SOUND " << processed_sounds_ << ".ogg" << std::endl;
  1378. sounds_.push_back("audio/sounds/" + std::to_string(processed_sounds_) + ".ogg");
  1379. // Remove the wav file.
  1380. if (!keep_originals_)
  1381. std::remove((
  1382. output_dir_ + "audio/sounds/" + std::to_string(processed_sounds_) + ".wav"
  1383. ).c_str());
  1384. }
  1385. else{
  1386. sounds_.push_back("audio/sounds/INVALID.ogg");
  1387. //std::cout << " -- ADD SOUND INVALID.ogg" << std::endl;
  1388. }
  1389. }
  1390. processed_sounds_ ++;
  1391. if (processed_sounds_ >= TOTAL_SOUNDS) return true;
  1392. else return false;
  1393. }
  1394. void MediaDataInstaller::WriteSoundIndex(){
  1395. TiXmlDocument xml;
  1396. std::unique_ptr<TiXmlElement> container(new TiXmlElement("sounds"));
  1397. //for (string item : items_){
  1398. for (int id = 0; id < sounds_.size(); id ++){
  1399. std::string path = sounds_[id];
  1400. std::unique_ptr<TiXmlElement> xml_sound(new TiXmlElement("sound"));
  1401. xml_sound->SetAttribute("file_name", path);
  1402. xml_sound->SetAttribute("name", id);
  1403. container->LinkEndChild(xml_sound.release());
  1404. // If there is a friendly name for this sound, add another entry
  1405. if (sound_map_.count(id) != 0 && sound_map_[id] != ""){
  1406. std::unique_ptr<TiXmlElement> xml_sound_name(new TiXmlElement("sound"));
  1407. xml_sound_name->SetAttribute("file_name", path);
  1408. std::string name = sound_map_[id];
  1409. xml_sound_name->SetAttribute("name", name);
  1410. xml_sound_name->SetAttribute("description", sound_description_[id]);
  1411. container->LinkEndChild(xml_sound_name.release());
  1412. }
  1413. }
  1414. xml.LinkEndChild(container.release());
  1415. xml.SaveFile(output_dir_ + "audio/sounds/_sounds.xml");
  1416. }
  1417. int MediaDataInstaller::InstallMusicsInit(){
  1418. // Read the music index file.
  1419. std::ifstream music_idx(input_dir_ + "data/music/music.idx");
  1420. int i = 0;
  1421. std::string name;
  1422. if (music_idx.is_open()){
  1423. while (std::getline(music_idx, name)){
  1424. // Newlines are very likely WINDOWS/DOS format, but check them all.
  1425. boost::replace_all(name, "\r\n", "");
  1426. boost::replace_all(name, "\n", "");
  1427. boost::replace_all(name, "\r", "");
  1428. musics_map_[i] = name;
  1429. i ++;
  1430. }
  1431. music_idx.close();
  1432. }
  1433. // Load midi_
  1434. midi_.load();
  1435. processed_musics_ = 0;
  1436. return midi_.list(true, true)->size();
  1437. }
  1438. bool MediaDataInstaller::InstallMusics(){
  1439. VGears::LGPArchive::FileEntry f = midi_.GetFiles().at(processed_musics_);
  1440. // Find the index in the map.
  1441. int index = 1000 + processed_musics_;
  1442. for (auto const& m : musics_map_){
  1443. if (m.second + ".mid" == f.file_name){
  1444. index = m.first;
  1445. break;
  1446. }
  1447. }
  1448. File midi(input_dir_ + "data/midi/midi.lgp");
  1449. std::fstream out;
  1450. out.open(output_dir_ + "audio/musics/" + std::to_string(index) + ".mid", std::ios::out);
  1451. midi.SetOffset(f.data_offset);
  1452. for (int j = 0; j < f.data_size; j ++) out << midi.readU8();
  1453. out.close();
  1454. // Convert to ogg (TiMidity + FFMpeg)
  1455. std::string command = (boost::format(
  1456. "timidity --quiet=3 %1%audio/musics/%2%.mid -Ow -o - "
  1457. "| ffmpeg -hide_banner -loglevel panic -y -i - %1%audio/musics/%2%.ogg"
  1458. ) % output_dir_ % index).str();
  1459. if (!no_ffmpeg_ && !no_timidity_) std::system(command.c_str());
  1460. // Remove the midi file.
  1461. if (!keep_originals_)
  1462. std::remove((output_dir_ + "audio/musics/" + std::to_string(index) + ".mid").c_str());
  1463. musics_.push_back("audio/musics/" + std::to_string(processed_musics_) + ".ogg");
  1464. processed_musics_ ++;
  1465. if (processed_musics_ == midi_.list(true, true)->size()) return true;
  1466. else return false;
  1467. }
  1468. void MediaDataInstaller::InstallHQMusics(){
  1469. std::vector<std::string> hq_musics = {"hearth", "sato", "sensui", "wind"};
  1470. for (std::string hq_music : hq_musics){
  1471. int index = 2000;
  1472. for (auto const& m : musics_map_){
  1473. if (m.second == hq_music){
  1474. index = m.first;
  1475. break;
  1476. }
  1477. }
  1478. std::string command = (boost::format(
  1479. "ffmpeg -hide_banner -loglevel panic -y -i %1%musics/%2%.wav %3%audio/sounds/%4%.ogg"
  1480. ) % input_dir_ % hq_music % output_dir_ % index).str();
  1481. if (!no_ffmpeg_) std::system(command.c_str());
  1482. }
  1483. }
  1484. void MediaDataInstaller::WriteMusicsIndex(){
  1485. TiXmlDocument xml;
  1486. std::unique_ptr<TiXmlElement> container(new TiXmlElement("musics"));
  1487. //for (string item : items_){
  1488. for (int id = 0; id < musics_.size(); id ++){
  1489. std::string path = musics_[id];
  1490. std::unique_ptr<TiXmlElement> xml_music(new TiXmlElement("music"));
  1491. xml_music->SetAttribute("file_name", path);
  1492. xml_music->SetAttribute("name", id);
  1493. xml_music->SetAttribute("loop", "0");
  1494. switch (id){
  1495. case 1:
  1496. xml_music->SetAttribute("default", "initial");
  1497. break;
  1498. case 6:
  1499. xml_music->SetAttribute("default", "battle");
  1500. break;
  1501. case 9:
  1502. xml_music->SetAttribute("default", "boss");
  1503. break;
  1504. case 13:
  1505. xml_music->SetAttribute("default", "world_map");
  1506. break;
  1507. case 43:
  1508. xml_music->SetAttribute("default", "chocobo_battle");
  1509. break;
  1510. case 45:
  1511. xml_music->SetAttribute("default", "victory");
  1512. break;
  1513. case 46:
  1514. xml_music->SetAttribute("default", "airship");
  1515. break;
  1516. case 50:
  1517. xml_music->SetAttribute("default", "chocobo_ride");
  1518. break;
  1519. case 57:
  1520. xml_music->SetAttribute("default", "game_over");
  1521. break;
  1522. case 70:
  1523. xml_music->SetAttribute("default", "world_map_danger");
  1524. break;
  1525. case 84:
  1526. xml_music->SetAttribute("default", "submarine");
  1527. break;
  1528. }
  1529. container->LinkEndChild(xml_music.release());
  1530. // If there is a friendly name for this sound, add another entry
  1531. if (musics_map_.count(id) != 0){
  1532. std::unique_ptr<TiXmlElement> xml_music_name(new TiXmlElement("music"));
  1533. xml_music_name->SetAttribute("file_name", path);
  1534. xml_music_name->SetAttribute("name", musics_map_[id]);
  1535. xml_music_name->SetAttribute("loop", "0");
  1536. container->LinkEndChild(xml_music_name.release());
  1537. }
  1538. }
  1539. xml.LinkEndChild(container.release());
  1540. xml.SaveFile(output_dir_ + "audio/musics/_musics.xml");
  1541. }