Compare commits
948 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 00cbd347b2 | |||
| 77123196d1 | |||
| 52b896271c | |||
| 7f4a19461c | |||
| b8465a9ef9 | |||
| db4af238f2 | |||
| d3bfc102fe | |||
| 1a9898b918 | |||
| 656dcd2021 | |||
| 39b80137f6 | |||
| 5d2b794c00 | |||
| d4aeb79341 | |||
| aa1adc1a69 | |||
| c10e4a98ca | |||
| 1bf5fb64a5 | |||
| b843937b34 | |||
| c87f066848 | |||
| 15eb293e61 | |||
| aa16a5388e | |||
| b50a3e842e | |||
| 8841e0b607 | |||
| c44dec1e35 | |||
| 5dcc7e41b9 | |||
| d5b3cfe644 | |||
| 82fff6486c | |||
| 2c0ec96eff | |||
| d141876af4 | |||
| 79d8e37cb1 | |||
| dcd9ca56e6 | |||
| 283854c854 | |||
| adb1365200 | |||
| c9a3dcdb44 | |||
| e7597bae30 | |||
| 8571545bf2 | |||
| 6361a4c776 | |||
| 336d129114 | |||
| 15a9975200 | |||
| 8be2c4ddd7 | |||
| 3914781ebf | |||
| 9eb29ed81c | |||
| 20cbebeed7 | |||
| 341bc43daf | |||
| f050ba9ff7 | |||
| 2c6c1d2e46 | |||
| 92b1730237 | |||
| e170407517 | |||
| 8d57ef4bed | |||
| 328ff0e8c4 | |||
| 11497c393d | |||
| 498769c990 | |||
| e6e7a7b549 | |||
| be72f48cea | |||
| 2f6dea92c7 | |||
| 99260acaf1 | |||
| 710a768d76 | |||
| 274a108167 | |||
| 4396411d10 | |||
| 6d10e6b9f8 | |||
| d77e810aae | |||
| 1dc28978fe | |||
| dc758739f4 | |||
| 960c2732e5 | |||
| a40b7180d9 | |||
| 763f3a5760 | |||
| a4697c6fcb | |||
| 75af33a04c | |||
| c5940905e7 | |||
| 4156a1d2c7 | |||
| d49a1cd6b3 | |||
| 3b7b4913eb | |||
| 897e70b6fc | |||
| fab52d323b | |||
| fd8a2c9483 | |||
| dda4a13bc3 | |||
| fb0b71ea54 | |||
| 57c1f4dce2 | |||
| e1a075268f | |||
| 2f96e28135 | |||
| e6150ea8da | |||
| 6c30d7a435 | |||
| 087f42a826 | |||
| 8932f30904 | |||
| 76e4e97a72 | |||
| b1bb8fe8c0 | |||
| 4a686cf800 | |||
| cc7f831ec1 | |||
| a9f73ee641 | |||
| 4adfb93b48 | |||
| f860d57c8c | |||
| 0389c8084c | |||
| 0819ad4f9c | |||
| 32672e58e7 | |||
| 67e98d43b7 | |||
| e2a9461005 | |||
| 60c9e869e3 | |||
| fc1a009953 | |||
| af5a780e63 | |||
| de38e366a0 | |||
| 6a969d8283 | |||
| 6fe7728bd1 | |||
| df646794f3 | |||
| 1db4e9303e | |||
| ef73aa4f8d | |||
| e6e2184fe1 | |||
| 5ce051e4ea | |||
| c914bd20b8 | |||
| 76942aeaee | |||
| 5d29c4755e | |||
| af02623456 | |||
| 4fb78f9caa | |||
| 262e036c22 | |||
| dbd5585e15 | |||
| e5cc09a96f | |||
| f756da02e5 | |||
| f4ac37f54a | |||
| 6e2c38895b | |||
| c60ad115cd | |||
| a920aea8de | |||
| 36b42635d6 | |||
| 81b27d5b85 | |||
| 7d9a050a4d | |||
| 4a029cc6cf | |||
| 57ba36b063 | |||
| 30c66439a4 | |||
| 4173eadae2 | |||
| f300c02b63 | |||
| e96df1649f | |||
| 7b08f98b8c | |||
| 1b6dd8a0fe | |||
| 350315a5d1 | |||
| dd6a8b5084 | |||
| 4ef7151721 | |||
| f4c871e35c | |||
| 8e808c4305 | |||
| 03c3eef193 | |||
| 42a5f46e5e | |||
| 7878b8f3e4 | |||
| 7906d70485 | |||
| dd62d0882e | |||
| 595e105ef1 | |||
| 6e88a3706c | |||
| d102506fba | |||
| 41bcad78a3 | |||
| 98af2c468c | |||
| 7c7f032e0e | |||
| 825af33b6a | |||
| da8f80bb28 | |||
| 63f763a556 | |||
| 83541f4605 | |||
| 43b7ca96d7 | |||
| e7ea2a3ae1 | |||
| c00edb928b | |||
| b0510d78f8 | |||
| 14543d567a | |||
| fd3872ae30 | |||
| 8df4d640ac | |||
| aa00cba76e | |||
| 18208cc993 | |||
| b310d675f1 | |||
| eb081dc719 | |||
| 242757777c | |||
| 7e841d6156 | |||
| e883f27436 | |||
| f563ac733f | |||
| a133be625e | |||
| 71e4448013 | |||
| 2a302a802f | |||
| 236cb0bfb0 | |||
| 06e8a5af41 | |||
| 0720c37656 | |||
| f1070a2e74 | |||
| db2e6164cb | |||
| 6bdca84b90 | |||
| 02c0caff4f | |||
| 2ad0b37fa5 | |||
| 6b6a352205 | |||
| 75d0402525 | |||
| 37ffc8b9c8 | |||
| d75b38d457 | |||
| f3f357c874 | |||
| ec88b90ed8 | |||
| 36e40665bb | |||
| 9804035dc0 | |||
| 973ec52b2a | |||
| d61b398f41 | |||
| af13595aae | |||
| 97211093f3 | |||
| fba4839705 | |||
| 15e22349df | |||
| 8888fb2ec1 | |||
| dc3c0dd9c8 | |||
| 08915e5684 | |||
| 083ceb4423 | |||
| 87125ae334 | |||
| c487e4ba0b | |||
| 1b141fd68c | |||
| 694c6c9832 | |||
| c6a875eb5c | |||
| 677c4845f6 | |||
| 7fb8902e7f | |||
| 58c097cfb9 | |||
| 6265613bc7 | |||
| c21b2e8f00 | |||
| b3c7edcf76 | |||
| c2ff12c3e8 | |||
| dbc4d8199e | |||
| 0e1248f840 | |||
| 7a516c72c3 | |||
| a927a881fc | |||
| ac1a87730e | |||
| cf881d7d25 | |||
| 41eb6c585d | |||
| ee505fc47d | |||
| 7758749770 | |||
| da893a5b86 | |||
| e412a8b55e | |||
| 5a0b854c5c | |||
| bf2420f7d3 | |||
| 50d6836b4a | |||
| da677682cd | |||
| 11b6ce819d | |||
| 5ee86cb558 | |||
| 3a2fcc9604 | |||
| fde05e65c0 | |||
| 00fb12134a | |||
| fa8d64ec3a | |||
| b4740d131f | |||
| ec2222347e | |||
| 3d0d97d6b5 | |||
| 2b78bea475 | |||
| 28b7f23769 | |||
| 784cb98d7f | |||
| d47746eab1 | |||
| 936c493b9e | |||
| d628bafe29 | |||
| d83c6f1753 | |||
| e1b83b6eb4 | |||
| d2153d601c | |||
| 98be9a8472 | |||
| 5d2b5559c8 | |||
| b54f6daa27 | |||
| c5acef2957 | |||
| b5b5a58302 | |||
| d6d7ffd3da | |||
| 66c2fdaacd | |||
| f6fa3c74c7 | |||
| 22c963c0a0 | |||
| e97ba37a5e | |||
| b18cc9d628 | |||
| 978b325a30 | |||
| 006506240f | |||
| f712068a17 | |||
| 55e79cd9d2 | |||
| c9aafcf7c5 | |||
| 34d6212ab2 | |||
| e76890a796 | |||
| e2e0a070ea | |||
| d53c8588e2 | |||
| 941cf65227 | |||
| e1f95a5ad9 | |||
| 18a26b480e | |||
| 67bbeca809 | |||
| eda5a6ac91 | |||
| a2d4f4766d | |||
| a9f3aedf8e | |||
| 9686a7ca4c | |||
| e80e3440e1 | |||
| 4cda92462a | |||
| 4a0269b3b1 | |||
| 4d81c28738 | |||
| 3b844375b7 | |||
| f1dc980de8 | |||
| 6daf357fd9 | |||
| d2fa0d6485 | |||
| b14fb37b81 | |||
| edb5261b07 | |||
| 8118947ab0 | |||
| 0ce0ab1260 | |||
| 64aca78450 | |||
| 584a4ad818 | |||
| bf505dba5c | |||
| 776219fb52 | |||
| a572c11f4f | |||
| 05136c13b7 | |||
| c2fed1a382 | |||
| 90067be132 | |||
| 80863fc7f2 | |||
| c0b9171f98 | |||
| b70ad81f57 | |||
| 0573a1b2ac | |||
| b774252f0c | |||
| 3792b03a7d | |||
| 927ffd0b8b | |||
| d6ebce068d | |||
| 4680641514 | |||
| ca08680a12 | |||
| 70d7d66d0c | |||
| d735616020 | |||
| 168e84498f | |||
| ed1708508a | |||
| e12e1d67c6 | |||
| d39a1a0bdf | |||
| f87f636828 | |||
| eed3942b81 | |||
| f5112a709a | |||
| f6bb46a0dc | |||
| 51e4485966 | |||
| ad8179287e | |||
| 0971b9aa78 | |||
| 9bc6aac81e | |||
| ad3efccb88 | |||
| f4c1332159 | |||
| 72981221ad | |||
| 6723f4c7c2 | |||
| f9621dcc17 | |||
| 10ce3c88fb | |||
| ea92a2e123 | |||
| b43eb2d0bd | |||
| d09172d74d | |||
| 6b0338a37d | |||
| 6206cd7db0 | |||
| 01b7fedc35 | |||
| 71b1db1fb6 | |||
| b4614acf70 | |||
| cd37a56161 | |||
| eb632ccb50 | |||
| 0f2e7db8e0 | |||
| a3d0962054 | |||
| 46a421f933 | |||
| b7f9960a60 | |||
| b46c7a0607 | |||
| ee9ea3f2bd | |||
| a31256d956 | |||
| 7a9160ed78 | |||
| 42bce9d33e | |||
| fabe051d3d | |||
| 8945b2ed48 | |||
| d575a3dda6 | |||
| 37dd045bd2 | |||
| 651e0ddad4 | |||
| 68e7f2e6c1 | |||
| b989ef4f7f | |||
| 789cf13aae | |||
| 86faa42acf | |||
| d623ac5918 | |||
| 4a3e43f73f | |||
| 094388187f | |||
| 791f7774a5 | |||
| e88000aeb0 | |||
| d34a6d7666 | |||
| 3bcc9514ab | |||
| 15fba97949 | |||
| 6766719969 | |||
| 6484d9354d | |||
| 23fb885e09 | |||
| 81cd594704 | |||
| 797d9fab7c | |||
| 96c2033361 | |||
| 7b11509010 | |||
| a4804d7290 | |||
| 5751b5c278 | |||
| f97f9ae422 | |||
| c7ccd6dbff | |||
| 1f351418e1 | |||
| e4b58e5a0c | |||
| 0d9c390526 | |||
| b924831eba | |||
| 317de33a8b | |||
| fa090c51f6 | |||
| e63d84bd7d | |||
| 5581f45050 | |||
| b6934b34db | |||
| 5453c68399 | |||
| 4ea7f8371f | |||
| c803ff65ce | |||
| 0e10b59307 | |||
| 4bf4ad3359 | |||
| f80ba4102a | |||
| a4334ecb02 | |||
| a8fea61bda | |||
| 1f5d323d89 | |||
| cf639b1d51 | |||
| 59baf24dc6 | |||
| 9b33827d02 | |||
| 9afbe42720 | |||
| 7f233de502 | |||
| ed9378375d | |||
| e51e7f3d45 | |||
| cb2410d9c5 | |||
| b2ac01bc98 | |||
| 1794683d3a | |||
| c70e3f38b1 | |||
| aadabe1ecd | |||
| 7f58ef14ee | |||
| 8efeceb236 | |||
| 9a126dec4e | |||
| 7ef3fff869 | |||
| 1ebca42f46 | |||
| 93d0d7443a | |||
| c23457d666 | |||
| d397c1d871 | |||
| 2f5f089e7f | |||
| facd1723f8 | |||
| 5f913cb9bf | |||
| 739434e3e4 | |||
| 78ad282056 | |||
| d61d4e508a | |||
| bd86c792c3 | |||
| dffcbb035e | |||
| 0f7a88bd5a | |||
| 97adc4a7f2 | |||
| 6190388164 | |||
| 8c9d067657 | |||
| 6d3d5e7da5 | |||
| 212d774613 | |||
| e68fac14c8 | |||
| 7675309e3f | |||
| 4ce19e1448 | |||
| fd379896d6 | |||
| 8431cddb14 | |||
| 2d60c772bf | |||
| 6d0d608e38 | |||
| fe02818d51 | |||
| db33604171 | |||
| 27e0f19dac | |||
| b89cc25df3 | |||
| 7267b60a26 | |||
| 67d5ba08ab | |||
| 1de525900d | |||
| 352b46c1f5 | |||
| 1bf7771981 | |||
| c1659d3dcf | |||
| b3c3882b12 | |||
| d80742d882 | |||
| a007bfd14a | |||
| 7eba85c3b4 | |||
| d9443d98f0 | |||
| 73447f05ab | |||
| 85c4cd3863 | |||
| cec0bc6fca | |||
| 53229f0905 | |||
| 18013e1ae0 | |||
| 61c68666d6 | |||
| bb8152b376 | |||
| 480053dfaa | |||
| eae97cff79 | |||
| 4d30cc50a1 | |||
| 4ed82c71dc | |||
| 9389ceb8c1 | |||
| b4f4e36acb | |||
| d332c3d9d6 | |||
| b59c9cdf02 | |||
| 8c25e9a992 | |||
| 4f29833476 | |||
| d648c7275c | |||
| a1ed35e5bd | |||
| 206f63f9e6 | |||
| 7a45380123 | |||
| 99ecccfaab | |||
| 7dd6f59b8b | |||
| 361a986b8e | |||
| b98c8b4abb | |||
| 582f084973 | |||
| 2f9874c68f | |||
| 47ad3bdc47 | |||
| 9d12813282 | |||
| 3bb234e6a6 | |||
| 44bf5af33a | |||
| 0193489b00 | |||
| a6092c21d4 | |||
| 02c50cd0c4 | |||
| fa0a66695c | |||
| 6818247317 | |||
| e8d2b0cceb | |||
| 5a97e9f0de | |||
| d0968a99c1 | |||
| 0ed8c277e8 | |||
| 477cf7f6ec | |||
| 59dc52f394 | |||
| 822476373b | |||
| 4c9e4b2d84 | |||
| 2ff5d54592 | |||
| cd01e8b778 | |||
| 8bdc4458c7 | |||
| 5f718932e6 | |||
| 3fc783b832 | |||
| c36b891d9b | |||
| fb64a11d38 | |||
| 26a4622982 | |||
| 257cd92208 | |||
| 2d9129084e | |||
| d6ce37ce7e | |||
| 6da8ffae11 | |||
| 62f56a4791 | |||
| 294684213a | |||
| ab691e64db | |||
| 3a9dd95abc | |||
| 706e57dd7b | |||
| d180b8a299 | |||
| 50bc5de2da | |||
| 4a15e113f7 | |||
| 1160fb2b15 | |||
| 27b3644335 | |||
| b6af684583 | |||
| 1ca64b1fdf | |||
| 3c1d28b081 | |||
| 5d0452d1dc | |||
| 87ed5fedfd | |||
| d05295aad2 | |||
| 9f2eb46663 | |||
| c1155bb08c | |||
| 661946b4f5 | |||
| 780e9f4669 | |||
| a33c3d606a | |||
| a21998c489 | |||
| dca922ade8 | |||
| 5f6d0939bd | |||
| ffb3523cb5 | |||
| 01347dc9f9 | |||
| 62d9390c9b | |||
| 44bdfe552c | |||
| d3c2c0ec7d | |||
| bd787719b8 | |||
| d4bd953c0b | |||
| 474eee5d98 | |||
| 38ecb6cfff | |||
| ccf1bffd4f | |||
| 1de5b72802 | |||
| bd95fe616b | |||
| d299284751 | |||
| b3d3148383 | |||
| 2ad78887b9 | |||
| 1ca12feaed | |||
| 84236e7ac3 | |||
| 1cbaa592d0 | |||
| df756b2ce0 | |||
| c7c16c39b0 | |||
| 059045481c | |||
| 44dbd3a8a9 | |||
| 753031df17 | |||
| 52f22275e3 | |||
| c19beca980 | |||
| eb49053e73 | |||
| d08b1d277e | |||
| e41873fff4 | |||
| dfa929a16f | |||
| 880e3928cf | |||
| 41d1bbe137 | |||
| e519caa554 | |||
| 1d208c7dc2 | |||
| 2edc81ee2d | |||
| 21c585b2ce | |||
| b5dc097587 | |||
| cddca2700a | |||
| 17b3f65276 | |||
| 75a4d2cf99 | |||
| 795ee54f2b | |||
| 3633bdeeaf | |||
| c5f66373c3 | |||
| 2d1aa1d13a | |||
| 32abe61554 | |||
| 235cef6abf | |||
| e871b53afc | |||
| dabb83fccf | |||
| 046b7e8949 | |||
| 97d1f0e46c | |||
| edfa369639 | |||
| 169f757954 | |||
| 4745f73655 | |||
| 660897ff63 | |||
| 37afdbd84c | |||
| 9679075cba | |||
| 5e5e57ea8f | |||
| 9118788149 | |||
| cc28a1444d | |||
| c65a40f432 | |||
| 9e8335c1f0 | |||
| 10cb23ad74 | |||
| 2daddd8a5a | |||
| d45968270a | |||
| e04b2c80b6 | |||
| 1ed45e1433 | |||
| ee1270f346 | |||
| 98c771cf2c | |||
| 69d2b5b3a3 | |||
| f57a912ca1 | |||
| 4eaf70b859 | |||
| 3f2111a3e6 | |||
| 1165e70434 | |||
| 93bea4c151 | |||
| 46df17e29f | |||
| 9c57ed6642 | |||
| 8417db65c7 | |||
| 16f52c03b9 | |||
| 1ed58c4a99 | |||
| cd096ce5e9 | |||
| 06338d864f | |||
| 873995199b | |||
| b2b7cf2374 | |||
| 0ae5c4c0f2 | |||
| a81ecfcfcc | |||
| 31511af130 | |||
| d9277530a2 | |||
| 219804cbe4 | |||
| cb6876792e | |||
| f7db8868d0 | |||
| 379649bead | |||
| 14a87f83b3 | |||
| e9ba8f734f | |||
| 248f49b3bf | |||
| 2b72b10356 | |||
| 7c6d8a6b9c | |||
| 4d65a5ff73 | |||
| cff73cccf0 | |||
| 7b04f67884 | |||
| 97ad234c8c | |||
| 2159c006fc | |||
| c9fdf8a480 | |||
| 3de58774ba | |||
| 66ec623542 | |||
| 3aa93b9855 | |||
| eab3b5bd7f | |||
| 37bf9b36ad | |||
| c25089b98f | |||
| 0fd779f002 | |||
| 6b50b50a6c | |||
| c9497060e9 | |||
| a7c94bba8c | |||
| 4ccc2bb12f | |||
| e3267a4e9b | |||
| 926fd3f406 | |||
| e04bc6037e | |||
| d4c1c40c1d | |||
| 89e07f8dbb | |||
| d1a2f98524 | |||
| 24856a6e8c | |||
| 42383a1fe1 | |||
| 4371b58223 | |||
| ef3dd96eb4 | |||
| ee184b5a51 | |||
| a1f92d76ab | |||
| 60e713855a | |||
| 0f34b991aa | |||
| 1c9195373d | |||
| c78d2828a7 | |||
| 4515fac467 | |||
| 260669f981 | |||
| 58f3786a35 | |||
| 38c7d66788 | |||
| e8bfa61fc2 | |||
| 537722d57a | |||
| a34b2b56fe | |||
| fd0fb25de1 | |||
| a2d64864dd | |||
| 2fbdd056ed | |||
| 1ad2931f80 | |||
| 306cfd0654 | |||
| 2b99e65d24 | |||
| 0b7137b8b0 | |||
| c5e84c17a5 | |||
| f865db5444 | |||
| a5df9dddf0 | |||
| a9c3c7541e | |||
| a31be1f3d1 | |||
| e5b59742ae | |||
| 8615418630 | |||
| b8602994fb | |||
| 923bf3b0e4 | |||
| 21142bdb26 | |||
| 5ce2ecd6c8 | |||
| b730af5e8a | |||
| f9b831d5c0 | |||
| e7c2aff97e | |||
| 668f9bee10 | |||
| 818d5f90a8 | |||
| d63c0077ee | |||
| c14e4f387c | |||
| 39a50a406b | |||
| 9f5618def4 | |||
| 82f790d082 | |||
| a58ddd4f55 | |||
| cc22fe17bb | |||
| 447e68a659 | |||
| 0f84682bc0 | |||
| 284a7fba95 | |||
| b96bd4ea9d | |||
| 8535568f53 | |||
| 1f1de82bb8 | |||
| 65016499ab | |||
| efd4b26f3d | |||
| 0fc75bb873 | |||
| 375932f43b | |||
| fd06827e2b | |||
| 57fb04accc | |||
| ba74653f61 | |||
| bd22074ec8 | |||
| e42b18cf71 | |||
| 77e7080a8c | |||
| 77fc202694 | |||
| d3436fc1e4 | |||
| d5db4a86bd | |||
| f8e3dcd7c0 | |||
| 1435b5d314 | |||
| abcf713cc1 | |||
| 5bf4128add | |||
| 53fc151453 | |||
| 14df96eacd | |||
| a7ed748973 | |||
| 43503ead83 | |||
| 39d8b77b02 | |||
| 36b9b9519d | |||
| 7d0af303ec | |||
| 5549ad9388 | |||
| 950f954c89 | |||
| b56426a67d | |||
| 45cb350b7a | |||
| b4eebbbcd6 | |||
| 73ff7ef3da | |||
| a142d94c36 | |||
| 4e75488567 | |||
| e945a86d46 | |||
| 5a872f85e1 | |||
| 8a6ee00a21 | |||
| b0278de3a8 | |||
| 3a65119267 | |||
| d6eb59d0af | |||
| 1763d0bfce | |||
| 029d7bcda3 | |||
| 8d4b15325a | |||
| f7bcbe3049 | |||
| e66c4751ea | |||
| 5dc5c85588 | |||
| dd42cca2cf | |||
| bb90be6748 | |||
| 3e6307bf96 | |||
| 36d37d97bd | |||
| 587c46cacf | |||
| ac8acaeba4 | |||
| 93e69c924d | |||
| 73ebcf2b1b | |||
| 72ebeaad3b | |||
| f29fb01887 | |||
| 3d24f3f595 | |||
| bf0935a5a2 | |||
| 1f1b81ab40 | |||
| b9a8118e33 | |||
| f581e3e79f | |||
| 2a2ef17302 | |||
| 34ef1d2fd0 | |||
| bb6f5abbbf | |||
| 960a29e513 | |||
| aeaaa54e0d | |||
| 3f10195c0e | |||
| c930bd0138 | |||
| 0a629ea6e9 | |||
| 6c94c8690e | |||
| 510ef9b60c | |||
| 2b40e66fa4 | |||
| 28073fbb19 | |||
| ef2f4f799c | |||
| c49cee3521 | |||
| b3e299dbde | |||
| 941c19f2c3 | |||
| bd68e29bfb | |||
| 4c99fc497c | |||
| b8334e5757 | |||
| ce36822c80 | |||
| 1ec0161247 | |||
| dcb1b59c1b | |||
| 510a38a6bc | |||
| 7bca63a800 | |||
| aa98408e00 | |||
| 416173fa79 | |||
| 99e3d9a899 | |||
| 5d3b21bd2b | |||
| a0e9ca9a9c | |||
| 262d067870 | |||
| 44874a0763 | |||
| 9fe268abc7 | |||
| 114c6e01d9 | |||
| 746c7a5303 | |||
| b8c9f7f1ce | |||
| 3cd5d75f6f | |||
| 08bd76d25c | |||
| 5b43e4652f | |||
| d0ce76e5c6 | |||
| 19ac30b918 | |||
| b3396446af | |||
| 3dc33b6f84 | |||
| 008af18951 | |||
| 5fcddaa066 | |||
| 15b28370fc | |||
| 9e313dd18b | |||
| bff206e30b | |||
| c5df54ae27 | |||
| c82df705a6 | |||
| 3e1cb17e22 | |||
| 83aee6d7e1 | |||
| b66174c3ec | |||
| 919cad0e51 | |||
| 61760401bc | |||
| b83cd172b2 | |||
| b889880cc7 | |||
| 9cf537eaff | |||
| 36eb47e631 | |||
| 4ddb2d81b7 | |||
| 405e6019d2 | |||
| 4e9ef65967 | |||
| 2a1145785e | |||
| 04bb9cd48e | |||
| 45e18f9aca | |||
| c927403fa5 | |||
| fde3c8e98f | |||
| da724c0632 | |||
| 1225a381ab | |||
| a8a3516e59 | |||
| 129882c79f | |||
| 8b63cf93d8 | |||
| 8a7aa5fa53 | |||
| 9e851ebd93 | |||
| aa66e01740 | |||
| 394939347c | |||
| bda5ba8cbc | |||
| f00178e45d | |||
| a46bee9535 | |||
| a7d8362787 | |||
| 1cb3cd5509 | |||
| 1feef9d5d6 | |||
| f3dda92e78 | |||
| 4f492e9f63 | |||
| 96a18391a8 | |||
| 35e15389ac | |||
| 9bd225f3bf | |||
| f1b81b7f82 | |||
| 257cc41d2b | |||
| e39961dc4b | |||
| de86227d01 | |||
| 00025f2318 | |||
| e4fe289f70 | |||
| 24567eeeb6 | |||
| b38e0a6b15 | |||
| 55fa1996ba | |||
| 6478df046a | |||
| ffc22fe8c4 | |||
| 5b7dad1de2 | |||
| c6622e6c87 | |||
| cf872d1e0d | |||
| ac2127094b | |||
| 3444868b95 | |||
| d01d6ff3d1 | |||
| 376860af9d | |||
| e87921f6be | |||
| 8cbc4d27eb | |||
| 596d5b478b | |||
| f9c86c9821 | |||
| d87df5f670 | |||
| 6c34c03cdf | |||
| c08439a562 | |||
| 38ec6ea702 | |||
| 065291d2c7 | |||
| 95cfce0ded | |||
| af8c5ab978 | |||
| b5d5930fed | |||
| 72fcd19a9e | |||
| 3b1d82c3ca | |||
| c92524a90e | |||
| 51e58b9e13 | |||
| 5ec6c01a78 | |||
| e0ff6311ef | |||
| d42c0ca23f | |||
| a4460c26ef | |||
| e1affbdf9a | |||
| 902b842bcb | |||
| 23946d5798 | |||
| 05340a926a | |||
| 0bfe2fec67 | |||
| 332f8f93fb | |||
| 0320107fc0 | |||
| fc7da35054 | |||
| 6f5ce7d715 | |||
| 0067a69795 | |||
| ca6f8f8963 | |||
| e4ce541fcf | |||
| 22a305028f | |||
| fa21734a98 | |||
| fca79ae92a | |||
| ea0ea0366b | |||
| daec428cb3 | |||
| 08c161fd13 | |||
| 29d4cd27c4 | |||
| 7913398110 | |||
| ccab94c765 | |||
| 90a33e9756 | |||
| 14ca2ab377 | |||
| aaa1fafd51 | |||
| 83c07645f4 | |||
| 533c216ad3 | |||
| 4669235f62 | |||
| 78b3c1ae47 | |||
| 72125bbd1e | |||
| a35c4abc30 | |||
| fb270dbab9 | |||
| 5fd0100ad0 | |||
| 17e09d5fd3 | |||
| 40f13ff2e6 | |||
| d1357b902d | |||
| 0ce37a4126 | |||
| e56af6a7a3 | |||
| b359d642f4 | |||
| 2192ae0a25 | |||
| 0b2c264a60 | |||
| 0993337721 | |||
| 6ccd3ede1a | |||
| a3cf852267 | |||
| 226dd3a828 | |||
| 2115111ea8 | |||
| c0cd3b5400 | |||
| 49e15d342d | |||
| bb44350a8f | |||
| 6229233b5f | |||
| d36b641bfb | |||
| bc6def77a4 | |||
| 72bacabf45 | |||
| 52091c2912 | |||
| d3c869871d | |||
| 7a4da43d7b | |||
| 9f82457830 | |||
| 8bb988675d | |||
| 076887e71f | |||
| d8d1388ec6 | |||
| bd6e637fee | |||
| 6dbb085a82 | |||
| b9c5b34eba | |||
| a72ebbe84d | |||
| 3e01b25573 | |||
| f217b9bb97 | |||
| 4e15f0b3d1 | |||
| e6c959e500 | |||
| bc65a38a55 | |||
| 92c8ecb726 | |||
| 247360cbf0 | |||
| 2478ed86eb | |||
| 2e84a351b1 | |||
| 24fd3f1cdd | |||
| a3a65a1722 | |||
| 888662267f | |||
| e55dcfa0a0 | |||
| c99f10169e |
@@ -0,0 +1 @@
|
|||||||
|
libsdl2-dev libsdl2-net-dev libpng-dev libglew-dev ninja-build
|
||||||
@@ -0,0 +1,253 @@
|
|||||||
|
name: generate-builds
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
jobs:
|
||||||
|
extract-assets:
|
||||||
|
runs-on: [ self-hosted, asset-builder ]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Extract assets
|
||||||
|
run: |
|
||||||
|
cp ../../../ZELOOTD.z64 OTRExporter/baserom_non_mq.z64
|
||||||
|
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release
|
||||||
|
cmake --build build-cmake --target ExtractAssets --config Release
|
||||||
|
zip -r assets.zip soh/assets
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: assets
|
||||||
|
path: assets.zip
|
||||||
|
retention-days: 1
|
||||||
|
build-macos:
|
||||||
|
needs: extract-assets
|
||||||
|
runs-on: macos-12
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: ccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
|
with:
|
||||||
|
key: ${{ runner.os }}-ccache
|
||||||
|
- name: Install gtar wrapper
|
||||||
|
run: |
|
||||||
|
sudo mv /usr/local/bin/gtar /usr/local/bin/gtar.orig
|
||||||
|
sudo cp .github/workflows//gtar /usr/local/bin/gtar
|
||||||
|
sudo chmod +x /usr/local/bin/gtar
|
||||||
|
- name: Cache MacPorts
|
||||||
|
id: cache-macports
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: /opt/local/
|
||||||
|
key: ${{ runner.os }}-macports-${{ hashFiles('.github/workflows/macports-deps.txt') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-macports-
|
||||||
|
- name: Install MacPorts (if necessary)
|
||||||
|
run: |
|
||||||
|
if [ -d /opt/local/ ]; then
|
||||||
|
echo "MacPorts already installed"
|
||||||
|
else
|
||||||
|
wget https://github.com/macports/macports-base/releases/download/v2.7.2/MacPorts-2.7.2-12-Monterey.pkg
|
||||||
|
sudo installer -pkg ./MacPorts-2.7.2-12-Monterey.pkg -target /
|
||||||
|
fi
|
||||||
|
echo "/opt/local/bin:/opt/local/sbin" >> $GITHUB_PATH
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
brew uninstall --ignore-dependencies libpng
|
||||||
|
sudo port install $(cat .github/workflows/macports-deps.txt)
|
||||||
|
brew install ninja
|
||||||
|
- name: Restore assets
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: assets
|
||||||
|
- name: Build SoH
|
||||||
|
run: |
|
||||||
|
unzip -o assets.zip
|
||||||
|
|
||||||
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
|
||||||
|
cmake --build build-cmake --config Release --parallel 10
|
||||||
|
(cd build-cmake && cpack)
|
||||||
|
|
||||||
|
mv _packages/*.dmg SoH.dmg
|
||||||
|
mv README.md readme.txt
|
||||||
|
- name: Upload build
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: soh-mac
|
||||||
|
path: |
|
||||||
|
SoH.dmg
|
||||||
|
readme.txt
|
||||||
|
build-linux:
|
||||||
|
needs: extract-assets
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y $(cat .github/workflows/apt-deps.txt)
|
||||||
|
- name: ccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
|
with:
|
||||||
|
key: ${{ runner.os }}-ccache
|
||||||
|
- name: Install latest SDL
|
||||||
|
run: |
|
||||||
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
wget https://www.libsdl.org/release/SDL2-2.24.1.tar.gz
|
||||||
|
tar -xzf SDL2-2.24.1.tar.gz
|
||||||
|
cd SDL2-2.24.1
|
||||||
|
./configure
|
||||||
|
make -j 10
|
||||||
|
sudo make install
|
||||||
|
sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/
|
||||||
|
- name: Install latest SDL_net
|
||||||
|
run: |
|
||||||
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
wget https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.2.0.tar.gz
|
||||||
|
tar -xzf SDL2_net-2.2.0.tar.gz
|
||||||
|
cd SDL2_net-2.2.0
|
||||||
|
./configure
|
||||||
|
make -j 10
|
||||||
|
sudo make install
|
||||||
|
sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/
|
||||||
|
- name: Restore assets
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: assets
|
||||||
|
- name: Build SoH
|
||||||
|
run: |
|
||||||
|
unzip -o assets.zip
|
||||||
|
|
||||||
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release
|
||||||
|
cmake --build build-cmake --target OTRGui -j3
|
||||||
|
cmake --build build-cmake --config Release -j3
|
||||||
|
(cd build-cmake && cpack -G External)
|
||||||
|
|
||||||
|
mv README.md readme.txt
|
||||||
|
mv build-cmake/*.appimage soh.appimage
|
||||||
|
env:
|
||||||
|
CC: gcc-10
|
||||||
|
CXX: g++-10
|
||||||
|
- name: Upload build
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: soh-linux
|
||||||
|
path: |
|
||||||
|
soh.appimage
|
||||||
|
readme.txt
|
||||||
|
build-switch:
|
||||||
|
needs: extract-assets
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: devkitpro/devkita64:latest
|
||||||
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y ninja-build
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: ccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
|
with:
|
||||||
|
key: ${{ runner.os }}-switch-ccache
|
||||||
|
- name: Restore assets
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: assets
|
||||||
|
- name: Build SoH
|
||||||
|
run: |
|
||||||
|
unzip -o assets.zip
|
||||||
|
|
||||||
|
cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache
|
||||||
|
cmake --build build-switch --target soh_nro -j3
|
||||||
|
|
||||||
|
mv build-switch/soh/*.nro soh.nro
|
||||||
|
mv README.md readme.txt
|
||||||
|
- name: Upload build
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: soh-switch
|
||||||
|
path: |
|
||||||
|
soh.nro
|
||||||
|
readme.txt
|
||||||
|
build-wiiu:
|
||||||
|
needs: extract-assets
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: devkitpro/devkitppc:latest
|
||||||
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y ninja-build
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: ccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
|
with:
|
||||||
|
key: ${{ runner.os }}-wiiu-ccache
|
||||||
|
- name: Restore assets
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: assets
|
||||||
|
- name: Build SoH
|
||||||
|
run: |
|
||||||
|
unzip -o assets.zip
|
||||||
|
|
||||||
|
cmake -H. -Bbuild-wiiu -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/WiiU.cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache
|
||||||
|
cmake --build build-wiiu --target soh_wuhb --config Release -j3
|
||||||
|
|
||||||
|
mv build-wiiu/soh/*.rpx soh.rpx
|
||||||
|
mv build-wiiu/soh/*.wuhb soh.wuhb
|
||||||
|
mv README.md readme.txt
|
||||||
|
env:
|
||||||
|
DEVKITPRO: /opt/devkitpro
|
||||||
|
DEVKITPPC: /opt/devkitpro/devkitPPC
|
||||||
|
- name: Upload build
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: soh-wiiu
|
||||||
|
path: |
|
||||||
|
soh.rpx
|
||||||
|
soh.wuhb
|
||||||
|
readme.txt
|
||||||
|
build-windows:
|
||||||
|
needs: extract-assets
|
||||||
|
runs-on: [self-hosted, Windows, x64]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Restore assets
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: assets
|
||||||
|
- name: Setup 7-Zip
|
||||||
|
run: |
|
||||||
|
"C:\Program Files\7-Zip" >> $env:GITHUB_PATH
|
||||||
|
- name: Build SoH
|
||||||
|
run: |
|
||||||
|
7z x assets.zip -aoa
|
||||||
|
|
||||||
|
cmake -S . -B build-windows -G "Visual Studio 17 2022" -T v142 -A x64 -DCMAKE_BUILD_TYPE:STRING=Release
|
||||||
|
cmake --build build-windows --target OTRGui --config Release --parallel 10
|
||||||
|
cmake --build build-windows --config Release --parallel 10
|
||||||
|
cd build-windows
|
||||||
|
cpack -G ZIP
|
||||||
|
- name: Upload build
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: soh-windows
|
||||||
|
path: _packages/*.zip
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
exec sudo /usr/local/bin/gtar.orig "$@"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
libsdl2 +universal libpng +universal glew +universal
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
name: pr-artifacts
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: [generate-builds]
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pr-artifacts:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event.workflow_run.event == 'pull_request' }}
|
||||||
|
steps:
|
||||||
|
- id: 'get-info'
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
result-encoding: string
|
||||||
|
script: |
|
||||||
|
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
run_id: context.payload.workflow_run.id,
|
||||||
|
});
|
||||||
|
|
||||||
|
return allArtifacts.data.artifacts.reduce((acc, item) => {
|
||||||
|
if (item.name === "assets") return acc;
|
||||||
|
acc += `
|
||||||
|
- [${item.name}](${context.payload.repository.html_url}/suites/${context.payload.workflow_run.check_suite_id}/artifacts/${item.id})`;
|
||||||
|
return acc;
|
||||||
|
}, '### Build Artifacts');
|
||||||
|
- id: 'add-to-pr'
|
||||||
|
uses: garrettjoecox/pr-section@3.1.0
|
||||||
|
with:
|
||||||
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
|
pr-number: ${{ github.event.workflow_run.pull_requests[0].number }}
|
||||||
|
section-name: 'artifacts'
|
||||||
|
section-value: '${{ steps.get-info.outputs.result }}'
|
||||||
@@ -7,9 +7,9 @@ __pycache__/
|
|||||||
.vscode/
|
.vscode/
|
||||||
.vs/
|
.vs/
|
||||||
.idea/
|
.idea/
|
||||||
CMakeLists.txt
|
|
||||||
cmake-build-debug
|
cmake-build-debug
|
||||||
venv/
|
venv/
|
||||||
|
.cache/
|
||||||
|
|
||||||
# Project-specific ignores
|
# Project-specific ignores
|
||||||
build/
|
build/
|
||||||
@@ -25,6 +25,10 @@ docs/doxygen/
|
|||||||
*.map
|
*.map
|
||||||
*.dump
|
*.dump
|
||||||
out.txt
|
out.txt
|
||||||
|
*.sln
|
||||||
|
*.vcxproj
|
||||||
|
*.vcxproj.user
|
||||||
|
*.vcxproj.filters
|
||||||
|
|
||||||
# Tool artifacts
|
# Tool artifacts
|
||||||
tools/mipspro7.2_compiler/
|
tools/mipspro7.2_compiler/
|
||||||
@@ -49,6 +53,8 @@ graphs/
|
|||||||
!*_custom*
|
!*_custom*
|
||||||
.extracted-assets.json
|
.extracted-assets.json
|
||||||
|
|
||||||
|
!OTRExporter/assets/**/*.png
|
||||||
|
|
||||||
# Docs
|
# Docs
|
||||||
!docs/tutorial/
|
!docs/tutorial/
|
||||||
|
|
||||||
@@ -401,3 +407,44 @@ ZAPD/BuildInfo.h
|
|||||||
|
|
||||||
DebugObj/*
|
DebugObj/*
|
||||||
ReleaseObj/*
|
ReleaseObj/*
|
||||||
|
.tags
|
||||||
|
tags
|
||||||
|
oot.otr
|
||||||
|
oot-mq.otr
|
||||||
|
*.sav
|
||||||
|
shipofharkinian.ini
|
||||||
|
shipofharkinian.json
|
||||||
|
imgui.ini
|
||||||
|
|
||||||
|
# Switch Stuff
|
||||||
|
|
||||||
|
*.nro
|
||||||
|
*.nacp
|
||||||
|
ZAPDTR/ZAPDUtils/lib/*
|
||||||
|
!/soh/icon.jpg
|
||||||
|
|
||||||
|
# Xcode
|
||||||
|
xcuserdata/
|
||||||
|
*.xcconfig
|
||||||
|
*.xcodeproj/*
|
||||||
|
!*.xcodeproj/project.pbxproj
|
||||||
|
!*.xcodeproj/xcshareddata/
|
||||||
|
!*.xcworkspace/contents.xcworkspacedata
|
||||||
|
/*.gcno
|
||||||
|
**/xcshareddata/WorkspaceSettings.xcsettings
|
||||||
|
|
||||||
|
# cmake
|
||||||
|
CMakeLists.txt.user
|
||||||
|
CMakeCache.txt
|
||||||
|
CMakeFiles
|
||||||
|
CMakeScripts
|
||||||
|
Testing
|
||||||
|
Makefile
|
||||||
|
cmake_install.cmake
|
||||||
|
install_manifest.txt
|
||||||
|
compile_commands.json
|
||||||
|
CTestTestfile.cmake
|
||||||
|
_deps
|
||||||
|
*/extract_assets_cmake*
|
||||||
|
/build*
|
||||||
|
build.c
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "libultraship"]
|
||||||
|
path = libultraship
|
||||||
|
url = https://github.com/kenix3/libultraship.git
|
||||||
@@ -2,48 +2,196 @@
|
|||||||
|
|
||||||
## Windows
|
## Windows
|
||||||
|
|
||||||
1. Install [Python](https://www.python.org/downloads/) >= 3.6.
|
Requires:
|
||||||
2. Install [Visual Studio 2022 Community Edition](https://visualstudio.microsoft.com/vs/community/)
|
* At least 8GB of RAM (machines with 4GB have seen complier failures)
|
||||||
3. In the Visual Studio Installer, install `MSVC v142 - VS 2019 C++`.
|
* Visual Studio 2022 Community Edition with the C++ feature set
|
||||||
4. Clone the Ship of Harkinian repository.
|
* One of the Windows SDKs that comes with Visual Studio, for example the current Windows 10 version 10.0.19041.0
|
||||||
5. Place one or more [compatible](#compatible-roms) roms in the `OTRExporter` directory with namings of your choice.
|
* The `MSVC v142 - VS 2019 C++ build tools` component of Visual Studio
|
||||||
6. Run `OTRExporter/OTRExporter.sln`.
|
* Python 3 (can be installed manually or as part of Visual Studio)
|
||||||
7. Switch the solution to `Release x64`.
|
* Git (can be installed manually or as part of Visual Studio)
|
||||||
8. Build the solution.
|
* Cmake (can be installed via chocolatey or manually)
|
||||||
9. Launching `OTRExporter/extract_assets.py` will generate an `oot.otr` archive file in `OTRExporter/oot.otr`.
|
|
||||||
10. Run `soh/soh.sln`
|
During installation, check the "Desktop development with C++" feature set:
|
||||||
11. Switch the solution to `Release x86`.
|
|
||||||
12. Build the solution.
|

|
||||||
13. Copy the `OTRExporter/oot.otr` archive file to `soh/Release`.
|
Doing so should also check one of the Windows SDKs by default. Then, in the installation details in the right-hand column, make sure you also check the v142 toolset.
|
||||||
14. Launch `soh.exe`.
|
|
||||||
|
You can also find the v142 toolset by searching through the individual components tab:
|
||||||
|
|
||||||
|

|
||||||
|
While you're there, you can also install Python 3 and Git if needed.
|
||||||
|
|
||||||
|
1. Clone the Ship of Harkinian repository
|
||||||
|
2. Place one or more [compatible](#compatible-roms) roms in the `OTRExporter` directory with namings of your choice
|
||||||
|
|
||||||
|
_Note: Instructions assume using powershell_
|
||||||
|
```powershell
|
||||||
|
# Navigate to the Shipwright repo within powershell. ie: cd "C:\yourpath\Shipwright"
|
||||||
|
cd Shipwright
|
||||||
|
|
||||||
|
# Setup cmake project
|
||||||
|
& 'C:\Program Files\CMake\bin\cmake' -S . -B "build/x64" -G "Visual Studio 17 2022" -T v142 -A x64 # -DCMAKE_BUILD_TYPE:STRING=Release (if you're packaging)
|
||||||
|
# or for VS2019
|
||||||
|
& 'C:\Program Files\CMake\bin\cmake' -S . -B "build/x64" -G "Visual Studio 16 2019" -T v142 -A x64
|
||||||
|
# Extract assets & generate OTR (run this anytime you need to regenerate OTR)
|
||||||
|
& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 --target ExtractAssets # --config Release (if you're packaging)
|
||||||
|
# Compile project
|
||||||
|
& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 # --config Release (if you're packaging)
|
||||||
|
|
||||||
|
# Now you can run the executable in .\build\x64
|
||||||
|
|
||||||
|
# If you need to clean the project you can run
|
||||||
|
& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 --target clean
|
||||||
|
```
|
||||||
|
|
||||||
|
### Developing SoH
|
||||||
|
With the cmake build system you have two options for working on the project:
|
||||||
|
|
||||||
|
#### Visual Studio
|
||||||
|
To develop using Visual Studio you only need to use cmake to generate the solution file:
|
||||||
|
```powershell
|
||||||
|
# Generates Ship.sln at `build/x64` for Visual Studio 2022
|
||||||
|
& 'C:\Program Files\CMake\bin\cmake' -S . -B "build/x64" -G "Visual Studio 17 2022" -T v142 -A x64
|
||||||
|
# or for Visual Studio 2019
|
||||||
|
& 'C:\Program Files\CMake\bin\cmake' -S . -B "build/x64" -G "Visual Studio 16 2019" -T v142 -A x64
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Visual Studio Code or another editor
|
||||||
|
To develop using Visual Studio Code or another editor you only need to open the repository in it.
|
||||||
|
To build you'll need to follow the instructions from the building section.
|
||||||
|
|
||||||
|
_Note: If you're using Visual Studio Code, the [cpack plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) makes it very easy to just press run and debug._
|
||||||
|
|
||||||
|
_Experimental: You can also use another build system entirely rather than MSVC like [Ninja](https://ninja-build.org/) for possibly better performance._
|
||||||
|
|
||||||
|
|
||||||
|
### Generating the distributable
|
||||||
|
After compiling the project you can generate the distributable by running:
|
||||||
|
```powershell
|
||||||
|
# Go to build folder
|
||||||
|
cd "build/x64"
|
||||||
|
# Generate
|
||||||
|
& 'C:\Program Files\CMake\bin\cpack.exe' -G ZIP
|
||||||
|
```
|
||||||
|
|
||||||
## Linux
|
## Linux
|
||||||
|
Requires `gcc >= 10, x11, curl, python3, sdl2 >= 2.0.22, libpng, glew >= 2.2, ninja, cmake, lld`
|
||||||
|
|
||||||
|
**Important: For maximum performance make sure you have ninja build tools installed!**
|
||||||
|
|
||||||
|
_Note: If you're using Visual Studio Code, the [cpack plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) makes it very easy to just press run and debug._
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Clone the repo
|
# Clone the repo
|
||||||
git clone git@github.com:HarbourMasters/ShipWright.git
|
git clone https://github.com/HarbourMasters/Shipwright.git
|
||||||
|
cd Shipwright
|
||||||
|
# Copy the baserom to the OTRExporter folder
|
||||||
|
cp <path to your ROM> OTRExporter
|
||||||
|
# Generate Ninja project
|
||||||
|
cmake -H. -Bbuild-cmake -GNinja # -DCMAKE_BUILD_TYPE:STRING=Release (if you're packaging)
|
||||||
|
# Extract assets & generate OTR (run this anytime you need to regenerate OTR)
|
||||||
|
cmake --build build-cmake --target ExtractAssets
|
||||||
|
# Compile the project
|
||||||
|
cmake --build build-cmake # --config Release (if you're packaging)
|
||||||
|
|
||||||
|
# Now you can run the executable in ./build-cmake/soh/soh.elf
|
||||||
|
# To develop the project open the repository in VSCode (or your preferred editor)
|
||||||
|
|
||||||
|
# If you need to clean the project you can run
|
||||||
|
cmake --build build-cmake --target clean
|
||||||
|
```
|
||||||
|
|
||||||
|
### Generating a distributable
|
||||||
|
After compiling the project you can generate a distributable by running of the following:
|
||||||
|
```bash
|
||||||
|
# Go to build folder
|
||||||
|
cd build-cmake
|
||||||
|
# Generate
|
||||||
|
cpack -G DEB
|
||||||
|
cpack -G ZIP
|
||||||
|
cpack -G External (creates appimage)
|
||||||
|
```
|
||||||
|
|
||||||
|
## macOS
|
||||||
|
Requires Xcode (or xcode-tools) && `sdl2, libpng, glew, ninja, cmake` (can be installed via homebrew, macports, etc)
|
||||||
|
|
||||||
|
**Important: For maximum performance make sure you have ninja build tools installed!**
|
||||||
|
|
||||||
|
_Note: If you're using Visual Studio Code, the [cpack plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) makes it very easy to just press run and debug._
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Clone the repo
|
||||||
|
git clone https://github.com/HarbourMasters/Shipwright.git
|
||||||
cd ShipWright
|
cd ShipWright
|
||||||
# Copy the baserom to the OTRExporter folder
|
# Copy the baserom to the OTRExporter folder
|
||||||
cp <path to your ROM> OTRExporter
|
cp <path to your ROM> OTRExporter
|
||||||
# Build the docker image
|
# Generate Ninja project
|
||||||
sudo docker build . -t soh
|
cmake -H. -Bbuild-cmake -GNinja # -DCMAKE_BUILD_TYPE:STRING=Release (if you're packaging)
|
||||||
# Run the docker image with the working directory mounted to /soh
|
# Extract assets & generate OTR (run this anytime you need to regenerate OTR)
|
||||||
sudo docker run --rm -it -v $(pwd):/soh soh /bin/bash
|
cmake --build build-cmake --target ExtractAssets
|
||||||
```
|
# Compile the project
|
||||||
Inside the Docker container:
|
cmake --build build-cmake # --config Release (if you're packaging)
|
||||||
```bash
|
|
||||||
# Clone and build StormLib
|
|
||||||
git clone https://github.com/ladislav-zezula/StormLib external/StormLib
|
|
||||||
cmake -B external/StormLib/build -S external/StormLib
|
|
||||||
cmake --build external/StormLib/build
|
|
||||||
cp external/StormLib/build/libstorm.a external
|
|
||||||
cp /usr/local/lib/libGLEW.a external
|
|
||||||
|
|
||||||
cd soh
|
# Copy oot.otr into the Application Support directory
|
||||||
# Extract the assets/Compile the exporter/Run the exporter
|
cp build-cmake/soh/oot.otr ~/Library/Application\ Support/com.shipofharkinian.soh/
|
||||||
make setup -j$(nproc) OPTFLAGS=-O0 DEBUG=0
|
|
||||||
# Compile the code
|
# Now you can run the executable file:
|
||||||
make -j $(nproc) OPTFLAGS=-O0 DEBUG=0
|
./build-cmake/soh/soh-macos
|
||||||
|
# To develop the project open the repository in VSCode (or your preferred editor)
|
||||||
|
|
||||||
|
# If you need to clean the project you can run
|
||||||
|
cmake --build build-cmake --target clean
|
||||||
|
```
|
||||||
|
|
||||||
|
### Generating a distributable
|
||||||
|
After compiling the project you can generate a distributable by running of the following:
|
||||||
|
```bash
|
||||||
|
# Go to build folder
|
||||||
|
cd build-cmake
|
||||||
|
# Generate
|
||||||
|
cpack
|
||||||
|
```
|
||||||
|
|
||||||
|
## Switch
|
||||||
|
1. Requires that your build machine is setup with the tools necessary for your platform above
|
||||||
|
2. Requires that you have the switch build tools installed
|
||||||
|
3. Clone the Ship of Harkinian repository
|
||||||
|
4. Place one or more [compatible](#compatible-roms) roms in the `OTRExporter` directory with namings of your choice
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd Shipwright
|
||||||
|
# Setup cmake project for your host machine
|
||||||
|
cmake -H. -Bbuild-cmake -GNinja
|
||||||
|
# Extract assets & generate OTR (run this anytime you need to regenerate OTR)
|
||||||
|
cmake --build build-cmake --target ExtractAssets
|
||||||
|
# Setup cmake project for building for Switch
|
||||||
|
cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake
|
||||||
|
# Build project and generate nro
|
||||||
|
cmake --build build-switch --target soh_nro
|
||||||
|
|
||||||
|
# Now you can run the executable in ./build-switch/soh/soh.nro
|
||||||
|
# To develop the project open the repository in VSCode (or your preferred editor)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Wii U
|
||||||
|
1. Requires that your build machine is setup with the tools necessary for your platform above
|
||||||
|
2. Requires that you have the Wii U build tools installed
|
||||||
|
3. Clone the Ship of Harkinian repository
|
||||||
|
4. Place one or more [compatible](#compatible-roms) roms in the `OTRExporter` directory with namings of your choice
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd Shipwright
|
||||||
|
# Setup cmake project for your host machine
|
||||||
|
cmake -H. -Bbuild-cmake -GNinja
|
||||||
|
# Extract assets & generate OTR (run this anytime you need to regenerate OTR)
|
||||||
|
cmake --build build-cmake --target ExtractAssets
|
||||||
|
# Setup cmake project for building for Wii U
|
||||||
|
cmake -H. -Bbuild-wiiu -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/WiiU.cmake # -DCMAKE_BUILD_TYPE:STRING=Release (if you're packaging)
|
||||||
|
# Build project and generate rpx
|
||||||
|
cmake --build build-wiiu --target soh # --target soh_wuhb (for building .wuhb)
|
||||||
|
|
||||||
|
# Now you can run the executable in ./build-wiiu/soh/soh.rpx or the Wii U Homebrew Bundle in ./build-wiiu/soh/soh.wuhb
|
||||||
|
# To develop the project open the repository in VSCode (or your preferred editor)
|
||||||
```
|
```
|
||||||
|
|
||||||
# Compatible Roms
|
# Compatible Roms
|
||||||
@@ -57,10 +205,9 @@ OOT_PAL_GC_DBG1 checksum 0x871E1C92 (debug non-master quest)
|
|||||||
The OTRExporter exports an `oot.otr` archive file which Ship of Harkinian requires to play.
|
The OTRExporter exports an `oot.otr` archive file which Ship of Harkinian requires to play.
|
||||||
|
|
||||||
Use the `extract_assets.py` script file to run the exporter using any of the following methods:
|
Use the `extract_assets.py` script file to run the exporter using any of the following methods:
|
||||||
|
1) Double click on the script after placing one or more roms in the directory.
|
||||||
1. Double click on the script after placing one or more roms in the directory.
|
2) Drag & Drop a rom onto the script.
|
||||||
2. Drag & Drop a rom onto the script.
|
3) In a terminal run `python3 extract_assets.py` after placing one or more roms in the directory.
|
||||||
3. In a terminal run `python3 extract_assets.py` after placing one or more roms in the directory.
|
4) In a terminal run `python3 extract_assets.py <path_to_rom>`
|
||||||
4. In a terminal run `python3 extract_assets.py <path_to_rom>`
|
|
||||||
|
|
||||||
If the script finds multiple roms the user is prompted which to use. Selection is done using the number keys and then pressing the carriage return key.
|
If the script finds multiple roms the user is prompted which to use. Selection is done using the number keys and then pressing the carriage return key.
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
################################################################################
|
||||||
|
# Command for variable_watch. This command issues error message, if a variable
|
||||||
|
# is changed. If variable PROPERTY_READER_GUARD_DISABLED is TRUE nothing happens
|
||||||
|
# variable_watch(<variable> property_reader_guard)
|
||||||
|
################################################################################
|
||||||
|
function(property_reader_guard VARIABLE ACCESS VALUE CURRENT_LIST_FILE STACK)
|
||||||
|
if("${PROPERTY_READER_GUARD_DISABLED}")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if("${ACCESS}" STREQUAL "MODIFIED_ACCESS")
|
||||||
|
message(FATAL_ERROR
|
||||||
|
" Variable ${VARIABLE} is not supposed to be changed.\n"
|
||||||
|
" It is used only for reading target property ${VARIABLE}.\n"
|
||||||
|
" Use\n"
|
||||||
|
" set_target_properties(\"<target>\" PROPERTIES \"${VARIABLE}\" \"<value>\")\n"
|
||||||
|
" or\n"
|
||||||
|
" set_target_properties(\"<target>\" PROPERTIES \"${VARIABLE}_<CONFIG>\" \"<value>\")\n"
|
||||||
|
" instead.\n")
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Create variable <name> with generator expression that expands to value of
|
||||||
|
# target property <name>_<CONFIG>. If property is empty or not set then property
|
||||||
|
# <name> is used instead. Variable <name> has watcher property_reader_guard that
|
||||||
|
# doesn't allow to edit it.
|
||||||
|
# create_property_reader(<name>)
|
||||||
|
# Input:
|
||||||
|
# name - Name of watched property and output variable
|
||||||
|
################################################################################
|
||||||
|
function(create_property_reader NAME)
|
||||||
|
set(PROPERTY_READER_GUARD_DISABLED TRUE)
|
||||||
|
set(CONFIG_VALUE "$<TARGET_GENEX_EVAL:${PROPS_TARGET},$<TARGET_PROPERTY:${PROPS_TARGET},${NAME}_$<UPPER_CASE:$<CONFIG>>>>")
|
||||||
|
set(IS_CONFIG_VALUE_EMPTY "$<STREQUAL:${CONFIG_VALUE},>")
|
||||||
|
set(GENERAL_VALUE "$<TARGET_GENEX_EVAL:${PROPS_TARGET},$<TARGET_PROPERTY:${PROPS_TARGET},${NAME}>>")
|
||||||
|
set("${NAME}" "$<IF:${IS_CONFIG_VALUE_EMPTY},${GENERAL_VALUE},${CONFIG_VALUE}>" PARENT_SCOPE)
|
||||||
|
variable_watch("${NAME}" property_reader_guard)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Set property $<name>_${PROPS_CONFIG_U} of ${PROPS_TARGET} to <value>
|
||||||
|
# set_config_specific_property(<name> <value>)
|
||||||
|
# Input:
|
||||||
|
# name - Prefix of property name
|
||||||
|
# value - New value
|
||||||
|
################################################################################
|
||||||
|
function(set_config_specific_property NAME VALUE)
|
||||||
|
set_target_properties("${PROPS_TARGET}" PROPERTIES "${NAME}_${PROPS_CONFIG_U}" "${VALUE}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
create_property_reader("TARGET_NAME")
|
||||||
|
create_property_reader("OUTPUT_DIRECTORY")
|
||||||
|
|
||||||
|
set_config_specific_property("TARGET_NAME" "${PROPS_TARGET}")
|
||||||
|
set_config_specific_property("OUTPUT_NAME" "${TARGET_NAME}")
|
||||||
|
set_config_specific_property("ARCHIVE_OUTPUT_NAME" "${TARGET_NAME}")
|
||||||
|
set_config_specific_property("LIBRARY_OUTPUT_NAME" "${TARGET_NAME}")
|
||||||
|
set_config_specific_property("RUNTIME_OUTPUT_NAME" "${TARGET_NAME}")
|
||||||
|
|
||||||
|
set_config_specific_property("ARCHIVE_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}")
|
||||||
|
set_config_specific_property("LIBRARY_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}")
|
||||||
|
set_config_specific_property("RUNTIME_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}")
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/Default.cmake")
|
||||||
|
|
||||||
|
set_config_specific_property("OUTPUT_DIRECTORY" "${CMAKE_SOURCE_DIR}$<$<NOT:$<STREQUAL:${CMAKE_VS_PLATFORM_NAME},Win32>>:/${CMAKE_VS_PLATFORM_NAME}>/${PROPS_CONFIG}")
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
create_property_reader("DEFAULT_CXX_EXCEPTION_HANDLING")
|
||||||
|
create_property_reader("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT")
|
||||||
|
|
||||||
|
set_target_properties("${PROPS_TARGET}" PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
||||||
|
set_config_specific_property("DEFAULT_CXX_EXCEPTION_HANDLING" "/EHsc")
|
||||||
|
set_config_specific_property("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT" "/Zi")
|
||||||
|
endif()
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
|
||||||
|
set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY 0)
|
||||||
|
set(CPACK_COMPONENTS_ALL "ship" "appimage")
|
||||||
|
|
||||||
|
if (NOT CPACK_GENERATOR STREQUAL "External")
|
||||||
|
list(REMOVE_ITEM CPACK_COMPONENTS_ALL "appimage")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CPACK_GENERATOR MATCHES "DEB|RPM")
|
||||||
|
# https://unix.stackexchange.com/a/11552/254512
|
||||||
|
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/ship/bin")#/${CMAKE_PROJECT_VERSION}")
|
||||||
|
set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY 0)
|
||||||
|
elseif (CPACK_GENERATOR MATCHES "ZIP")
|
||||||
|
set(CPACK_PACKAGING_INSTALL_PREFIX "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CPACK_GENERATOR MATCHES "External")
|
||||||
|
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
|
||||||
|
SET(CPACK_MONOLITHIC_INSTALL 1)
|
||||||
|
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/bin")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CPACK_GENERATOR MATCHES "Bundle")
|
||||||
|
set(CPACK_BUNDLE_NAME "soh")
|
||||||
|
set(CPACK_BUNDLE_PLIST "macosx/Info.plist")
|
||||||
|
set(CPACK_BUNDLE_ICON "macosx/soh.icns")
|
||||||
|
set(CPACK_BUNDLE_STARTUP_COMMAND "../soh/macosx/soh-macos.sh")
|
||||||
|
set(CPACK_BUNDLE_APPLE_CERT_APP "-")
|
||||||
|
endif()
|
||||||
|
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
# these are cache variables, so they could be overwritten with -D,
|
||||||
|
|
||||||
|
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}"
|
||||||
|
CACHE STRING "The resulting package name"
|
||||||
|
)
|
||||||
|
|
||||||
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Simple C++ application"
|
||||||
|
CACHE STRING "Package description for the package metadata"
|
||||||
|
)
|
||||||
|
set(CPACK_PACKAGE_VENDOR "Some Company")
|
||||||
|
|
||||||
|
set(CPACK_VERBATIM_VARIABLES YES)
|
||||||
|
|
||||||
|
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
|
||||||
|
SET(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_SOURCE_DIR}/_packages")
|
||||||
|
|
||||||
|
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
|
||||||
|
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
|
||||||
|
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
|
||||||
|
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
|
||||||
|
|
||||||
|
set(CPACK_PACKAGE_CONTACT "YOUR@E-MAIL.net")
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "YOUR NAME")
|
||||||
|
|
||||||
|
#set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
|
||||||
|
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
|
||||||
|
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
set(CPACK_SYSTEM_NAME ${LSB_RELEASE_CODENAME_SHORT})
|
||||||
|
# package name for deb
|
||||||
|
# if set, then instead of some-application-0.9.2-Linux.deb
|
||||||
|
# you'll get some-application_0.9.2_amd64.deb (note the underscores too)
|
||||||
|
#set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
|
||||||
|
execute_process(COMMAND dpkg --print-architecture OUTPUT_VARIABLE ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
set( CPACK_DEBIAN_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}-${ARCHITECTURE}.deb )
|
||||||
|
# if you want every group to have its own package,
|
||||||
|
# although the same happens if this is not sent (so it defaults to ONE_PER_GROUP)
|
||||||
|
# and CPACK_DEB_COMPONENT_INSTALL is set to YES
|
||||||
|
set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE)#ONE_PER_GROUP)
|
||||||
|
# without this you won't be able to pack only specified component
|
||||||
|
set(CPACK_DEB_COMPONENT_INSTALL YES)
|
||||||
|
|
||||||
|
set(CPACK_EXTERNAL_ENABLE_STAGING YES)
|
||||||
|
set(CPACK_EXTERNAL_PACKAGE_SCRIPT "${PROJECT_BINARY_DIR}/appimage-generate.cmake")
|
||||||
|
|
||||||
|
file(GENERATE
|
||||||
|
OUTPUT "${PROJECT_BINARY_DIR}/appimage-generate.cmake"
|
||||||
|
CONTENT [[
|
||||||
|
include(CMakePrintHelpers)
|
||||||
|
cmake_print_variables(CPACK_TEMPORARY_DIRECTORY)
|
||||||
|
cmake_print_variables(CPACK_TOPLEVEL_DIRECTORY)
|
||||||
|
cmake_print_variables(CPACK_PACKAGE_DIRECTORY)
|
||||||
|
cmake_print_variables(CPACK_PACKAGE_FILE_NAME)
|
||||||
|
|
||||||
|
find_program(LINUXDEPLOY_EXECUTABLE
|
||||||
|
NAMES linuxdeploy linuxdeploy-x86_64.AppImage
|
||||||
|
PATHS ${CPACK_PACKAGE_DIRECTORY}/linuxdeploy)
|
||||||
|
|
||||||
|
if (NOT LINUXDEPLOY_EXECUTABLE)
|
||||||
|
message(STATUS "Downloading linuxdeploy")
|
||||||
|
set(LINUXDEPLOY_EXECUTABLE ${CPACK_PACKAGE_DIRECTORY}/linuxdeploy/linuxdeploy)
|
||||||
|
file(DOWNLOAD
|
||||||
|
https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
||||||
|
${LINUXDEPLOY_EXECUTABLE}
|
||||||
|
INACTIVITY_TIMEOUT 10
|
||||||
|
LOG ${CPACK_PACKAGE_DIRECTORY}/linuxdeploy/download.log
|
||||||
|
STATUS LINUXDEPLOY_DOWNLOAD)
|
||||||
|
execute_process(COMMAND chmod +x ${LINUXDEPLOY_EXECUTABLE} COMMAND_ECHO STDOUT)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND
|
||||||
|
${CMAKE_COMMAND} -E env
|
||||||
|
OUTPUT=${CPACK_PACKAGE_FILE_NAME}.appimage
|
||||||
|
VERSION=$<IF:$<BOOL:${CPACK_PACKAGE_VERSION}>,${CPACK_PACKAGE_VERSION},0.1.0>
|
||||||
|
${LINUXDEPLOY_EXECUTABLE}
|
||||||
|
--appimage-extract-and-run
|
||||||
|
--appdir=${CPACK_TEMPORARY_DIRECTORY}
|
||||||
|
--executable=$<TARGET_FILE:soh>
|
||||||
|
$<$<BOOL:$<TARGET_PROPERTY:soh,APPIMAGE_DESKTOP_FILE>>:--desktop-file=$<TARGET_PROPERTY:soh,APPIMAGE_DESKTOP_FILE>>
|
||||||
|
$<$<BOOL:$<TARGET_PROPERTY:soh,APPIMAGE_ICON_FILE>>:--icon-file=$<TARGET_PROPERTY:soh,APPIMAGE_ICON_FILE>>
|
||||||
|
--output=appimage
|
||||||
|
# --verbosity=2
|
||||||
|
)
|
||||||
|
]])
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(CPack)
|
||||||
|
|
||||||
@@ -0,0 +1,248 @@
|
|||||||
|
# utils file for projects came from visual studio solution with cmake-converter.
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Wrap each token of the command with condition
|
||||||
|
################################################################################
|
||||||
|
cmake_policy(PUSH)
|
||||||
|
cmake_policy(SET CMP0054 NEW)
|
||||||
|
macro(prepare_commands)
|
||||||
|
unset(TOKEN_ROLE)
|
||||||
|
unset(COMMANDS)
|
||||||
|
foreach(TOKEN ${ARG_COMMANDS})
|
||||||
|
if("${TOKEN}" STREQUAL "COMMAND")
|
||||||
|
set(TOKEN_ROLE "KEYWORD")
|
||||||
|
elseif("${TOKEN_ROLE}" STREQUAL "KEYWORD")
|
||||||
|
set(TOKEN_ROLE "CONDITION")
|
||||||
|
elseif("${TOKEN_ROLE}" STREQUAL "CONDITION")
|
||||||
|
set(TOKEN_ROLE "COMMAND")
|
||||||
|
elseif("${TOKEN_ROLE}" STREQUAL "COMMAND")
|
||||||
|
set(TOKEN_ROLE "ARG")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if("${TOKEN_ROLE}" STREQUAL "KEYWORD")
|
||||||
|
list(APPEND COMMANDS "${TOKEN}")
|
||||||
|
elseif("${TOKEN_ROLE}" STREQUAL "CONDITION")
|
||||||
|
set(CONDITION ${TOKEN})
|
||||||
|
elseif("${TOKEN_ROLE}" STREQUAL "COMMAND")
|
||||||
|
list(APPEND COMMANDS "$<$<NOT:${CONDITION}>:${DUMMY}>$<${CONDITION}:${TOKEN}>")
|
||||||
|
elseif("${TOKEN_ROLE}" STREQUAL "ARG")
|
||||||
|
list(APPEND COMMANDS "$<${CONDITION}:${TOKEN}>")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endmacro()
|
||||||
|
cmake_policy(POP)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Transform all the tokens to absolute paths
|
||||||
|
################################################################################
|
||||||
|
macro(prepare_output)
|
||||||
|
unset(OUTPUT)
|
||||||
|
foreach(TOKEN ${ARG_OUTPUT})
|
||||||
|
if(IS_ABSOLUTE ${TOKEN})
|
||||||
|
list(APPEND OUTPUT "${TOKEN}")
|
||||||
|
else()
|
||||||
|
list(APPEND OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/${TOKEN}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Parse add_custom_command_if args.
|
||||||
|
#
|
||||||
|
# Input:
|
||||||
|
# PRE_BUILD - Pre build event option
|
||||||
|
# PRE_LINK - Pre link event option
|
||||||
|
# POST_BUILD - Post build event option
|
||||||
|
# TARGET - Target
|
||||||
|
# OUTPUT - List of output files
|
||||||
|
# DEPENDS - List of files on which the command depends
|
||||||
|
# COMMANDS - List of commands(COMMAND condition1 commannd1 args1 COMMAND
|
||||||
|
# condition2 commannd2 args2 ...)
|
||||||
|
# Output:
|
||||||
|
# OUTPUT - Output files
|
||||||
|
# DEPENDS - Files on which the command depends
|
||||||
|
# COMMENT - Comment
|
||||||
|
# PRE_BUILD - TRUE/FALSE
|
||||||
|
# PRE_LINK - TRUE/FALSE
|
||||||
|
# POST_BUILD - TRUE/FALSE
|
||||||
|
# TARGET - Target name
|
||||||
|
# COMMANDS - Prepared commands(every token is wrapped in CONDITION)
|
||||||
|
# NAME - Unique name for custom target
|
||||||
|
# STEP - PRE_BUILD/PRE_LINK/POST_BUILD
|
||||||
|
################################################################################
|
||||||
|
function(add_custom_command_if_parse_arguments)
|
||||||
|
cmake_parse_arguments("ARG" "PRE_BUILD;PRE_LINK;POST_BUILD" "TARGET;COMMENT" "DEPENDS;OUTPUT;COMMANDS" ${ARGN})
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set(DUMMY "cd.")
|
||||||
|
elseif(UNIX)
|
||||||
|
set(DUMMY "true")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
prepare_commands()
|
||||||
|
prepare_output()
|
||||||
|
|
||||||
|
set(DEPENDS "${ARG_DEPENDS}")
|
||||||
|
set(COMMENT "${ARG_COMMENT}")
|
||||||
|
set(PRE_BUILD "${ARG_PRE_BUILD}")
|
||||||
|
set(PRE_LINK "${ARG_PRE_LINK}")
|
||||||
|
set(POST_BUILD "${ARG_POST_BUILD}")
|
||||||
|
set(TARGET "${ARG_TARGET}")
|
||||||
|
if(PRE_BUILD)
|
||||||
|
set(STEP "PRE_BUILD")
|
||||||
|
elseif(PRE_LINK)
|
||||||
|
set(STEP "PRE_LINK")
|
||||||
|
elseif(POST_BUILD)
|
||||||
|
set(STEP "POST_BUILD")
|
||||||
|
endif()
|
||||||
|
set(NAME "${TARGET}_${STEP}")
|
||||||
|
|
||||||
|
set(OUTPUT "${OUTPUT}" PARENT_SCOPE)
|
||||||
|
set(DEPENDS "${DEPENDS}" PARENT_SCOPE)
|
||||||
|
set(COMMENT "${COMMENT}" PARENT_SCOPE)
|
||||||
|
set(PRE_BUILD "${PRE_BUILD}" PARENT_SCOPE)
|
||||||
|
set(PRE_LINK "${PRE_LINK}" PARENT_SCOPE)
|
||||||
|
set(POST_BUILD "${POST_BUILD}" PARENT_SCOPE)
|
||||||
|
set(TARGET "${TARGET}" PARENT_SCOPE)
|
||||||
|
set(COMMANDS "${COMMANDS}" PARENT_SCOPE)
|
||||||
|
set(STEP "${STEP}" PARENT_SCOPE)
|
||||||
|
set(NAME "${NAME}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Add conditional custom command
|
||||||
|
#
|
||||||
|
# Generating Files
|
||||||
|
# The first signature is for adding a custom command to produce an output:
|
||||||
|
# add_custom_command_if(
|
||||||
|
# <OUTPUT output1 [output2 ...]>
|
||||||
|
# <COMMANDS>
|
||||||
|
# <COMMAND condition command1 [args1...]>
|
||||||
|
# [COMMAND condition command2 [args2...]]
|
||||||
|
# [DEPENDS [depends...]]
|
||||||
|
# [COMMENT comment]
|
||||||
|
#
|
||||||
|
# Build Events
|
||||||
|
# add_custom_command_if(
|
||||||
|
# <TARGET target>
|
||||||
|
# <PRE_BUILD | PRE_LINK | POST_BUILD>
|
||||||
|
# <COMMAND condition command1 [args1...]>
|
||||||
|
# [COMMAND condition command2 [args2...]]
|
||||||
|
# [COMMENT comment]
|
||||||
|
#
|
||||||
|
# Input:
|
||||||
|
# output - Output files the command is expected to produce
|
||||||
|
# condition - Generator expression for wrapping the command
|
||||||
|
# command - Command-line(s) to execute at build time.
|
||||||
|
# args - Command`s args
|
||||||
|
# depends - Files on which the command depends
|
||||||
|
# comment - Display the given message before the commands are executed at
|
||||||
|
# build time.
|
||||||
|
# PRE_BUILD - Run before any other rules are executed within the target
|
||||||
|
# PRE_LINK - Run after sources have been compiled but before linking the
|
||||||
|
# binary
|
||||||
|
# POST_BUILD - Run after all other rules within the target have been
|
||||||
|
# executed
|
||||||
|
################################################################################
|
||||||
|
function(add_custom_command_if)
|
||||||
|
add_custom_command_if_parse_arguments(${ARGN})
|
||||||
|
|
||||||
|
if(OUTPUT AND TARGET)
|
||||||
|
message(FATAL_ERROR "Wrong syntax. A TARGET and OUTPUT can not both be specified.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(OUTPUT)
|
||||||
|
add_custom_command(OUTPUT ${OUTPUT}
|
||||||
|
${COMMANDS}
|
||||||
|
DEPENDS ${DEPENDS}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
COMMENT ${COMMENT})
|
||||||
|
elseif(TARGET)
|
||||||
|
if(PRE_BUILD AND NOT ${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
||||||
|
add_custom_target(
|
||||||
|
${NAME}
|
||||||
|
${COMMANDS}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
COMMENT ${COMMENT})
|
||||||
|
add_dependencies(${TARGET} ${NAME})
|
||||||
|
else()
|
||||||
|
add_custom_command(
|
||||||
|
TARGET ${TARGET}
|
||||||
|
${STEP}
|
||||||
|
${COMMANDS}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
COMMENT ${COMMENT})
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Wrong syntax. A TARGET or OUTPUT must be specified.")
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Use props file for a target and configs
|
||||||
|
# use_props(<target> <configs...> <props_file>)
|
||||||
|
# Inside <props_file> there are following variables:
|
||||||
|
# PROPS_TARGET - <target>
|
||||||
|
# PROPS_CONFIG - One of <configs...>
|
||||||
|
# PROPS_CONFIG_U - Uppercase PROPS_CONFIG
|
||||||
|
# Input:
|
||||||
|
# target - Target to apply props file
|
||||||
|
# configs - Build configurations to apply props file
|
||||||
|
# props_file - CMake script
|
||||||
|
################################################################################
|
||||||
|
macro(use_props TARGET CONFIGS PROPS_FILE)
|
||||||
|
set(PROPS_TARGET "${TARGET}")
|
||||||
|
foreach(PROPS_CONFIG ${CONFIGS})
|
||||||
|
string(TOUPPER "${PROPS_CONFIG}" PROPS_CONFIG_U)
|
||||||
|
|
||||||
|
get_filename_component(ABSOLUTE_PROPS_FILE "${PROPS_FILE}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
|
||||||
|
if(EXISTS "${ABSOLUTE_PROPS_FILE}")
|
||||||
|
include("${ABSOLUTE_PROPS_FILE}")
|
||||||
|
else()
|
||||||
|
message(WARNING "Corresponding cmake file from props \"${ABSOLUTE_PROPS_FILE}\" doesn't exist")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Add compile options to source file
|
||||||
|
# source_file_compile_options(<source_file> [compile_options...])
|
||||||
|
# Input:
|
||||||
|
# source_file - Source file
|
||||||
|
# compile_options - Options to add to COMPILE_FLAGS property
|
||||||
|
################################################################################
|
||||||
|
function(source_file_compile_options SOURCE_FILE)
|
||||||
|
if("${ARGC}" LESS_EQUAL "1")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
get_source_file_property(COMPILE_OPTIONS "${SOURCE_FILE}" COMPILE_OPTIONS)
|
||||||
|
|
||||||
|
if(COMPILE_OPTIONS)
|
||||||
|
list(APPEND COMPILE_OPTIONS ${ARGN})
|
||||||
|
else()
|
||||||
|
set(COMPILE_OPTIONS "${ARGN}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set_source_files_properties("${SOURCE_FILE}" PROPERTIES COMPILE_OPTIONS "${COMPILE_OPTIONS}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Default properties of visual studio projects
|
||||||
|
################################################################################
|
||||||
|
set(DEFAULT_CXX_PROPS "${CMAKE_CURRENT_LIST_DIR}/DefaultCXX.cmake")
|
||||||
|
|
||||||
|
function(get_linux_lsb_release_information)
|
||||||
|
find_program(LSB_RELEASE_EXEC lsb_release)
|
||||||
|
if(NOT LSB_RELEASE_EXEC)
|
||||||
|
message(FATAL_ERROR "Could not detect lsb_release executable, can not gather required information")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(COMMAND "${LSB_RELEASE_EXEC}" --short --id OUTPUT_VARIABLE LSB_RELEASE_ID_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
execute_process(COMMAND "${LSB_RELEASE_EXEC}" --short --release OUTPUT_VARIABLE LSB_RELEASE_VERSION_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
execute_process(COMMAND "${LSB_RELEASE_EXEC}" --short --codename OUTPUT_VARIABLE LSB_RELEASE_CODENAME_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
set(LSB_RELEASE_ID_SHORT "${LSB_RELEASE_ID_SHORT}" PARENT_SCOPE)
|
||||||
|
set(LSB_RELEASE_VERSION_SHORT "${LSB_RELEASE_VERSION_SHORT}" PARENT_SCOPE)
|
||||||
|
set(LSB_RELEASE_CODENAME_SHORT "${LSB_RELEASE_CODENAME_SHORT}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
@@ -0,0 +1,191 @@
|
|||||||
|
#------------------------------------------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Automate-VCPKG by Andre Taulien
|
||||||
|
# ===============================
|
||||||
|
#
|
||||||
|
# Project Repository: https://github.com/REGoth-project/Automate-VCPKG
|
||||||
|
# License ..........: MIT, see end of file.
|
||||||
|
#
|
||||||
|
# Based on: https://github.com/sutambe/cpptruths/blob/vcpkg_cmake_blog/cpp0x/vcpkg_test/CMakeLists.txt
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# While [Vcpkg](https://github.com/microsoft/vcpkg) on it's own is awesome, it does add
|
||||||
|
# a little bit of complexity to getting a project to build. Even more if the one trying
|
||||||
|
# to compile your application is not too fond of the commandline. Additionally, CMake
|
||||||
|
# commands tend to get rather long with the toolchain path.
|
||||||
|
#
|
||||||
|
# To keep things simple for new users who just want to get the project to build, this
|
||||||
|
# script offers a solution.
|
||||||
|
#
|
||||||
|
# Lets assume your main `CMakelists.txt` looks something like this:
|
||||||
|
#
|
||||||
|
# cmake_minimum_required (VERSION 3.12.0)
|
||||||
|
# project (MyProject)
|
||||||
|
#
|
||||||
|
# add_executable(MyExecutable main.c)
|
||||||
|
#
|
||||||
|
# To integrate Vcpkg into that `CMakelists.txt`, simple put the following lines before the
|
||||||
|
# call to `project(MyProject)`:
|
||||||
|
#
|
||||||
|
# include(cmake/automate-vcpkg.cmake)
|
||||||
|
#
|
||||||
|
# vcpkg_bootstrap()
|
||||||
|
# vcpkg_install_packages(libsquish physfs)
|
||||||
|
#
|
||||||
|
# The call to `vcpkg_bootstrap()` will clone the official Vcpkg repository and bootstrap it.
|
||||||
|
# If it detected an existing environment variable defining a valid `VCPKG_ROOT`, it will
|
||||||
|
# update the existing installation of Vcpkg.
|
||||||
|
#
|
||||||
|
# Arguments to `vcpkg_install_packages()` are the packages you want to install using Vcpkg.
|
||||||
|
#
|
||||||
|
# If you want to keep the possibility for users to chose their own copy of Vcpkg, you can
|
||||||
|
# simply not run the code snippet mentioned above, something like this will work:
|
||||||
|
#
|
||||||
|
# option(SKIP_AUTOMATE_VCPKG "When ON, you will need to built the packages
|
||||||
|
# required by MyProject on your own or supply your own vcpkg toolchain.")
|
||||||
|
#
|
||||||
|
# if (NOT SKIP_AUTOMATE_VCPKG)
|
||||||
|
# include(cmake/automate-vcpkg.cmake)
|
||||||
|
#
|
||||||
|
# vcpkg_bootstrap()
|
||||||
|
# vcpkg_install_packages(libsquish physfs)
|
||||||
|
# endif()
|
||||||
|
#
|
||||||
|
# Then, the user has to supply the packages on their own, be it through Vcpkg or manually
|
||||||
|
# specifying their locations.
|
||||||
|
#------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
cmake_minimum_required (VERSION 3.12)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set(VCPKG_FALLBACK_ROOT ${CMAKE_CURRENT_BINARY_DIR}/vcpkg CACHE STRING "vcpkg configuration directory to use if vcpkg was not installed on the system before")
|
||||||
|
else()
|
||||||
|
set(VCPKG_FALLBACK_ROOT ${CMAKE_CURRENT_BINARY_DIR}/.vcpkg CACHE STRING "vcpkg configuration directory to use if vcpkg was not installed on the system before")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# On Windows, Vcpkg defaults to x86, even on x64 systems. If we're
|
||||||
|
# doing a 64-bit build, we need to fix that.
|
||||||
|
if (WIN32)
|
||||||
|
|
||||||
|
# Since the compiler checks haven't run yet, we need to figure
|
||||||
|
# out the value of CMAKE_SIZEOF_VOID_P ourselfs
|
||||||
|
|
||||||
|
include(CheckTypeSize)
|
||||||
|
enable_language(C)
|
||||||
|
check_type_size("void*" SIZEOF_VOID_P BUILTIN_TYPES_ONLY)
|
||||||
|
|
||||||
|
if (SIZEOF_VOID_P EQUAL 8)
|
||||||
|
message(STATUS "Using Vcpkg triplet 'x64-windows'")
|
||||||
|
|
||||||
|
set(VCPKG_TRIPLET x64-windows)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT DEFINED VCPKG_ROOT)
|
||||||
|
if(NOT DEFINED ENV{VCPKG_ROOT})
|
||||||
|
set(VCPKG_ROOT ${VCPKG_FALLBACK_ROOT})
|
||||||
|
else()
|
||||||
|
set(VCPKG_ROOT $ENV{VCPKG_ROOT})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Installs a new copy of Vcpkg or updates an existing one
|
||||||
|
macro(vcpkg_bootstrap)
|
||||||
|
_install_or_update_vcpkg()
|
||||||
|
|
||||||
|
# Find out whether the user supplied their own VCPKG toolchain file
|
||||||
|
if(NOT DEFINED ${CMAKE_TOOLCHAIN_FILE})
|
||||||
|
# We know this wasn't set before so we need point the toolchain file to the newly found VCPKG_ROOT
|
||||||
|
set(CMAKE_TOOLCHAIN_FILE ${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake CACHE STRING "")
|
||||||
|
|
||||||
|
# Just setting vcpkg.cmake as toolchain file does not seem to actually pull in the code
|
||||||
|
include(${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake)
|
||||||
|
|
||||||
|
set(AUTOMATE_VCPKG_USE_SYSTEM_VCPKG OFF)
|
||||||
|
else()
|
||||||
|
# VCPKG_ROOT has been defined by the toolchain file already
|
||||||
|
set(AUTOMATE_VCPKG_USE_SYSTEM_VCPKG ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "Automate VCPKG status:")
|
||||||
|
message(STATUS " VCPKG_ROOT.....: ${VCPKG_ROOT}")
|
||||||
|
message(STATUS " VCPKG_EXEC.....: ${VCPKG_EXEC}")
|
||||||
|
message(STATUS " VCPKG_BOOTSTRAP: ${VCPKG_BOOTSTRAP}")
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(_install_or_update_vcpkg)
|
||||||
|
if(NOT EXISTS ${VCPKG_ROOT})
|
||||||
|
message(STATUS "Cloning vcpkg in ${VCPKG_ROOT}")
|
||||||
|
execute_process(COMMAND git clone https://github.com/Microsoft/vcpkg.git ${VCPKG_ROOT})
|
||||||
|
|
||||||
|
# If a reproducible build is desired (and potentially old libraries are # ok), uncomment the
|
||||||
|
# following line and pin the vcpkg repository to a specific githash.
|
||||||
|
# execute_process(COMMAND git checkout 745a0aea597771a580d0b0f4886ea1e3a94dbca6 WORKING_DIRECTORY ${VCPKG_ROOT})
|
||||||
|
else()
|
||||||
|
# The following command has no effect if the vcpkg repository is in a detached head state.
|
||||||
|
message(STATUS "Auto-updating vcpkg in ${VCPKG_ROOT}")
|
||||||
|
execute_process(COMMAND git pull WORKING_DIRECTORY ${VCPKG_ROOT})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT EXISTS ${VCPKG_ROOT}/README.md)
|
||||||
|
message(FATAL_ERROR "***** FATAL ERROR: Could not clone vcpkg *****")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set(VCPKG_EXEC ${VCPKG_ROOT}/vcpkg.exe)
|
||||||
|
set(VCPKG_BOOTSTRAP ${VCPKG_ROOT}/bootstrap-vcpkg.bat)
|
||||||
|
else()
|
||||||
|
set(VCPKG_EXEC ${VCPKG_ROOT}/vcpkg)
|
||||||
|
set(VCPKG_BOOTSTRAP ${VCPKG_ROOT}/bootstrap-vcpkg.sh)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT EXISTS ${VCPKG_EXEC})
|
||||||
|
message("Bootstrapping vcpkg in ${VCPKG_ROOT}")
|
||||||
|
execute_process(COMMAND ${VCPKG_BOOTSTRAP} WORKING_DIRECTORY ${VCPKG_ROOT})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT EXISTS ${VCPKG_EXEC})
|
||||||
|
message(FATAL_ERROR "***** FATAL ERROR: Could not bootstrap vcpkg *****")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
# Installs the list of packages given as parameters using Vcpkg
|
||||||
|
macro(vcpkg_install_packages)
|
||||||
|
|
||||||
|
# Need the given list to be space-separated
|
||||||
|
#string (REPLACE ";" " " PACKAGES_LIST_STR "${ARGN}")
|
||||||
|
|
||||||
|
message(STATUS "Installing/Updating the following vcpkg-packages: ${PACKAGES_LIST_STR}")
|
||||||
|
|
||||||
|
if (VCPKG_TRIPLET)
|
||||||
|
set(ENV{VCPKG_DEFAULT_TRIPLET} "${VCPKG_TRIPLET}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${VCPKG_EXEC} install ${ARGN}
|
||||||
|
WORKING_DIRECTORY ${VCPKG_ROOT}
|
||||||
|
)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
# MIT License
|
||||||
|
#
|
||||||
|
# Copyright (c) 2019 REGoth-project
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
# of this software and associated documentation files (the "Software"), to deal
|
||||||
|
# in the Software without restriction, including without limitation the rights
|
||||||
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
# copies of the Software, and to permit persons to whom the Software is
|
||||||
|
# furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in all
|
||||||
|
# copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
# SOFTWARE.
|
||||||
@@ -0,0 +1,219 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)
|
||||||
|
|
||||||
|
set(CMAKE_SYSTEM_VERSION 10.0 CACHE STRING "" FORCE)
|
||||||
|
set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
|
||||||
|
#set(CMAKE_C_STANDARD 11 CACHE STRING "The C standard to use") - issue with soh compile with MSVC
|
||||||
|
|
||||||
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE)
|
||||||
|
|
||||||
|
project(Ship LANGUAGES C CXX
|
||||||
|
VERSION 5.0.2)
|
||||||
|
set(PROJECT_BUILD_NAME "FLYNN CHARLIE" CACHE STRING "")
|
||||||
|
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "")
|
||||||
|
|
||||||
|
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT soh)
|
||||||
|
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MP>)
|
||||||
|
|
||||||
|
if (CMAKE_SYSTEM_NAME MATCHES "Windows|Linux")
|
||||||
|
if(NOT DEFINED BUILD_CROWD_CONTROL)
|
||||||
|
set(BUILD_CROWD_CONTROL ON)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
include(CMake/automate-vcpkg.cmake)
|
||||||
|
|
||||||
|
set(VCPKG_TRIPLET x64-windows-static)
|
||||||
|
set(VCPKG_TARGET_TRIPLET x64-windows-static)
|
||||||
|
|
||||||
|
vcpkg_bootstrap()
|
||||||
|
vcpkg_install_packages(zlib bzip2 libpng SDL2 SDL2-net GLEW glfw3)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Set target arch type if empty. Visual studio solution generator provides it.
|
||||||
|
################################################################################
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
if(NOT CMAKE_VS_PLATFORM_NAME)
|
||||||
|
set(CMAKE_VS_PLATFORM_NAME "x64")
|
||||||
|
endif()
|
||||||
|
message("${CMAKE_VS_PLATFORM_NAME} architecture in use")
|
||||||
|
|
||||||
|
if(NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64"
|
||||||
|
OR "${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32"))
|
||||||
|
message(FATAL_ERROR "${CMAKE_VS_PLATFORM_NAME} arch is not supported!")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Global configuration types
|
||||||
|
################################################################################
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch")
|
||||||
|
set(CMAKE_C_FLAGS_DEBUG "-O3 -ffast-math")
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "-O3 -ffast-math")
|
||||||
|
set(CMAKE_C_FLAGS_RELEASE "-O3 -ffast-math -DNDEBUG")
|
||||||
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -ffast-math -DNDEBUG")
|
||||||
|
else()
|
||||||
|
set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
|
||||||
|
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
|
||||||
|
set(CMAKE_OBJCXX_FLAGS_RELEASE "-O2 -DNDEBUG")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT CMAKE_BUILD_TYPE )
|
||||||
|
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build." FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Global compiler options
|
||||||
|
################################################################################
|
||||||
|
if(MSVC)
|
||||||
|
# remove default flags provided with CMake for MSVC
|
||||||
|
set(CMAKE_C_FLAGS "")
|
||||||
|
set(CMAKE_C_FLAGS_DEBUG "")
|
||||||
|
set(CMAKE_C_FLAGS_RELEASE "")
|
||||||
|
set(CMAKE_CXX_FLAGS "")
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "")
|
||||||
|
set(CMAKE_CXX_FLAGS_RELEASE "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Global linker options
|
||||||
|
################################################################################
|
||||||
|
if(MSVC)
|
||||||
|
# remove default flags provided with CMake for MSVC
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "")
|
||||||
|
set(CMAKE_MODULE_LINKER_FLAGS "")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "")
|
||||||
|
set(CMAKE_STATIC_LINKER_FLAGS "")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS}")
|
||||||
|
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS}")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS}")
|
||||||
|
set(CMAKE_STATIC_LINKER_FLAGS_DEBUG "${CMAKE_STATIC_LINKER_FLAGS}")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS}")
|
||||||
|
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS}")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS}")
|
||||||
|
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Common utils
|
||||||
|
################################################################################
|
||||||
|
include(CMake/Utils.cmake)
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
get_linux_lsb_release_information()
|
||||||
|
message(STATUS "Linux ${LSB_RELEASE_ID_SHORT} ${LSB_RELEASE_VERSION_SHORT} ${LSB_RELEASE_CODENAME_SHORT}")
|
||||||
|
else()
|
||||||
|
message(STATUS ${CMAKE_SYSTEM_NAME})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Additional Global Settings(add specific info there)
|
||||||
|
################################################################################
|
||||||
|
include(CMake/GlobalSettingsInclude.cmake OPTIONAL)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Use solution folders feature
|
||||||
|
################################################################################
|
||||||
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Sub-projects
|
||||||
|
################################################################################
|
||||||
|
add_subdirectory(libultraship ${CMAKE_BINARY_DIR}/libultraship)
|
||||||
|
add_subdirectory(ZAPDTR/ZAPD ${CMAKE_BINARY_DIR}/ZAPD)
|
||||||
|
add_subdirectory(OTRExporter)
|
||||||
|
add_subdirectory(soh)
|
||||||
|
if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|NintendoSwitch|CafeOS")
|
||||||
|
add_subdirectory(OTRGui)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set_property(TARGET soh PROPERTY APPIMAGE_DESKTOP_FILE_TERMINAL YES)
|
||||||
|
set_property(TARGET soh PROPERTY APPIMAGE_DESKTOP_FILE "${CMAKE_SOURCE_DIR}/scripts/linux/appimage/soh.desktop")
|
||||||
|
set_property(TARGET soh PROPERTY APPIMAGE_ICON_FILE "${CMAKE_BINARY_DIR}/sohIcon.png")
|
||||||
|
|
||||||
|
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||||
|
install(PROGRAMS "${CMAKE_SOURCE_DIR}/scripts/linux/appimage/soh.sh" DESTINATION . COMPONENT appimage)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package(Python3 COMPONENTS Interpreter)
|
||||||
|
|
||||||
|
add_custom_target(
|
||||||
|
ExtractAssets
|
||||||
|
# CMake versions prior to 3.17 do not have the rm command, use remove instead for older versions
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E $<IF:$<VERSION_LESS:${CMAKE_VERSION},3.17>,remove,rm> -f oot.otr oot-mq.otr
|
||||||
|
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$<TARGET_FILE:ZAPD>" --non-interactive
|
||||||
|
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/copy-existing-otrs.cmake
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter
|
||||||
|
COMMENT "Running asset extraction..."
|
||||||
|
DEPENDS ZAPD
|
||||||
|
BYPRODUCTS oot.otr ${CMAKE_SOURCE_DIR}/oot.otr oot-mq.otr ${CMAKE_SOURCE_DIR}/oot-mq.otr
|
||||||
|
)
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
find_package(ImageMagick COMPONENTS convert)
|
||||||
|
if (ImageMagick_FOUND)
|
||||||
|
execute_process (
|
||||||
|
COMMAND ${ImageMagick_convert_EXECUTABLE} soh/macosx/sohIcon.png -resize 512x512 ${CMAKE_BINARY_DIR}/sohIcon.png
|
||||||
|
OUTPUT_VARIABLE outVar
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
|
add_custom_target(CreateOSXIcons
|
||||||
|
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/macosx/soh.iconset
|
||||||
|
COMMAND sips -z 16 16 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_16x16.png
|
||||||
|
COMMAND sips -z 32 32 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_16x16@2x.png
|
||||||
|
COMMAND sips -z 32 32 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_32x32.png
|
||||||
|
COMMAND sips -z 64 64 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_32x32@2x.png
|
||||||
|
COMMAND sips -z 128 128 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_128x128.png
|
||||||
|
COMMAND sips -z 256 256 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_128x128@2x.png
|
||||||
|
COMMAND sips -z 256 256 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_256x256.png
|
||||||
|
COMMAND sips -z 512 512 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_256x256@2x.png
|
||||||
|
COMMAND sips -z 512 512 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_512x512.png
|
||||||
|
COMMAND cp soh/macosx/sohIcon.png ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_512x512@2x.png
|
||||||
|
COMMAND iconutil -c icns -o ${CMAKE_BINARY_DIR}/macosx/soh.icns ${CMAKE_BINARY_DIR}/macosx/soh.iconset
|
||||||
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
|
COMMENT "Creating OSX icons ..."
|
||||||
|
)
|
||||||
|
add_dependencies(soh CreateOSXIcons)
|
||||||
|
|
||||||
|
add_custom_target(Assets ALL
|
||||||
|
COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_SOURCE_DIR}/OTRGui/assets/extractor" -Ddst_dir="${CMAKE_BINARY_DIR}/assets/extractor" -P "${CMAKE_SOURCE_DIR}/OTRGui/Overwrite.cmake"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_SOURCE_DIR}/OTRExporter/assets" -Ddst_dir="${CMAKE_BINARY_DIR}/assets/game" -P "${CMAKE_SOURCE_DIR}/OTRGui/Overwrite.cmake"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_SOURCE_DIR}/soh/assets/xml" -Ddst_dir="${CMAKE_BINARY_DIR}/assets/extractor/xmls" -P "${CMAKE_SOURCE_DIR}/OTRGui/Overwrite.cmake"
|
||||||
|
)
|
||||||
|
add_dependencies(soh Assets)
|
||||||
|
|
||||||
|
install(TARGETS ZAPD DESTINATION ${CMAKE_BINARY_DIR}/assets/extractor)
|
||||||
|
|
||||||
|
set(PROGRAM_PERMISSIONS_EXECUTE OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ)
|
||||||
|
|
||||||
|
install(DIRECTORY ${CMAKE_BINARY_DIR}/assets
|
||||||
|
DESTINATION .
|
||||||
|
PATTERN ZAPD.out
|
||||||
|
PERMISSIONS ${PROGRAM_PERMISSIONS_EXECUTE}
|
||||||
|
)
|
||||||
|
|
||||||
|
install(CODE "
|
||||||
|
include(BundleUtilities)
|
||||||
|
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/soh-macos\" \"\" \"${dirs}\")
|
||||||
|
")
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME MATCHES "Windows|NintendoSwitch|CafeOS")
|
||||||
|
install(FILES ${CMAKE_SOURCE_DIR}/README.md DESTINATION . COMPONENT ship RENAME readme.txt )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
set(CPACK_GENERATOR "External")
|
||||||
|
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows|NintendoSwitch|CafeOS")
|
||||||
|
set(CPACK_GENERATOR "ZIP")
|
||||||
|
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
|
set(CPACK_GENERATOR "Bundle")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_SOURCE_DIR}/CMake/Packaging-2.cmake)
|
||||||
|
include(CMake/Packaging.cmake)
|
||||||
@@ -1,38 +1,77 @@
|
|||||||
|
FROM ubuntu:20.04 as build
|
||||||
|
|
||||||
FROM ubuntu:21.04 as build
|
|
||||||
|
|
||||||
ENV LANG C.UTF-8
|
ENV LANG C.UTF-8
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
RUN dpkg --add-architecture i386 && \
|
ENV GCCVER=10
|
||||||
apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get upgrade -y && \
|
apt-get upgrade -y && \
|
||||||
apt-get install -y \
|
apt-get install -y \
|
||||||
binutils:i386 \
|
binutils \
|
||||||
gcc-10:i386 \
|
gcc-${GCCVER} \
|
||||||
g++-10:i386 \
|
g++-${GCCVER} \
|
||||||
python3.10 \
|
patchelf \
|
||||||
python \
|
p7zip-full \
|
||||||
make \
|
python3 \
|
||||||
cmake \
|
cmake \
|
||||||
git \
|
make \
|
||||||
lld \
|
curl \
|
||||||
libsdl2-dev:i386 \
|
git \
|
||||||
zlib1g-dev:i386 \
|
lld \
|
||||||
libbz2-dev:i386 \
|
libsdl2-dev \
|
||||||
libpng-dev:i386 \
|
zlib1g-dev \
|
||||||
libgles2-mesa-dev && \
|
libbz2-dev \
|
||||||
ln -sf /usr/bin/python3.10 /usr/bin/python3 && \
|
libpng-dev \
|
||||||
ln -s /usr/bin/gcc-10 /usr/bin/gcc && \
|
libgles2-mesa-dev \
|
||||||
ln -s /usr/bin/gcc-10 /usr/bin/cc && \
|
wget \
|
||||||
ln -s /usr/bin/g++-10 /usr/bin/g++ && \
|
gpg \
|
||||||
ln -s /usr/bin/g++-10 /usr/bin/c++
|
imagemagick \
|
||||||
|
ninja-build && \
|
||||||
|
apt-get install -y software-properties-common && \
|
||||||
|
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
|
||||||
|
apt-add-repository "deb https://apt.kitware.com/ubuntu/ focal main" && \
|
||||||
|
apt-get update && \
|
||||||
|
apt-get upgrade -y && \
|
||||||
|
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCCVER} 10 && \
|
||||||
|
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${GCCVER} 10
|
||||||
|
|
||||||
RUN git clone https://github.com/Perlmint/glew-cmake.git && \
|
RUN git clone https://github.com/Perlmint/glew-cmake.git && \
|
||||||
cmake glew-cmake && \
|
cmake glew-cmake && \
|
||||||
make -j$(nproc) && \
|
make -j$(nproc) && \
|
||||||
make install ARCH64=false
|
make install
|
||||||
|
|
||||||
|
ENV SDL2VER=2.0.22
|
||||||
|
RUN curl -sLO https://libsdl.org/release/SDL2-${SDL2VER}.tar.gz && \
|
||||||
|
tar -xzf SDL2-${SDL2VER}.tar.gz && \
|
||||||
|
cd SDL2-${SDL2VER} && \
|
||||||
|
./configure --build=x86_64-linux-gnu && \
|
||||||
|
make -j$(nproc) && make install && \
|
||||||
|
rm ../SDL2-${SDL2VER}.tar.gz && \
|
||||||
|
cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/
|
||||||
|
|
||||||
|
ENV SDL2NETVER=2.2.0
|
||||||
|
RUN curl -sLO https://www.libsdl.org/projects/SDL_net/release/SDL2_net-${SDL2NETVER}.tar.gz && \
|
||||||
|
tar -xzf SDL2_net-${SDL2NETVER}.tar.gz && \
|
||||||
|
cd SDL2_net-${SDL2NETVER} && \
|
||||||
|
./configure --build=x86_64-linux-gnu && \
|
||||||
|
make -j$(nproc) && make install && \
|
||||||
|
rm ../SDL2_net-${SDL2NETVER}.tar.gz && \
|
||||||
|
cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
ln -sf /proc/self/mounts /etc/mtab && \
|
||||||
|
mkdir -p /usr/local/share/keyring/ && \
|
||||||
|
wget -O /usr/local/share/keyring/devkitpro-pub.gpg https://apt.devkitpro.org/devkitpro-pub.gpg && \
|
||||||
|
echo "deb [signed-by=/usr/local/share/keyring/devkitpro-pub.gpg] https://apt.devkitpro.org stable main" > /etc/apt/sources.list.d/devkitpro.list && \
|
||||||
|
apt-get update -y && \
|
||||||
|
apt-get install -y devkitpro-pacman && \
|
||||||
|
yes | dkp-pacman -Syu switch-dev switch-portlibs wiiu-dev wiiu-portlibs --noconfirm
|
||||||
|
|
||||||
|
ENV DEVKITPRO=/opt/devkitpro
|
||||||
|
ENV DEVKITARM=/opt/devkitpro/devkitARM
|
||||||
|
ENV DEVKITPPC=/opt/devkitpro/devkitPPC
|
||||||
|
ENV PATH=$PATH:/opt/devkitpro/portlibs/switch/bin/:$DEVKITPPC/bin
|
||||||
|
ENV WUT_ROOT=$DEVKITPRO/wut
|
||||||
|
|
||||||
RUN mkdir /soh
|
RUN mkdir /soh
|
||||||
WORKDIR /soh
|
WORKDIR /soh
|
||||||
|
|||||||
@@ -1,117 +0,0 @@
|
|||||||
pipeline {
|
|
||||||
agent none
|
|
||||||
|
|
||||||
options {
|
|
||||||
timestamps()
|
|
||||||
skipDefaultCheckout(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
stages {
|
|
||||||
stage ('Build Windows') {
|
|
||||||
environment {
|
|
||||||
MSBUILD='C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Msbuild\\Current\\Bin\\msbuild.exe'
|
|
||||||
CONFIG='Release'
|
|
||||||
OTRPLATFORM='x64'
|
|
||||||
PLATFORM='x86'
|
|
||||||
ZIP='C:\\Program Files\\7-Zip\\7z.exe'
|
|
||||||
PYTHON='C:\\Users\\jenkins\\AppData\\Local\\Programs\\Python\\Python310\\python.exe'
|
|
||||||
CMAKE='C:\\Program Files\\CMake\\bin\\cmake.exe'
|
|
||||||
TOOLSET='v142'
|
|
||||||
}
|
|
||||||
agent {
|
|
||||||
label "SoH-Builders"
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
checkout([
|
|
||||||
$class: 'GitSCM',
|
|
||||||
branches: scm.branches,
|
|
||||||
doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations,
|
|
||||||
extensions: scm.extensions,
|
|
||||||
userRemoteConfigs: scm.userRemoteConfigs
|
|
||||||
])
|
|
||||||
|
|
||||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
|
||||||
bat """
|
|
||||||
|
|
||||||
"${env.MSBUILD}" ".\\OTRExporter\\OTRExporter.sln" -t:build -p:Configuration=${env.CONFIG};Platform=${env.OTRPLATFORM};PlatformToolset=${env.TOOLSET};RestorePackagesConfig=true /restore /nodeReuse:false /m
|
|
||||||
|
|
||||||
xcopy "..\\..\\ZELOOTD.z64" "OTRExporter\\"
|
|
||||||
|
|
||||||
cd "OTRExporter"
|
|
||||||
"${env.PYTHON}" ".\\extract_assets.py"
|
|
||||||
cd "..\\"
|
|
||||||
|
|
||||||
"${env.MSBUILD}" ".\\soh\\soh.sln" -t:build -p:Configuration=${env.CONFIG};Platform=${env.PLATFORM};PlatformToolset=${env.TOOLSET} /nodeReuse:false /m
|
|
||||||
|
|
||||||
cd OTRGui
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
|
|
||||||
"${env.CMAKE}" ..
|
|
||||||
"${env.CMAKE}" --build . --config Release
|
|
||||||
|
|
||||||
cd "..\\..\\"
|
|
||||||
|
|
||||||
move "soh\\Release\\soh.exe" ".\\"
|
|
||||||
move "OTRGui\\build\\assets" ".\\"
|
|
||||||
move ".\\OTRExporter\\x64\\Release\\ZAPD.exe" ".\\assets\\extractor\\"
|
|
||||||
move ".\\OTRGui\\build\\Release\\OTRGui.exe" ".\\"
|
|
||||||
rename README.md readme.txt
|
|
||||||
|
|
||||||
"${env.ZIP}" a soh.7z soh.exe OTRGui.exe assets readme.txt
|
|
||||||
|
|
||||||
"""
|
|
||||||
archiveArtifacts artifacts: 'soh.7z', followSymlinks: false, onlyIfSuccessful: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
post {
|
|
||||||
always {
|
|
||||||
step([$class: 'WsCleanup']) // Clean workspace
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage ('Build Linux') {
|
|
||||||
agent {
|
|
||||||
label "SoH-Linux-Builders"
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
checkout([
|
|
||||||
$class: 'GitSCM',
|
|
||||||
branches: scm.branches,
|
|
||||||
doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations,
|
|
||||||
extensions: scm.extensions,
|
|
||||||
userRemoteConfigs: scm.userRemoteConfigs
|
|
||||||
])
|
|
||||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
|
||||||
sh '''
|
|
||||||
|
|
||||||
cp ../../ZELOOTD.z64 OTRExporter/baserom_non_mq.z64
|
|
||||||
docker build . -t soh
|
|
||||||
docker run --name sohcont -dit --rm -v $(pwd):/soh soh /bin/bash
|
|
||||||
cp ../../buildsoh.bash soh
|
|
||||||
docker exec sohcont soh/buildsoh.bash
|
|
||||||
|
|
||||||
mkdir build
|
|
||||||
mv soh/soh.elf build/
|
|
||||||
mv OTRGui/build/OTRGui build/
|
|
||||||
mv OTRGui/build/assets build/
|
|
||||||
mv ZAPDTR/ZAPD.out build/assets/extractor/
|
|
||||||
mv README.md build/readme.txt
|
|
||||||
cd build
|
|
||||||
|
|
||||||
7z a soh-linux.7z soh.elf OTRGui assets readme.txt
|
|
||||||
mv soh-linux.7z ../
|
|
||||||
|
|
||||||
'''
|
|
||||||
}
|
|
||||||
sh 'sudo docker container stop sohcont'
|
|
||||||
archiveArtifacts artifacts: 'soh-linux.7z', followSymlinks: false, onlyIfSuccessful: true
|
|
||||||
}
|
|
||||||
post {
|
|
||||||
always {
|
|
||||||
step([$class: 'WsCleanup']) // Clean workspace
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -341,6 +341,7 @@ build/
|
|||||||
ZAPDUtils/build/
|
ZAPDUtils/build/
|
||||||
ZAPD/BuildInfo.h
|
ZAPD/BuildInfo.h
|
||||||
baserom/
|
baserom/
|
||||||
|
baserom_ntsc/
|
||||||
*.vtx.inc
|
*.vtx.inc
|
||||||
*.otr
|
*.otr
|
||||||
*.swp
|
*.swp
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
################################################################################
|
||||||
|
# Command for variable_watch. This command issues error message, if a variable
|
||||||
|
# is changed. If variable PROPERTY_READER_GUARD_DISABLED is TRUE nothing happens
|
||||||
|
# variable_watch(<variable> property_reader_guard)
|
||||||
|
################################################################################
|
||||||
|
function(property_reader_guard VARIABLE ACCESS VALUE CURRENT_LIST_FILE STACK)
|
||||||
|
if("${PROPERTY_READER_GUARD_DISABLED}")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if("${ACCESS}" STREQUAL "MODIFIED_ACCESS")
|
||||||
|
message(FATAL_ERROR
|
||||||
|
" Variable ${VARIABLE} is not supposed to be changed.\n"
|
||||||
|
" It is used only for reading target property ${VARIABLE}.\n"
|
||||||
|
" Use\n"
|
||||||
|
" set_target_properties(\"<target>\" PROPERTIES \"${VARIABLE}\" \"<value>\")\n"
|
||||||
|
" or\n"
|
||||||
|
" set_target_properties(\"<target>\" PROPERTIES \"${VARIABLE}_<CONFIG>\" \"<value>\")\n"
|
||||||
|
" instead.\n")
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Create variable <name> with generator expression that expands to value of
|
||||||
|
# target property <name>_<CONFIG>. If property is empty or not set then property
|
||||||
|
# <name> is used instead. Variable <name> has watcher property_reader_guard that
|
||||||
|
# doesn't allow to edit it.
|
||||||
|
# create_property_reader(<name>)
|
||||||
|
# Input:
|
||||||
|
# name - Name of watched property and output variable
|
||||||
|
################################################################################
|
||||||
|
function(create_property_reader NAME)
|
||||||
|
set(PROPERTY_READER_GUARD_DISABLED TRUE)
|
||||||
|
set(CONFIG_VALUE "$<TARGET_GENEX_EVAL:${PROPS_TARGET},$<TARGET_PROPERTY:${PROPS_TARGET},${NAME}_$<UPPER_CASE:$<CONFIG>>>>")
|
||||||
|
set(IS_CONFIG_VALUE_EMPTY "$<STREQUAL:${CONFIG_VALUE},>")
|
||||||
|
set(GENERAL_VALUE "$<TARGET_GENEX_EVAL:${PROPS_TARGET},$<TARGET_PROPERTY:${PROPS_TARGET},${NAME}>>")
|
||||||
|
set("${NAME}" "$<IF:${IS_CONFIG_VALUE_EMPTY},${GENERAL_VALUE},${CONFIG_VALUE}>" PARENT_SCOPE)
|
||||||
|
variable_watch("${NAME}" property_reader_guard)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Set property $<name>_${PROPS_CONFIG_U} of ${PROPS_TARGET} to <value>
|
||||||
|
# set_config_specific_property(<name> <value>)
|
||||||
|
# Input:
|
||||||
|
# name - Prefix of property name
|
||||||
|
# value - New value
|
||||||
|
################################################################################
|
||||||
|
function(set_config_specific_property NAME VALUE)
|
||||||
|
set_target_properties("${PROPS_TARGET}" PROPERTIES "${NAME}_${PROPS_CONFIG_U}" "${VALUE}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
create_property_reader("TARGET_NAME")
|
||||||
|
create_property_reader("OUTPUT_DIRECTORY")
|
||||||
|
|
||||||
|
set_config_specific_property("TARGET_NAME" "${PROPS_TARGET}")
|
||||||
|
set_config_specific_property("OUTPUT_NAME" "${TARGET_NAME}")
|
||||||
|
set_config_specific_property("ARCHIVE_OUTPUT_NAME" "${TARGET_NAME}")
|
||||||
|
set_config_specific_property("LIBRARY_OUTPUT_NAME" "${TARGET_NAME}")
|
||||||
|
set_config_specific_property("RUNTIME_OUTPUT_NAME" "${TARGET_NAME}")
|
||||||
|
|
||||||
|
set_config_specific_property("ARCHIVE_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}")
|
||||||
|
set_config_specific_property("LIBRARY_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}")
|
||||||
|
set_config_specific_property("RUNTIME_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}")
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/Default.cmake")
|
||||||
|
|
||||||
|
set_config_specific_property("OUTPUT_DIRECTORY" "${CMAKE_SOURCE_DIR}$<$<NOT:$<STREQUAL:${CMAKE_VS_PLATFORM_NAME},Win32>>:/${CMAKE_VS_PLATFORM_NAME}>/${PROPS_CONFIG}")
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
create_property_reader("DEFAULT_CXX_EXCEPTION_HANDLING")
|
||||||
|
create_property_reader("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT")
|
||||||
|
|
||||||
|
set_target_properties("${PROPS_TARGET}" PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
||||||
|
set_config_specific_property("DEFAULT_CXX_EXCEPTION_HANDLING" "/EHsc")
|
||||||
|
set_config_specific_property("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT" "/Zi")
|
||||||
|
endif()
|
||||||
@@ -0,0 +1,233 @@
|
|||||||
|
# utils file for projects came from visual studio solution with cmake-converter.
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Wrap each token of the command with condition
|
||||||
|
################################################################################
|
||||||
|
cmake_policy(PUSH)
|
||||||
|
cmake_policy(SET CMP0054 NEW)
|
||||||
|
macro(prepare_commands)
|
||||||
|
unset(TOKEN_ROLE)
|
||||||
|
unset(COMMANDS)
|
||||||
|
foreach(TOKEN ${ARG_COMMANDS})
|
||||||
|
if("${TOKEN}" STREQUAL "COMMAND")
|
||||||
|
set(TOKEN_ROLE "KEYWORD")
|
||||||
|
elseif("${TOKEN_ROLE}" STREQUAL "KEYWORD")
|
||||||
|
set(TOKEN_ROLE "CONDITION")
|
||||||
|
elseif("${TOKEN_ROLE}" STREQUAL "CONDITION")
|
||||||
|
set(TOKEN_ROLE "COMMAND")
|
||||||
|
elseif("${TOKEN_ROLE}" STREQUAL "COMMAND")
|
||||||
|
set(TOKEN_ROLE "ARG")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if("${TOKEN_ROLE}" STREQUAL "KEYWORD")
|
||||||
|
list(APPEND COMMANDS "${TOKEN}")
|
||||||
|
elseif("${TOKEN_ROLE}" STREQUAL "CONDITION")
|
||||||
|
set(CONDITION ${TOKEN})
|
||||||
|
elseif("${TOKEN_ROLE}" STREQUAL "COMMAND")
|
||||||
|
list(APPEND COMMANDS "$<$<NOT:${CONDITION}>:${DUMMY}>$<${CONDITION}:${TOKEN}>")
|
||||||
|
elseif("${TOKEN_ROLE}" STREQUAL "ARG")
|
||||||
|
list(APPEND COMMANDS "$<${CONDITION}:${TOKEN}>")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endmacro()
|
||||||
|
cmake_policy(POP)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Transform all the tokens to absolute paths
|
||||||
|
################################################################################
|
||||||
|
macro(prepare_output)
|
||||||
|
unset(OUTPUT)
|
||||||
|
foreach(TOKEN ${ARG_OUTPUT})
|
||||||
|
if(IS_ABSOLUTE ${TOKEN})
|
||||||
|
list(APPEND OUTPUT "${TOKEN}")
|
||||||
|
else()
|
||||||
|
list(APPEND OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/${TOKEN}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Parse add_custom_command_if args.
|
||||||
|
#
|
||||||
|
# Input:
|
||||||
|
# PRE_BUILD - Pre build event option
|
||||||
|
# PRE_LINK - Pre link event option
|
||||||
|
# POST_BUILD - Post build event option
|
||||||
|
# TARGET - Target
|
||||||
|
# OUTPUT - List of output files
|
||||||
|
# DEPENDS - List of files on which the command depends
|
||||||
|
# COMMANDS - List of commands(COMMAND condition1 commannd1 args1 COMMAND
|
||||||
|
# condition2 commannd2 args2 ...)
|
||||||
|
# Output:
|
||||||
|
# OUTPUT - Output files
|
||||||
|
# DEPENDS - Files on which the command depends
|
||||||
|
# COMMENT - Comment
|
||||||
|
# PRE_BUILD - TRUE/FALSE
|
||||||
|
# PRE_LINK - TRUE/FALSE
|
||||||
|
# POST_BUILD - TRUE/FALSE
|
||||||
|
# TARGET - Target name
|
||||||
|
# COMMANDS - Prepared commands(every token is wrapped in CONDITION)
|
||||||
|
# NAME - Unique name for custom target
|
||||||
|
# STEP - PRE_BUILD/PRE_LINK/POST_BUILD
|
||||||
|
################################################################################
|
||||||
|
function(add_custom_command_if_parse_arguments)
|
||||||
|
cmake_parse_arguments("ARG" "PRE_BUILD;PRE_LINK;POST_BUILD" "TARGET;COMMENT" "DEPENDS;OUTPUT;COMMANDS" ${ARGN})
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set(DUMMY "cd.")
|
||||||
|
elseif(UNIX)
|
||||||
|
set(DUMMY "true")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
prepare_commands()
|
||||||
|
prepare_output()
|
||||||
|
|
||||||
|
set(DEPENDS "${ARG_DEPENDS}")
|
||||||
|
set(COMMENT "${ARG_COMMENT}")
|
||||||
|
set(PRE_BUILD "${ARG_PRE_BUILD}")
|
||||||
|
set(PRE_LINK "${ARG_PRE_LINK}")
|
||||||
|
set(POST_BUILD "${ARG_POST_BUILD}")
|
||||||
|
set(TARGET "${ARG_TARGET}")
|
||||||
|
if(PRE_BUILD)
|
||||||
|
set(STEP "PRE_BUILD")
|
||||||
|
elseif(PRE_LINK)
|
||||||
|
set(STEP "PRE_LINK")
|
||||||
|
elseif(POST_BUILD)
|
||||||
|
set(STEP "POST_BUILD")
|
||||||
|
endif()
|
||||||
|
set(NAME "${TARGET}_${STEP}")
|
||||||
|
|
||||||
|
set(OUTPUT "${OUTPUT}" PARENT_SCOPE)
|
||||||
|
set(DEPENDS "${DEPENDS}" PARENT_SCOPE)
|
||||||
|
set(COMMENT "${COMMENT}" PARENT_SCOPE)
|
||||||
|
set(PRE_BUILD "${PRE_BUILD}" PARENT_SCOPE)
|
||||||
|
set(PRE_LINK "${PRE_LINK}" PARENT_SCOPE)
|
||||||
|
set(POST_BUILD "${POST_BUILD}" PARENT_SCOPE)
|
||||||
|
set(TARGET "${TARGET}" PARENT_SCOPE)
|
||||||
|
set(COMMANDS "${COMMANDS}" PARENT_SCOPE)
|
||||||
|
set(STEP "${STEP}" PARENT_SCOPE)
|
||||||
|
set(NAME "${NAME}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Add conditional custom command
|
||||||
|
#
|
||||||
|
# Generating Files
|
||||||
|
# The first signature is for adding a custom command to produce an output:
|
||||||
|
# add_custom_command_if(
|
||||||
|
# <OUTPUT output1 [output2 ...]>
|
||||||
|
# <COMMANDS>
|
||||||
|
# <COMMAND condition command1 [args1...]>
|
||||||
|
# [COMMAND condition command2 [args2...]]
|
||||||
|
# [DEPENDS [depends...]]
|
||||||
|
# [COMMENT comment]
|
||||||
|
#
|
||||||
|
# Build Events
|
||||||
|
# add_custom_command_if(
|
||||||
|
# <TARGET target>
|
||||||
|
# <PRE_BUILD | PRE_LINK | POST_BUILD>
|
||||||
|
# <COMMAND condition command1 [args1...]>
|
||||||
|
# [COMMAND condition command2 [args2...]]
|
||||||
|
# [COMMENT comment]
|
||||||
|
#
|
||||||
|
# Input:
|
||||||
|
# output - Output files the command is expected to produce
|
||||||
|
# condition - Generator expression for wrapping the command
|
||||||
|
# command - Command-line(s) to execute at build time.
|
||||||
|
# args - Command`s args
|
||||||
|
# depends - Files on which the command depends
|
||||||
|
# comment - Display the given message before the commands are executed at
|
||||||
|
# build time.
|
||||||
|
# PRE_BUILD - Run before any other rules are executed within the target
|
||||||
|
# PRE_LINK - Run after sources have been compiled but before linking the
|
||||||
|
# binary
|
||||||
|
# POST_BUILD - Run after all other rules within the target have been
|
||||||
|
# executed
|
||||||
|
################################################################################
|
||||||
|
function(add_custom_command_if)
|
||||||
|
add_custom_command_if_parse_arguments(${ARGN})
|
||||||
|
|
||||||
|
if(OUTPUT AND TARGET)
|
||||||
|
message(FATAL_ERROR "Wrong syntax. A TARGET and OUTPUT can not both be specified.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(OUTPUT)
|
||||||
|
add_custom_command(OUTPUT ${OUTPUT}
|
||||||
|
${COMMANDS}
|
||||||
|
DEPENDS ${DEPENDS}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
COMMENT ${COMMENT})
|
||||||
|
elseif(TARGET)
|
||||||
|
if(PRE_BUILD AND NOT ${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
||||||
|
add_custom_target(
|
||||||
|
${NAME}
|
||||||
|
${COMMANDS}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
COMMENT ${COMMENT})
|
||||||
|
add_dependencies(${TARGET} ${NAME})
|
||||||
|
else()
|
||||||
|
add_custom_command(
|
||||||
|
TARGET ${TARGET}
|
||||||
|
${STEP}
|
||||||
|
${COMMANDS}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
COMMENT ${COMMENT})
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Wrong syntax. A TARGET or OUTPUT must be specified.")
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Use props file for a target and configs
|
||||||
|
# use_props(<target> <configs...> <props_file>)
|
||||||
|
# Inside <props_file> there are following variables:
|
||||||
|
# PROPS_TARGET - <target>
|
||||||
|
# PROPS_CONFIG - One of <configs...>
|
||||||
|
# PROPS_CONFIG_U - Uppercase PROPS_CONFIG
|
||||||
|
# Input:
|
||||||
|
# target - Target to apply props file
|
||||||
|
# configs - Build configurations to apply props file
|
||||||
|
# props_file - CMake script
|
||||||
|
################################################################################
|
||||||
|
macro(use_props TARGET CONFIGS PROPS_FILE)
|
||||||
|
set(PROPS_TARGET "${TARGET}")
|
||||||
|
foreach(PROPS_CONFIG ${CONFIGS})
|
||||||
|
string(TOUPPER "${PROPS_CONFIG}" PROPS_CONFIG_U)
|
||||||
|
|
||||||
|
get_filename_component(ABSOLUTE_PROPS_FILE "${PROPS_FILE}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
|
||||||
|
if(EXISTS "${ABSOLUTE_PROPS_FILE}")
|
||||||
|
include("${ABSOLUTE_PROPS_FILE}")
|
||||||
|
else()
|
||||||
|
message(WARNING "Corresponding cmake file from props \"${ABSOLUTE_PROPS_FILE}\" doesn't exist")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Add compile options to source file
|
||||||
|
# source_file_compile_options(<source_file> [compile_options...])
|
||||||
|
# Input:
|
||||||
|
# source_file - Source file
|
||||||
|
# compile_options - Options to add to COMPILE_FLAGS property
|
||||||
|
################################################################################
|
||||||
|
function(source_file_compile_options SOURCE_FILE)
|
||||||
|
if("${ARGC}" LESS_EQUAL "1")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
get_source_file_property(COMPILE_OPTIONS "${SOURCE_FILE}" COMPILE_OPTIONS)
|
||||||
|
|
||||||
|
if(COMPILE_OPTIONS)
|
||||||
|
list(APPEND COMPILE_OPTIONS ${ARGN})
|
||||||
|
else()
|
||||||
|
set(COMPILE_OPTIONS "${ARGN}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set_source_files_properties("${SOURCE_FILE}" PROPERTIES COMPILE_OPTIONS "${COMPILE_OPTIONS}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Default properties of visual studio projects
|
||||||
|
################################################################################
|
||||||
|
set(DEFAULT_CXX_PROPS "${CMAKE_CURRENT_LIST_DIR}/DefaultCXX.cmake")
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)
|
||||||
|
|
||||||
|
set(CMAKE_SYSTEM_VERSION 10.0 CACHE STRING "" FORCE)
|
||||||
|
set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
|
||||||
|
#set(CMAKE_C_STANDARD 11 CACHE STRING "The C standard to use")
|
||||||
|
set(CMAKE_C_STANDARD 11)
|
||||||
|
|
||||||
|
project(OTRExporter C CXX)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Set target arch type if empty. Visual studio solution generator provides it.
|
||||||
|
################################################################################
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
if(NOT CMAKE_VS_PLATFORM_NAME)
|
||||||
|
set(CMAKE_VS_PLATFORM_NAME "x64")
|
||||||
|
endif()
|
||||||
|
message("${CMAKE_VS_PLATFORM_NAME} architecture in use")
|
||||||
|
|
||||||
|
if(NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64"
|
||||||
|
OR "${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32"))
|
||||||
|
message(FATAL_ERROR "${CMAKE_VS_PLATFORM_NAME} arch is not supported!")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Global configuration types
|
||||||
|
################################################################################
|
||||||
|
set(CMAKE_CONFIGURATION_TYPES
|
||||||
|
"Debug"
|
||||||
|
"Release"
|
||||||
|
CACHE STRING "" FORCE
|
||||||
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Global compiler options
|
||||||
|
################################################################################
|
||||||
|
if(MSVC)
|
||||||
|
# remove default flags provided with CMake for MSVC
|
||||||
|
set(CMAKE_C_FLAGS "")
|
||||||
|
set(CMAKE_C_FLAGS_DEBUG "")
|
||||||
|
set(CMAKE_C_FLAGS_RELEASE "")
|
||||||
|
set(CMAKE_CXX_FLAGS "")
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "")
|
||||||
|
set(CMAKE_CXX_FLAGS_RELEASE "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Global linker options
|
||||||
|
################################################################################
|
||||||
|
if(MSVC)
|
||||||
|
# remove default flags provided with CMake for MSVC
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "")
|
||||||
|
set(CMAKE_MODULE_LINKER_FLAGS "")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "")
|
||||||
|
set(CMAKE_STATIC_LINKER_FLAGS "")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS}")
|
||||||
|
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS}")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS}")
|
||||||
|
set(CMAKE_STATIC_LINKER_FLAGS_DEBUG "${CMAKE_STATIC_LINKER_FLAGS}")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS}")
|
||||||
|
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS}")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS}")
|
||||||
|
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Common utils
|
||||||
|
################################################################################
|
||||||
|
include(CMake/Utils.cmake)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Additional Global Settings(add specific info there)
|
||||||
|
################################################################################
|
||||||
|
include(CMake/GlobalSettingsInclude.cmake OPTIONAL)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Use solution folders feature
|
||||||
|
################################################################################
|
||||||
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Sub-projects
|
||||||
|
################################################################################
|
||||||
|
if (NOT TARGET libultraship)
|
||||||
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../libultraship ${CMAKE_BINARY_DIR}/libultraship)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT TARGET ZAPD)
|
||||||
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../ZAPDTR/ZAPD ${CMAKE_BINARY_DIR}/ZAPD)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT TARGET ZAPDUtils)
|
||||||
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/extern/ZAPDUtils ${CMAKE_BINARY_DIR}/ZAPDUtils)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_subdirectory(OTRExporter)
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio Version 16
|
|
||||||
VisualStudioVersion = 16.0.30320.27
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OTRExporter", "OTRExporter\OTRExporter.vcxproj", "{A6103FD3-0709-4FC7-B066-1A6E056D6306}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{6DA9B521-65B7-41E2-8F8A-F0451CC18ED8} = {6DA9B521-65B7-41E2-8F8A-F0451CC18ED8}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libultraship", "..\libultraship\libultraship\libultraship.vcxproj", "{6DA9B521-65B7-41E2-8F8A-F0451CC18ED8}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZAPD", "..\ZAPDTR\ZAPD\ZAPD.vcxproj", "{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{6DA9B521-65B7-41E2-8F8A-F0451CC18ED8} = {6DA9B521-65B7-41E2-8F8A-F0451CC18ED8}
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908} = {A2E01C3E-D647-45D1-9788-043DEBC1A908}
|
|
||||||
{A6103FD3-0709-4FC7-B066-1A6E056D6306} = {A6103FD3-0709-4FC7-B066-1A6E056D6306}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZAPDUtils", "..\ZAPDTR\ZAPDUtils\ZAPDUtils.vcxproj", "{A2E01C3E-D647-45D1-9788-043DEBC1A908}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|x64 = Debug|x64
|
|
||||||
Debug|x86 = Debug|x86
|
|
||||||
Release|x64 = Release|x64
|
|
||||||
Release|x86 = Release|x86
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{A6103FD3-0709-4FC7-B066-1A6E056D6306}.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
{A6103FD3-0709-4FC7-B066-1A6E056D6306}.Debug|x64.Build.0 = Debug|x64
|
|
||||||
{A6103FD3-0709-4FC7-B066-1A6E056D6306}.Debug|x86.ActiveCfg = Debug|Win32
|
|
||||||
{A6103FD3-0709-4FC7-B066-1A6E056D6306}.Debug|x86.Build.0 = Debug|Win32
|
|
||||||
{A6103FD3-0709-4FC7-B066-1A6E056D6306}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{A6103FD3-0709-4FC7-B066-1A6E056D6306}.Release|x64.Build.0 = Release|x64
|
|
||||||
{A6103FD3-0709-4FC7-B066-1A6E056D6306}.Release|x86.ActiveCfg = Release|Win32
|
|
||||||
{A6103FD3-0709-4FC7-B066-1A6E056D6306}.Release|x86.Build.0 = Release|Win32
|
|
||||||
{6DA9B521-65B7-41E2-8F8A-F0451CC18ED8}.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
{6DA9B521-65B7-41E2-8F8A-F0451CC18ED8}.Debug|x64.Build.0 = Debug|x64
|
|
||||||
{6DA9B521-65B7-41E2-8F8A-F0451CC18ED8}.Debug|x86.ActiveCfg = Debug|Win32
|
|
||||||
{6DA9B521-65B7-41E2-8F8A-F0451CC18ED8}.Debug|x86.Build.0 = Debug|Win32
|
|
||||||
{6DA9B521-65B7-41E2-8F8A-F0451CC18ED8}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{6DA9B521-65B7-41E2-8F8A-F0451CC18ED8}.Release|x64.Build.0 = Release|x64
|
|
||||||
{6DA9B521-65B7-41E2-8F8A-F0451CC18ED8}.Release|x86.ActiveCfg = Release|Win32
|
|
||||||
{6DA9B521-65B7-41E2-8F8A-F0451CC18ED8}.Release|x86.Build.0 = Release|Win32
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Debug|x64.Build.0 = Debug|x64
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Debug|x86.ActiveCfg = Debug|Win32
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Debug|x86.Build.0 = Debug|Win32
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Release|x64.Build.0 = Release|x64
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Release|x86.ActiveCfg = Release|Win32
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Release|x86.Build.0 = Release|Win32
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x64.Build.0 = Debug|x64
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x86.ActiveCfg = Debug|Win32
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x86.Build.0 = Debug|Win32
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x64.Build.0 = Release|x64
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x86.ActiveCfg = Release|Win32
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x86.Build.0 = Release|Win32
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
||||||
SolutionGuid = {DCE19FF1-37C0-49CD-915A-DD695E15F00B}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
||||||
@@ -0,0 +1,192 @@
|
|||||||
|
#include "AudioExporter.h"
|
||||||
|
#include "Main.h"
|
||||||
|
#include <Animation.h>
|
||||||
|
#include <Utils/MemoryStream.h>
|
||||||
|
#include <Globals.h>
|
||||||
|
#include <Utils/File.h>
|
||||||
|
#include "DisplayListExporter.h"
|
||||||
|
|
||||||
|
void OTRExporter_Audio::WriteSampleEntryReference(ZAudio* audio, SampleEntry* entry, std::map<uint32_t, SampleEntry*> samples, BinaryWriter* writer)
|
||||||
|
{
|
||||||
|
writer->Write((uint8_t)(entry != nullptr ? 1 : 0));
|
||||||
|
|
||||||
|
if (entry != nullptr)
|
||||||
|
{
|
||||||
|
if (audio->sampleOffsets[entry->bankId].find(entry->sampleLoopOffset) != audio->sampleOffsets[entry->bankId].end())
|
||||||
|
{
|
||||||
|
if (audio->sampleOffsets[entry->bankId][entry->sampleLoopOffset].find(entry->sampleDataOffset) != audio->sampleOffsets[entry->bankId][entry->sampleLoopOffset].end())
|
||||||
|
{
|
||||||
|
writer->Write(StringHelper::Sprintf("audio/samples/%s", audio->sampleOffsets[entry->bankId][entry->sampleLoopOffset][entry->sampleDataOffset].c_str()));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
writer->Write(entry->fileName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
writer->Write(entry->fileName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
writer->Write("");
|
||||||
|
}
|
||||||
|
|
||||||
|
void OTRExporter_Audio::WriteSampleEntry(SampleEntry* entry, BinaryWriter* writer)
|
||||||
|
{
|
||||||
|
WriteHeader(nullptr, "", writer, Ship::ResourceType::AudioSample, Ship::Version::Rachael);
|
||||||
|
|
||||||
|
writer->Write(entry->codec);
|
||||||
|
writer->Write(entry->medium);
|
||||||
|
writer->Write(entry->unk_bit26);
|
||||||
|
writer->Write(entry->unk_bit25);
|
||||||
|
|
||||||
|
writer->Write((uint32_t)entry->data.size());
|
||||||
|
writer->Write((char*)entry->data.data(), entry->data.size());
|
||||||
|
|
||||||
|
writer->Write((uint32_t)(entry->loop.start));
|
||||||
|
writer->Write((uint32_t)(entry->loop.end));
|
||||||
|
writer->Write((uint32_t)(entry->loop.count));
|
||||||
|
writer->Write((uint32_t)entry->loop.states.size());
|
||||||
|
|
||||||
|
for (size_t i = 0; i < entry->loop.states.size(); i++)
|
||||||
|
writer->Write((entry->loop.states[i]));
|
||||||
|
|
||||||
|
writer->Write((uint32_t)(entry->book.order));
|
||||||
|
writer->Write((uint32_t)(entry->book.npredictors));
|
||||||
|
writer->Write((uint32_t)entry->book.books.size());
|
||||||
|
|
||||||
|
for (size_t i = 0; i < entry->book.books.size(); i++)
|
||||||
|
writer->Write((entry->book.books[i]));
|
||||||
|
}
|
||||||
|
|
||||||
|
void OTRExporter_Audio::WriteSoundFontEntry(ZAudio* audio, SoundFontEntry* entry, std::map<uint32_t, SampleEntry*> samples, BinaryWriter* writer)
|
||||||
|
{
|
||||||
|
writer->Write((uint8_t)(entry != nullptr ? 1 : 0));
|
||||||
|
|
||||||
|
if (entry != nullptr)
|
||||||
|
{
|
||||||
|
WriteSampleEntryReference(audio, entry->sampleEntry, samples, writer);
|
||||||
|
writer->Write(entry->tuning);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OTRExporter_Audio::WriteEnvData(std::vector<AdsrEnvelope*> envelopes, BinaryWriter* writer)
|
||||||
|
{
|
||||||
|
writer->Write((uint32_t)envelopes.size());
|
||||||
|
|
||||||
|
for (auto env : envelopes)
|
||||||
|
{
|
||||||
|
writer->Write(env->delay);
|
||||||
|
writer->Write(env->arg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
|
||||||
|
{
|
||||||
|
ZAudio* audio = (ZAudio*)res;
|
||||||
|
|
||||||
|
WriteHeader(res, outPath, writer, Ship::ResourceType::Audio, Ship::Version::Rachael);
|
||||||
|
|
||||||
|
// Write Samples as individual files
|
||||||
|
for (auto pair : audio->samples)
|
||||||
|
{
|
||||||
|
MemoryStream* sampleStream = new MemoryStream();
|
||||||
|
BinaryWriter sampleWriter = BinaryWriter(sampleStream);
|
||||||
|
|
||||||
|
writer->Write((uint32_t)pair.first);
|
||||||
|
WriteSampleEntry(pair.second, &sampleWriter);
|
||||||
|
|
||||||
|
std::string basePath = "";
|
||||||
|
|
||||||
|
if (audio->sampleOffsets[pair.second->bankId].find(pair.second->sampleLoopOffset) != audio->sampleOffsets[pair.second->bankId].end())
|
||||||
|
{
|
||||||
|
if (audio->sampleOffsets[pair.second->bankId][pair.second->sampleLoopOffset].find(pair.second->sampleDataOffset) != audio->sampleOffsets[pair.second->bankId][pair.second->sampleLoopOffset].end())
|
||||||
|
basePath = StringHelper::Sprintf("samples/%s", audio->sampleOffsets[pair.second->bankId][pair.second->sampleLoopOffset][pair.second->sampleDataOffset].c_str());
|
||||||
|
else
|
||||||
|
basePath = StringHelper::Sprintf("samples/sample_%08X", pair.first);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
basePath = StringHelper::Sprintf("samples/sample_%08X", pair.first);
|
||||||
|
|
||||||
|
std::string fName = OTRExporter_DisplayList::GetPathToRes(res, basePath);
|
||||||
|
AddFile(fName, sampleStream->ToVector());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write the soundfont table
|
||||||
|
for (size_t i = 0; i < audio->soundFontTable.size(); i++)
|
||||||
|
{
|
||||||
|
MemoryStream* fntStream = new MemoryStream();
|
||||||
|
BinaryWriter fntWriter = BinaryWriter(fntStream);
|
||||||
|
|
||||||
|
WriteHeader(nullptr, "", &fntWriter, Ship::ResourceType::AudioSoundFont, Ship::Version::Rachael);
|
||||||
|
|
||||||
|
fntWriter.Write((uint32_t)i);
|
||||||
|
fntWriter.Write(audio->soundFontTable[i].medium);
|
||||||
|
fntWriter.Write(audio->soundFontTable[i].cachePolicy);
|
||||||
|
fntWriter.Write(audio->soundFontTable[i].data1);
|
||||||
|
fntWriter.Write(audio->soundFontTable[i].data2);
|
||||||
|
fntWriter.Write(audio->soundFontTable[i].data3);
|
||||||
|
|
||||||
|
fntWriter.Write((uint32_t)audio->soundFontTable[i].drums.size());
|
||||||
|
fntWriter.Write((uint32_t)audio->soundFontTable[i].instruments.size());
|
||||||
|
fntWriter.Write((uint32_t)audio->soundFontTable[i].soundEffects.size());
|
||||||
|
|
||||||
|
for (size_t k = 0; k < audio->soundFontTable[i].drums.size(); k++)
|
||||||
|
{
|
||||||
|
fntWriter.Write(audio->soundFontTable[i].drums[k].releaseRate);
|
||||||
|
fntWriter.Write(audio->soundFontTable[i].drums[k].pan);
|
||||||
|
fntWriter.Write(audio->soundFontTable[i].drums[k].loaded);
|
||||||
|
|
||||||
|
WriteEnvData(audio->soundFontTable[i].drums[k].env, &fntWriter);
|
||||||
|
|
||||||
|
WriteSampleEntryReference(audio, audio->soundFontTable[i].drums[k].sample, audio->samples, &fntWriter);
|
||||||
|
fntWriter.Write(audio->soundFontTable[i].drums[k].tuning);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t k = 0; k < audio->soundFontTable[i].instruments.size(); k++)
|
||||||
|
{
|
||||||
|
fntWriter.Write((uint8_t)audio->soundFontTable[i].instruments[k].isValidInstrument);
|
||||||
|
|
||||||
|
fntWriter.Write(audio->soundFontTable[i].instruments[k].loaded);
|
||||||
|
fntWriter.Write(audio->soundFontTable[i].instruments[k].normalRangeLo);
|
||||||
|
fntWriter.Write(audio->soundFontTable[i].instruments[k].normalRangeHi);
|
||||||
|
fntWriter.Write(audio->soundFontTable[i].instruments[k].releaseRate);
|
||||||
|
|
||||||
|
WriteEnvData(audio->soundFontTable[i].instruments[k].env, &fntWriter);
|
||||||
|
|
||||||
|
WriteSoundFontEntry(audio, audio->soundFontTable[i].instruments[k].lowNotesSound, audio->samples, &fntWriter);
|
||||||
|
WriteSoundFontEntry(audio, audio->soundFontTable[i].instruments[k].normalNotesSound, audio->samples, &fntWriter);
|
||||||
|
WriteSoundFontEntry(audio, audio->soundFontTable[i].instruments[k].highNotesSound, audio->samples, &fntWriter);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t k = 0; k < audio->soundFontTable[i].soundEffects.size(); k++)
|
||||||
|
{
|
||||||
|
WriteSoundFontEntry(audio, audio->soundFontTable[i].soundEffects[k], audio->samples, &fntWriter);
|
||||||
|
}
|
||||||
|
|
||||||
|
//std::string fName = OTRExporter_DisplayList::GetPathToRes(res, StringHelper::Sprintf("fonts/font_%02X", i));
|
||||||
|
std::string fName = OTRExporter_DisplayList::GetPathToRes(res, StringHelper::Sprintf("fonts/%s", audio->soundFontNames[i].c_str()));
|
||||||
|
AddFile(fName, fntStream->ToVector());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write Sequences
|
||||||
|
for (size_t i = 0; i < audio->sequences.size(); i++)
|
||||||
|
{
|
||||||
|
auto seq = audio->sequences[i];
|
||||||
|
|
||||||
|
MemoryStream* seqStream = new MemoryStream();
|
||||||
|
BinaryWriter seqWriter = BinaryWriter(seqStream);
|
||||||
|
|
||||||
|
WriteHeader(nullptr, "", &seqWriter, Ship::ResourceType::AudioSequence, Ship::Version::Rachael);
|
||||||
|
|
||||||
|
seqWriter.Write((uint32_t)seq.size());
|
||||||
|
seqWriter.Write(seq.data(), seq.size());
|
||||||
|
seqWriter.Write((uint8_t)i);
|
||||||
|
seqWriter.Write((uint8_t)audio->sequenceTable[i].medium);
|
||||||
|
seqWriter.Write((uint8_t)audio->sequenceTable[i].cachePolicy);
|
||||||
|
seqWriter.Write((uint32_t)audio->fontIndices[i].size());
|
||||||
|
|
||||||
|
for (size_t k = 0; k < audio->fontIndices[i].size(); k++)
|
||||||
|
seqWriter.Write((uint8_t)audio->fontIndices[i][k]);
|
||||||
|
|
||||||
|
std::string fName = OTRExporter_DisplayList::GetPathToRes(res, StringHelper::Sprintf("sequences/%s", audio->seqNames[i].c_str()));
|
||||||
|
AddFile(fName, seqStream->ToVector());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "ZResource.h"
|
||||||
|
#include "ZAudio.h"
|
||||||
|
#include "Exporter.h"
|
||||||
|
#include <Utils/BinaryWriter.h>
|
||||||
|
|
||||||
|
class OTRExporter_Audio : public OTRExporter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void WriteSampleEntry(SampleEntry* entry, BinaryWriter* writer);
|
||||||
|
void WriteSampleEntryReference(ZAudio* audio, SampleEntry* entry, std::map<uint32_t, SampleEntry*> samples, BinaryWriter* writer);
|
||||||
|
void WriteSoundFontEntry(ZAudio* audio, SoundFontEntry* entry, std::map<uint32_t, SampleEntry*> samples, BinaryWriter* writer);
|
||||||
|
void WriteEnvData(std::vector<AdsrEnvelope*> envelopes, BinaryWriter* writer);
|
||||||
|
virtual void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
|
||||||
|
};
|
||||||
@@ -0,0 +1,242 @@
|
|||||||
|
set(PROJECT_NAME OTRExporter)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Source groups
|
||||||
|
################################################################################
|
||||||
|
set(Header_Files
|
||||||
|
"AnimationExporter.h"
|
||||||
|
"ArrayExporter.h"
|
||||||
|
"AudioExporter.h"
|
||||||
|
"BackgroundExporter.h"
|
||||||
|
"BlobExporter.h"
|
||||||
|
"CollisionExporter.h"
|
||||||
|
"command_macros_base.h"
|
||||||
|
"CutsceneExporter.h"
|
||||||
|
"DisplayListExporter.h"
|
||||||
|
"Exporter.h"
|
||||||
|
"Main.h"
|
||||||
|
"MtxExporter.h"
|
||||||
|
"PathExporter.h"
|
||||||
|
"PlayerAnimationExporter.h"
|
||||||
|
"RoomExporter.h"
|
||||||
|
"SkeletonExporter.h"
|
||||||
|
"SkeletonLimbExporter.h"
|
||||||
|
"TextExporter.h"
|
||||||
|
"TextureExporter.h"
|
||||||
|
"VersionInfo.h"
|
||||||
|
"VtxExporter.h"
|
||||||
|
"z64cutscene.h"
|
||||||
|
"z64cutscene_commands.h"
|
||||||
|
)
|
||||||
|
source_group("Header Files" FILES ${Header_Files})
|
||||||
|
|
||||||
|
set(Source_Files
|
||||||
|
"AnimationExporter.cpp"
|
||||||
|
"ArrayExporter.cpp"
|
||||||
|
"AudioExporter.cpp"
|
||||||
|
"BackgroundExporter.cpp"
|
||||||
|
"BlobExporter.cpp"
|
||||||
|
"CollisionExporter.cpp"
|
||||||
|
"CutsceneExporter.cpp"
|
||||||
|
"DisplayListExporter.cpp"
|
||||||
|
"Exporter.cpp"
|
||||||
|
"Main.cpp"
|
||||||
|
"MtxExporter.cpp"
|
||||||
|
"PathExporter.cpp"
|
||||||
|
"PlayerAnimationExporter.cpp"
|
||||||
|
"RoomExporter.cpp"
|
||||||
|
"SkeletonExporter.cpp"
|
||||||
|
"SkeletonLimbExporter.cpp"
|
||||||
|
"TextExporter.cpp"
|
||||||
|
"TextureExporter.cpp"
|
||||||
|
"VersionInfo.cpp"
|
||||||
|
"VtxExporter.cpp"
|
||||||
|
)
|
||||||
|
source_group("Source Files" FILES ${Source_Files})
|
||||||
|
|
||||||
|
set(ALL_FILES
|
||||||
|
${Header_Files}
|
||||||
|
${Source_Files}
|
||||||
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Target
|
||||||
|
################################################################################
|
||||||
|
add_library(${PROJECT_NAME} STATIC ${ALL_FILES})
|
||||||
|
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
use_props(${PROJECT_NAME} "${CMAKE_CONFIGURATION_TYPES}" "${DEFAULT_CXX_PROPS}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(ROOT_NAMESPACE OTRExporter)
|
||||||
|
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||||
|
VS_GLOBAL_KEYWORD "Win32Proj"
|
||||||
|
)
|
||||||
|
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
||||||
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||||
|
INTERPROCEDURAL_OPTIMIZATION_RELEASE "TRUE"
|
||||||
|
)
|
||||||
|
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x86")
|
||||||
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||||
|
INTERPROCEDURAL_OPTIMIZATION_RELEASE "TRUE"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
################################################################################
|
||||||
|
# MSVC runtime library
|
||||||
|
################################################################################
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
get_property(MSVC_RUNTIME_LIBRARY_DEFAULT TARGET ${PROJECT_NAME} PROPERTY MSVC_RUNTIME_LIBRARY)
|
||||||
|
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
||||||
|
string(CONCAT "MSVC_RUNTIME_LIBRARY_STR"
|
||||||
|
$<$<CONFIG:Debug>:
|
||||||
|
MultiThreadedDebug
|
||||||
|
>
|
||||||
|
$<$<CONFIG:Release>:
|
||||||
|
MultiThreaded
|
||||||
|
>
|
||||||
|
$<$<NOT:$<OR:$<CONFIG:Debug>,$<CONFIG:Release>>>:${MSVC_RUNTIME_LIBRARY_DEFAULT}>
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
set_target_properties(${PROJECT_NAME} PROPERTIES MSVC_RUNTIME_LIBRARY ${MSVC_RUNTIME_LIBRARY_STR})
|
||||||
|
endif()
|
||||||
|
################################################################################
|
||||||
|
# Compile definitions
|
||||||
|
################################################################################
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
||||||
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||||
|
"$<$<CONFIG:Debug>:"
|
||||||
|
"_DEBUG"
|
||||||
|
">"
|
||||||
|
"$<$<CONFIG:Release>:"
|
||||||
|
"NDEBUG"
|
||||||
|
">"
|
||||||
|
"_CONSOLE;"
|
||||||
|
"_CRT_SECURE_NO_WARNINGS;"
|
||||||
|
"UNICODE;"
|
||||||
|
"_UNICODE"
|
||||||
|
STORMLIB_NO_AUTO_LINK
|
||||||
|
)
|
||||||
|
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x86")
|
||||||
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||||
|
"$<$<CONFIG:Debug>:"
|
||||||
|
"_DEBUG;"
|
||||||
|
"_CRT_SECURE_NO_WARNINGS"
|
||||||
|
">"
|
||||||
|
"$<$<CONFIG:Release>:"
|
||||||
|
"NDEBUG"
|
||||||
|
">"
|
||||||
|
"WIN32;"
|
||||||
|
"_CONSOLE;"
|
||||||
|
"UNICODE;"
|
||||||
|
"_UNICODE"
|
||||||
|
STORMLIB_NO_AUTO_LINK
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|AppleClang")
|
||||||
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||||
|
"$<$<CONFIG:Debug>:"
|
||||||
|
"_DEBUG"
|
||||||
|
">"
|
||||||
|
"$<$<CONFIG:Release>:"
|
||||||
|
"NDEBUG"
|
||||||
|
">"
|
||||||
|
"_CONSOLE;"
|
||||||
|
"_CRT_SECURE_NO_WARNINGS;"
|
||||||
|
"UNICODE;"
|
||||||
|
"_UNICODE"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
################################################################################
|
||||||
|
# Compile and link options
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
target_include_directories(${PROJECT_NAME} PRIVATE
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../ZAPDTR/ZAPD/
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/ZAPDUtils
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../ZAPDTR/lib/tinyxml2
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src/resource
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src/resource/types
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/spdlog/include
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src/graphic/Fast3D/U64
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/StormLib/src
|
||||||
|
.
|
||||||
|
)
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
||||||
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||||
|
$<$<CONFIG:Release>:
|
||||||
|
/Oi;
|
||||||
|
/Gy
|
||||||
|
>
|
||||||
|
/permissive-;
|
||||||
|
/sdl;
|
||||||
|
/W3;
|
||||||
|
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT};
|
||||||
|
${DEFAULT_CXX_EXCEPTION_HANDLING}
|
||||||
|
)
|
||||||
|
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x86")
|
||||||
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||||
|
$<$<CONFIG:Release>:
|
||||||
|
/Oi;
|
||||||
|
/Gy
|
||||||
|
>
|
||||||
|
/permissive-;
|
||||||
|
/sdl;
|
||||||
|
/W3;
|
||||||
|
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT};
|
||||||
|
${DEFAULT_CXX_EXCEPTION_HANDLING}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
||||||
|
target_link_options(${PROJECT_NAME} PRIVATE
|
||||||
|
$<$<CONFIG:Release>:
|
||||||
|
/OPT:REF;
|
||||||
|
/OPT:ICF
|
||||||
|
>
|
||||||
|
/SUBSYSTEM:CONSOLE
|
||||||
|
)
|
||||||
|
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x86")
|
||||||
|
target_link_options(${PROJECT_NAME} PRIVATE
|
||||||
|
$<$<CONFIG:Release>:
|
||||||
|
/DEBUG;
|
||||||
|
/OPT:REF;
|
||||||
|
/OPT:ICF;
|
||||||
|
/INCREMENTAL:NO
|
||||||
|
>
|
||||||
|
/SUBSYSTEM:CONSOLE
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|AppleClang")
|
||||||
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||||
|
-Wall -Wextra -Wno-error
|
||||||
|
-Wno-unused-parameter
|
||||||
|
-Wno-unused-function
|
||||||
|
-Wno-unused-variable
|
||||||
|
-Wno-missing-field-initializers
|
||||||
|
-Wno-parentheses
|
||||||
|
-Wno-narrowing
|
||||||
|
$<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-enum-enum-conversion>
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
################################################################################
|
||||||
|
# Dependencies
|
||||||
|
################################################################################
|
||||||
|
add_dependencies(${PROJECT_NAME}
|
||||||
|
libultraship
|
||||||
|
)
|
||||||
|
|
||||||
|
# Link with other targets.
|
||||||
|
target_link_libraries(${PROJECT_NAME} PUBLIC "${ADDITIONAL_LIBRARY_DEPENDENCIES}")
|
||||||
|
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
#include "../ZAPD/ZFile.h"
|
#include "../ZAPD/ZFile.h"
|
||||||
#include <Utils/MemoryStream.h>
|
#include <Utils/MemoryStream.h>
|
||||||
#include <Utils/BitConverter.h>
|
#include <Utils/BitConverter.h>
|
||||||
#include "Lib/StrHash64.h"
|
#include "StrHash64/StrHash64.h"
|
||||||
#include "spdlog/spdlog.h"
|
#include "spdlog/spdlog.h"
|
||||||
#include "PR/ultra64/gbi.h"
|
#include "PR/ultra64/gbi.h"
|
||||||
#include <Globals.h>
|
#include <Globals.h>
|
||||||
@@ -96,14 +96,14 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
{
|
{
|
||||||
case G_NOOP:
|
case G_NOOP:
|
||||||
{
|
{
|
||||||
Gfx value = gsDPNoOp();
|
Gfx value = {gsDPNoOp()};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case G_ENDDL:
|
case G_ENDDL:
|
||||||
{
|
{
|
||||||
Gfx value = gsSPEndDisplayList();
|
Gfx value = {gsSPEndDisplayList()};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
@@ -114,7 +114,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
int32_t nnnn = (data & 0x0000FFFF00000000ULL) >> 32;
|
int32_t nnnn = (data & 0x0000FFFF00000000ULL) >> 32;
|
||||||
int32_t vvvvvvvv = (data & 0x00000000FFFFFFFFULL);
|
int32_t vvvvvvvv = (data & 0x00000000FFFFFFFFULL);
|
||||||
|
|
||||||
Gfx value = gsSPModifyVertex(nnnn / 2, ww, vvvvvvvv);
|
Gfx value = {gsSPModifyVertex(nnnn / 2, ww, vvvvvvvv)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
@@ -131,35 +131,35 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
int32_t cccccc = (data & 0x00FFFFFF00000000) >> 32;
|
int32_t cccccc = (data & 0x00FFFFFF00000000) >> 32;
|
||||||
int32_t ssssssss = (data & 0xFFFFFFFF);
|
int32_t ssssssss = (data & 0xFFFFFFFF);
|
||||||
|
|
||||||
Gfx value = gsSPGeometryMode(~cccccc, ssssssss);
|
Gfx value = {gsSPGeometryMode(~cccccc, ssssssss)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case G_RDPPIPESYNC:
|
case G_RDPPIPESYNC:
|
||||||
{
|
{
|
||||||
Gfx value = gsDPPipeSync();
|
Gfx value = {gsDPPipeSync()};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case G_RDPLOADSYNC:
|
case G_RDPLOADSYNC:
|
||||||
{
|
{
|
||||||
Gfx value = gsDPLoadSync();
|
Gfx value = {gsDPLoadSync()};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case G_RDPTILESYNC:
|
case G_RDPTILESYNC:
|
||||||
{
|
{
|
||||||
Gfx value = gsDPTileSync();
|
Gfx value = {gsDPTileSync()};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case G_RDPFULLSYNC:
|
case G_RDPFULLSYNC:
|
||||||
{
|
{
|
||||||
Gfx value = gsDPFullSync();
|
Gfx value = {gsDPFullSync()};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
@@ -169,14 +169,14 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
int32_t hhhhhh = (data & 0x00FFFFFF00000000) >> 32;
|
int32_t hhhhhh = (data & 0x00FFFFFF00000000) >> 32;
|
||||||
int32_t llllllll = (data & 0x00000000FFFFFFFF);
|
int32_t llllllll = (data & 0x00000000FFFFFFFF);
|
||||||
|
|
||||||
Gfx value = gsDPSetOtherMode(hhhhhh, llllllll);
|
Gfx value = {gsDPSetOtherMode(hhhhhh, llllllll)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case G_POPMTX:
|
case G_POPMTX:
|
||||||
{
|
{
|
||||||
Gfx value = gsSPPopMatrix(data);
|
Gfx value = {gsSPPopMatrix(data)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
@@ -188,7 +188,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
uint8_t b = (uint8_t)((data & 0xFF00FF00) >> 8);
|
uint8_t b = (uint8_t)((data & 0xFF00FF00) >> 8);
|
||||||
uint8_t a = (uint8_t)((data & 0x000000FF) >> 0);
|
uint8_t a = (uint8_t)((data & 0x000000FF) >> 0);
|
||||||
|
|
||||||
Gfx value = gsDPSetEnvColor(r, g, b, a);
|
Gfx value = {gsDPSetEnvColor(r, g, b, a)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
@@ -204,7 +204,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
|
|
||||||
mm = (mm & 0x0FFFFFFF) + 1;
|
mm = (mm & 0x0FFFFFFF) + 1;
|
||||||
|
|
||||||
Gfx value = gsSPMatrix(mm, pp);
|
Gfx value = {gsSPMatrix(mm, pp)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
@@ -214,7 +214,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
uint32_t mm = (data & 0x00000000FFFFFFFF);
|
uint32_t mm = (data & 0x00000000FFFFFFFF);
|
||||||
pp ^= G_MTX_PUSH;
|
pp ^= G_MTX_PUSH;
|
||||||
|
|
||||||
Gfx value = gsSPMatrix(mm, pp);
|
Gfx value = {gsSPMatrix(mm, pp)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
|
|
||||||
@@ -253,7 +253,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
int32_t xxx = (data & 0x0000000000FFF000) >> 12;
|
int32_t xxx = (data & 0x0000000000FFF000) >> 12;
|
||||||
int32_t ddd = (data & 0x0000000000000FFF);
|
int32_t ddd = (data & 0x0000000000000FFF);
|
||||||
|
|
||||||
Gfx value = gsDPLoadBlock(i, sss, ttt, xxx, ddd);
|
Gfx value = {gsDPLoadBlock(i, sss, ttt, xxx, ddd)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
@@ -263,7 +263,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
int32_t vvvv = (data & 0xFFFF00000000) >> 32;
|
int32_t vvvv = (data & 0xFFFF00000000) >> 32;
|
||||||
int32_t wwww = (data & 0x0000FFFF);
|
int32_t wwww = (data & 0x0000FFFF);
|
||||||
|
|
||||||
Gfx value = gsSPCullDisplayList(vvvv / 2, wwww / 2);
|
Gfx value = {gsSPCullDisplayList(vvvv / 2, wwww / 2)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
@@ -279,7 +279,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
uint32_t z = (data & 0x00000000FFFFFFFF) >> 0;
|
uint32_t z = (data & 0x00000000FFFFFFFF) >> 0;
|
||||||
uint32_t h = (data & 0xFFFFFFFF);
|
uint32_t h = (data & 0xFFFFFFFF);
|
||||||
|
|
||||||
Gfx value = gsSPBranchLessZraw3(h & 0x00FFFFFF);
|
Gfx value = {gsSPBranchLessZraw3(h & 0x00FFFFFF)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
@@ -292,7 +292,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
break;
|
break;
|
||||||
case G_RDPHALF_2:
|
case G_RDPHALF_2:
|
||||||
{
|
{
|
||||||
Gfx value = gsDPWordLo(data & 0xFFFFFFFF);
|
Gfx value = {gsDPWordLo(data & 0xFFFFFFFF)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
@@ -305,7 +305,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
int32_t XXX = (data & 0x0000000000FFF000) >> 12;
|
int32_t XXX = (data & 0x0000000000FFF000) >> 12;
|
||||||
int32_t YYY = (data & 0x0000000000000FFF);
|
int32_t YYY = (data & 0x0000000000000FFF);
|
||||||
|
|
||||||
Gfx value = gsSPTextureRectangle2(XXX, YYY, xxx, yyy, i);
|
Gfx value = {gsSPTextureRectangle2(XXX, YYY, xxx, yyy, i)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
@@ -324,7 +324,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
|
|
||||||
int bp = 0;
|
int bp = 0;
|
||||||
|
|
||||||
Gfx value = gsSPBranchLessZraw2(0xDEADABCD, (a / 5) | (b / 2), z);
|
Gfx value = {gsSPBranchLessZraw2(0xDEADABCD, (a / 5) | (b / 2), z)};
|
||||||
word0 = (value.words.w0 & 0x00FFFFFF) + (G_BRANCH_Z_OTR << 24);
|
word0 = (value.words.w0 & 0x00FFFFFF) + (G_BRANCH_Z_OTR << 24);
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
|
|
||||||
@@ -362,18 +362,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
BinaryWriter dlWriter = BinaryWriter(dlStream);
|
BinaryWriter dlWriter = BinaryWriter(dlStream);
|
||||||
|
|
||||||
Save(dList->otherDLists[i], outPath, &dlWriter);
|
Save(dList->otherDLists[i], outPath, &dlWriter);
|
||||||
|
AddFile(fName, dlStream->ToVector());
|
||||||
#ifdef _DEBUG
|
|
||||||
//if (otrArchive->HasFile(fName))
|
|
||||||
//otrArchive->RemoveFile(fName);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (Globals::Instance->fileMode != ZFileMode::ExtractDirectory)
|
|
||||||
File::WriteAllBytes("Extract/" + fName, dlStream->ToVector());
|
|
||||||
else
|
|
||||||
files[fName] = dlStream->ToVector();
|
|
||||||
|
|
||||||
//otrArchive->AddFile(fName, (uintptr_t)dlStream->ToVector().data(), dlWriter.GetBaseAddress());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -400,9 +389,9 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
u32 dListVal = (data & 0x0FFFFFFF) + 1;
|
u32 dListVal = (data & 0x0FFFFFFF) + 1;
|
||||||
|
|
||||||
if (pp != 0)
|
if (pp != 0)
|
||||||
value = gsSPBranchList(dListVal);
|
value = {gsSPBranchList(dListVal)};
|
||||||
else
|
else
|
||||||
value = gsSPDisplayList(dListVal);
|
value = {gsSPDisplayList(dListVal)};
|
||||||
|
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
@@ -460,10 +449,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
|
|
||||||
Save(dList->otherDLists[i], outPath, &dlWriter);
|
Save(dList->otherDLists[i], outPath, &dlWriter);
|
||||||
|
|
||||||
if (Globals::Instance->fileMode != ZFileMode::ExtractDirectory)
|
AddFile(fName, dlStream->ToVector());
|
||||||
File::WriteAllBytes("Extract/" + fName, dlStream->ToVector());
|
|
||||||
else
|
|
||||||
files[fName] = dlStream->ToVector();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -483,7 +469,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
int32_t ddd = (____ & 0x700) >> 8;
|
int32_t ddd = (____ & 0x700) >> 8;
|
||||||
int32_t nnnnnnn = (____ & 0xFE) >> 1;
|
int32_t nnnnnnn = (____ & 0xFE) >> 1;
|
||||||
|
|
||||||
Gfx value = gsSPTexture(ssss, tttt, lll, ddd, nnnnnnn);
|
Gfx value = {gsSPTexture(ssss, tttt, lll, ddd, nnnnnnn)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
@@ -494,7 +480,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
int32_t bb = ((data & 0x0000FF0000000000ULL) >> 40) / 2;
|
int32_t bb = ((data & 0x0000FF0000000000ULL) >> 40) / 2;
|
||||||
int32_t cc = ((data & 0x000000FF00000000ULL) >> 32) / 2;
|
int32_t cc = ((data & 0x000000FF00000000ULL) >> 32) / 2;
|
||||||
|
|
||||||
Gfx test = gsSP1Triangle(aa, bb, cc, 0);
|
Gfx test = {gsSP1Triangle(aa, bb, cc, 0)};
|
||||||
word0 = test.words.w0;
|
word0 = test.words.w0;
|
||||||
word1 = test.words.w1;
|
word1 = test.words.w1;
|
||||||
}
|
}
|
||||||
@@ -508,7 +494,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
int32_t ee = ((data & 0x0000000000FF00ULL) >> 8) / 2;
|
int32_t ee = ((data & 0x0000000000FF00ULL) >> 8) / 2;
|
||||||
int32_t ff = ((data & 0x000000000000FFULL) >> 0) / 2;
|
int32_t ff = ((data & 0x000000000000FFULL) >> 0) / 2;
|
||||||
|
|
||||||
Gfx test = gsSP2Triangles(aa, bb, cc, 0, dd, ee, ff, 0);
|
Gfx test = {gsSP2Triangles(aa, bb, cc, 0, dd, ee, ff, 0)};
|
||||||
word0 = test.words.w0;
|
word0 = test.words.w0;
|
||||||
word1 = test.words.w1;
|
word1 = test.words.w1;
|
||||||
}
|
}
|
||||||
@@ -520,7 +506,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
int32_t cc = ((data & 0x000000FF00000000ULL) >> 32) / 2;
|
int32_t cc = ((data & 0x000000FF00000000ULL) >> 32) / 2;
|
||||||
int32_t dd = ((data & 0x000000000000FFULL)) / 2;
|
int32_t dd = ((data & 0x000000000000FFULL)) / 2;
|
||||||
|
|
||||||
Gfx test = gsSP1Quadrangle(aa, bb, cc, dd, 0);
|
Gfx test = {gsSP1Quadrangle(aa, bb, cc, dd, 0)};
|
||||||
word0 = test.words.w0;
|
word0 = test.words.w0;
|
||||||
word1 = test.words.w1;
|
word1 = test.words.w1;
|
||||||
}
|
}
|
||||||
@@ -534,7 +520,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
int32_t bb = (data & 0x000000000000FF00) >> 8;
|
int32_t bb = (data & 0x000000000000FF00) >> 8;
|
||||||
int32_t aa = (data & 0x00000000000000FF) >> 0;
|
int32_t aa = (data & 0x00000000000000FF) >> 0;
|
||||||
|
|
||||||
Gfx value = gsDPSetPrimColor(mm, ff, rr, gg, bb, aa);
|
Gfx value = {gsDPSetPrimColor(mm, ff, rr, gg, bb, aa)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
@@ -548,7 +534,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
|
|
||||||
// TODO: Output the correct render modes in data
|
// TODO: Output the correct render modes in data
|
||||||
|
|
||||||
Gfx value = gsSPSetOtherMode(0xE2, sft, len, dd);
|
Gfx value = {gsSPSetOtherMode(0xE2, sft, len, dd)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
@@ -566,11 +552,11 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
if (sft == 14) // G_MDSFT_TEXTLUT
|
if (sft == 14) // G_MDSFT_TEXTLUT
|
||||||
{
|
{
|
||||||
const char* types[] = { "G_TT_NONE", "G_TT_NONE", "G_TT_RGBA16", "G_TT_IA16" };
|
const char* types[] = { "G_TT_NONE", "G_TT_NONE", "G_TT_RGBA16", "G_TT_IA16" };
|
||||||
value = gsDPSetTextureLUT(dd >> 14);
|
value = {gsDPSetTextureLUT(dd >> 14)};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
value = gsSPSetOtherMode(0xE3, sft, nn + 1, dd);
|
value = {gsSPSetOtherMode(0xE3, sft, nn + 1, dd)};
|
||||||
}
|
}
|
||||||
|
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
@@ -597,7 +583,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
int32_t bbbb = (data & 0b0000000000000000000000000000000000000000000000000000000011110000) >> 4;
|
int32_t bbbb = (data & 0b0000000000000000000000000000000000000000000000000000000011110000) >> 4;
|
||||||
int32_t uuuu = (data & 0b0000000000000000000000000000000000000000000000000000000000001111);
|
int32_t uuuu = (data & 0b0000000000000000000000000000000000000000000000000000000000001111);
|
||||||
|
|
||||||
Gfx value = gsDPSetTile(fff, ii, nnnnnnnnn, mmmmmmmmm, ttt, pppp, cc, aaaa, ssss, dd, bbbb, uuuu);
|
Gfx value = {gsDPSetTile(fff, ii, nnnnnnnnn, mmmmmmmmm, ttt, pppp, cc, aaaa, ssss, dd, bbbb, uuuu)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
@@ -621,7 +607,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
int32_t ab1 = (data & 0b00000000000000000000000000000000000000000000000000000000111000) >> 3;
|
int32_t ab1 = (data & 0b00000000000000000000000000000000000000000000000000000000111000) >> 3;
|
||||||
int32_t ad1 = (data & 0b00000000000000000000000000000000000000000000000000000000000111) >> 0;
|
int32_t ad1 = (data & 0b00000000000000000000000000000000000000000000000000000000000111) >> 0;
|
||||||
|
|
||||||
Gfx value = gsDPSetCombineLERP2(a0, b0, c0, d0, aa0, ab0, ac0, ad0, a1, b1, c1, d1, aa1, ab1, ac1, ad1);
|
Gfx value = {gsDPSetCombineLERP2(a0, b0, c0, d0, aa0, ab0, ac0, ad0, a1, b1, c1, d1, aa1, ab1, ac1, ad1)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
@@ -634,7 +620,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
int32_t vvv = (data & 0x0000000000000FFF);
|
int32_t vvv = (data & 0x0000000000000FFF);
|
||||||
int32_t i = (data & 0x000000000F000000) >> 24;
|
int32_t i = (data & 0x000000000F000000) >> 24;
|
||||||
|
|
||||||
Gfx value = gsDPSetTileSize(i, sss, ttt, uuu, vvv);
|
Gfx value = {gsDPSetTileSize(i, sss, ttt, uuu, vvv)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
@@ -644,7 +630,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
int32_t t = (data & 0x0000000007000000) >> 24;
|
int32_t t = (data & 0x0000000007000000) >> 24;
|
||||||
int32_t ccc = (data & 0x00000000003FF000) >> 14;
|
int32_t ccc = (data & 0x00000000003FF000) >> 14;
|
||||||
|
|
||||||
Gfx value = gsDPLoadTLUTCmd(t, ccc);
|
Gfx value = {gsDPLoadTLUTCmd(t, ccc)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
@@ -657,7 +643,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
int uuu = (data & 0x0000000000FFF000) >> 12;
|
int uuu = (data & 0x0000000000FFF000) >> 12;
|
||||||
int vvv= (data & 0x0000000000000FFF);
|
int vvv= (data & 0x0000000000000FFF);
|
||||||
|
|
||||||
Gfx value = gsDPLoadTile(i, sss, ttt, uuu, vvv);
|
Gfx value = {gsDPLoadTile(i, sss, ttt, uuu, vvv)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
}
|
}
|
||||||
@@ -667,15 +653,20 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
uint32_t seg = data & 0xFFFFFFFF;
|
uint32_t seg = data & 0xFFFFFFFF;
|
||||||
int32_t texAddress = Seg2Filespace(data, dList->parent->baseAddress);
|
int32_t texAddress = Seg2Filespace(data, dList->parent->baseAddress);
|
||||||
|
|
||||||
if (!Globals::Instance->HasSegment(GETSEGNUM(seg), res->parent->workerID))
|
if (!Globals::Instance->HasSegment(GETSEGNUM(seg), res->parent->workerID) || (res->GetName() == "sShadowMaterialDL"))
|
||||||
{
|
{
|
||||||
|
if (res->GetName() == "sShadowMaterialDL") {
|
||||||
|
// sShadowMaterialDL (In ovl_En_Jsjutan) has a texture in bss. This is a hack to override the reference to one
|
||||||
|
// to segment C. The actor has been modified to load the texture into segment C.
|
||||||
|
seg = 0x0C000000;
|
||||||
|
}
|
||||||
int32_t __ = (data & 0x00FF000000000000) >> 48;
|
int32_t __ = (data & 0x00FF000000000000) >> 48;
|
||||||
int32_t www = (data & 0x00000FFF00000000) >> 32;
|
int32_t www = (data & 0x00000FFF00000000) >> 32;
|
||||||
|
|
||||||
uint32_t fmt = (__ & 0xE0) >> 5;
|
uint32_t fmt = (__ & 0xE0) >> 5;
|
||||||
uint32_t siz = (__ & 0x18) >> 3;
|
uint32_t siz = (__ & 0x18) >> 3;
|
||||||
|
|
||||||
Gfx value = gsDPSetTextureImage(fmt, siz, www + 1, (seg & 0x0FFFFFFF) + 1);
|
Gfx value = {gsDPSetTextureImage(fmt, siz, www + 1, (seg & 0x0FFFFFFF) + 1)};
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1;
|
word1 = value.words.w1;
|
||||||
|
|
||||||
@@ -693,7 +684,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
uint32_t fmt = (__ & 0xE0) >> 5;
|
uint32_t fmt = (__ & 0xE0) >> 5;
|
||||||
uint32_t siz = (__ & 0x18) >> 3;
|
uint32_t siz = (__ & 0x18) >> 3;
|
||||||
|
|
||||||
Gfx value = gsDPSetTextureImage(fmt, siz, www + 1, __);
|
Gfx value = {gsDPSetTextureImage(fmt, siz, www + 1, __)};
|
||||||
word0 = value.words.w0 & 0x00FFFFFF;
|
word0 = value.words.w0 & 0x00FFFFFF;
|
||||||
word0 += (G_SETTIMG_OTR << 24);
|
word0 += (G_SETTIMG_OTR << 24);
|
||||||
//word1 = value.words.w1;
|
//word1 = value.words.w1;
|
||||||
@@ -736,7 +727,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
int32_t aa = (data & 0x000000FF00000000ULL) >> 32;
|
int32_t aa = (data & 0x000000FF00000000ULL) >> 32;
|
||||||
int32_t nn = (data & 0x000FF00000000000ULL) >> 44;
|
int32_t nn = (data & 0x000FF00000000000ULL) >> 44;
|
||||||
|
|
||||||
Gfx value = gsSPVertex(data & 0xFFFFFFFF, nn, ((aa >> 1) - nn));
|
Gfx value = {gsSPVertex(data & 0xFFFFFFFF, nn, ((aa >> 1) - nn))};
|
||||||
|
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word1 = value.words.w1 | 1;
|
word1 = value.words.w1 | 1;
|
||||||
@@ -759,7 +750,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
{
|
{
|
||||||
uint32_t diff = segOffset - vtxDecl->address;
|
uint32_t diff = segOffset - vtxDecl->address;
|
||||||
|
|
||||||
Gfx value = gsSPVertex(diff, nn, ((aa >> 1) - nn));
|
Gfx value = {gsSPVertex(diff, nn, ((aa >> 1) - nn))};
|
||||||
|
|
||||||
word0 = value.words.w0;
|
word0 = value.words.w0;
|
||||||
word0 &= 0x00FFFFFF;
|
word0 &= 0x00FFFFFF;
|
||||||
@@ -827,10 +818,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Globals::Instance->fileMode != ZFileMode::ExtractDirectory)
|
AddFile(fName, vtxStream->ToVector());
|
||||||
File::WriteAllBytes("Extract/" + fName, vtxStream->ToVector());
|
|
||||||
else
|
|
||||||
files[fName] = vtxStream->ToVector();
|
|
||||||
|
|
||||||
auto end = std::chrono::steady_clock::now();
|
auto end = std::chrono::steady_clock::now();
|
||||||
size_t diff = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
|
size_t diff = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
|
||||||
@@ -894,8 +882,14 @@ std::string OTRExporter_DisplayList::GetPrefix(ZResource* res)
|
|||||||
std::string prefix = "";
|
std::string prefix = "";
|
||||||
std::string xmlPath = StringHelper::Replace(res->parent->GetXmlFilePath().string(), "\\", "/");
|
std::string xmlPath = StringHelper::Replace(res->parent->GetXmlFilePath().string(), "\\", "/");
|
||||||
|
|
||||||
if (StringHelper::Contains(oName, "_scene") || StringHelper::Contains(oName, "_room"))
|
if (StringHelper::Contains(oName, "_scene") || StringHelper::Contains(oName, "_room")) {
|
||||||
prefix = "scenes";
|
prefix = "scenes";
|
||||||
|
if (Globals::Instance->rom->IsMQ()) {
|
||||||
|
prefix += "/mq";
|
||||||
|
} else {
|
||||||
|
prefix += "/nonmq";
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (StringHelper::Contains(xmlPath, "objects/"))
|
else if (StringHelper::Contains(xmlPath, "objects/"))
|
||||||
prefix = "objects";
|
prefix = "objects";
|
||||||
else if (StringHelper::Contains(xmlPath, "textures/"))
|
else if (StringHelper::Contains(xmlPath, "textures/"))
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
#include "Exporter.h"
|
#include "Exporter.h"
|
||||||
#include "VersionInfo.h"
|
#include "VersionInfo.h"
|
||||||
|
|
||||||
void OTRExporter::WriteHeader(ZResource* res, const fs::path& outPath, BinaryWriter* writer, Ship::ResourceType resType)
|
void OTRExporter::WriteHeader(ZResource* res, const fs::path& outPath, BinaryWriter* writer, Ship::ResourceType resType, Ship::Version resVersion)
|
||||||
{
|
{
|
||||||
writer->Write((uint8_t)Endianess::Little); // 0x00
|
writer->Write((uint8_t)Endianness::Little); // 0x00
|
||||||
writer->Write((uint8_t)0); // 0x01
|
writer->Write((uint8_t)0); // 0x01
|
||||||
writer->Write((uint8_t)0); // 0x02
|
writer->Write((uint8_t)0); // 0x02
|
||||||
writer->Write((uint8_t)0); // 0x03
|
writer->Write((uint8_t)0); // 0x03
|
||||||
|
|
||||||
writer->Write((uint32_t)resType); // 0x04
|
writer->Write((uint32_t)resType); // 0x04
|
||||||
writer->Write((uint32_t)MAJOR_VERSION); // 0x08
|
//writer->Write((uint32_t)MAJOR_VERSION); // 0x08
|
||||||
|
writer->Write((uint32_t)resVersion); // 0x08
|
||||||
writer->Write((uint64_t)0xDEADBEEFDEADBEEF); // id, 0x0C
|
writer->Write((uint64_t)0xDEADBEEFDEADBEEF); // id, 0x0C
|
||||||
writer->Write((uint32_t)resourceVersions[resType]); // 0x10
|
writer->Write((uint32_t)resourceVersions[resType]); // 0x10
|
||||||
writer->Write((uint64_t)0); // ROM CRC, 0x14
|
writer->Write((uint64_t)0); // ROM CRC, 0x14
|
||||||
|
|||||||
@@ -4,9 +4,10 @@
|
|||||||
//#include "OTRExporter.h"
|
//#include "OTRExporter.h"
|
||||||
#include <Utils/BinaryWriter.h>
|
#include <Utils/BinaryWriter.h>
|
||||||
#include <Resource.h>
|
#include <Resource.h>
|
||||||
|
#include "VersionInfo.h"
|
||||||
|
|
||||||
class OTRExporter : public ZResourceExporter
|
class OTRExporter : public ZResourceExporter
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
static void WriteHeader(ZResource* res, const fs::path& outPath, BinaryWriter* writer, Ship::ResourceType resType);
|
static void WriteHeader(ZResource* res, const fs::path& outPath, BinaryWriter* writer, Ship::ResourceType resType, Ship::Version resVersion = MAJOR_VERSION);
|
||||||
};
|
};
|
||||||
@@ -15,17 +15,20 @@
|
|||||||
#include "TextExporter.h"
|
#include "TextExporter.h"
|
||||||
#include "BlobExporter.h"
|
#include "BlobExporter.h"
|
||||||
#include "MtxExporter.h"
|
#include "MtxExporter.h"
|
||||||
|
#include "AudioExporter.h"
|
||||||
#include <Globals.h>
|
#include <Globals.h>
|
||||||
#include <Utils/File.h>
|
#include <Utils/File.h>
|
||||||
#include <Utils/Directory.h>
|
#include <Utils/Directory.h>
|
||||||
#include <Utils/MemoryStream.h>
|
#include <Utils/MemoryStream.h>
|
||||||
#include <Utils/BinaryWriter.h>
|
#include <Utils/BinaryWriter.h>
|
||||||
|
#include <bit>
|
||||||
|
|
||||||
std::string otrFileName = "oot.otr";
|
std::string otrFileName = "oot.otr";
|
||||||
std::shared_ptr<Ship::Archive> otrArchive;
|
std::shared_ptr<Ship::Archive> otrArchive;
|
||||||
BinaryWriter* fileWriter;
|
BinaryWriter* fileWriter;
|
||||||
std::chrono::steady_clock::time_point fileStart, resStart;
|
std::chrono::steady_clock::time_point fileStart, resStart;
|
||||||
std::map<std::string, std::vector<char>> files;
|
std::map<std::string, std::vector<char>> files;
|
||||||
|
std::mutex fileMutex;
|
||||||
|
|
||||||
void InitVersionInfo();
|
void InitVersionInfo();
|
||||||
|
|
||||||
@@ -45,7 +48,7 @@ static void ExporterParseFileMode(const std::string& buildMode, ZFileMode& fileM
|
|||||||
if (File::Exists(otrFileName))
|
if (File::Exists(otrFileName))
|
||||||
otrArchive = std::shared_ptr<Ship::Archive>(new Ship::Archive(otrFileName, true));
|
otrArchive = std::shared_ptr<Ship::Archive>(new Ship::Archive(otrFileName, true));
|
||||||
else
|
else
|
||||||
otrArchive = Ship::Archive::CreateArchive(otrFileName, 65536 / 2);
|
otrArchive = Ship::Archive::CreateArchive(otrFileName, 40000);
|
||||||
|
|
||||||
auto lst = Directory::ListFiles("Extract");
|
auto lst = Directory::ListFiles("Extract");
|
||||||
|
|
||||||
@@ -61,13 +64,45 @@ static void ExporterProgramEnd()
|
|||||||
{
|
{
|
||||||
if (Globals::Instance->fileMode == ZFileMode::ExtractDirectory)
|
if (Globals::Instance->fileMode == ZFileMode::ExtractDirectory)
|
||||||
{
|
{
|
||||||
printf("Generating OTR Archive...\n");
|
printf("Creating version file...\n");
|
||||||
otrArchive = Ship::Archive::CreateArchive(otrFileName, 65536 / 2);
|
|
||||||
|
|
||||||
for (auto item : files)
|
// Get crc from rom
|
||||||
{
|
std::string romPath = Globals::Instance->baseRomPath.string();
|
||||||
|
std::vector<uint8_t> romData = File::ReadAllBytes(romPath);
|
||||||
|
uint32_t crc = BitConverter::ToUInt32BE(romData, 0x10);
|
||||||
|
uint8_t endianness = (uint8_t)Endianness::Big;
|
||||||
|
|
||||||
|
// Write crc to version file
|
||||||
|
fs::path versionPath("Extract/version");
|
||||||
|
MemoryStream* versionStream = new MemoryStream();
|
||||||
|
BinaryWriter writer(versionStream);
|
||||||
|
writer.SetEndianness(Endianness::Big);
|
||||||
|
writer.Write(endianness);
|
||||||
|
writer.Write(crc);
|
||||||
|
std::ofstream versionFile(versionPath.c_str(), std::ios::out | std::ios::binary);
|
||||||
|
versionFile.write(versionStream->ToVector().data(), versionStream->GetLength());
|
||||||
|
versionFile.flush();
|
||||||
|
versionFile.close();
|
||||||
|
writer.Close();
|
||||||
|
|
||||||
|
printf("Created version file.\n");
|
||||||
|
|
||||||
|
printf("Generating OTR Archive...\n");
|
||||||
|
otrArchive = Ship::Archive::CreateArchive(otrFileName, 40000);
|
||||||
|
|
||||||
|
for (auto item : files) {
|
||||||
|
std::string fName = item.first;
|
||||||
|
if (fName.find("gTitleZeldaShieldLogoMQTex") != std::string::npos && !ZRom(romPath).IsMQ())
|
||||||
|
{
|
||||||
|
size_t pos = 0;
|
||||||
|
if ((pos = fName.find("gTitleZeldaShieldLogoMQTex", 0)) != std::string::npos)
|
||||||
|
{
|
||||||
|
fName.replace(pos, 27, "gTitleZeldaShieldLogoTex");
|
||||||
|
}
|
||||||
|
}
|
||||||
auto fileData = item.second;
|
auto fileData = item.second;
|
||||||
otrArchive->AddFile(item.first, (uintptr_t)fileData.data(), fileData.size());
|
otrArchive->AddFile(fName, (uintptr_t)fileData.data(),
|
||||||
|
fileData.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add any additional files that need to be manually copied...
|
// Add any additional files that need to be manually copied...
|
||||||
@@ -75,13 +110,33 @@ static void ExporterProgramEnd()
|
|||||||
|
|
||||||
for (auto item : lst)
|
for (auto item : lst)
|
||||||
{
|
{
|
||||||
|
std::vector<std::string> splitPath = StringHelper::Split(item, ".");
|
||||||
|
|
||||||
|
if (splitPath.size() >= 3) {
|
||||||
|
std::string extension = splitPath.at(splitPath.size() - 1);
|
||||||
|
std::string format = splitPath.at(splitPath.size() - 2);
|
||||||
|
splitPath.pop_back();
|
||||||
|
splitPath.pop_back();
|
||||||
|
std::string afterPath = std::accumulate(splitPath.begin(), splitPath.end(), std::string(""));
|
||||||
|
if (extension == "png" && (format == "rgba32" || format == "rgb5a1" || format == "i4" || format == "i8" || format == "ia4" || format == "ia8" || format == "ia16" || format == "ci4" || format == "ci8")) {
|
||||||
|
Globals::Instance->buildRawTexture = true;
|
||||||
|
Globals::Instance->BuildAssetTexture(item, ZTexture::GetTextureTypeFromString(format), afterPath);
|
||||||
|
Globals::Instance->buildRawTexture = false;
|
||||||
|
|
||||||
|
auto fileData = File::ReadAllBytes(afterPath);
|
||||||
|
printf("otrArchive->AddFile(%s)\n", StringHelper::Split(afterPath, "Extract/")[1].c_str());
|
||||||
|
otrArchive->AddFile(StringHelper::Split(afterPath, "Extract/")[1], (uintptr_t)fileData.data(), fileData.size());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
auto fileData = File::ReadAllBytes(item);
|
auto fileData = File::ReadAllBytes(item);
|
||||||
|
printf("otrArchive->AddFile(%s)\n", StringHelper::Split(item, "Extract/")[1].c_str());
|
||||||
otrArchive->AddFile(StringHelper::Split(item, "Extract/")[1], (uintptr_t)fileData.data(), fileData.size());
|
otrArchive->AddFile(StringHelper::Split(item, "Extract/")[1], (uintptr_t)fileData.data(), fileData.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
otrArchive->AddFile("Audiobank", (uintptr_t)Globals::Instance->GetBaseromFile("Audiobank").data(), Globals::Instance->GetBaseromFile("Audiobank").size());
|
//otrArchive->AddFile("Audiobank", (uintptr_t)Globals::Instance->GetBaseromFile("Audiobank").data(), Globals::Instance->GetBaseromFile("Audiobank").size());
|
||||||
otrArchive->AddFile("Audioseq", (uintptr_t)Globals::Instance->GetBaseromFile("Audioseq").data(), Globals::Instance->GetBaseromFile("Audioseq").size());
|
//otrArchive->AddFile("Audioseq", (uintptr_t)Globals::Instance->GetBaseromFile("Audioseq").data(), Globals::Instance->GetBaseromFile("Audioseq").size());
|
||||||
otrArchive->AddFile("Audiotable", (uintptr_t)Globals::Instance->GetBaseromFile("Audiotable").data(), Globals::Instance->GetBaseromFile("Audiotable").size());
|
//otrArchive->AddFile("Audiotable", (uintptr_t)Globals::Instance->GetBaseromFile("Audiotable").data(), Globals::Instance->GetBaseromFile("Audiotable").size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,7 +213,10 @@ static void ExporterResourceEnd(ZResource* res, BinaryWriter& writer)
|
|||||||
fName = StringHelper::Sprintf("%s/%s", oName.c_str(), rName.c_str());
|
fName = StringHelper::Sprintf("%s/%s", oName.c_str(), rName.c_str());
|
||||||
|
|
||||||
if (Globals::Instance->fileMode == ZFileMode::ExtractDirectory)
|
if (Globals::Instance->fileMode == ZFileMode::ExtractDirectory)
|
||||||
|
{
|
||||||
|
std::unique_lock Lock(fileMutex);
|
||||||
files[fName] = strem->ToVector();
|
files[fName] = strem->ToVector();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
File::WriteAllBytes("Extract/" + fName, strem->ToVector());
|
File::WriteAllBytes("Extract/" + fName, strem->ToVector());
|
||||||
}
|
}
|
||||||
@@ -178,6 +236,17 @@ static void ExporterXMLEnd()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AddFile(std::string fName, std::vector<char> data)
|
||||||
|
{
|
||||||
|
if (Globals::Instance->fileMode != ZFileMode::ExtractDirectory)
|
||||||
|
File::WriteAllBytes("Extract/" + fName, data);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::unique_lock Lock(fileMutex);
|
||||||
|
files[fName] = data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void ImportExporters()
|
static void ImportExporters()
|
||||||
{
|
{
|
||||||
// In this example we set up a new exporter called "EXAMPLE".
|
// In this example we set up a new exporter called "EXAMPLE".
|
||||||
@@ -211,6 +280,7 @@ static void ImportExporters()
|
|||||||
exporterSet->exporters[ZResourceType::Text] = new OTRExporter_Text();
|
exporterSet->exporters[ZResourceType::Text] = new OTRExporter_Text();
|
||||||
exporterSet->exporters[ZResourceType::Blob] = new OTRExporter_Blob();
|
exporterSet->exporters[ZResourceType::Blob] = new OTRExporter_Blob();
|
||||||
exporterSet->exporters[ZResourceType::Mtx] = new OTRExporter_MtxExporter();
|
exporterSet->exporters[ZResourceType::Mtx] = new OTRExporter_MtxExporter();
|
||||||
|
exporterSet->exporters[ZResourceType::Audio] = new OTRExporter_Audio();
|
||||||
|
|
||||||
Globals::AddExporter("OTR", exporterSet);
|
Globals::AddExporter("OTR", exporterSet);
|
||||||
|
|
||||||
|
|||||||
@@ -4,3 +4,5 @@
|
|||||||
|
|
||||||
extern std::shared_ptr<Ship::Archive> otrArchive;
|
extern std::shared_ptr<Ship::Archive> otrArchive;
|
||||||
extern std::map<std::string, std::vector<char>> files;
|
extern std::map<std::string, std::vector<char>> files;
|
||||||
|
|
||||||
|
void AddFile(std::string fName, std::vector<char> data);
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
# Only used for standalone compilation, usually inherits these from the main makefile
|
|
||||||
|
|
||||||
CXX := g++
|
|
||||||
AR := ar
|
|
||||||
FORMAT := clang-format-11
|
|
||||||
|
|
||||||
ASAN ?= 0
|
|
||||||
DEBUG ?= 1
|
|
||||||
OPTFLAGS ?= -O0
|
|
||||||
LTO ?= 0
|
|
||||||
|
|
||||||
WARN := -Wall -Wextra -Werror \
|
|
||||||
-Wno-unused-parameter \
|
|
||||||
-Wno-unused-function \
|
|
||||||
-Wno-unused-variable
|
|
||||||
|
|
||||||
|
|
||||||
CXXFLAGS := $(WARN) -std=c++17
|
|
||||||
CPPFLAGS := -MMD
|
|
||||||
|
|
||||||
ifneq ($(DEBUG),0)
|
|
||||||
CXXFLAGS += -g
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(ASAN),0)
|
|
||||||
CXXFLAGS += -fsanitize=address
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(LTO),0)
|
|
||||||
CXXFLAGS += -flto
|
|
||||||
endif
|
|
||||||
|
|
||||||
SRC_DIRS := $(shell find -type d -not -path "*build*")
|
|
||||||
CXX_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.cpp))
|
|
||||||
H_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.h))
|
|
||||||
|
|
||||||
O_FILES := $(CXX_FILES:%.cpp=build/%.o)
|
|
||||||
D_FILES := $(O_FILES:%.o=%.d)
|
|
||||||
LIB := OTRExporter.a
|
|
||||||
|
|
||||||
INC_DIRS := $(addprefix -I, \
|
|
||||||
../../ZAPDTR/ZAPD \
|
|
||||||
../../ZAPDTR/lib/tinyxml2 \
|
|
||||||
../../ZAPDTR/lib/libgfxd \
|
|
||||||
../../ZAPDTR/ZAPDUtils \
|
|
||||||
../../libultraship/libultraship \
|
|
||||||
../../libultraship/libultraship/Lib/spdlog/include \
|
|
||||||
../../libultraship/libultraship/Lib/Fast3D/U64 \
|
|
||||||
)
|
|
||||||
|
|
||||||
# create build directories
|
|
||||||
$(shell mkdir -p $(SRC_DIRS:%=build/%))
|
|
||||||
|
|
||||||
all: $(LIB)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf build $(LIB)
|
|
||||||
|
|
||||||
format:
|
|
||||||
$(FORMAT) -i $(CXX_FILES) $(H_FILES)
|
|
||||||
|
|
||||||
.PHONY: all clean format
|
|
||||||
|
|
||||||
build/%.o: %.cpp
|
|
||||||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OPTFLAGS) $(INC_DIRS) -c $< -o $@
|
|
||||||
|
|
||||||
$(LIB): $(O_FILES)
|
|
||||||
$(AR) rcs $@ $^
|
|
||||||
|
|
||||||
-include $(D_FILES)
|
|
||||||
@@ -1,220 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|x64">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|x64">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="ArrayExporter.h" />
|
|
||||||
<ClInclude Include="BackgroundExporter.h" />
|
|
||||||
<ClInclude Include="BlobExporter.h" />
|
|
||||||
<ClInclude Include="CollisionExporter.h" />
|
|
||||||
<ClInclude Include="command_macros_base.h" />
|
|
||||||
<ClInclude Include="CutsceneExporter.h" />
|
|
||||||
<ClInclude Include="DisplayListExporter.h" />
|
|
||||||
<ClInclude Include="AnimationExporter.h" />
|
|
||||||
<ClInclude Include="Main.h" />
|
|
||||||
<ClInclude Include="Exporter.h" />
|
|
||||||
<ClInclude Include="MtxExporter.h" />
|
|
||||||
<ClInclude Include="SkeletonExporter.h" />
|
|
||||||
<ClInclude Include="SkeletonLimbExporter.h" />
|
|
||||||
<ClInclude Include="PathExporter.h" />
|
|
||||||
<ClInclude Include="PlayerAnimationExporter.h" />
|
|
||||||
<ClInclude Include="RoomExporter.h" />
|
|
||||||
<ClInclude Include="TextExporter.h" />
|
|
||||||
<ClInclude Include="TextureExporter.h" />
|
|
||||||
<ClInclude Include="VersionInfo.h" />
|
|
||||||
<ClInclude Include="VtxExporter.h" />
|
|
||||||
<ClInclude Include="z64cutscene.h" />
|
|
||||||
<ClInclude Include="z64cutscene_commands.h" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="ArrayExporter.cpp" />
|
|
||||||
<ClCompile Include="BackgroundExporter.cpp" />
|
|
||||||
<ClCompile Include="BlobExporter.cpp" />
|
|
||||||
<ClCompile Include="CollisionExporter.cpp" />
|
|
||||||
<ClCompile Include="CutsceneExporter.cpp" />
|
|
||||||
<ClCompile Include="DisplayListExporter.cpp" />
|
|
||||||
<ClCompile Include="AnimationExporter.cpp" />
|
|
||||||
<ClCompile Include="Main.cpp" />
|
|
||||||
<ClCompile Include="Exporter.cpp" />
|
|
||||||
<ClCompile Include="MtxExporter.cpp" />
|
|
||||||
<ClCompile Include="SkeletonExporter.cpp" />
|
|
||||||
<ClCompile Include="SkeletonLimbExporter.cpp" />
|
|
||||||
<ClCompile Include="PathExporter.cpp" />
|
|
||||||
<ClCompile Include="PlayerAnimationExporter.cpp" />
|
|
||||||
<ClCompile Include="RoomExporter.cpp" />
|
|
||||||
<ClCompile Include="TextExporter.cpp" />
|
|
||||||
<ClCompile Include="TextureExporter.cpp" />
|
|
||||||
<ClCompile Include="VersionInfo.cpp" />
|
|
||||||
<ClCompile Include="VtxExporter.cpp" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\OTRGui\build\ZERO_CHECK.vcxproj">
|
|
||||||
<Project>{02d10590-9542-3f55-aaf8-6055677e2a2a}</Project>
|
|
||||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<VCProjectVersion>16.0</VCProjectVersion>
|
|
||||||
<Keyword>Win32Proj</Keyword>
|
|
||||||
<ProjectGuid>{a6103fd3-0709-4fc7-b066-1a6e056d6306}</ProjectGuid>
|
|
||||||
<RootNamespace>OTRExporter</RootNamespace>
|
|
||||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v142</PlatformToolset>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v142</PlatformToolset>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v142</PlatformToolset>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v142</PlatformToolset>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="ExtensionSettings">
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="Shared">
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<LinkIncremental>true</LinkIncremental>
|
|
||||||
<IncludePath>$(SolutionDir)otrlib;$(SolutionDir)\ZAPD\ZAPD\;$(SolutionDir)\ZAPD\lib\tinyxml2;$(SolutionDir)\ZAPD\lib\libgfxd;$(SolutionDir)\ZAPD\lib\elfio;$(SolutionDir)\ZAPD\lib\assimp\include;$(SolutionDir)\ZAPD\lib\stb;$(ProjectDir);$(IncludePath)</IncludePath>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRules />
|
|
||||||
<CodeAnalysisRuleAssemblies />
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<LinkIncremental>false</LinkIncremental>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRules />
|
|
||||||
<CodeAnalysisRuleAssemblies />
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<LinkIncremental>true</LinkIncremental>
|
|
||||||
<IncludePath>$(ProjectDir)..\..\ZAPDTR\ZAPD;$(ProjectDir)..\..\ZAPDTR\lib\tinyxml2;$(ProjectDir)..\..\ZAPDTR\lib\libgfxd;$(ProjectDir)..\..\ZAPDTR\ZAPDUtils;$(ProjectDir)..\..\libultraship\libultraship;$(ProjectDir)..\..\libultraship\libultraship\lib\spdlog\include;$(ProjectDir)..\..\libultraship\libultraship\Lib\Fast3D\U64;$(IncludePath)</IncludePath>
|
|
||||||
<LibraryPath>$(ProjectDir)..\..\libultraship\libultraship;$(LibraryPath)</LibraryPath>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRules />
|
|
||||||
<CodeAnalysisRuleAssemblies />
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<LinkIncremental>false</LinkIncremental>
|
|
||||||
<IncludePath>$(ProjectDir)..\..\ZAPDTR\ZAPD;$(ProjectDir)..\..\ZAPDTR\lib\tinyxml2;$(ProjectDir)..\..\ZAPDTR\lib\libgfxd;$(ProjectDir)..\..\ZAPDTR\ZAPDUtils;$(ProjectDir)..\..\libultraship\libultraship;$(ProjectDir)..\..\libultraship\libultraship\lib\spdlog\include;$(ProjectDir)..\..\libultraship\libultraship\Lib\Fast3D\U64;$(IncludePath)</IncludePath>
|
|
||||||
<LibraryPath>$(ProjectDir)..\..\libultraship\libultraship;$(LibraryPath)</LibraryPath>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRules />
|
|
||||||
<CodeAnalysisRuleAssemblies />
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<ConformanceMode>true</ConformanceMode>
|
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<ConformanceMode>true</ConformanceMode>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<ConformanceMode>true</ConformanceMode>
|
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
|
||||||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
|
||||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<AdditionalDependencies>ZAPDUtils.lib;OTRLib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<ConformanceMode>true</ConformanceMode>
|
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
|
||||||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
|
||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
</ImportGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,144 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup>
|
|
||||||
<Filter Include="Source Files">
|
|
||||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
|
||||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Header Files">
|
|
||||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
|
||||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Resource Files">
|
|
||||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
|
||||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
|
||||||
</Filter>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="CollisionExporter.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="RoomExporter.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="TextureExporter.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="DisplayListExporter.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="Main.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="PlayerAnimationExporter.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="BackgroundExporter.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="VtxExporter.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ArrayExporter.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="Exporter.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="AnimationExporter.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="CutsceneExporter.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="z64cutscene.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="z64cutscene_commands.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="command_macros_base.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="PathExporter.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="SkeletonExporter.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="SkeletonLimbExporter.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="TextExporter.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="BlobExporter.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="MtxExporter.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="VersionInfo.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="CollisionExporter.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="Main.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="RoomExporter.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="TextureExporter.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="DisplayListExporter.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="PlayerAnimationExporter.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="SkeletonExporter.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="SkeletonLimbExporter.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="BackgroundExporter.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="VtxExporter.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ArrayExporter.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="Exporter.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="AnimationExporter.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="CutsceneExporter.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="PathExporter.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="TextExporter.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="BlobExporter.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="MtxExporter.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="VersionInfo.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -453,13 +453,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite
|
|||||||
OTRExporter_Cutscene cs;
|
OTRExporter_Cutscene cs;
|
||||||
cs.Save(cmdSetCutscenes->cutscenes[0], "", &csWriter);
|
cs.Save(cmdSetCutscenes->cutscenes[0], "", &csWriter);
|
||||||
|
|
||||||
if (Globals::Instance->fileMode != ZFileMode::ExtractDirectory)
|
AddFile(fName, csStream->ToVector());
|
||||||
File::WriteAllBytes("Extract/" + fName, csStream->ToVector());
|
|
||||||
else
|
|
||||||
files[fName] = csStream->ToVector();
|
|
||||||
|
|
||||||
//std::string fName = OTRExporter_DisplayList::GetPathToRes(res, vtxDecl->varName);
|
|
||||||
//otrArchive->AddFile(fName, (uintptr_t)csStream->ToVector().data(), csWriter.GetBaseAddress());
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RoomCommand::SetPathways:
|
case RoomCommand::SetPathways:
|
||||||
@@ -480,14 +474,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite
|
|||||||
OTRExporter_Path pathExp;
|
OTRExporter_Path pathExp;
|
||||||
pathExp.Save(&cmdSetPathways->pathwayList, outPath, &pathWriter);
|
pathExp.Save(&cmdSetPathways->pathwayList, outPath, &pathWriter);
|
||||||
|
|
||||||
if (Globals::Instance->fileMode != ZFileMode::ExtractDirectory)
|
AddFile(path, pathStream->ToVector());
|
||||||
File::WriteAllBytes("Extract/" + path, pathStream->ToVector());
|
|
||||||
else
|
|
||||||
files[path] = pathStream->ToVector();
|
|
||||||
|
|
||||||
//otrArchive->AddFile(path, (uintptr_t)pathStream->ToVector().data(), pathWriter.GetBaseAddress());
|
|
||||||
|
|
||||||
int bp = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ std::map<Ship::ResourceType, uint32_t> resourceVersions;
|
|||||||
|
|
||||||
void InitVersionInfo()
|
void InitVersionInfo()
|
||||||
{
|
{
|
||||||
resourceVersions = {
|
resourceVersions = std::map<Ship::ResourceType, uint32_t> {
|
||||||
{ Ship::ResourceType::Animation, 0 },
|
{ Ship::ResourceType::Animation, 0 },
|
||||||
{ Ship::ResourceType::Model, 0 },
|
{ Ship::ResourceType::Model, 0 },
|
||||||
{ Ship::ResourceType::Texture, 0 },
|
{ Ship::ResourceType::Texture, 0 },
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "Resource.h"
|
#include "src/resource/Resource.h"
|
||||||
|
|
||||||
#define MAJOR_VERSION Ship::Version::Deckard
|
#define MAJOR_VERSION Ship::Version::Deckard
|
||||||
|
|
||||||
|
|||||||
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 1017 B |
|
After Width: | Height: | Size: 883 B |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
@@ -4,15 +4,23 @@ import os, sys, shutil
|
|||||||
import shutil
|
import shutil
|
||||||
from rom_info import Z64Rom
|
from rom_info import Z64Rom
|
||||||
import rom_chooser
|
import rom_chooser
|
||||||
|
import struct
|
||||||
|
import subprocess
|
||||||
|
import argparse
|
||||||
|
|
||||||
def BuildOTR(xmlPath, rom):
|
def BuildOTR(xmlPath, rom, zapd_exe=None):
|
||||||
shutil.copytree("assets", "Extract/assets")
|
shutil.copytree("assets", "Extract/assets")
|
||||||
|
|
||||||
execStr = "x64\\Release\\ZAPD.exe" if sys.platform == "win32" else "../ZAPDTR/ZAPD.out"
|
if not zapd_exe:
|
||||||
execStr += " ed -i %s -b %s -fl CFG/filelists -o placeholder -osf placeholder -gsf 1 -rconf CFG/Config.xml -se OTR" % (xmlPath, rom)
|
zapd_exe = "x64\\Release\\ZAPD.exe" if sys.platform == "win32" else "../ZAPDTR/ZAPD.out"
|
||||||
|
|
||||||
print(execStr)
|
exec_cmd = [zapd_exe, "ed", "-i", xmlPath, "-b", rom, "-fl", "CFG/filelists",
|
||||||
exitValue = os.system(execStr)
|
"-o", "placeholder", "-osf", "placeholder", "-gsf", "1",
|
||||||
|
"-rconf", "CFG/Config.xml", "-se", "OTR", "--otrfile",
|
||||||
|
"oot-mq.otr" if Z64Rom.isMqRom(rom) else "oot.otr"]
|
||||||
|
|
||||||
|
print(exec_cmd)
|
||||||
|
exitValue = subprocess.call(exec_cmd)
|
||||||
if exitValue != 0:
|
if exitValue != 0:
|
||||||
print("\n")
|
print("\n")
|
||||||
print("Error when building the OTR file...", file=os.sys.stderr)
|
print("Error when building the OTR file...", file=os.sys.stderr)
|
||||||
@@ -20,13 +28,21 @@ def BuildOTR(xmlPath, rom):
|
|||||||
print("\n")
|
print("\n")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
rom_path = rom_chooser.chooseROM()
|
parser = argparse.ArgumentParser()
|
||||||
rom = Z64Rom(rom_path)
|
parser.add_argument("-z", "--zapd", help="Path to ZAPD executable", dest="zapd_exe", type=str)
|
||||||
|
parser.add_argument("rom", help="Path to the rom", type=str, nargs="?")
|
||||||
|
parser.add_argument("--non-interactive", help="Runs the script non-interactively for use in build scripts.", dest="non_interactive", action="store_true")
|
||||||
|
|
||||||
if (os.path.exists("Extract")):
|
args = parser.parse_args()
|
||||||
shutil.rmtree("Extract")
|
|
||||||
|
|
||||||
BuildOTR("../soh/assets/xml/" + rom.version.xml_ver + "/", rom_path)
|
rom_paths = [ args.rom ] if args.rom else rom_chooser.chooseROM(args.non_interactive)
|
||||||
|
for rom_path in rom_paths:
|
||||||
|
rom = Z64Rom(rom_path)
|
||||||
|
|
||||||
|
if (os.path.exists("Extract")):
|
||||||
|
shutil.rmtree("Extract")
|
||||||
|
|
||||||
|
BuildOTR("../soh/assets/xml/" + rom.version.xml_ver + "/", rom_path, zapd_exe=args.zapd_exe)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import os, sys, glob
|
|||||||
|
|
||||||
from rom_info import Z64Rom
|
from rom_info import Z64Rom
|
||||||
|
|
||||||
def chooseROM():
|
def chooseROM(non_interactive=False):
|
||||||
roms = []
|
roms = []
|
||||||
|
|
||||||
for file in glob.glob("*.z64"):
|
for file in glob.glob("*.z64"):
|
||||||
@@ -14,7 +14,21 @@ def chooseROM():
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if (len(roms) == 1):
|
if (len(roms) == 1):
|
||||||
return roms[0]
|
return roms
|
||||||
|
|
||||||
|
if non_interactive:
|
||||||
|
romsToExtract = []
|
||||||
|
foundMq = False
|
||||||
|
foundOot = False
|
||||||
|
for rom in roms:
|
||||||
|
isMq = Z64Rom.isMqRom(rom)
|
||||||
|
if isMq and not foundMq:
|
||||||
|
romsToExtract.append(rom)
|
||||||
|
foundMq = True
|
||||||
|
elif not isMq and not foundOot:
|
||||||
|
romsToExtract.append(rom)
|
||||||
|
foundOot = True
|
||||||
|
return romsToExtract
|
||||||
|
|
||||||
print(str(len(roms))+ " roms found, please select one by pressing 1-"+str(len(roms)))
|
print(str(len(roms))+ " roms found, please select one by pressing 1-"+str(len(roms)))
|
||||||
|
|
||||||
@@ -34,4 +48,4 @@ def chooseROM():
|
|||||||
|
|
||||||
else: break
|
else: break
|
||||||
|
|
||||||
return roms[selection - 1]
|
return [ roms[selection - 1] ]
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ class RomVersion:
|
|||||||
ROM_INFO_TABLE = dict()
|
ROM_INFO_TABLE = dict()
|
||||||
ROM_INFO_TABLE[Checksums.OOT_PAL_GC] = RomVersion("CFG/filelists/gamecube_pal.txt", 0x7170, "GC_NMQ_PAL_F")
|
ROM_INFO_TABLE[Checksums.OOT_PAL_GC] = RomVersion("CFG/filelists/gamecube_pal.txt", 0x7170, "GC_NMQ_PAL_F")
|
||||||
ROM_INFO_TABLE[Checksums.OOT_PAL_GC_DBG1] = RomVersion("CFG/filelists/dbg.txt", 0x12F70, "GC_NMQ_D")
|
ROM_INFO_TABLE[Checksums.OOT_PAL_GC_DBG1] = RomVersion("CFG/filelists/dbg.txt", 0x12F70, "GC_NMQ_D")
|
||||||
|
ROM_INFO_TABLE[Checksums.OOT_PAL_GC_MQ_DBG] = RomVersion("CFG/filelists/dbg.txt", 0x12F70, "GC_MQ_D")
|
||||||
|
|
||||||
class RomDmaEntry:
|
class RomDmaEntry:
|
||||||
def __init__(self, rom, i):
|
def __init__(self, rom, i):
|
||||||
@@ -73,6 +74,11 @@ class Z64Rom:
|
|||||||
self.is_valid = False
|
self.is_valid = False
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if self.checksum in [Checksums.OOT_NTSC_JP_MQ, Checksums.OOT_NTSC_US_MQ, Checksums.OOT_PAL_GC_MQ_DBG, Checksums.OOT_PAL_MQ]:
|
||||||
|
self.isMq = True
|
||||||
|
else:
|
||||||
|
self.isMq = False
|
||||||
|
|
||||||
# get rom version
|
# get rom version
|
||||||
self.version = ROM_INFO_TABLE[self.checksum]
|
self.version = ROM_INFO_TABLE[self.checksum]
|
||||||
|
|
||||||
@@ -85,3 +91,7 @@ class Z64Rom:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def isValidRom(rom_path):
|
def isValidRom(rom_path):
|
||||||
return Z64Rom(rom_path).is_valid
|
return Z64Rom(rom_path).is_valid
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def isMqRom(rom_path):
|
||||||
|
return Z64Rom(rom_path).isMq
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
################################################################################
|
||||||
|
# Command for variable_watch. This command issues error message, if a variable
|
||||||
|
# is changed. If variable PROPERTY_READER_GUARD_DISABLED is TRUE nothing happens
|
||||||
|
# variable_watch(<variable> property_reader_guard)
|
||||||
|
################################################################################
|
||||||
|
function(property_reader_guard VARIABLE ACCESS VALUE CURRENT_LIST_FILE STACK)
|
||||||
|
if("${PROPERTY_READER_GUARD_DISABLED}")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if("${ACCESS}" STREQUAL "MODIFIED_ACCESS")
|
||||||
|
message(FATAL_ERROR
|
||||||
|
" Variable ${VARIABLE} is not supposed to be changed.\n"
|
||||||
|
" It is used only for reading target property ${VARIABLE}.\n"
|
||||||
|
" Use\n"
|
||||||
|
" set_target_properties(\"<target>\" PROPERTIES \"${VARIABLE}\" \"<value>\")\n"
|
||||||
|
" or\n"
|
||||||
|
" set_target_properties(\"<target>\" PROPERTIES \"${VARIABLE}_<CONFIG>\" \"<value>\")\n"
|
||||||
|
" instead.\n")
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Create variable <name> with generator expression that expands to value of
|
||||||
|
# target property <name>_<CONFIG>. If property is empty or not set then property
|
||||||
|
# <name> is used instead. Variable <name> has watcher property_reader_guard that
|
||||||
|
# doesn't allow to edit it.
|
||||||
|
# create_property_reader(<name>)
|
||||||
|
# Input:
|
||||||
|
# name - Name of watched property and output variable
|
||||||
|
################################################################################
|
||||||
|
function(create_property_reader NAME)
|
||||||
|
set(PROPERTY_READER_GUARD_DISABLED TRUE)
|
||||||
|
set(CONFIG_VALUE "$<TARGET_GENEX_EVAL:${PROPS_TARGET},$<TARGET_PROPERTY:${PROPS_TARGET},${NAME}_$<UPPER_CASE:$<CONFIG>>>>")
|
||||||
|
set(IS_CONFIG_VALUE_EMPTY "$<STREQUAL:${CONFIG_VALUE},>")
|
||||||
|
set(GENERAL_VALUE "$<TARGET_GENEX_EVAL:${PROPS_TARGET},$<TARGET_PROPERTY:${PROPS_TARGET},${NAME}>>")
|
||||||
|
set("${NAME}" "$<IF:${IS_CONFIG_VALUE_EMPTY},${GENERAL_VALUE},${CONFIG_VALUE}>" PARENT_SCOPE)
|
||||||
|
variable_watch("${NAME}" property_reader_guard)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Set property $<name>_${PROPS_CONFIG_U} of ${PROPS_TARGET} to <value>
|
||||||
|
# set_config_specific_property(<name> <value>)
|
||||||
|
# Input:
|
||||||
|
# name - Prefix of property name
|
||||||
|
# value - New value
|
||||||
|
################################################################################
|
||||||
|
function(set_config_specific_property NAME VALUE)
|
||||||
|
set_target_properties("${PROPS_TARGET}" PROPERTIES "${NAME}_${PROPS_CONFIG_U}" "${VALUE}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
create_property_reader("TARGET_NAME")
|
||||||
|
create_property_reader("OUTPUT_DIRECTORY")
|
||||||
|
|
||||||
|
set_config_specific_property("TARGET_NAME" "${PROPS_TARGET}")
|
||||||
|
set_config_specific_property("OUTPUT_NAME" "${TARGET_NAME}")
|
||||||
|
set_config_specific_property("ARCHIVE_OUTPUT_NAME" "${TARGET_NAME}")
|
||||||
|
set_config_specific_property("LIBRARY_OUTPUT_NAME" "${TARGET_NAME}")
|
||||||
|
set_config_specific_property("RUNTIME_OUTPUT_NAME" "${TARGET_NAME}")
|
||||||
|
|
||||||
|
set_config_specific_property("ARCHIVE_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}")
|
||||||
|
set_config_specific_property("LIBRARY_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}")
|
||||||
|
set_config_specific_property("RUNTIME_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}")
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/Default.cmake")
|
||||||
|
|
||||||
|
set_config_specific_property("OUTPUT_DIRECTORY" "${CMAKE_SOURCE_DIR}$<$<NOT:$<STREQUAL:${CMAKE_VS_PLATFORM_NAME},Win32>>:/${CMAKE_VS_PLATFORM_NAME}>/${PROPS_CONFIG}")
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
create_property_reader("DEFAULT_CXX_EXCEPTION_HANDLING")
|
||||||
|
create_property_reader("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT")
|
||||||
|
|
||||||
|
set_target_properties("${PROPS_TARGET}" PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
||||||
|
set_config_specific_property("DEFAULT_CXX_EXCEPTION_HANDLING" "/EHsc")
|
||||||
|
set_config_specific_property("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT" "/Zi")
|
||||||
|
endif()
|
||||||
@@ -0,0 +1,234 @@
|
|||||||
|
# utils file for projects came from visual studio solution with cmake-converter.
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Wrap each token of the command with condition
|
||||||
|
################################################################################
|
||||||
|
cmake_policy(PUSH)
|
||||||
|
cmake_policy(SET CMP0054 NEW)
|
||||||
|
macro(prepare_commands)
|
||||||
|
unset(TOKEN_ROLE)
|
||||||
|
unset(COMMANDS)
|
||||||
|
foreach(TOKEN ${ARG_COMMANDS})
|
||||||
|
if("${TOKEN}" STREQUAL "COMMAND")
|
||||||
|
set(TOKEN_ROLE "KEYWORD")
|
||||||
|
elseif("${TOKEN_ROLE}" STREQUAL "KEYWORD")
|
||||||
|
set(TOKEN_ROLE "CONDITION")
|
||||||
|
elseif("${TOKEN_ROLE}" STREQUAL "CONDITION")
|
||||||
|
set(TOKEN_ROLE "COMMAND")
|
||||||
|
elseif("${TOKEN_ROLE}" STREQUAL "COMMAND")
|
||||||
|
set(TOKEN_ROLE "ARG")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if("${TOKEN_ROLE}" STREQUAL "KEYWORD")
|
||||||
|
list(APPEND COMMANDS "${TOKEN}")
|
||||||
|
elseif("${TOKEN_ROLE}" STREQUAL "CONDITION")
|
||||||
|
set(CONDITION ${TOKEN})
|
||||||
|
elseif("${TOKEN_ROLE}" STREQUAL "COMMAND")
|
||||||
|
list(APPEND COMMANDS "$<$<NOT:${CONDITION}>:${DUMMY}>$<${CONDITION}:${TOKEN}>")
|
||||||
|
elseif("${TOKEN_ROLE}" STREQUAL "ARG")
|
||||||
|
list(APPEND COMMANDS "$<${CONDITION}:${TOKEN}>")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endmacro()
|
||||||
|
cmake_policy(POP)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Transform all the tokens to absolute paths
|
||||||
|
################################################################################
|
||||||
|
macro(prepare_output)
|
||||||
|
unset(OUTPUT)
|
||||||
|
foreach(TOKEN ${ARG_OUTPUT})
|
||||||
|
if(IS_ABSOLUTE ${TOKEN})
|
||||||
|
list(APPEND OUTPUT "${TOKEN}")
|
||||||
|
else()
|
||||||
|
list(APPEND OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/${TOKEN}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Parse add_custom_command_if args.
|
||||||
|
#
|
||||||
|
# Input:
|
||||||
|
# PRE_BUILD - Pre build event option
|
||||||
|
# PRE_LINK - Pre link event option
|
||||||
|
# POST_BUILD - Post build event option
|
||||||
|
# TARGET - Target
|
||||||
|
# OUTPUT - List of output files
|
||||||
|
# DEPENDS - List of files on which the command depends
|
||||||
|
# COMMANDS - List of commands(COMMAND condition1 commannd1 args1 COMMAND
|
||||||
|
# condition2 commannd2 args2 ...)
|
||||||
|
# Output:
|
||||||
|
# OUTPUT - Output files
|
||||||
|
# DEPENDS - Files on which the command depends
|
||||||
|
# COMMENT - Comment
|
||||||
|
# PRE_BUILD - TRUE/FALSE
|
||||||
|
# PRE_LINK - TRUE/FALSE
|
||||||
|
# POST_BUILD - TRUE/FALSE
|
||||||
|
# TARGET - Target name
|
||||||
|
# COMMANDS - Prepared commands(every token is wrapped in CONDITION)
|
||||||
|
# NAME - Unique name for custom target
|
||||||
|
# STEP - PRE_BUILD/PRE_LINK/POST_BUILD
|
||||||
|
################################################################################
|
||||||
|
function(add_custom_command_if_parse_arguments)
|
||||||
|
cmake_parse_arguments("ARG" "PRE_BUILD;PRE_LINK;POST_BUILD" "TARGET;COMMENT" "DEPENDS;OUTPUT;COMMANDS" ${ARGN})
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set(DUMMY "cd.")
|
||||||
|
elseif(UNIX)
|
||||||
|
set(DUMMY "true")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
prepare_commands()
|
||||||
|
prepare_output()
|
||||||
|
|
||||||
|
set(DEPENDS "${ARG_DEPENDS}")
|
||||||
|
set(COMMENT "${ARG_COMMENT}")
|
||||||
|
set(PRE_BUILD "${ARG_PRE_BUILD}")
|
||||||
|
set(PRE_LINK "${ARG_PRE_LINK}")
|
||||||
|
set(POST_BUILD "${ARG_POST_BUILD}")
|
||||||
|
set(TARGET "${ARG_TARGET}")
|
||||||
|
if(PRE_BUILD)
|
||||||
|
set(STEP "PRE_BUILD")
|
||||||
|
elseif(PRE_LINK)
|
||||||
|
set(STEP "PRE_LINK")
|
||||||
|
elseif(POST_BUILD)
|
||||||
|
set(STEP "POST_BUILD")
|
||||||
|
endif()
|
||||||
|
set(NAME "${TARGET}_${STEP}")
|
||||||
|
|
||||||
|
set(OUTPUT "${OUTPUT}" PARENT_SCOPE)
|
||||||
|
set(DEPENDS "${DEPENDS}" PARENT_SCOPE)
|
||||||
|
set(COMMENT "${COMMENT}" PARENT_SCOPE)
|
||||||
|
set(PRE_BUILD "${PRE_BUILD}" PARENT_SCOPE)
|
||||||
|
set(PRE_LINK "${PRE_LINK}" PARENT_SCOPE)
|
||||||
|
set(POST_BUILD "${POST_BUILD}" PARENT_SCOPE)
|
||||||
|
set(TARGET "${TARGET}" PARENT_SCOPE)
|
||||||
|
set(COMMANDS "${COMMANDS}" PARENT_SCOPE)
|
||||||
|
set(STEP "${STEP}" PARENT_SCOPE)
|
||||||
|
set(NAME "${NAME}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Add conditional custom command
|
||||||
|
#
|
||||||
|
# Generating Files
|
||||||
|
# The first signature is for adding a custom command to produce an output:
|
||||||
|
# add_custom_command_if(
|
||||||
|
# <OUTPUT output1 [output2 ...]>
|
||||||
|
# <COMMANDS>
|
||||||
|
# <COMMAND condition command1 [args1...]>
|
||||||
|
# [COMMAND condition command2 [args2...]]
|
||||||
|
# [DEPENDS [depends...]]
|
||||||
|
# [COMMENT comment]
|
||||||
|
#
|
||||||
|
# Build Events
|
||||||
|
# add_custom_command_if(
|
||||||
|
# <TARGET target>
|
||||||
|
# <PRE_BUILD | PRE_LINK | POST_BUILD>
|
||||||
|
# <COMMAND condition command1 [args1...]>
|
||||||
|
# [COMMAND condition command2 [args2...]]
|
||||||
|
# [COMMENT comment]
|
||||||
|
#
|
||||||
|
# Input:
|
||||||
|
# output - Output files the command is expected to produce
|
||||||
|
# condition - Generator expression for wrapping the command
|
||||||
|
# command - Command-line(s) to execute at build time.
|
||||||
|
# args - Command`s args
|
||||||
|
# depends - Files on which the command depends
|
||||||
|
# comment - Display the given message before the commands are executed at
|
||||||
|
# build time.
|
||||||
|
# PRE_BUILD - Run before any other rules are executed within the target
|
||||||
|
# PRE_LINK - Run after sources have been compiled but before linking the
|
||||||
|
# binary
|
||||||
|
# POST_BUILD - Run after all other rules within the target have been
|
||||||
|
# executed
|
||||||
|
################################################################################
|
||||||
|
function(add_custom_command_if)
|
||||||
|
add_custom_command_if_parse_arguments(${ARGN})
|
||||||
|
|
||||||
|
if(OUTPUT AND TARGET)
|
||||||
|
message(FATAL_ERROR "Wrong syntax. A TARGET and OUTPUT can not both be specified.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(OUTPUT)
|
||||||
|
add_custom_command(OUTPUT ${OUTPUT}
|
||||||
|
${COMMANDS}
|
||||||
|
DEPENDS ${DEPENDS}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
COMMENT ${COMMENT})
|
||||||
|
elseif(TARGET)
|
||||||
|
if(PRE_BUILD AND NOT ${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
||||||
|
add_custom_target(
|
||||||
|
${NAME}
|
||||||
|
${COMMANDS}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
COMMENT ${COMMENT})
|
||||||
|
add_dependencies(${TARGET} ${NAME})
|
||||||
|
else()
|
||||||
|
add_custom_command(
|
||||||
|
TARGET ${TARGET}
|
||||||
|
${STEP}
|
||||||
|
${COMMANDS}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
COMMENT ${COMMENT})
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Wrong syntax. A TARGET or OUTPUT must be specified.")
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Use props file for a target and configs
|
||||||
|
# use_props(<target> <configs...> <props_file>)
|
||||||
|
# Inside <props_file> there are following variables:
|
||||||
|
# PROPS_TARGET - <target>
|
||||||
|
# PROPS_CONFIG - One of <configs...>
|
||||||
|
# PROPS_CONFIG_U - Uppercase PROPS_CONFIG
|
||||||
|
# Input:
|
||||||
|
# target - Target to apply props file
|
||||||
|
# configs - Build configurations to apply props file
|
||||||
|
# props_file - CMake script
|
||||||
|
################################################################################
|
||||||
|
macro(use_props TARGET CONFIGS PROPS_FILE)
|
||||||
|
set(PROPS_TARGET "${TARGET}")
|
||||||
|
foreach(PROPS_CONFIG ${CONFIGS})
|
||||||
|
string(TOUPPER "${PROPS_CONFIG}" PROPS_CONFIG_U)
|
||||||
|
|
||||||
|
get_filename_component(ABSOLUTE_PROPS_FILE "${PROPS_FILE}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
|
||||||
|
if(EXISTS "${ABSOLUTE_PROPS_FILE}")
|
||||||
|
include("${ABSOLUTE_PROPS_FILE}")
|
||||||
|
else()
|
||||||
|
message(WARNING "Corresponding cmake file from props \"${ABSOLUTE_PROPS_FILE}\" doesn't exist")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Add compile options to source file
|
||||||
|
# source_file_compile_options(<source_file> [compile_options...])
|
||||||
|
# Input:
|
||||||
|
# source_file - Source file
|
||||||
|
# compile_options - Options to add to COMPILE_FLAGS property
|
||||||
|
################################################################################
|
||||||
|
function(source_file_compile_options SOURCE_FILE)
|
||||||
|
if("${ARGC}" LESS_EQUAL "1")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
get_source_file_property(COMPILE_OPTIONS "${SOURCE_FILE}" COMPILE_OPTIONS)
|
||||||
|
|
||||||
|
if(COMPILE_OPTIONS)
|
||||||
|
list(APPEND COMPILE_OPTIONS ${ARGN})
|
||||||
|
else()
|
||||||
|
set(COMPILE_OPTIONS "${ARGN}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set_source_files_properties("${SOURCE_FILE}" PROPERTIES COMPILE_OPTIONS "${COMPILE_OPTIONS}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Default properties of visual studio projects
|
||||||
|
################################################################################
|
||||||
|
set(DEFAULT_CXX_PROPS "${CMAKE_CURRENT_LIST_DIR}/DefaultCXX.cmake")
|
||||||
|
set(DEFAULT_Fortran_PROPS "${CMAKE_CURRENT_LIST_DIR}/DefaultFortran.cmake")
|
||||||
@@ -3,27 +3,66 @@ project(OTRGui)
|
|||||||
|
|
||||||
set(PLATFORM "Desktop")
|
set(PLATFORM "Desktop")
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build)
|
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build)
|
||||||
set(APP_ICON_RESOURCE_WINDOWS ${CMAKE_CURRENT_SOURCE_DIR}/appicon.rc)
|
set(APP_ICON_RESOURCE_WINDOWS ${CMAKE_CURRENT_SOURCE_DIR}/appicon.rc)
|
||||||
|
|
||||||
add_subdirectory(libs/raylib)
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
set(OpenGL_GL_PREFERENCE "GLVND")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(CMake/Utils.cmake)
|
||||||
|
|
||||||
|
add_subdirectory(libs/raylib EXCLUDE_FROM_ALL)
|
||||||
|
|
||||||
include_directories(src)
|
include_directories(src)
|
||||||
include_directories(src/game)
|
include_directories(src/game)
|
||||||
include_directories(include)
|
include_directories(include)
|
||||||
|
|
||||||
include_external_msproject(ZAPD ../../ZAPDTR/ZAPD/ZAPD.vcproj)
|
if (NOT TARGET libultraship)
|
||||||
include_external_msproject(ZAPDUtils ../../ZAPDTR/ZAPDUtils/ZAPDUtils.vcproj)
|
add_subdirectory(../libultraship ${CMAKE_BINARY_DIR}/libultraship)
|
||||||
include_external_msproject(libultraship ../../libultraship/libultraship/libultraship.vcproj)
|
endif()
|
||||||
include_external_msproject(OTRExporter ../../OTRExporter/OTRExporter/OTRExporter.vcproj)
|
if (NOT TARGET ZAPD)
|
||||||
|
add_subdirectory(../ZAPDTR/ZAPD ${CMAKE_BINARY_DIR}/ZAPD)
|
||||||
|
endif()
|
||||||
|
if (NOT TARGET ZAPDUtils)
|
||||||
|
add_subdirectory(../libultraship/extern/ZAPDUtils ${CMAKE_BINARY_DIR}/ZAPDUtils)
|
||||||
|
endif()
|
||||||
|
if (NOT TARGET OTRExporter)
|
||||||
|
add_subdirectory(../OTRExporter/OTRExporter ${CMAKE_BINARY_DIR}/OTRExporter)
|
||||||
|
endif()
|
||||||
|
if (NOT TARGET storm)
|
||||||
|
add_subdirectory(../libultraship/extern/StormLib ${CMAKE_BINARY_DIR}/StormLib)
|
||||||
|
endif()
|
||||||
|
|
||||||
file(GLOB_RECURSE HEADERS src/*.h)
|
file(GLOB_RECURSE HEADERS src/*.h)
|
||||||
file(GLOB_RECURSE SOURCES src/*.cpp)
|
file(GLOB_RECURSE SOURCES src/*.cpp)
|
||||||
file(GLOB_RECURSE C_SOURCES src/*.c)
|
file(GLOB_RECURSE C_SOURCES src/*.c)
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME} ${SOURCES} ${C_SOURCES} ${HEADERS} ${APP_ICON_RESOURCE_WINDOWS})
|
add_executable(${PROJECT_NAME} EXCLUDE_FROM_ALL ${SOURCES} ${C_SOURCES} ${HEADERS} ${APP_ICON_RESOURCE_WINDOWS})
|
||||||
add_custom_command(TARGET ${PROJECT_NAME} PRE_BUILD COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_SOURCE_DIR}/assets" -Ddst_dir="${CMAKE_CURRENT_BINARY_DIR}/assets" -P "${CMAKE_CURRENT_SOURCE_DIR}/Overwrite.cmake")
|
|
||||||
add_custom_command(TARGET ${PROJECT_NAME} PRE_BUILD COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_SOURCE_DIR}/../OTRExporter/assets" -Ddst_dir="${CMAKE_CURRENT_BINARY_DIR}/assets/game" -P "${CMAKE_CURRENT_SOURCE_DIR}/Overwrite.cmake")
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
add_custom_command(TARGET ${PROJECT_NAME} PRE_BUILD COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_SOURCE_DIR}/../soh/assets/xml" -Ddst_dir="${CMAKE_CURRENT_BINARY_DIR}/assets/extractor/xmls" -P "${CMAKE_CURRENT_SOURCE_DIR}/Overwrite.cmake")
|
use_props(${PROJECT_NAME} "${CMAKE_CONFIGURATION_TYPES}" "${DEFAULT_CXX_PROPS}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_custom_target(Assets ALL
|
||||||
|
COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_CURRENT_SOURCE_DIR}/assets" -Ddst_dir="${CMAKE_CURRENT_BINARY_DIR}/assets" -P "${CMAKE_CURRENT_SOURCE_DIR}/Overwrite.cmake"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_CURRENT_SOURCE_DIR}/../OTRExporter/assets" -Ddst_dir="${CMAKE_CURRENT_BINARY_DIR}/assets/game" -P "${CMAKE_CURRENT_SOURCE_DIR}/Overwrite.cmake"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_CURRENT_SOURCE_DIR}/../soh/assets/xml" -Ddst_dir="${CMAKE_CURRENT_BINARY_DIR}/assets/extractor/xmls" -P "${CMAKE_CURRENT_SOURCE_DIR}/Overwrite.cmake"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_dependencies(OTRGui Assets)
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME} PUBLIC raylib)
|
target_link_libraries(${PROJECT_NAME} PUBLIC raylib)
|
||||||
|
|
||||||
|
target_include_directories(${PROJECT_NAME} PRIVATE
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship
|
||||||
|
.
|
||||||
|
)
|
||||||
|
|
||||||
|
INSTALL(TARGETS OTRGui DESTINATION . COMPONENT ship)
|
||||||
|
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/assets
|
||||||
|
DESTINATION .
|
||||||
|
COMPONENT ship
|
||||||
|
)
|
||||||
|
INSTALL(TARGETS ZAPD DESTINATION assets/extractor COMPONENT ship)
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
file(GLOB_RECURSE _file_list RELATIVE "${src_dir}" "${src_dir}/*")
|
include(CMakePrintHelpers)
|
||||||
|
|
||||||
|
string(REPLACE "\\ " " " sources_dir "${src_dir}")
|
||||||
|
string(REPLACE "\\ " " " destination_dir "${dst_dir}")
|
||||||
|
|
||||||
|
file(GLOB_RECURSE _file_list RELATIVE "${sources_dir}" "${sources_dir}/*")
|
||||||
|
|
||||||
foreach( each_file ${_file_list} )
|
foreach( each_file ${_file_list} )
|
||||||
set(destinationfile "${dst_dir}/${each_file}")
|
set(destinationfile "${destination_dir}/${each_file}")
|
||||||
set(sourcefile "${src_dir}/${each_file}")
|
set(sourcefile "${sources_dir}/${each_file}")
|
||||||
if(NOT EXISTS ${destinationfile} OR ${sourcefile} IS_NEWER_THAN ${destinationfile})
|
if(NOT EXISTS ${destinationfile} OR ${sourcefile} IS_NEWER_THAN ${destinationfile})
|
||||||
get_filename_component(destinationdir ${destinationfile} DIRECTORY)
|
get_filename_component(destinationdir ${destinationfile} DIRECTORY)
|
||||||
file(COPY ${sourcefile} DESTINATION ${destinationdir})
|
file(COPY ${sourcefile} DESTINATION ${destinationdir})
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ void ExtractRom()
|
|||||||
//MoonUtils::copy("tmp/baserom/Audioseq", "Extract/Audioseq");
|
//MoonUtils::copy("tmp/baserom/Audioseq", "Extract/Audioseq");
|
||||||
//MoonUtils::copy("tmp/baserom/Audiotable", "Extract/Audiotable");
|
//MoonUtils::copy("tmp/baserom/Audiotable", "Extract/Audiotable");
|
||||||
//MoonUtils::copy("tmp/baserom/version", "Extract/version");
|
//MoonUtils::copy("tmp/baserom/version", "Extract/version");
|
||||||
MoonUtils::write("Extract/version", (char*)&version.crc, sizeof(version.crc));
|
|
||||||
|
|
||||||
MoonUtils::copy("assets/game/", "Extract/assets/");
|
MoonUtils::copy("assets/game/", "Extract/assets/");
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef EXTRACT_BASEROM_H_
|
#ifndef EXTRACT_BASEROM_H_
|
||||||
#define EXTRACT_BASEROM_H_
|
#define EXTRACT_BASEROM_H_
|
||||||
|
|
||||||
#include "../../libultraship/libultraship/GameVersions.h"
|
#include "src/resource/GameVersions.h"
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ std::string GetXMLVersion(RomVersion version)
|
|||||||
switch (version.crc)
|
switch (version.crc)
|
||||||
{
|
{
|
||||||
case OOT_PAL_GC_DBG1: return "GC_NMQ_D";
|
case OOT_PAL_GC_DBG1: return "GC_NMQ_D";
|
||||||
case OOT_PAL_GC_DBG2: return "GC_MQ_D";
|
case OOT_PAL_GC_MQ_DBG: return "GC_MQ_D";
|
||||||
case OOT_PAL_GC: return "GC_NMQ_PAL_F";
|
case OOT_PAL_GC: return "GC_NMQ_PAL_F";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ void startWorker(RomVersion version) {
|
|||||||
|
|
||||||
path += GetXMLVersion(version);
|
path += GetXMLVersion(version);
|
||||||
|
|
||||||
Util::write("tmp/baserom/version", (char*)&version.crc, sizeof(version.crc));
|
// Util::write("tmp/baserom/version", (char*)&version.crc, sizeof(version.crc));
|
||||||
|
|
||||||
if (oldExtractMode)
|
if (oldExtractMode)
|
||||||
{
|
{
|
||||||
@@ -111,7 +111,7 @@ void startWorker(RomVersion version) {
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::string execStr = Util::format("assets/extractor/%s", isWindows() ? "ZAPD.exe" : "ZAPD.out");
|
std::string execStr = Util::format("assets/extractor/%s", isWindows() ? "ZAPD.exe" : "ZAPD.out");
|
||||||
std::string args = Util::format(" ed -eh -i %s -b tmp/rom.z64 -fl assets/extractor/filelists -o %s -osf %s -gsf 1 -rconf assets/extractor/Config_%s.xml -se OTR %s", path.c_str(), path + "../", path + "../", GetXMLVersion(version).c_str(), "");
|
std::string args = Util::format(" ed -eh -i %s -b tmp/rom.z64 -fl assets/extractor/filelists -o %s -osf %s -gsf 1 -rconf assets/extractor/Config_%s.xml -se OTR %s", path.c_str(), (path + "/../").c_str(), (path + "/../").c_str(), GetXMLVersion(version).c_str(), "");
|
||||||
ProcessResult result = NativeFS->LaunchProcess(execStr + args);
|
ProcessResult result = NativeFS->LaunchProcess(execStr + args);
|
||||||
|
|
||||||
if (result.exitCode != 0) {
|
if (result.exitCode != 0) {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ A PC port of OoT allowing you to enjoy the game with modern controls, widescreen
|
|||||||
|
|
||||||
The Ship does not include assets and as such requires a prior copy of the game to play.
|
The Ship does not include assets and as such requires a prior copy of the game to play.
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start (Windows)
|
||||||
|
|
||||||
1) Download The Ship of Harkinian from [Discord](https://discord.com/invite/BtBmd55HVH).
|
1) Download The Ship of Harkinian from [Discord](https://discord.com/invite/BtBmd55HVH).
|
||||||
2) Requires a supported copy of the game (See supported games below).
|
2) Requires a supported copy of the game (See supported games below).
|
||||||
@@ -12,16 +12,25 @@ The Ship does not include assets and as such requires a prior copy of the game t
|
|||||||
4) Launch `soh.exe`
|
4) Launch `soh.exe`
|
||||||
|
|
||||||
### Supported Games
|
### Supported Games
|
||||||
Ocarina of Time Debug (not Master Quest)
|
#### Ocarina of Time Debug PAL GC (not Master Quest)
|
||||||
|
> Currently the recommended option
|
||||||
```
|
```
|
||||||
Build team: `zelda@srd022j`
|
Build team: `zelda@srd022j`
|
||||||
Build date: `03-02-21 00:49:18` (year-month-day)
|
Build date: `03-02-21 00:49:18` (year-month-day)
|
||||||
sha1: cee6bc3c2a634b41728f2af8da54d9bf8cc14099
|
sha1: cee6bc3c2a634b41728f2af8da54d9bf8cc14099
|
||||||
```
|
```
|
||||||
Ocarina of Time PAL GameCube
|
#### Ocarina of Time PAL GameCube
|
||||||
|
> May lead to crashes and instability
|
||||||
```
|
```
|
||||||
sha1: 0227d7c0074f2d0ac935631990da8ec5914597b4
|
sha1: 0227d7c0074f2d0ac935631990da8ec5914597b4
|
||||||
```
|
```
|
||||||
|
#### Ocarina of Time Debug PAL GC MQ (Dungeons will be Master Quest)
|
||||||
|
```
|
||||||
|
Build team: `zelda@srd022j`
|
||||||
|
Build date: `03-02-21 00:16:31` (year-month-day)
|
||||||
|
sha1: 079b855b943d6ad8bd1eb026c0ed169ecbdac7da (Produced by decomp)
|
||||||
|
sha1: 50bebedad9e0f10746a52b07239e47fa6c284d03 (Alternate)
|
||||||
|
```
|
||||||
|
|
||||||
Congratulations, you are now sailing with the Ship of Harkinian! Have fun!
|
Congratulations, you are now sailing with the Ship of Harkinian! Have fun!
|
||||||
|
|
||||||
@@ -29,10 +38,10 @@ Congratulations, you are now sailing with the Ship of Harkinian! Have fun!
|
|||||||
|
|
||||||
The Ship of Harkinian uses a proprietary versioning system consisting of a sci-fi film character followed by a phonetic alphabet code word. The film character represents a major release version which increments with the addition of many new features and bug fixes. The code word represents a minor release version which increments with small updates mainly comprised of bug fixes. For example, `DECKARD ALFA`.
|
The Ship of Harkinian uses a proprietary versioning system consisting of a sci-fi film character followed by a phonetic alphabet code word. The film character represents a major release version which increments with the addition of many new features and bug fixes. The code word represents a minor release version which increments with small updates mainly comprised of bug fixes. For example, `DECKARD ALFA`.
|
||||||
|
|
||||||
### The Extraction Tool
|
### Windows Rom Extraction
|
||||||
|
|
||||||
* Open a rom to initiate generating the `oot.otr` archive file.
|
* Open OTRGui.exe, and select one of the supported roms listed above, to generate the `oot.otr` archive file.
|
||||||
* If a second button exists then `oot.otr` already exists. To prevent overwriting the old `oot.otr` use this button to choose a new game directory. The new directory must not already contain an `oot.otr` to prevent an error.
|
* If a second button already exits then `oot.otr` already exists. To prevent overwriting the old `oot.otr` use this button to choose a new game directory. The new directory must not already contain an `oot.otr` to prevent an error.
|
||||||
* When the process completes, place `oot.otr` beside `soh.exe` if it is not already.
|
* When the process completes, place `oot.otr` beside `soh.exe` if it is not already.
|
||||||
|
|
||||||
This packaging process can take up to **5 minutes**.
|
This packaging process can take up to **5 minutes**.
|
||||||
@@ -40,13 +49,60 @@ This packaging process can take up to **5 minutes**.
|
|||||||
Close the OTRGui when the `Done!` message appears.
|
Close the OTRGui when the `Done!` message appears.
|
||||||
If you get another message, then you might have selected the wrong rom. Make sure to use a rom consistent with the above checksum.
|
If you get another message, then you might have selected the wrong rom. Make sure to use a rom consistent with the above checksum.
|
||||||
|
|
||||||
|
### Linux Rom Extraction
|
||||||
|
|
||||||
|
* Place one of the supported roms in the same folder as the appimage.
|
||||||
|
* When you run the soh appimage, it should begin generating the `oot.otr` archive file.
|
||||||
|
* When the process completes, place `oot.otr` in the same folder as the appimage, if it is not already, then run the appimage.
|
||||||
|
|
||||||
|
The packaging process can take up to **5 minutes**.
|
||||||
|
|
||||||
|
If you get any errors, then you might have selected the wrong rom. Make sure to use a rom consistent with the above checksum.
|
||||||
|
|
||||||
|
### MacOS Rom Extraction
|
||||||
|
|
||||||
|
* Run `soh.app`, and when prompted, select one of the supported roms listed above.
|
||||||
|
* You should see a notification saying `Processing OTR`, then, once the process is complete, you should get a notification saying `OTR Successfully Generated`, then the game should start.
|
||||||
|
|
||||||
|
The packing process can take up to **5 minutes**.
|
||||||
|
|
||||||
|
If you get an error saying `Incompatible ROM hash`, you have selected the wrong rom, make sure the checksum matches one of the ones listed above.
|
||||||
|
|
||||||
|
### Nintendo Switch Rom Extraction
|
||||||
|
|
||||||
|
* Download the latest PC release of the Ship of Harkinian, and follow the instructions above for generating the `oot.otr` archive on that platform.
|
||||||
|
* Place the `.nro` and the `oot.otr` archive into a folder called `soh` in your Switch folder on your Switch
|
||||||
|
|
||||||
|
### Nintendo Wii U Rom Extraction
|
||||||
|
|
||||||
|
* Download the latest PC release of the Ship of Harkinian, and follow the instructions above for generating the `oot.otr` archive on that platform.
|
||||||
|
* Copy the `.rpx` and the `oot.otr` archive to `wiiu/apps/soh`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
If you still cannot get the tool to work, join our [Discord Server](https://discord.com/invite/BtBmd55HVH) and ask for help in the `#support` text channel. Keep-in-mind that we do not condone piracy in any way.
|
If you still cannot get the tool to work, join our [Discord Server](https://discord.com/invite/BtBmd55HVH) and ask for help in the `#support` text channel. Keep-in-mind that we do not condone piracy in any way.
|
||||||
|
|
||||||
### Running The Ship of Harkinian
|
### Running The Ship of Harkinian
|
||||||
|
|
||||||
Launch the game. If the window immediately closes, or if there are visual artifacts, you may have selected the wrong rom in the OTRGui tool.
|
Launch the game. If the window immediately closes, or if there are visual artifacts, you may have selected the wrong rom in the OTRGui tool.
|
||||||
|
|
||||||
Currently, DirectX 11 and OpenGL is supported. Change the renderer by opening the `shipofharkinian.ini` configuration file in notepad and add `sdl` to `gfx backend` for OpenGL or leave blank for DirectX.
|
Default keyboard configuration:
|
||||||
|
| N64 | A | B | Z | Start | Analog stick | C buttons | D-Pad |
|
||||||
|
| - | - | - | - | - | - | - | - |
|
||||||
|
| Keyboard | X | C | Z | Space | WASD | Arrow keys | TFGH |
|
||||||
|
|
||||||
|
Other shortcuts:
|
||||||
|
| Keys | Action |
|
||||||
|
| - | - |
|
||||||
|
| F1 | Toggle menubar |
|
||||||
|
| F5 | Save state |
|
||||||
|
| F6 | Change state |
|
||||||
|
| F7 | Load state |
|
||||||
|
| F10 | Fullscreen (OpenGL) |
|
||||||
|
| Alt+Enter | Fullscreen (DirectX) |
|
||||||
|
| Ctrl+R | Reset |
|
||||||
|
|
||||||
|
Currently, DirectX 11 and OpenGL are supported. Change the renderer by opening the `shipofharkinian.json` configuration file in notepad and add `sdl` to the quotes in `"GfxBackend": ""` for OpenGL or leave blank for DirectX.
|
||||||
|
|
||||||
## Take The Survey
|
## Take The Survey
|
||||||
Want to use cartridge readers in tandem with the OTRGui?
|
Want to use cartridge readers in tandem with the OTRGui?
|
||||||
@@ -60,9 +116,19 @@ Official Discord: https://discord.com/invite/BtBmd55HVH
|
|||||||
|
|
||||||
Refer to the [building instructions](BUILDING.md) to compile SoH.
|
Refer to the [building instructions](BUILDING.md) to compile SoH.
|
||||||
|
|
||||||
|
## Getting CI to work on your fork
|
||||||
|
|
||||||
|
The CI works via [Github Actions](https://github.com/features/actions) where we mostly make use of machines hosted by Github; except for the very first step of the CI process called "Extract assets". This steps extracts assets from the game file and generates an "assets" folder in `soh/`.
|
||||||
|
|
||||||
|
To get this step working on your fork, you'll need to add a machine to your own repository as a self-hosted runner via "Settings > Actions > Runners" in your repository settings. If you're on macOS or Linux take a look at `macports-deps.txt` or `apt-deps.txt` to see the dependencies expected to be on your machine. For Windows, deps get installed as part of the CI process. To setup your runner as a service read the docs [here](https://docs.github.com/en/actions/hosting-your-own-runners/configuring-the-self-hosted-runner-application-as-a-service?platform=linux).
|
||||||
|
|
||||||
|
|
||||||
## Troubleshooting The Exporter
|
## Troubleshooting The Exporter
|
||||||
- Affirm that you have an `/assets` folder filled with XMLs in the same directory as OTRGui.exe
|
- Confirm that you have an `/assets` folder filled with XMLs in the same directory as OTRGui.exe
|
||||||
- Affirm that `zapd.exe` exists in the `/assets/extractor` folder
|
- Confirm that `zapd.exe` exists in the `/assets/extractor` folder
|
||||||
|
|
||||||
|
## Nightly Builds
|
||||||
|
Nightly builds of Ship of Harkinian are available here: [Windows](https://nightly.link/HarbourMasters/Shipwright/workflows/generate-builds/develop/soh-windows.zip), [macOS](https://nightly.link/HarbourMasters/Shipwright/workflows/generate-builds/develop/soh-mac.zip), [Linux](https://nightly.link/HarbourMasters/Shipwright/workflows/generate-builds/develop/soh-linux.zip), [Switch](https://nightly.link/HarbourMasters/Shipwright/workflows/generate-builds/develop/soh-switch.zip), [Wii U](https://nightly.link/HarbourMasters/Shipwright/workflows/generate-builds/develop/soh-wiiu.zip)
|
||||||
|
|
||||||
|
|
||||||
## The Harbour Masters Are...
|
## The Harbour Masters Are...
|
||||||
@@ -102,10 +168,9 @@ Refer to the [building instructions](BUILDING.md) to compile SoH.
|
|||||||
|
|
||||||
## Video Credits
|
## Video Credits
|
||||||
Kenix | Producer / Writer
|
Kenix | Producer / Writer
|
||||||
rainbow_fash | Executive Producer
|
briaguya | Writer
|
||||||
TheLegendOfXela | Editor
|
rainbow_fash | Executive Producer
|
||||||
|
ReveriePass | Editor
|
||||||
MicTheMicrophone | Gwonam / The King
|
MicTheMicrophone | Gwonam / The King
|
||||||
Amphibibro | Link
|
Amphibibro | Link
|
||||||
AceHeart | Zelda
|
AceHeart | Zelda
|
||||||
|
|
||||||
###### Lemons
|
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
# use variables in submakes
|
|
||||||
export
|
|
||||||
OPTIMIZATION_ON ?= 1
|
|
||||||
ASAN ?= 0
|
|
||||||
DEPRECATION_ON ?= 1
|
|
||||||
DEBUG ?= 0
|
|
||||||
COPYCHECK_ARGS ?=
|
|
||||||
LLD ?= 0
|
|
||||||
WERROR ?= 0
|
|
||||||
|
|
||||||
# Use clang++ if available, else use g++
|
|
||||||
ifeq ($(shell command -v clang++ >/dev/null 2>&1; echo $$?),0)
|
|
||||||
CXX := clang++
|
|
||||||
else
|
|
||||||
CXX := g++
|
|
||||||
endif
|
|
||||||
|
|
||||||
INC := -I ZAPD -I lib/elfio -I lib/libgfxd -I lib/tinyxml2 -I ZAPDUtils
|
|
||||||
CXXFLAGS := -fpic -std=c++17 -Wall -Wextra -fno-omit-frame-pointer
|
|
||||||
OPTFLAGS :=
|
|
||||||
|
|
||||||
ifneq ($(DEBUG),0)
|
|
||||||
OPTIMIZATION_ON = 0
|
|
||||||
CXXFLAGS += -g3 -DDEVELOPMENT -D_DEBUG
|
|
||||||
COPYCHECK_ARGS += --devel
|
|
||||||
DEPRECATION_ON = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(WERROR),0)
|
|
||||||
CXXFLAGS += -Werror
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(OPTIMIZATION_ON),0)
|
|
||||||
OPTFLAGS := -O0
|
|
||||||
else
|
|
||||||
OPTFLAGS := -O2
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(ASAN),0)
|
|
||||||
CXXFLAGS += -fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined
|
|
||||||
endif
|
|
||||||
ifneq ($(DEPRECATION_ON),0)
|
|
||||||
CXXFLAGS += -DDEPRECATION_ON
|
|
||||||
endif
|
|
||||||
# CXXFLAGS += -DTEXTURE_DEBUG
|
|
||||||
|
|
||||||
LDFLAGS := -lm -ldl -lpng \
|
|
||||||
-L../external -L../libultraship -lz -lbz2 -pthread -lpulse -lultraship -lstorm -lSDL2 -lGLEW -lGL -lX11
|
|
||||||
|
|
||||||
# Use LLD if available. Set LLD=0 to not use it
|
|
||||||
ifeq ($(shell command -v ld.lld >/dev/null 2>&1; echo $$?),0)
|
|
||||||
LLD := 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(LLD),0)
|
|
||||||
LDFLAGS += -fuse-ld=lld
|
|
||||||
endif
|
|
||||||
|
|
||||||
UNAME := $(shell uname)
|
|
||||||
UNAMEM := $(shell uname -m)
|
|
||||||
ifneq ($(UNAME), Darwin)
|
|
||||||
LDFLAGS += -Wl,-export-dynamic -lstdc++fs
|
|
||||||
EXPORTERS := -Wl,--whole-archive ../OTRExporter/OTRExporter/OTRExporter.a -Wl,--no-whole-archive
|
|
||||||
else
|
|
||||||
EXPORTERS := -Wl,-force_load ../OTRExporter/OTRExporter/OTRExporter.a
|
|
||||||
ifeq ($(UNAMEM),arm64)
|
|
||||||
ifeq ($(shell brew list libpng > /dev/null 2>&1; echo $$?),0)
|
|
||||||
LDFLAGS += -L $(shell brew --prefix)/lib
|
|
||||||
INC += -I $(shell brew --prefix)/include
|
|
||||||
else
|
|
||||||
$(error Please install libpng via Homebrew)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
ZAPD_SRC_DIRS := $(shell find ZAPD -type d)
|
|
||||||
SRC_DIRS = $(ZAPD_SRC_DIRS) lib/tinyxml2
|
|
||||||
|
|
||||||
ZAPD_CPP_FILES := $(foreach dir,$(ZAPD_SRC_DIRS),$(wildcard $(dir)/*.cpp))
|
|
||||||
ZAPD_H_FILES := $(foreach dir,$(ZAPD_SRC_DIRS),$(wildcard $(dir)/*.h))
|
|
||||||
|
|
||||||
CPP_FILES += $(ZAPD_CPP_FILES) lib/tinyxml2/tinyxml2.cpp
|
|
||||||
O_FILES := $(foreach f,$(CPP_FILES:.cpp=.o),build/$f)
|
|
||||||
O_FILES += build/ZAPD/BuildInfo.o
|
|
||||||
|
|
||||||
# create build directories
|
|
||||||
$(shell mkdir -p $(foreach dir,$(SRC_DIRS),build/$(dir)))
|
|
||||||
|
|
||||||
|
|
||||||
# Main targets
|
|
||||||
all: ZAPD.out copycheck
|
|
||||||
|
|
||||||
build/ZAPD/BuildInfo.o:
|
|
||||||
python3 ZAPD/genbuildinfo.py $(COPYCHECK_ARGS)
|
|
||||||
$(CXX) $(CXXFLAGS) $(OPTFLAGS) $(INC) -c $(OUTPUT_OPTION) build/ZAPD/BuildInfo.cpp
|
|
||||||
|
|
||||||
copycheck: ZAPD.out
|
|
||||||
python3 copycheck.py
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf build ZAPD.out
|
|
||||||
$(MAKE) -C lib/libgfxd clean
|
|
||||||
$(MAKE) -C ZAPDUtils clean
|
|
||||||
$(MAKE) -C ExporterTest clean
|
|
||||||
|
|
||||||
rebuild: clean all
|
|
||||||
|
|
||||||
format:
|
|
||||||
clang-format-11 -i $(ZAPD_CPP_FILES) $(ZAPD_H_FILES)
|
|
||||||
$(MAKE) -C ZAPDUtils format
|
|
||||||
$(MAKE) -C ExporterTest format
|
|
||||||
|
|
||||||
.PHONY: all build/ZAPD/BuildInfo.o copycheck clean rebuild format
|
|
||||||
|
|
||||||
build/%.o: %.cpp
|
|
||||||
$(CXX) $(CXXFLAGS) $(OPTFLAGS) $(INC) -c $(OUTPUT_OPTION) $<
|
|
||||||
|
|
||||||
|
|
||||||
# Submakes
|
|
||||||
lib/libgfxd/libgfxd.a:
|
|
||||||
$(MAKE) -C lib/libgfxd
|
|
||||||
|
|
||||||
.PHONY: ExporterTest
|
|
||||||
ExporterTest:
|
|
||||||
$(MAKE) -C ExporterTest
|
|
||||||
|
|
||||||
.PHONY: ZAPDUtils
|
|
||||||
ZAPDUtils:
|
|
||||||
$(MAKE) -C ZAPDUtils
|
|
||||||
|
|
||||||
|
|
||||||
# Linking
|
|
||||||
ZAPD.out: $(O_FILES) lib/libgfxd/libgfxd.a ExporterTest ZAPDUtils
|
|
||||||
$(CXX) $(CXXFLAGS) $(O_FILES) lib/libgfxd/libgfxd.a ZAPDUtils/ZAPDUtils.a $(EXPORTERS) $(LDFLAGS) $(OUTPUT_OPTION)
|
|
||||||
@@ -0,0 +1,495 @@
|
|||||||
|
set(PROJECT_NAME ZAPD)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
|
||||||
|
#set(CMAKE_C_STANDARD 11 CACHE STRING "The C standard to use")
|
||||||
|
set(CMAKE_C_STANDARD 11)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Source groups
|
||||||
|
################################################################################
|
||||||
|
set(Header_Files
|
||||||
|
"../lib/tinyxml2/tinyxml2.h"
|
||||||
|
"CRC32.h"
|
||||||
|
"Declaration.h"
|
||||||
|
"FileWorker.h"
|
||||||
|
"GameConfig.h"
|
||||||
|
"Globals.h"
|
||||||
|
"ImageBackend.h"
|
||||||
|
"OutputFormatter.h"
|
||||||
|
"WarningHandler.h"
|
||||||
|
)
|
||||||
|
source_group("Header Files" FILES ${Header_Files})
|
||||||
|
|
||||||
|
set(Header_Files__Libraries
|
||||||
|
"../../libultraship/extern/stb/stb_image.h"
|
||||||
|
"../../libultraship/extern/stb/stb_image_write.h"
|
||||||
|
"ctpl_stl.h"
|
||||||
|
)
|
||||||
|
source_group("Header Files\\Libraries" FILES ${Header_Files__Libraries})
|
||||||
|
|
||||||
|
set(Header_Files__Libraries__elfio
|
||||||
|
"../lib/elfio/elfio/elf_types.hpp"
|
||||||
|
"../lib/elfio/elfio/elfio.hpp"
|
||||||
|
"../lib/elfio/elfio/elfio_dump.hpp"
|
||||||
|
"../lib/elfio/elfio/elfio_dynamic.hpp"
|
||||||
|
"../lib/elfio/elfio/elfio_header.hpp"
|
||||||
|
"../lib/elfio/elfio/elfio_note.hpp"
|
||||||
|
"../lib/elfio/elfio/elfio_relocation.hpp"
|
||||||
|
"../lib/elfio/elfio/elfio_section.hpp"
|
||||||
|
"../lib/elfio/elfio/elfio_segment.hpp"
|
||||||
|
"../lib/elfio/elfio/elfio_strings.hpp"
|
||||||
|
"../lib/elfio/elfio/elfio_symbols.hpp"
|
||||||
|
"../lib/elfio/elfio/elfio_utils.hpp"
|
||||||
|
)
|
||||||
|
source_group("Header Files\\Libraries\\elfio" FILES ${Header_Files__Libraries__elfio})
|
||||||
|
|
||||||
|
set(Header_Files__Libraries__libgfxd
|
||||||
|
"../lib/libgfxd/gbi.h"
|
||||||
|
"../lib/libgfxd/gfxd.h"
|
||||||
|
"../lib/libgfxd/priv.h"
|
||||||
|
)
|
||||||
|
source_group("Header Files\\Libraries\\libgfxd" FILES ${Header_Files__Libraries__libgfxd})
|
||||||
|
|
||||||
|
set(Header_Files__Yaz0
|
||||||
|
"yaz0/readwrite.h"
|
||||||
|
"yaz0/yaz0.h"
|
||||||
|
)
|
||||||
|
source_group("Header Files\\Yaz0" FILES ${Header_Files__Yaz0})
|
||||||
|
|
||||||
|
set(Header_Files__Z64
|
||||||
|
"OtherStructs/SkinLimbStructs.h"
|
||||||
|
"Overlays/ZOverlay.h"
|
||||||
|
"ZAnimation.h"
|
||||||
|
"ZArray.h"
|
||||||
|
"ZAudio.h"
|
||||||
|
"ZBackground.h"
|
||||||
|
"ZBlob.h"
|
||||||
|
"ZCollision.h"
|
||||||
|
"ZCutscene.h"
|
||||||
|
"ZCutsceneMM.h"
|
||||||
|
"ZDisplayList.h"
|
||||||
|
"ZFile.h"
|
||||||
|
"ZLimb.h"
|
||||||
|
"ZMtx.h"
|
||||||
|
"ZPath.h"
|
||||||
|
"ZPlayerAnimationData.h"
|
||||||
|
"ZResource.h"
|
||||||
|
"ZRom.h"
|
||||||
|
"ZScalar.h"
|
||||||
|
"ZSkeleton.h"
|
||||||
|
"ZString.h"
|
||||||
|
"ZSymbol.h"
|
||||||
|
"ZText.h"
|
||||||
|
"ZTexture.h"
|
||||||
|
"ZTextureAnimation.h"
|
||||||
|
"ZVector.h"
|
||||||
|
"ZVtx.h"
|
||||||
|
)
|
||||||
|
source_group("Header Files\\Z64" FILES ${Header_Files__Z64})
|
||||||
|
|
||||||
|
set(Header_Files__Z64__ZRoom
|
||||||
|
"ZRoom/ZRoom.h"
|
||||||
|
"ZRoom/ZRoomCommand.h"
|
||||||
|
)
|
||||||
|
source_group("Header Files\\Z64\\ZRoom" FILES ${Header_Files__Z64__ZRoom})
|
||||||
|
|
||||||
|
set(Header_Files__Z64__ZRoom__Commands
|
||||||
|
"ZRoom/Commands/EndMarker.h"
|
||||||
|
"ZRoom/Commands/SetActorCutsceneList.h"
|
||||||
|
"ZRoom/Commands/SetActorList.h"
|
||||||
|
"ZRoom/Commands/SetAlternateHeaders.h"
|
||||||
|
"ZRoom/Commands/SetAnimatedMaterialList.h"
|
||||||
|
"ZRoom/Commands/SetCameraSettings.h"
|
||||||
|
"ZRoom/Commands/SetCollisionHeader.h"
|
||||||
|
"ZRoom/Commands/SetCsCamera.h"
|
||||||
|
"ZRoom/Commands/SetCutscenes.h"
|
||||||
|
"ZRoom/Commands/SetEchoSettings.h"
|
||||||
|
"ZRoom/Commands/SetEntranceList.h"
|
||||||
|
"ZRoom/Commands/SetExitList.h"
|
||||||
|
"ZRoom/Commands/SetLightingSettings.h"
|
||||||
|
"ZRoom/Commands/SetLightList.h"
|
||||||
|
"ZRoom/Commands/SetMesh.h"
|
||||||
|
"ZRoom/Commands/SetMinimapChests.h"
|
||||||
|
"ZRoom/Commands/SetMinimapList.h"
|
||||||
|
"ZRoom/Commands/SetObjectList.h"
|
||||||
|
"ZRoom/Commands/SetPathways.h"
|
||||||
|
"ZRoom/Commands/SetRoomBehavior.h"
|
||||||
|
"ZRoom/Commands/SetRoomList.h"
|
||||||
|
"ZRoom/Commands/SetSkyboxModifier.h"
|
||||||
|
"ZRoom/Commands/SetSkyboxSettings.h"
|
||||||
|
"ZRoom/Commands/SetSoundSettings.h"
|
||||||
|
"ZRoom/Commands/SetSpecialObjects.h"
|
||||||
|
"ZRoom/Commands/SetStartPositionList.h"
|
||||||
|
"ZRoom/Commands/SetTimeSettings.h"
|
||||||
|
"ZRoom/Commands/SetTransitionActorList.h"
|
||||||
|
"ZRoom/Commands/SetWind.h"
|
||||||
|
"ZRoom/Commands/SetWorldMapVisited.h"
|
||||||
|
"ZRoom/Commands/Unused09.h"
|
||||||
|
"ZRoom/Commands/Unused1D.h"
|
||||||
|
"ZRoom/Commands/ZRoomCommandUnk.h"
|
||||||
|
)
|
||||||
|
source_group("Header Files\\Z64\\ZRoom\\Commands" FILES ${Header_Files__Z64__ZRoom__Commands})
|
||||||
|
|
||||||
|
set(Resource_Files
|
||||||
|
"../../OTRExporter/CFG/SymbolMap_OoTMqDbg.txt"
|
||||||
|
)
|
||||||
|
source_group("Resource Files" FILES ${Resource_Files})
|
||||||
|
|
||||||
|
set(Source_Files
|
||||||
|
"Declaration.cpp"
|
||||||
|
"FileWorker.cpp"
|
||||||
|
"GameConfig.cpp"
|
||||||
|
"Globals.cpp"
|
||||||
|
"ImageBackend.cpp"
|
||||||
|
"Main.cpp"
|
||||||
|
"OutputFormatter.cpp"
|
||||||
|
"WarningHandler.cpp"
|
||||||
|
)
|
||||||
|
source_group("Source Files" FILES ${Source_Files})
|
||||||
|
|
||||||
|
set(Source_Files__Libraries__libgfxd
|
||||||
|
"../lib/libgfxd/gfxd.c"
|
||||||
|
"../lib/libgfxd/uc.c"
|
||||||
|
"../lib/libgfxd/uc_f3d.c"
|
||||||
|
"../lib/libgfxd/uc_f3db.c"
|
||||||
|
"../lib/libgfxd/uc_f3dex.c"
|
||||||
|
"../lib/libgfxd/uc_f3dex2.c"
|
||||||
|
"../lib/libgfxd/uc_f3dexb.c"
|
||||||
|
)
|
||||||
|
source_group("Source Files\\Libraries\\libgfxd" FILES ${Source_Files__Libraries__libgfxd})
|
||||||
|
|
||||||
|
set(Source_Files__Yaz0
|
||||||
|
"yaz0/yaz0.cpp"
|
||||||
|
)
|
||||||
|
source_group("Source Files\\Yaz0" FILES ${Source_Files__Yaz0})
|
||||||
|
|
||||||
|
set(Source_Files__Z64
|
||||||
|
"OtherStructs/SkinLimbStructs.cpp"
|
||||||
|
"Overlays/ZOverlay.cpp"
|
||||||
|
"ZAnimation.cpp"
|
||||||
|
"ZArray.cpp"
|
||||||
|
"ZAudio.cpp"
|
||||||
|
"ZAudioDecode.cpp"
|
||||||
|
"ZBackground.cpp"
|
||||||
|
"ZBlob.cpp"
|
||||||
|
"ZCollision.cpp"
|
||||||
|
"ZCutscene.cpp"
|
||||||
|
"ZCutsceneMM.cpp"
|
||||||
|
"ZDisplayList.cpp"
|
||||||
|
"ZFile.cpp"
|
||||||
|
"ZLimb.cpp"
|
||||||
|
"ZMtx.cpp"
|
||||||
|
"ZPath.cpp"
|
||||||
|
"ZPlayerAnimationData.cpp"
|
||||||
|
"ZResource.cpp"
|
||||||
|
"ZRom.cpp"
|
||||||
|
"ZScalar.cpp"
|
||||||
|
"ZSkeleton.cpp"
|
||||||
|
"ZString.cpp"
|
||||||
|
"ZSymbol.cpp"
|
||||||
|
"ZText.cpp"
|
||||||
|
"ZTexture.cpp"
|
||||||
|
"ZTextureAnimation.cpp"
|
||||||
|
"ZVector.cpp"
|
||||||
|
"ZVtx.cpp"
|
||||||
|
)
|
||||||
|
source_group("Source Files\\Z64" FILES ${Source_Files__Z64})
|
||||||
|
|
||||||
|
set(Source_Files__Z64__ZRoom
|
||||||
|
"ZRoom/ZRoom.cpp"
|
||||||
|
"ZRoom/ZRoomCommand.cpp"
|
||||||
|
)
|
||||||
|
source_group("Source Files\\Z64\\ZRoom" FILES ${Source_Files__Z64__ZRoom})
|
||||||
|
|
||||||
|
set(Source_Files__Z64__ZRoom__Commands
|
||||||
|
"ZRoom/Commands/EndMarker.cpp"
|
||||||
|
"ZRoom/Commands/SetActorCutsceneList.cpp"
|
||||||
|
"ZRoom/Commands/SetActorList.cpp"
|
||||||
|
"ZRoom/Commands/SetAlternateHeaders.cpp"
|
||||||
|
"ZRoom/Commands/SetAnimatedMaterialList.cpp"
|
||||||
|
"ZRoom/Commands/SetCameraSettings.cpp"
|
||||||
|
"ZRoom/Commands/SetCollisionHeader.cpp"
|
||||||
|
"ZRoom/Commands/SetCsCamera.cpp"
|
||||||
|
"ZRoom/Commands/SetCutscenes.cpp"
|
||||||
|
"ZRoom/Commands/SetEchoSettings.cpp"
|
||||||
|
"ZRoom/Commands/SetEntranceList.cpp"
|
||||||
|
"ZRoom/Commands/SetExitList.cpp"
|
||||||
|
"ZRoom/Commands/SetLightingSettings.cpp"
|
||||||
|
"ZRoom/Commands/SetLightList.cpp"
|
||||||
|
"ZRoom/Commands/SetMesh.cpp"
|
||||||
|
"ZRoom/Commands/SetMinimapChests.cpp"
|
||||||
|
"ZRoom/Commands/SetMinimapList.cpp"
|
||||||
|
"ZRoom/Commands/SetObjectList.cpp"
|
||||||
|
"ZRoom/Commands/SetPathways.cpp"
|
||||||
|
"ZRoom/Commands/SetRoomBehavior.cpp"
|
||||||
|
"ZRoom/Commands/SetRoomList.cpp"
|
||||||
|
"ZRoom/Commands/SetSkyboxModifier.cpp"
|
||||||
|
"ZRoom/Commands/SetSkyboxSettings.cpp"
|
||||||
|
"ZRoom/Commands/SetSoundSettings.cpp"
|
||||||
|
"ZRoom/Commands/SetSpecialObjects.cpp"
|
||||||
|
"ZRoom/Commands/SetStartPositionList.cpp"
|
||||||
|
"ZRoom/Commands/SetTimeSettings.cpp"
|
||||||
|
"ZRoom/Commands/SetTransitionActorList.cpp"
|
||||||
|
"ZRoom/Commands/SetWind.cpp"
|
||||||
|
"ZRoom/Commands/SetWorldMapVisited.cpp"
|
||||||
|
"ZRoom/Commands/Unused09.cpp"
|
||||||
|
"ZRoom/Commands/Unused1D.cpp"
|
||||||
|
"ZRoom/Commands/ZRoomCommandUnk.cpp"
|
||||||
|
)
|
||||||
|
source_group("Source Files\\Z64\\ZRoom\\Commands" FILES ${Source_Files__Z64__ZRoom__Commands})
|
||||||
|
|
||||||
|
set(ALL_FILES
|
||||||
|
${Header_Files}
|
||||||
|
${Header_Files__Libraries}
|
||||||
|
${Header_Files__Libraries__elfio}
|
||||||
|
${Header_Files__Libraries__libgfxd}
|
||||||
|
${Header_Files__Yaz0}
|
||||||
|
${Header_Files__Z64}
|
||||||
|
${Header_Files__Z64__ZRoom}
|
||||||
|
${Header_Files__Z64__ZRoom__Commands}
|
||||||
|
${Resource_Files}
|
||||||
|
${Source_Files}
|
||||||
|
${Source_Files__Libraries__libgfxd}
|
||||||
|
${Source_Files__Yaz0}
|
||||||
|
${Source_Files__Z64}
|
||||||
|
${Source_Files__Z64__ZRoom}
|
||||||
|
${Source_Files__Z64__ZRoom__Commands}
|
||||||
|
${any__any}
|
||||||
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Target
|
||||||
|
################################################################################
|
||||||
|
add_executable(${PROJECT_NAME} ${ALL_FILES})
|
||||||
|
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
use_props(${PROJECT_NAME} "${CMAKE_CONFIGURATION_TYPES}" "${DEFAULT_CXX_PROPS}")
|
||||||
|
endif()
|
||||||
|
################################################################################
|
||||||
|
# Includes for CMake from *.props
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
set(ROOT_NAMESPACE ZAPD)
|
||||||
|
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
||||||
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||||
|
INTERPROCEDURAL_OPTIMIZATION_RELEASE "TRUE"
|
||||||
|
)
|
||||||
|
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x86")
|
||||||
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||||
|
INTERPROCEDURAL_OPTIMIZATION_RELEASE "TRUE"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
|
||||||
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||||
|
OUTPUT_NAME "ZAPD.out"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
################################################################################
|
||||||
|
# MSVC runtime library
|
||||||
|
################################################################################
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
get_property(MSVC_RUNTIME_LIBRARY_DEFAULT TARGET ${PROJECT_NAME} PROPERTY MSVC_RUNTIME_LIBRARY)
|
||||||
|
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
||||||
|
string(CONCAT "MSVC_RUNTIME_LIBRARY_STR"
|
||||||
|
$<$<CONFIG:Debug>:
|
||||||
|
MultiThreadedDebug
|
||||||
|
>
|
||||||
|
$<$<CONFIG:Release>:
|
||||||
|
MultiThreaded
|
||||||
|
>
|
||||||
|
$<$<NOT:$<OR:$<CONFIG:Debug>,$<CONFIG:Release>>>:${MSVC_RUNTIME_LIBRARY_DEFAULT}>
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
set_target_properties(${PROJECT_NAME} PROPERTIES MSVC_RUNTIME_LIBRARY ${MSVC_RUNTIME_LIBRARY_STR})
|
||||||
|
endif()
|
||||||
|
################################################################################
|
||||||
|
# Compile definitions
|
||||||
|
################################################################################
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
||||||
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||||
|
"_CRT_SECURE_NO_WARNINGS;"
|
||||||
|
"_MBCS"
|
||||||
|
STORMLIB_NO_AUTO_LINK
|
||||||
|
)
|
||||||
|
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x86")
|
||||||
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||||
|
"$<$<CONFIG:Debug>:"
|
||||||
|
"_CRT_SECURE_NO_WARNINGS"
|
||||||
|
">"
|
||||||
|
"_MBCS"
|
||||||
|
STORMLIB_NO_AUTO_LINK
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Compile and link options
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
|
set(CMAKE_FIND_FRAMEWORK LAST)
|
||||||
|
endif()
|
||||||
|
find_package(PNG REQUIRED)
|
||||||
|
|
||||||
|
target_include_directories(${PROJECT_NAME} PRIVATE
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/ZAPDUtils
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../ZAPDTR/lib/tinyxml2
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../ZAPDTR/lib/libgfxd
|
||||||
|
${PNG_PNG_INCLUDE_DIR}/
|
||||||
|
.
|
||||||
|
)
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
||||||
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||||
|
$<$<CONFIG:Debug>:
|
||||||
|
/Od;
|
||||||
|
/RTC1
|
||||||
|
>
|
||||||
|
$<$<CONFIG:Release>:
|
||||||
|
/Oi;
|
||||||
|
/Gy
|
||||||
|
>
|
||||||
|
/permissive-;
|
||||||
|
/sdl;
|
||||||
|
/W3;
|
||||||
|
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT};
|
||||||
|
${DEFAULT_CXX_EXCEPTION_HANDLING}
|
||||||
|
)
|
||||||
|
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x86")
|
||||||
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||||
|
$<$<CONFIG:Debug>:
|
||||||
|
/Od
|
||||||
|
>
|
||||||
|
$<$<CONFIG:Release>:
|
||||||
|
/O2;
|
||||||
|
/Oi;
|
||||||
|
/Gy
|
||||||
|
>
|
||||||
|
/permissive-;
|
||||||
|
/sdl;
|
||||||
|
/W3;
|
||||||
|
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT};
|
||||||
|
${DEFAULT_CXX_EXCEPTION_HANDLING}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
||||||
|
target_link_options(${PROJECT_NAME} PRIVATE
|
||||||
|
$<$<CONFIG:Debug>:
|
||||||
|
/PROFILE
|
||||||
|
>
|
||||||
|
$<$<CONFIG:Release>:
|
||||||
|
/OPT:REF;
|
||||||
|
/OPT:ICF
|
||||||
|
>
|
||||||
|
/DEBUG:FULL
|
||||||
|
)
|
||||||
|
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x86")
|
||||||
|
target_link_options(${PROJECT_NAME} PRIVATE
|
||||||
|
$<$<CONFIG:Debug>:
|
||||||
|
/PROFILE
|
||||||
|
>
|
||||||
|
$<$<CONFIG:Release>:
|
||||||
|
/OPT:REF;
|
||||||
|
/OPT:ICF
|
||||||
|
>
|
||||||
|
/DEBUG:FULL
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|AppleClang")
|
||||||
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||||
|
-Wall -Wextra -Wno-error
|
||||||
|
-Wno-unused-parameter
|
||||||
|
-Wno-unused-function
|
||||||
|
-Wno-unused-variable
|
||||||
|
-Wno-missing-field-initializers
|
||||||
|
-Wno-parentheses
|
||||||
|
-Wno-narrowing
|
||||||
|
$<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-enum-enum-conversion>
|
||||||
|
-pthread
|
||||||
|
)
|
||||||
|
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
|
target_link_options(${PROJECT_NAME} PRIVATE
|
||||||
|
-pthread
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
target_link_options(${PROJECT_NAME} PRIVATE
|
||||||
|
-pthread
|
||||||
|
-Wl,-export-dynamic
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Dependencies
|
||||||
|
################################################################################
|
||||||
|
add_dependencies(${PROJECT_NAME}
|
||||||
|
OTRExporter
|
||||||
|
ZAPDUtils
|
||||||
|
libultraship
|
||||||
|
)
|
||||||
|
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
||||||
|
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||||
|
set(ADDITIONAL_LIBRARY_DEPENDENCIES
|
||||||
|
"ZAPDUtils;"
|
||||||
|
"-WHOLEARCHIVE:$<TARGET_LINKER_FILE_DIR:OTRExporter>/$<TARGET_LINKER_FILE_NAME:OTRExporter>"
|
||||||
|
"libultraship;"
|
||||||
|
storm
|
||||||
|
PNG::PNG
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
set(ADDITIONAL_LIBRARY_DEPENDENCIES
|
||||||
|
"ZAPDUtils;"
|
||||||
|
-Wl,-force_load $<TARGET_LINKER_FILE_DIR:OTRExporter>/$<TARGET_LINKER_FILE_NAME:OTRExporter>
|
||||||
|
"libultraship;"
|
||||||
|
PNG::PNG
|
||||||
|
${CMAKE_DL_LIBS}
|
||||||
|
Threads::Threads
|
||||||
|
)
|
||||||
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch")
|
||||||
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
set(ADDITIONAL_LIBRARY_DEPENDENCIES
|
||||||
|
"ZAPDUtils;"
|
||||||
|
-Wl,--whole-archive $<TARGET_LINKER_FILE_DIR:OTRExporter>/$<TARGET_LINKER_FILE_NAME:OTRExporter> -Wl,--no-whole-archive
|
||||||
|
"libultraship;"
|
||||||
|
PNG::PNG
|
||||||
|
Threads::Threads
|
||||||
|
)
|
||||||
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "CafeOS")
|
||||||
|
set(ADDITIONAL_LIBRARY_DEPENDENCIES
|
||||||
|
"ZAPDUtils;"
|
||||||
|
"libultraship;"
|
||||||
|
PNG::PNG
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
set(ADDITIONAL_LIBRARY_DEPENDENCIES
|
||||||
|
"ZAPDUtils;"
|
||||||
|
-Wl,--whole-archive $<TARGET_LINKER_FILE_DIR:OTRExporter>/$<TARGET_LINKER_FILE_NAME:OTRExporter> -Wl,--no-whole-archive
|
||||||
|
"libultraship;"
|
||||||
|
PNG::PNG
|
||||||
|
${CMAKE_DL_LIBS}
|
||||||
|
Threads::Threads
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME MATCHES "NintendoSwitch|CafeOS")
|
||||||
|
add_library(pathconf OBJECT pathconf.c)
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE "${ADDITIONAL_LIBRARY_DEPENDENCIES}" $<TARGET_OBJECTS:pathconf> )
|
||||||
|
else()
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE "${ADDITIONAL_LIBRARY_DEPENDENCIES}")
|
||||||
|
endif()
|
||||||
@@ -119,6 +119,26 @@ void Globals::AddExternalFile(ZFile* file, int workerID)
|
|||||||
workerData[workerID]->externalFiles.push_back(file);
|
workerData[workerID]->externalFiles.push_back(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Globals::BuildAssetTexture(const fs::path& pngFilePath, TextureType texType, const fs::path& outPath)
|
||||||
|
{
|
||||||
|
std::string name = outPath.stem().string();
|
||||||
|
|
||||||
|
ZTexture tex(nullptr);
|
||||||
|
|
||||||
|
if (name.find("u32") != std::string::npos)
|
||||||
|
tex.dWordAligned = false;
|
||||||
|
|
||||||
|
tex.FromPNG(pngFilePath.string(), texType);
|
||||||
|
std::string cfgPath = StringHelper::Split(pngFilePath.string(), ".")[0] + ".cfg";
|
||||||
|
|
||||||
|
if (File::Exists(cfgPath))
|
||||||
|
name = File::ReadAllText(cfgPath);
|
||||||
|
|
||||||
|
std::string src = tex.GetBodySourceCode();
|
||||||
|
|
||||||
|
File::WriteAllBytes(outPath.string(), src.c_str(), src.size());
|
||||||
|
}
|
||||||
|
|
||||||
std::map<std::string, ExporterSet*>& Globals::GetExporterMap()
|
std::map<std::string, ExporterSet*>& Globals::GetExporterMap()
|
||||||
{
|
{
|
||||||
static std::map<std::string, ExporterSet*> exporters;
|
static std::map<std::string, ExporterSet*> exporters;
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ public:
|
|||||||
bool forceStatic = false;
|
bool forceStatic = false;
|
||||||
bool forceUnaccountedStatic = false;
|
bool forceUnaccountedStatic = false;
|
||||||
bool otrMode = true;
|
bool otrMode = true;
|
||||||
|
bool buildRawTexture = false;
|
||||||
|
|
||||||
ZRom* rom;
|
ZRom* rom;
|
||||||
std::vector<ZFile*> files;
|
std::vector<ZFile*> files;
|
||||||
@@ -85,6 +86,7 @@ public:
|
|||||||
std::map<int32_t, std::vector<ZFile*>> GetSegmentRefFiles(int workerID);
|
std::map<int32_t, std::vector<ZFile*>> GetSegmentRefFiles(int workerID);
|
||||||
void AddFile(ZFile* file, int workerID);
|
void AddFile(ZFile* file, int workerID);
|
||||||
void AddExternalFile(ZFile* file, int workerID);
|
void AddExternalFile(ZFile* file, int workerID);
|
||||||
|
void BuildAssetTexture(const fs::path& pngFilePath, TextureType texType, const fs::path& outPath);
|
||||||
|
|
||||||
ZResourceExporter* GetExporter(ZResourceType resType);
|
ZResourceExporter* GetExporter(ZResourceType resType);
|
||||||
ExporterSet* GetExporterSet();
|
ExporterSet* GetExporterSet();
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ void ImageBackend::ReadPng(const char* filename)
|
|||||||
|
|
||||||
void ImageBackend::ReadPng(const fs::path& filename)
|
void ImageBackend::ReadPng(const fs::path& filename)
|
||||||
{
|
{
|
||||||
ReadPng(filename.c_str());
|
ReadPng(filename.string().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImageBackend::WritePng(const char* filename)
|
void ImageBackend::WritePng(const char* filename)
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ extern "C" void Audio_SetGameVolume(int player_id, float volume)
|
|||||||
|
|
||||||
extern "C" int ResourceMgr_OTRSigCheck(char* imgData)
|
extern "C" int ResourceMgr_OTRSigCheck(char* imgData)
|
||||||
{
|
{
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebugConsole_SaveCVars()
|
void DebugConsole_SaveCVars()
|
||||||
@@ -256,6 +256,10 @@ int main(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
Globals::Instance->forceUnaccountedStatic = true;
|
Globals::Instance->forceUnaccountedStatic = true;
|
||||||
}
|
}
|
||||||
|
else if (arg == "-brt" || arg == "--build-raw-texture")
|
||||||
|
{
|
||||||
|
Globals::Instance->buildRawTexture = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse File Mode
|
// Parse File Mode
|
||||||
@@ -590,22 +594,7 @@ bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, const fs::path
|
|||||||
|
|
||||||
void BuildAssetTexture(const fs::path& pngFilePath, TextureType texType, const fs::path& outPath)
|
void BuildAssetTexture(const fs::path& pngFilePath, TextureType texType, const fs::path& outPath)
|
||||||
{
|
{
|
||||||
std::string name = outPath.stem().string();
|
return Globals::Instance->BuildAssetTexture(pngFilePath, texType, outPath);
|
||||||
|
|
||||||
ZTexture tex(nullptr);
|
|
||||||
|
|
||||||
if (name.find("u32") != std::string::npos)
|
|
||||||
tex.dWordAligned = false;
|
|
||||||
|
|
||||||
tex.FromPNG(pngFilePath.string(), texType);
|
|
||||||
std::string cfgPath = StringHelper::Split(pngFilePath.string(), ".")[0] + ".cfg";
|
|
||||||
|
|
||||||
if (File::Exists(cfgPath))
|
|
||||||
name = File::ReadAllText(cfgPath);
|
|
||||||
|
|
||||||
std::string src = tex.GetBodySourceCode();
|
|
||||||
|
|
||||||
File::WriteAllText(outPath.string(), src);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildAssetBackground(const fs::path& imageFilePath, const fs::path& outPath)
|
void BuildAssetBackground(const fs::path& imageFilePath, const fs::path& outPath)
|
||||||
|
|||||||
@@ -1,384 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\..\OTRExporter\packages\YY.NuGet.Import.Helper.1.0.0.4\build\native\YY.NuGet.Import.Helper.props" Condition="Exists('..\..\OTRExporter\packages\YY.NuGet.Import.Helper.1.0.0.4\build\native\YY.NuGet.Import.Helper.props')" />
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|x64">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|x64">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<VCProjectVersion>15.0</VCProjectVersion>
|
|
||||||
<ProjectGuid>{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}</ProjectGuid>
|
|
||||||
<RootNamespace>ZAPD</RootNamespace>
|
|
||||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
|
||||||
<ProjectName>ZAPD</ProjectName>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v142</PlatformToolset>
|
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v142</PlatformToolset>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v142</PlatformToolset>
|
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v142</PlatformToolset>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="ExtensionSettings">
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="Shared">
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<LibraryPath>$(OutDir);$(ProjectDir)..\lib\libgfxd;$(ProjectDir)..\..\OTRExporter\packages\libpng-v142.1.6.37.2\build\native\lib\x64\v142\Debug\;$(ProjectDir)..\..\libultraship\libultraship\;$(LibraryPath)</LibraryPath>
|
|
||||||
<IncludePath>$(ProjectDir)..\ZAPDUtils;$(ProjectDir)..\lib\tinyxml2;$(ProjectDir)..\lib\libgfxd;$(ProjectDir)..\lib\elfio;$(ProjectDir)..\lib\stb;$(ProjectDir);$(IncludePath)</IncludePath>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRules />
|
|
||||||
<CodeAnalysisRuleAssemblies />
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<IncludePath>$(ProjectDir)..\ZAPDUtils;$(ProjectDir)..\lib\tinyxml2;$(ProjectDir)..\lib\libgfxd;$(ProjectDir)..\lib\elfio;$(ProjectDir)..\lib\stb;$(ProjectDir);$(IncludePath)</IncludePath>
|
|
||||||
<LibraryPath>$(OutDir);$(ProjectDir)..\lib\libgfxd;$(ProjectDir)..\..\OTRExporter\packages\libpng-v142.1.6.37.2\build\native\lib\x64\v142\Debug\;$(ProjectDir)..\..\libultraship\libultraship\;$(LibraryPath)</LibraryPath>
|
|
||||||
<PreBuildEventUseInBuild>false</PreBuildEventUseInBuild>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRules />
|
|
||||||
<CodeAnalysisRuleAssemblies />
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<IncludePath>$(SolutionDir)ZAPD\lib\tinyxml2;$(SolutionDir)ZAPD\lib\libgfxd;$(SolutionDir)ZAPD\lib\elfio;$(SolutionDir)ZAPD\lib\stb;$(ProjectDir);$(IncludePath)</IncludePath>
|
|
||||||
<LibraryPath>$(SolutionDir)ZAPD\lib\libgfxd;$(SolutionDir)x64\Debug;$(SolutionDir)packages\libpng.1.6.28.1\build\native\lib\x64\v140\dynamic\Debug;$(LibraryPath)</LibraryPath>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRules />
|
|
||||||
<CodeAnalysisRuleAssemblies />
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRules />
|
|
||||||
<CodeAnalysisRuleAssemblies />
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<ConformanceMode>true</ConformanceMode>
|
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
|
||||||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
|
||||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<Profile>true</Profile>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<ConformanceMode>true</ConformanceMode>
|
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
|
||||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
|
||||||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
|
||||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<Profile>true</Profile>
|
|
||||||
<AdditionalDependencies>ZAPDUtils.lib;/WHOLEARCHIVE:OTRExporter.lib;libultraship.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
<PreBuildEvent>
|
|
||||||
<Command>
|
|
||||||
</Command>
|
|
||||||
</PreBuildEvent>
|
|
||||||
<PostBuildEvent>
|
|
||||||
<Command>
|
|
||||||
</Command>
|
|
||||||
</PostBuildEvent>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<Optimization>MaxSpeed</Optimization>
|
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<ConformanceMode>true</ConformanceMode>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<ConformanceMode>true</ConformanceMode>
|
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
|
||||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
|
||||||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
|
||||||
<AdditionalDependencies>ZAPDUtils.lib;/WHOLEARCHIVE:OTRExporter.lib;libultraship.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
<PreBuildEvent>
|
|
||||||
<Command>
|
|
||||||
</Command>
|
|
||||||
</PreBuildEvent>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="..\lib\libgfxd\gfxd.c" />
|
|
||||||
<ClCompile Include="..\lib\libgfxd\uc.c" />
|
|
||||||
<ClCompile Include="..\lib\libgfxd\uc_f3d.c" />
|
|
||||||
<ClCompile Include="..\lib\libgfxd\uc_f3db.c" />
|
|
||||||
<ClCompile Include="..\lib\libgfxd\uc_f3dex.c" />
|
|
||||||
<ClCompile Include="..\lib\libgfxd\uc_f3dex2.c" />
|
|
||||||
<ClCompile Include="..\lib\libgfxd\uc_f3dexb.c" />
|
|
||||||
<ClCompile Include="Declaration.cpp" />
|
|
||||||
<ClCompile Include="FileWorker.cpp" />
|
|
||||||
<ClCompile Include="GameConfig.cpp" />
|
|
||||||
<ClCompile Include="Globals.cpp" />
|
|
||||||
<ClCompile Include="ImageBackend.cpp" />
|
|
||||||
<ClCompile Include="Main.cpp" />
|
|
||||||
<ClCompile Include="OtherStructs\SkinLimbStructs.cpp" />
|
|
||||||
<ClCompile Include="OutputFormatter.cpp" />
|
|
||||||
<ClCompile Include="Overlays\ZOverlay.cpp" />
|
|
||||||
<ClCompile Include="WarningHandler.cpp" />
|
|
||||||
<ClCompile Include="yaz0\yaz0.cpp" />
|
|
||||||
<ClCompile Include="ZArray.cpp" />
|
|
||||||
<ClCompile Include="ZBackground.cpp" />
|
|
||||||
<ClCompile Include="ZCutsceneMM.cpp" />
|
|
||||||
<ClCompile Include="ZLimb.cpp" />
|
|
||||||
<ClCompile Include="ZMtx.cpp" />
|
|
||||||
<ClCompile Include="ZPath.cpp" />
|
|
||||||
<ClCompile Include="ZPlayerAnimationData.cpp" />
|
|
||||||
<ClCompile Include="ZRom.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetActorCutsceneList.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetAnimatedMaterialList.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetCsCamera.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetMinimapChests.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetMinimapList.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetWorldMapVisited.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\Unused1D.cpp" />
|
|
||||||
<ClCompile Include="ZScalar.cpp" />
|
|
||||||
<ClCompile Include="ZAnimation.cpp" />
|
|
||||||
<ClCompile Include="ZBlob.cpp" />
|
|
||||||
<ClCompile Include="ZCollision.cpp" />
|
|
||||||
<ClCompile Include="ZCutscene.cpp" />
|
|
||||||
<ClCompile Include="ZDisplayList.cpp" />
|
|
||||||
<ClCompile Include="ZFile.cpp" />
|
|
||||||
<ClCompile Include="ZSkeleton.cpp" />
|
|
||||||
<ClCompile Include="ZResource.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\EndMarker.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetActorList.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetAlternateHeaders.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetCameraSettings.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetCollisionHeader.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetCutscenes.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetEchoSettings.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetEntranceList.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetExitList.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetLightingSettings.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetLightList.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetMesh.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetObjectList.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetPathways.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetRoomBehavior.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetRoomList.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetSkyboxModifier.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetSkyboxSettings.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetSoundSettings.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetSpecialObjects.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetStartPositionList.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetTimeSettings.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetTransitionActorList.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetWind.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\Unused09.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\Commands\ZRoomCommandUnk.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\ZRoom.cpp" />
|
|
||||||
<ClCompile Include="ZRoom\ZRoomCommand.cpp" />
|
|
||||||
<ClCompile Include="ZString.cpp" />
|
|
||||||
<ClCompile Include="ZSymbol.cpp" />
|
|
||||||
<ClCompile Include="ZText.cpp" />
|
|
||||||
<ClCompile Include="ZTexture.cpp" />
|
|
||||||
<ClCompile Include="ZTextureAnimation.cpp" />
|
|
||||||
<ClCompile Include="ZVector.cpp" />
|
|
||||||
<ClCompile Include="ZVtx.cpp" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio.hpp" />
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_dump.hpp" />
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_dynamic.hpp" />
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_header.hpp" />
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_note.hpp" />
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_relocation.hpp" />
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_section.hpp" />
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_segment.hpp" />
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_strings.hpp" />
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_symbols.hpp" />
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_utils.hpp" />
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elf_types.hpp" />
|
|
||||||
<ClInclude Include="..\lib\libgfxd\gbi.h" />
|
|
||||||
<ClInclude Include="..\lib\libgfxd\gfxd.h" />
|
|
||||||
<ClInclude Include="..\lib\libgfxd\priv.h" />
|
|
||||||
<ClInclude Include="..\lib\stb\stb_image.h" />
|
|
||||||
<ClInclude Include="..\lib\stb\stb_image_write.h" />
|
|
||||||
<ClInclude Include="..\lib\stb\tinyxml2.h" />
|
|
||||||
<ClInclude Include="CRC32.h" />
|
|
||||||
<ClInclude Include="ctpl_stl.h" />
|
|
||||||
<ClInclude Include="Declaration.h" />
|
|
||||||
<ClInclude Include="FileWorker.h" />
|
|
||||||
<ClInclude Include="GameConfig.h" />
|
|
||||||
<ClInclude Include="Globals.h" />
|
|
||||||
<ClInclude Include="ImageBackend.h" />
|
|
||||||
<ClInclude Include="OtherStructs\SkinLimbStructs.h" />
|
|
||||||
<ClInclude Include="OutputFormatter.h" />
|
|
||||||
<ClInclude Include="Overlays\ZOverlay.h" />
|
|
||||||
<ClInclude Include="WarningHandler.h" />
|
|
||||||
<ClInclude Include="yaz0\readwrite.h" />
|
|
||||||
<ClInclude Include="yaz0\yaz0.h" />
|
|
||||||
<ClInclude Include="ZAnimation.h" />
|
|
||||||
<ClInclude Include="ZArray.h" />
|
|
||||||
<ClInclude Include="ZBackground.h" />
|
|
||||||
<ClInclude Include="ZBlob.h" />
|
|
||||||
<ClInclude Include="ZCollision.h" />
|
|
||||||
<ClInclude Include="ZCutscene.h" />
|
|
||||||
<ClInclude Include="ZCutsceneMM.h" />
|
|
||||||
<ClInclude Include="ZDisplayList.h" />
|
|
||||||
<ClInclude Include="ZFile.h" />
|
|
||||||
<ClInclude Include="ZLimb.h" />
|
|
||||||
<ClInclude Include="ZMtx.h" />
|
|
||||||
<ClInclude Include="ZPath.h" />
|
|
||||||
<ClInclude Include="ZPlayerAnimationData.h" />
|
|
||||||
<ClInclude Include="ZRom.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetActorCutsceneList.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetAnimatedMaterialList.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetCsCamera.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetMinimapChests.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetMinimapList.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetWorldMapVisited.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\Unused1D.h" />
|
|
||||||
<ClInclude Include="ZScalar.h" />
|
|
||||||
<ClInclude Include="ZSkeleton.h" />
|
|
||||||
<ClInclude Include="ZResource.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\EndMarker.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetActorList.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetAlternateHeaders.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetCameraSettings.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetCollisionHeader.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetCutscenes.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetEchoSettings.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetEntranceList.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetExitList.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetLightingSettings.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetLightList.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetMesh.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetObjectList.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetPathways.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetRoomBehavior.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetRoomList.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetSkyboxModifier.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetSkyboxSettings.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetSoundSettings.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetSpecialObjects.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetStartPositionList.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetTimeSettings.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetTransitionActorList.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetWind.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\Unused09.h" />
|
|
||||||
<ClInclude Include="ZRoom\Commands\ZRoomCommandUnk.h" />
|
|
||||||
<ClInclude Include="ZRoom\ZRoom.h" />
|
|
||||||
<ClInclude Include="ZRoom\ZRoomCommand.h" />
|
|
||||||
<ClInclude Include="ZString.h" />
|
|
||||||
<ClInclude Include="ZSymbol.h" />
|
|
||||||
<ClInclude Include="ZText.h" />
|
|
||||||
<ClInclude Include="ZTexture.h" />
|
|
||||||
<ClInclude Include="ZTextureAnimation.h" />
|
|
||||||
<ClInclude Include="ZVector.h" />
|
|
||||||
<ClInclude Include="ZVtx.h" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Text Include="..\SymbolMap_OoTMqDbg.txt">
|
|
||||||
<DeploymentContent>true</DeploymentContent>
|
|
||||||
</Text>
|
|
||||||
<Text Include="any\any\zlib.static.txt" />
|
|
||||||
<Text Include="NuGet\libpng.static.txt" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="packages.config" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\OTRGui\build\ZERO_CHECK.vcxproj">
|
|
||||||
<Project>{02d10590-9542-3f55-aaf8-6055677e2a2a}</Project>
|
|
||||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
<Import Project="..\..\OTRExporter\packages\zlib.v120.windesktop.msvcstl.dyn.rt-dyn.1.2.8.8\build\native\zlib.v120.windesktop.msvcstl.dyn.rt-dyn.targets" Condition="Exists('..\..\OTRExporter\packages\zlib.v120.windesktop.msvcstl.dyn.rt-dyn.1.2.8.8\build\native\zlib.v120.windesktop.msvcstl.dyn.rt-dyn.targets')" />
|
|
||||||
<Import Project="..\..\OTRExporter\packages\zlib.v140.windesktop.msvcstl.dyn.rt-dyn.1.2.8.8\build\native\zlib.v140.windesktop.msvcstl.dyn.rt-dyn.targets" Condition="Exists('..\..\OTRExporter\packages\zlib.v140.windesktop.msvcstl.dyn.rt-dyn.1.2.8.8\build\native\zlib.v140.windesktop.msvcstl.dyn.rt-dyn.targets')" />
|
|
||||||
<Import Project="..\..\OTRExporter\packages\YY.NuGet.Import.Helper.1.0.0.4\build\native\YY.NuGet.Import.Helper.targets" Condition="Exists('..\..\OTRExporter\packages\YY.NuGet.Import.Helper.1.0.0.4\build\native\YY.NuGet.Import.Helper.targets')" />
|
|
||||||
<Import Project="..\..\OTRExporter\packages\zlib.static.1.2.5\build\native\zlib.static.targets" Condition="Exists('..\..\OTRExporter\packages\zlib.static.1.2.5\build\native\zlib.static.targets')" />
|
|
||||||
<Import Project="..\..\OTRExporter\packages\libpng.static.1.6.37\build\native\libpng.static.targets" Condition="Exists('..\..\OTRExporter\packages\libpng.static.1.6.37\build\native\libpng.static.targets')" />
|
|
||||||
</ImportGroup>
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('..\..\OTRExporter\packages\zlib.v120.windesktop.msvcstl.dyn.rt-dyn.1.2.8.8\build\native\zlib.v120.windesktop.msvcstl.dyn.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\OTRExporter\packages\zlib.v120.windesktop.msvcstl.dyn.rt-dyn.1.2.8.8\build\native\zlib.v120.windesktop.msvcstl.dyn.rt-dyn.targets'))" />
|
|
||||||
<Error Condition="!Exists('..\..\OTRExporter\packages\zlib.v140.windesktop.msvcstl.dyn.rt-dyn.1.2.8.8\build\native\zlib.v140.windesktop.msvcstl.dyn.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\OTRExporter\packages\zlib.v140.windesktop.msvcstl.dyn.rt-dyn.1.2.8.8\build\native\zlib.v140.windesktop.msvcstl.dyn.rt-dyn.targets'))" />
|
|
||||||
<Error Condition="!Exists('..\..\OTRExporter\packages\YY.NuGet.Import.Helper.1.0.0.4\build\native\YY.NuGet.Import.Helper.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\OTRExporter\packages\YY.NuGet.Import.Helper.1.0.0.4\build\native\YY.NuGet.Import.Helper.props'))" />
|
|
||||||
<Error Condition="!Exists('..\..\OTRExporter\packages\YY.NuGet.Import.Helper.1.0.0.4\build\native\YY.NuGet.Import.Helper.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\OTRExporter\packages\YY.NuGet.Import.Helper.1.0.0.4\build\native\YY.NuGet.Import.Helper.targets'))" />
|
|
||||||
<Error Condition="!Exists('..\..\OTRExporter\packages\zlib.static.1.2.5\build\native\zlib.static.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\OTRExporter\packages\zlib.static.1.2.5\build\native\zlib.static.targets'))" />
|
|
||||||
<Error Condition="!Exists('..\..\OTRExporter\packages\libpng.static.1.6.37\build\native\libpng.static.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\OTRExporter\packages\libpng.static.1.6.37\build\native\libpng.static.targets'))" />
|
|
||||||
</Target>
|
|
||||||
</Project>
|
|
||||||
@@ -1,587 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup>
|
|
||||||
<Filter Include="Source Files">
|
|
||||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
|
||||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Header Files">
|
|
||||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
|
||||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Resource Files">
|
|
||||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
|
||||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Source Files\Libraries">
|
|
||||||
<UniqueIdentifier>{02148456-5068-4613-8478-f10addc58e70}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Header Files\Libraries">
|
|
||||||
<UniqueIdentifier>{bcab3136-95ba-4839-833c-43d78ad6e335}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Header Files\Libraries\elfio">
|
|
||||||
<UniqueIdentifier>{dc06ed84-f6fe-4277-80f3-d62bd5cdbb98}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Source Files\Z64">
|
|
||||||
<UniqueIdentifier>{6049c045-bc38-4221-b29e-ca6d4d8af4aa}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Source Files\Z64\ZRoom">
|
|
||||||
<UniqueIdentifier>{490e3a08-047b-48d3-ab53-3a860a3b92aa}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Source Files\Z64\ZRoom\Commands">
|
|
||||||
<UniqueIdentifier>{26c06845-8e8e-4b79-ad18-07c4f9c0f801}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Header Files\Z64">
|
|
||||||
<UniqueIdentifier>{d45c420d-2378-47ac-92c5-80db9475c195}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Header Files\Z64\ZRoom">
|
|
||||||
<UniqueIdentifier>{03cc56a2-e0e8-4167-80a0-98fb900a959a}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Header Files\Z64\ZRoom\Commands">
|
|
||||||
<UniqueIdentifier>{73db0879-6df8-4f6a-8cc2-a1f836e9e796}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Header Files\Libraries\fbx">
|
|
||||||
<UniqueIdentifier>{be9a5be0-ec6a-4200-8e39-bb58c7da7aa8}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Source Files\Libraries\libgfxd">
|
|
||||||
<UniqueIdentifier>{7ee79d97-c6a8-4e82-93ef-37981f4d7838}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Header Files\Libraries\libgfxd">
|
|
||||||
<UniqueIdentifier>{85600275-99fe-491d-8189-bcc3dc1a8903}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="any">
|
|
||||||
<UniqueIdentifier>{ba9990b0-1082-48bb-874c-6108534b5455}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="any\any">
|
|
||||||
<UniqueIdentifier>{ce9d91b0-ba20-4296-bc2d-8630965bb392}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="NuGet">
|
|
||||||
<UniqueIdentifier>{730beb67-6d59-4849-9d9b-702c4a565fc0}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Source Files\Yaz0">
|
|
||||||
<UniqueIdentifier>{b26457d2-cdb8-4c92-9ed7-a55bf6d3619e}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Header Files\Yaz0">
|
|
||||||
<UniqueIdentifier>{9651a041-1019-4486-9e90-1dccfa9471e9}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="Main.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\ZRoom.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetEchoSettings.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\ZRoomCommand.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetSoundSettings.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetWind.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetTimeSettings.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetSpecialObjects.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetRoomBehavior.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetSkyboxSettings.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetCameraSettings.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetSkyboxModifier.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetActorList.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetEntranceList.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetStartPositionList.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="Globals.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetAlternateHeaders.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetExitList.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\EndMarker.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetCollisionHeader.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetRoomList.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetObjectList.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetMesh.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\Unused09.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetLightingSettings.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetTransitionActorList.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetPathways.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetCutscenes.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZAnimation.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZBlob.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZCutscene.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZDisplayList.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZFile.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZResource.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZTexture.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="Overlays\ZOverlay.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZSkeleton.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetLightList.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\ZRoomCommandUnk.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZCollision.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZScalar.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZVector.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZArray.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZVtx.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZLimb.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="OutputFormatter.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZSymbol.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\lib\libgfxd\gfxd.c">
|
|
||||||
<Filter>Source Files\Libraries\libgfxd</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\lib\libgfxd\uc.c">
|
|
||||||
<Filter>Source Files\Libraries\libgfxd</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\lib\libgfxd\uc_f3d.c">
|
|
||||||
<Filter>Source Files\Libraries\libgfxd</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\lib\libgfxd\uc_f3db.c">
|
|
||||||
<Filter>Source Files\Libraries\libgfxd</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\lib\libgfxd\uc_f3dex.c">
|
|
||||||
<Filter>Source Files\Libraries\libgfxd</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\lib\libgfxd\uc_f3dex2.c">
|
|
||||||
<Filter>Source Files\Libraries\libgfxd</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\lib\libgfxd\uc_f3dexb.c">
|
|
||||||
<Filter>Source Files\Libraries\libgfxd</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZMtx.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetWorldMapVisited.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\Unused1D.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetActorCutsceneList.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetCsCamera.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetMinimapChests.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetMinimapList.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZCutsceneMM.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZBackground.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRoom\Commands\SetAnimatedMaterialList.cpp">
|
|
||||||
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZPath.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="Declaration.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ImageBackend.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZString.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="GameConfig.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZTextureAnimation.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="OtherStructs\SkinLimbStructs.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZPlayerAnimationData.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="WarningHandler.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZText.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ZRom.cpp">
|
|
||||||
<Filter>Source Files\Z64</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="yaz0\yaz0.cpp">
|
|
||||||
<Filter>Source Files\Yaz0</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="FileWorker.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="ZRoom\ZRoom.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\ZRoomCommand.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetEchoSettings.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetSoundSettings.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetWind.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetTimeSettings.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetSpecialObjects.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetRoomBehavior.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetSkyboxSettings.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetCameraSettings.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetSkyboxModifier.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetActorList.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetEntranceList.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetStartPositionList.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elf_types.hpp">
|
|
||||||
<Filter>Header Files\Libraries\elfio</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio.hpp">
|
|
||||||
<Filter>Header Files\Libraries\elfio</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_dump.hpp">
|
|
||||||
<Filter>Header Files\Libraries\elfio</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_dynamic.hpp">
|
|
||||||
<Filter>Header Files\Libraries\elfio</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_header.hpp">
|
|
||||||
<Filter>Header Files\Libraries\elfio</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_note.hpp">
|
|
||||||
<Filter>Header Files\Libraries\elfio</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_relocation.hpp">
|
|
||||||
<Filter>Header Files\Libraries\elfio</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_section.hpp">
|
|
||||||
<Filter>Header Files\Libraries\elfio</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_segment.hpp">
|
|
||||||
<Filter>Header Files\Libraries\elfio</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_strings.hpp">
|
|
||||||
<Filter>Header Files\Libraries\elfio</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_symbols.hpp">
|
|
||||||
<Filter>Header Files\Libraries\elfio</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\lib\elfio\elfio\elfio_utils.hpp">
|
|
||||||
<Filter>Header Files\Libraries\elfio</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="Globals.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetAlternateHeaders.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetExitList.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\EndMarker.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetCollisionHeader.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetRoomList.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetObjectList.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetMesh.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\Unused09.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetLightingSettings.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetTransitionActorList.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetPathways.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetCutscenes.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\lib\stb\stb_image.h">
|
|
||||||
<Filter>Header Files\Libraries</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\lib\stb\stb_image_write.h">
|
|
||||||
<Filter>Header Files\Libraries</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="Overlays\ZOverlay.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZTexture.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZAnimation.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZBlob.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZCutscene.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZDisplayList.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZFile.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZResource.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZSkeleton.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetLightList.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\ZRoomCommandUnk.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZCollision.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZScalar.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZVector.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\lib\stb\tinyxml2.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZArray.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZVtx.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="CRC32.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZLimb.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="OutputFormatter.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZSymbol.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\lib\libgfxd\gbi.h">
|
|
||||||
<Filter>Header Files\Libraries\libgfxd</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\lib\libgfxd\gfxd.h">
|
|
||||||
<Filter>Header Files\Libraries\libgfxd</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\lib\libgfxd\priv.h">
|
|
||||||
<Filter>Header Files\Libraries\libgfxd</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZMtx.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetWorldMapVisited.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetActorCutsceneList.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\Unused1D.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetCsCamera.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetMinimapChests.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetMinimapList.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZCutsceneMM.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZBackground.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRoom\Commands\SetAnimatedMaterialList.h">
|
|
||||||
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ImageBackend.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZPath.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="Declaration.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZString.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="GameConfig.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZTextureAnimation.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="OtherStructs\SkinLimbStructs.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZPlayerAnimationData.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="WarningHandler.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZText.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ZRom.h">
|
|
||||||
<Filter>Header Files\Z64</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="yaz0\readwrite.h">
|
|
||||||
<Filter>Header Files\Yaz0</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="yaz0\yaz0.h">
|
|
||||||
<Filter>Header Files\Yaz0</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="FileWorker.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ctpl_stl.h">
|
|
||||||
<Filter>Header Files\Libraries</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Text Include="..\SymbolMap_OoTMqDbg.txt">
|
|
||||||
<Filter>Resource Files</Filter>
|
|
||||||
</Text>
|
|
||||||
<Text Include="any\any\zlib.static.txt">
|
|
||||||
<Filter>any\any</Filter>
|
|
||||||
</Text>
|
|
||||||
<Text Include="NuGet\libpng.static.txt">
|
|
||||||
<Filter>NuGet</Filter>
|
|
||||||
</Text>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="packages.config" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -0,0 +1,415 @@
|
|||||||
|
#include "ZAudio.h"
|
||||||
|
|
||||||
|
#include "Globals.h"
|
||||||
|
#include "Utils/BitConverter.h"
|
||||||
|
#include "Utils/File.h"
|
||||||
|
#include "Utils/Path.h"
|
||||||
|
#include "Utils/StringHelper.h"
|
||||||
|
#include "ZFile.h"
|
||||||
|
|
||||||
|
REGISTER_ZFILENODE(Audio, ZAudio);
|
||||||
|
|
||||||
|
ZAudio::ZAudio(ZFile* nParent) : ZResource(nParent)
|
||||||
|
{
|
||||||
|
RegisterRequiredAttribute("SoundFontTableOffset");
|
||||||
|
RegisterRequiredAttribute("SequenceTableOffset");
|
||||||
|
RegisterRequiredAttribute("SampleBankTableOffset");
|
||||||
|
RegisterRequiredAttribute("SequenceFontTableOffset");
|
||||||
|
}
|
||||||
|
|
||||||
|
void ZAudio::ParseXML(tinyxml2::XMLElement* reader)
|
||||||
|
{
|
||||||
|
ZResource::ParseXML(reader);
|
||||||
|
|
||||||
|
auto t = reader->Name();
|
||||||
|
|
||||||
|
auto child = reader->FirstChildElement();
|
||||||
|
|
||||||
|
while (child != nullptr)
|
||||||
|
{
|
||||||
|
if (std::string(child->Value()) == "Sequences")
|
||||||
|
{
|
||||||
|
auto seqChild = child->FirstChildElement();
|
||||||
|
|
||||||
|
while (seqChild != nullptr)
|
||||||
|
{
|
||||||
|
if (std::string(seqChild->Value()) == "Sequence")
|
||||||
|
{
|
||||||
|
seqNames.push_back(seqChild->Attribute("Name"));
|
||||||
|
}
|
||||||
|
|
||||||
|
seqChild = seqChild->NextSiblingElement();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (std::string(child->Value()) == "Samples")
|
||||||
|
{
|
||||||
|
int bankId = child->IntAttribute("Bank", 0);
|
||||||
|
auto sampChild = child->FirstChildElement();
|
||||||
|
|
||||||
|
while (sampChild != nullptr)
|
||||||
|
{
|
||||||
|
if (std::string(sampChild->Value()) == "Sample")
|
||||||
|
{
|
||||||
|
auto atStr = sampChild->FirstChildElement()->Attribute("At");
|
||||||
|
auto loopStr = sampChild->FirstChildElement()->Attribute("LoopOffset");
|
||||||
|
uint32_t loopOffset = 0xFFFFFFFF;
|
||||||
|
uint32_t atOffset = StringHelper::StrToL(atStr, 16);
|
||||||
|
|
||||||
|
if (loopStr != NULL)
|
||||||
|
{
|
||||||
|
loopOffset = StringHelper::StrToL(loopStr, 16);
|
||||||
|
specialLoopSamples[loopOffset] = atOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
sampleOffsets[bankId][loopOffset][atOffset] = sampChild->Attribute("Name");
|
||||||
|
}
|
||||||
|
|
||||||
|
sampChild = sampChild->NextSiblingElement();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (std::string(child->Value()) == "Soundfont")
|
||||||
|
{
|
||||||
|
auto name = child->Attribute("Name");
|
||||||
|
auto index = child->IntAttribute("Index", 0);
|
||||||
|
soundFontNames[index] = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
child = child->NextSiblingElement();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ZAudio::DecodeADPCMSample(SampleEntry* sample)
|
||||||
|
{
|
||||||
|
int16_t buffer[1024 * 128];
|
||||||
|
|
||||||
|
int16_t* out = &buffer[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<AdsrEnvelope*> ZAudio::ParseEnvelopeData(std::vector<uint8_t> audioBank, std::vector<uint8_t> audioTable, int envelopeOffset, int baseOffset)
|
||||||
|
{
|
||||||
|
std::vector<AdsrEnvelope*> result;
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
AdsrEnvelope* env = new AdsrEnvelope();
|
||||||
|
|
||||||
|
env->delay = BitConverter::ToInt16BE(audioBank, envelopeOffset + 0);
|
||||||
|
env->arg = BitConverter::ToInt16BE(audioBank, envelopeOffset + 2);
|
||||||
|
|
||||||
|
envelopeOffset += 4;
|
||||||
|
|
||||||
|
result.push_back(env);
|
||||||
|
|
||||||
|
if (env->delay < 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
SoundFontEntry* ZAudio::ParseSoundFontEntry(std::vector<uint8_t> audioBank,
|
||||||
|
std::vector<uint8_t> audioTable,
|
||||||
|
AudioTableEntry audioSampleBankEntry, int bankIndex,
|
||||||
|
int soundFontOffset,
|
||||||
|
int baseOffset)
|
||||||
|
{
|
||||||
|
SoundFontEntry* soundFont = new SoundFontEntry();
|
||||||
|
soundFont->sampleEntry = ParseSampleEntry(
|
||||||
|
audioBank, audioTable, audioSampleBankEntry, bankIndex,
|
||||||
|
BitConverter::ToInt32BE(audioBank, soundFontOffset + 0) + baseOffset, baseOffset);
|
||||||
|
soundFont->tuning = BitConverter::ToFloatBE(audioBank, soundFontOffset + 4);
|
||||||
|
|
||||||
|
return soundFont;
|
||||||
|
}
|
||||||
|
|
||||||
|
SampleEntry* ZAudio::ParseSampleEntry(std::vector<uint8_t> audioBank,
|
||||||
|
std::vector<uint8_t> audioTable,
|
||||||
|
AudioTableEntry audioSampleBankEntry, int bankIndex,
|
||||||
|
int sampleOffset,
|
||||||
|
int baseOffset)
|
||||||
|
{
|
||||||
|
int sampleDataOffset = BitConverter::ToInt32BE(audioBank, sampleOffset + 4) + audioSampleBankEntry.ptr;
|
||||||
|
|
||||||
|
if (samples.find(sampleOffset) == samples.end())
|
||||||
|
{
|
||||||
|
SampleEntry* sample = new SampleEntry();
|
||||||
|
|
||||||
|
sample->bankId = bankIndex;
|
||||||
|
|
||||||
|
int sampleSize = BitConverter::ToInt32BE(audioBank, sampleOffset + 0) & 0x00FFFFFF;
|
||||||
|
int loopOffset = BitConverter::ToInt32BE(audioBank, sampleOffset + 8) + baseOffset;
|
||||||
|
int bookOffset = BitConverter::ToInt32BE(audioBank, sampleOffset + 12) + baseOffset;
|
||||||
|
|
||||||
|
char* sampleData = (char*)malloc(sampleSize);
|
||||||
|
memcpy(sampleData, audioTable.data() + sampleDataOffset, sampleSize);
|
||||||
|
sample->data = std::vector<uint8_t>(sampleSize);
|
||||||
|
memcpy(sample->data.data(), sampleData, sampleSize);
|
||||||
|
|
||||||
|
uint32_t origField = (BitConverter::ToUInt32BE(audioBank, sampleOffset + 0));
|
||||||
|
sample->codec = (origField >> 28) & 0x0F;
|
||||||
|
sample->medium = (origField >> 24) & 0x03;
|
||||||
|
sample->unk_bit26 = (origField >> 22) & 0x01;
|
||||||
|
sample->unk_bit25 = (origField >> 21) & 0x01;
|
||||||
|
|
||||||
|
sample->loop.start = BitConverter::ToInt32BE(audioBank, loopOffset + 0);
|
||||||
|
sample->loop.end = BitConverter::ToInt32BE(audioBank, loopOffset + 4);
|
||||||
|
sample->loop.count = BitConverter::ToInt32BE(audioBank, loopOffset + 8);
|
||||||
|
|
||||||
|
if (sample->loop.count != 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 16; i++)
|
||||||
|
{
|
||||||
|
int16_t state = BitConverter::ToInt16BE(audioBank, loopOffset + 16 + (i * 2));
|
||||||
|
sample->loop.states.push_back(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sample->book.order = BitConverter::ToInt32BE(audioBank, bookOffset + 0);
|
||||||
|
sample->book.npredictors = BitConverter::ToInt32BE(audioBank, bookOffset + 4);
|
||||||
|
|
||||||
|
for (int i = 0; i < sample->book.npredictors * sample->book.order * 8; i++)
|
||||||
|
{
|
||||||
|
sample->book.books.push_back(
|
||||||
|
BitConverter::ToInt16BE(audioBank, bookOffset + 8 + (i * 2)));
|
||||||
|
}
|
||||||
|
|
||||||
|
sample->sampleDataOffset = sampleDataOffset;
|
||||||
|
|
||||||
|
if (specialLoopSamples.find(loopOffset) != specialLoopSamples.end())
|
||||||
|
sample->sampleLoopOffset = loopOffset;
|
||||||
|
|
||||||
|
sample->fileName = StringHelper::Sprintf("audio/samples/sample_%08X", sampleOffset);
|
||||||
|
|
||||||
|
samples[sampleOffset] = sample;
|
||||||
|
|
||||||
|
return sample;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return samples[sampleOffset];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<AudioTableEntry> ZAudio::ParseAudioTable(std::vector<uint8_t> codeData, int baseOffset)
|
||||||
|
{
|
||||||
|
std::vector<AudioTableEntry> entries;
|
||||||
|
|
||||||
|
int numEntries = BitConverter::ToInt16BE(codeData, baseOffset + 0);
|
||||||
|
int romAddr = BitConverter::ToInt16BE(codeData, baseOffset + 4);
|
||||||
|
|
||||||
|
int currentOffset = baseOffset + 16;
|
||||||
|
|
||||||
|
for (int i = 0; i < numEntries; i++)
|
||||||
|
{
|
||||||
|
AudioTableEntry entry;
|
||||||
|
|
||||||
|
entry.ptr = BitConverter::ToInt32BE(codeData, currentOffset + 0);
|
||||||
|
entry.size = BitConverter::ToInt32BE(codeData, currentOffset + 4);
|
||||||
|
entry.medium = codeData[currentOffset + 8];
|
||||||
|
entry.cachePolicy = codeData[currentOffset + 9];
|
||||||
|
entry.data1 = BitConverter::ToInt16BE(codeData, currentOffset + 10);
|
||||||
|
entry.data2 = BitConverter::ToInt16BE(codeData, currentOffset + 12);
|
||||||
|
entry.data3 = BitConverter::ToInt16BE(codeData, currentOffset + 14);
|
||||||
|
|
||||||
|
entries.push_back(entry);
|
||||||
|
|
||||||
|
currentOffset += 16;
|
||||||
|
}
|
||||||
|
|
||||||
|
return entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ZAudio::ParseSoundFont(std::vector<uint8_t> codeData, std::vector<uint8_t> audioTable,
|
||||||
|
std::vector<AudioTableEntry> audioSampleBank,
|
||||||
|
AudioTableEntry& entry)
|
||||||
|
{
|
||||||
|
int ptr = entry.ptr;
|
||||||
|
int size = entry.size;
|
||||||
|
int sampleBankId1 = (entry.data1 >> 8) & 0xFF;
|
||||||
|
int sampleBankId2 = (entry.data1) & 0xFF;
|
||||||
|
int numInstruments = (entry.data2 >> 8) & 0xFF;
|
||||||
|
int numDrums = entry.data2 & 0xFF;
|
||||||
|
int numSfx = entry.data3;
|
||||||
|
|
||||||
|
int currentOffset = BitConverter::ToInt32BE(codeData, ptr) + ptr;
|
||||||
|
for (int i = 0; i < numDrums; i++)
|
||||||
|
{
|
||||||
|
DrumEntry drum;
|
||||||
|
|
||||||
|
int samplePtr = BitConverter::ToInt32BE(codeData, currentOffset);
|
||||||
|
|
||||||
|
if (samplePtr != 0)
|
||||||
|
{
|
||||||
|
samplePtr += ptr;
|
||||||
|
|
||||||
|
drum.sample = ParseSampleEntry(codeData, audioTable, audioSampleBank[sampleBankId1], sampleBankId1,
|
||||||
|
BitConverter::ToInt32BE(codeData, samplePtr + 4) + ptr, ptr);
|
||||||
|
|
||||||
|
drum.releaseRate = codeData[samplePtr + 0];
|
||||||
|
drum.pan = codeData[samplePtr + 1];
|
||||||
|
drum.loaded = codeData[samplePtr + 2];
|
||||||
|
drum.tuning = BitConverter::ToFloatBE(codeData, samplePtr + 8);
|
||||||
|
drum.env = ParseEnvelopeData(codeData, audioTable, BitConverter::ToInt32BE(codeData, samplePtr + 12) + ptr, ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
entry.drums.push_back(drum);
|
||||||
|
|
||||||
|
currentOffset += 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
currentOffset = BitConverter::ToInt32BE(codeData, ptr + 4) + ptr;
|
||||||
|
for (int i = 0; i < numSfx; i++)
|
||||||
|
{
|
||||||
|
SoundFontEntry* sfx;
|
||||||
|
sfx = ParseSoundFontEntry(codeData, audioTable, audioSampleBank[sampleBankId1], sampleBankId1,
|
||||||
|
currentOffset, ptr);
|
||||||
|
entry.soundEffects.push_back(sfx);
|
||||||
|
|
||||||
|
currentOffset += 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < numInstruments; i++)
|
||||||
|
{
|
||||||
|
InstrumentEntry instrument;
|
||||||
|
|
||||||
|
currentOffset = BitConverter::ToInt32BE(codeData, ptr + 8 + (i * 4));
|
||||||
|
|
||||||
|
instrument.isValidInstrument = currentOffset != 0;
|
||||||
|
|
||||||
|
if (currentOffset != 0)
|
||||||
|
{
|
||||||
|
currentOffset += ptr;
|
||||||
|
|
||||||
|
instrument.loaded = codeData[currentOffset + 0];
|
||||||
|
instrument.normalRangeLo = codeData[currentOffset + 1];
|
||||||
|
instrument.normalRangeHi = codeData[currentOffset + 2];
|
||||||
|
instrument.releaseRate = codeData[currentOffset + 3];
|
||||||
|
instrument.env = ParseEnvelopeData(codeData, audioTable, BitConverter::ToInt32BE(codeData, currentOffset + 4) + ptr, ptr);
|
||||||
|
|
||||||
|
if (BitConverter::ToInt32BE(codeData, currentOffset + 8) != 0)
|
||||||
|
instrument.lowNotesSound = ParseSoundFontEntry(
|
||||||
|
codeData, audioTable, audioSampleBank[sampleBankId1], sampleBankId1, currentOffset + 8, ptr);
|
||||||
|
|
||||||
|
if (BitConverter::ToInt32BE(codeData, currentOffset + 16) != 0)
|
||||||
|
instrument.normalNotesSound = ParseSoundFontEntry(
|
||||||
|
codeData, audioTable, audioSampleBank[sampleBankId1], sampleBankId1, currentOffset + 16, ptr);
|
||||||
|
|
||||||
|
if (BitConverter::ToInt32BE(codeData, currentOffset + 24) != 0 &&
|
||||||
|
instrument.normalRangeHi != 0x7F)
|
||||||
|
instrument.highNotesSound = ParseSoundFontEntry(
|
||||||
|
codeData, audioTable, audioSampleBank[sampleBankId1], sampleBankId1, currentOffset + 24, ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
entry.instruments.push_back(instrument);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ZAudio::ParseRawData()
|
||||||
|
{
|
||||||
|
ZResource::ParseRawData();
|
||||||
|
|
||||||
|
std::vector<uint8_t> codeData;
|
||||||
|
std::vector<uint8_t> audioTableData;
|
||||||
|
std::vector<uint8_t> audioBankData;
|
||||||
|
std::vector<uint8_t> audioSeqData;
|
||||||
|
|
||||||
|
if (Globals::Instance->fileMode == ZFileMode::ExtractDirectory)
|
||||||
|
codeData = Globals::Instance->GetBaseromFile("code");
|
||||||
|
else
|
||||||
|
codeData = Globals::Instance->GetBaseromFile(Globals::Instance->baseRomPath.string() + "code");
|
||||||
|
|
||||||
|
if (Globals::Instance->fileMode == ZFileMode::ExtractDirectory)
|
||||||
|
audioTableData = Globals::Instance->GetBaseromFile("Audiotable");
|
||||||
|
else
|
||||||
|
audioTableData = Globals::Instance->GetBaseromFile(Globals::Instance->baseRomPath.string() + "Audiotable");
|
||||||
|
|
||||||
|
if (Globals::Instance->fileMode == ZFileMode::ExtractDirectory)
|
||||||
|
audioBankData = Globals::Instance->GetBaseromFile("Audiobank");
|
||||||
|
else
|
||||||
|
audioBankData = Globals::Instance->GetBaseromFile(Globals::Instance->baseRomPath.string() + "Audiobank");
|
||||||
|
|
||||||
|
|
||||||
|
if (Globals::Instance->fileMode == ZFileMode::ExtractDirectory)
|
||||||
|
audioSeqData = Globals::Instance->GetBaseromFile("Audioseq");
|
||||||
|
else
|
||||||
|
audioSeqData = Globals::Instance->GetBaseromFile(Globals::Instance->baseRomPath.string() +
|
||||||
|
"Audioseq");
|
||||||
|
|
||||||
|
// TABLE PARSING
|
||||||
|
|
||||||
|
// MQ DBG ROM
|
||||||
|
//int gSoundFontTableOffset = 0x138270;
|
||||||
|
//int gSequenceTableOffset = 0x1386A0;
|
||||||
|
//int gSampleBankTableOffset = 0x138D90;
|
||||||
|
//int gSequenceFontTableOffset = 0x1384E0;
|
||||||
|
|
||||||
|
// NTSC 1.0
|
||||||
|
//int gSoundFontTableOffset = 0x1026A0;
|
||||||
|
//int gSequenceTableOffset = 0x102AD0;
|
||||||
|
//int gSampleBankTableOffset = 0x1031C0;
|
||||||
|
//int gSequenceFontTableOffset = 0x102910;
|
||||||
|
|
||||||
|
int gSoundFontTableOffset = StringHelper::StrToL(registeredAttributes.at("SoundFontTableOffset").value, 16);
|
||||||
|
int gSequenceTableOffset = StringHelper::StrToL(registeredAttributes.at("SequenceTableOffset").value, 16);
|
||||||
|
int gSampleBankTableOffset = StringHelper::StrToL(registeredAttributes.at("SampleBankTableOffset").value, 16);
|
||||||
|
int gSequenceFontTableOffset = StringHelper::StrToL(registeredAttributes.at("SequenceFontTableOffset").value, 16);
|
||||||
|
|
||||||
|
soundFontTable = ParseAudioTable(codeData, gSoundFontTableOffset);
|
||||||
|
sequenceTable = ParseAudioTable(codeData, gSequenceTableOffset);
|
||||||
|
sampleBankTable = ParseAudioTable(codeData, gSampleBankTableOffset);
|
||||||
|
|
||||||
|
// SEQEUNCE FONT TABLE PARSING
|
||||||
|
for (int i = 0; i < sequenceTable.size(); i++)
|
||||||
|
{
|
||||||
|
uint16_t idx = BitConverter::ToUInt16BE(codeData, gSequenceFontTableOffset + (i * 2));
|
||||||
|
uint8_t numFonts = codeData[gSequenceFontTableOffset + (idx++)];
|
||||||
|
std::vector<uint32_t> fontIds;
|
||||||
|
|
||||||
|
for (int j = 0; j < numFonts; j++)
|
||||||
|
{
|
||||||
|
uint8_t fontId = codeData[gSequenceFontTableOffset + (idx++)];
|
||||||
|
fontIds.push_back(fontId);
|
||||||
|
}
|
||||||
|
|
||||||
|
fontIndices.push_back(fontIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// SAMPLE/FONT PARSING
|
||||||
|
for (int i = 0; i < soundFontTable.size(); i++)
|
||||||
|
{
|
||||||
|
ParseSoundFont(audioBankData, audioTableData, sampleBankTable, soundFontTable[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// SEQUENCE PARSING
|
||||||
|
for (int i = 0; i < sequenceTable.size(); i++)
|
||||||
|
{
|
||||||
|
int seqDestIdx = i;
|
||||||
|
|
||||||
|
if (sequenceTable[i].size == 0)
|
||||||
|
seqDestIdx = sequenceTable[i].ptr;
|
||||||
|
|
||||||
|
std::vector<char> seqVec = std::vector<char>(sequenceTable[seqDestIdx].size);
|
||||||
|
memcpy(seqVec.data(), audioSeqData.data() + sequenceTable[seqDestIdx].ptr,
|
||||||
|
sequenceTable[seqDestIdx].size);
|
||||||
|
|
||||||
|
sequences.push_back(seqVec);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string ZAudio::GetSourceTypeName() const
|
||||||
|
{
|
||||||
|
return "u8";
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t ZAudio::GetRawDataSize() const
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
ZResourceType ZAudio::GetResourceType() const
|
||||||
|
{
|
||||||
|
return ZResourceType::Audio;
|
||||||
|
}
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "ZResource.h"
|
||||||
|
#include "tinyxml2.h"
|
||||||
|
|
||||||
|
struct AdsrEnvelope
|
||||||
|
{
|
||||||
|
int16_t delay;
|
||||||
|
int16_t arg;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct AdpcmBook
|
||||||
|
{
|
||||||
|
/* 0x00 */ int32_t order;
|
||||||
|
/* 0x04 */ int32_t npredictors;
|
||||||
|
/* 0x08 */ std::vector<int16_t> books; // size 8 * order * npredictors. 8-byte aligned
|
||||||
|
};
|
||||||
|
|
||||||
|
struct AdpcmLoop
|
||||||
|
{
|
||||||
|
/* 0x00 */ uint32_t start;
|
||||||
|
/* 0x04 */ uint32_t end;
|
||||||
|
/* 0x08 */ uint32_t count;
|
||||||
|
/* 0x10 */ std::vector<int16_t> states;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SampleEntry
|
||||||
|
{
|
||||||
|
std::string fileName;
|
||||||
|
uint8_t bankId;
|
||||||
|
uint32_t sampleDataOffset;
|
||||||
|
uint32_t sampleLoopOffset = 0xFFFFFFFF;
|
||||||
|
uint8_t codec;
|
||||||
|
uint8_t medium;
|
||||||
|
uint8_t unk_bit26;
|
||||||
|
uint8_t unk_bit25;
|
||||||
|
|
||||||
|
std::vector<uint8_t> data;
|
||||||
|
AdpcmLoop loop;
|
||||||
|
AdpcmBook book;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SoundFontEntry
|
||||||
|
{
|
||||||
|
SampleEntry* sampleEntry = nullptr;
|
||||||
|
float tuning;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct DrumEntry
|
||||||
|
{
|
||||||
|
uint8_t releaseRate;
|
||||||
|
uint8_t pan;
|
||||||
|
uint8_t loaded;
|
||||||
|
uint32_t offset;
|
||||||
|
float tuning;
|
||||||
|
std::vector<AdsrEnvelope*> env;
|
||||||
|
SampleEntry* sample = nullptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct InstrumentEntry
|
||||||
|
{
|
||||||
|
bool isValidInstrument;
|
||||||
|
uint8_t loaded;
|
||||||
|
uint8_t normalRangeLo;
|
||||||
|
uint8_t normalRangeHi;
|
||||||
|
uint8_t releaseRate;
|
||||||
|
std::vector<AdsrEnvelope*> env;
|
||||||
|
SoundFontEntry* lowNotesSound = nullptr;
|
||||||
|
SoundFontEntry* normalNotesSound = nullptr;
|
||||||
|
SoundFontEntry* highNotesSound = nullptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct AudioTableEntry
|
||||||
|
{
|
||||||
|
uint32_t ptr;
|
||||||
|
uint32_t size;
|
||||||
|
uint8_t medium;
|
||||||
|
uint8_t cachePolicy;
|
||||||
|
uint16_t data1;
|
||||||
|
uint16_t data2;
|
||||||
|
uint16_t data3;
|
||||||
|
|
||||||
|
std::vector<DrumEntry> drums;
|
||||||
|
std::vector<SoundFontEntry*> soundEffects;
|
||||||
|
std::vector<InstrumentEntry> instruments;
|
||||||
|
};
|
||||||
|
|
||||||
|
class ZAudio : public ZResource
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
std::vector<AudioTableEntry> soundFontTable;
|
||||||
|
std::vector<AudioTableEntry> sequenceTable;
|
||||||
|
std::vector<AudioTableEntry> sampleBankTable;
|
||||||
|
std::vector<std::vector<char>> sequences;
|
||||||
|
std::map<uint32_t, SampleEntry*> samples;
|
||||||
|
std::vector<std::vector<uint32_t>> fontIndices;
|
||||||
|
std::vector<std::string> seqNames;
|
||||||
|
std::map<uint32_t, std::string> soundFontNames;
|
||||||
|
|
||||||
|
// First Key = Bank ID, Sec Key = LoopDataOffset, Third Key = Sample Data Offset
|
||||||
|
std::map<uint32_t, std::map<uint32_t, std::map<uint32_t, std::string>>> sampleOffsets;
|
||||||
|
|
||||||
|
// Key = Loop Offset, Value = Sample Offset
|
||||||
|
std::map<uint32_t, uint32_t> specialLoopSamples;
|
||||||
|
|
||||||
|
ZAudio(ZFile* nParent);
|
||||||
|
|
||||||
|
void ParseXML(tinyxml2::XMLElement* reader) override;
|
||||||
|
|
||||||
|
void DecodeADPCMSample(SampleEntry* sample);
|
||||||
|
std::vector<AdsrEnvelope*> ParseEnvelopeData(std::vector<uint8_t> audioBank, std::vector<uint8_t> audioTable,
|
||||||
|
int envelopeOffset, int baseOffset);
|
||||||
|
|
||||||
|
SoundFontEntry* ParseSoundFontEntry(std::vector<uint8_t> audioBank,
|
||||||
|
std::vector<uint8_t> audioTable,
|
||||||
|
AudioTableEntry audioSampleBankEntry, int bankIndex,
|
||||||
|
int soundFontOffset,
|
||||||
|
int baseOffset);
|
||||||
|
|
||||||
|
SampleEntry* ParseSampleEntry(std::vector<uint8_t> audioBank, std::vector<uint8_t> audioTable,
|
||||||
|
AudioTableEntry audioSampleBankEntry, int bankIndex,
|
||||||
|
int sampleOffset, int baseOffset);
|
||||||
|
|
||||||
|
std::vector<AudioTableEntry> ParseAudioTable(std::vector<uint8_t> codeData, int baseOffset);
|
||||||
|
void ParseSoundFont(std::vector<uint8_t> codeData, std::vector<uint8_t> audioTable,
|
||||||
|
std::vector<AudioTableEntry> audioSampleBank, AudioTableEntry& entry);
|
||||||
|
|
||||||
|
void ParseRawData() override;
|
||||||
|
|
||||||
|
std::string GetSourceTypeName() const override;
|
||||||
|
ZResourceType GetResourceType() const override;
|
||||||
|
|
||||||
|
size_t GetRawDataSize() const override;
|
||||||
|
};
|
||||||
@@ -0,0 +1,669 @@
|
|||||||
|
/**
|
||||||
|
* Bruteforcing decoder for converting ADPCM-encoded AIFC into AIFF, in a way
|
||||||
|
* that roundtrips with vadpcm_enc.
|
||||||
|
*/
|
||||||
|
#include <assert.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
//#include <unistd.h>
|
||||||
|
|
||||||
|
typedef signed char s8;
|
||||||
|
typedef short s16;
|
||||||
|
typedef int s32;
|
||||||
|
typedef long long s64;
|
||||||
|
typedef unsigned char u8;
|
||||||
|
typedef unsigned short u16;
|
||||||
|
typedef unsigned int u32;
|
||||||
|
typedef unsigned long long u64;
|
||||||
|
typedef float f32;
|
||||||
|
typedef double f64;
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define __builtin_bswap16 _byteswap_ushort
|
||||||
|
#define __builtin_bswap32 _byteswap_ulong
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define bswap16(x) __builtin_bswap16(x)
|
||||||
|
#define bswap32(x) __builtin_bswap32(x)
|
||||||
|
#define BSWAP16(x) x = __builtin_bswap16(x)
|
||||||
|
#define BSWAP32(x) x = __builtin_bswap32(x)
|
||||||
|
#define BSWAP16_MANY(x, n) \
|
||||||
|
for (s32 _i = 0; _i < n; _i++) \
|
||||||
|
BSWAP16((x)[_i])
|
||||||
|
|
||||||
|
#define NORETURN __attribute__((noreturn))
|
||||||
|
#define UNUSED __attribute__((unused))
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
u32 ckID;
|
||||||
|
u32 ckSize;
|
||||||
|
} ChunkHeader;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
u32 ckID;
|
||||||
|
u32 ckSize;
|
||||||
|
u32 formType;
|
||||||
|
} Chunk;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
s16 numChannels;
|
||||||
|
u16 numFramesH;
|
||||||
|
u16 numFramesL;
|
||||||
|
s16 sampleSize;
|
||||||
|
s16 sampleRate[5]; // 80-bit float
|
||||||
|
u16 compressionTypeH;
|
||||||
|
u16 compressionTypeL;
|
||||||
|
} CommonChunk;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
s16 MarkerID;
|
||||||
|
u16 positionH;
|
||||||
|
u16 positionL;
|
||||||
|
} Marker;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
s16 playMode;
|
||||||
|
s16 beginLoop;
|
||||||
|
s16 endLoop;
|
||||||
|
} Loop;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
s8 baseNote;
|
||||||
|
s8 detune;
|
||||||
|
s8 lowNote;
|
||||||
|
s8 highNote;
|
||||||
|
s8 lowVelocity;
|
||||||
|
s8 highVelocity;
|
||||||
|
s16 gain;
|
||||||
|
Loop sustainLoop;
|
||||||
|
Loop releaseLoop;
|
||||||
|
} InstrumentChunk;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
s32 offset;
|
||||||
|
s32 blockSize;
|
||||||
|
} SoundDataChunk;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
s16 version;
|
||||||
|
s16 order;
|
||||||
|
s16 nEntries;
|
||||||
|
} CodeChunk;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
u32 start;
|
||||||
|
u32 end;
|
||||||
|
u32 count;
|
||||||
|
s16 state[16];
|
||||||
|
} ALADPCMloop;
|
||||||
|
|
||||||
|
static char usage[] = "input.aifc output.aiff";
|
||||||
|
static const char *progname, *infilename;
|
||||||
|
static int framesize = 9;
|
||||||
|
|
||||||
|
void fail_parse(const char* fmt, ...)
|
||||||
|
{
|
||||||
|
char* formatted = NULL;
|
||||||
|
va_list ap;
|
||||||
|
va_start(ap, fmt);
|
||||||
|
int size = vsnprintf(NULL, 0, fmt, ap);
|
||||||
|
va_end(ap);
|
||||||
|
if (size >= 0)
|
||||||
|
{
|
||||||
|
size++;
|
||||||
|
formatted = (char*)malloc(size);
|
||||||
|
if (formatted != NULL)
|
||||||
|
{
|
||||||
|
va_start(ap, fmt);
|
||||||
|
size = vsnprintf(formatted, size, fmt, ap);
|
||||||
|
va_end(ap);
|
||||||
|
if (size < 0)
|
||||||
|
{
|
||||||
|
free(formatted);
|
||||||
|
formatted = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (formatted != NULL)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s: %s [%s]\n", progname, formatted, infilename);
|
||||||
|
free(formatted);
|
||||||
|
}
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
s32 myrand()
|
||||||
|
{
|
||||||
|
static u64 state = 1619236481962341ULL;
|
||||||
|
state *= 3123692312237ULL;
|
||||||
|
state += 1;
|
||||||
|
return state >> 33;
|
||||||
|
}
|
||||||
|
|
||||||
|
s16 qsample(f32 x, s32 scale)
|
||||||
|
{
|
||||||
|
if (x > 0.0f)
|
||||||
|
{
|
||||||
|
return (s16)((x / scale) + 0.4999999);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return (s16)((x / scale) - 0.4999999);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void clamp_to_s16(f32* in, s32* out)
|
||||||
|
{
|
||||||
|
f32 llevel = -0x8000;
|
||||||
|
f32 ulevel = 0x7fff;
|
||||||
|
|
||||||
|
for (s32 i = 0; i < 16; i++)
|
||||||
|
{
|
||||||
|
if (in[i] > ulevel)
|
||||||
|
in[i] = ulevel;
|
||||||
|
if (in[i] < llevel)
|
||||||
|
in[i] = llevel;
|
||||||
|
|
||||||
|
if (in[i] > 0.0f)
|
||||||
|
{
|
||||||
|
out[i] = (s32)(in[i] + 0.5);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out[i] = (s32)(in[i] - 0.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
s16 clamp_bits(s32 x, s32 bits)
|
||||||
|
{
|
||||||
|
s32 lim = 1 << (bits - 1);
|
||||||
|
if (x < -lim)
|
||||||
|
return -lim;
|
||||||
|
if (x > lim - 1)
|
||||||
|
return lim - 1;
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
s32 readaifccodebook(FILE* fhandle, s32**** table, s16* order, s16* npredictors)
|
||||||
|
{
|
||||||
|
BSWAP16(*order);
|
||||||
|
BSWAP16(*npredictors);
|
||||||
|
*table = (s32***)malloc(*npredictors * sizeof(s32**));
|
||||||
|
for (s32 i = 0; i < *npredictors; i++)
|
||||||
|
{
|
||||||
|
(*table)[i] = (s32**)malloc(8 * sizeof(s32*));
|
||||||
|
for (s32 j = 0; j < 8; j++)
|
||||||
|
{
|
||||||
|
(*table)[i][j] = (s32*)malloc((*order + 8) * sizeof(s32));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (s32 i = 0; i < *npredictors; i++)
|
||||||
|
{
|
||||||
|
s32** table_entry = (*table)[i];
|
||||||
|
for (s32 j = 0; j < *order; j++)
|
||||||
|
{
|
||||||
|
for (s32 k = 0; k < 8; k++)
|
||||||
|
{
|
||||||
|
s16 ts = 0;
|
||||||
|
BSWAP16(ts);
|
||||||
|
table_entry[k][j] = ts;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (s32 k = 1; k < 8; k++)
|
||||||
|
{
|
||||||
|
table_entry[k][*order] = table_entry[k - 1][*order - 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
table_entry[0][*order] = 1 << 11;
|
||||||
|
|
||||||
|
for (s32 k = 1; k < 8; k++)
|
||||||
|
{
|
||||||
|
s32 j = 0;
|
||||||
|
for (; j < k; j++)
|
||||||
|
{
|
||||||
|
table_entry[j][k + *order] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (; j < 8; j++)
|
||||||
|
{
|
||||||
|
table_entry[j][k + *order] = table_entry[j - k][*order];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ALADPCMloop* readlooppoints(FILE* ifile, s16* nloops)
|
||||||
|
{
|
||||||
|
BSWAP16(*nloops);
|
||||||
|
ALADPCMloop* al = (ALADPCMloop*)malloc(*nloops * sizeof(ALADPCMloop));
|
||||||
|
for (s32 i = 0; i < *nloops; i++)
|
||||||
|
{
|
||||||
|
BSWAP32(al[i].start);
|
||||||
|
BSWAP32(al[i].end);
|
||||||
|
BSWAP32(al[i].count);
|
||||||
|
BSWAP16_MANY(al[i].state, 16);
|
||||||
|
}
|
||||||
|
return al;
|
||||||
|
}
|
||||||
|
|
||||||
|
s32 inner_product(s32 length, s32* v1, s32* v2)
|
||||||
|
{
|
||||||
|
s32 out = 0;
|
||||||
|
for (s32 i = 0; i < length; i++)
|
||||||
|
{
|
||||||
|
out += v1[i] * v2[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compute "out / 2^11", rounded down.
|
||||||
|
s32 dout = out / (1 << 11);
|
||||||
|
s32 fiout = dout * (1 << 11);
|
||||||
|
return dout - (out - fiout < 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void my_decodeframe(u8* frame, s32* decompressed, s32* state, s32 order, s32*** coefTable)
|
||||||
|
{
|
||||||
|
s32 ix[16];
|
||||||
|
|
||||||
|
u8 header = frame[0];
|
||||||
|
s32 scale = 1 << (header >> 4);
|
||||||
|
s32 optimalp = header & 0xf;
|
||||||
|
|
||||||
|
if (framesize == 5)
|
||||||
|
{
|
||||||
|
for (s32 i = 0; i < 16; i += 4)
|
||||||
|
{
|
||||||
|
u8 c = frame[1 + i / 4];
|
||||||
|
ix[i] = c >> 6;
|
||||||
|
ix[i + 1] = (c >> 4) & 0x3;
|
||||||
|
ix[i + 2] = (c >> 2) & 0x3;
|
||||||
|
ix[i + 3] = c & 0x3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (s32 i = 0; i < 16; i += 2)
|
||||||
|
{
|
||||||
|
u8 c = frame[1 + i / 2];
|
||||||
|
ix[i] = c >> 4;
|
||||||
|
ix[i + 1] = c & 0xf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (s32 i = 0; i < 16; i++)
|
||||||
|
{
|
||||||
|
if (framesize == 5)
|
||||||
|
{
|
||||||
|
if (ix[i] >= 2)
|
||||||
|
ix[i] -= 4;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (ix[i] >= 8)
|
||||||
|
ix[i] -= 16;
|
||||||
|
}
|
||||||
|
decompressed[i] = ix[i];
|
||||||
|
ix[i] *= scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (s32 j = 0; j < 2; j++)
|
||||||
|
{
|
||||||
|
s32 in_vec[16];
|
||||||
|
if (j == 0)
|
||||||
|
{
|
||||||
|
for (s32 i = 0; i < order; i++)
|
||||||
|
{
|
||||||
|
in_vec[i] = state[16 - order + i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (s32 i = 0; i < order; i++)
|
||||||
|
{
|
||||||
|
in_vec[i] = state[8 - order + i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (s32 i = 0; i < 8; i++)
|
||||||
|
{
|
||||||
|
s32 ind = j * 8 + i;
|
||||||
|
in_vec[order + i] = ix[ind];
|
||||||
|
state[ind] = inner_product(order + i, coefTable[optimalp][i], in_vec) + ix[ind];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void get_bounds(s32* in, s32* decompressed, s32 scale, s32* minVals, s32* maxVals)
|
||||||
|
{
|
||||||
|
s32 minv, maxv;
|
||||||
|
if (framesize == 9)
|
||||||
|
{
|
||||||
|
minv = -8;
|
||||||
|
maxv = 7;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
minv = -2;
|
||||||
|
maxv = 1;
|
||||||
|
}
|
||||||
|
for (s32 i = 0; i < 16; i++)
|
||||||
|
{
|
||||||
|
s32 lo = in[i] - scale / 2;
|
||||||
|
s32 hi = in[i] + scale / 2;
|
||||||
|
lo -= scale;
|
||||||
|
hi += scale;
|
||||||
|
if (decompressed[i] == minv)
|
||||||
|
lo -= scale;
|
||||||
|
else if (decompressed[i] == maxv)
|
||||||
|
hi += scale;
|
||||||
|
minVals[i] = lo;
|
||||||
|
maxVals[i] = hi;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void write_header(FILE* ofile, const char* id, s32 size)
|
||||||
|
{
|
||||||
|
fwrite(id, 4, 1, ofile);
|
||||||
|
BSWAP32(size);
|
||||||
|
fwrite(&size, sizeof(s32), 1, ofile);
|
||||||
|
}
|
||||||
|
|
||||||
|
char* OldMain(char* infilename)
|
||||||
|
{
|
||||||
|
s16 order = -1;
|
||||||
|
s16 nloops = 0;
|
||||||
|
ALADPCMloop* aloops = NULL;
|
||||||
|
s16 npredictors = -1;
|
||||||
|
s32*** coefTable = NULL;
|
||||||
|
s32 state[16];
|
||||||
|
s32 decompressed[16];
|
||||||
|
s32 soundPointer = -1;
|
||||||
|
s32 currPos = 0;
|
||||||
|
s32 nSamples = 0;
|
||||||
|
Chunk FormChunk = Chunk();
|
||||||
|
ChunkHeader Header = ChunkHeader();
|
||||||
|
CommonChunk CommChunk = CommonChunk();
|
||||||
|
InstrumentChunk InstChunk;
|
||||||
|
SoundDataChunk SndDChunk = SoundDataChunk();
|
||||||
|
FILE* ifile = NULL;
|
||||||
|
FILE* ofile = NULL;
|
||||||
|
|
||||||
|
if ((ifile = fopen(infilename, "rb")) == NULL)
|
||||||
|
{
|
||||||
|
fail_parse("AIFF-C file could not be opened");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(&InstChunk, 0, sizeof(InstChunk));
|
||||||
|
|
||||||
|
BSWAP32(FormChunk.ckID);
|
||||||
|
BSWAP32(FormChunk.formType);
|
||||||
|
if ((FormChunk.ckID != 0x464f524d) || (FormChunk.formType != 0x41494643))
|
||||||
|
{ // FORM, AIFC
|
||||||
|
fail_parse("not an AIFF-C file");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
s32 num = fread(&Header, sizeof(Header), 1, ifile);
|
||||||
|
u32 ts = 0;
|
||||||
|
|
||||||
|
if (num <= 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
BSWAP32(Header.ckID);
|
||||||
|
BSWAP32(Header.ckSize);
|
||||||
|
|
||||||
|
Header.ckSize++;
|
||||||
|
Header.ckSize &= ~1;
|
||||||
|
s32 offset = ftell(ifile);
|
||||||
|
|
||||||
|
switch (Header.ckID)
|
||||||
|
{
|
||||||
|
case 0x434f4d4d: // COMM
|
||||||
|
{
|
||||||
|
BSWAP16(CommChunk.numChannels);
|
||||||
|
BSWAP16(CommChunk.numFramesH);
|
||||||
|
BSWAP16(CommChunk.numFramesL);
|
||||||
|
BSWAP16(CommChunk.sampleSize);
|
||||||
|
BSWAP16(CommChunk.compressionTypeH);
|
||||||
|
BSWAP16(CommChunk.compressionTypeL);
|
||||||
|
s32 cType = (CommChunk.compressionTypeH << 16) + CommChunk.compressionTypeL;
|
||||||
|
if (cType == 0x56415043 || cType == 0x41445039)
|
||||||
|
{ // VAPC or ADP9
|
||||||
|
framesize = 9;
|
||||||
|
}
|
||||||
|
else if (cType == 0x41445035)
|
||||||
|
{ // ADP5
|
||||||
|
framesize = 5;
|
||||||
|
}
|
||||||
|
else if (cType == 0x4850434d)
|
||||||
|
{ // HPCM
|
||||||
|
framesize = 16;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
char comprType[5] = {
|
||||||
|
static_cast<char>(CommChunk.compressionTypeH >> 8), static_cast<char>(CommChunk.compressionTypeH & 0xFF),
|
||||||
|
static_cast<char>(CommChunk.compressionTypeL >> 8), static_cast<char>(CommChunk.compressionTypeL & 0xFF), 0};
|
||||||
|
fail_parse("file is of the wrong compression type [got %s (%08x)]", &comprType,
|
||||||
|
cType);
|
||||||
|
}
|
||||||
|
if (CommChunk.numChannels != 1)
|
||||||
|
{
|
||||||
|
fail_parse("file contains %d channels, only 1 channel supported",
|
||||||
|
CommChunk.numChannels);
|
||||||
|
}
|
||||||
|
if (CommChunk.sampleSize != 16)
|
||||||
|
{
|
||||||
|
fail_parse("file contains %d bit samples, only 16 bit samples supported",
|
||||||
|
CommChunk.sampleSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
nSamples = (CommChunk.numFramesH << 16) + CommChunk.numFramesL;
|
||||||
|
|
||||||
|
// Allow broken input lengths
|
||||||
|
if (nSamples % 16)
|
||||||
|
{
|
||||||
|
nSamples -= (nSamples % 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nSamples % 16 != 0)
|
||||||
|
{
|
||||||
|
fail_parse("number of chunks must be a multiple of 16, found %d with remainder %d",
|
||||||
|
nSamples, nSamples % 16);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x53534e44: // SSND
|
||||||
|
BSWAP32(SndDChunk.offset);
|
||||||
|
BSWAP32(SndDChunk.blockSize);
|
||||||
|
assert(SndDChunk.offset == 0);
|
||||||
|
assert(SndDChunk.blockSize == 0);
|
||||||
|
soundPointer = ftell(ifile);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x4150504c: // APPL
|
||||||
|
BSWAP32(ts);
|
||||||
|
if (ts == 0x73746f63)
|
||||||
|
{ // stoc
|
||||||
|
u8 len = 0;
|
||||||
|
if (len == 11)
|
||||||
|
{
|
||||||
|
char ChunkName[12];
|
||||||
|
s16 version;
|
||||||
|
ChunkName[11] = '\0';
|
||||||
|
if (strcmp("VADPCMCODES", ChunkName) == 0)
|
||||||
|
{
|
||||||
|
BSWAP16(version);
|
||||||
|
if (version != 1)
|
||||||
|
{
|
||||||
|
fail_parse("Unknown codebook chunk version");
|
||||||
|
}
|
||||||
|
readaifccodebook(ifile, &coefTable, &order, &npredictors);
|
||||||
|
}
|
||||||
|
else if (strcmp("VADPCMLOOPS", ChunkName) == 0)
|
||||||
|
{
|
||||||
|
BSWAP16(version);
|
||||||
|
if (version != 1)
|
||||||
|
{
|
||||||
|
fail_parse("Unknown loop chunk version");
|
||||||
|
}
|
||||||
|
aloops = readlooppoints(ifile, &nloops);
|
||||||
|
if (nloops != 1)
|
||||||
|
{
|
||||||
|
fail_parse("Only a single loop supported");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
fseek(ifile, offset + Header.ckSize, SEEK_SET);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (coefTable == NULL)
|
||||||
|
{
|
||||||
|
fail_parse("Codebook missing from bitstream");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (s32 i = 0; i < order; i++)
|
||||||
|
{
|
||||||
|
state[15 - i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 outputBytes = nSamples * sizeof(s16);
|
||||||
|
u8* outputBuf = (u8*)malloc(outputBytes);
|
||||||
|
|
||||||
|
fseek(ifile, soundPointer, SEEK_SET);
|
||||||
|
s32 fails = 0;
|
||||||
|
while (currPos < nSamples)
|
||||||
|
{
|
||||||
|
u8 input[9];
|
||||||
|
u8 encoded[9];
|
||||||
|
s32 lastState[16];
|
||||||
|
s32 decoded[16];
|
||||||
|
s16 guess[16];
|
||||||
|
s16 origGuess[16];
|
||||||
|
|
||||||
|
memcpy(lastState, state, sizeof(state));
|
||||||
|
|
||||||
|
// Decode for real
|
||||||
|
my_decodeframe(input, decompressed, state, order, coefTable);
|
||||||
|
memcpy(decoded, state, sizeof(state));
|
||||||
|
|
||||||
|
// Create a guess from that, by clamping to 16 bits
|
||||||
|
for (s32 i = 0; i < 16; i++)
|
||||||
|
{
|
||||||
|
origGuess[i] = clamp_bits(state[i], 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(state, decoded, sizeof(state));
|
||||||
|
memcpy(outputBuf + currPos * 2, decoded, sizeof(decoded));
|
||||||
|
currPos += 16;
|
||||||
|
}
|
||||||
|
if (fails)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s %d\n", infilename, fails);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write an incomplete file header. We'll fill in the size later.
|
||||||
|
fwrite("FORM\0\0\0\0AIFF", 12, 1, ofile);
|
||||||
|
|
||||||
|
// Subtract 4 from the COMM size to skip the compression field.
|
||||||
|
write_header(ofile, "COMM", sizeof(CommonChunk) - 4);
|
||||||
|
CommChunk.numFramesH = nSamples >> 16;
|
||||||
|
CommChunk.numFramesL = nSamples & 0xffff;
|
||||||
|
BSWAP16(CommChunk.numChannels);
|
||||||
|
BSWAP16(CommChunk.numFramesH);
|
||||||
|
BSWAP16(CommChunk.numFramesL);
|
||||||
|
BSWAP16(CommChunk.sampleSize);
|
||||||
|
fwrite(&CommChunk, sizeof(CommonChunk) - 4, 1, ofile);
|
||||||
|
|
||||||
|
if (nloops > 0)
|
||||||
|
{
|
||||||
|
s32 startPos = aloops[0].start, endPos = aloops[0].end;
|
||||||
|
const char* markerNames[2] = {"start", "end"};
|
||||||
|
Marker markers[2] = {{1, static_cast<u16>(startPos >> 16), static_cast<u16>(startPos & 0xffff)},
|
||||||
|
{2, static_cast<u16>(endPos >> 16), static_cast<u16>(endPos & 0xffff)}};
|
||||||
|
write_header(ofile, "MARK", 2 + 2 * sizeof(Marker) + 1 + 5 + 1 + 3);
|
||||||
|
s16 numMarkers = bswap16(2);
|
||||||
|
fwrite(&numMarkers, sizeof(s16), 1, ofile);
|
||||||
|
for (s32 i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
u8 len = (u8)strlen(markerNames[i]);
|
||||||
|
BSWAP16(markers[i].MarkerID);
|
||||||
|
BSWAP16(markers[i].positionH);
|
||||||
|
BSWAP16(markers[i].positionL);
|
||||||
|
fwrite(&markers[i], sizeof(Marker), 1, ofile);
|
||||||
|
fwrite(&len, 1, 1, ofile);
|
||||||
|
fwrite(markerNames[i], len, 1, ofile);
|
||||||
|
}
|
||||||
|
|
||||||
|
write_header(ofile, "INST", sizeof(InstrumentChunk));
|
||||||
|
InstChunk.sustainLoop.playMode = bswap16(1);
|
||||||
|
InstChunk.sustainLoop.beginLoop = bswap16(1);
|
||||||
|
InstChunk.sustainLoop.endLoop = bswap16(2);
|
||||||
|
InstChunk.releaseLoop.playMode = 0;
|
||||||
|
InstChunk.releaseLoop.beginLoop = 0;
|
||||||
|
InstChunk.releaseLoop.endLoop = 0;
|
||||||
|
fwrite(&InstChunk, sizeof(InstrumentChunk), 1, ofile);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save the coefficient table for use when encoding. Ideally this wouldn't
|
||||||
|
// be needed and "tabledesign -s 1" would generate the right table, but in
|
||||||
|
// practice it's difficult to adjust samples to make that happen.
|
||||||
|
write_header(ofile, "APPL", 4 + 12 + sizeof(CodeChunk) + npredictors * order * 8 * 2);
|
||||||
|
fwrite("stoc", 4, 1, ofile);
|
||||||
|
CodeChunk cChunk;
|
||||||
|
cChunk.version = bswap16(1);
|
||||||
|
cChunk.order = bswap16(order);
|
||||||
|
cChunk.nEntries = bswap16(npredictors);
|
||||||
|
fwrite("\x0bVADPCMCODES", 12, 1, ofile);
|
||||||
|
fwrite(&cChunk, sizeof(CodeChunk), 1, ofile);
|
||||||
|
for (s32 i = 0; i < npredictors; i++)
|
||||||
|
{
|
||||||
|
for (s32 j = 0; j < order; j++)
|
||||||
|
{
|
||||||
|
for (s32 k = 0; k < 8; k++)
|
||||||
|
{
|
||||||
|
s16 ts = bswap16(coefTable[i][k][j]);
|
||||||
|
fwrite(&ts, sizeof(s16), 1, ofile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
write_header(ofile, "SSND", outputBytes + 8);
|
||||||
|
SndDChunk.offset = 0;
|
||||||
|
SndDChunk.blockSize = 0;
|
||||||
|
fwrite(&SndDChunk, sizeof(SoundDataChunk), 1, ofile);
|
||||||
|
fwrite(outputBuf, outputBytes, 1, ofile);
|
||||||
|
|
||||||
|
// Fix the size in the header
|
||||||
|
s32 fileSize = bswap32(ftell(ofile) - 8);
|
||||||
|
fseek(ofile, 4, SEEK_SET);
|
||||||
|
fwrite(&fileSize, 4, 1, ofile);
|
||||||
|
|
||||||
|
fclose(ifile);
|
||||||
|
fclose(ofile);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -800,9 +800,11 @@ void ZFile::GenerateSourceHeaderFiles()
|
|||||||
{
|
{
|
||||||
OutputFormatter formatter;
|
OutputFormatter formatter;
|
||||||
|
|
||||||
|
formatter.Write("#pragma once\n");
|
||||||
|
std::set<std::string> nameSet;
|
||||||
for (ZResource* res : resources)
|
for (ZResource* res : resources)
|
||||||
{
|
{
|
||||||
std::string resSrc = res->GetSourceOutputHeader("");
|
std::string resSrc = res->GetSourceOutputHeader("", &nameSet);
|
||||||
formatter.Write(resSrc);
|
formatter.Write(resSrc);
|
||||||
|
|
||||||
if (resSrc != "")
|
if (resSrc != "")
|
||||||
@@ -811,7 +813,7 @@ void ZFile::GenerateSourceHeaderFiles()
|
|||||||
|
|
||||||
for (auto& sym : symbolResources)
|
for (auto& sym : symbolResources)
|
||||||
{
|
{
|
||||||
formatter.Write(sym.second->GetSourceOutputHeader(""));
|
formatter.Write(sym.second->GetSourceOutputHeader("", &nameSet));
|
||||||
}
|
}
|
||||||
|
|
||||||
formatter.Write(ProcessExterns());
|
formatter.Write(ProcessExterns());
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include "WarningHandler.h"
|
#include "WarningHandler.h"
|
||||||
#include "ZFile.h"
|
#include "ZFile.h"
|
||||||
#include <Globals.h>
|
#include <Globals.h>
|
||||||
|
#include <set>
|
||||||
#include <ZDisplayList.h>
|
#include <ZDisplayList.h>
|
||||||
#include <ZArray.h>
|
#include <ZArray.h>
|
||||||
|
|
||||||
@@ -100,11 +101,14 @@ void ZResource::ParseXML(tinyxml2::XMLElement* reader)
|
|||||||
attrs = attrs->Next();
|
attrs = attrs->Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!canHaveInner && !reader->NoChildren())
|
if (!Globals::Instance->otrMode)
|
||||||
{
|
{
|
||||||
std::string errorHeader = StringHelper::Sprintf(
|
if (!canHaveInner && !reader->NoChildren())
|
||||||
"resource '%s' with inner element/child detected", reader->Name());
|
{
|
||||||
HANDLE_ERROR_PROCESS(WarningType::InvalidXML, errorHeader, "");
|
std::string errorHeader = StringHelper::Sprintf(
|
||||||
|
"resource '%s' with inner element/child detected", reader->Name());
|
||||||
|
HANDLE_ERROR_PROCESS(WarningType::InvalidXML, errorHeader, "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& attr : registeredAttributes)
|
for (const auto& attr : registeredAttributes)
|
||||||
@@ -121,7 +125,6 @@ void ZResource::ParseXML(tinyxml2::XMLElement* reader)
|
|||||||
|
|
||||||
name = registeredAttributes.at("Name").value;
|
name = registeredAttributes.at("Name").value;
|
||||||
|
|
||||||
|
|
||||||
// Disable this check for OTR file generation for now since it takes up a considerable amount of CPU time
|
// Disable this check for OTR file generation for now since it takes up a considerable amount of CPU time
|
||||||
if (!Globals::Instance->otrMode)
|
if (!Globals::Instance->otrMode)
|
||||||
{
|
{
|
||||||
@@ -302,7 +305,7 @@ void ZResource::GetSourceOutputCode([[maybe_unused]] const std::string& prefix)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ZResource::GetSourceOutputHeader([[maybe_unused]] const std::string& prefix)
|
std::string ZResource::GetSourceOutputHeader([[maybe_unused]] const std::string& prefix, std::set<std::string> *nameSet)
|
||||||
{
|
{
|
||||||
if (Globals::Instance->otrMode && genOTRDef)
|
if (Globals::Instance->otrMode && genOTRDef)
|
||||||
{
|
{
|
||||||
@@ -325,7 +328,7 @@ std::string ZResource::GetSourceOutputHeader([[maybe_unused]] const std::string&
|
|||||||
std::string xmlPath = StringHelper::Replace(parent->GetXmlFilePath().string(), "\\", "/");
|
std::string xmlPath = StringHelper::Replace(parent->GetXmlFilePath().string(), "\\", "/");
|
||||||
|
|
||||||
if (StringHelper::Contains(outName, "_room_") || StringHelper::Contains(outName, "_scene"))
|
if (StringHelper::Contains(outName, "_room_") || StringHelper::Contains(outName, "_scene"))
|
||||||
prefix = "scenes";
|
prefix = "scenes/nonmq";
|
||||||
else if (StringHelper::Contains(xmlPath, "objects/"))
|
else if (StringHelper::Contains(xmlPath, "objects/"))
|
||||||
prefix = "objects";
|
prefix = "objects";
|
||||||
else if (StringHelper::Contains(xmlPath, "textures/"))
|
else if (StringHelper::Contains(xmlPath, "textures/"))
|
||||||
@@ -339,10 +342,47 @@ std::string ZResource::GetSourceOutputHeader([[maybe_unused]] const std::string&
|
|||||||
else if (StringHelper::Contains(xmlPath, "text/"))
|
else if (StringHelper::Contains(xmlPath, "text/"))
|
||||||
prefix = "text";
|
prefix = "text";
|
||||||
|
|
||||||
if (prefix != "")
|
if (prefix != "") {
|
||||||
str += StringHelper::Sprintf("#define %s \"__OTR__%s/%s/%s\"", name.c_str(), prefix.c_str(), outName.c_str(), nameStr.c_str());
|
str += StringHelper::Sprintf("#define d%s \"__OTR__%s/%s/%s\"", name.c_str(), prefix.c_str(), outName.c_str(), nameStr.c_str());
|
||||||
|
}
|
||||||
else
|
else
|
||||||
str += StringHelper::Sprintf("#define %s \"__OTR__%s/%s\"", name.c_str(), outName.c_str(), nameStr.c_str());
|
str += StringHelper::Sprintf("#define d%s \"__OTR__%s/%s\"", name.c_str(), outName.c_str(), nameStr.c_str());
|
||||||
|
|
||||||
|
if (nameSet && nameSet->find(name) == nameSet->end()) {
|
||||||
|
str += StringHelper::Sprintf(R"(
|
||||||
|
#ifdef _WIN32
|
||||||
|
static const __declspec(align(2)) char %s[] = d%s;
|
||||||
|
#else
|
||||||
|
static const char %s[] __attribute__((aligned (2))) = d%s;
|
||||||
|
#endif
|
||||||
|
)", name.c_str(), name.c_str(), name.c_str(), name.c_str());
|
||||||
|
|
||||||
|
if (nameSet) {
|
||||||
|
nameSet->insert(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name == "gTitleZeldaShieldLogoMQTex")
|
||||||
|
{
|
||||||
|
std::string addName = "gTitleZeldaShieldLogoTex";
|
||||||
|
nameStr = StringHelper::Strip(StringHelper::Strip(addName, "\n"), "\r");
|
||||||
|
str += StringHelper::Sprintf("\n#define d%s \"__OTR__%s/%s/%s\"", addName.c_str(), prefix.c_str(), outName.c_str(), nameStr.c_str());
|
||||||
|
if (nameSet && nameSet->find(addName) == nameSet->end())
|
||||||
|
{
|
||||||
|
str += StringHelper::Sprintf(R"(
|
||||||
|
#ifdef _WIN32
|
||||||
|
static const __declspec(align(2)) char %s[] = d%s;
|
||||||
|
#else
|
||||||
|
static const char %s[] __attribute__((aligned (2))) = d%s;
|
||||||
|
#endif
|
||||||
|
)", addName.c_str(), addName.c_str(), addName.c_str(), addName.c_str());
|
||||||
|
|
||||||
|
if (nameSet)
|
||||||
|
{
|
||||||
|
nameSet->insert(addName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <set>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -50,7 +51,8 @@ enum class ZResourceType
|
|||||||
TextureAnimationParams,
|
TextureAnimationParams,
|
||||||
Vector,
|
Vector,
|
||||||
Vertex,
|
Vertex,
|
||||||
Text
|
Text,
|
||||||
|
Audio
|
||||||
};
|
};
|
||||||
|
|
||||||
class ResourceAttribute
|
class ResourceAttribute
|
||||||
@@ -115,7 +117,7 @@ public:
|
|||||||
[[nodiscard]] virtual std::string GetDefaultName(const std::string& prefix) const;
|
[[nodiscard]] virtual std::string GetDefaultName(const std::string& prefix) const;
|
||||||
|
|
||||||
virtual void GetSourceOutputCode(const std::string& prefix);
|
virtual void GetSourceOutputCode(const std::string& prefix);
|
||||||
virtual std::string GetSourceOutputHeader(const std::string& prefix);
|
virtual std::string GetSourceOutputHeader(const std::string& prefix, std::set<std::string> *nameSet);
|
||||||
virtual void CalcHash();
|
virtual void CalcHash();
|
||||||
/**
|
/**
|
||||||
* Exports the resource to binary format
|
* Exports the resource to binary format
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include "Utils/Directory.h"
|
#include "Utils/Directory.h"
|
||||||
#include "yaz0/yaz0.h"
|
#include "yaz0/yaz0.h"
|
||||||
|
|
||||||
#ifndef _MSC_VER
|
#ifdef __linux__
|
||||||
#include <byteswap.h>
|
#include <byteswap.h>
|
||||||
#endif
|
#endif
|
||||||
#include <Globals.h>
|
#include <Globals.h>
|
||||||
@@ -17,6 +17,10 @@ namespace fs = std::filesystem;
|
|||||||
#define __bswap_32 _byteswap_ulong
|
#define __bswap_32 _byteswap_ulong
|
||||||
#define bswap_32 _byteswap_ulong
|
#define bswap_32 _byteswap_ulong
|
||||||
#endif
|
#endif
|
||||||
|
#if defined __APPLE__
|
||||||
|
#define __bswap32 __builtin_bswap32
|
||||||
|
#define bswap32 __builtin_bswap32
|
||||||
|
#endif
|
||||||
|
|
||||||
// ROM DMA Table Start
|
// ROM DMA Table Start
|
||||||
#define OOT_OFF_NTSC_10_RC 0x7430
|
#define OOT_OFF_NTSC_10_RC 0x7430
|
||||||
@@ -60,7 +64,33 @@ namespace fs = std::filesystem;
|
|||||||
#define OOT_PAL_GC_MQ_DBG 0x917D18F6
|
#define OOT_PAL_GC_MQ_DBG 0x917D18F6
|
||||||
#define OOT_IQUE_TW 0x3D81FB3E
|
#define OOT_IQUE_TW 0x3D81FB3E
|
||||||
#define OOT_IQUE_CN 0xB1E1E07B
|
#define OOT_IQUE_CN 0xB1E1E07B
|
||||||
#define OOT_UNKNOWN 0xFFFFFFFF
|
#define UNKNOWN 0xFFFFFFFF
|
||||||
|
|
||||||
|
bool ZRom::IsMQ() {
|
||||||
|
int crc = BitConverter::ToInt32BE(romData, 0x10);
|
||||||
|
switch (crc) {
|
||||||
|
case OOT_NTSC_10:
|
||||||
|
case OOT_NTSC_11:
|
||||||
|
case OOT_NTSC_12:
|
||||||
|
case OOT_PAL_10:
|
||||||
|
case OOT_PAL_11:
|
||||||
|
case OOT_NTSC_JP_GC:
|
||||||
|
case OOT_NTSC_JP_GC_CE:
|
||||||
|
case OOT_NTSC_US_GC:
|
||||||
|
case OOT_PAL_GC:
|
||||||
|
case OOT_PAL_GC_DBG1:
|
||||||
|
case OOT_PAL_GC_DBG2:
|
||||||
|
case OOT_IQUE_CN:
|
||||||
|
case OOT_IQUE_TW:
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
case OOT_NTSC_JP_MQ:
|
||||||
|
case OOT_NTSC_US_MQ:
|
||||||
|
case OOT_PAL_MQ:
|
||||||
|
case OOT_PAL_GC_MQ_DBG:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ZRom::ZRom(std::string romPath)
|
ZRom::ZRom(std::string romPath)
|
||||||
{
|
{
|
||||||
@@ -191,9 +221,9 @@ ZRom::ZRom(std::string romPath)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
files[lines[i]] = outData;
|
files[lines[i]] = outData;
|
||||||
}
|
|
||||||
|
|
||||||
int bp = 0;
|
//File::WriteAllBytes(StringHelper::Sprintf("baserom/%s", lines[i].c_str()), files[lines[i]]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<uint8_t> ZRom::GetFile(std::string fileName)
|
std::vector<uint8_t> ZRom::GetFile(std::string fileName)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ public:
|
|||||||
ZRom(std::string romPath);
|
ZRom(std::string romPath);
|
||||||
|
|
||||||
std::vector<uint8_t> GetFile(std::string fileName);
|
std::vector<uint8_t> GetFile(std::string fileName);
|
||||||
|
bool IsMQ();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::vector<uint8_t> romData;
|
std::vector<uint8_t> romData;
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ std::string ZString::GetBodySourceCode() const
|
|||||||
return StringHelper::Sprintf("\t\"%s\"", strData.data());
|
return StringHelper::Sprintf("\t\"%s\"", strData.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ZString::GetSourceOutputHeader([[maybe_unused]] const std::string& prefix)
|
std::string ZString::GetSourceOutputHeader([[maybe_unused]] const std::string& prefix, std::set<std::string> *nameSet)
|
||||||
{
|
{
|
||||||
return StringHelper::Sprintf("#define %s_macro \"%s\"", name.c_str(), strData.data());
|
return StringHelper::Sprintf("#define %s_macro \"%s\"", name.c_str(), strData.data());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ public:
|
|||||||
Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override;
|
Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override;
|
||||||
std::string GetBodySourceCode() const override;
|
std::string GetBodySourceCode() const override;
|
||||||
|
|
||||||
std::string GetSourceOutputHeader(const std::string& prefix) override;
|
std::string GetSourceOutputHeader(const std::string& prefix, std::set<std::string> *nameSet) override;
|
||||||
std::string GetSourceTypeName() const override;
|
std::string GetSourceTypeName() const override;
|
||||||
ZResourceType GetResourceType() const override;
|
ZResourceType GetResourceType() const override;
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ size_t ZSymbol::GetRawDataSize() const
|
|||||||
return typeSize;
|
return typeSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ZSymbol::GetSourceOutputHeader([[maybe_unused]] const std::string& prefix)
|
std::string ZSymbol::GetSourceOutputHeader([[maybe_unused]] const std::string& prefix, std::set<std::string> *nameSet)
|
||||||
{
|
{
|
||||||
if (isArray)
|
if (isArray)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public:
|
|||||||
|
|
||||||
Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override;
|
Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override;
|
||||||
|
|
||||||
std::string GetSourceOutputHeader(const std::string& prefix) override;
|
std::string GetSourceOutputHeader(const std::string& prefix, std::set<std::string> *nameSet) override;
|
||||||
|
|
||||||
std::string GetSourceTypeName() const override;
|
std::string GetSourceTypeName() const override;
|
||||||
ZResourceType GetResourceType() const override;
|
ZResourceType GetResourceType() const override;
|
||||||
|
|||||||
@@ -830,6 +830,8 @@ std::string ZTexture::GetBodySourceCode() const
|
|||||||
// Please don't remove this line, unless you somehow made a way to prevent
|
// Please don't remove this line, unless you somehow made a way to prevent
|
||||||
// that warning when building the OoT repo.
|
// that warning when building the OoT repo.
|
||||||
sourceOutput += "\n";
|
sourceOutput += "\n";
|
||||||
|
} else if (Globals::Instance->buildRawTexture) {
|
||||||
|
sourceOutput += std::string(textureDataRaw.begin(), textureDataRaw.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
return sourceOutput;
|
return sourceOutput;
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
long pathconf(const char *path, int name) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio Version 16
|
|
||||||
VisualStudioVersion = 16.0.30320.27
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZAPD", "ZAPD\ZAPD.vcxproj", "{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExporterExample", "ExporterTest\ExporterTest.vcxproj", "{65608EB0-1A47-45AD-AB66-192FB64C762C}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZAPDUtils", "ZAPDUtils\ZAPDUtils.vcxproj", "{A2E01C3E-D647-45D1-9788-043DEBC1A908}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|x64 = Debug|x64
|
|
||||||
Debug|x86 = Debug|x86
|
|
||||||
MinSizeRel|x64 = MinSizeRel|x64
|
|
||||||
MinSizeRel|x86 = MinSizeRel|x86
|
|
||||||
Release|x64 = Release|x64
|
|
||||||
Release|x86 = Release|x86
|
|
||||||
RelWithDebInfo|x64 = RelWithDebInfo|x64
|
|
||||||
RelWithDebInfo|x86 = RelWithDebInfo|x86
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Debug|x64.Build.0 = Debug|x64
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Debug|x86.ActiveCfg = Debug|Win32
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Debug|x86.Build.0 = Debug|Win32
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.MinSizeRel|x64.ActiveCfg = Release|x64
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.MinSizeRel|x64.Build.0 = Release|x64
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.MinSizeRel|x86.ActiveCfg = Release|Win32
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.MinSizeRel|x86.Build.0 = Release|Win32
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Release|x64.Build.0 = Release|x64
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Release|x86.ActiveCfg = Release|Win32
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Release|x86.Build.0 = Release|Win32
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.RelWithDebInfo|x64.Build.0 = Release|x64
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.RelWithDebInfo|x86.ActiveCfg = Release|Win32
|
|
||||||
{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.RelWithDebInfo|x86.Build.0 = Release|Win32
|
|
||||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.Debug|x64.Build.0 = Debug|x64
|
|
||||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.Debug|x86.ActiveCfg = Debug|Win32
|
|
||||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.Debug|x86.Build.0 = Debug|Win32
|
|
||||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.MinSizeRel|x64.ActiveCfg = Debug|x64
|
|
||||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.MinSizeRel|x64.Build.0 = Debug|x64
|
|
||||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.MinSizeRel|x86.ActiveCfg = Debug|Win32
|
|
||||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.MinSizeRel|x86.Build.0 = Debug|Win32
|
|
||||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.Release|x64.Build.0 = Release|x64
|
|
||||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.Release|x86.ActiveCfg = Release|Win32
|
|
||||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.Release|x86.Build.0 = Release|Win32
|
|
||||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
|
||||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.RelWithDebInfo|x64.Build.0 = Release|x64
|
|
||||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.RelWithDebInfo|x86.ActiveCfg = Release|Win32
|
|
||||||
{65608EB0-1A47-45AD-AB66-192FB64C762C}.RelWithDebInfo|x86.Build.0 = Release|Win32
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x64.Build.0 = Debug|x64
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x86.ActiveCfg = Debug|Win32
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x86.Build.0 = Debug|Win32
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.MinSizeRel|x64.ActiveCfg = Debug|x64
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.MinSizeRel|x64.Build.0 = Debug|x64
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.MinSizeRel|x86.ActiveCfg = Debug|Win32
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.MinSizeRel|x86.Build.0 = Debug|Win32
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x64.Build.0 = Release|x64
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x86.ActiveCfg = Release|Win32
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x86.Build.0 = Release|Win32
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.RelWithDebInfo|x64.Build.0 = Release|x64
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.RelWithDebInfo|x86.ActiveCfg = Release|Win32
|
|
||||||
{A2E01C3E-D647-45D1-9788-043DEBC1A908}.RelWithDebInfo|x86.Build.0 = Release|Win32
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
||||||
SolutionGuid = {C2E1CC72-7A50-3249-AFD5-DFF6FE25CDCA}
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(Performance) = preSolution
|
|
||||||
HasPerformanceSessions = true
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
struct Color3b
|
|
||||||
{
|
|
||||||
uint8_t r, g, b;
|
|
||||||
|
|
||||||
Color3b()
|
|
||||||
{
|
|
||||||
r = 0;
|
|
||||||
g = 0;
|
|
||||||
b = 0;
|
|
||||||
};
|
|
||||||
Color3b(uint8_t nR, uint8_t nG, uint8_t nB)
|
|
||||||
{
|
|
||||||
r = nR;
|
|
||||||
g = nG;
|
|
||||||
b = nB;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
# Only used for standalone compilation, usually inherits these from the main makefile
|
|
||||||
CXXFLAGS ?= -Wall -Wextra -O2 -g -std=c++17
|
|
||||||
|
|
||||||
SRC_DIRS := $(shell find -type d -not -path "*build*")
|
|
||||||
CPP_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.cpp))
|
|
||||||
H_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.h))
|
|
||||||
|
|
||||||
O_FILES := $(foreach f,$(CPP_FILES:.cpp=.o),build/$f)
|
|
||||||
LIB := ZAPDUtils.a
|
|
||||||
|
|
||||||
# create build directories
|
|
||||||
$(shell mkdir -p $(foreach dir,$(SRC_DIRS),build/$(dir)))
|
|
||||||
|
|
||||||
all: $(LIB)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf build $(LIB)
|
|
||||||
|
|
||||||
format:
|
|
||||||
clang-format-11 -i $(CPP_FILES) $(H_FILES)
|
|
||||||
|
|
||||||
.PHONY: all clean format
|
|
||||||
|
|
||||||
build/%.o: %.cpp
|
|
||||||
$(CXX) $(CXXFLAGS) $(OPTFLAGS) -c $(OUTPUT_OPTION) $<
|
|
||||||
|
|
||||||
$(LIB): $(O_FILES)
|
|
||||||
$(AR) rcs $@ $^
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstdlib>
|
|
||||||
|
|
||||||
typedef uint32_t strhash;
|
|
||||||
|
|
||||||
[[maybe_unused]] static strhash CRC32B(unsigned char* message, int32_t size)
|
|
||||||
{
|
|
||||||
int32_t byte = 0, crc = 0;
|
|
||||||
int32_t mask = 0;
|
|
||||||
|
|
||||||
crc = 0xFFFFFFFF;
|
|
||||||
|
|
||||||
for (int32_t i = 0; i < size; i++)
|
|
||||||
{
|
|
||||||
byte = message[i];
|
|
||||||
crc = crc ^ byte;
|
|
||||||
|
|
||||||
for (int32_t j = 7; j >= 0; j--)
|
|
||||||
{
|
|
||||||
mask = -(crc & 1);
|
|
||||||
crc = (crc >> 1) ^ (0xEDB88320 & mask);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ~(uint32_t)(crc);
|
|
||||||
}
|
|
||||||
|
|
||||||
[[maybe_unused]] constexpr static strhash CRC32BCT(const char* message, int32_t size)
|
|
||||||
{
|
|
||||||
int32_t byte = 0, crc = 0;
|
|
||||||
int32_t mask = 0;
|
|
||||||
|
|
||||||
crc = 0xFFFFFFFF;
|
|
||||||
|
|
||||||
for (int32_t i = 0; i < size; i++)
|
|
||||||
{
|
|
||||||
byte = message[i];
|
|
||||||
crc = crc ^ byte;
|
|
||||||
|
|
||||||
for (int32_t j = 7; j >= 0; j--)
|
|
||||||
{
|
|
||||||
mask = -(crc & 1);
|
|
||||||
crc = (crc >> 1) ^ (0xEDB88320 & mask);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ~(uint32_t)(crc);
|
|
||||||
}
|
|
||||||
@@ -1,148 +0,0 @@
|
|||||||
#include "BinaryReader.h"
|
|
||||||
#include <cmath>
|
|
||||||
#include <stdexcept>
|
|
||||||
#include "Stream.h"
|
|
||||||
|
|
||||||
BinaryReader::BinaryReader(Stream* nStream)
|
|
||||||
{
|
|
||||||
stream.reset(nStream);
|
|
||||||
}
|
|
||||||
|
|
||||||
BinaryReader::BinaryReader(std::shared_ptr<Stream> nStream)
|
|
||||||
{
|
|
||||||
stream = nStream;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BinaryReader::Close()
|
|
||||||
{
|
|
||||||
stream->Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BinaryReader::Seek(uint32_t offset, SeekOffsetType seekType)
|
|
||||||
{
|
|
||||||
stream->Seek(offset, seekType);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t BinaryReader::GetBaseAddress()
|
|
||||||
{
|
|
||||||
return stream->GetBaseAddress();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BinaryReader::Read([[maybe_unused]] char* buffer, int32_t length)
|
|
||||||
{
|
|
||||||
stream->Read(length);
|
|
||||||
}
|
|
||||||
|
|
||||||
char BinaryReader::ReadChar()
|
|
||||||
{
|
|
||||||
return (char)stream->ReadByte();
|
|
||||||
}
|
|
||||||
|
|
||||||
int8_t BinaryReader::ReadByte()
|
|
||||||
{
|
|
||||||
return stream->ReadByte();
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t BinaryReader::ReadUByte()
|
|
||||||
{
|
|
||||||
return (uint8_t)stream->ReadByte();
|
|
||||||
}
|
|
||||||
|
|
||||||
int16_t BinaryReader::ReadInt16()
|
|
||||||
{
|
|
||||||
int16_t result = 0;
|
|
||||||
|
|
||||||
stream->Read((char*)&result, sizeof(int16_t));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t BinaryReader::ReadInt32()
|
|
||||||
{
|
|
||||||
int32_t result = 0;
|
|
||||||
|
|
||||||
stream->Read((char*)&result, sizeof(int32_t));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16_t BinaryReader::ReadUInt16()
|
|
||||||
{
|
|
||||||
uint16_t result = 0;
|
|
||||||
|
|
||||||
stream->Read((char*)&result, sizeof(uint16_t));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t BinaryReader::ReadUInt32()
|
|
||||||
{
|
|
||||||
uint32_t result = 0;
|
|
||||||
|
|
||||||
stream->Read((char*)&result, sizeof(uint32_t));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64_t BinaryReader::ReadUInt64()
|
|
||||||
{
|
|
||||||
uint64_t result = 0;
|
|
||||||
|
|
||||||
stream->Read((char*)&result, sizeof(uint64_t));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
float BinaryReader::ReadSingle()
|
|
||||||
{
|
|
||||||
float result = NAN;
|
|
||||||
|
|
||||||
stream->Read((char*)&result, sizeof(float));
|
|
||||||
|
|
||||||
if (std::isnan(result))
|
|
||||||
throw std::runtime_error("BinaryReader::ReadSingle(): Error reading stream");
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
double BinaryReader::ReadDouble()
|
|
||||||
{
|
|
||||||
double result = NAN;
|
|
||||||
|
|
||||||
stream->Read((char*)&result, sizeof(double));
|
|
||||||
if (std::isnan(result))
|
|
||||||
throw std::runtime_error("BinaryReader::ReadDouble(): Error reading stream");
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
Vec3f BinaryReader::ReadVec3f()
|
|
||||||
{
|
|
||||||
return Vec3f();
|
|
||||||
}
|
|
||||||
|
|
||||||
Vec3s BinaryReader::ReadVec3s()
|
|
||||||
{
|
|
||||||
return Vec3s(0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
Vec3s BinaryReader::ReadVec3b()
|
|
||||||
{
|
|
||||||
return Vec3s(0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
Vec2f BinaryReader::ReadVec2f()
|
|
||||||
{
|
|
||||||
return Vec2f();
|
|
||||||
}
|
|
||||||
|
|
||||||
Color3b BinaryReader::ReadColor3b()
|
|
||||||
{
|
|
||||||
return Color3b();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string BinaryReader::ReadString()
|
|
||||||
{
|
|
||||||
std::string res;
|
|
||||||
int numChars = ReadInt32();
|
|
||||||
|
|
||||||
for (int i = 0; i < numChars; i++)
|
|
||||||
res += ReadChar();
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <array>
|
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include "../Color3b.h"
|
|
||||||
#include "../Vec2f.h"
|
|
||||||
#include "../Vec3f.h"
|
|
||||||
#include "../Vec3s.h"
|
|
||||||
#include "Stream.h"
|
|
||||||
|
|
||||||
class BinaryReader
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
BinaryReader(Stream* nStream);
|
|
||||||
BinaryReader(std::shared_ptr<Stream> nStream);
|
|
||||||
|
|
||||||
void Close();
|
|
||||||
|
|
||||||
void Seek(uint32_t offset, SeekOffsetType seekType);
|
|
||||||
uint32_t GetBaseAddress();
|
|
||||||
|
|
||||||
void Read(char* buffer, int32_t length);
|
|
||||||
char ReadChar();
|
|
||||||
int8_t ReadByte();
|
|
||||||
int16_t ReadInt16();
|
|
||||||
int32_t ReadInt32();
|
|
||||||
uint8_t ReadUByte();
|
|
||||||
uint16_t ReadUInt16();
|
|
||||||
uint32_t ReadUInt32();
|
|
||||||
uint64_t ReadUInt64();
|
|
||||||
float ReadSingle();
|
|
||||||
double ReadDouble();
|
|
||||||
Vec3f ReadVec3f();
|
|
||||||
Vec3s ReadVec3s();
|
|
||||||
Vec3s ReadVec3b();
|
|
||||||
Vec2f ReadVec2f();
|
|
||||||
Color3b ReadColor3b();
|
|
||||||
std::string ReadString();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
std::shared_ptr<Stream> stream;
|
|
||||||
};
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
#include "BinaryWriter.h"
|
|
||||||
|
|
||||||
BinaryWriter::BinaryWriter(Stream* nStream)
|
|
||||||
{
|
|
||||||
stream.reset(nStream);
|
|
||||||
}
|
|
||||||
|
|
||||||
BinaryWriter::BinaryWriter(std::shared_ptr<Stream> nStream)
|
|
||||||
{
|
|
||||||
stream = nStream;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BinaryWriter::Close()
|
|
||||||
{
|
|
||||||
stream->Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<Stream> BinaryWriter::GetStream()
|
|
||||||
{
|
|
||||||
return stream;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64_t BinaryWriter::GetBaseAddress()
|
|
||||||
{
|
|
||||||
return stream->GetBaseAddress();
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64_t BinaryWriter::GetLength()
|
|
||||||
{
|
|
||||||
return stream->GetLength();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BinaryWriter::Seek(int32_t offset, SeekOffsetType seekType)
|
|
||||||
{
|
|
||||||
stream->Seek(offset, seekType);
|
|
||||||
}
|
|
||||||
|
|
||||||
void BinaryWriter::Write(int8_t value)
|
|
||||||
{
|
|
||||||
stream->Write((char*)&value, sizeof(int8_t));
|
|
||||||
}
|
|
||||||
|
|
||||||
void BinaryWriter::Write(uint8_t value)
|
|
||||||
{
|
|
||||||
stream->Write((char*)&value, sizeof(uint8_t));
|
|
||||||
}
|
|
||||||
|
|
||||||
void BinaryWriter::Write(int16_t value)
|
|
||||||
{
|
|
||||||
stream->Write((char*)&value, sizeof(int16_t));
|
|
||||||
}
|
|
||||||
|
|
||||||
void BinaryWriter::Write(uint16_t value)
|
|
||||||
{
|
|
||||||
stream->Write((char*)&value, sizeof(uint16_t));
|
|
||||||
}
|
|
||||||
|
|
||||||
void BinaryWriter::Write(int32_t value)
|
|
||||||
{
|
|
||||||
stream->Write((char*)&value, sizeof(int32_t));
|
|
||||||
}
|
|
||||||
|
|
||||||
void BinaryWriter::Write(int32_t valueA, int32_t valueB)
|
|
||||||
{
|
|
||||||
Write(valueA);
|
|
||||||
Write(valueB);
|
|
||||||
}
|
|
||||||
|
|
||||||
void BinaryWriter::Write(uint32_t value)
|
|
||||||
{
|
|
||||||
stream->Write((char*)&value, sizeof(uint32_t));
|
|
||||||
}
|
|
||||||
|
|
||||||
void BinaryWriter::Write(int64_t value)
|
|
||||||
{
|
|
||||||
stream->Write((char*)&value, sizeof(int64_t));
|
|
||||||
}
|
|
||||||
|
|
||||||
void BinaryWriter::Write(uint64_t value)
|
|
||||||
{
|
|
||||||
stream->Write((char*)&value, sizeof(uint64_t));
|
|
||||||
}
|
|
||||||
|
|
||||||
void BinaryWriter::Write(float value)
|
|
||||||
{
|
|
||||||
stream->Write((char*)&value, sizeof(float));
|
|
||||||
}
|
|
||||||
|
|
||||||
void BinaryWriter::Write(double value)
|
|
||||||
{
|
|
||||||
stream->Write((char*)&value, sizeof(double));
|
|
||||||
}
|
|
||||||
|
|
||||||
void BinaryWriter::Write(const std::string& str)
|
|
||||||
{
|
|
||||||
int strLen = str.size();
|
|
||||||
stream->Write((char*)&strLen, sizeof(int));
|
|
||||||
|
|
||||||
for (char c : str)
|
|
||||||
stream->WriteByte(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
void BinaryWriter::Write(char* srcBuffer, size_t length)
|
|
||||||
{
|
|
||||||
stream->Write(srcBuffer, length);
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <array>
|
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include "Stream.h"
|
|
||||||
|
|
||||||
class BinaryWriter
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
BinaryWriter(Stream* nStream);
|
|
||||||
BinaryWriter(std::shared_ptr<Stream> nStream);
|
|
||||||
|
|
||||||
std::shared_ptr<Stream> GetStream();
|
|
||||||
uint64_t GetBaseAddress();
|
|
||||||
uint64_t GetLength();
|
|
||||||
void Seek(int32_t offset, SeekOffsetType seekType);
|
|
||||||
void Close();
|
|
||||||
|
|
||||||
void Write(int8_t value);
|
|
||||||
void Write(uint8_t value);
|
|
||||||
void Write(int16_t value);
|
|
||||||
void Write(uint16_t value);
|
|
||||||
void Write(int32_t value);
|
|
||||||
void Write(int32_t valueA, int32_t valueB);
|
|
||||||
void Write(uint32_t value);
|
|
||||||
void Write(int64_t value);
|
|
||||||
void Write(uint64_t value);
|
|
||||||
void Write(float value);
|
|
||||||
void Write(double value);
|
|
||||||
void Write(const std::string& str);
|
|
||||||
void Write(char* srcBuffer, size_t length);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
std::shared_ptr<Stream> stream;
|
|
||||||
};
|
|
||||||
@@ -1,162 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
#include <limits>
|
|
||||||
#include <vector>
|
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
class BitConverter
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static inline int8_t ToInt8BE(const uint8_t* data, int32_t offset)
|
|
||||||
{
|
|
||||||
return (uint8_t)data[offset + 0];
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int8_t ToInt8BE(const std::vector<uint8_t>& data, int32_t offset)
|
|
||||||
{
|
|
||||||
return (uint8_t)data[offset + 0];
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint8_t ToUInt8BE(const uint8_t* data, int32_t offset)
|
|
||||||
{
|
|
||||||
return (uint8_t)data[offset + 0];
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint8_t ToUInt8BE(const std::vector<uint8_t>& data, int32_t offset)
|
|
||||||
{
|
|
||||||
return (uint8_t)data[offset + 0];
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int16_t ToInt16BE(const uint8_t* data, int32_t offset)
|
|
||||||
{
|
|
||||||
return ((uint16_t)data[offset + 0] << 8) + (uint16_t)data[offset + 1];
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int16_t ToInt16BE(const std::vector<uint8_t>& data, int32_t offset)
|
|
||||||
{
|
|
||||||
return ((uint16_t)data[offset + 0] << 8) + (uint16_t)data[offset + 1];
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint16_t ToUInt16BE(const uint8_t* data, int32_t offset)
|
|
||||||
{
|
|
||||||
return ((uint16_t)data[offset + 0] << 8) + (uint16_t)data[offset + 1];
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint16_t ToUInt16BE(const std::vector<uint8_t>& data, int32_t offset)
|
|
||||||
{
|
|
||||||
return ((uint16_t)data[offset + 0] << 8) + (uint16_t)data[offset + 1];
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int32_t ToInt32BE(const uint8_t* data, int32_t offset)
|
|
||||||
{
|
|
||||||
return ((uint32_t)data[offset + 0] << 24) + ((uint32_t)data[offset + 1] << 16) +
|
|
||||||
((uint32_t)data[offset + 2] << 8) + (uint32_t)data[offset + 3];
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int32_t ToInt32BE(const std::vector<uint8_t>& data, int32_t offset)
|
|
||||||
{
|
|
||||||
return ((uint32_t)data[offset + 0] << 24) + ((uint32_t)data[offset + 1] << 16) +
|
|
||||||
((uint32_t)data[offset + 2] << 8) + (uint32_t)data[offset + 3];
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint32_t ToUInt32BE(const uint8_t* data, int32_t offset)
|
|
||||||
{
|
|
||||||
return ((uint32_t)data[offset + 0] << 24) + ((uint32_t)data[offset + 1] << 16) +
|
|
||||||
((uint32_t)data[offset + 2] << 8) + (uint32_t)data[offset + 3];
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint32_t ToUInt32BE(const std::vector<uint8_t>& data, int32_t offset)
|
|
||||||
{
|
|
||||||
return ((uint32_t)data[offset + 0] << 24) + ((uint32_t)data[offset + 1] << 16) +
|
|
||||||
((uint32_t)data[offset + 2] << 8) + (uint32_t)data[offset + 3];
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int64_t ToInt64BE(const uint8_t* data, int32_t offset)
|
|
||||||
{
|
|
||||||
return ((uint64_t)data[offset + 0] << 56) + ((uint64_t)data[offset + 1] << 48) +
|
|
||||||
((uint64_t)data[offset + 2] << 40) + ((uint64_t)data[offset + 3] << 32) +
|
|
||||||
((uint64_t)data[offset + 4] << 24) + ((uint64_t)data[offset + 5] << 16) +
|
|
||||||
((uint64_t)data[offset + 6] << 8) + ((uint64_t)data[offset + 7]);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int64_t ToInt64BE(const std::vector<uint8_t>& data, int32_t offset)
|
|
||||||
{
|
|
||||||
return ((uint64_t)data[offset + 0] << 56) + ((uint64_t)data[offset + 1] << 48) +
|
|
||||||
((uint64_t)data[offset + 2] << 40) + ((uint64_t)data[offset + 3] << 32) +
|
|
||||||
((uint64_t)data[offset + 4] << 24) + ((uint64_t)data[offset + 5] << 16) +
|
|
||||||
((uint64_t)data[offset + 6] << 8) + ((uint64_t)data[offset + 7]);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint64_t ToUInt64BE(const uint8_t* data, int32_t offset)
|
|
||||||
{
|
|
||||||
return ((uint64_t)data[offset + 0] << 56) + ((uint64_t)data[offset + 1] << 48) +
|
|
||||||
((uint64_t)data[offset + 2] << 40) + ((uint64_t)data[offset + 3] << 32) +
|
|
||||||
((uint64_t)data[offset + 4] << 24) + ((uint64_t)data[offset + 5] << 16) +
|
|
||||||
((uint64_t)data[offset + 6] << 8) + ((uint64_t)data[offset + 7]);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint64_t ToUInt64BE(const std::vector<uint8_t>& data, int32_t offset)
|
|
||||||
{
|
|
||||||
return ((uint64_t)data[offset + 0] << 56) + ((uint64_t)data[offset + 1] << 48) +
|
|
||||||
((uint64_t)data[offset + 2] << 40) + ((uint64_t)data[offset + 3] << 32) +
|
|
||||||
((uint64_t)data[offset + 4] << 24) + ((uint64_t)data[offset + 5] << 16) +
|
|
||||||
((uint64_t)data[offset + 6] << 8) + ((uint64_t)data[offset + 7]);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline float ToFloatBE(const uint8_t* data, int32_t offset)
|
|
||||||
{
|
|
||||||
float value;
|
|
||||||
uint32_t floatData = ((uint32_t)data[offset + 0] << 24) +
|
|
||||||
((uint32_t)data[offset + 1] << 16) +
|
|
||||||
((uint32_t)data[offset + 2] << 8) + (uint32_t)data[offset + 3];
|
|
||||||
static_assert(sizeof(uint32_t) == sizeof(float), "expected 32-bit float");
|
|
||||||
std::memcpy(&value, &floatData, sizeof(value));
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline float ToFloatBE(const std::vector<uint8_t>& data, int32_t offset)
|
|
||||||
{
|
|
||||||
float value;
|
|
||||||
uint32_t floatData = ((uint32_t)data[offset + 0] << 24) +
|
|
||||||
((uint32_t)data[offset + 1] << 16) +
|
|
||||||
((uint32_t)data[offset + 2] << 8) + (uint32_t)data[offset + 3];
|
|
||||||
static_assert(sizeof(uint32_t) == sizeof(float), "expected 32-bit float");
|
|
||||||
std::memcpy(&value, &floatData, sizeof(value));
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline double ToDoubleBE(const uint8_t* data, int32_t offset)
|
|
||||||
{
|
|
||||||
double value;
|
|
||||||
uint64_t floatData =
|
|
||||||
((uint64_t)data[offset + 0] << 56) + ((uint64_t)data[offset + 1] << 48) +
|
|
||||||
((uint64_t)data[offset + 2] << 40) + ((uint64_t)data[offset + 3] << 32) +
|
|
||||||
((uint64_t)data[offset + 4] << 24) + ((uint64_t)data[offset + 5] << 16) +
|
|
||||||
((uint64_t)data[offset + 6] << 8) + ((uint64_t)data[offset + 7]);
|
|
||||||
static_assert(sizeof(uint64_t) == sizeof(double), "expected 64-bit double");
|
|
||||||
// Checks if the float format on the platform the ZAPD binary is running on supports the
|
|
||||||
// same float format as the object file.
|
|
||||||
static_assert(std::numeric_limits<float>::is_iec559,
|
|
||||||
"expected IEC559 floats on host machine");
|
|
||||||
std::memcpy(&value, &floatData, sizeof(value));
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline double ToDoubleBE(const std::vector<uint8_t>& data, int32_t offset)
|
|
||||||
{
|
|
||||||
double value;
|
|
||||||
uint64_t floatData =
|
|
||||||
((uint64_t)data[offset + 0] << 56) + ((uint64_t)data[offset + 1] << 48) +
|
|
||||||
((uint64_t)data[offset + 2] << 40) + ((uint64_t)data[offset + 3] << 32) +
|
|
||||||
((uint64_t)data[offset + 4] << 24) + ((uint64_t)data[offset + 5] << 16) +
|
|
||||||
((uint64_t)data[offset + 6] << 8) + ((uint64_t)data[offset + 7]);
|
|
||||||
static_assert(sizeof(uint64_t) == sizeof(double), "expected 64-bit double");
|
|
||||||
// Checks if the float format on the platform the ZAPD binary is running on supports the
|
|
||||||
// same float format as the object file.
|
|
||||||
static_assert(std::numeric_limits<double>::is_iec559,
|
|
||||||
"expected IEC559 doubles on host machine");
|
|
||||||
std::memcpy(&value, &floatData, sizeof(value));
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#if __has_include(<filesystem>)
|
|
||||||
#include <filesystem>
|
|
||||||
namespace fs = std::filesystem;
|
|
||||||
#else
|
|
||||||
#include <experimental/filesystem>
|
|
||||||
namespace fs = std::experimental::filesystem;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "StringHelper.h"
|
|
||||||
|
|
||||||
#undef GetCurrentDirectory
|
|
||||||
#undef CreateDirectory
|
|
||||||
|
|
||||||
class Directory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
#ifndef PATH_HACK
|
|
||||||
static std::string GetCurrentDirectory() { return fs::current_path().u8string().c_str(); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static bool Exists(const fs::path& path) { return fs::exists(path); }
|
|
||||||
|
|
||||||
// Stupid hack because of Windows.h
|
|
||||||
static void MakeDirectory(const std::string& path)
|
|
||||||
{
|
|
||||||
CreateDirectory(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void CreateDirectory(const std::string& path)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
fs::create_directories(path);
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::vector<std::string> ListFiles(const std::string& dir)
|
|
||||||
{
|
|
||||||
std::vector<std::string> lst;
|
|
||||||
|
|
||||||
if (Exists(dir))
|
|
||||||
{
|
|
||||||
for (auto& p : fs::recursive_directory_iterator(dir))
|
|
||||||
{
|
|
||||||
if (!p.is_directory())
|
|
||||||
lst.push_back(p.path().generic_string());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return lst;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <cstdio>
|
|
||||||
#include <fstream>
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include "Path.h"
|
|
||||||
#include "Utils/StringHelper.h"
|
|
||||||
#include "Utils/Directory.h"
|
|
||||||
|
|
||||||
|
|
||||||
class File
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static bool Exists(const fs::path& filePath)
|
|
||||||
{
|
|
||||||
std::ifstream file(filePath, std::ios::in | std::ios::binary | std::ios::ate);
|
|
||||||
return file.good();
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::vector<uint8_t> ReadAllBytes(const fs::path& filePath)
|
|
||||||
{
|
|
||||||
std::ifstream file(filePath, std::ios::in | std::ios::binary | std::ios::ate);
|
|
||||||
|
|
||||||
if (!file)
|
|
||||||
return std::vector<uint8_t>();
|
|
||||||
|
|
||||||
int32_t fileSize = (int32_t)file.tellg();
|
|
||||||
file.seekg(0);
|
|
||||||
char* data = new char[fileSize];
|
|
||||||
file.read(data, fileSize);
|
|
||||||
std::vector<uint8_t> result = std::vector<uint8_t>(data, data + fileSize);
|
|
||||||
delete[] data;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
static std::string ReadAllText(const fs::path& filePath)
|
|
||||||
{
|
|
||||||
std::ifstream file(filePath, std::ios::in | std::ios::binary | std::ios::ate);
|
|
||||||
int32_t fileSize = (int32_t)file.tellg();
|
|
||||||
file.seekg(0);
|
|
||||||
char* data = new char[fileSize + 1];
|
|
||||||
memset(data, 0, fileSize + 1);
|
|
||||||
file.read(data, fileSize);
|
|
||||||
std::string str = std::string((const char*)data);
|
|
||||||
delete[] data;
|
|
||||||
|
|
||||||
return str;
|
|
||||||
};
|
|
||||||
|
|
||||||
static std::vector<std::string> ReadAllLines(const fs::path& filePath)
|
|
||||||
{
|
|
||||||
std::string text = ReadAllText(filePath);
|
|
||||||
std::vector<std::string> lines = StringHelper::Split(text, "\n");
|
|
||||||
|
|
||||||
return lines;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void WriteAllBytes(const fs::path& filePath, const std::vector<uint8_t>& data)
|
|
||||||
{
|
|
||||||
std::ofstream file(filePath, std::ios::binary);
|
|
||||||
file.write((char*)data.data(), data.size());
|
|
||||||
};
|
|
||||||
|
|
||||||
static void WriteAllBytes(const std::string& filePath, const std::vector<char>& data)
|
|
||||||
{
|
|
||||||
if (!Directory::Exists(Path::GetDirectoryName(filePath)))
|
|
||||||
Directory::MakeDirectory(Path::GetDirectoryName(filePath).string());
|
|
||||||
|
|
||||||
std::ofstream file(filePath, std::ios::binary);
|
|
||||||
file.write((char*)data.data(), data.size());
|
|
||||||
};
|
|
||||||
|
|
||||||
static void WriteAllBytes(const std::string& filePath, const char* data, int dataSize)
|
|
||||||
{
|
|
||||||
std::ofstream file(filePath, std::ios::binary);
|
|
||||||
file.write((char*)data, dataSize);
|
|
||||||
};
|
|
||||||
|
|
||||||
static void WriteAllText(const fs::path& filePath, const std::string& text)
|
|
||||||
{
|
|
||||||
std::ofstream file(filePath, std::ios::out);
|
|
||||||
file.write(text.c_str(), text.size());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
#include "MemoryStream.h"
|
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
#ifndef _MSC_VER
|
|
||||||
#define memcpy_s(dest, destSize, source, sourceSize) memcpy(dest, source, destSize)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
MemoryStream::MemoryStream()
|
|
||||||
{
|
|
||||||
buffer = std::vector<char>();
|
|
||||||
//buffer.reserve(1024 * 16);
|
|
||||||
bufferSize = 0;
|
|
||||||
baseAddress = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
MemoryStream::MemoryStream(char* nBuffer, size_t nBufferSize) : MemoryStream()
|
|
||||||
{
|
|
||||||
buffer = std::vector<char>(nBuffer, nBuffer + nBufferSize);
|
|
||||||
bufferSize = nBufferSize;
|
|
||||||
baseAddress = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
MemoryStream::~MemoryStream()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64_t MemoryStream::GetLength()
|
|
||||||
{
|
|
||||||
return buffer.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MemoryStream::Seek(int32_t offset, SeekOffsetType seekType)
|
|
||||||
{
|
|
||||||
if (seekType == SeekOffsetType::Start)
|
|
||||||
baseAddress = offset;
|
|
||||||
else if (seekType == SeekOffsetType::Current)
|
|
||||||
baseAddress += offset;
|
|
||||||
else if (seekType == SeekOffsetType::End)
|
|
||||||
baseAddress = bufferSize - 1 - offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::unique_ptr<char[]> MemoryStream::Read(size_t length)
|
|
||||||
{
|
|
||||||
std::unique_ptr<char[]> result = std::make_unique<char[]>(length);
|
|
||||||
|
|
||||||
memcpy_s(result.get(), length, &buffer[baseAddress], length);
|
|
||||||
baseAddress += length;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MemoryStream::Read(const char* dest, size_t length)
|
|
||||||
{
|
|
||||||
memcpy_s((void*)dest, length, &buffer[baseAddress], length);
|
|
||||||
baseAddress += length;
|
|
||||||
}
|
|
||||||
|
|
||||||
int8_t MemoryStream::ReadByte()
|
|
||||||
{
|
|
||||||
return buffer[baseAddress++];
|
|
||||||
}
|
|
||||||
|
|
||||||
void MemoryStream::Write(char* srcBuffer, size_t length)
|
|
||||||
{
|
|
||||||
if (baseAddress + length >= buffer.size())
|
|
||||||
{
|
|
||||||
buffer.resize(baseAddress + length);
|
|
||||||
bufferSize += length;
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy_s(&buffer[baseAddress], length, srcBuffer, length);
|
|
||||||
baseAddress += length;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MemoryStream::WriteByte(int8_t value)
|
|
||||||
{
|
|
||||||
if (baseAddress >= buffer.size())
|
|
||||||
{
|
|
||||||
buffer.resize(baseAddress + 1);
|
|
||||||
bufferSize = baseAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
buffer[baseAddress++] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<char> MemoryStream::ToVector()
|
|
||||||
{
|
|
||||||
return buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MemoryStream::Flush()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void MemoryStream::Close()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <vector>
|
|
||||||
#include "Stream.h"
|
|
||||||
|
|
||||||
class MemoryStream : public Stream
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
MemoryStream();
|
|
||||||
MemoryStream(char* nBuffer, size_t nBufferSize);
|
|
||||||
~MemoryStream();
|
|
||||||
|
|
||||||
uint64_t GetLength() override;
|
|
||||||
|
|
||||||
void Seek(int32_t offset, SeekOffsetType seekType) override;
|
|
||||||
|
|
||||||
std::unique_ptr<char[]> Read(size_t length) override;
|
|
||||||
void Read(const char* dest, size_t length) override;
|
|
||||||
int8_t ReadByte() override;
|
|
||||||
|
|
||||||
void Write(char* srcBuffer, size_t length) override;
|
|
||||||
void WriteByte(int8_t value) override;
|
|
||||||
|
|
||||||
std::vector<char> ToVector();
|
|
||||||
|
|
||||||
void Flush() override;
|
|
||||||
void Close() override;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
std::vector<char> buffer;
|
|
||||||
std::size_t bufferSize;
|
|
||||||
};
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
#include "Utils/StringHelper.h"
|
|
||||||
|
|
||||||
#if __has_include(<filesystem>)
|
|
||||||
#include <filesystem>
|
|
||||||
namespace fs = std::filesystem;
|
|
||||||
#else
|
|
||||||
#include <experimental/filesystem>
|
|
||||||
namespace fs = std::experimental::filesystem;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class Path
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static std::string GetFileName(const fs::path& input)
|
|
||||||
{
|
|
||||||
// https://en.cppreference.com/w/cpp/filesystem/path/filename
|
|
||||||
return input.filename().string();
|
|
||||||
};
|
|
||||||
|
|
||||||
static std::string GetFileNameWithoutExtension(const fs::path& input)
|
|
||||||
{
|
|
||||||
// https://en.cppreference.com/w/cpp/filesystem/path/stem
|
|
||||||
return input.stem().string();
|
|
||||||
};
|
|
||||||
|
|
||||||
static std::string GetFileNameExtension(const std::string& input)
|
|
||||||
{
|
|
||||||
return input.substr(input.find_last_of("."), input.length());
|
|
||||||
};
|
|
||||||
|
|
||||||
static fs::path GetPath(const std::string& input)
|
|
||||||
{
|
|
||||||
std::vector<std::string> split = StringHelper::Split(input, "/");
|
|
||||||
fs::path output;
|
|
||||||
|
|
||||||
for (std::string str : split)
|
|
||||||
{
|
|
||||||
if (str.find_last_of(".") == std::string::npos)
|
|
||||||
output /= str;
|
|
||||||
}
|
|
||||||
|
|
||||||
return output;
|
|
||||||
};
|
|
||||||
|
|
||||||
static fs::path GetDirectoryName(const fs::path& path) { return path.parent_path(); };
|
|
||||||
};
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
enum class SeekOffsetType
|
|
||||||
{
|
|
||||||
Start,
|
|
||||||
Current,
|
|
||||||
End
|
|
||||||
};
|
|
||||||
|
|
||||||
// TODO: Eventually account for endianess in binaryreader and binarywriter
|
|
||||||
enum class Endianess
|
|
||||||
{
|
|
||||||
Little = 0,
|
|
||||||
Big = 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
class Stream
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~Stream() = default;
|
|
||||||
virtual uint64_t GetLength() = 0;
|
|
||||||
uint64_t GetBaseAddress() { return baseAddress; }
|
|
||||||
|
|
||||||
virtual void Seek(int32_t offset, SeekOffsetType seekType) = 0;
|
|
||||||
|
|
||||||
virtual std::unique_ptr<char[]> Read(size_t length) = 0;
|
|
||||||
virtual void Read(const char* dest, size_t length) = 0;
|
|
||||||
virtual int8_t ReadByte() = 0;
|
|
||||||
|
|
||||||
virtual void Write(char* destBuffer, size_t length) = 0;
|
|
||||||
virtual void WriteByte(int8_t value) = 0;
|
|
||||||
|
|
||||||
virtual void Flush() = 0;
|
|
||||||
virtual void Close() = 0;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
uint64_t baseAddress;
|
|
||||||
};
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
#include "StringHelper.h"
|
|
||||||
|
|
||||||
#pragma optimize("2", on)
|
|
||||||
#define _CRT_SECURE_NO_WARNINGS
|
|
||||||
|
|
||||||
#ifndef _MSC_VER
|
|
||||||
#define vsprintf_s vsprintf
|
|
||||||
#endif
|
|
||||||
|
|
||||||
std::vector<std::string> StringHelper::Split(std::string s, const std::string& delimiter)
|
|
||||||
{
|
|
||||||
std::vector<std::string> result;
|
|
||||||
|
|
||||||
size_t pos = 0;
|
|
||||||
std::string token;
|
|
||||||
|
|
||||||
while ((pos = s.find(delimiter)) != std::string::npos)
|
|
||||||
{
|
|
||||||
token = s.substr(0, pos);
|
|
||||||
result.push_back(token);
|
|
||||||
s.erase(0, pos + delimiter.length());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (s.length() != 0)
|
|
||||||
result.push_back(s);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string StringHelper::Strip(std::string s, const std::string& delimiter)
|
|
||||||
{
|
|
||||||
size_t pos = 0;
|
|
||||||
std::string token;
|
|
||||||
|
|
||||||
while ((pos = s.find(delimiter)) != std::string::npos)
|
|
||||||
{
|
|
||||||
token = s.substr(0, pos);
|
|
||||||
s.erase(pos, pos + delimiter.length());
|
|
||||||
}
|
|
||||||
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string StringHelper::Replace(std::string str, const std::string& from,
|
|
||||||
const std::string& to)
|
|
||||||
{
|
|
||||||
size_t start_pos = str.find(from);
|
|
||||||
|
|
||||||
while (start_pos != std::string::npos)
|
|
||||||
{
|
|
||||||
str.replace(start_pos, from.length(), to);
|
|
||||||
start_pos = str.find(from);
|
|
||||||
}
|
|
||||||
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
void StringHelper::ReplaceOriginal(std::string& str, const std::string& from, const std::string& to)
|
|
||||||
{
|
|
||||||
size_t start_pos = str.find(from);
|
|
||||||
|
|
||||||
while (start_pos != std::string::npos)
|
|
||||||
{
|
|
||||||
str.replace(start_pos, from.length(), to);
|
|
||||||
start_pos = str.find(from);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool StringHelper::StartsWith(const std::string& s, const std::string& input)
|
|
||||||
{
|
|
||||||
return s.rfind(input, 0) == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool StringHelper::Contains(const std::string& s, const std::string& input)
|
|
||||||
{
|
|
||||||
return s.find(input) != std::string::npos;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool StringHelper::EndsWith(const std::string& s, const std::string& input)
|
|
||||||
{
|
|
||||||
size_t inputLen = strlen(input.c_str());
|
|
||||||
return s.rfind(input) == (s.size() - inputLen);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string StringHelper::Sprintf(const char* format, ...)
|
|
||||||
{
|
|
||||||
char buffer[32768];
|
|
||||||
// char buffer[2048];
|
|
||||||
std::string output;
|
|
||||||
va_list va;
|
|
||||||
|
|
||||||
va_start(va, format);
|
|
||||||
vsprintf_s(buffer, format, va);
|
|
||||||
va_end(va);
|
|
||||||
|
|
||||||
output = buffer;
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string StringHelper::Implode(std::vector<std::string>& elements,
|
|
||||||
const char* const separator)
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
|
|
||||||
// return std::accumulate(std::begin(elements), std::end(elements), std::string(),
|
|
||||||
//[separator](std::string& ss, std::string& s) {
|
|
||||||
// return ss.empty() ? s : ss + separator + s;
|
|
||||||
//});
|
|
||||||
}
|
|
||||||
|
|
||||||
int64_t StringHelper::StrToL(const std::string& str, int32_t base)
|
|
||||||
{
|
|
||||||
return std::strtoull(str.c_str(), nullptr, base);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string StringHelper::BoolStr(bool b)
|
|
||||||
{
|
|
||||||
return b ? "true" : "false";
|
|
||||||
}
|
|
||||||
|
|
||||||
bool StringHelper::HasOnlyDigits(const std::string& str)
|
|
||||||
{
|
|
||||||
return std::all_of(str.begin(), str.end(), ::isdigit);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool StringHelper::IEquals(const std::string& a, const std::string& b)
|
|
||||||
{
|
|
||||||
return std::equal(a.begin(), a.end(), b.begin(), b.end(),
|
|
||||||
[](char a, char b) { return tolower(a) == tolower(b); });
|
|
||||||
}
|
|
||||||