Compare commits
605 Commits
feature/ne
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91a79f78cc | ||
|
|
8d5e5812ec | ||
|
|
622323117a | ||
|
|
2fdbe74a4a | ||
|
|
13af32ed2d | ||
|
|
dd00cee809 | ||
|
|
34cafac121 | ||
|
|
4bf4c12159 | ||
|
|
754c563515 | ||
|
|
ea1a829957 | ||
|
|
ccb956a834 | ||
|
|
ba83aa5247 | ||
|
|
324e84eafc | ||
|
|
e290f2aca9 | ||
|
|
b13001ac90 | ||
|
|
1e24a2cc81 | ||
|
|
631dbdfa53 | ||
|
|
fbf295f2a8 | ||
|
|
00c84fd622 | ||
|
|
a8cee21ae8 | ||
|
|
48d7c3e692 | ||
|
|
c7291b567f | ||
|
|
ecb0e528c2 | ||
|
|
2de65b22ec | ||
|
|
a01d07ce41 | ||
|
|
348bf2a299 | ||
|
|
37c81d78ce | ||
|
|
33052d2e11 | ||
|
|
4603ebd7cf | ||
|
|
00f0a8a828 | ||
|
|
367e4e012e | ||
|
|
3bf4e8b0e5 | ||
|
|
39a5a75333 | ||
|
|
20f4dcd798 | ||
|
|
8398156122 | ||
|
|
8136ba1d34 | ||
|
|
2c18b939e7 | ||
|
|
01d2b95417 | ||
|
|
8cfb82e03d | ||
|
|
2d8d34bab8 | ||
|
|
6e772cb6b7 | ||
|
|
32ce8e350f | ||
|
|
73ab1a368a | ||
|
|
d9aa25c4af | ||
|
|
d18cfb6968 | ||
|
|
924e448270 | ||
|
|
4dc402fd16 | ||
|
|
8b802028e9 | ||
|
|
f6a20c873a | ||
|
|
4e4422466c | ||
|
|
3bf032d2e0 | ||
|
|
3d378b28c9 | ||
|
|
1f7ca563bf | ||
|
|
f6a0ff580c | ||
|
|
b9e858a6d5 | ||
|
|
f88eeec7ee | ||
|
|
9c6c55fe75 | ||
|
|
e6f2932ef1 | ||
|
|
8c1f9539c7 | ||
|
|
21379d133d | ||
|
|
6e58c8fc2f | ||
|
|
10db1eec7d | ||
|
|
d267ad19f5 | ||
|
|
99d2885f9c | ||
|
|
0545bfe642 | ||
|
|
7e408d2c2e | ||
|
|
512b9bae61 | ||
|
|
0f10bf9375 | ||
|
|
63468fa91e | ||
|
|
d9f6e13bdf | ||
|
|
e512636ad6 | ||
|
|
f2769e689f | ||
|
|
9898a03417 | ||
|
|
7174f1fe22 | ||
|
|
4480eb83d7 | ||
|
|
5ee673175c | ||
|
|
86885f999c | ||
|
|
2e4e0a6b99 | ||
|
|
338b50c694 | ||
|
|
20b57db193 | ||
|
|
7b61cff46d | ||
|
|
25728f9486 | ||
|
|
8e215f13af | ||
|
|
a71607aae3 | ||
|
|
2ae9bf95a4 | ||
|
|
08cf71cb02 | ||
|
|
8f3fa82f64 | ||
|
|
e40bee38af | ||
|
|
2799108c7d | ||
|
|
e1be487b6b | ||
|
|
383d6e2439 | ||
|
|
3452b73eb0 | ||
|
|
9dc45d3024 | ||
|
|
dc0a8a1e3d | ||
|
|
cf2102e182 | ||
|
|
6db6760a0a | ||
|
|
cdd0142759 | ||
|
|
4fbf77e661 | ||
|
|
8d31623138 | ||
|
|
acd14a2179 | ||
|
|
f09124f611 | ||
|
|
ead2e4eaf7 | ||
|
|
63ccc50de3 | ||
|
|
a753c24d9d | ||
|
|
d4bf2e0796 | ||
|
|
2472cd5d1b | ||
|
|
7bfe92eb9c | ||
|
|
990d413673 | ||
|
|
b4f677f81b | ||
|
|
59dfc3f05e | ||
|
|
3d409fc1d4 | ||
|
|
ab437b460f | ||
|
|
ff46687106 | ||
|
|
d7f099dc05 | ||
|
|
415156256a | ||
|
|
c799f53687 | ||
|
|
15ff5e65b1 | ||
|
|
a3769f0bad | ||
|
|
8a668620de | ||
|
|
935634c9e2 | ||
|
|
d13e227eb9 | ||
|
|
b977dbd183 | ||
|
|
15399a2969 | ||
|
|
bc3cc77a0a | ||
|
|
dcd6d9bf7b | ||
|
|
ddcb00676a | ||
|
|
73f9207839 | ||
|
|
bccbca87fa | ||
|
|
a24fec5558 | ||
|
|
c26ba7dcab | ||
|
|
cadcd2d53c | ||
|
|
7eca939c06 | ||
|
|
975567cdd4 | ||
|
|
2df2d491ae | ||
|
|
9b4852f393 | ||
|
|
f3d0abb65e | ||
|
|
9a5ae3bf51 | ||
|
|
d11783ebfc | ||
|
|
f5eebe6743 | ||
|
|
b8c7bdb1ba | ||
|
|
87bbe47e7e | ||
|
|
1ff6475fdb | ||
|
|
2f044a8d94 | ||
|
|
a1a54665d9 | ||
|
|
6e73c2d50c | ||
|
|
53f690c554 | ||
|
|
eebd333e11 | ||
|
|
3b65f1bdf2 | ||
|
|
a9444c05bf | ||
|
|
9a957138b5 | ||
|
|
a94e3bd012 | ||
|
|
b80cfab4fb | ||
|
|
da6233c10d | ||
|
|
43e925ae23 | ||
|
|
cd7c65ef4a | ||
|
|
fd7f466578 | ||
|
|
3a84ccd30f | ||
|
|
7fdd451cd1 | ||
|
|
59d5b12e80 | ||
|
|
d81513a95f | ||
|
|
23d577336f | ||
|
|
b9646c1140 | ||
|
|
7d103dfcea | ||
|
|
df1bad5380 | ||
|
|
6a41e543ee | ||
|
|
06e94e9648 | ||
|
|
096da843d1 | ||
|
|
ba6da187f3 | ||
|
|
11cc55dd71 | ||
|
|
e82dbce63c | ||
|
|
4677ab9637 | ||
|
|
b77e6e8077 | ||
|
|
3416060d4b | ||
|
|
ce7ed928c4 | ||
|
|
b7c7eff1b5 | ||
|
|
64b5471ea4 | ||
|
|
ef2d880039 | ||
|
|
a577d329ec | ||
|
|
80fc72e8b0 | ||
|
|
0a3fbfe39a | ||
|
|
4f430055f3 | ||
|
|
67832954e4 | ||
|
|
333de659ed | ||
|
|
0374410315 | ||
|
|
296a25d26f | ||
|
|
0e141ae95c | ||
|
|
fc1c89c710 | ||
|
|
422ceb9a25 | ||
|
|
14a494cc24 | ||
|
|
0da6a4aee7 | ||
|
|
00618f8081 | ||
|
|
d525f9bee3 | ||
|
|
ab7d2bb3b8 | ||
|
|
e2f35a0314 | ||
|
|
e4c409ab19 | ||
|
|
48c28e046d | ||
|
|
0f45fb5788 | ||
|
|
8d4303b166 | ||
|
|
857a55f133 | ||
|
|
b513834076 | ||
|
|
2131034ad9 | ||
|
|
4a53b0ff74 | ||
|
|
f7ff77b11d | ||
|
|
e06fe64311 | ||
|
|
e416d47df4 | ||
|
|
51a0d00b93 | ||
|
|
ae16506d87 | ||
|
|
75c128534e | ||
|
|
e0b7ff743c | ||
|
|
84314df7cb | ||
|
|
1545a92c27 | ||
|
|
b62c548193 | ||
|
|
d92098571e | ||
|
|
1eb340aaea | ||
|
|
6211ea3c77 | ||
|
|
3d91f1f3f4 | ||
| 365aac8cfa | |||
|
|
abd1a6a051 | ||
| b80a11093a | |||
|
|
d129c7ba62 | ||
|
|
46606f529d | ||
|
|
034234a134 | ||
|
|
c197edaee6 | ||
|
|
32991d0273 | ||
|
|
c4826bf1f3 | ||
|
|
1afbe28cc9 | ||
|
|
d28aba759f | ||
|
|
80c0fb2f23 | ||
|
|
99c2b0ab3b | ||
|
|
9f46d1ea9c | ||
|
|
d4c36cab72 | ||
|
|
5ec26d101c | ||
|
|
c5732b0899 | ||
|
|
fb442b39fa | ||
|
|
afb0430f30 | ||
|
|
7bb6d0ab89 | ||
|
|
9d85b77ef0 | ||
|
|
2b55752eb3 | ||
|
|
c45df3444c | ||
|
|
cc30cda7cc | ||
|
|
de0ee2e438 | ||
|
|
1000b0cafa | ||
|
|
9a10f4a9e7 | ||
|
|
6cb52df017 | ||
|
|
e1f8897150 | ||
|
|
aa8a6d18ae | ||
|
|
d70b54480d | ||
|
|
d2eb7b9795 | ||
|
|
e7aca45a9f | ||
|
|
7752d3ada5 | ||
|
|
4cfd3da983 | ||
|
|
1ea1ae3199 | ||
|
|
2b29b121e0 | ||
|
|
5c9868c435 | ||
|
|
6c0a111c09 | ||
|
|
4cbf8ca553 | ||
|
|
5aefd3e4e1 | ||
|
|
8bb5287605 | ||
|
|
0c2478cc70 | ||
|
|
06cda8303d | ||
|
|
3c45b639cb | ||
|
|
aa77115da8 | ||
|
|
5c42895bb2 | ||
|
|
67668ccc27 | ||
|
|
cdf01bb966 | ||
|
|
178665610c | ||
|
|
13a7b65f6d | ||
|
|
26ba52bcd2 | ||
|
|
9e4d14f686 | ||
|
|
5ecabfee07 | ||
|
|
caa9fe276e | ||
|
|
80f1a65a71 | ||
|
|
2adf0cc1e8 | ||
|
|
1ca6766402 | ||
|
|
08b6e1d6d9 | ||
|
|
efd06290d8 | ||
|
|
2f4bc7bb05 | ||
|
|
147e4bb079 | ||
|
|
749084539e | ||
|
|
87add0fa93 | ||
|
|
98039b533f | ||
|
|
1d2d68ed54 | ||
|
|
18c9457948 | ||
|
|
bb3683d8fb | ||
|
|
6dd8a4a24c | ||
|
|
a2acf1dd90 | ||
|
|
b34959ba1d | ||
|
|
2b40623f83 | ||
|
|
faa73b7697 | ||
|
|
d40b2326f7 | ||
|
|
57c6c18d8b | ||
|
|
f4b2aaf84e | ||
|
|
f253b75a45 | ||
|
|
b15886e089 | ||
|
|
e78778e82c | ||
|
|
d957774436 | ||
|
|
1722cbf067 | ||
|
|
c394b38c76 | ||
|
|
baafe8b4e5 | ||
|
|
78247fafab | ||
|
|
f7055fbc10 | ||
|
|
54a46e8a3e | ||
|
|
3ffcec4a71 | ||
|
|
3af6532904 | ||
|
|
f879005e76 | ||
|
|
af3f28752a | ||
|
|
240a643111 | ||
|
|
bf951db63c | ||
|
|
54b54a2367 | ||
|
|
5a9855a9f6 | ||
|
|
3e3553b2ce | ||
|
|
e90788e232 | ||
|
|
c7ed43cf8d | ||
|
|
a8ca882e07 | ||
|
|
0e48faf7a3 | ||
|
|
51e12e9683 | ||
|
|
0ec4548a6b | ||
|
|
c72d51ad1e | ||
|
|
1747f8f8be | ||
|
|
6fbd17291a | ||
|
|
e1ec4b8878 | ||
|
|
1d08ae6af6 | ||
|
|
c596b3a828 | ||
|
|
846c689088 | ||
|
|
84dc8358a7 | ||
|
|
86092b18a2 | ||
|
|
c968117ed1 | ||
|
|
ef884f4be7 | ||
|
|
5bf97fcf1a | ||
|
|
c0967ce23e | ||
|
|
de0e4c5aae | ||
|
|
01094b8d9e | ||
|
|
7af197ad80 | ||
|
|
136a49801e | ||
|
|
d603742172 | ||
|
|
cdf8ac1ffc | ||
|
|
8d5c2c7ea1 | ||
|
|
d075ad4c24 | ||
|
|
4e1c18fff2 | ||
|
|
a2e9683ba3 | ||
|
|
f7444171e3 | ||
|
|
fdea13bf84 | ||
|
|
a06df405fc | ||
|
|
70515d28d4 | ||
|
|
37c25d3baf | ||
|
|
75802ffa8e | ||
|
|
5a35d4f4d8 | ||
|
|
9958f33b60 | ||
|
|
c1e9b308a1 | ||
|
|
6ef4fe82da | ||
|
|
8f287ceeec | ||
|
|
12b4a77f1f | ||
|
|
38dd74b188 | ||
|
|
e3db1e11cc | ||
|
|
0d9d2fccfb | ||
|
|
c84463e3c2 | ||
|
|
619cfad47c | ||
|
|
17408d5d4e | ||
|
|
04daaeaf7f | ||
|
|
92456f1da6 | ||
|
|
38909a69a6 | ||
|
|
26a1629dee | ||
|
|
cc5c1854e2 | ||
|
|
fccad08fb0 | ||
|
|
0d156994b4 | ||
|
|
dd1eb94beb | ||
|
|
b53f169a4f | ||
|
|
ce9bcefb88 | ||
|
|
ab60c56e88 | ||
|
|
32e4815cbe | ||
|
|
a8ee358150 | ||
|
|
302350fe2c | ||
|
|
2f323046d3 | ||
|
|
3dad8bfb5c | ||
|
|
f8624c8997 | ||
|
|
9d8e214ae3 | ||
|
|
15bbbec1db | ||
|
|
00a3dfb958 | ||
|
|
12c9e79bf2 | ||
|
|
39cd33efd4 | ||
|
|
ce5c98b78d | ||
|
|
053c440415 | ||
|
|
d477865e9a | ||
|
|
a7e0859b8d | ||
|
|
ed593d3ae1 | ||
|
|
d973d2bee5 | ||
|
|
90c3d3bef3 | ||
|
|
d583b9ce08 | ||
|
|
46792b3dc6 | ||
|
|
1739a4686e | ||
|
|
28257af738 | ||
|
|
50fb3d2557 | ||
|
|
3f0d4641b1 | ||
|
|
b2fcdd1762 | ||
|
|
99706b868b | ||
|
|
dfe3311323 | ||
|
|
6a04ed7431 | ||
|
|
32ab5c7451 | ||
|
|
b6403208f1 | ||
|
|
fcaa1eacaf | ||
|
|
97c4fbddde | ||
|
|
ed9e7ee558 | ||
|
|
618c304a87 | ||
|
|
cc311c2a1a | ||
|
|
fda7f55231 | ||
|
|
fe5724ef82 | ||
|
|
1a0ba48b51 | ||
|
|
713d55b4eb | ||
|
|
59d6d6907a | ||
|
|
020178f780 | ||
|
|
a2242fe018 | ||
|
|
ef6d1007e6 | ||
|
|
9971facf90 | ||
|
|
3a0070612a | ||
|
|
8f415d4fe6 | ||
|
|
f438e6c063 | ||
|
|
1e086cf00a | ||
|
|
d166e3329a | ||
|
|
4db49c0896 | ||
|
|
12806268d4 | ||
|
|
39d37640cc | ||
|
|
d771df9b09 | ||
|
|
44af7bf03c | ||
|
|
07e473bad0 | ||
|
|
19d417e84b | ||
|
|
c898f62d69 | ||
|
|
d69f6eef40 | ||
|
|
affd9fe889 | ||
|
|
90ebbd86ee | ||
|
|
50a1aa3bbc | ||
|
|
270dacf1e5 | ||
|
|
4a4df3c2a4 | ||
|
|
4d7598e805 | ||
|
|
94d407ffb7 | ||
|
|
3291e52cc6 | ||
|
|
f576af8f11 | ||
|
|
eee7231737 | ||
|
|
e7455256a7 | ||
|
|
2a026947c4 | ||
|
|
12795451e6 | ||
|
|
c9802401fb | ||
|
|
5a12e3c967 | ||
|
|
a02e3714d0 | ||
|
|
84f99dc919 | ||
|
|
163f46b4cf | ||
|
|
7b1d269986 | ||
|
|
386d0793aa | ||
|
|
dc3360a97d | ||
|
|
6ab9a9b350 | ||
|
|
e3f971f62c | ||
|
|
3a718acb50 | ||
|
|
2e09f532b9 | ||
|
|
c39185e35c | ||
|
|
eee271278a | ||
|
|
e7077aae63 | ||
|
|
78a6efd02f | ||
|
|
73b3cc9e75 | ||
|
|
ef6f75c8a8 | ||
|
|
3bed978b89 | ||
|
|
dcab86b1ed | ||
|
|
7cf9ac8d4c | ||
|
|
e63cf8554e | ||
|
|
d7e4dfda41 | ||
|
|
9c92fcd854 | ||
|
|
7768c5f7f5 | ||
|
|
58e87e8787 | ||
|
|
b176bc3d00 | ||
|
|
3c13462618 | ||
|
|
68a41d4582 | ||
|
|
60e93e0ab3 | ||
|
|
9fb5c62b75 | ||
|
|
352e51170d | ||
|
|
fc64762bfe | ||
|
|
fe34c63697 | ||
|
|
02d96741e8 | ||
|
|
d8b27a31d2 | ||
|
|
4fcd3a4c60 | ||
|
|
fd1868ed46 | ||
|
|
7250e1f460 | ||
|
|
1e0a490a69 | ||
|
|
bfedb389b8 | ||
|
|
0a2fdd0b74 | ||
|
|
a2959f9b29 | ||
|
|
cd99390ba7 | ||
|
|
388e2dfc52 | ||
|
|
47e09afa73 | ||
|
|
cdef686ec4 | ||
|
|
be21cf40cb | ||
|
|
4eb817375c | ||
|
|
5a623c18d0 | ||
|
|
63ca1074fc | ||
|
|
9a70b774ab | ||
|
|
ea385c2853 | ||
|
|
f9604bc858 | ||
|
|
65a37363e6 | ||
|
|
2879a89594 | ||
|
|
6bc88394cd | ||
|
|
f17d56c603 | ||
|
|
2253db1abb | ||
|
|
c362953775 | ||
|
|
6ea2989d69 | ||
|
|
ea90db4fe6 | ||
|
|
2b1a18be6a | ||
|
|
40ad7470aa | ||
|
|
89d1d0944a | ||
|
|
73e13263fc | ||
|
|
60ddd31101 | ||
|
|
ee4a680d6d | ||
|
|
2f61367fcb | ||
|
|
c7b1c97d68 | ||
|
|
ed30f6b861 | ||
|
|
5ea8c5f09a | ||
|
|
d1cf5ecc52 | ||
|
|
a85abf0ecd | ||
|
|
caca3dd489 | ||
|
|
39853c77fe | ||
|
|
f149b66322 | ||
|
|
0ea4a7ad6f | ||
|
|
729a6bac7c | ||
|
|
be8aa3691e | ||
|
|
cfa0638b94 | ||
|
|
ff1a25b41f | ||
|
|
a0cfb65b56 | ||
|
|
77428c0515 | ||
|
|
34d6ae6658 | ||
|
|
f339360fbc | ||
|
|
f23c38cc3c | ||
|
|
fdf1559f09 | ||
|
|
556e33d56f | ||
|
|
c980d53543 | ||
|
|
c8cfc1c5fc | ||
|
|
a7904ca74e | ||
|
|
6cc3d71acf | ||
|
|
23827f4ffa | ||
|
|
67050e6a67 | ||
|
|
0943608bd8 | ||
|
|
f1aa61bf3b | ||
|
|
691a16e9ad | ||
|
|
0a3a307d39 | ||
| 6632149f42 | |||
|
|
2eaaa87b72 | ||
|
|
c005d19fa8 | ||
|
|
b5595d9855 | ||
|
|
aef7c2657d | ||
|
|
ecd897b4ac | ||
|
|
2eb0ee39fb | ||
|
|
130814d206 | ||
|
|
0576fb5bd4 | ||
|
|
298d5e9848 | ||
|
|
3ac572edeb | ||
|
|
ac33cd4524 | ||
|
|
ea39199201 | ||
|
|
b204858a90 | ||
|
|
f3427e77ba | ||
|
|
7b0fe25650 | ||
|
|
af82d9a78a | ||
|
|
3e311e5aec | ||
|
|
95349eaa5b | ||
|
|
22062c2a6e | ||
|
|
72846f4733 | ||
|
|
c056b45184 | ||
|
|
9dd0bd9897 | ||
|
|
4dd68a06e8 | ||
|
|
db9165295f | ||
|
|
8fe0e02e64 | ||
|
|
20964df102 | ||
|
|
2495fbfdef | ||
|
|
6e7a83d473 | ||
|
|
87cbdeeefc | ||
|
|
a90f1017f7 | ||
|
|
588d03ad8f | ||
|
|
b58561eb78 | ||
|
|
8e71f570c4 | ||
|
|
167d465033 | ||
|
|
9106dc7646 | ||
|
|
a94bb60ca9 | ||
|
|
2f24c704ba | ||
|
|
0ce21bac73 | ||
|
|
0df96fe804 | ||
|
|
80f7a73573 | ||
|
|
c649ee2b40 | ||
|
|
fc9e5d8b5b | ||
|
|
dee231c700 | ||
|
|
0548e383ce | ||
|
|
34d97c3c65 | ||
|
|
070854b888 | ||
|
|
3b09306868 | ||
|
|
05e803c620 | ||
|
|
55ea909322 | ||
|
|
7cda2e1354 | ||
|
|
f45f38738d | ||
|
|
9ed104eb7c | ||
|
|
9407f1d23e | ||
|
|
15866b4f53 | ||
|
|
473165e4ad | ||
|
|
288af4b64c | ||
|
|
bbce4fbd08 | ||
|
|
f08da5b670 | ||
|
|
45b0426757 | ||
|
|
67f3e21779 | ||
|
|
14f6a481f5 | ||
|
|
c165a537a0 | ||
|
|
2854479b97 | ||
|
|
885cf48ce4 | ||
|
|
417aec53df |
21
.gitignore
vendored
@ -1,4 +1,25 @@
|
||||
/build/
|
||||
/data/dlls/
|
||||
/data/fastfiles/
|
||||
/releases/
|
||||
|
||||
.vscode/*
|
||||
.qmake.stash
|
||||
|
||||
# Ignore Qt Creator user files
|
||||
*.pro.user
|
||||
*.pro.user.*
|
||||
*.qbs.user
|
||||
*.qbs.user.*
|
||||
*.creator.user
|
||||
*.creator.user.*
|
||||
*.creator.*
|
||||
*.ps1
|
||||
version.txt
|
||||
*.autosave
|
||||
*.XMODEL_EXPORT
|
||||
data/obj/*
|
||||
libs/*/release/*
|
||||
libs/*/debug/*
|
||||
.git.stash
|
||||
*Makefile*
|
||||
|
||||
@ -2,5 +2,9 @@ TEMPLATE = subdirs
|
||||
|
||||
SUBDIRS += libs \
|
||||
app \
|
||||
tools \
|
||||
tests
|
||||
#tools \
|
||||
#tests
|
||||
|
||||
#tests.depends = libs
|
||||
app.depends = libs
|
||||
#tools.depends = libs
|
||||
|
||||
@ -1,625 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 15.0.0, 2025-04-04T21:57:41. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
<value type="QByteArray">{40d992cb-ac11-4385-a22b-016f1b4251a7}</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
<value type="qlonglong">0</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||
<value type="QString" key="language">Cpp</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||
<value type="QString" key="language">QmlJS</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.LineEndingBehavior">0</value>
|
||||
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||
<value type="int" key="EditorConfiguration.PreferAfterWhitespaceComments">0</value>
|
||||
<value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value>
|
||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">2</value>
|
||||
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||
<value type="bool" key="EditorConfiguration.UseIndenter">false</value>
|
||||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||
<value type="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
|
||||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||
<value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
|
||||
<value type="bool" key="EditorConfiguration.tintMarginArea">true</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
|
||||
<value type="bool" key="AutoTest.Framework.Boost">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.CTest">false</value>
|
||||
<value type="bool" key="AutoTest.Framework.Catch">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.GTest">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.QtTest">true</value>
|
||||
</valuemap>
|
||||
<value type="bool" key="AutoTest.ApplyFilter">false</value>
|
||||
<valuemap type="QVariantMap" key="AutoTest.CheckStates">
|
||||
<value type="Qt::CheckState" key="1@G:/Projects/Qt/XPlor/tests/autotest_cod.h:AutoTest_COD">Unchecked</value>
|
||||
</valuemap>
|
||||
<valuelist type="QVariantList" key="AutoTest.PathFilters"/>
|
||||
<value type="int" key="AutoTest.RunAfterBuild">0</value>
|
||||
<value type="bool" key="AutoTest.UseGlobal">true</value>
|
||||
<valuemap type="QVariantMap" key="ClangTools">
|
||||
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
|
||||
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
|
||||
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
|
||||
<value type="int" key="ClangTools.ParallelJobs">16</value>
|
||||
<value type="bool" key="ClangTools.PreferConfigFile">true</value>
|
||||
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
|
||||
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
|
||||
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
|
||||
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="CppEditor.QuickFix">
|
||||
<value type="bool" key="UseGlobalSettings">true</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="DeviceType">Desktop</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.8.2 MSVC2022 64bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.8.2 MSVC2022 64bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.682.win64_msvc2022_64_kit</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<value type="int" key="EnableQmlDebugging">0</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">G:\Projects\Qt\XPlor\build\Desktop_Qt_6_8_2_MSVC2022_64bit-Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">G:/Projects/Qt/XPlor/build/Desktop_Qt_6_8_2_MSVC2022_64bit-Debug</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">G:\Projects\Qt\XPlor\build\Desktop_Qt_6_8_2_MSVC2022_64bit-Release</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">G:/Projects/Qt/XPlor/build/Desktop_Qt_6_8_2_MSVC2022_64bit-Release</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||
<value type="int" key="QtQuickCompiler">0</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
||||
<value type="int" key="EnableQmlDebugging">0</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">G:\Projects\Qt\XPlor\build\Desktop_Qt_6_8_2_MSVC2022_64bit-Profile</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">G:/Projects/Qt/XPlor/build/Desktop_Qt_6_8_2_MSVC2022_64bit-Profile</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||
<value type="int" key="QtQuickCompiler">0</value>
|
||||
<value type="int" key="SeparateDebugInfo">0</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
|
||||
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<value type="int" key="Analyzer.Valgrind.Callgrind.CostFormat">0</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="CustomOutputParsers"/>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
|
||||
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph "dwarf,4096" -F 250</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">G:/Projects/Qt/XPlor/app/app.pro</value>
|
||||
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">G:/Projects/Qt/XPlor/build/Desktop_Qt_6_8_2_MSVC2022_64bit-Debug/app</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<value type="int" key="Analyzer.Valgrind.Callgrind.CostFormat">0</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="CustomOutputParsers"/>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
|
||||
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph "dwarf,4096" -F 250</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">G:/Projects/Qt/XPlor/tests/tests.pro</value>
|
||||
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">G:/Projects/Qt/XPlor/build/Desktop_Qt_6_8_2_MSVC2022_64bit-Debug/tests</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">2</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.1</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="DeviceType">Desktop</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.8.2 llvm-mingw 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.8.2 llvm-mingw 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.682.win64_llvm_mingw_kit</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<value type="int" key="EnableQmlDebugging">0</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">G:\Projects\Qt\XPlor\build\Desktop_Qt_6_8_2_llvm_mingw_64_bit-Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">G:/Projects/Qt/XPlor/build/Desktop_Qt_6_8_2_llvm_mingw_64_bit-Debug</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">G:\Projects\Qt\XPlor\build\Desktop_Qt_6_8_2_llvm_mingw_64_bit-Release</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">G:/Projects/Qt/XPlor/build/Desktop_Qt_6_8_2_llvm_mingw_64_bit-Release</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||
<value type="int" key="QtQuickCompiler">0</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
||||
<value type="int" key="EnableQmlDebugging">0</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">G:\Projects\Qt\XPlor\build\Desktop_Qt_6_8_2_llvm_mingw_64_bit-Profile</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">G:/Projects/Qt/XPlor/build/Desktop_Qt_6_8_2_llvm_mingw_64_bit-Profile</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||
<value type="int" key="QtQuickCompiler">0</value>
|
||||
<value type="int" key="SeparateDebugInfo">0</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
|
||||
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<value type="int" key="Analyzer.Valgrind.Callgrind.CostFormat">0</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="CustomOutputParsers"/>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
|
||||
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph "dwarf,4096" -F 250</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">G:/Projects/Qt/XPlor/app/app.pro</value>
|
||||
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<value type="int" key="Analyzer.Valgrind.Callgrind.CostFormat">0</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="CustomOutputParsers"/>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
|
||||
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph "dwarf,4096" -F 250</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">G:/Projects/Qt/XPlor/tests/tests.pro</value>
|
||||
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">2</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.2</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="DeviceType">Desktop</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.8.1 MSVC2022 64bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.8.1 MSVC2022 64bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.681.win64_msvc2022_64_kit</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<value type="int" key="EnableQmlDebugging">0</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">G:\Projects\Qt\XPlor\build\Desktop_Qt_6_8_1_MSVC2022_64bit-Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">G:/Projects/Qt/XPlor/build/Desktop_Qt_6_8_1_MSVC2022_64bit-Debug</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">G:\Projects\Qt\XPlor\build\Desktop_Qt_6_8_1_MSVC2022_64bit-Release</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">G:/Projects/Qt/XPlor/build/Desktop_Qt_6_8_1_MSVC2022_64bit-Release</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||
<value type="int" key="QtQuickCompiler">0</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
|
||||
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<value type="int" key="Analyzer.Valgrind.Callgrind.CostFormat">0</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="CustomOutputParsers"/>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
|
||||
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph "dwarf,4096" -F 250</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">G:/Projects/Qt/XPlor/app/app.pro</value>
|
||||
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">G:/Projects/Qt/XPlor/build/Desktop_Qt_6_8_1_MSVC2022_64bit-Debug/app</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<value type="int" key="Analyzer.Valgrind.Callgrind.CostFormat">0</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="CustomOutputParsers"/>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
|
||||
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph "dwarf,4096" -F 250</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">G:/Projects/Qt/XPlor/tests/tests.pro</value>
|
||||
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">G:/Projects/Qt/XPlor/build/Desktop_Qt_6_8_1_MSVC2022_64bit-Debug/tests</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">2</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||
<value type="qlonglong">3</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>Version</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
</qtcreator>
|
||||
36
ai-commit.sh
Normal file
@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# 1. Stage everything
|
||||
git add -A
|
||||
|
||||
# 2. Get list of staged files
|
||||
FILES=$(git diff --cached --name-only)
|
||||
|
||||
if [ -z "$FILES" ]; then
|
||||
echo "No changes to commit."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# 3. Loop file by file
|
||||
for FILE in $FILES; do
|
||||
# Get diff for this file
|
||||
DIFF=$(git diff --cached -- "$FILE")
|
||||
|
||||
if [ -z "$DIFF" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# Ask Ollama for a commit message describing this file change
|
||||
MSG=$(echo "$DIFF" | ollama run gemma3 \
|
||||
"You are a commit bot. Write a SHORT, clear, concise Git commit message for changes in file: $FILE.
|
||||
Only output the commit message, nothing else.
|
||||
Diff:
|
||||
$DIFF")
|
||||
|
||||
# Commit just this file with its message
|
||||
git commit -m "$MSG" -- "$FILE"
|
||||
|
||||
echo "✅ Committed $FILE with message:"
|
||||
echo "$MSG"
|
||||
done
|
||||
81
app/app.pro
@ -6,75 +6,18 @@ SUBDIRS += app
|
||||
|
||||
CONFIG += c++17
|
||||
|
||||
SOURCES += \
|
||||
aboutdialog.cpp \
|
||||
ddsviewer.cpp \
|
||||
fastfileviewer.cpp \
|
||||
imagewidget.cpp \
|
||||
iwiviewer.cpp \
|
||||
localstringviewer.cpp \
|
||||
main.cpp \
|
||||
mainwindow.cpp \
|
||||
materialviewer.cpp \
|
||||
preferenceeditor.cpp \
|
||||
soundviewer.cpp \
|
||||
stringtableviewer.cpp \
|
||||
techsetviewer.cpp \
|
||||
xtreewidget.cpp \
|
||||
xtreewidgetitem.cpp \
|
||||
zonefileviewer.cpp
|
||||
|
||||
HEADERS += \
|
||||
aboutdialog.h \
|
||||
d3dbsp_structs.h \
|
||||
ddsviewer.h \
|
||||
fastfileviewer.h \
|
||||
imagewidget.h \
|
||||
iwiviewer.h \
|
||||
localstringviewer.h \
|
||||
mainwindow.h \
|
||||
materialviewer.h \
|
||||
preferenceeditor.h \
|
||||
soundviewer.h \
|
||||
stringtableviewer.h \
|
||||
techsetviewer.h \
|
||||
xtreewidget.h \
|
||||
xtreewidgetitem.h \
|
||||
zonefileviewer.h
|
||||
|
||||
FORMS += \
|
||||
aboutdialog.ui \
|
||||
ddsviewer.ui \
|
||||
fastfileviewer.ui \
|
||||
imagewidget.ui \
|
||||
iwiviewer.ui \
|
||||
localstringviewer.ui \
|
||||
mainwindow.ui \
|
||||
materialviewer.ui \
|
||||
modelviewer.ui \
|
||||
preferenceeditor.ui \
|
||||
soundviewer.ui \
|
||||
stringtableviewer.ui \
|
||||
techsetviewer.ui \
|
||||
zonefileviewer.ui
|
||||
SOURCES += $$files($$PWD/*.cpp)
|
||||
HEADERS += $$files($$PWD/*.h)
|
||||
FORMS += $$files($$PWD/*.ui)
|
||||
|
||||
RESOURCES += ../data/data.qrc
|
||||
|
||||
app.depends += \
|
||||
libs/core \
|
||||
libs/compression \
|
||||
libs/encryption \
|
||||
libs/fastfile \
|
||||
libs/ddsfile \
|
||||
libs/ipakfile \
|
||||
libs/iwifile \
|
||||
libs/zonefile
|
||||
|
||||
LIBS += \
|
||||
-L$$PWD/../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT \
|
||||
-L$$PWD/../third_party/zlib/lib/ -lzlib \
|
||||
-L$$PWD/../third_party/xbox_sdk/lib -lxcompress64 \
|
||||
-L$$OUT_PWD/../libs/ -lcore \
|
||||
-L$$OUT_PWD/../libs/ -lxassets\
|
||||
-L$$OUT_PWD/../libs/ -lcompression \
|
||||
-L$$OUT_PWD/../libs/ -lencryption \
|
||||
-L$$OUT_PWD/../libs/ -lfastfile \
|
||||
@ -94,6 +37,7 @@ INCLUDEPATH += \
|
||||
$$PWD/../libs/ddsfile \
|
||||
$$PWD/../libs/ipakfile \
|
||||
$$PWD/../libs/iwifile \
|
||||
$$PWD/../libs/xassets \
|
||||
$$PWD/../libs/zonefile
|
||||
|
||||
DEPENDPATH += \
|
||||
@ -107,16 +51,11 @@ DEPENDPATH += \
|
||||
$$PWD/../libs/ddsfile \
|
||||
$$PWD/../libs/ipakfile \
|
||||
$$PWD/../libs/iwifile \
|
||||
$$PWD/../libs/xassets \
|
||||
$$PWD/../libs/zonefile
|
||||
|
||||
# Copy DLLs to Debug folder
|
||||
QMAKE_POST_LINK += xcopy /Y /E /I \"G:/Projects/Qt/XPlor/third_party/devil_sdk/lib\\*.dll\" \"$$OUT_PWD/debug/\" $$escape_expand(\\n\\t)
|
||||
QMAKE_POST_LINK += xcopy /Y /E /I \"G:/Projects/Qt/XPlor/third_party/zlib/lib\\*.dll\" \"$$OUT_PWD/debug/\" $$escape_expand(\\n\\t)
|
||||
QMAKE_POST_LINK += xcopy /Y /E /I \"G:/Projects/Qt/XPlor/third_party/xna/lib\\*.dll\" \"$$OUT_PWD/debug/\" $$escape_expand(\\n\\t)
|
||||
QMAKE_POST_LINK += xcopy /Y /E /I \"$$PWD/../third_party/xbox_sdk/lib\\*.dll\" \"$$OUT_PWD/debug/\" $$escape_expand(\\n\\t)
|
||||
|
||||
# Copy DLLs to Release folder
|
||||
QMAKE_POST_LINK += xcopy /Y /E /I \"G:/Projects/Qt/XPlor/third_party/devil_sdk/lib\\*.dll\" \"$$OUT_PWD/release/\" $$escape_expand(\\n\\t)
|
||||
QMAKE_POST_LINK += xcopy /Y /E /I \"G:/Projects/Qt/XPlor/third_party/zlib/lib\\*.dll\" \"$$OUT_PWD/release/\" $$escape_expand(\\n\\t)
|
||||
QMAKE_POST_LINK += xcopy /Y /E /I \"G:/Projects/Qt/XPlor/third_party/xna/lib\\*.dll\" \"$$OUT_PWD/release/\" $$escape_expand(\\n\\t)
|
||||
QMAKE_POST_LINK += xcopy /Y /E /I \"$$PWD/../third_party/xbox_sdk/lib\\*.dll\" \"$$OUT_PWD/release/\" $$escape_expand(\\n\\t)
|
||||
win32 {
|
||||
QMAKE_POST_LINK =
|
||||
QMAKE_POST_LINK += for /D %%G in (\"$$PWD/../third_party/*/lib\") do copy /Y \"%%~G\*.dll\" \"$$OUT_PWD/$$DESTDIR/\" >NUL $$escape_expand(\\n\\t)
|
||||
}
|
||||
|
||||
@ -16,4 +16,26 @@ struct LumpIndexEntry {
|
||||
quint32 length;
|
||||
};
|
||||
|
||||
// Bink structure definitions
|
||||
struct BINKRECT {
|
||||
int Left;
|
||||
int Top;
|
||||
int Width;
|
||||
int Height;
|
||||
};
|
||||
|
||||
struct BINK {
|
||||
int Width;
|
||||
int Height;
|
||||
uint32_t Frames;
|
||||
uint32_t FrameNum;
|
||||
uint32_t FrameRate;
|
||||
uint32_t FrameRateDiv;
|
||||
uint32_t ReadError;
|
||||
uint32_t OpenFlags;
|
||||
BINKRECT FrameRects;
|
||||
uint32_t NumRects;
|
||||
uint32_t FrameChangePercent;
|
||||
};
|
||||
|
||||
#endif // D3DBSP_STRUCTS_H
|
||||
|
||||
@ -14,8 +14,8 @@ DDSViewer::~DDSViewer() {
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void DDSViewer::SetDDSFile(std::shared_ptr<DDSFile> aDDSFile) {
|
||||
mDDSFile.swap(aDDSFile);
|
||||
void DDSViewer::SetDDSFile(const DDSFile* aDDSFile) {
|
||||
mDDSFile = aDDSFile;
|
||||
|
||||
ui->label_Title->setText(mDDSFile->fileStem + ".dds");
|
||||
|
||||
|
||||
@ -16,14 +16,14 @@ public:
|
||||
explicit DDSViewer(QWidget *parent = nullptr);
|
||||
~DDSViewer();
|
||||
|
||||
void SetDDSFile(std::shared_ptr<DDSFile> aDDSFile);
|
||||
void SetDDSFile(const DDSFile *aDDSFile);
|
||||
|
||||
private slots:
|
||||
void MipmapIndexChanged(int aMipmapIndex);
|
||||
|
||||
private:
|
||||
Ui::DDSViewer *ui;
|
||||
std::shared_ptr<DDSFile> mDDSFile;
|
||||
const DDSFile* mDDSFile;
|
||||
};
|
||||
|
||||
#endif // DDSVIEWER_H
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
#include "fastfileviewer.h"
|
||||
#include "asset_structs.h"
|
||||
#include "ui_fastfileviewer.h"
|
||||
|
||||
FastFileViewer::FastFileViewer(QWidget *parent)
|
||||
@ -15,10 +14,10 @@ FastFileViewer::~FastFileViewer()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void FastFileViewer::SetFastFile(std::shared_ptr<FastFile> aFastFile) {
|
||||
mFastFile.swap(aFastFile);
|
||||
void FastFileViewer::SetFastFile(const FastFile* aFastFile) {
|
||||
mFastFile = aFastFile;
|
||||
|
||||
ui->label_Title->setText(mFastFile->GetStem() + ".ff");
|
||||
ui->label_Title->setText(mFastFile->GetStem());
|
||||
ui->comboBox_Company->setCurrentIndex(mFastFile->GetCompany());
|
||||
ui->comboBox_FileType->setCurrentIndex(mFastFile->GetType());
|
||||
ui->checkBox_Signed->setChecked(mFastFile->GetSignage() == SIGNAGE_SIGNED);
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#ifndef FASTFILEVIEWER_H
|
||||
#define FASTFILEVIEWER_H
|
||||
|
||||
#include "asset_structs.h"
|
||||
#include "fastfile.h"
|
||||
#include <QWidget>
|
||||
|
||||
@ -17,10 +16,10 @@ public:
|
||||
explicit FastFileViewer(QWidget *parent = nullptr);
|
||||
~FastFileViewer();
|
||||
|
||||
void SetFastFile(std::shared_ptr<FastFile> aFastFile);
|
||||
void SetFastFile(const FastFile *aFastFile);
|
||||
private:
|
||||
Ui::FFViewer *ui;
|
||||
std::shared_ptr<FastFile> mFastFile;
|
||||
const FastFile* mFastFile;
|
||||
};
|
||||
|
||||
#endif // FASTFILEVIEWER_H
|
||||
|
||||
@ -13,16 +13,16 @@ ImageWidget::~ImageWidget()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ImageWidget::SetImage(std::shared_ptr<Image> aImage)
|
||||
void ImageWidget::SetImage(std::shared_ptr<QImage> aImage)
|
||||
{
|
||||
mImage = aImage;
|
||||
|
||||
ui->lineEdit_Name->setText(aImage->name);
|
||||
ui->lineEdit_Role->setText(aImage->materialName);
|
||||
ui->comboBox_Compression->setCurrentIndex(aImage->compression);
|
||||
//ui->lineEdit_Name->setText(aImage->name);
|
||||
//ui->lineEdit_Role->setText(aImage->materialName);
|
||||
//ui->comboBox_Compression->setCurrentIndex(aImage->compression);
|
||||
}
|
||||
|
||||
std::shared_ptr<Image> ImageWidget::GetImage()
|
||||
std::shared_ptr<QImage> ImageWidget::GetImage()
|
||||
{
|
||||
return mImage;
|
||||
}
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
#include "enums.h"
|
||||
#include "dds_structs.h"
|
||||
#include "d3dbsp_structs.h"
|
||||
#include "asset_structs.h"
|
||||
#include "ipak_structs.h"
|
||||
|
||||
#include <QWidget>
|
||||
@ -21,11 +20,11 @@ public:
|
||||
explicit ImageWidget(QWidget *parent = nullptr);
|
||||
~ImageWidget();
|
||||
|
||||
void SetImage(std::shared_ptr<Image> aImage);
|
||||
std::shared_ptr<Image> GetImage();
|
||||
void SetImage(std::shared_ptr<QImage> aImage);
|
||||
std::shared_ptr<QImage> GetImage();
|
||||
|
||||
private:
|
||||
std::shared_ptr<Image> mImage;
|
||||
std::shared_ptr<QImage> mImage;
|
||||
Ui::ImageWidget *ui;
|
||||
};
|
||||
|
||||
|
||||
@ -14,8 +14,8 @@ IWIViewer::~IWIViewer()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void IWIViewer::SetIWIFile(std::shared_ptr<IWIFile> aIWIFile) {
|
||||
mIWIFile.swap(aIWIFile);
|
||||
void IWIViewer::SetIWIFile(const IWIFile* aIWIFile) {
|
||||
mIWIFile = aIWIFile;
|
||||
|
||||
ui->label_Title->setText(mIWIFile->fileStem + ".iwi");
|
||||
|
||||
|
||||
@ -18,10 +18,10 @@ public:
|
||||
|
||||
void MipmapIndexChanged(int aMipmapIndex);
|
||||
|
||||
void SetIWIFile(std::shared_ptr<IWIFile> aIWIFile);
|
||||
void SetIWIFile(const IWIFile *aIWIFile);
|
||||
private:
|
||||
Ui::IWIViewer *ui;
|
||||
std::shared_ptr<IWIFile> mIWIFile;
|
||||
const IWIFile* mIWIFile;
|
||||
};
|
||||
|
||||
#endif // IWIVIEWER_H
|
||||
|
||||
@ -10,6 +10,7 @@ LocalStringViewer::LocalStringViewer(QWidget *parent)
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->tableWidget_Strings->setColumnCount(2);
|
||||
ui->tableWidget_Strings->setRowCount(0);
|
||||
ui->tableWidget_Strings->setColumnWidth(0, 200);
|
||||
ui->tableWidget_Strings->horizontalHeader()->setStretchLastSection(true);
|
||||
}
|
||||
@ -36,24 +37,22 @@ void LocalStringViewer::SetFileNotes(const QString aFileNotes) {
|
||||
ui->plainTextEdit_FileNotes->setPlainText(mFileNotes);
|
||||
}
|
||||
|
||||
void LocalStringViewer::AddLocalString(LocalString aLocalString) {
|
||||
mLocalStrings << aLocalString;
|
||||
|
||||
void LocalStringViewer::AddLocalString(XLocalizeEntry aLocalString) {
|
||||
mLocalStrings.append(aLocalString);
|
||||
ui->tableWidget_Strings->setRowCount(mLocalStrings.size());
|
||||
|
||||
QTableWidgetItem *aliasItem = new QTableWidgetItem(aLocalString.alias);
|
||||
QTableWidgetItem *stringItem = new QTableWidgetItem(aLocalString.string);
|
||||
|
||||
ui->groupBox_LocalStrViewer->setTitle(QString("Entries (%1)").arg(mLocalStrings.size()));
|
||||
QTableWidgetItem *aliasItem = new QTableWidgetItem(aLocalString.GetValue()->GetString());
|
||||
QTableWidgetItem *stringItem = new QTableWidgetItem(aLocalString.GetName()->GetString());
|
||||
ui->tableWidget_Strings->setItem(mLocalStrings.size() - 1, 0, aliasItem);
|
||||
ui->tableWidget_Strings->setItem(mLocalStrings.size() - 1, 1, stringItem);
|
||||
}
|
||||
|
||||
void LocalStringViewer::SetZoneFile(std::shared_ptr<ZoneFile> aZoneFile) {
|
||||
void LocalStringViewer::SetZoneFile(const ZoneFile* aZoneFile) {
|
||||
mLocalStrings.clear();
|
||||
ui->tableWidget_Strings->clear();
|
||||
|
||||
ui->label_Title->setText(aZoneFile->GetStem().section('.', 0, 0) + ".str");
|
||||
for (LocalString localStr : aZoneFile->GetAssetMap().localStrings) {
|
||||
AddLocalString(localStr);
|
||||
}
|
||||
// for (const LocalString &localStr : aZoneFile->GetAssetMap().localStrings) {
|
||||
// AddLocalString(localStr);
|
||||
// }
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#ifndef LOCALSTRINGVIEWER_H
|
||||
#define LOCALSTRINGVIEWER_H
|
||||
|
||||
#include "asset_structs.h"
|
||||
#include "xlocalizeentry.h"
|
||||
#include "zonefile.h"
|
||||
#include <QWidget>
|
||||
|
||||
@ -20,15 +20,15 @@ public:
|
||||
void SetVersion(quint32 aVersion);
|
||||
void SetConfigPath(const QString aConfigPath);
|
||||
void SetFileNotes(const QString aFileNotes);
|
||||
void AddLocalString(LocalString aLocalString);
|
||||
void SetZoneFile(std::shared_ptr<ZoneFile> aZoneFile);
|
||||
void AddLocalString(XLocalizeEntry aLocalString);
|
||||
void SetZoneFile(const ZoneFile *aZoneFile);
|
||||
|
||||
private:
|
||||
Ui::LocalStringViewer *ui;
|
||||
quint32 mVersion;
|
||||
QString mConfigPath;
|
||||
QString mFileNotes;
|
||||
QVector<LocalString> mLocalStrings;
|
||||
QVector<XLocalizeEntry> mLocalStrings;
|
||||
};
|
||||
|
||||
#endif // LOCALSTRINGVIEWER_H
|
||||
|
||||
@ -142,7 +142,7 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<widget class="QGroupBox" name="groupBox_LocalStrViewer">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
|
||||
@ -1,13 +1,20 @@
|
||||
#include "mainwindow.h"
|
||||
#include "qtimer.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
#include "aboutdialog.h"
|
||||
#include "fastfile.h"
|
||||
#include "highlighter_gsc.h"
|
||||
#include "highlighter_cfg.h"
|
||||
#include "highlighter_shock.h"
|
||||
#include "highlighter_rumble.h"
|
||||
#include "materialviewer.h"
|
||||
#include "preferenceeditor.h"
|
||||
#include "soundviewer.h"
|
||||
#include "reportissuedialog.h"
|
||||
#include "rumblegraphviewer.h"
|
||||
#include "stringtableviewer.h"
|
||||
#include "techsetviewer.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include "compression.h"
|
||||
#include "fastfile_factory.h"
|
||||
#include "iwifile.h"
|
||||
#include "ddsfile.h"
|
||||
#include "statusbarmanager.h"
|
||||
@ -16,13 +23,11 @@
|
||||
#include "ipak_structs.h"
|
||||
#include "iwiviewer.h"
|
||||
#include "localstringviewer.h"
|
||||
#include "imagewidget.h"
|
||||
#include "xtreewidget.h"
|
||||
#include "zonefileviewer.h"
|
||||
#include "techsetviewer.h"
|
||||
#include "logmanager.h"
|
||||
|
||||
#include <qmath.h>
|
||||
#include <QtMath>
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
: QMainWindow(parent), ui(new Ui::MainWindow) {
|
||||
@ -30,10 +35,12 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
|
||||
setAcceptDrops(true);
|
||||
|
||||
XAsset::SetDebug(true);
|
||||
|
||||
mTypeMap = QMap<QString, int>();
|
||||
mTypeOrder = QStringList();
|
||||
mRawFileMap = QMap<QString, QString>();
|
||||
mImageMap = QMap<QString, Image>();
|
||||
//mImageMap = QMap<QString, Image>();
|
||||
mTreeMap = QMap<QString, QTreeWidgetItem *>();
|
||||
mStrTableMap = QMap<QString, QVector<QPair<QString, QString>>>();
|
||||
mBSPVersion = 0;
|
||||
@ -43,13 +50,23 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
mTreeWidget = new XTreeWidget(this);
|
||||
mLogWidget = new QPlainTextEdit(this);
|
||||
|
||||
//ModelViewer *mModelViewer = new ModelViewer(container);
|
||||
//mModelViewer->setAcceptDrops(false);
|
||||
|
||||
mProgressBar = new QProgressBar(this);
|
||||
mProgressBar->setMaximum(100); // Default max value
|
||||
mProgressBar->setVisible(false); // Initially hidden
|
||||
|
||||
connect(ui->actionRun_Tests, &QAction::triggered, this, [](bool checked) {
|
||||
Q_UNUSED(checked);
|
||||
});
|
||||
|
||||
connect(ui->actionReport_Issue, &QAction::triggered, this, [this](bool checked) {
|
||||
Q_UNUSED(checked);
|
||||
|
||||
ReportIssueDialog issueDialog("https://git.redline.llc", "njohnson", "XPlor", "4738c4d2efd123efac1506c68c59b285c646df9f", this);
|
||||
if (issueDialog.exec() == QDialog::Accepted) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
connect(&StatusBarManager::instance(), &StatusBarManager::statusUpdated,
|
||||
this, &MainWindow::HandleStatusUpdate);
|
||||
|
||||
@ -142,91 +159,118 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
ui->tabWidget->clear();
|
||||
});
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::RawFileSelected, this, [this](std::shared_ptr<RawFile> rawFile, const QString aParentName) {
|
||||
QPlainTextEdit *scriptEditor = new QPlainTextEdit(this);
|
||||
connect(mTreeWidget, &XTreeWidget::RawFileSelected, this, [this](const XRawFile* rawFile, const QString aParentName) {
|
||||
QTabWidget *rawTabWidget = new QTabWidget(this);
|
||||
rawTabWidget->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
|
||||
QPlainTextEdit *scriptEditor = new QPlainTextEdit(rawTabWidget);
|
||||
scriptEditor->setAcceptDrops(false);
|
||||
scriptEditor->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
scriptEditor->setFont(QFont("Consolas"));
|
||||
|
||||
if (rawFile->contents.isEmpty()) {
|
||||
scriptEditor->setPlainText("EMPTY");
|
||||
} else {
|
||||
scriptEditor->setPlainText(rawFile->contents);
|
||||
}
|
||||
// if (rawFile->contents.isEmpty()) {
|
||||
// scriptEditor->setPlainText("EMPTY");
|
||||
// } else {
|
||||
// scriptEditor->setPlainText(rawFile->contents);
|
||||
// }
|
||||
|
||||
QString fileStem = rawFile->path.split('/').last();
|
||||
QString fileStem;// = rawFile->path.split('/').last();
|
||||
for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
delete scriptEditor;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
QScrollArea *scrollArea = new QScrollArea(ui->tabWidget);
|
||||
scrollArea->layout()->addWidget(scriptEditor);
|
||||
const int tabStopSpaces = 4;
|
||||
QFontMetrics metrics(scriptEditor->font());
|
||||
scriptEditor->setTabStopDistance(tabStopSpaces * metrics.horizontalAdvance(' '));
|
||||
|
||||
ui->tabWidget->addTab(scrollArea, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_GSCFile.png"));
|
||||
QSyntaxHighlighter *highlighter = nullptr;
|
||||
if (fileStem.contains(".gsc")) {
|
||||
highlighter = new Highlighter_GSC(scriptEditor->document());
|
||||
} else if (fileStem.contains(".cfg")) {
|
||||
highlighter = new Highlighter_CFG(scriptEditor->document());
|
||||
} else if (fileStem.contains(".rmb")) {
|
||||
highlighter = new Highlighter_Rumble(scriptEditor->document());
|
||||
|
||||
RumbleGraphViewer *rmbGraphViewer = new RumbleGraphViewer(this);
|
||||
rmbGraphViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
rmbGraphViewer->SetRumbleGraphFile(rawFile);
|
||||
|
||||
rawTabWidget->addTab(rmbGraphViewer, "UI Editor");
|
||||
rawTabWidget->addTab(scriptEditor, "Text Editor");
|
||||
|
||||
ui->tabWidget->addTab(rawTabWidget, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_RUMBLE));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::ImageSelected, this, [this](std::shared_ptr<Image> image, const QString aParentName) {
|
||||
ImageWidget *mImageWidget = new ImageWidget(this);
|
||||
mImageWidget->setAcceptDrops(false);
|
||||
mImageWidget->SetImage(image);
|
||||
mImageWidget->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
|
||||
QString fileStem = image->materialName;
|
||||
for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if (fileStem.contains(".shock")) {
|
||||
highlighter = new Highlighter_Shock(scriptEditor->document());
|
||||
} /*else if (rawFile->contents.left(6) == "RUMBLE") {
|
||||
RumbleFileViewer *rmbFileViewer = new RumbleFileViewer(this);
|
||||
rmbFileViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
rmbFileViewer->SetRumbleFile(rawFile);
|
||||
|
||||
ui->tabWidget->addTab(mImageWidget, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_Image.png"));
|
||||
rawTabWidget->addTab(rmbFileViewer, "UI Editor");
|
||||
rawTabWidget->addTab(scriptEditor, "Text Editor");
|
||||
|
||||
ui->tabWidget->addTab(rawTabWidget, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_RUMBLE));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::MenuSelected, this, [](std::shared_ptr<Menu> menu, const QString aParentName) {
|
||||
Q_UNUSED(menu);
|
||||
});
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::DDSFileSelected, this, [this](std::shared_ptr<DDSFile> ddsFile, const QString aParentName) {
|
||||
DDSViewer *ddsViewer = new DDSViewer(this);
|
||||
ddsViewer->setAcceptDrops(false);
|
||||
ddsViewer->SetDDSFile(ddsFile);
|
||||
ddsViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
|
||||
QString fileStem = ddsFile->fileStem + ".dds";
|
||||
for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
return;
|
||||
}
|
||||
}*/ else {
|
||||
delete highlighter;
|
||||
}
|
||||
|
||||
ui->tabWidget->addTab(ddsViewer, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_DDSFile.png"));
|
||||
ui->tabWidget->addTab(scriptEditor, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_RAWFILE));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::MaterialSelected, this, [this](std::shared_ptr<Material> material, const QString aParentName) {
|
||||
// connect(mTreeWidget, &XTreeWidget::ImageSelected, this, [this](std::shared_ptr<Image> image, const QString aParentName) {
|
||||
// ImageWidget *mImageWidget = new ImageWidget(this);
|
||||
// mImageWidget->setAcceptDrops(false);
|
||||
// mImageWidget->SetImage(image);
|
||||
// mImageWidget->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
|
||||
// QString fileStem = image->materialName;
|
||||
// for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
// if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
// delete mImageWidget;
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
// ui->tabWidget->addTab(mImageWidget, fileStem);
|
||||
// ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_IMAGE));
|
||||
// ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
// });
|
||||
|
||||
// connect(mTreeWidget, &XTreeWidget::MenuSelected, this, [](std::shared_ptr<Menu> menu, const QString aParentName) {
|
||||
// Q_UNUSED(menu);
|
||||
// });
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::MaterialSelected, this, [this](const XMaterial* material, const QString aParentName) {
|
||||
MaterialViewer *matViewer = new MaterialViewer(this);
|
||||
matViewer->setAcceptDrops(false);
|
||||
matViewer->SetMaterial(material);
|
||||
matViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
|
||||
QString fileStem = material->name;
|
||||
for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// QString fileStem = material->name;
|
||||
// for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
// if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
// delete matViewer;
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
ui->tabWidget->addTab(matViewer, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_Material.png"));
|
||||
//ui->tabWidget->addTab(matViewer, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_MATERIAL));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::DDSFileSelected, this, [this](std::shared_ptr<DDSFile> ddsFile, const QString aParentName) {
|
||||
connect(mTreeWidget, &XTreeWidget::DDSFileSelected, this, [this](const DDSFile* ddsFile, const QString aParentName) {
|
||||
DDSViewer *ddsViewer = new DDSViewer(this);
|
||||
ddsViewer->setAcceptDrops(false);
|
||||
ddsViewer->SetDDSFile(ddsFile);
|
||||
@ -235,16 +279,17 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
QString fileStem = ddsFile->fileStem + ".dds";
|
||||
for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
delete ddsViewer;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ui->tabWidget->addTab(ddsViewer, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_DDSFile.png"));
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_IMAGE));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::IWIFileSelected, this, [this](std::shared_ptr<IWIFile> iwiFile, const QString aParentName) {
|
||||
connect(mTreeWidget, &XTreeWidget::IWIFileSelected, this, [this](const IWIFile* iwiFile, const QString aParentName) {
|
||||
IWIViewer *iwiViewer = new IWIViewer(this);
|
||||
iwiViewer->setAcceptDrops(false);
|
||||
iwiViewer->SetIWIFile(iwiFile);
|
||||
@ -253,42 +298,45 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
QString fileStem = iwiFile->fileStem + ".iwi";
|
||||
for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
delete iwiViewer;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ui->tabWidget->addTab(iwiViewer, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_IWIFile.png"));
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_IMAGE));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::FastFileSelected, this, [this](std::shared_ptr<FastFile> aFastFile, const QString aParentName) {
|
||||
connect(mTreeWidget, &XTreeWidget::FastFileSelected, this, [this](const FastFile* aFastFile, const QString aParentName) {
|
||||
FastFileViewer *fastFileViewer = new FastFileViewer(this);
|
||||
fastFileViewer->setAcceptDrops(false);
|
||||
fastFileViewer->SetFastFile(aFastFile);
|
||||
fastFileViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
|
||||
QString fileStem = aFastFile->GetStem() + ".ff";
|
||||
QString fileStem = aFastFile->GetStem();
|
||||
for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
delete fastFileViewer;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ui->tabWidget->addTab(fastFileViewer, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_FastFile.png"));
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon("FF"));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::ZoneFileSelected, this, [this](std::shared_ptr<ZoneFile> aZoneFile, const QString aParentName) {
|
||||
connect(mTreeWidget, &XTreeWidget::ZoneFileSelected, this, [this](const ZoneFile* aZoneFile, const QString aParentName) {
|
||||
ZoneFileViewer *zoneFileViewer = new ZoneFileViewer(this);
|
||||
zoneFileViewer->setAcceptDrops(false);
|
||||
zoneFileViewer->SetZoneFile(aZoneFile);
|
||||
zoneFileViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
|
||||
QString fileStem = aZoneFile->GetStem() + ".zone";
|
||||
QString fileStem = aZoneFile->GetBaseStem() + ".zone";
|
||||
for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
delete zoneFileViewer;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -306,11 +354,11 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
scrollArea->setWidget(containerWidget);
|
||||
|
||||
ui->tabWidget->addTab(scrollArea, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_ZoneFile.png"));
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon("ZF"));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::LocalStringSelected, this, [this](std::shared_ptr<ZoneFile> aZoneFile, const QString aParentName) {
|
||||
connect(mTreeWidget, &XTreeWidget::LocalStringSelected, this, [this](const ZoneFile* aZoneFile, const QString aParentName) {
|
||||
LocalStringViewer *localStrViewer = new LocalStringViewer(this);
|
||||
localStrViewer->setAcceptDrops(false);
|
||||
localStrViewer->SetZoneFile(aZoneFile);
|
||||
@ -319,68 +367,72 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
QString fileStem = aZoneFile->GetStem() + ".str";
|
||||
for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
delete localStrViewer;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ui->tabWidget->addTab(localStrViewer, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_String.png"));
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_LOCALIZE_ENTRY));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::TechSetSelected, this, [this](std::shared_ptr<TechSet> aTechSet, const QString aParentName) {
|
||||
connect(mTreeWidget, &XTreeWidget::TechSetSelected, this, [this](const XMaterialTechniqueSet* aTechSet, const QString aParentName) {
|
||||
TechSetViewer *techSetViewer = new TechSetViewer(this);
|
||||
techSetViewer->setAcceptDrops(false);
|
||||
techSetViewer->SetTechSet(aTechSet);
|
||||
techSetViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
|
||||
QString fileStem = aTechSet->name;
|
||||
QString fileStem = aTechSet->GetName();
|
||||
for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
delete techSetViewer;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ui->tabWidget->addTab(techSetViewer, aTechSet->name);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_TechSetFile.png"));
|
||||
ui->tabWidget->addTab(techSetViewer, aTechSet->GetName());
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_TECHNIQUE_SET));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::StrTableSelected, this, [this](std::shared_ptr<StringTable> aStrTable, const QString aParentName) {
|
||||
connect(mTreeWidget, &XTreeWidget::StrTableSelected, this, [this](const XStringTable* aStrTable, const QString aParentName) {
|
||||
StringTableViewer *strTableViewer = new StringTableViewer(this);
|
||||
strTableViewer->setAcceptDrops(false);
|
||||
strTableViewer->SetStringTable(aStrTable);
|
||||
strTableViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
|
||||
QString fileStem = aStrTable->name;
|
||||
QString fileStem = aStrTable->GetName()->GetString();
|
||||
for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
delete strTableViewer;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ui->tabWidget->addTab(strTableViewer, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_StringTable.png"));
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_STRINGTABLE));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::SoundSelected, this, [this](std::shared_ptr<Sound> aSound, const QString aParentName) {
|
||||
SoundViewer *soundViewer = new SoundViewer(this);
|
||||
soundViewer->setAcceptDrops(false);
|
||||
soundViewer->SetSound(aSound);
|
||||
soundViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
// connect(mTreeWidget, &XTreeWidget::SoundSelected, this, [this](std::shared_ptr<Sound> aSound, const QString aParentName) {
|
||||
// SoundViewer *soundViewer = new SoundViewer(this);
|
||||
// soundViewer->setAcceptDrops(false);
|
||||
// soundViewer->SetSound(aSound);
|
||||
// soundViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
|
||||
QString fileStem = aSound->path.split('/').last();
|
||||
for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// QString fileStem = aSound->path.split('/').last();
|
||||
// for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
// if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
// delete soundViewer;
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
ui->tabWidget->addTab(soundViewer, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_Sound.png"));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
// ui->tabWidget->addTab(soundViewer, fileStem);
|
||||
// ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_SOUND));
|
||||
// ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
// });
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::ItemSelected, this, [this](const QString itemText) {
|
||||
for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
@ -475,13 +527,28 @@ void MainWindow::Reset() {
|
||||
and opens the selected file.
|
||||
*/
|
||||
bool MainWindow::OpenFastFile(const QString aFastFilePath) {
|
||||
const QString fastFileStem = aFastFilePath.section("/", -1, -1).section('.', 0, 0);
|
||||
const QString fastFileStem = aFastFilePath.section("/", -1, -1);
|
||||
if (mTreeWidget->HasFastFile(fastFileStem)) {
|
||||
LogManager::instance().addError("Can't add duplicate file!");
|
||||
return false;
|
||||
}
|
||||
|
||||
std::shared_ptr<FastFile> fastFile = FastFile::Open(aFastFilePath);
|
||||
FastFile* fastFile = FastFile::Open(aFastFilePath);
|
||||
fastFile->SetStem(fastFileStem);
|
||||
mTreeWidget->AddFastFile(fastFile);
|
||||
|
||||
// Open zone file after decompressing ff and writing
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MainWindow::OpenFastFile(const QByteArray& aFastFileData, const QString aFastFilePath) {
|
||||
const QString fastFileStem = aFastFilePath.section("/", -1, -1);
|
||||
if (mTreeWidget->HasFastFile(fastFileStem)) {
|
||||
LogManager::instance().addError("Can't add duplicate file!");
|
||||
return false;
|
||||
}
|
||||
|
||||
FastFile* fastFile = FastFile::Open(aFastFileData);
|
||||
fastFile->SetStem(fastFileStem);
|
||||
mTreeWidget->AddFastFile(fastFile);
|
||||
|
||||
@ -496,11 +563,13 @@ bool MainWindow::OpenFastFile(const QString aFastFilePath) {
|
||||
and opens the selected file.
|
||||
*/
|
||||
bool MainWindow::OpenFastFile() {
|
||||
const QString fastFileName = Utils::GetOpenFastFileName();
|
||||
if (!OpenFastFile(fastFileName)) {
|
||||
qDebug() << "Failed to open Fast file!";
|
||||
return false;
|
||||
}
|
||||
// Open file dialog to steam apps
|
||||
const QString steamPath = "C:/Program Files (x86)/Steam/steamapps/common/Call of Duty World at War/zone/english/";
|
||||
|
||||
QFileDialog::getOpenFileContent(tr("Fast File (*.ff);;All Files (*.*)"), [this](const QString &fileName, const QByteArray &data){
|
||||
OpenFastFile(data, fileName);
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -514,19 +583,25 @@ bool MainWindow::OpenZoneFile(const QString aZoneFilePath, bool fromFF) {
|
||||
Q_UNUSED(aZoneFilePath);
|
||||
Q_UNUSED(fromFF);
|
||||
|
||||
//ZoneFile zoneFile;
|
||||
//if (!zoneFile.Load(aZoneFilePath)) {
|
||||
// ZoneFile* zoneFile = ZoneFile::Create();
|
||||
// if (!zoneFile.Load(aZoneFilePath)) {
|
||||
// qDebug() << "Error: Failed to load zone file!";
|
||||
// return false;
|
||||
//}
|
||||
//mTreeWidget->AddZoneFile(std::make_shared<ZoneFile>(zoneFile));
|
||||
// }
|
||||
// mTreeWidget->AddZoneFile(std::make_shared<ZoneFile>(zoneFile));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MainWindow::OpenZoneFile() {
|
||||
const QString zoneFileName = Utils::GetOpenZoneFileName();
|
||||
if (!OpenZoneFile(zoneFileName)) {
|
||||
// Open file dialog to steam apps
|
||||
const QString steamPath = "C:/Program Files (x86)/Steam/steamapps/common/Call of Duty World at War/zone/english/";
|
||||
const QString zoneFilePath = QFileDialog::getOpenFileName(this, "Open Zone File", steamPath, "Zone File (*.zone);;All Files (*.*)");
|
||||
if (zoneFilePath.isNull()) {
|
||||
// User pressed cancel
|
||||
return false;
|
||||
} else if (!QFile::exists(zoneFilePath)) {
|
||||
QMessageBox::warning(this, "Warning!", QString("%1 does not exist!.").arg(zoneFilePath));
|
||||
qDebug() << "Failed to open Zone file!";
|
||||
return false;
|
||||
}
|
||||
@ -598,7 +673,7 @@ quint32 DXT3 = 0x33545844; // 'DXT3'
|
||||
quint32 DXT5 = 0x35545844; // 'DXT5'
|
||||
|
||||
int MainWindow::LoadFile_IWI(const QString aFilePath) {
|
||||
mTreeWidget->AddIWIFile(std::make_shared<IWIFile>(aFilePath));
|
||||
mTreeWidget->AddIWIFile(new IWIFile(aFilePath));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -609,7 +684,7 @@ int MainWindow::LoadFile_DDSFiles(const QStringList aFilePaths) {
|
||||
qDebug() << "Error: Invalid filename " << filePath;
|
||||
return -1;
|
||||
}
|
||||
mTreeWidget->AddDDSFile(std::make_shared<DDSFile>(filePath));
|
||||
mTreeWidget->AddDDSFile(new DDSFile(filePath));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -641,7 +716,7 @@ int MainWindow::LoadFile_DDS(const QString aFilePath) {
|
||||
qDebug() << "Error: Invalid filename " << aFilePath;
|
||||
return -1;
|
||||
}
|
||||
mTreeWidget->AddDDSFile(std::make_shared<DDSFile>(aFilePath));
|
||||
mTreeWidget->AddDDSFile(new DDSFile(aFilePath));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -714,7 +789,7 @@ int MainWindow::LoadFile_IPAK(const QString aFilePath) {
|
||||
|
||||
QVector<IPAKIndexEntry> entries = QVector<IPAKIndexEntry>();
|
||||
QVector<IPAKSection> sections = QVector<IPAKSection>(header.sectionCount);
|
||||
for (uint i = 0; i < header.sectionCount; i++) {
|
||||
for (quint32 i = 0; i < header.sectionCount; i++) {
|
||||
IPAKSection currentSection;
|
||||
stream >> currentSection;
|
||||
sections << currentSection;
|
||||
@ -736,7 +811,7 @@ int MainWindow::LoadFile_IPAK(const QString aFilePath) {
|
||||
<< " - Count: " << chunkHeader.count << "\n"
|
||||
<< " - Offset: " << chunkHeader.offset;
|
||||
|
||||
for (uint j = 0; j < 31; j++) {
|
||||
for (quint32 j = 0; j < 31; j++) {
|
||||
IPAKDataChunkCommand command;
|
||||
stream >> command;
|
||||
if (!command.size) { continue; }
|
||||
@ -746,7 +821,7 @@ int MainWindow::LoadFile_IPAK(const QString aFilePath) {
|
||||
<< " - Compressed: " << command.compressed;
|
||||
|
||||
}
|
||||
for (uint j = 0; j < chunkHeader.count; j++) {
|
||||
for (quint32 j = 0; j < chunkHeader.count; j++) {
|
||||
auto command = chunkHeader.commands[j];
|
||||
|
||||
qDebug() << "Reading from " << stream.device()->pos();
|
||||
@ -771,7 +846,7 @@ int MainWindow::LoadFile_IPAK(const QString aFilePath) {
|
||||
stream.skipRawData(sizeof(quint32) * (31 - chunkHeader.count));
|
||||
qDebug() << stream.device()->pos();
|
||||
} else if (sectionType == "Index") {
|
||||
for (uint j = 0; j < currentSection.itemCount; j++) {
|
||||
for (quint32 j = 0; j < currentSection.itemCount; j++) {
|
||||
IPAKIndexEntry entry;
|
||||
stream >> entry;
|
||||
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include "d3dbsp_structs.h"
|
||||
#include "asset_structs.h"
|
||||
#include "xtreewidget.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
@ -16,7 +15,6 @@
|
||||
#include <QPlainTextEdit>
|
||||
#include <QMimeData>
|
||||
#include <QProgressBar>
|
||||
#include <windows.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui {
|
||||
@ -35,6 +33,7 @@ public:
|
||||
|
||||
private slots:
|
||||
bool OpenFastFile(const QString aFastFilePath);
|
||||
bool OpenFastFile(const QByteArray& aFastFileData, const QString aFastFilePath);
|
||||
bool OpenFastFile();
|
||||
|
||||
bool OpenZoneFile(const QString aZoneFilePath, bool fromFF = false);
|
||||
@ -64,7 +63,7 @@ private:
|
||||
quint32 mTagCount;
|
||||
quint32 mRecordCount;
|
||||
QMap<QString, QString> mRawFileMap;
|
||||
QMap<QString, Image> mImageMap;
|
||||
//QMap<QString, Image> mImageMap;
|
||||
QMap<QString, QTreeWidgetItem*> mTreeMap;
|
||||
QMap<QString, QVector<QPair<QString, QString>>> mStrTableMap;
|
||||
XTreeWidget *mTreeWidget;
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
<widget class="QMenu" name="MenuDef">
|
||||
<property name="title">
|
||||
<string>File</string>
|
||||
</property>
|
||||
@ -117,9 +117,17 @@
|
||||
</property>
|
||||
<addaction name="actionAbout"/>
|
||||
<addaction name="actionCheck_for_Updates"/>
|
||||
<addaction name="actionReport_Issue"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<widget class="QMenu" name="menuTools">
|
||||
<property name="title">
|
||||
<string>Tools</string>
|
||||
</property>
|
||||
<addaction name="actionRun_Tests"/>
|
||||
</widget>
|
||||
<addaction name="MenuDef"/>
|
||||
<addaction name="menuEdit"/>
|
||||
<addaction name="menuTools"/>
|
||||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="toolBar">
|
||||
@ -353,6 +361,16 @@
|
||||
<string>Preferences...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionReport_Issue">
|
||||
<property name="text">
|
||||
<string>Report Issue</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionRun_Tests">
|
||||
<property name="text">
|
||||
<string>Run Tests</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../data/data.qrc"/>
|
||||
|
||||
@ -3,40 +3,41 @@
|
||||
|
||||
MaterialViewer::MaterialViewer(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::MaterialViewer) {
|
||||
, ui(new Ui::MaterialViewer)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
MaterialViewer::~MaterialViewer() {
|
||||
MaterialViewer::~MaterialViewer()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
QString ToHexStr(quint32 in) {
|
||||
QString ToHexStr(quint32 in)
|
||||
{
|
||||
return QString("%1").arg(in, 8, 16, QChar('0')).toUpper();
|
||||
}
|
||||
|
||||
void MaterialViewer::SetMaterial(std::shared_ptr<Material> aMaterial) {
|
||||
ui->lineEdit_NamePtr->setText(ToHexStr(aMaterial->namePtr));
|
||||
ui->lineEdit_Name->setText(aMaterial->name);
|
||||
ui->lineEdit_RefPtr->setText(ToHexStr(aMaterial->refNamePtr));
|
||||
ui->lineEdit_RefName->setText(aMaterial->refName);
|
||||
ui->lineEdit_Unknowns->setText(ToHexStr(aMaterial->unknownA[0])
|
||||
+ ToHexStr(aMaterial->unknownA[1])
|
||||
+ ToHexStr(aMaterial->unknownA[2])
|
||||
+ ToHexStr(aMaterial->unknownA[3])
|
||||
+ ToHexStr(aMaterial->unknownA[4])
|
||||
+ ToHexStr(aMaterial->unknownA[5])
|
||||
+ ToHexStr(aMaterial->unknownA[6])
|
||||
+ ToHexStr(aMaterial->unknownA[7])
|
||||
+ ToHexStr(aMaterial->unknownA[8])
|
||||
+ ToHexStr(aMaterial->unknownA[9])
|
||||
+ ToHexStr(aMaterial->unknownA[10])
|
||||
+ ToHexStr(aMaterial->unknownA[11]));
|
||||
ui->lineEdit_StateA->setText(ToHexStr(aMaterial->stateBits[0]));
|
||||
ui->lineEdit_StateA->setText(ToHexStr(aMaterial->stateBits[1]));
|
||||
ui->spinBox_TextureCount->setValue(aMaterial->textureCount);
|
||||
ui->spinBox_ConstCount->setValue(aMaterial->constCount);
|
||||
ui->lineEdit_TechSetPtr->setText(ToHexStr(aMaterial->techSetPtr));
|
||||
ui->lineEdit_TexturePtr->setText(ToHexStr(aMaterial->texturePtr));
|
||||
ui->lineEdit_ConstantPtr->setText(ToHexStr(aMaterial->constPtr));
|
||||
void MaterialViewer::SetMaterial(const XMaterial* aMaterial)
|
||||
{
|
||||
Q_UNUSED(aMaterial);
|
||||
|
||||
// TODO: Fill in MaterialViewer::SetMaterial
|
||||
|
||||
// ui->lineEdit_NamePtr->setText(ToHexStr(aMaterial->namePtr));
|
||||
// ui->lineEdit_Name->setText(aMaterial->name);
|
||||
// ui->lineEdit_RefPtr->setText(ToHexStr(aMaterial->refNamePtr));
|
||||
// ui->lineEdit_RefName->setText(aMaterial->refName);
|
||||
// QString unknownStr = "";
|
||||
// foreach (quint32 unknownPtr, aMaterial->pointers) {
|
||||
// unknownStr += ToHexStr(unknownPtr) + "\n";
|
||||
// }
|
||||
// ui->lineEdit_Unknowns->setText(unknownStr);
|
||||
// ui->lineEdit_StateA->setText(ToHexStr(aMaterial->stateBits[0]));
|
||||
// ui->lineEdit_StateA->setText(ToHexStr(aMaterial->stateBits[1]));
|
||||
// ui->spinBox_TextureCount->setValue(aMaterial->textureCount);
|
||||
// ui->spinBox_ConstCount->setValue(aMaterial->constCount);
|
||||
// ui->lineEdit_TechSetPtr->setText(ToHexStr(aMaterial->techSetPtr));
|
||||
// ui->lineEdit_TexturePtr->setText(ToHexStr(aMaterial->texturePtr));
|
||||
// ui->lineEdit_ConstantPtr->setText(ToHexStr(aMaterial->constPtr));
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#ifndef MATERIALVIEWER_H
|
||||
#define MATERIALVIEWER_H
|
||||
|
||||
#include "asset_structs.h"
|
||||
#include "xmaterial.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QScrollArea>
|
||||
@ -18,7 +18,7 @@ public:
|
||||
explicit MaterialViewer(QWidget *parent = nullptr);
|
||||
~MaterialViewer();
|
||||
|
||||
void SetMaterial(std::shared_ptr<Material> aMaterial);
|
||||
void SetMaterial(const XMaterial *aMaterial);
|
||||
|
||||
private:
|
||||
Ui::MaterialViewer *ui;
|
||||
|
||||
103
app/reportissuedialog.cpp
Normal file
@ -0,0 +1,103 @@
|
||||
#include "reportissuedialog.h"
|
||||
#include "qjsonarray.h"
|
||||
#include "ui_reportissuedialog.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QMessageBox>
|
||||
#include <QNetworkRequest>
|
||||
|
||||
ReportIssueDialog::ReportIssueDialog(const QString &giteaBaseUrl,
|
||||
const QString &repoOwner,
|
||||
const QString &repoName,
|
||||
const QString &accessToken,
|
||||
QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::ReportIssueDialog),
|
||||
networkManager(new QNetworkAccessManager(this)),
|
||||
giteaBaseUrl(giteaBaseUrl),
|
||||
repoOwner(repoOwner),
|
||||
repoName(repoName),
|
||||
accessToken(accessToken)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(networkManager, &QNetworkAccessManager::finished, this, &ReportIssueDialog::onNetworkReplyFinished);
|
||||
}
|
||||
|
||||
ReportIssueDialog::~ReportIssueDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ReportIssueDialog::on_buttonSend_clicked()
|
||||
{
|
||||
QString title = ui->lineEditSummary->text().trimmed();
|
||||
QString details = ui->textEditDetails->toPlainText().trimmed();
|
||||
QString contact = ui->lineEditContact->text().trimmed();
|
||||
|
||||
if (title.isEmpty()) {
|
||||
QMessageBox::warning(this, tr("Input Error"), tr("Please enter a summary/title for the issue."));
|
||||
return;
|
||||
}
|
||||
|
||||
QString body = details;
|
||||
if (!contact.isEmpty()) {
|
||||
body += QString("\n\nContact info:\n%1").arg(contact);
|
||||
}
|
||||
|
||||
ui->buttonSend->setEnabled(false);
|
||||
sendIssueReport(title, body, contact);
|
||||
}
|
||||
|
||||
void ReportIssueDialog::on_buttonCancel_clicked()
|
||||
{
|
||||
reject();
|
||||
}
|
||||
|
||||
void ReportIssueDialog::sendIssueReport(const QString &title, const QString &body, const QString &/*contact*/)
|
||||
{
|
||||
// Compose URL: e.g. https://gitea.example.com/api/v1/repos/{owner}/{repo}/issues
|
||||
QUrl url(QString("%1/api/v1/repos/%2/%3/issues").arg(giteaBaseUrl).arg(repoOwner).arg(repoName));
|
||||
|
||||
QNetworkRequest request(url);
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||
|
||||
if (!accessToken.isEmpty()) {
|
||||
request.setRawHeader("Authorization", "token " + accessToken.toUtf8());
|
||||
}
|
||||
|
||||
// Compose JSON body
|
||||
QJsonObject json;
|
||||
json["title"] = title;
|
||||
json["body"] = body;
|
||||
json["labels"] = QJsonArray{12};
|
||||
|
||||
QJsonDocument doc(json);
|
||||
QByteArray data = doc.toJson();
|
||||
|
||||
networkManager->post(request, data);
|
||||
}
|
||||
|
||||
void ReportIssueDialog::onNetworkReplyFinished(QNetworkReply *reply)
|
||||
{
|
||||
ui->buttonSend->setEnabled(true);
|
||||
|
||||
QByteArray responseData = reply->readAll();
|
||||
QString responseStr = QString::fromUtf8(responseData);
|
||||
|
||||
if (reply->error() != QNetworkReply::NoError) {
|
||||
QString errorStr = reply->errorString();
|
||||
if (errorStr.isEmpty()) errorStr = "Unknown network error";
|
||||
QMessageBox::critical(this, tr("Error"), tr("Failed to send issue report:\n%1\nResponse:\n%2").arg(errorStr).arg(responseStr));
|
||||
} else {
|
||||
int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
||||
if (status == 201) {
|
||||
QMessageBox::information(this, tr("Success"), tr("Issue reported successfully!"));
|
||||
accept();
|
||||
} else {
|
||||
QMessageBox::warning(this, tr("Failed"), tr("Unexpected response from server (%1):\n%2").arg(status).arg(responseStr));
|
||||
}
|
||||
}
|
||||
reply->deleteLater();
|
||||
}
|
||||
43
app/reportissuedialog.h
Normal file
@ -0,0 +1,43 @@
|
||||
#ifndef REPORTISSUEDIALOG_H
|
||||
#define REPORTISSUEDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
|
||||
namespace Ui {
|
||||
class ReportIssueDialog;
|
||||
}
|
||||
|
||||
class ReportIssueDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ReportIssueDialog(const QString &giteaBaseUrl,
|
||||
const QString &repoOwner,
|
||||
const QString &repoName,
|
||||
const QString &accessToken,
|
||||
QWidget *parent = nullptr);
|
||||
~ReportIssueDialog();
|
||||
|
||||
private slots:
|
||||
void on_buttonSend_clicked();
|
||||
void on_buttonCancel_clicked();
|
||||
|
||||
void onNetworkReplyFinished(QNetworkReply *reply);
|
||||
|
||||
private:
|
||||
Ui::ReportIssueDialog *ui;
|
||||
|
||||
QNetworkAccessManager *networkManager;
|
||||
|
||||
QString giteaBaseUrl;
|
||||
QString repoOwner;
|
||||
QString repoName;
|
||||
QString accessToken;
|
||||
|
||||
void sendIssueReport(const QString &title, const QString &body, const QString &contact);
|
||||
};
|
||||
|
||||
#endif // REPORTISSUEDIALOG_H
|
||||
84
app/reportissuedialog.ui
Normal file
@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ReportIssueDialog</class>
|
||||
<widget class="QDialog" name="ReportIssueDialog">
|
||||
<property name="windowTitle">
|
||||
<string>Report a Problem</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelInstructions">
|
||||
<property name="text">
|
||||
<string>Please describe the problem you encountered. We’ll use this info to help fix it.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelSummary">
|
||||
<property name="text">
|
||||
<string>Summary (short title):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEditSummary" />
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelDetails">
|
||||
<property name="text">
|
||||
<string>Details (what happened?):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="textEditDetails" />
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelContact">
|
||||
<property name="text">
|
||||
<string>Your contact (email or name, optional):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEditContact" />
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="buttonLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonSend">
|
||||
<property name="text">
|
||||
<string>Send Report</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonCancel">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
58
app/rumblefileviewer.cpp
Normal file
@ -0,0 +1,58 @@
|
||||
#include "rumblefileviewer.h"
|
||||
#include "ui_rumblefileviewer.h"
|
||||
|
||||
RumbleFileViewer::RumbleFileViewer(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::RumbleFileViewer)
|
||||
, mPropertyCount()
|
||||
, mRumbleFile(nullptr) {
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->tableWidget_Properties->setColumnCount(2);
|
||||
ui->tableWidget_Properties->setRowCount(0);
|
||||
ui->tableWidget_Properties->setColumnWidth(0, 200);
|
||||
ui->tableWidget_Properties->horizontalHeader()->setStretchLastSection(true);
|
||||
}
|
||||
|
||||
RumbleFileViewer::~RumbleFileViewer() {
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void RumbleFileViewer::SetRumbleFile(XRawFile *aRumbleFile) {
|
||||
mRumbleFile = aRumbleFile;
|
||||
|
||||
ui->tableWidget_Properties->clear();
|
||||
|
||||
// const QString magic = aRumbleFile->contents.left(6);
|
||||
// if (magic != "RUMBLE") {
|
||||
// qDebug() << "Rumble file has invalid magic: " << magic;
|
||||
// return;
|
||||
// }
|
||||
|
||||
// int firstIndex = 0;
|
||||
// int secondIndex = 0;
|
||||
// int thirdIndex = 0;
|
||||
|
||||
// int startIndex = 0;
|
||||
// for (int i = 0; i < aRumbleFile->contents.count("\\") / 2; i++) {
|
||||
// ui->tableWidget_Properties->setRowCount(i + 1);
|
||||
// ui->spinBox_Entries->setValue(i + 1);
|
||||
|
||||
// firstIndex = aRumbleFile->contents.indexOf("\\", startIndex);
|
||||
// secondIndex = aRumbleFile->contents.indexOf("\\", firstIndex + 1);
|
||||
// thirdIndex = aRumbleFile->contents.indexOf("\\", secondIndex + 1);
|
||||
// if (thirdIndex == -1) {
|
||||
// thirdIndex = aRumbleFile->contents.size();
|
||||
// }
|
||||
|
||||
// const QString keyStr = aRumbleFile->contents.mid(firstIndex + 1, secondIndex - firstIndex - 1);
|
||||
// QTableWidgetItem *keyItem = new QTableWidgetItem(keyStr);
|
||||
// ui->tableWidget_Properties->setItem(i, 0, keyItem);
|
||||
|
||||
// const QString valStr = aRumbleFile->contents.mid(secondIndex + 1, thirdIndex - secondIndex - 1);
|
||||
// QTableWidgetItem *valueItem = new QTableWidgetItem(valStr);
|
||||
// ui->tableWidget_Properties->setItem(i, 1, valueItem);
|
||||
|
||||
// startIndex = thirdIndex;
|
||||
// }
|
||||
}
|
||||
28
app/rumblefileviewer.h
Normal file
@ -0,0 +1,28 @@
|
||||
#ifndef RUMBLEFILEVIEWER_H
|
||||
#define RUMBLEFILEVIEWER_H
|
||||
|
||||
#include "xrawfile.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class RumbleFileViewer;
|
||||
}
|
||||
|
||||
class RumbleFileViewer : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit RumbleFileViewer(QWidget *parent = nullptr);
|
||||
~RumbleFileViewer();
|
||||
|
||||
void SetRumbleFile(XRawFile* aRumbleFile);
|
||||
|
||||
private:
|
||||
Ui::RumbleFileViewer *ui;
|
||||
quint32 mPropertyCount;
|
||||
XRawFile* mRumbleFile;
|
||||
};
|
||||
|
||||
#endif // RUMBLEFILEVIEWER_H
|
||||
153
app/rumblefileviewer.ui
Normal file
@ -0,0 +1,153 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>RumbleFileViewer</class>
|
||||
<widget class="QWidget" name="RumbleFileViewer">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>841</width>
|
||||
<height>457</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>841</width>
|
||||
<height>457</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_Title">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
<pointsize>16</pointsize>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Rumble File Viewer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>325</width>
|
||||
<height>398</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>325</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Header</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="2" column="0" colspan="3">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QSpinBox" name="spinBox_Entries">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>10000</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Entries:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_LocalStrViewer">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>400</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Properties</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTableWidget" name="tableWidget_Properties">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
54
app/rumblegraphviewer.cpp
Normal file
@ -0,0 +1,54 @@
|
||||
#include "rumblegraphviewer.h"
|
||||
#include "ui_rumblegraphviewer.h"
|
||||
|
||||
RumbleGraphViewer::RumbleGraphViewer(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::RumbleGraphViewer),
|
||||
mEntryCount(),
|
||||
mRumbleGraphFile(nullptr) {
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->tableWidget_Entries->setColumnCount(2);
|
||||
ui->tableWidget_Entries->setHorizontalHeaderLabels({ "X", "Y" });
|
||||
ui->tableWidget_Entries->setRowCount(0);
|
||||
ui->tableWidget_Entries->setColumnWidth(0, 200);
|
||||
ui->tableWidget_Entries->horizontalHeader()->setStretchLastSection(true);
|
||||
}
|
||||
|
||||
RumbleGraphViewer::~RumbleGraphViewer() {
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void RumbleGraphViewer::SetRumbleGraphFile(const XRawFile* aRawFile) {
|
||||
mRumbleGraphFile = aRawFile;
|
||||
|
||||
XDataStream rawFileStream;//(mRumbleGraphFile->contents.toLatin1());
|
||||
|
||||
QByteArray magic(15, Qt::Uninitialized);
|
||||
rawFileStream.readRawData(magic.data(), 15);
|
||||
|
||||
rawFileStream.skipRawData(4);
|
||||
|
||||
char sectionChar;
|
||||
rawFileStream >> sectionChar;
|
||||
int sectionCount = sectionChar - '0';
|
||||
ui->tableWidget_Entries->setRowCount(sectionCount);
|
||||
ui->spinBox_Entries->setValue(sectionCount);
|
||||
ui->groupBox_LocalStrViewer->setTitle(QString("Entries (%1)").arg(sectionCount));
|
||||
|
||||
rawFileStream.skipRawData(2);
|
||||
|
||||
for (int i = 0; i < sectionCount; i++) {
|
||||
QByteArray xVal(6, Qt::Uninitialized), yVal(6, Qt::Uninitialized);
|
||||
rawFileStream.readRawData(xVal.data(), 6);
|
||||
rawFileStream.skipRawData(1);
|
||||
rawFileStream.readRawData(yVal.data(), 6);
|
||||
rawFileStream.skipRawData(2);
|
||||
|
||||
QTableWidgetItem *xItem = new QTableWidgetItem(xVal);
|
||||
QTableWidgetItem *yItem = new QTableWidgetItem(yVal);
|
||||
|
||||
ui->tableWidget_Entries->setItem(i, 0, xItem);
|
||||
ui->tableWidget_Entries->setItem(i, 1, yItem);
|
||||
}
|
||||
}
|
||||
30
app/rumblegraphviewer.h
Normal file
@ -0,0 +1,30 @@
|
||||
#ifndef RUMBLEGRAPHVIEWER_H
|
||||
#define RUMBLEGRAPHVIEWER_H
|
||||
|
||||
#include "xrawfile.h"
|
||||
#include "zonefile.h"
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class RumbleGraphViewer;
|
||||
}
|
||||
|
||||
class RumbleGraphViewer : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit RumbleGraphViewer(QWidget *parent = nullptr);
|
||||
~RumbleGraphViewer();
|
||||
|
||||
void SetEntryCount(quint32 aCount);
|
||||
void SetRumbleGraphFile(const XRawFile *aRawFile);
|
||||
void SetZoneFile(ZoneFile* aZoneFile);
|
||||
|
||||
private:
|
||||
Ui::RumbleGraphViewer *ui;
|
||||
quint32 mEntryCount;
|
||||
const XRawFile* mRumbleGraphFile;
|
||||
};
|
||||
|
||||
#endif // RUMBLEGRAPHVIEWER_H
|
||||
153
app/rumblegraphviewer.ui
Normal file
@ -0,0 +1,153 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>RumbleGraphViewer</class>
|
||||
<widget class="QWidget" name="RumbleGraphViewer">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>841</width>
|
||||
<height>457</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>841</width>
|
||||
<height>457</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_Title">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
<pointsize>16</pointsize>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Rumble Graph File </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>325</width>
|
||||
<height>398</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>325</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Header</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Entry Count: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QSpinBox" name="spinBox_Entries">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>10000</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="3">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_LocalStrViewer">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>400</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Entries</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTableWidget" name="tableWidget_Entries">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -61,17 +61,17 @@ SoundViewer::~SoundViewer()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void SoundViewer::SetSound(std::shared_ptr<Sound> aSound)
|
||||
{
|
||||
buffer->setData(aSound->data);
|
||||
if (!buffer->open(QIODevice::ReadOnly)) {
|
||||
qWarning() << "Failed to open QBuffer.";
|
||||
return;
|
||||
}
|
||||
// void SoundViewer::SetSound(std::shared_ptr<Sound> aSound)
|
||||
// {
|
||||
// buffer->setData(aSound->data);
|
||||
// if (!buffer->open(QIODevice::ReadOnly)) {
|
||||
// qWarning() << "Failed to open QBuffer.";
|
||||
// return;
|
||||
// }
|
||||
|
||||
ui->groupBox->setTitle(aSound->path);
|
||||
player->setSourceDevice(buffer);
|
||||
}
|
||||
// ui->groupBox->setTitle(aSound->path);
|
||||
// player->setSourceDevice(buffer);
|
||||
// }
|
||||
|
||||
void SoundViewer::SetOutput(QAudioOutput *aOutput) {
|
||||
if (!aOutput) { return; }
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
#ifndef SOUNDVIEWER_H
|
||||
#define SOUNDVIEWER_H
|
||||
|
||||
#include "asset_structs.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QMediaPlayer>
|
||||
#include <QBuffer>
|
||||
@ -22,7 +20,7 @@ public:
|
||||
explicit SoundViewer(QWidget *parent = nullptr);
|
||||
~SoundViewer();
|
||||
|
||||
void SetSound(std::shared_ptr<Sound> aSound);
|
||||
//void SetSound(std::shared_ptr<Sound> aSound);
|
||||
|
||||
void SetOutput(QAudioOutput *aOutput);
|
||||
private:
|
||||
|
||||
@ -13,22 +13,21 @@ StringTableViewer::~StringTableViewer()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void StringTableViewer::SetStringTable(std::shared_ptr<StringTable> aStringTable) {
|
||||
void StringTableViewer::SetStringTable(const XStringTable *aStringTable) {
|
||||
ui->tableWidget_Strings->clear();
|
||||
|
||||
ui->tableWidget_Strings->setRowCount(aStringTable->rowCount);
|
||||
ui->tableWidget_Strings->setColumnCount(aStringTable->columnCount);
|
||||
ui->tableWidget_Strings->setRowCount(aStringTable->GetRowCount());
|
||||
ui->tableWidget_Strings->setColumnCount(aStringTable->GetColumnCount());
|
||||
|
||||
int currentIndex = 0;
|
||||
for (const QString &key : aStringTable->content.keys()) {
|
||||
const QString value = aStringTable->content[key];
|
||||
for (auto value : *aStringTable->GetValues()) {
|
||||
|
||||
QTableWidgetItem *tableKeyItem = new QTableWidgetItem();
|
||||
tableKeyItem->setText(key);
|
||||
tableKeyItem->setText(value->GetName());
|
||||
ui->tableWidget_Strings->setItem(currentIndex, 0, tableKeyItem);
|
||||
|
||||
QTableWidgetItem *tableValItem = new QTableWidgetItem();
|
||||
tableValItem->setText(value);
|
||||
tableValItem->setText(value->GetString());
|
||||
ui->tableWidget_Strings->setItem(currentIndex, 1, tableValItem);
|
||||
|
||||
currentIndex++;
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
#ifndef STRINGTABLEVIEWER_H
|
||||
#define STRINGTABLEVIEWER_H
|
||||
|
||||
#include "asset_structs.h"
|
||||
#include "xstringtable.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
@ -16,7 +17,7 @@ public:
|
||||
explicit StringTableViewer(QWidget *parent = nullptr);
|
||||
~StringTableViewer();
|
||||
|
||||
void SetStringTable(std::shared_ptr<StringTable> aStringTable);
|
||||
void SetStringTable(const XStringTable *aStringTable);
|
||||
|
||||
private:
|
||||
Ui::StringTableViewer *ui;
|
||||
|
||||
@ -13,13 +13,13 @@ TechSetViewer::~TechSetViewer()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TechSetViewer::SetTechSet(std::shared_ptr<TechSet> aTechSet) {
|
||||
ui->listWidget_Ptrs->clear();
|
||||
ui->label_Title->setText(aTechSet->name);
|
||||
void TechSetViewer::SetTechSet(const XMaterialTechniqueSet* aTechSet) {
|
||||
//ui->listWidget_Ptrs->clear();
|
||||
ui->label_Title->setText(aTechSet->GetName());
|
||||
|
||||
int ptrIndex = 1;
|
||||
for (auto ptr : aTechSet->pointers) {
|
||||
ui->listWidget_Ptrs->addItem(QString("Pointer %1: %2").arg(ptrIndex).arg(ptr));
|
||||
ptrIndex++;
|
||||
}
|
||||
// int ptrIndex = 1;
|
||||
//for (auto ptr : aTechSet->pointers) {
|
||||
// ui->listWidget_Ptrs->addItem(QString("Pointer %1: %2").arg(ptrIndex).arg(ptr));
|
||||
// ptrIndex++;
|
||||
//}
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
#ifndef TECHSETVIEWER_H
|
||||
#define TECHSETVIEWER_H
|
||||
|
||||
#include "asset_structs.h"
|
||||
#include "xmaterialtechniqueset.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
@ -16,7 +17,7 @@ public:
|
||||
explicit TechSetViewer(QWidget *parent = nullptr);
|
||||
~TechSetViewer();
|
||||
|
||||
void SetTechSet(std::shared_ptr<TechSet> aTechSet);
|
||||
void SetTechSet(const XMaterialTechniqueSet *aTechSet);
|
||||
|
||||
private:
|
||||
Ui::TechSetViewer *ui;
|
||||
|
||||
@ -6,14 +6,14 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>961</width>
|
||||
<height>756</height>
|
||||
<width>880</width>
|
||||
<height>559</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_Title">
|
||||
<property name="font">
|
||||
@ -29,46 +29,120 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Unknown Pointers:</string>
|
||||
<string>Set Parameters</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QListWidget" name="listWidget_Ptrs"/>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_Name">
|
||||
<property name="placeholderText">
|
||||
<string>Technique set name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>World Vertex Format:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinBox_WorldVertFormat"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="listWidget_Techniques"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Current Technique</string>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</spacer>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_TechniqueName">
|
||||
<property name="placeholderText">
|
||||
<string>Technique set name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Flags:</string>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>363</height>
|
||||
</size>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinBox_Flags"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Pass Count:</string>
|
||||
</property>
|
||||
</spacer>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinBox_PassCount"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Material Pass</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
||||
@ -5,10 +5,10 @@
|
||||
|
||||
XTreeWidget::XTreeWidget(QWidget *parent)
|
||||
: QTreeWidget(parent) {
|
||||
mFastFiles = QMap<QString, std::shared_ptr<FastFile>>();
|
||||
mZoneFiles = QMap<QString, std::shared_ptr<ZoneFile>>();
|
||||
mDDSFiles = QMap<QString, std::shared_ptr<DDSFile>>();
|
||||
mIWIFiles = QMap<QString, std::shared_ptr<IWIFile>>();
|
||||
mFastFiles = QMap<QString, const FastFile*>();
|
||||
mZoneFiles = QMap<QString, const ZoneFile*>();
|
||||
mDDSFiles = QMap<QString, const DDSFile*>();
|
||||
mIWIFiles = QMap<QString, const IWIFile*>();
|
||||
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
setSelectionMode(QTreeWidget::SingleSelection);
|
||||
@ -16,6 +16,7 @@ XTreeWidget::XTreeWidget(QWidget *parent)
|
||||
header()->hide();
|
||||
setMinimumWidth(350);
|
||||
setSortingEnabled(true);
|
||||
setIconSize(QSize(16, 16));
|
||||
|
||||
header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
|
||||
|
||||
@ -36,225 +37,241 @@ XTreeWidget::~XTreeWidget() {
|
||||
|
||||
}
|
||||
|
||||
void XTreeWidget::AddFastFile(std::shared_ptr<FastFile> aFastFile) {
|
||||
void XTreeWidget::AddFastFile(FastFile* aFastFile) {
|
||||
XTreeWidgetItem *fastFileItem = new XTreeWidgetItem(this);
|
||||
fastFileItem->setText(0, aFastFile->GetStem() + ".ff");
|
||||
fastFileItem->setIcon(0, QIcon(":/icons/icons/Icon_FastFile.png"));
|
||||
fastFileItem->setText(0, aFastFile->GetStem());
|
||||
fastFileItem->setIcon(0, Utils::CreateAssetIcon("FF"));
|
||||
if (aFastFile->GetPlatform() == "PC") {
|
||||
fastFileItem->setIcon(1, QIcon(":/icons/icons/Icon_PC.png"));
|
||||
fastFileItem->setIcon(1, Utils::CreateAssetIcon("PC"));
|
||||
} else if (aFastFile->GetPlatform() == "360") {
|
||||
fastFileItem->setIcon(1, QIcon(":/icons/icons/Icon_Xbox.png"));
|
||||
fastFileItem->setIcon(1, Utils::CreateAssetIcon("360"));
|
||||
} else if (aFastFile->GetPlatform() == "PS3") {
|
||||
fastFileItem->setIcon(1, Utils::CreateAssetIcon("PS3"));
|
||||
} else if (aFastFile->GetPlatform() == "Wii") {
|
||||
fastFileItem->setIcon(1, QIcon(":/icons/icons/Icon_Wii.png"));
|
||||
fastFileItem->setIcon(1, Utils::CreateAssetIcon("WII"));
|
||||
} else if (aFastFile->GetPlatform() == "WiiU") {
|
||||
fastFileItem->setIcon(1, QIcon(":/icons/icons/Icon_WiiU.png"));
|
||||
fastFileItem->setIcon(1, Utils::CreateAssetIcon("WU"));
|
||||
}
|
||||
if (aFastFile->GetGame() == "COD2") {
|
||||
fastFileItem->setIcon(2, QIcon(":/icons/icons/Icon_COD2.png"));
|
||||
fastFileItem->setIcon(2, Utils::CreateGameIcon(2));
|
||||
} if (aFastFile->GetGame() == "COD4") {
|
||||
fastFileItem->setIcon(2, QIcon(":/icons/icons/Icon_COD4.png"));
|
||||
fastFileItem->setIcon(2, Utils::CreateGameIcon(4));
|
||||
} else if (aFastFile->GetGame() == "COD5") {
|
||||
fastFileItem->setIcon(2, QIcon(":/icons/icons/Icon_COD5.png"));
|
||||
fastFileItem->setIcon(2, Utils::CreateGameIcon(5));
|
||||
} else if (aFastFile->GetGame() == "COD6") {
|
||||
fastFileItem->setIcon(2, QIcon(":/icons/icons/Icon_COD6.png"));
|
||||
fastFileItem->setIcon(2, Utils::CreateGameIcon(6));
|
||||
} else if (aFastFile->GetGame() == "COD7") {
|
||||
fastFileItem->setIcon(2, QIcon(":/icons/icons/Icon_COD7.png"));
|
||||
fastFileItem->setIcon(2, Utils::CreateGameIcon(7));
|
||||
} else if (aFastFile->GetGame() == "COD8") {
|
||||
fastFileItem->setIcon(2, QIcon(":/icons/icons/Icon_COD8.png"));
|
||||
fastFileItem->setIcon(2, Utils::CreateGameIcon(8));
|
||||
} else if (aFastFile->GetGame() == "COD9") {
|
||||
fastFileItem->setIcon(2, QIcon(":/icons/icons/Icon_COD9.png"));
|
||||
fastFileItem->setIcon(2, Utils::CreateGameIcon(9));
|
||||
} else if (aFastFile->GetGame() == "COD10") {
|
||||
fastFileItem->setIcon(2, Utils::CreateGameIcon(10));
|
||||
} else if (aFastFile->GetGame() == "COD11") {
|
||||
fastFileItem->setIcon(2, Utils::CreateGameIcon(11));
|
||||
} else if (aFastFile->GetGame() == "COD12") {
|
||||
fastFileItem->setIcon(2, Utils::CreateGameIcon(12));
|
||||
}
|
||||
|
||||
AddZoneFile(aFastFile->GetZoneFile(), fastFileItem);
|
||||
|
||||
mFastFiles[aFastFile->GetStem().section(".", 0, 0)] = aFastFile;
|
||||
mFastFiles[aFastFile->GetStem()] = aFastFile;
|
||||
|
||||
resizeColumnToContents(1);
|
||||
setSortingEnabled(true);
|
||||
sortByColumn(0, Qt::AscendingOrder);
|
||||
}
|
||||
|
||||
void XTreeWidget::AddZoneFile(std::shared_ptr<ZoneFile> aZoneFile, XTreeWidgetItem *aParentItem) {
|
||||
void XTreeWidget::AddZoneFile(const ZoneFile* aZoneFile, XTreeWidgetItem *aParentItem) {
|
||||
XTreeWidgetItem *zoneItem;
|
||||
if (aParentItem != nullptr) {
|
||||
zoneItem = new XTreeWidgetItem(aParentItem);
|
||||
} else {
|
||||
zoneItem = new XTreeWidgetItem(this);
|
||||
}
|
||||
zoneItem->setIcon(0, QIcon(":/icons/icons/Icon_ZoneFile.png"));
|
||||
zoneItem->setText(0, aZoneFile->GetStem() + ".zone");
|
||||
zoneItem->setIcon(0, Utils::CreateAssetIcon("ZF"));
|
||||
zoneItem->setText(0, aZoneFile->GetBaseStem() + ".zone");
|
||||
|
||||
auto assetMap = aZoneFile->GetAssetMap();
|
||||
|
||||
if (!assetMap.localStrings.isEmpty()) {
|
||||
XTreeWidgetItem *localStrRoot = new XTreeWidgetItem(zoneItem);
|
||||
localStrRoot->setText(0, "String Files");
|
||||
localStrRoot->setIcon(0, QIcon(":/icons/icons/Icon_StringFile.png"));
|
||||
|
||||
XTreeWidgetItem *localStrItem = new XTreeWidgetItem(localStrRoot);
|
||||
localStrItem->setText(0, aZoneFile->GetStem().section('.', 0, 0) + ".str");
|
||||
localStrItem->setIcon(0, QIcon(":/icons/icons/Icon_StringFile.png"));
|
||||
}
|
||||
|
||||
if (!assetMap.techSets.isEmpty()) {
|
||||
XTreeWidgetItem *techSetRoot = new XTreeWidgetItem(zoneItem);
|
||||
techSetRoot->setText(0, "Tech Sets");
|
||||
techSetRoot->setIcon(0, QIcon(":/icons/icons/Icon_TechSetFile.png"));
|
||||
|
||||
for (TechSet techSet : assetMap.techSets) {
|
||||
XTreeWidgetItem *techSetItem = new XTreeWidgetItem(techSetRoot);
|
||||
techSetItem->setText(0, techSet.name);
|
||||
techSetItem->setIcon(0, QIcon(":/icons/icons/Icon_TechSetFile.png"));
|
||||
XAssetList assetList = aZoneFile->GetAssetList();
|
||||
QVector<XAsset*> localizeEntries;
|
||||
for (int i = 0; i < assetList.Size(); i++)
|
||||
{
|
||||
XAsset *currentAsset = assetList.GetAsset(i);
|
||||
if (currentAsset->GetType() == ASSET_TYPE_LOCALIZE_ENTRY)
|
||||
{
|
||||
localizeEntries.append(currentAsset);
|
||||
} else if (currentAsset->GetType() == ASSET_TYPE_LOCALIZE_ENTRY)
|
||||
{
|
||||
localizeEntries.append(currentAsset);
|
||||
}
|
||||
}
|
||||
|
||||
if (!assetMap.rawFiles.isEmpty()) {
|
||||
XTreeWidgetItem *rawFileRoot = new XTreeWidgetItem(zoneItem);
|
||||
rawFileRoot->setText(0, "Raw Files");
|
||||
rawFileRoot->setIcon(0, QIcon(":/icons/icons/Icon_GSCFile.png"));
|
||||
for (RawFile rawFile : assetMap.rawFiles) {
|
||||
if (!rawFile.length) { continue; }
|
||||
|
||||
XTreeWidgetItem *tempItem = rawFileRoot;
|
||||
for (const QString &pathPart : rawFile.path.split('/')) {
|
||||
bool childFound = false;
|
||||
for (int i = 0; i < tempItem->childCount(); i++) {
|
||||
QTreeWidgetItem *rawChildItem = tempItem->child(i);
|
||||
XTreeWidgetItem *childItem = dynamic_cast<XTreeWidgetItem*>(rawChildItem);
|
||||
if (childItem->text(0) == pathPart) {
|
||||
tempItem = childItem;
|
||||
// if (!assetMap.localizeEntries.isEmpty()) {
|
||||
// QIcon localStrIcon = Utils::CreateAssetIcon(ASSET_TYPE_LOCALIZE_ENTRY);
|
||||
|
||||
childFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// XTreeWidgetItem *localStrRoot = new XTreeWidgetItem(zoneItem);
|
||||
// localStrRoot->setText(0, "String Files");
|
||||
// localStrRoot->setIcon(0, localStrIcon);
|
||||
// localStrRoot->SetCategory(CATEGORY_TYPE);
|
||||
|
||||
if (pathPart.contains(".gsc")) {
|
||||
XTreeWidgetItem *rawFileItem = new XTreeWidgetItem(tempItem);
|
||||
rawFileItem->setText(0, pathPart);
|
||||
// XTreeWidgetItem *localStrItem = new XTreeWidgetItem(localStrRoot);
|
||||
// localStrItem->setText(0, aZoneFile->GetStem().section('.', 0, 0) + ".str");
|
||||
// localStrItem->setIcon(0, localStrIcon);
|
||||
// }
|
||||
|
||||
tempItem = rawFileItem;
|
||||
} else if (!childFound) {
|
||||
tempItem = new XTreeWidgetItem(tempItem);
|
||||
tempItem->setText(0, pathPart);
|
||||
}
|
||||
// if (!assetMap.techSets.isEmpty()) {
|
||||
// QIcon techSetIcon = Utils::CreateAssetIcon(ASSET_TYPE_TECHNIQUE_SET);
|
||||
|
||||
}
|
||||
tempItem->setIcon(0, QIcon(":/icons/icons/Icon_GSCFile.png"));
|
||||
}
|
||||
}
|
||||
// XTreeWidgetItem *techSetRoot = new XTreeWidgetItem(zoneItem);
|
||||
// techSetRoot->setText(0, "Tech Sets");
|
||||
// techSetRoot->setIcon(0, techSetIcon);
|
||||
// techSetRoot->SetCategory(CATEGORY_TYPE);
|
||||
|
||||
if (!assetMap.menuFiles.isEmpty()) {
|
||||
XTreeWidgetItem *menuRoot = new XTreeWidgetItem(zoneItem);
|
||||
menuRoot->setText(0, "Menu Files");
|
||||
menuRoot->setIcon(0, QIcon(":/icons/icons/Icon_MenuFile.png"));
|
||||
// for (auto techSet : assetMap.techSets) {
|
||||
// XTreeWidgetItem *techSetItem = new XTreeWidgetItem(techSetRoot);
|
||||
// techSetItem->setText(0, techSet.name);
|
||||
// techSetItem->setIcon(0, techSetIcon);
|
||||
// }
|
||||
// }
|
||||
|
||||
int menuIndex = 1;
|
||||
for (MenuFile menuFile : assetMap.menuFiles) {
|
||||
XTreeWidgetItem *menuFileRoot = new XTreeWidgetItem(menuRoot);
|
||||
menuFileRoot->setText(0, QString("Menu %1").arg(menuIndex));
|
||||
for (Menu menu : menuFile.menuDefs) {
|
||||
XTreeWidgetItem *menuItem = new XTreeWidgetItem(menuFileRoot);
|
||||
menuItem->setText(0, menu.name);
|
||||
menuItem->setIcon(0, QIcon(":/icons/icons/Icon_MenuFile.png"));
|
||||
}
|
||||
menuIndex++;
|
||||
}
|
||||
}
|
||||
// if (!assetMap.rawFiles.isEmpty()) {
|
||||
// QIcon rawFileIcon = Utils::CreateAssetIcon(ASSET_TYPE_RAWFILE);
|
||||
|
||||
if (!assetMap.images.isEmpty()) {
|
||||
XTreeWidgetItem *imageRoot = new XTreeWidgetItem(zoneItem);
|
||||
imageRoot->setText(0, "Images");
|
||||
imageRoot->setIcon(0, QIcon(":/icons/icons/Icon_Image.png"));
|
||||
// XTreeWidgetItem *rawFileRoot = new XTreeWidgetItem(zoneItem);
|
||||
// rawFileRoot->setText(0, "Raw Files");
|
||||
// rawFileRoot->setIcon(0, rawFileIcon);
|
||||
// rawFileRoot->SetCategory(CATEGORY_TYPE);
|
||||
// for (auto rawFile : assetMap.rawFiles) {
|
||||
// if (!rawFile.length) { continue; }
|
||||
|
||||
for (Image image : assetMap.images) {
|
||||
XTreeWidgetItem *imageItem = new XTreeWidgetItem(imageRoot);
|
||||
imageItem->setText(0, image.materialName);
|
||||
imageItem->setIcon(0, QIcon(":/icons/icons/Icon_Image.png"));
|
||||
}
|
||||
}
|
||||
// XTreeWidgetItem *tempItem = rawFileRoot;
|
||||
// // const QStringList pathParts = rawFile->path.split('/');
|
||||
// // for (const QString &pathPart : pathParts) {
|
||||
// // bool childFound = false;
|
||||
// // for (int i = 0; i < tempItem->childCount(); i++) {
|
||||
// // QTreeWidgetItem *rawChildItem = tempItem->child(i);
|
||||
// // XTreeWidgetItem *childItem = dynamic_cast<XTreeWidgetItem*>(rawChildItem);
|
||||
// // if (childItem->text(0) == pathPart) {
|
||||
// // tempItem = childItem;
|
||||
|
||||
if (!assetMap.models.isEmpty()) {
|
||||
XTreeWidgetItem *modelsRoot = new XTreeWidgetItem(zoneItem);
|
||||
modelsRoot->setText(0, "Models");
|
||||
modelsRoot->setIcon(0, QIcon(":/icons/icons/Icon_Model.png"));
|
||||
// // childFound = true;
|
||||
// // break;
|
||||
// // }
|
||||
// // }
|
||||
|
||||
for (Model model: assetMap.models) {
|
||||
XTreeWidgetItem *modelItem = new XTreeWidgetItem(modelsRoot);
|
||||
modelItem->setText(0, model.modelName);
|
||||
modelItem->setIcon(0, QIcon(":/icons/icons/Icon_Model.png"));
|
||||
}
|
||||
}
|
||||
// // const QString rawFileStr = pathPart;// = QString("%1 [%2-%3]").arg(pathPart).arg(rawFile.startPos).arg(rawFile.endPos);
|
||||
// // if (pathPart == pathParts.last()) {
|
||||
// // XTreeWidgetItem *rawFileItem = new XTreeWidgetItem(tempItem);
|
||||
// // rawFileItem->setText(0, rawFileStr);
|
||||
|
||||
if (!assetMap.materials.isEmpty()) {
|
||||
XTreeWidgetItem *materialsRoot = new XTreeWidgetItem(zoneItem);
|
||||
materialsRoot->setText(0, "Materials");
|
||||
materialsRoot->setIcon(0, QIcon(":/icons/icons/Icon_Material.png"));
|
||||
// // tempItem = rawFileItem;
|
||||
// // } else if (!childFound) {
|
||||
// // tempItem = new XTreeWidgetItem(tempItem);
|
||||
// // tempItem->setText(0, rawFileStr);
|
||||
// // }
|
||||
|
||||
for (Material material: assetMap.materials) {
|
||||
XTreeWidgetItem *materialItem = new XTreeWidgetItem(materialsRoot);
|
||||
materialItem->setText(0, material.name);
|
||||
materialItem->setIcon(0, QIcon(":/icons/icons/Icon_Material.png"));
|
||||
}
|
||||
}
|
||||
// // }
|
||||
// tempItem->setIcon(0, rawFileIcon);
|
||||
// }
|
||||
// }
|
||||
|
||||
if (!assetMap.stringTables.isEmpty()) {
|
||||
XTreeWidgetItem *strTableRoot = new XTreeWidgetItem(zoneItem);
|
||||
strTableRoot->setText(0, "String Tables");
|
||||
strTableRoot->setIcon(0, QIcon(":/icons/icons/Icon_StringTable.png"));
|
||||
// if (!assetMap.menuDefinitions.isEmpty()) {
|
||||
// // QIcon MenuDefIcon = Utils::CreateAssetIcon(ASSET_TYPE_MENU);
|
||||
|
||||
for (StringTable strTable: assetMap.stringTables) {
|
||||
XTreeWidgetItem *modelItem = new XTreeWidgetItem(strTableRoot);
|
||||
modelItem->setText(0, strTable.name);
|
||||
modelItem->setIcon(0, QIcon(":/icons/icons/Icon_StringTable.png"));
|
||||
}
|
||||
}
|
||||
// // XTreeWidgetItem *menuRoot = new XTreeWidgetItem(zoneItem);
|
||||
// // menuRoot->setText(0, "Menu Files");
|
||||
// // menuRoot->setIcon(0, MenuDefIcon);
|
||||
// // menuRoot->SetCategory(CATEGORY_TYPE);
|
||||
|
||||
if (!assetMap.sounds.isEmpty()) {
|
||||
XTreeWidgetItem *soundsRoot = new XTreeWidgetItem(zoneItem);
|
||||
soundsRoot->setText(0, "Sounds");
|
||||
soundsRoot->setIcon(0, QIcon(":/icons/icons/Icon_Sound.png"));
|
||||
for (SoundAsset soundAsset : assetMap.sounds) {
|
||||
for (Sound sound : soundAsset.sounds) {
|
||||
XTreeWidgetItem *tempItem = soundsRoot;
|
||||
// // int menuIndex = 1;
|
||||
// // for (MenuDef menuDef : assetMap.menuDefinitions) {
|
||||
// // XTreeWidgetItem *MenuDefRoot = new XTreeWidgetItem(menuRoot);
|
||||
// // MenuDefRoot->setText(0, QString("Menu %1").arg(menuIndex));
|
||||
// // for (Menu menu : menuDef.men) {
|
||||
// // XTreeWidgetItem *menuItem = new XTreeWidgetItem(MenuDefRoot);
|
||||
// // menuItem->setText(0, menu.filePath);
|
||||
// // menuItem->setIcon(0, MenuDefIcon);
|
||||
// // }
|
||||
// // menuIndex++;
|
||||
// // }
|
||||
// }
|
||||
|
||||
if (!sound.dataLength) { continue; }
|
||||
// if (!assetMap.images.isEmpty()) {
|
||||
// // QIcon imageIcon = Utils::CreateAssetIcon(ASSET_TYPE_IMAGE);
|
||||
|
||||
for (const QString &pathPart : sound.path.split('/')) {
|
||||
if (pathPart.isEmpty()) { continue; }
|
||||
// // XTreeWidgetItem *imageRoot = new XTreeWidgetItem(zoneItem);
|
||||
// // imageRoot->setText(0, "Images");
|
||||
// // imageRoot->setIcon(0, imageIcon);
|
||||
// // imageRoot->SetCategory(CATEGORY_TYPE);
|
||||
|
||||
bool childFound = false;
|
||||
for (int i = 0; i < tempItem->childCount(); i++) {
|
||||
XTreeWidgetItem *childItem = dynamic_cast<XTreeWidgetItem*>(tempItem->child(i));
|
||||
if (childItem->text(0) == pathPart) {
|
||||
tempItem = childItem;
|
||||
// // for (Image image : assetMap.images) {
|
||||
// // XTreeWidgetItem *imageItem = new XTreeWidgetItem(imageRoot);
|
||||
// // imageItem->setText(0, image.materialName);
|
||||
// // imageItem->setIcon(0, imageIcon);
|
||||
// // }
|
||||
// }
|
||||
|
||||
childFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if (!assetMap.models.isEmpty()) {
|
||||
// QIcon modelIcon = Utils::CreateAssetIcon(ASSET_TYPE_XMODEL);
|
||||
|
||||
if (pathPart.contains(".wav")) {
|
||||
XTreeWidgetItem *soundItem = new XTreeWidgetItem(tempItem);
|
||||
soundItem->setText(0, pathPart);
|
||||
// XTreeWidgetItem *modelsRoot = new XTreeWidgetItem(zoneItem);
|
||||
// modelsRoot->setText(0, "Models");
|
||||
// modelsRoot->setIcon(0, modelIcon);
|
||||
// modelsRoot->SetCategory(CATEGORY_TYPE);
|
||||
|
||||
tempItem = soundItem;
|
||||
} else if (!childFound) {
|
||||
tempItem = new XTreeWidgetItem(tempItem);
|
||||
tempItem->setText(0, pathPart);
|
||||
}
|
||||
// for (auto model: assetMap.models) {
|
||||
// XTreeWidgetItem *modelItem = new XTreeWidgetItem(modelsRoot);
|
||||
// modelItem->setText(0, model.name);
|
||||
// modelItem->setIcon(0, modelIcon);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
tempItem->setIcon(0, QIcon(":/icons/icons/Icon_Sound.png"));
|
||||
}
|
||||
}
|
||||
}
|
||||
// if (!assetMap.materials.isEmpty()) {
|
||||
// QIcon materialIcon = Utils::CreateAssetIcon(ASSET_TYPE_MATERIAL);
|
||||
|
||||
mZoneFiles[aZoneFile->GetStem().section(".", 0, 0)] = aZoneFile;
|
||||
// XTreeWidgetItem *materialsRoot = new XTreeWidgetItem(zoneItem);
|
||||
// materialsRoot->setText(0, "Materials");
|
||||
// materialsRoot->setIcon(0, materialIcon);
|
||||
// materialsRoot->SetCategory(CATEGORY_TYPE);
|
||||
|
||||
// for (auto material: assetMap.materials) {
|
||||
// XTreeWidgetItem *materialItem = new XTreeWidgetItem(materialsRoot);
|
||||
// //materialItem->setText(0, material.name);
|
||||
// materialItem->setIcon(0, materialIcon);
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (!assetMap.stringTables.isEmpty()) {
|
||||
// QIcon stringTableIcon = Utils::CreateAssetIcon(ASSET_TYPE_STRINGTABLE);
|
||||
|
||||
// XTreeWidgetItem *strTableRoot = new XTreeWidgetItem(zoneItem);
|
||||
// strTableRoot->setText(0, "String Tables");
|
||||
// strTableRoot->setIcon(0, stringTableIcon);
|
||||
// strTableRoot->SetCategory(CATEGORY_TYPE);
|
||||
|
||||
// for (auto strTable: assetMap.stringTables) {
|
||||
// XTreeWidgetItem *modelItem = new XTreeWidgetItem(strTableRoot);
|
||||
// modelItem->setText(0, strTable.name);
|
||||
// modelItem->setIcon(0, stringTableIcon);
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (!assetMap.sounds.isEmpty()) {
|
||||
// QIcon soundIcon = Utils::CreateAssetIcon(ASSET_TYPE_SOUND);
|
||||
|
||||
// XTreeWidgetItem *soundsRoot = new XTreeWidgetItem(zoneItem);
|
||||
// soundsRoot->setText(0, "Sounds");
|
||||
// soundsRoot->setIcon(0, soundIcon);
|
||||
// soundsRoot->SetCategory(CATEGORY_TYPE);
|
||||
// }
|
||||
|
||||
mZoneFiles[aZoneFile->GetBaseStem() + ".zone"] = aZoneFile;
|
||||
}
|
||||
|
||||
void XTreeWidget::CloseFastFile(const QString aFFName) {
|
||||
const QString fileStem = aFFName.section(".", 0, 0);
|
||||
const QString fileStem = aFFName;
|
||||
emit ItemClosed(fileStem);
|
||||
}
|
||||
|
||||
@ -285,7 +302,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
|
||||
QMenu *exportSubmenu = new QMenu("Export...", this);
|
||||
contextMenu->addMenu(exportSubmenu);
|
||||
|
||||
std::shared_ptr<DDSFile> ddsFile = mDDSFiles[fileStem];
|
||||
const DDSFile* ddsFile = mDDSFiles[fileStem];
|
||||
|
||||
QAction *exportIWIAction = new QAction("Export as IWI");
|
||||
exportSubmenu->addAction(exportIWIAction);
|
||||
@ -329,7 +346,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
|
||||
QMenu *exportSubmenu = new QMenu("Export...", this);
|
||||
contextMenu->addMenu(exportSubmenu);
|
||||
|
||||
std::shared_ptr<IWIFile> iwiFile = mIWIFiles[fileStem];
|
||||
const IWIFile* iwiFile = mIWIFiles[fileStem];
|
||||
|
||||
QAction *exportDDSAction = new QAction("Export as DDS");
|
||||
exportSubmenu->addAction(exportDDSAction);
|
||||
@ -355,7 +372,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
|
||||
iwiFile->SaveJPG();
|
||||
});
|
||||
} else if (activeText.contains(".ff")) {
|
||||
const QString fileStem = activeText.replace(".zone", "");
|
||||
const QString fileStem = activeText;
|
||||
|
||||
QMenu *closeMultipleAction = new QMenu("Close Multiple Tabs");
|
||||
|
||||
@ -379,7 +396,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
|
||||
auto childItem = invisibleRootItem()->child(i);
|
||||
if (childItem == activeItem) { continue; }
|
||||
|
||||
const QString fileStem = childItem->text(0).replace(".ff", "");
|
||||
const QString fileStem = childItem->text(0);
|
||||
if (!mFastFiles.contains(fileStem)) {
|
||||
qDebug() << "Error: Could not find " << fileStem << " in Fast File map!";
|
||||
return;
|
||||
@ -401,7 +418,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
|
||||
auto childItem = invisibleRootItem()->child(i);
|
||||
if (childItem == activeItem) { return; }
|
||||
|
||||
const QString fileStem = childItem->text(0).replace(".ff", "");
|
||||
const QString fileStem = childItem->text(0);
|
||||
if (!mFastFiles.contains(fileStem)) {
|
||||
qDebug() << "Error: Could not find " << fileStem << " in Fast File map!";
|
||||
return;
|
||||
@ -428,7 +445,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const QString fileStem = childItem->text(0).replace(".ff", "");
|
||||
const QString fileStem = childItem->text(0);
|
||||
if (!mFastFiles.contains(fileStem)) {
|
||||
qDebug() << "Error: Could not find " << fileStem << " in Fast File map!";
|
||||
return;
|
||||
@ -448,7 +465,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
|
||||
connect(closeAction, &QAction::triggered, this, [this, &activeItem, &activeText](bool checked) {
|
||||
Q_UNUSED(checked);
|
||||
|
||||
const QString fileStem = activeItem->text(0).replace(".ff", "");
|
||||
const QString fileStem = activeItem->text(0);
|
||||
|
||||
mFastFiles.remove(fileStem);
|
||||
CloseFastFile(activeText);
|
||||
@ -458,7 +475,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
|
||||
QMenu *exportSubmenu = new QMenu("Export...", this);
|
||||
contextMenu->addMenu(exportSubmenu);
|
||||
|
||||
std::shared_ptr<FastFile> fastFile = mFastFiles[fileStem];
|
||||
const FastFile* fastFile = mFastFiles[fileStem];
|
||||
|
||||
QAction *exportFastFileAction = new QAction("Export Fast File");
|
||||
exportSubmenu->addAction(exportFastFileAction);
|
||||
@ -473,16 +490,16 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
|
||||
});
|
||||
QAction *exportZoneFileAction = new QAction("Export Zone File");
|
||||
exportSubmenu->addAction(exportZoneFileAction);
|
||||
connect(exportZoneFileAction, &QAction::triggered, this, [fastFile](bool checked) {
|
||||
connect(exportZoneFileAction, &QAction::triggered, this, [](bool checked) {
|
||||
Q_UNUSED(checked);
|
||||
|
||||
const QString zoneFilePath = QFileDialog::getSaveFileName(
|
||||
nullptr, "Export Zone File...", QDir::currentPath(),
|
||||
"Zone File (*.zone);;All Files(*.*)");
|
||||
fastFile->GetZoneFile()->SaveZoneFile(zoneFilePath);
|
||||
// const QString zoneFilePath = QFileDialog::getSaveFileName(
|
||||
// nullptr, "Export Zone File...", QDir::currentPath(),
|
||||
// "Zone File (*.zone);;All Files(*.*)");
|
||||
//fastFile->GetZoneFile()->SaveZoneFile(zoneFilePath);
|
||||
});
|
||||
} else if (activeText.contains(".zone")) {
|
||||
const QString fileStem = activeText.replace(".zone", "");
|
||||
const QString fileStem = activeText;
|
||||
if (!mZoneFiles.contains(fileStem)) {
|
||||
qDebug() << "Error: Could not find " << fileStem << " in Zone File map!";
|
||||
return;
|
||||
@ -491,7 +508,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
|
||||
QMenu *exportSubmenu = new QMenu("Export...", this);
|
||||
contextMenu->addMenu(exportSubmenu);
|
||||
|
||||
std::shared_ptr<ZoneFile> zoneFile = mZoneFiles[fileStem];
|
||||
//const ZoneFile* zoneFile = mZoneFiles[fileStem];
|
||||
|
||||
QAction *exportZoneFileAction = new QAction("Export Zone File");
|
||||
exportSubmenu->addAction(exportZoneFileAction);
|
||||
@ -513,41 +530,41 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
|
||||
}
|
||||
}
|
||||
if (parentItem && parentItem != invisibleRootItem() && parentItem->text(0).contains(".zone")) {
|
||||
const QString fileStem = parentItem->text(0).section('.', 0, 0);
|
||||
QVector<SoundAsset> soundAssets = mZoneFiles[fileStem]->GetAssetMap().sounds;
|
||||
for (SoundAsset soundAsset : soundAssets) {
|
||||
for (Sound sound : soundAsset.sounds) {
|
||||
if (sound.path.contains(activeText)) {
|
||||
QMenu *exportSubmenu = new QMenu("Export...", this);
|
||||
contextMenu->addMenu(exportSubmenu);
|
||||
//const QString fileStem = parentItem->text(0).section('.', 0, 0);
|
||||
// QVector<LoadedSound> LoadedSounds = mZoneFiles[fileStem]->GetAssetMap().sounds;
|
||||
// for (LoadedSound LoadedSound : LoadedSounds) {
|
||||
// for (Sound sound : LoadedSound.sounds) {
|
||||
// if (sound.path.contains(activeText)) {
|
||||
// QMenu *exportSubmenu = new QMenu("Export...", this);
|
||||
// contextMenu->addMenu(exportSubmenu);
|
||||
|
||||
QAction *exportWAVAction = new QAction("Export as WAV File");
|
||||
exportSubmenu->addAction(exportWAVAction);
|
||||
connect(exportWAVAction, &QAction::triggered, this, [sound](bool checked) {
|
||||
Q_UNUSED(checked);
|
||||
// QAction *exportWAVAction = new QAction("Export as WAV File");
|
||||
// exportSubmenu->addAction(exportWAVAction);
|
||||
// connect(exportWAVAction, &QAction::triggered, this, [sound](bool checked) {
|
||||
// Q_UNUSED(checked);
|
||||
|
||||
QDir dir = QDir::currentPath();
|
||||
if (!dir.exists("exports/")) {
|
||||
dir.mkdir("exports/");
|
||||
}
|
||||
// QDir dir = QDir::currentPath();
|
||||
// if (!dir.exists("exports/")) {
|
||||
// dir.mkdir("exports/");
|
||||
// }
|
||||
|
||||
if (!dir.exists("exports/sounds/")) {
|
||||
dir.mkdir("exports/sounds/");
|
||||
}
|
||||
// if (!dir.exists("exports/sounds/")) {
|
||||
// dir.mkdir("exports/sounds/");
|
||||
// }
|
||||
|
||||
const QString fileName = "exports/sounds/" + sound.path.split('/').last();
|
||||
QFile wavFile(fileName);
|
||||
if (!wavFile.open(QIODevice::WriteOnly)) {
|
||||
qDebug() << "Failed to write wav file!";
|
||||
return;
|
||||
}
|
||||
wavFile.write(sound.data);
|
||||
wavFile.close();
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// const QString fileName = "exports/sounds/" + sound.path.split('/').last();
|
||||
// QFile wavFile(fileName);
|
||||
// if (!wavFile.open(QIODevice::WriteOnly)) {
|
||||
// qDebug() << "Failed to write wav file!";
|
||||
// return;
|
||||
// }
|
||||
// wavFile.write(sound.data);
|
||||
// wavFile.close();
|
||||
// });
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
} else if (activeItem && activeText == "Sounds") {
|
||||
XTreeWidgetItem *parentItem = dynamic_cast<XTreeWidgetItem*>(activeItem->parent());
|
||||
@ -560,39 +577,39 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
|
||||
}
|
||||
if (parentItem && parentItem != invisibleRootItem() && parentItem->text(0).contains(".zone")) {
|
||||
const QString fileStem = parentItem->text(0).section('.', 0, 0);
|
||||
auto zoneFile = mZoneFiles[fileStem];
|
||||
//auto zoneFile = mZoneFiles[fileStem];
|
||||
|
||||
QMenu *exportSubmenu = new QMenu("Export...", this);
|
||||
contextMenu->addMenu(exportSubmenu);
|
||||
|
||||
QAction *exportAllWAVAction = new QAction("Export ALL as WAV Files");
|
||||
exportSubmenu->addAction(exportAllWAVAction);
|
||||
connect(exportAllWAVAction, &QAction::triggered, this, [zoneFile](bool checked) {
|
||||
connect(exportAllWAVAction, &QAction::triggered, this, [](bool checked) {
|
||||
Q_UNUSED(checked);
|
||||
|
||||
for (SoundAsset soundAsset : zoneFile->GetAssetMap().sounds) {
|
||||
for (Sound sound : soundAsset.sounds) {
|
||||
if (!sound.dataLength) { continue; }
|
||||
// for (LoadedSound LoadedSound : zoneFile->GetAssetMap().sounds) {
|
||||
// for (Sound sound : LoadedSound.sounds) {
|
||||
// if (!sound.dataLength) { continue; }
|
||||
|
||||
QDir dir = QDir::currentPath();
|
||||
if (!dir.exists("exports/")) {
|
||||
dir.mkdir("exports/");
|
||||
}
|
||||
// QDir dir = QDir::currentPath();
|
||||
// if (!dir.exists("exports/")) {
|
||||
// dir.mkdir("exports/");
|
||||
// }
|
||||
|
||||
if (!dir.exists("exports/sounds/")) {
|
||||
dir.mkdir("exports/sounds/");
|
||||
}
|
||||
// if (!dir.exists("exports/sounds/")) {
|
||||
// dir.mkdir("exports/sounds/");
|
||||
// }
|
||||
|
||||
const QString fileName = "exports/sounds/" + sound.path.split('/').last();
|
||||
QFile wavFile(fileName);
|
||||
if (!wavFile.open(QIODevice::WriteOnly)) {
|
||||
qDebug() << "Failed to write wav file!";
|
||||
return;
|
||||
}
|
||||
wavFile.write(sound.data);
|
||||
wavFile.close();
|
||||
}
|
||||
}
|
||||
// const QString fileName = "exports/sounds/" + sound.path.split('/').last();
|
||||
// QFile wavFile(fileName);
|
||||
// if (!wavFile.open(QIODevice::WriteOnly)) {
|
||||
// qDebug() << "Failed to write wav file!";
|
||||
// return;
|
||||
// }
|
||||
// wavFile.write(sound.data);
|
||||
// wavFile.close();
|
||||
// }
|
||||
// }
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -612,95 +629,58 @@ void XTreeWidget::ItemSelectionChanged() {
|
||||
QString selectedText = selectedItem->text(0);
|
||||
emit ItemSelected(selectedText);
|
||||
|
||||
const QString fileStem = selectedText.section(".", 0, 0);
|
||||
|
||||
XTreeWidgetItem *parentItem = dynamic_cast<XTreeWidgetItem*>(selectedItem->parent());
|
||||
|
||||
if (selectedText.contains(".dds")) {
|
||||
if (!mDDSFiles.contains(fileStem)) {
|
||||
LogManager::instance().addError("Could not find " + fileStem + " in DDS map!");
|
||||
/*if (selectedText.contains(".dds")) {
|
||||
if (!mDDSFiles.contains(selectedText)) {
|
||||
LogManager::instance().addError("Could not find " + selectedText + " in DDS map!");
|
||||
return;
|
||||
}
|
||||
std::shared_ptr<DDSFile> ddsFile = mDDSFiles[fileStem];
|
||||
emit DDSFileSelected(ddsFile, fileStem);
|
||||
emit DDSFileSelected(mDDSFiles[selectedText], selectedText);
|
||||
} else if (selectedText.contains(".iwi")) {
|
||||
if (!mIWIFiles.contains(fileStem)) {
|
||||
LogManager::instance().addError("Could not find " + fileStem + " in IWI map!");
|
||||
if (!mIWIFiles.contains(selectedText)) {
|
||||
LogManager::instance().addError("Could not find " + selectedText + " in IWI map!");
|
||||
return;
|
||||
}
|
||||
emit IWIFileSelected(mIWIFiles[fileStem], fileStem);
|
||||
} else if (selectedText.contains(".ff")) {
|
||||
if (!mFastFiles.contains(fileStem)) {
|
||||
LogManager::instance().addError("Could not find " + fileStem + " in Fast File map!");
|
||||
emit IWIFileSelected(mIWIFiles[selectedText], selectedText);
|
||||
} else */if (selectedText.contains(".ff")) {
|
||||
if (!mFastFiles.contains(selectedText)) {
|
||||
LogManager::instance().addError("Could not find " + selectedText + " in Fast File map!");
|
||||
return;
|
||||
}
|
||||
emit FastFileSelected(mFastFiles[fileStem], fileStem);
|
||||
emit FastFileSelected(mFastFiles[selectedText], selectedText);
|
||||
} else if (selectedText.contains(".zone")) {
|
||||
if (!mZoneFiles.contains(fileStem)) {
|
||||
LogManager::instance().addError("Could not find " + fileStem + " in Zone File map!");
|
||||
if (!mZoneFiles.contains(selectedText)) {
|
||||
LogManager::instance().addError("Could not find " + selectedText + " in Zone File map!");
|
||||
return;
|
||||
}
|
||||
emit ZoneFileSelected(mZoneFiles[fileStem], fileStem);
|
||||
emit ZoneFileSelected(mZoneFiles[selectedText], selectedText);
|
||||
} else if (selectedText.contains(".str")) {
|
||||
if (!mZoneFiles.contains(fileStem)) {
|
||||
LogManager::instance().addError("Could not find " + fileStem + " in Zone File map!");
|
||||
if (!mZoneFiles.contains(selectedText.replace(".str", ".zone"))) {
|
||||
LogManager::instance().addError("Could not find " + selectedText + " in Zone File map!");
|
||||
return;
|
||||
}
|
||||
emit LocalStringSelected(mZoneFiles[fileStem], fileStem);
|
||||
} else if (selectedText.contains(".gsc")) {
|
||||
XTreeWidgetItem *zoneRoot = selectedItem;
|
||||
if (!zoneRoot) { return; }
|
||||
|
||||
while (!zoneRoot->text(0).contains(".zone")) {
|
||||
zoneRoot = dynamic_cast<XTreeWidgetItem*>(zoneRoot->parent());
|
||||
if (!zoneRoot) { return; }
|
||||
}
|
||||
|
||||
const QString fileStem = zoneRoot->text(0).section('.', 0, 0);
|
||||
if (!mZoneFiles.contains(fileStem)) {
|
||||
LogManager::instance().addError("Could not find " + fileStem + " in Zone File map!");
|
||||
return;
|
||||
}
|
||||
|
||||
QVector<RawFile> rawFiles = mZoneFiles[fileStem]->GetAssetMap().rawFiles;
|
||||
for (RawFile rawFile : rawFiles) {
|
||||
if (rawFile.path.contains(selectedText)) {
|
||||
emit RawFileSelected(std::make_shared<RawFile>(rawFile), fileStem);
|
||||
return;
|
||||
}
|
||||
}
|
||||
emit LocalStringSelected(mZoneFiles[selectedText], selectedText);
|
||||
} else if (parentItem && (parentItem->text(0) == "Images")) {
|
||||
XTreeWidgetItem *grandpaItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent());
|
||||
if (grandpaItem && grandpaItem->text(0).contains(".zone")) {
|
||||
const QString fileStem = grandpaItem->text(0).section('.', 0, 0);
|
||||
QVector<Image> images = mZoneFiles[fileStem]->GetAssetMap().images;
|
||||
for (Image image : images) {
|
||||
if (image.materialName == selectedText) {
|
||||
emit ImageSelected(std::make_shared<Image>(image), fileStem);
|
||||
break;
|
||||
// QVector<Image> images = mZoneFiles[fileStem]->GetAssetMap().images;
|
||||
// for (Image image : images) {
|
||||
// if (image.materialName == selectedText) {
|
||||
// emit ImageSelected(std::make_shared<Image>(image), fileStem);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (parentItem && (parentItem->text(0) == "Tech Sets")) {
|
||||
} /*else if (parentItem && (parentItem->text(0) == "Tech Sets")) {
|
||||
XTreeWidgetItem *grandpaItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent());
|
||||
if (grandpaItem && grandpaItem->text(0).contains(".zone")) {
|
||||
const QString fileStem = grandpaItem->text(0).section('.', 0, 0);
|
||||
auto techsets = mZoneFiles[fileStem]->GetAssetMap().techSets;
|
||||
auto techsets = mZoneFiles[fileStem]->GetAssetList().techSets;
|
||||
for (auto techset : techsets) {
|
||||
if (techset.name == selectedText) {
|
||||
emit TechSetSelected(std::make_shared<TechSet>(techset), fileStem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (parentItem && (parentItem->text(0) == "Tech Sets")) {
|
||||
XTreeWidgetItem *grandpaItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent());
|
||||
if (grandpaItem && grandpaItem->text(0).contains(".zone")) {
|
||||
const QString fileStem = grandpaItem->text(0).section('.', 0, 0);
|
||||
auto techsets = mZoneFiles[fileStem]->GetAssetMap().techSets;
|
||||
for (auto techset : techsets) {
|
||||
if (techset.name == selectedText) {
|
||||
emit TechSetSelected(std::make_shared<TechSet>(techset), fileStem);
|
||||
emit TechSetSelected(new MaterialTechSet(techset), fileStem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -709,12 +689,12 @@ void XTreeWidget::ItemSelectionChanged() {
|
||||
XTreeWidgetItem *grandpaItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent());
|
||||
if (grandpaItem && grandpaItem->text(0).contains(".zone")) {
|
||||
const QString fileStem = grandpaItem->text(0).section('.', 0, 0);
|
||||
QVector<Material> materials = mZoneFiles[fileStem]->GetAssetMap().materials;
|
||||
for (Material material : materials) {
|
||||
if (material.name == selectedText) {
|
||||
emit MaterialSelected(std::make_shared<Material>(material), fileStem);
|
||||
break;
|
||||
}
|
||||
auto materials = mZoneFiles[fileStem]->GetAssetMap().materials;
|
||||
for (auto material : materials) {
|
||||
// if (material.name == selectedText) {
|
||||
// emit MaterialSelected(std::make_shared<Material>(material), fileStem);
|
||||
// break;
|
||||
// }
|
||||
}
|
||||
}
|
||||
} else if (parentItem && selectedText.contains(".wav")) {
|
||||
@ -728,20 +708,46 @@ void XTreeWidget::ItemSelectionChanged() {
|
||||
}
|
||||
if (grandpaItem && grandpaItem != invisibleRootItem() && grandpaItem->text(0).contains(".zone")) {
|
||||
const QString fileStem = grandpaItem->text(0).section('.', 0, 0);
|
||||
QVector<SoundAsset> soundAssets = mZoneFiles[fileStem]->GetAssetMap().sounds;
|
||||
for (SoundAsset soundAsset : soundAssets) {
|
||||
for (Sound sound : soundAsset.sounds) {
|
||||
if (sound.path.contains(selectedText)) {
|
||||
emit SoundSelected(std::make_shared<Sound>(sound), fileStem);
|
||||
// QVector<LoadedSound> LoadedSounds = mZoneFiles[fileStem]->GetAssetMap().sounds;
|
||||
// for (LoadedSound LoadedSound : LoadedSounds) {
|
||||
// for (Sound sound : LoadedSound.sounds) {
|
||||
// if (sound.path.contains(selectedText)) {
|
||||
// emit SoundSelected(std::make_shared<Sound>(sound), fileStem);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
} else if (selectedItem->GetCategory() != CATEGORY_TYPE) {
|
||||
XTreeWidgetItem *zoneRoot = selectedItem;
|
||||
|
||||
bool zoneChild = false;
|
||||
while (zoneRoot) {
|
||||
zoneRoot = dynamic_cast<XTreeWidgetItem*>(zoneRoot->parent());
|
||||
if (zoneRoot->text(0).contains("Raw Files")) {
|
||||
zoneChild = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!zoneChild) { return; }
|
||||
const QString fileStem = zoneRoot->parent()->text(0);
|
||||
|
||||
if (!mZoneFiles.contains(fileStem)) {
|
||||
LogManager::instance().addError("Could not find " + fileStem + " in Zone File map!");
|
||||
return;
|
||||
}
|
||||
|
||||
auto rawFiles = mZoneFiles[fileStem]->GetAssetMap().rawFiles;
|
||||
for (auto rawFile : rawFiles) {
|
||||
//if (rawFile->path.split('/').last() == selectedText) {
|
||||
// emit RawFileSelected(std::make_shared<RawFile>(rawFile), fileStem);
|
||||
// return;
|
||||
//}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
std::shared_ptr<ZoneFile> XTreeWidget::FindZoneFile(const QString aStem) {
|
||||
const ZoneFile* XTreeWidget::FindZoneFile(const QString aStem) {
|
||||
foreach (auto zoneFile, mZoneFiles) {
|
||||
if (zoneFile->GetStem() == aStem) {
|
||||
return zoneFile;
|
||||
@ -750,7 +756,7 @@ std::shared_ptr<ZoneFile> XTreeWidget::FindZoneFile(const QString aStem) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<FastFile> XTreeWidget::FindFastFile(const QString aStem) {
|
||||
const FastFile *XTreeWidget::FindFastFile(const QString aStem) {
|
||||
foreach (auto fastFile, mFastFiles) {
|
||||
if (fastFile->GetStem() == aStem) {
|
||||
return fastFile;
|
||||
@ -767,7 +773,7 @@ bool XTreeWidget::HasFastFile(const QString aStem) {
|
||||
return FindFastFile(aStem) != nullptr;
|
||||
}
|
||||
|
||||
void XTreeWidget::AddIWIFile(std::shared_ptr<IWIFile> aIWIFile) {
|
||||
void XTreeWidget::AddIWIFile(IWIFile* aIWIFile) {
|
||||
const QString iwiFileName = QString(aIWIFile->fileStem + ".iwi");
|
||||
|
||||
for (int i = 0; i < invisibleRootItem()->childCount(); i++) {
|
||||
@ -778,12 +784,12 @@ void XTreeWidget::AddIWIFile(std::shared_ptr<IWIFile> aIWIFile) {
|
||||
}
|
||||
|
||||
XTreeWidgetItem *iwiItem = new XTreeWidgetItem(this);
|
||||
iwiItem->setIcon(0, QIcon(":/icons/icons/Icon_IWIFile.png"));
|
||||
iwiItem->setIcon(0, Utils::CreateAssetIcon(ASSET_TYPE_IMAGE));
|
||||
iwiItem->setText(0, iwiFileName);
|
||||
mIWIFiles[aIWIFile->fileStem.section(".", 0, 0)] = aIWIFile;
|
||||
}
|
||||
|
||||
void XTreeWidget::AddDDSFile(std::shared_ptr<DDSFile> aDDSFile) {
|
||||
void XTreeWidget::AddDDSFile(DDSFile* aDDSFile) {
|
||||
const QString ddsFileName = QString(aDDSFile->fileStem + ".dds");
|
||||
|
||||
for (int i = 0; i < invisibleRootItem()->childCount(); i++) {
|
||||
@ -794,7 +800,7 @@ void XTreeWidget::AddDDSFile(std::shared_ptr<DDSFile> aDDSFile) {
|
||||
}
|
||||
|
||||
XTreeWidgetItem *ddsItem = new XTreeWidgetItem(this);
|
||||
ddsItem->setIcon(0, QIcon(":/icons/icons/Icon_DDSFile.png"));
|
||||
ddsItem->setIcon(0, Utils::CreateAssetIcon(ASSET_TYPE_IMAGE));
|
||||
ddsItem->setText(0, ddsFileName);
|
||||
mDDSFiles[aDDSFile->fileStem.section(".", 0, 0)] = aDDSFile;
|
||||
}
|
||||
|
||||
@ -2,14 +2,19 @@
|
||||
#define XTREEWIDGET_H
|
||||
|
||||
#include "d3dbsp_structs.h"
|
||||
#include "asset_structs.h"
|
||||
#include "ddsfile.h"
|
||||
#include "iwifile.h"
|
||||
#include "fastfile.h"
|
||||
#include "xloadedsound.h"
|
||||
#include "xtreewidgetitem.h"
|
||||
#include "zonefile.h"
|
||||
#include "xrawfile.h"
|
||||
#include "xgfximage.h"
|
||||
#include "xstringtable.h"
|
||||
#include "xmenudef.h"
|
||||
|
||||
#include <QTreeWidget>
|
||||
#include <QFileDialog>
|
||||
|
||||
class XTreeWidget : public QTreeWidget
|
||||
{
|
||||
@ -18,31 +23,31 @@ public:
|
||||
explicit XTreeWidget(QWidget *parent = nullptr);
|
||||
~XTreeWidget();
|
||||
|
||||
void AddFastFile(std::shared_ptr<FastFile> aFastFile);
|
||||
void AddZoneFile(std::shared_ptr<ZoneFile> aZoneFile, XTreeWidgetItem *aParentItem = nullptr);
|
||||
void AddIWIFile(std::shared_ptr<IWIFile> aIWIFile);
|
||||
void AddDDSFile(std::shared_ptr<DDSFile> aDDSFile);
|
||||
void AddFastFile(FastFile* aFastFile);
|
||||
void AddZoneFile(const ZoneFile *aZoneFile, XTreeWidgetItem *aParentItem = nullptr);
|
||||
void AddIWIFile(IWIFile* aIWIFile);
|
||||
void AddDDSFile(DDSFile* aDDSFile);
|
||||
|
||||
std::shared_ptr<ZoneFile> FindZoneFile(const QString aStem);
|
||||
std::shared_ptr<FastFile> FindFastFile(const QString aStem);
|
||||
const ZoneFile *FindZoneFile(const QString aStem);
|
||||
const FastFile* FindFastFile(const QString aStem);
|
||||
|
||||
bool HasZoneFile(const QString aStem);
|
||||
bool HasFastFile(const QString aStem);
|
||||
|
||||
void CloseFastFile(const QString aFFName);
|
||||
signals:
|
||||
void DDSFileSelected(std::shared_ptr<DDSFile> aDDSFile, const QString aParentName);
|
||||
void IWIFileSelected(std::shared_ptr<IWIFile> aIWIFile, const QString aParentName);
|
||||
void FastFileSelected(std::shared_ptr<FastFile> aFastFile, const QString aParentName);
|
||||
void ZoneFileSelected(std::shared_ptr<ZoneFile> aZoneFile, const QString aParentName);
|
||||
void LocalStringSelected(std::shared_ptr<ZoneFile> aZoneFile, const QString aParentName);
|
||||
void RawFileSelected(std::shared_ptr<RawFile> aRawFile, const QString aParentName);
|
||||
void ImageSelected(std::shared_ptr<Image> aImage, const QString aParentName);
|
||||
void TechSetSelected(std::shared_ptr<TechSet> aZoneFile, const QString aParentName);
|
||||
void StrTableSelected(std::shared_ptr<StringTable> aStrTable, const QString aParentName);
|
||||
void MenuSelected(std::shared_ptr<Menu> aMenu, const QString aParentName);
|
||||
void SoundSelected(std::shared_ptr<Sound> aSound, const QString aParentName);
|
||||
void MaterialSelected(std::shared_ptr<Material> aMaterial, const QString aParentName);
|
||||
void DDSFileSelected(const DDSFile* aDDSFile, const QString aParentName);
|
||||
void IWIFileSelected(const IWIFile* aIWIFile, const QString aParentName);
|
||||
void FastFileSelected(const FastFile* aFastFile, const QString aParentName);
|
||||
void ZoneFileSelected(const ZoneFile* aZoneFile, const QString aParentName);
|
||||
void LocalStringSelected(const ZoneFile* aZoneFile, const QString aParentName);
|
||||
void RawFileSelected(const XRawFile* aRawFile, const QString aParentName);
|
||||
void ImageSelected(const XGfxImage* aImage, const QString aParentName);
|
||||
void TechSetSelected(const XMaterialTechniqueSet* aZoneFile, const QString aParentName);
|
||||
void StrTableSelected(const XStringTable* aStrTable, const QString aParentName);
|
||||
void MenuSelected(const XMenuDef* aMenu, const QString aParentName);
|
||||
void SoundSelected(const XLoadedSound* aSound, const QString aParentName);
|
||||
void MaterialSelected(const XMaterial* aMaterial, const QString aParentName);
|
||||
void ItemSelected(const QString itemText);
|
||||
|
||||
void ItemClosed(const QString itemText);
|
||||
@ -53,10 +58,10 @@ protected:
|
||||
void PrepareContextMenu(const QPoint &pos);
|
||||
|
||||
private:
|
||||
QMap<QString, std::shared_ptr<FastFile>> mFastFiles;
|
||||
QMap<QString, std::shared_ptr<ZoneFile>> mZoneFiles;
|
||||
QMap<QString, std::shared_ptr<DDSFile>> mDDSFiles;
|
||||
QMap<QString, std::shared_ptr<IWIFile>> mIWIFiles;
|
||||
QMap<QString, const FastFile*> mFastFiles;
|
||||
QMap<QString, const ZoneFile*> mZoneFiles;
|
||||
QMap<QString, const DDSFile*> mDDSFiles;
|
||||
QMap<QString, const IWIFile*> mIWIFiles;
|
||||
};
|
||||
|
||||
#endif // XTREEWIDGET_H
|
||||
|
||||
@ -1,15 +1,29 @@
|
||||
#include "xtreewidgetitem.h"
|
||||
|
||||
XTreeWidgetItem::XTreeWidgetItem(QTreeWidget *parent, bool group)
|
||||
: QTreeWidgetItem(parent), isGroup(group) {
|
||||
: QTreeWidgetItem(parent)
|
||||
, isGroup(group)
|
||||
, mCategory(CATEGORY_NONE) {
|
||||
|
||||
}
|
||||
|
||||
XTreeWidgetItem::XTreeWidgetItem(QTreeWidgetItem *parent, bool group)
|
||||
: QTreeWidgetItem(parent), isGroup(group) {
|
||||
: QTreeWidgetItem(parent)
|
||||
, isGroup(group)
|
||||
, mCategory(CATEGORY_NONE) {
|
||||
|
||||
}
|
||||
|
||||
void XTreeWidgetItem::SetCategory(TREE_CATEGORY category)
|
||||
{
|
||||
mCategory = category;
|
||||
}
|
||||
|
||||
TREE_CATEGORY XTreeWidgetItem::GetCategory()
|
||||
{
|
||||
return mCategory;
|
||||
}
|
||||
|
||||
bool XTreeWidgetItem::operator<(const QTreeWidgetItem &other) const {
|
||||
// Attempt to cast the other item to our custom type.
|
||||
const XTreeWidgetItem* otherItem = dynamic_cast<const XTreeWidgetItem*>(&other);
|
||||
|
||||
@ -4,6 +4,12 @@
|
||||
#include <QTreeWidget>
|
||||
#include <QTreeWidgetItem>
|
||||
|
||||
enum TREE_CATEGORY {
|
||||
CATEGORY_NONE = 0x00,
|
||||
CATEGORY_FILE = 0x01,
|
||||
CATEGORY_TYPE = 0x02
|
||||
};
|
||||
|
||||
// Custom item class
|
||||
class XTreeWidgetItem : public QTreeWidgetItem
|
||||
{
|
||||
@ -15,9 +21,15 @@ public:
|
||||
XTreeWidgetItem(QTreeWidget *parent, bool group = false);
|
||||
XTreeWidgetItem(QTreeWidgetItem *parent, bool group = false);
|
||||
|
||||
void SetCategory(TREE_CATEGORY category);
|
||||
TREE_CATEGORY GetCategory();
|
||||
|
||||
// Override the less-than operator to customize sorting.
|
||||
bool operator<(const QTreeWidgetItem &other) const override;
|
||||
XTreeWidgetItem &operator =(const XTreeWidgetItem &other);
|
||||
|
||||
private:
|
||||
TREE_CATEGORY mCategory;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -1,34 +1,86 @@
|
||||
#include "zonefileviewer.h"
|
||||
#include "ui_zonefileviewer.h"
|
||||
|
||||
#include "statusbarmanager.h"
|
||||
|
||||
ZoneFileViewer::ZoneFileViewer(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::ZoneFileViewer) {
|
||||
ui->setupUi(this);
|
||||
|
||||
aZoneFile = nullptr;
|
||||
mZoneFile = nullptr;
|
||||
|
||||
ui->tableWidget_RecordCounts->setColumnCount(4);
|
||||
ui->tableWidget_RecordCounts->setHorizontalHeaderLabels({ "Identifier", "Asset", "Count", "Icon" });
|
||||
ui->tableWidget_RecordCounts->setColumnCount(3);
|
||||
ui->tableWidget_RecordCounts->setHorizontalHeaderLabels({ "Identifier", "Asset", "Count" });
|
||||
ui->tableWidget_RecordCounts->horizontalHeader()->setStretchLastSection(true);
|
||||
|
||||
ui->tableWidget_RecordOrder->setColumnCount(4);
|
||||
ui->tableWidget_RecordOrder->setHorizontalHeaderLabels({ "Identifier", "Asset", "Count", "Icon" });
|
||||
ui->tableWidget_RecordOrder->setColumnCount(3);
|
||||
ui->tableWidget_RecordOrder->setHorizontalHeaderLabels({ "Identifier", "Asset", "Count" });
|
||||
ui->tableWidget_RecordOrder->horizontalHeader()->setStretchLastSection(true);
|
||||
|
||||
connect(ui->lineEdit_TagSearch, &QLineEdit::textChanged, this, &ZoneFileViewer::SortTags);
|
||||
connect(ui->tableWidget_RecordCounts, &QTableWidget::itemSelectionChanged, this, &ZoneFileViewer::HighlightRecordInOrder);
|
||||
connect(ui->listWidget_Tags, &QListWidget::currentTextChanged, this, [this](const QString &aCurrentText) {
|
||||
StatusBarManager::instance().updateStatus(QString("Selected tag '%1' with index %2").arg(aCurrentText).arg(mZoneFile->GetTags().indexOf(aCurrentText)));
|
||||
});
|
||||
}
|
||||
|
||||
ZoneFileViewer::~ZoneFileViewer() {
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ZoneFileViewer::SetZoneFile(std::shared_ptr<ZoneFile> aZoneFile) {
|
||||
void ZoneFileViewer::HighlightRecordInOrder() {
|
||||
ui->tableWidget_RecordOrder->clearSelection();
|
||||
|
||||
foreach (auto selectedItem, ui->tableWidget_RecordCounts->selectedItems()) {
|
||||
int selectedRow = selectedItem->row();
|
||||
const QString assetId = ui->tableWidget_RecordCounts->item(selectedRow, 0)->text();
|
||||
|
||||
for (int i = 0; i < ui->tableWidget_RecordOrder->rowCount(); i++) {
|
||||
const QString testAssetId = ui->tableWidget_RecordOrder->item(i, 0)->text();
|
||||
if (testAssetId != assetId) { continue; }
|
||||
|
||||
ui->tableWidget_RecordOrder->selectRow(i);
|
||||
ui->tableWidget_RecordOrder->item(i, 0)->setSelected(true);
|
||||
ui->tableWidget_RecordOrder->item(i, 1)->setSelected(true);
|
||||
ui->tableWidget_RecordOrder->item(i, 2)->setSelected(true);
|
||||
ui->tableWidget_RecordOrder->item(i, 3)->setSelected(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ZoneFileViewer::SortTags(const QString &aSearchText) {
|
||||
ui->listWidget_Tags->clear();
|
||||
|
||||
const QStringList tags = mZoneFile->GetTags();
|
||||
if (aSearchText.isEmpty()) {
|
||||
ui->listWidget_Tags->addItems(tags);
|
||||
return;
|
||||
}
|
||||
|
||||
QStringList sortedTags;
|
||||
foreach (const QString tag, tags) {
|
||||
if (tag.contains(aSearchText)) {
|
||||
sortedTags << tag;
|
||||
}
|
||||
}
|
||||
|
||||
StatusBarManager::instance().updateStatus(QString("Found %1 tags.").arg(sortedTags.size()));
|
||||
ui->listWidget_Tags->addItems(sortedTags);
|
||||
}
|
||||
|
||||
void ZoneFileViewer::SetZoneFile(const ZoneFile* aZoneFile) {
|
||||
mZoneFile = aZoneFile;
|
||||
|
||||
ui->tableWidget_RecordCounts->clearContents();
|
||||
ui->tableWidget_RecordOrder->clearContents();
|
||||
ui->listWidget_Tags->clear();
|
||||
|
||||
const QStringList tags = aZoneFile->GetTags();
|
||||
const QStringList tags = mZoneFile->GetTags();
|
||||
ui->listWidget_Tags->addItems(tags);
|
||||
ui->label_Title->setText(aZoneFile->GetStem() + ".zone");
|
||||
ui->label_Title->setText(mZoneFile->GetBaseStem() + ".zone");
|
||||
|
||||
ui->groupBox_Tags->setTitle(QString("Tags (%1)").arg(tags.size()));
|
||||
|
||||
if (tags.isEmpty()) {
|
||||
ui->groupBox_Tags->hide();
|
||||
@ -36,88 +88,65 @@ void ZoneFileViewer::SetZoneFile(std::shared_ptr<ZoneFile> aZoneFile) {
|
||||
ui->groupBox_Tags->show();
|
||||
}
|
||||
|
||||
QString lastAsset = "";
|
||||
QString lastRecord = "";
|
||||
QIcon assetIcon;
|
||||
int consecutiveCount = 1;
|
||||
int consecutiveIndex = 0;
|
||||
const QStringList records = aZoneFile->GetRecords();
|
||||
QMap<QString, int> recordCounts = QMap<QString, int>();
|
||||
for (const QString &record : records) {
|
||||
lastRecord = record;
|
||||
if (record == "ffffffff") { break; }
|
||||
if (!recordCounts.contains(record)) {
|
||||
recordCounts[record] = 0;
|
||||
QMap<XAssetType, int> recordCounts = QMap<XAssetType, int>();
|
||||
QVector<QPair<XAssetType, int>> assetOccurances = QVector<QPair<XAssetType, int>>();
|
||||
for (XAssetType type : mZoneFile->GetTypes()) {
|
||||
if (!recordCounts.contains(type)) {
|
||||
recordCounts[type] = 0;
|
||||
}
|
||||
recordCounts[record]++;
|
||||
recordCounts[type]++;
|
||||
|
||||
QString assetType = aZoneFile->AssetTypeToString(record);
|
||||
if (!assetOccurances.isEmpty() && assetOccurances.last().first == type) {
|
||||
assetOccurances.last().second++;
|
||||
continue;
|
||||
}
|
||||
|
||||
QPair<XAssetType, int> assetOccurance(type, 1);
|
||||
assetOccurances << assetOccurance;
|
||||
}
|
||||
ui->tableWidget_RecordOrder->setRowCount(assetOccurances.size());
|
||||
|
||||
int assetIndex = 0;
|
||||
foreach (auto assetOccurance, assetOccurances) {
|
||||
XAssetType assetType = assetOccurance.first;
|
||||
int assetCount = assetOccurance.second;
|
||||
|
||||
QIcon assetIcon = Utils::CreateAssetIcon(assetType);
|
||||
if (assetIcon.isNull()) {
|
||||
qDebug() << "Icon is null for record: " << record;
|
||||
qDebug() << "Icon is null for record: " << assetType;
|
||||
}
|
||||
|
||||
if (lastAsset.isEmpty()) {
|
||||
lastAsset = assetType;
|
||||
lastRecord = record;
|
||||
} else if (lastAsset == assetType) {
|
||||
consecutiveCount++;
|
||||
} else {
|
||||
ui->tableWidget_RecordOrder->setRowCount(consecutiveIndex + 1);
|
||||
QTableWidgetItem *recordItem = new QTableWidgetItem(QString::number(assetType, 16));
|
||||
QTableWidgetItem *recordStrItem = new QTableWidgetItem(XAsset::XAssetTypeToString(assetType));
|
||||
QTableWidgetItem *recordCountItem = new QTableWidgetItem(QString::number(assetCount));
|
||||
recordItem->setIcon(assetIcon);
|
||||
|
||||
QTableWidgetItem *recordItem = new QTableWidgetItem(lastRecord.toUpper());
|
||||
QTableWidgetItem *recordStrItem = new QTableWidgetItem(lastAsset);
|
||||
QTableWidgetItem *recordCountItem = new QTableWidgetItem(QString::number(consecutiveCount));
|
||||
QTableWidgetItem *recordIconItem = new QTableWidgetItem();
|
||||
assetIcon = aZoneFile->AssetStrToIcon(lastAsset);
|
||||
recordIconItem->setIcon(assetIcon);
|
||||
ui->tableWidget_RecordOrder->setItem(assetIndex, 0, recordItem);
|
||||
ui->tableWidget_RecordOrder->setItem(assetIndex, 1, recordStrItem);
|
||||
ui->tableWidget_RecordOrder->setItem(assetIndex, 2, recordCountItem);
|
||||
|
||||
ui->tableWidget_RecordOrder->setItem(consecutiveIndex, 0, recordItem);
|
||||
ui->tableWidget_RecordOrder->setItem(consecutiveIndex, 1, recordStrItem);
|
||||
ui->tableWidget_RecordOrder->setItem(consecutiveIndex, 2, recordCountItem);
|
||||
ui->tableWidget_RecordOrder->setItem(consecutiveIndex, 3, recordIconItem);
|
||||
|
||||
consecutiveCount = 1;
|
||||
consecutiveIndex++;
|
||||
lastAsset = assetType;
|
||||
lastRecord = record;
|
||||
assetIndex++;
|
||||
}
|
||||
}
|
||||
ui->tableWidget_RecordOrder->setRowCount(consecutiveIndex + 1);
|
||||
|
||||
QTableWidgetItem *recordItem = new QTableWidgetItem(lastRecord.toUpper());
|
||||
QTableWidgetItem *recordStrItem = new QTableWidgetItem(lastAsset);
|
||||
QTableWidgetItem *recordCountItem = new QTableWidgetItem(QString::number(consecutiveCount));
|
||||
QTableWidgetItem *recordIconItem = new QTableWidgetItem();
|
||||
assetIcon = aZoneFile->AssetStrToIcon(lastAsset);
|
||||
recordIconItem->setIcon(assetIcon);
|
||||
|
||||
ui->tableWidget_RecordOrder->setItem(consecutiveIndex, 0, recordItem);
|
||||
ui->tableWidget_RecordOrder->setItem(consecutiveIndex, 1, recordStrItem);
|
||||
ui->tableWidget_RecordOrder->setItem(consecutiveIndex, 2, recordCountItem);
|
||||
ui->tableWidget_RecordOrder->setItem(consecutiveIndex, 3, recordIconItem);
|
||||
|
||||
int recordIndex = 0;
|
||||
for (const QString &record : recordCounts.keys()) {
|
||||
int recordCount = recordCounts[record];
|
||||
for (XAssetType assetType : recordCounts.keys()) {
|
||||
int recordCount = recordCounts[assetType];
|
||||
|
||||
QString assetType = aZoneFile->AssetTypeToString(record);
|
||||
assetIcon = aZoneFile->AssetStrToIcon(assetType);
|
||||
QIcon assetIcon = Utils::CreateAssetIcon(assetType);
|
||||
if (assetIcon.isNull()) {
|
||||
qDebug() << "Icon is null for record: " << record;
|
||||
qDebug() << "Icon is null for record: " << assetType;
|
||||
}
|
||||
|
||||
ui->tableWidget_RecordCounts->setRowCount(recordIndex + 1);
|
||||
|
||||
QTableWidgetItem *recordCountStrItem = new QTableWidgetItem(assetType);
|
||||
QTableWidgetItem *recordItem = new QTableWidgetItem(record.toUpper());
|
||||
QTableWidgetItem *recordItem = new QTableWidgetItem(QString::number(assetType, 16));
|
||||
QTableWidgetItem *recordCountStrItem = new QTableWidgetItem(XAsset::XAssetTypeToString(assetType));
|
||||
QTableWidgetItem *recordCountItem = new QTableWidgetItem(QString::number(recordCount));
|
||||
QTableWidgetItem *recordIconItem = new QTableWidgetItem();
|
||||
recordIconItem->setIcon(assetIcon);
|
||||
recordItem->setIcon(assetIcon);
|
||||
|
||||
ui->tableWidget_RecordCounts->setItem(recordIndex, 0, recordItem);
|
||||
ui->tableWidget_RecordCounts->setItem(recordIndex, 1, recordCountStrItem);
|
||||
ui->tableWidget_RecordCounts->setItem(recordIndex, 2, recordCountItem);
|
||||
ui->tableWidget_RecordCounts->setItem(recordIndex, 3, recordIconItem);
|
||||
|
||||
recordIndex++;
|
||||
}
|
||||
|
||||
@ -18,10 +18,16 @@ public:
|
||||
explicit ZoneFileViewer(QWidget *parent = nullptr);
|
||||
~ZoneFileViewer();
|
||||
|
||||
void SetZoneFile(std::shared_ptr<ZoneFile> aZoneFile);
|
||||
void SetZoneFile(const ZoneFile *aZoneFile);
|
||||
|
||||
public slots:
|
||||
void SortTags(const QString &aSearchText);
|
||||
|
||||
void HighlightRecordInOrder();
|
||||
|
||||
private:
|
||||
Ui::ZoneFileViewer *ui;
|
||||
std::shared_ptr<ZoneFile> aZoneFile;
|
||||
const ZoneFile* mZoneFile;
|
||||
};
|
||||
|
||||
#endif // ZONEFILEVIEWER_H
|
||||
|
||||
@ -61,7 +61,14 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="listWidget_Tags"/>
|
||||
<widget class="QListWidget" name="listWidget_Tags">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::EditTrigger::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@ -73,7 +80,20 @@
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QTableWidget" name="tableWidget_RecordCounts"/>
|
||||
<widget class="QTableWidget" name="tableWidget_RecordCounts">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::EditTrigger::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SelectionMode::SingleSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectionBehavior::SelectRows</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@ -85,7 +105,17 @@
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QTableWidget" name="tableWidget_RecordOrder"/>
|
||||
<widget class="QTableWidget" name="tableWidget_RecordOrder">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::EditTrigger::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SelectionMode::NoSelection</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
||||
@ -1,26 +1,4 @@
|
||||
<RCC>
|
||||
<qresource prefix="/obj">
|
||||
<file>obj/defaultactor_LOD0.XMODEL_BIN</file>
|
||||
<file>obj/defaultactor_LOD0.XMODEL_EXPORT</file>
|
||||
<file>obj/defaultactor_LOD0.bin</file>
|
||||
<file>obj/defaultactor_LOD0.cast</file>
|
||||
<file>obj/defaultactor_LOD0.gltf</file>
|
||||
<file>obj/defaultactor_LOD0.ma</file>
|
||||
<file>obj/defaultactor_LOD0.mesh.ascii</file>
|
||||
<file>obj/defaultactor_LOD0.obj</file>
|
||||
<file>obj/defaultactor_LOD0.semodel</file>
|
||||
<file>obj/defaultactor_LOD0.smd</file>
|
||||
<file>obj/defaultactor_LOD0_BIND.mel</file>
|
||||
<file>obj/defaultactor_LOD0_cosmetics.mel</file>
|
||||
<file>obj/diffusemap.png</file>
|
||||
<file>obj/mtl_body_default_character.mtl</file>
|
||||
<file>obj/mtl_body_default_character_images.txt</file>
|
||||
<file>obj/normalmap.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/d3dbsp">
|
||||
<file>d3dbsp/asset_viewer.d3dbsp</file>
|
||||
<file>d3dbsp/barebones.d3dbsp</file>
|
||||
</qresource>
|
||||
<qresource prefix="/images">
|
||||
<file>images/XPlor.png</file>
|
||||
<file>images/copy.svg</file>
|
||||
@ -34,28 +12,6 @@
|
||||
<file>images/save.svg</file>
|
||||
</qresource>
|
||||
<qresource prefix="/icons">
|
||||
<file>icons/Icon_COD4.png</file>
|
||||
<file>icons/Icon_COD5.png</file>
|
||||
<file>icons/Icon_COD6.png</file>
|
||||
<file>icons/Icon_COD7.png</file>
|
||||
<file>icons/Icon_COD8.png</file>
|
||||
<file>icons/Icon_COD9.png</file>
|
||||
<file>icons/Icon_DDSFile.png</file>
|
||||
<file>icons/Icon_FastFile.png</file>
|
||||
<file>icons/Icon_IWIFile.png</file>
|
||||
<file>icons/Icon_PC.png</file>
|
||||
<file>icons/Icon_Playstation.png</file>
|
||||
<file>icons/Icon_Xbox.png</file>
|
||||
<file>icons/Icon_ZoneFile.png</file>
|
||||
<file>icons/Icon_GSCFile.png</file>
|
||||
<file>icons/Icon_StringFile.png</file>
|
||||
<file>icons/Icon_TechSetFile.png</file>
|
||||
<file>icons/Icon_WAVFile.png</file>
|
||||
<file>icons/Icon_MenuFile.png</file>
|
||||
<file>icons/Icon_Image.png</file>
|
||||
<file>icons/Icon_Model.png</file>
|
||||
<file>icons/Icon_StringTable.png</file>
|
||||
<file>icons/Icon_Sound.png</file>
|
||||
<file>icons/Icon_Pause.png</file>
|
||||
<file>icons/Icon_Play.png</file>
|
||||
<file>icons/Icon_SkipBack.png</file>
|
||||
@ -64,28 +20,11 @@
|
||||
<file>icons/Icon_Editor.png</file>
|
||||
<file>icons/Icon_Views.png</file>
|
||||
<file>icons/Icon_Tree.png</file>
|
||||
<file>icons/Icon_Copy.png</file>
|
||||
<file>icons/Icon_Cut.png</file>
|
||||
<file>icons/Icon_Find.png</file>
|
||||
<file>icons/Icon_NewFile.png</file>
|
||||
<file>icons/Icon_Paste.png</file>
|
||||
<file>icons/Icon_Save.png</file>
|
||||
<file>icons/Icon_OpenFile.png</file>
|
||||
<file>icons/Icon_COD2.png</file>
|
||||
<file>icons/Icon_Material.png</file>
|
||||
<file>icons/Icon_Animation.png</file>
|
||||
<file>icons/Icon_BSP.png</file>
|
||||
<file>icons/Icon_ColMapSp.png</file>
|
||||
<file>icons/Icon_Effect.png</file>
|
||||
<file>icons/Icon_GameMapSp.png</file>
|
||||
<file>icons/Icon_Font.png</file>
|
||||
<file>icons/Icon_FXMap.png</file>
|
||||
<file>icons/Icon_LightDef.png</file>
|
||||
<file>icons/Icon_Weapon.png</file>
|
||||
<file>icons/Icon_RawFile.png</file>
|
||||
<file>icons/Icon_Destructible.png</file>
|
||||
<file>icons/Icon_PhysPreset.png</file>
|
||||
<file>icons/Icon_Wii.png</file>
|
||||
<file>icons/Icon_WiiU.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
BIN
data/icons/Icon.psd
Normal file
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 316 B |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 855 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
@ -234,7 +234,7 @@
|
||||
"WEIGHTS_0": 6
|
||||
},
|
||||
"indices": 1,
|
||||
"material": 0,
|
||||
ASSET_MATERIAL: 0,
|
||||
"mode": 4
|
||||
}
|
||||
]
|
||||
@ -250,7 +250,7 @@
|
||||
"WEIGHTS_0": 12
|
||||
},
|
||||
"indices": 7,
|
||||
"material": 0,
|
||||
ASSET_MATERIAL: 0,
|
||||
"mode": 4
|
||||
}
|
||||
]
|
||||
|
||||
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 146 B |
@ -1,20 +1,17 @@
|
||||
#include "compression.h"
|
||||
//#include "lzokay.h"
|
||||
|
||||
#define XBOXAPI __declspec(dllimport)
|
||||
#include "minilzo.h"
|
||||
#include "xcompress.h"
|
||||
|
||||
#include <QLibrary>
|
||||
#include <QDebug>
|
||||
#include <QFile>
|
||||
#include <QDataStream>
|
||||
|
||||
QByteArray Compression::CompressXMem(const QByteArray &data)
|
||||
{
|
||||
XMEMCODEC_PARAMETERS_LZX lzxParams = {};
|
||||
lzxParams.Flags = 0;
|
||||
lzxParams.WindowSize = XCOMPRESS_LZX_BLOCK_SIZE;
|
||||
lzxParams.CompressionPartitionSize = XCOMPRESS_LZX_BLOCK_SIZE;
|
||||
lzxParams.WindowSize = 0x20000;
|
||||
lzxParams.CompressionPartitionSize = 0x80000;
|
||||
|
||||
XMEMCOMPRESSION_CONTEXT ctx = nullptr;
|
||||
if (FAILED(XMemCreateCompressionContext(XMEMCODEC_LZX, &lzxParams, 0, &ctx)) || !ctx)
|
||||
@ -34,27 +31,60 @@ QByteArray Compression::CompressXMem(const QByteArray &data)
|
||||
return output;
|
||||
}
|
||||
|
||||
QByteArray Compression::DecompressXMem(const QByteArray &data)
|
||||
QByteArray Compression::DecompressXMem(const QByteArray &data,
|
||||
int flags, int windowSize, int partSize)
|
||||
{
|
||||
if (data.isEmpty())
|
||||
return {};
|
||||
|
||||
XMEMCODEC_PARAMETERS_LZX lzxParams = {};
|
||||
lzxParams.Flags = 0;
|
||||
lzxParams.WindowSize = XCOMPRESS_LZX_BLOCK_SIZE;
|
||||
lzxParams.CompressionPartitionSize = XCOMPRESS_LZX_BLOCK_SIZE;
|
||||
lzxParams.Flags = flags;
|
||||
lzxParams.WindowSize = windowSize;
|
||||
lzxParams.CompressionPartitionSize = partSize;
|
||||
|
||||
XMEMDECOMPRESSION_CONTEXT ctx = nullptr;
|
||||
if (FAILED(XMemCreateDecompressionContext(XMEMCODEC_LZX, &lzxParams, 0, &ctx)) || !ctx)
|
||||
return QByteArray();
|
||||
QByteArray internalState(0x94933, Qt::Uninitialized);
|
||||
|
||||
QByteArray output(data.size(), 0);
|
||||
SIZE_T actualSize = data.size();
|
||||
XMEMDECOMPRESSION_CONTEXT ctx = XMemInitializeDecompressionContext(
|
||||
XMEMCODEC_LZX, &lzxParams, 1,
|
||||
internalState.data(), internalState.size());
|
||||
|
||||
HRESULT hr = XMemDecompress(ctx, output.data(), &actualSize, data.constData(), data.size());
|
||||
if (!ctx || XMemResetDecompressionContext(ctx)) {
|
||||
qWarning() << "Failed to init LZX context";
|
||||
return {};
|
||||
}
|
||||
|
||||
QByteArray output;
|
||||
output.reserve(16 * 1024 * 1024); // rough guess
|
||||
|
||||
const quint8 *nextIn = reinterpret_cast<const quint8*>(data.constData());
|
||||
SIZE_T availIn = data.size();
|
||||
|
||||
QByteArray scratch(0x10000, Qt::Uninitialized); // 64 KB chunks
|
||||
|
||||
while (availIn > 0) {
|
||||
SIZE_T inSize = availIn; // let XMem tell us how much it will consume
|
||||
SIZE_T outSize = scratch.size(); // max 64 KB per call
|
||||
|
||||
HRESULT hr = XMemDecompressStream(ctx,
|
||||
scratch.data(), &outSize,
|
||||
nextIn, &inSize);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
qWarning() << "XMemDecompressStream failed, hr=" << hr;
|
||||
XMemDestroyDecompressionContext(ctx);
|
||||
return {};
|
||||
}
|
||||
|
||||
if (FAILED(hr))
|
||||
return QByteArray();
|
||||
if (inSize == 0 && outSize == 0)
|
||||
break; // no progress
|
||||
|
||||
output.resize(static_cast<int>(actualSize));
|
||||
output.append(scratch.constData(), static_cast<int>(outSize));
|
||||
|
||||
nextIn += inSize;
|
||||
availIn -= inSize;
|
||||
}
|
||||
|
||||
XMemDestroyDecompressionContext(ctx);
|
||||
return output;
|
||||
}
|
||||
|
||||
@ -68,6 +98,45 @@ quint32 Compression::CalculateAdler32Checksum(const QByteArray &data) {
|
||||
return adler;
|
||||
}
|
||||
|
||||
qint64 Compression::FindZlibOffset(const QByteArray &bytes)
|
||||
{
|
||||
QDataStream stream(bytes);
|
||||
|
||||
while (!stream.atEnd())
|
||||
{
|
||||
QByteArray testSegment = stream.device()->peek(2).toHex().toUpper();
|
||||
if (testSegment == "7801" ||
|
||||
testSegment == "785E" ||
|
||||
testSegment == "789C" ||
|
||||
testSegment == "78DA") {
|
||||
return stream.device()->pos();
|
||||
}
|
||||
stream.skipRawData(1);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
QByteArray Compression::StripHashBlocks(const QByteArray &raw,
|
||||
int dataChunkSize,
|
||||
int hashChunkSize)
|
||||
{
|
||||
QByteArray cleaned;
|
||||
cleaned.reserve(raw.size()); // upper bound
|
||||
|
||||
int p = 0;
|
||||
while (p < raw.size())
|
||||
{
|
||||
const int chunk = qMin(dataChunkSize, raw.size() - p);
|
||||
cleaned.append(raw.constData() + p, chunk);
|
||||
p += chunk;
|
||||
|
||||
// skip hash bytes if they are still inside the buffer
|
||||
if (p < raw.size())
|
||||
p += qMin(hashChunkSize, raw.size() - p);
|
||||
}
|
||||
return cleaned;
|
||||
}
|
||||
|
||||
QByteArray Compression::DecompressZLIB(const QByteArray &aCompressedData) {
|
||||
if (aCompressedData.isEmpty()) {
|
||||
return {};
|
||||
@ -95,22 +164,23 @@ QByteArray Compression::DecompressZLIB(const QByteArray &aCompressedData) {
|
||||
|
||||
ret = inflate(&strm, Z_NO_FLUSH);
|
||||
|
||||
if (strm.avail_out < buffer.size()) { // Data has been written to the buffer
|
||||
if (strm.avail_out < buffer.size()) {
|
||||
decompressed.append(buffer.constData(), buffer.size() - strm.avail_out);
|
||||
}
|
||||
|
||||
if (ret == Z_STREAM_END) {
|
||||
break; // Proper end of the data stream
|
||||
break;
|
||||
}
|
||||
|
||||
if (ret == Z_BUF_ERROR && strm.avail_out == 0) {
|
||||
// Buffer was completely used, resize it
|
||||
int newSize = buffer.size() * 2; // Double the buffer size
|
||||
buffer.resize(newSize);
|
||||
buffer.resize(buffer.size() * 2);
|
||||
} else if (ret != Z_OK) {
|
||||
qWarning() << "Zlib error:" << zError(ret);
|
||||
size_t errorOffset = strm.total_in;
|
||||
qWarning() << "Zlib error:" << zError(ret)
|
||||
<< "at offset" << errorOffset
|
||||
<< "of" << aCompressedData.size() << "bytes";
|
||||
inflateEnd(&strm);
|
||||
return {}; // Return on other errors
|
||||
return decompressed;
|
||||
}
|
||||
} while (ret != Z_STREAM_END);
|
||||
|
||||
@ -118,6 +188,7 @@ QByteArray Compression::DecompressZLIB(const QByteArray &aCompressedData) {
|
||||
return decompressed;
|
||||
}
|
||||
|
||||
|
||||
QByteArray Compression::CompressZLIB(const QByteArray &aData) {
|
||||
return CompressZLIBWithSettings(aData);
|
||||
}
|
||||
@ -242,6 +313,28 @@ QByteArray Compression::CompressDeflateWithSettings(const QByteArray &aData, int
|
||||
return compressed;
|
||||
}
|
||||
|
||||
QByteArray Compression::DecompressLZO(const QByteArray &aCompressedData, quint32 aDestSize) {
|
||||
QByteArray dst;
|
||||
static bool ok = (lzo_init() == LZO_E_OK);
|
||||
if (!ok)
|
||||
throw std::runtime_error("lzo_init failed");
|
||||
|
||||
dst = QByteArray(aDestSize, Qt::Uninitialized);
|
||||
lzo_uint out = aDestSize;
|
||||
|
||||
int rc = lzo1x_decompress_safe(
|
||||
reinterpret_cast<const lzo_bytep>(aCompressedData.constData()),
|
||||
static_cast<lzo_uint>(aCompressedData.size()),
|
||||
reinterpret_cast<lzo_bytep>(dst.data()),
|
||||
&out,
|
||||
nullptr);
|
||||
|
||||
if (rc != LZO_E_OK || out != aDestSize)
|
||||
throw std::runtime_error("LZO decompression error");
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
QByteArray Compression::DecompressOodle(const QByteArray &aCompressedData, quint32 aDecompressedSize) {
|
||||
return pDecompressOodle(aCompressedData, aCompressedData.length(), aDecompressedSize);
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
#include "QtZlib/zlib.h"
|
||||
|
||||
#include <windows.h>
|
||||
//#include <windows.h>
|
||||
#include <QtGlobal>
|
||||
#include <stddef.h>
|
||||
#include <QByteArray>
|
||||
@ -47,6 +47,10 @@ class Compression {
|
||||
public:
|
||||
static quint32 CalculateAdler32Checksum(const QByteArray &data);
|
||||
static QByteArray DecompressZLIB(const QByteArray &aCompressedData);
|
||||
static qint64 FindZlibOffset(const QByteArray &bytes);
|
||||
static QByteArray StripHashBlocks(const QByteArray &raw,
|
||||
int dataChunkSize = 0x200000,
|
||||
int hashChunkSize = 0x2000);
|
||||
static QByteArray CompressZLIB(const QByteArray &aData);
|
||||
static QByteArray CompressZLIBWithSettings(const QByteArray &aData,
|
||||
int aCompressionLevel = Z_BEST_COMPRESSION,
|
||||
@ -64,13 +68,14 @@ public:
|
||||
int aStrategy = Z_DEFAULT_STRATEGY,
|
||||
const QByteArray &aDictionary = {});
|
||||
|
||||
static QByteArray DecompressLZO(const QByteArray &aCompressedData, quint32 aDestSize);
|
||||
|
||||
static QByteArray DecompressOodle(const QByteArray &aCompressedData, quint32 aDecompressedSize);
|
||||
static QByteArray CompressOodle(const QByteArray &aData);
|
||||
|
||||
|
||||
static QByteArray CompressXMem(const QByteArray &data);
|
||||
static QByteArray DecompressXMem(const QByteArray &data);
|
||||
|
||||
static QByteArray DecompressXMem(const QByteArray &data, int flags = 0, int windowSize = 0x20000, int partSize = 0x80000);
|
||||
private:
|
||||
static quint32 pGetOodleCompressedBounds(quint32 aBufferSize);
|
||||
static QByteArray pCompressOodle(QByteArray aBuffer, quint32 aBufferSize, quint32 aOutputBufferSize,
|
||||
|
||||
@ -1,14 +1,11 @@
|
||||
QT += core
|
||||
TEMPLATE = lib
|
||||
CONFIG += staticlib c++17
|
||||
DEFINES += MINILZO_USE_STATIC
|
||||
|
||||
SOURCES += \
|
||||
compression.cpp \
|
||||
lzokay.cpp \
|
||||
|
||||
HEADERS += \
|
||||
compression.h \
|
||||
lzokay.h
|
||||
SOURCES += $$files($$PWD/*.cpp, true) \
|
||||
$$files($$PWD/*.c, true)
|
||||
HEADERS += $$files($$PWD/*.h, true)
|
||||
|
||||
LIBS += \
|
||||
-L$$PWD/../../third_party/xbox_sdk/lib -lxcompress64 \
|
||||
|
||||
453
libs/compression/lzoconf.h
Normal file
@ -0,0 +1,453 @@
|
||||
/* lzoconf.h -- configuration of the LZO data compression library
|
||||
|
||||
This file is part of the LZO real-time data compression library.
|
||||
|
||||
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer
|
||||
All Rights Reserved.
|
||||
|
||||
The LZO library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
The LZO library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with the LZO library; see the file COPYING.
|
||||
If not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
Markus F.X.J. Oberhumer
|
||||
<markus@oberhumer.com>
|
||||
http://www.oberhumer.com/opensource/lzo/
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __LZOCONF_H_INCLUDED
|
||||
#define __LZOCONF_H_INCLUDED 1
|
||||
|
||||
#define LZO_VERSION 0x20a0 /* 2.10 */
|
||||
#define LZO_VERSION_STRING "2.10"
|
||||
#define LZO_VERSION_DATE "Mar 01 2017"
|
||||
|
||||
/* internal Autoconf configuration file - only used when building LZO */
|
||||
#if defined(LZO_HAVE_CONFIG_H)
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
// LZO requires a conforming <limits.h>
|
||||
************************************************************************/
|
||||
|
||||
#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
|
||||
# error "invalid CHAR_BIT"
|
||||
#endif
|
||||
#if !defined(UCHAR_MAX) || !defined(USHRT_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX)
|
||||
# error "check your compiler installation"
|
||||
#endif
|
||||
#if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1)
|
||||
# error "your limits.h macros are broken"
|
||||
#endif
|
||||
|
||||
/* get OS and architecture defines */
|
||||
#ifndef __LZODEFS_H_INCLUDED
|
||||
#include <lzodefs.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
// some core defines
|
||||
************************************************************************/
|
||||
|
||||
/* memory checkers */
|
||||
#if !defined(__LZO_CHECKER)
|
||||
# if defined(__BOUNDS_CHECKING_ON)
|
||||
# define __LZO_CHECKER 1
|
||||
# elif defined(__CHECKER__)
|
||||
# define __LZO_CHECKER 1
|
||||
# elif defined(__INSURE__)
|
||||
# define __LZO_CHECKER 1
|
||||
# elif defined(__PURIFY__)
|
||||
# define __LZO_CHECKER 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
// integral and pointer types
|
||||
************************************************************************/
|
||||
|
||||
/* lzo_uint must match size_t */
|
||||
#if !defined(LZO_UINT_MAX)
|
||||
# if (LZO_ABI_LLP64)
|
||||
# if (LZO_OS_WIN64)
|
||||
typedef unsigned __int64 lzo_uint;
|
||||
typedef __int64 lzo_int;
|
||||
# define LZO_TYPEOF_LZO_INT LZO_TYPEOF___INT64
|
||||
# else
|
||||
typedef lzo_ullong_t lzo_uint;
|
||||
typedef lzo_llong_t lzo_int;
|
||||
# define LZO_TYPEOF_LZO_INT LZO_TYPEOF_LONG_LONG
|
||||
# endif
|
||||
# define LZO_SIZEOF_LZO_INT 8
|
||||
# define LZO_UINT_MAX 0xffffffffffffffffull
|
||||
# define LZO_INT_MAX 9223372036854775807LL
|
||||
# define LZO_INT_MIN (-1LL - LZO_INT_MAX)
|
||||
# elif (LZO_ABI_IP32L64) /* MIPS R5900 */
|
||||
typedef quint32 lzo_uint;
|
||||
typedef int lzo_int;
|
||||
# define LZO_SIZEOF_LZO_INT LZO_SIZEOF_INT
|
||||
# define LZO_TYPEOF_LZO_INT LZO_TYPEOF_INT
|
||||
# define LZO_UINT_MAX UINT_MAX
|
||||
# define LZO_INT_MAX INT_MAX
|
||||
# define LZO_INT_MIN INT_MIN
|
||||
# elif (ULONG_MAX >= LZO_0xffffffffL)
|
||||
typedef unsigned long lzo_uint;
|
||||
typedef long lzo_int;
|
||||
# define LZO_SIZEOF_LZO_INT LZO_SIZEOF_LONG
|
||||
# define LZO_TYPEOF_LZO_INT LZO_TYPEOF_LONG
|
||||
# define LZO_UINT_MAX ULONG_MAX
|
||||
# define LZO_INT_MAX LONG_MAX
|
||||
# define LZO_INT_MIN LONG_MIN
|
||||
# else
|
||||
# error "lzo_uint"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* The larger type of lzo_uint and lzo_uint32_t. */
|
||||
#if (LZO_SIZEOF_LZO_INT >= 4)
|
||||
# define lzo_xint lzo_uint
|
||||
#else
|
||||
# define lzo_xint lzo_uint32_t
|
||||
#endif
|
||||
|
||||
typedef int lzo_bool;
|
||||
|
||||
/* sanity checks */
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int) == LZO_SIZEOF_LZO_INT)
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == LZO_SIZEOF_LZO_INT)
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint))
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint32_t))
|
||||
|
||||
#ifndef __LZO_MMODEL
|
||||
#define __LZO_MMODEL /*empty*/
|
||||
#endif
|
||||
|
||||
/* no typedef here because of const-pointer issues */
|
||||
#define lzo_bytep unsigned char __LZO_MMODEL *
|
||||
#define lzo_charp char __LZO_MMODEL *
|
||||
#define lzo_voidp void __LZO_MMODEL *
|
||||
#define lzo_shortp short __LZO_MMODEL *
|
||||
#define lzo_ushortp unsigned short __LZO_MMODEL *
|
||||
#define lzo_intp lzo_int __LZO_MMODEL *
|
||||
#define lzo_uintp lzo_uint __LZO_MMODEL *
|
||||
#define lzo_xintp lzo_xint __LZO_MMODEL *
|
||||
#define lzo_voidpp lzo_voidp __LZO_MMODEL *
|
||||
#define lzo_bytepp lzo_bytep __LZO_MMODEL *
|
||||
|
||||
#define lzo_int8_tp lzo_int8_t __LZO_MMODEL *
|
||||
#define lzo_uint8_tp lzo_uint8_t __LZO_MMODEL *
|
||||
#define lzo_int16_tp lzo_int16_t __LZO_MMODEL *
|
||||
#define lzo_uint16_tp lzo_uint16_t __LZO_MMODEL *
|
||||
#define lzo_int32_tp lzo_int32_t __LZO_MMODEL *
|
||||
#define lzo_uint32_tp lzo_uint32_t __LZO_MMODEL *
|
||||
#if defined(lzo_int64_t)
|
||||
#define lzo_int64_tp lzo_int64_t __LZO_MMODEL *
|
||||
#define lzo_uint64_tp lzo_uint64_t __LZO_MMODEL *
|
||||
#endif
|
||||
|
||||
/* Older LZO versions used to support ancient systems and memory models
|
||||
* such as 16-bit MSDOS with __huge pointers or Cray PVP, but these
|
||||
* obsolete configurations are not supported any longer.
|
||||
*/
|
||||
#if defined(__LZO_MMODEL_HUGE)
|
||||
#error "__LZO_MMODEL_HUGE memory model is unsupported"
|
||||
#endif
|
||||
#if (LZO_MM_PVP)
|
||||
#error "LZO_MM_PVP memory model is unsupported"
|
||||
#endif
|
||||
#if (LZO_SIZEOF_INT < 4)
|
||||
#error "LZO_SIZEOF_INT < 4 is unsupported"
|
||||
#endif
|
||||
#if (__LZO_UINTPTR_T_IS_POINTER)
|
||||
#error "__LZO_UINTPTR_T_IS_POINTER is unsupported"
|
||||
#endif
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) >= 4)
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) >= 4)
|
||||
/* Strange configurations where sizeof(lzo_uint) != sizeof(size_t) should
|
||||
* work but have not received much testing lately, so be strict here.
|
||||
*/
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(size_t))
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(ptrdiff_t))
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(lzo_uintptr_t))
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_uintptr_t))
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_uintptr_t))
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long *) == sizeof(lzo_uintptr_t))
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_voidp))
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_bytep))
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
// function types
|
||||
************************************************************************/
|
||||
|
||||
/* name mangling */
|
||||
#if !defined(__LZO_EXTERN_C)
|
||||
# ifdef __cplusplus
|
||||
# define __LZO_EXTERN_C extern "C"
|
||||
# else
|
||||
# define __LZO_EXTERN_C extern
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* calling convention */
|
||||
#if !defined(__LZO_CDECL)
|
||||
# define __LZO_CDECL __lzo_cdecl
|
||||
#endif
|
||||
|
||||
/* DLL export information */
|
||||
#if !defined(__LZO_EXPORT1)
|
||||
# define __LZO_EXPORT1 /*empty*/
|
||||
#endif
|
||||
#if !defined(__LZO_EXPORT2)
|
||||
# define __LZO_EXPORT2 /*empty*/
|
||||
#endif
|
||||
|
||||
/* __cdecl calling convention for public C and assembly functions */
|
||||
#if !defined(LZO_PUBLIC)
|
||||
# define LZO_PUBLIC(r) __LZO_EXPORT1 r __LZO_EXPORT2 __LZO_CDECL
|
||||
#endif
|
||||
#if !defined(LZO_EXTERN)
|
||||
# define LZO_EXTERN(r) __LZO_EXTERN_C LZO_PUBLIC(r)
|
||||
#endif
|
||||
#if !defined(LZO_PRIVATE)
|
||||
# define LZO_PRIVATE(r) static r __LZO_CDECL
|
||||
#endif
|
||||
|
||||
/* function types */
|
||||
typedef int
|
||||
(__LZO_CDECL *lzo_compress_t) ( const lzo_bytep src, lzo_uint src_len,
|
||||
lzo_bytep dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem );
|
||||
|
||||
typedef int
|
||||
(__LZO_CDECL *lzo_decompress_t) ( const lzo_bytep src, lzo_uint src_len,
|
||||
lzo_bytep dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem );
|
||||
|
||||
typedef int
|
||||
(__LZO_CDECL *lzo_optimize_t) ( lzo_bytep src, lzo_uint src_len,
|
||||
lzo_bytep dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem );
|
||||
|
||||
typedef int
|
||||
(__LZO_CDECL *lzo_compress_dict_t)(const lzo_bytep src, lzo_uint src_len,
|
||||
lzo_bytep dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem,
|
||||
const lzo_bytep dict, lzo_uint dict_len );
|
||||
|
||||
typedef int
|
||||
(__LZO_CDECL *lzo_decompress_dict_t)(const lzo_bytep src, lzo_uint src_len,
|
||||
lzo_bytep dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem,
|
||||
const lzo_bytep dict, lzo_uint dict_len );
|
||||
|
||||
|
||||
/* Callback interface. Currently only the progress indicator ("nprogress")
|
||||
* is used, but this may change in a future release. */
|
||||
|
||||
struct lzo_callback_t;
|
||||
typedef struct lzo_callback_t lzo_callback_t;
|
||||
#define lzo_callback_p lzo_callback_t __LZO_MMODEL *
|
||||
|
||||
/* malloc & free function types */
|
||||
typedef lzo_voidp (__LZO_CDECL *lzo_alloc_func_t)
|
||||
(lzo_callback_p self, lzo_uint items, lzo_uint size);
|
||||
typedef void (__LZO_CDECL *lzo_free_func_t)
|
||||
(lzo_callback_p self, lzo_voidp ptr);
|
||||
|
||||
/* a progress indicator callback function */
|
||||
typedef void (__LZO_CDECL *lzo_progress_func_t)
|
||||
(lzo_callback_p, lzo_uint, lzo_uint, int);
|
||||
|
||||
struct lzo_callback_t
|
||||
{
|
||||
/* custom allocators (set to 0 to disable) */
|
||||
lzo_alloc_func_t nalloc; /* [not used right now] */
|
||||
lzo_free_func_t nfree; /* [not used right now] */
|
||||
|
||||
/* a progress indicator callback function (set to 0 to disable) */
|
||||
lzo_progress_func_t nprogress;
|
||||
|
||||
/* INFO: the first parameter "self" of the nalloc/nfree/nprogress
|
||||
* callbacks points back to this struct, so you are free to store
|
||||
* some extra info in the following variables. */
|
||||
lzo_voidp user1;
|
||||
lzo_xint user2;
|
||||
lzo_xint user3;
|
||||
};
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
// error codes and prototypes
|
||||
************************************************************************/
|
||||
|
||||
/* Error codes for the compression/decompression functions. Negative
|
||||
* values are errors, positive values will be used for special but
|
||||
* normal events.
|
||||
*/
|
||||
#define LZO_E_OK 0
|
||||
#define LZO_E_ERROR (-1)
|
||||
#define LZO_E_OUT_OF_MEMORY (-2) /* [lzo_alloc_func_t failure] */
|
||||
#define LZO_E_NOT_COMPRESSIBLE (-3) /* [not used right now] */
|
||||
#define LZO_E_INPUT_OVERRUN (-4)
|
||||
#define LZO_E_OUTPUT_OVERRUN (-5)
|
||||
#define LZO_E_LOOKBEHIND_OVERRUN (-6)
|
||||
#define LZO_E_EOF_NOT_FOUND (-7)
|
||||
#define LZO_E_INPUT_NOT_CONSUMED (-8)
|
||||
#define LZO_E_NOT_YET_IMPLEMENTED (-9) /* [not used right now] */
|
||||
#define LZO_E_INVALID_ARGUMENT (-10)
|
||||
#define LZO_E_INVALID_ALIGNMENT (-11) /* pointer argument is not properly aligned */
|
||||
#define LZO_E_OUTPUT_NOT_CONSUMED (-12)
|
||||
#define LZO_E_INTERNAL_ERROR (-99)
|
||||
|
||||
|
||||
#ifndef lzo_sizeof_dict_t
|
||||
# define lzo_sizeof_dict_t ((unsigned)sizeof(lzo_bytep))
|
||||
#endif
|
||||
|
||||
/* lzo_init() should be the first function you call.
|
||||
* Check the return code !
|
||||
*
|
||||
* lzo_init() is a macro to allow checking that the library and the
|
||||
* compiler's view of various types are consistent.
|
||||
*/
|
||||
#define lzo_init() __lzo_init_v2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\
|
||||
(int)sizeof(long),(int)sizeof(lzo_uint32_t),(int)sizeof(lzo_uint),\
|
||||
(int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\
|
||||
(int)sizeof(lzo_callback_t))
|
||||
LZO_EXTERN(int) __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int);
|
||||
|
||||
/* version functions (useful for shared libraries) */
|
||||
LZO_EXTERN(unsigned) lzo_version(void);
|
||||
LZO_EXTERN(const char *) lzo_version_string(void);
|
||||
LZO_EXTERN(const char *) lzo_version_date(void);
|
||||
LZO_EXTERN(const lzo_charp) _lzo_version_string(void);
|
||||
LZO_EXTERN(const lzo_charp) _lzo_version_date(void);
|
||||
|
||||
/* string functions */
|
||||
LZO_EXTERN(int)
|
||||
lzo_memcmp(const lzo_voidp a, const lzo_voidp b, lzo_uint len);
|
||||
LZO_EXTERN(lzo_voidp)
|
||||
lzo_memcpy(lzo_voidp dst, const lzo_voidp src, lzo_uint len);
|
||||
LZO_EXTERN(lzo_voidp)
|
||||
lzo_memmove(lzo_voidp dst, const lzo_voidp src, lzo_uint len);
|
||||
LZO_EXTERN(lzo_voidp)
|
||||
lzo_memset(lzo_voidp buf, int c, lzo_uint len);
|
||||
|
||||
/* checksum functions */
|
||||
LZO_EXTERN(lzo_uint32_t)
|
||||
lzo_adler32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len);
|
||||
LZO_EXTERN(lzo_uint32_t)
|
||||
lzo_crc32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len);
|
||||
LZO_EXTERN(const lzo_uint32_tp)
|
||||
lzo_get_crc32_table(void);
|
||||
|
||||
/* misc. */
|
||||
LZO_EXTERN(int) _lzo_config_check(void);
|
||||
typedef union {
|
||||
lzo_voidp a00; lzo_bytep a01; lzo_uint a02; lzo_xint a03; lzo_uintptr_t a04;
|
||||
void *a05; unsigned char *a06; unsigned long a07; size_t a08; ptrdiff_t a09;
|
||||
#if defined(lzo_int64_t)
|
||||
lzo_uint64_t a10;
|
||||
#endif
|
||||
} lzo_align_t;
|
||||
|
||||
/* align a char pointer on a boundary that is a multiple of 'size' */
|
||||
LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp p, lzo_uint size);
|
||||
#define LZO_PTR_ALIGN_UP(p,size) \
|
||||
((p) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(p),(lzo_uint)(size)))
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
// deprecated macros - only for backward compatibility
|
||||
************************************************************************/
|
||||
|
||||
/* deprecated - use 'lzo_bytep' instead of 'lzo_byte *' */
|
||||
#define lzo_byte unsigned char
|
||||
/* deprecated type names */
|
||||
#define lzo_int32 lzo_int32_t
|
||||
#define lzo_uint32 lzo_uint32_t
|
||||
#define lzo_int32p lzo_int32_t __LZO_MMODEL *
|
||||
#define lzo_uint32p lzo_uint32_t __LZO_MMODEL *
|
||||
#define LZO_INT32_MAX LZO_INT32_C(2147483647)
|
||||
#define LZO_UINT32_MAX LZO_UINT32_C(4294967295)
|
||||
#if defined(lzo_int64_t)
|
||||
#define lzo_int64 lzo_int64_t
|
||||
#define lzo_uint64 lzo_uint64_t
|
||||
#define lzo_int64p lzo_int64_t __LZO_MMODEL *
|
||||
#define lzo_uint64p lzo_uint64_t __LZO_MMODEL *
|
||||
#define LZO_INT64_MAX LZO_INT64_C(9223372036854775807)
|
||||
#define LZO_UINT64_MAX LZO_UINT64_C(18446744073709551615)
|
||||
#endif
|
||||
/* deprecated types */
|
||||
typedef union { lzo_bytep a; lzo_uint b; } __lzo_pu_u;
|
||||
typedef union { lzo_bytep a; lzo_uint32_t b; } __lzo_pu32_u;
|
||||
/* deprecated defines */
|
||||
#if !defined(LZO_SIZEOF_LZO_UINT)
|
||||
# define LZO_SIZEOF_LZO_UINT LZO_SIZEOF_LZO_INT
|
||||
#endif
|
||||
|
||||
#if defined(LZO_CFG_COMPAT)
|
||||
|
||||
#define __LZOCONF_H 1
|
||||
|
||||
#if defined(LZO_ARCH_I086)
|
||||
# define __LZO_i386 1
|
||||
#elif defined(LZO_ARCH_I386)
|
||||
# define __LZO_i386 1
|
||||
#endif
|
||||
|
||||
#if defined(LZO_OS_DOS16)
|
||||
# define __LZO_DOS 1
|
||||
# define __LZO_DOS16 1
|
||||
#elif defined(LZO_OS_DOS32)
|
||||
# define __LZO_DOS 1
|
||||
#elif defined(LZO_OS_WIN16)
|
||||
# define __LZO_WIN 1
|
||||
# define __LZO_WIN16 1
|
||||
#elif defined(LZO_OS_WIN32)
|
||||
# define __LZO_WIN 1
|
||||
#endif
|
||||
|
||||
#define __LZO_CMODEL /*empty*/
|
||||
#define __LZO_DMODEL /*empty*/
|
||||
#define __LZO_ENTRY __LZO_CDECL
|
||||
#define LZO_EXTERN_CDECL LZO_EXTERN
|
||||
#define LZO_ALIGN LZO_PTR_ALIGN_UP
|
||||
|
||||
#define lzo_compress_asm_t lzo_compress_t
|
||||
#define lzo_decompress_asm_t lzo_decompress_t
|
||||
|
||||
#endif /* LZO_CFG_COMPAT */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* already included */
|
||||
|
||||
|
||||
/* vim:set ts=4 sw=4 et: */
|
||||
3268
libs/compression/lzodefs.h
Normal file
@ -1,647 +0,0 @@
|
||||
#include "lzokay.h"
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
|
||||
/*
|
||||
* Based on documentation from the Linux sources: Documentation/lzo.txt
|
||||
* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/lzo.txt
|
||||
*/
|
||||
|
||||
namespace lzokay {
|
||||
|
||||
#if _WIN32
|
||||
#define HOST_BIG_ENDIAN 0
|
||||
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
#define HOST_BIG_ENDIAN 1
|
||||
#else
|
||||
#define HOST_BIG_ENDIAN 0
|
||||
#endif
|
||||
|
||||
#if HOST_BIG_ENDIAN
|
||||
static uint16_t get_le16(const uint8_t* p) {
|
||||
uint16_t val = *reinterpret_cast<const uint16_t*>(p);
|
||||
#if __GNUC__
|
||||
return __builtin_bswap16(val);
|
||||
#elif _WIN32
|
||||
return _byteswap_ushort(val);
|
||||
#else
|
||||
return (val = (val << 8) | ((val >> 8) & 0xFF));
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
static uint16_t get_le16(const uint8_t* p) {
|
||||
return *reinterpret_cast<const uint16_t*>(p);
|
||||
}
|
||||
#endif
|
||||
|
||||
constexpr std::size_t Max255Count = std::size_t(~0) / 255 - 2;
|
||||
|
||||
#define NEEDS_IN(count) \
|
||||
if (inp + (count) > inp_end) { \
|
||||
dst_size = outp - dst; \
|
||||
return EResult::InputOverrun; \
|
||||
}
|
||||
|
||||
#define NEEDS_OUT(count) \
|
||||
if (outp + (count) > outp_end) { \
|
||||
dst_size = outp - dst; \
|
||||
return EResult::OutputOverrun; \
|
||||
}
|
||||
|
||||
#define CONSUME_ZERO_BYTE_LENGTH \
|
||||
std::size_t offset; \
|
||||
{ \
|
||||
const uint8_t *old_inp = inp; \
|
||||
while (*inp == 0) ++inp; \
|
||||
offset = inp - old_inp; \
|
||||
if (offset > Max255Count) { \
|
||||
dst_size = outp - dst; \
|
||||
return EResult::Error; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define WRITE_ZERO_BYTE_LENGTH(length) \
|
||||
{ \
|
||||
std::size_t l; \
|
||||
for (l = length; l > 255; l -= 255) { *outp++ = 0; } \
|
||||
*outp++ = static_cast<uint8_t>(l); \
|
||||
}
|
||||
|
||||
constexpr uint32_t M1MaxOffset = 0x0400;
|
||||
constexpr uint32_t M2MaxOffset = 0x0800;
|
||||
constexpr uint32_t M3MaxOffset = 0x4000;
|
||||
// constexpr uint32_t M4MaxOffset = 0xbfff;
|
||||
|
||||
// constexpr uint32_t M1MinLen = 2;
|
||||
// constexpr uint32_t M1MaxLen = 2;
|
||||
constexpr uint32_t M2MinLen = 3;
|
||||
constexpr uint32_t M2MaxLen = 8;
|
||||
// constexpr uint32_t M3MinLen = 3;
|
||||
constexpr uint32_t M3MaxLen = 33;
|
||||
// constexpr uint32_t M4MinLen = 3;
|
||||
constexpr uint32_t M4MaxLen = 9;
|
||||
|
||||
constexpr uint32_t M1Marker = 0x0;
|
||||
// constexpr uint32_t M2Marker = 0x40;
|
||||
constexpr uint32_t M3Marker = 0x20;
|
||||
constexpr uint32_t M4Marker = 0x10;
|
||||
|
||||
constexpr uint32_t MaxMatchByLengthLen = 34; /* Max M3 len + 1 */
|
||||
|
||||
EResult decompress(const uint8_t* src, std::size_t src_size,
|
||||
uint8_t* dst, std::size_t init_dst_size,
|
||||
std::size_t& dst_size) {
|
||||
dst_size = init_dst_size;
|
||||
|
||||
if (src_size < 3) {
|
||||
dst_size = 0;
|
||||
return EResult::InputOverrun;
|
||||
}
|
||||
|
||||
const uint8_t* inp = src;
|
||||
const uint8_t* inp_end = src + src_size;
|
||||
uint8_t* outp = dst;
|
||||
uint8_t* outp_end = dst + dst_size;
|
||||
uint8_t* lbcur;
|
||||
std::size_t lblen;
|
||||
std::size_t state = 0;
|
||||
std::size_t nstate = 0;
|
||||
|
||||
/* First byte encoding */
|
||||
if (*inp >= 22) {
|
||||
/* 22..255 : copy literal string
|
||||
* length = (byte - 17) = 4..238
|
||||
* state = 4 [ don't copy extra literals ]
|
||||
* skip byte
|
||||
*/
|
||||
std::size_t len = *inp++ - uint8_t(17);
|
||||
NEEDS_IN(len)
|
||||
NEEDS_OUT(len)
|
||||
for (std::size_t i = 0; i < len; ++i)
|
||||
*outp++ = *inp++;
|
||||
state = 4;
|
||||
} else if (*inp >= 18) {
|
||||
/* 18..21 : copy 0..3 literals
|
||||
* state = (byte - 17) = 0..3 [ copy <state> literals ]
|
||||
* skip byte
|
||||
*/
|
||||
nstate = *inp++ - uint8_t(17);
|
||||
state = nstate;
|
||||
NEEDS_IN(nstate)
|
||||
NEEDS_OUT(nstate)
|
||||
for (std::size_t i = 0; i < nstate; ++i)
|
||||
*outp++ = *inp++;
|
||||
}
|
||||
/* 0..17 : follow regular instruction encoding, see below. It is worth
|
||||
* noting that codes 16 and 17 will represent a block copy from
|
||||
* the dictionary which is empty, and that they will always be
|
||||
* invalid at this place.
|
||||
*/
|
||||
|
||||
while (true) {
|
||||
NEEDS_IN(1)
|
||||
uint8_t inst = *inp++;
|
||||
if (inst & 0xC0) {
|
||||
/* [M2]
|
||||
* 1 L L D D D S S (128..255)
|
||||
* Copy 5-8 bytes from block within 2kB distance
|
||||
* state = S (copy S literals after this block)
|
||||
* length = 5 + L
|
||||
* Always followed by exactly one byte : H H H H H H H H
|
||||
* distance = (H << 3) + D + 1
|
||||
*
|
||||
* 0 1 L D D D S S (64..127)
|
||||
* Copy 3-4 bytes from block within 2kB distance
|
||||
* state = S (copy S literals after this block)
|
||||
* length = 3 + L
|
||||
* Always followed by exactly one byte : H H H H H H H H
|
||||
* distance = (H << 3) + D + 1
|
||||
*/
|
||||
NEEDS_IN(1)
|
||||
lbcur = outp - ((*inp++ << 3) + ((inst >> 2) & 0x7) + 1);
|
||||
lblen = std::size_t(inst >> 5) + 1;
|
||||
nstate = inst & uint8_t(0x3);
|
||||
} else if (inst & M3Marker) {
|
||||
/* [M3]
|
||||
* 0 0 1 L L L L L (32..63)
|
||||
* Copy of small block within 16kB distance (preferably less than 34B)
|
||||
* length = 2 + (L ?: 31 + (zero_bytes * 255) + non_zero_byte)
|
||||
* Always followed by exactly one LE16 : D D D D D D D D : D D D D D D S S
|
||||
* distance = D + 1
|
||||
* state = S (copy S literals after this block)
|
||||
*/
|
||||
lblen = std::size_t(inst & uint8_t(0x1f)) + 2;
|
||||
if (lblen == 2) {
|
||||
CONSUME_ZERO_BYTE_LENGTH
|
||||
NEEDS_IN(1)
|
||||
lblen += offset * 255 + 31 + *inp++;
|
||||
}
|
||||
NEEDS_IN(2)
|
||||
nstate = get_le16(inp);
|
||||
inp += 2;
|
||||
lbcur = outp - ((nstate >> 2) + 1);
|
||||
nstate &= 0x3;
|
||||
} else if (inst & M4Marker) {
|
||||
/* [M4]
|
||||
* 0 0 0 1 H L L L (16..31)
|
||||
* Copy of a block within 16..48kB distance (preferably less than 10B)
|
||||
* length = 2 + (L ?: 7 + (zero_bytes * 255) + non_zero_byte)
|
||||
* Always followed by exactly one LE16 : D D D D D D D D : D D D D D D S S
|
||||
* distance = 16384 + (H << 14) + D
|
||||
* state = S (copy S literals after this block)
|
||||
* End of stream is reached if distance == 16384
|
||||
*/
|
||||
lblen = std::size_t(inst & uint8_t(0x7)) + 2;
|
||||
if (lblen == 2) {
|
||||
CONSUME_ZERO_BYTE_LENGTH
|
||||
NEEDS_IN(1)
|
||||
lblen += offset * 255 + 7 + *inp++;
|
||||
}
|
||||
NEEDS_IN(2)
|
||||
nstate = get_le16(inp);
|
||||
inp += 2;
|
||||
lbcur = outp - (((inst & 0x8) << 11) + (nstate >> 2));
|
||||
nstate &= 0x3;
|
||||
if (lbcur == outp)
|
||||
break; /* Stream finished */
|
||||
lbcur -= 16384;
|
||||
} else {
|
||||
/* [M1] Depends on the number of literals copied by the last instruction. */
|
||||
if (state == 0) {
|
||||
/* If last instruction did not copy any literal (state == 0), this
|
||||
* encoding will be a copy of 4 or more literal, and must be interpreted
|
||||
* like this :
|
||||
*
|
||||
* 0 0 0 0 L L L L (0..15) : copy long literal string
|
||||
* length = 3 + (L ?: 15 + (zero_bytes * 255) + non_zero_byte)
|
||||
* state = 4 (no extra literals are copied)
|
||||
*/
|
||||
std::size_t len = inst + 3;
|
||||
if (len == 3) {
|
||||
CONSUME_ZERO_BYTE_LENGTH
|
||||
NEEDS_IN(1)
|
||||
len += offset * 255 + 15 + *inp++;
|
||||
}
|
||||
/* copy_literal_run */
|
||||
NEEDS_IN(len)
|
||||
NEEDS_OUT(len)
|
||||
for (std::size_t i = 0; i < len; ++i)
|
||||
*outp++ = *inp++;
|
||||
state = 4;
|
||||
continue;
|
||||
} else if (state != 4) {
|
||||
/* If last instruction used to copy between 1 to 3 literals (encoded in
|
||||
* the instruction's opcode or distance), the instruction is a copy of a
|
||||
* 2-byte block from the dictionary within a 1kB distance. It is worth
|
||||
* noting that this instruction provides little savings since it uses 2
|
||||
* bytes to encode a copy of 2 other bytes but it encodes the number of
|
||||
* following literals for free. It must be interpreted like this :
|
||||
*
|
||||
* 0 0 0 0 D D S S (0..15) : copy 2 bytes from <= 1kB distance
|
||||
* length = 2
|
||||
* state = S (copy S literals after this block)
|
||||
* Always followed by exactly one byte : H H H H H H H H
|
||||
* distance = (H << 2) + D + 1
|
||||
*/
|
||||
NEEDS_IN(1)
|
||||
nstate = inst & uint8_t(0x3);
|
||||
lbcur = outp - ((inst >> 2) + (*inp++ << 2) + 1);
|
||||
lblen = 2;
|
||||
} else {
|
||||
/* If last instruction used to copy 4 or more literals (as detected by
|
||||
* state == 4), the instruction becomes a copy of a 3-byte block from the
|
||||
* dictionary from a 2..3kB distance, and must be interpreted like this :
|
||||
*
|
||||
* 0 0 0 0 D D S S (0..15) : copy 3 bytes from 2..3 kB distance
|
||||
* length = 3
|
||||
* state = S (copy S literals after this block)
|
||||
* Always followed by exactly one byte : H H H H H H H H
|
||||
* distance = (H << 2) + D + 2049
|
||||
*/
|
||||
NEEDS_IN(1)
|
||||
nstate = inst & uint8_t(0x3);
|
||||
lbcur = outp - ((inst >> 2) + (*inp++ << 2) + 2049);
|
||||
lblen = 3;
|
||||
}
|
||||
}
|
||||
if (lbcur < dst) {
|
||||
dst_size = outp - dst;
|
||||
return EResult::LookbehindOverrun;
|
||||
}
|
||||
NEEDS_IN(nstate)
|
||||
NEEDS_OUT(lblen + nstate)
|
||||
/* Copy lookbehind */
|
||||
for (std::size_t i = 0; i < lblen; ++i)
|
||||
*outp++ = *lbcur++;
|
||||
state = nstate;
|
||||
/* Copy literal */
|
||||
for (std::size_t i = 0; i < nstate; ++i)
|
||||
*outp++ = *inp++;
|
||||
}
|
||||
|
||||
dst_size = outp - dst;
|
||||
if (lblen != 3) /* Ensure terminating M4 was encountered */
|
||||
return EResult::Error;
|
||||
if (inp == inp_end)
|
||||
return EResult::Success;
|
||||
else if (inp < inp_end)
|
||||
return EResult::InputNotConsumed;
|
||||
else
|
||||
return EResult::InputOverrun;
|
||||
}
|
||||
|
||||
struct State {
|
||||
const uint8_t* src;
|
||||
const uint8_t* src_end;
|
||||
const uint8_t* inp;
|
||||
uint32_t wind_sz;
|
||||
uint32_t wind_b;
|
||||
uint32_t wind_e;
|
||||
uint32_t cycle1_countdown;
|
||||
|
||||
const uint8_t* bufp;
|
||||
uint32_t buf_sz;
|
||||
|
||||
/* Access next input byte and advance both ends of circular buffer */
|
||||
void get_byte(uint8_t* buf) {
|
||||
if (inp >= src_end) {
|
||||
if (wind_sz > 0)
|
||||
--wind_sz;
|
||||
buf[wind_e] = 0;
|
||||
if (wind_e < DictBase::MaxMatchLen)
|
||||
buf[DictBase::BufSize + wind_e] = 0;
|
||||
} else {
|
||||
buf[wind_e] = *inp;
|
||||
if (wind_e < DictBase::MaxMatchLen)
|
||||
buf[DictBase::BufSize + wind_e] = *inp;
|
||||
++inp;
|
||||
}
|
||||
if (++wind_e == DictBase::BufSize)
|
||||
wind_e = 0;
|
||||
if (++wind_b == DictBase::BufSize)
|
||||
wind_b = 0;
|
||||
}
|
||||
|
||||
uint32_t pos2off(uint32_t pos) const {
|
||||
return wind_b > pos ? wind_b - pos : DictBase::BufSize - (pos - wind_b);
|
||||
}
|
||||
};
|
||||
|
||||
class DictImpl : public DictBase {
|
||||
public:
|
||||
struct Match3Impl : DictBase::Match3 {
|
||||
static uint32_t make_key(const uint8_t* data) {
|
||||
return ((0x9f5f * (((uint32_t(data[0]) << 5 ^ uint32_t(data[1])) << 5) ^ data[2])) >> 5) & 0x3fff;
|
||||
}
|
||||
|
||||
uint16_t get_head(uint32_t key) const {
|
||||
return (chain_sz[key] == 0) ? uint16_t(UINT16_MAX) : head[key];
|
||||
}
|
||||
|
||||
void init() {
|
||||
std::fill(std::begin(chain_sz), std::end(chain_sz), 0);
|
||||
}
|
||||
|
||||
void remove(uint32_t pos, const uint8_t* b) {
|
||||
--chain_sz[make_key(b + pos)];
|
||||
}
|
||||
|
||||
void advance(State& s, uint32_t& match_pos, uint32_t& match_count, const uint8_t* b) {
|
||||
uint32_t key = make_key(b + s.wind_b);
|
||||
match_pos = chain[s.wind_b] = get_head(key);
|
||||
match_count = chain_sz[key]++;
|
||||
if (match_count > DictBase::MaxMatchLen)
|
||||
match_count = DictBase::MaxMatchLen;
|
||||
head[key] = uint16_t(s.wind_b);
|
||||
}
|
||||
|
||||
void skip_advance(State& s, const uint8_t* b) {
|
||||
uint32_t key = make_key(b + s.wind_b);
|
||||
chain[s.wind_b] = get_head(key);
|
||||
head[key] = uint16_t(s.wind_b);
|
||||
best_len[s.wind_b] = uint16_t(DictBase::MaxMatchLen + 1);
|
||||
chain_sz[key]++;
|
||||
}
|
||||
};
|
||||
|
||||
struct Match2Impl : DictBase::Match2 {
|
||||
static uint32_t make_key(const uint8_t* data) {
|
||||
return uint32_t(data[0]) ^ (uint32_t(data[1]) << 8);
|
||||
}
|
||||
|
||||
void init() {
|
||||
std::fill(std::begin(head), std::end(head), UINT16_MAX);
|
||||
}
|
||||
|
||||
void add(uint16_t pos, const uint8_t* b) {
|
||||
head[make_key(b + pos)] = pos;
|
||||
}
|
||||
|
||||
void remove(uint32_t pos, const uint8_t* b) {
|
||||
uint16_t& p = head[make_key(b + pos)];
|
||||
if (p == pos)
|
||||
p = UINT16_MAX;
|
||||
}
|
||||
|
||||
bool search(State& s, uint32_t& lb_pos, uint32_t& lb_len,
|
||||
uint32_t best_pos[MaxMatchByLengthLen], const uint8_t* b) const {
|
||||
uint16_t pos = head[make_key(b + s.wind_b)];
|
||||
if (pos == UINT16_MAX)
|
||||
return false;
|
||||
if (best_pos[2] == 0)
|
||||
best_pos[2] = pos + 1;
|
||||
if (lb_len < 2) {
|
||||
lb_len = 2;
|
||||
lb_pos = pos;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void init(State& s, const uint8_t* src, std::size_t src_size) {
|
||||
auto& match3 = static_cast<Match3Impl&>(_storage->match3);
|
||||
auto& match2 = static_cast<Match2Impl&>(_storage->match2);
|
||||
|
||||
s.cycle1_countdown = DictBase::MaxDist;
|
||||
match3.init();
|
||||
match2.init();
|
||||
|
||||
s.src = src;
|
||||
s.src_end = src + src_size;
|
||||
s.inp = src;
|
||||
s.wind_sz = uint32_t(std::min(src_size, std::size_t(MaxMatchLen)));
|
||||
s.wind_b = 0;
|
||||
s.wind_e = s.wind_sz;
|
||||
std::copy_n(s.inp, s.wind_sz, _storage->buffer);
|
||||
s.inp += s.wind_sz;
|
||||
|
||||
if (s.wind_e == DictBase::BufSize)
|
||||
s.wind_e = 0;
|
||||
|
||||
if (s.wind_sz < 3)
|
||||
std::fill_n(_storage->buffer + s.wind_b + s.wind_sz, 3, 0);
|
||||
}
|
||||
|
||||
void reset_next_input_entry(State& s, Match3Impl& match3, Match2Impl& match2) {
|
||||
/* Remove match from about-to-be-clobbered buffer entry */
|
||||
if (s.cycle1_countdown == 0) {
|
||||
match3.remove(s.wind_e, _storage->buffer);
|
||||
match2.remove(s.wind_e, _storage->buffer);
|
||||
} else {
|
||||
--s.cycle1_countdown;
|
||||
}
|
||||
}
|
||||
|
||||
void advance(State& s, uint32_t& lb_off, uint32_t& lb_len,
|
||||
uint32_t best_off[MaxMatchByLengthLen], bool skip) {
|
||||
auto& match3 = static_cast<Match3Impl&>(_storage->match3);
|
||||
auto& match2 = static_cast<Match2Impl&>(_storage->match2);
|
||||
|
||||
if (skip) {
|
||||
for (uint32_t i = 0; i < lb_len - 1; ++i) {
|
||||
reset_next_input_entry(s, match3, match2);
|
||||
match3.skip_advance(s, _storage->buffer);
|
||||
match2.add(uint16_t(s.wind_b), _storage->buffer);
|
||||
s.get_byte(_storage->buffer);
|
||||
}
|
||||
}
|
||||
|
||||
lb_len = 1;
|
||||
lb_off = 0;
|
||||
uint32_t lb_pos;
|
||||
|
||||
uint32_t best_pos[MaxMatchByLengthLen] = {};
|
||||
uint32_t match_pos, match_count;
|
||||
match3.advance(s, match_pos, match_count, _storage->buffer);
|
||||
|
||||
int best_char = _storage->buffer[s.wind_b];
|
||||
uint32_t best_len = lb_len;
|
||||
if (lb_len >= s.wind_sz) {
|
||||
if (s.wind_sz == 0)
|
||||
best_char = -1;
|
||||
lb_off = 0;
|
||||
match3.best_len[s.wind_b] = DictBase::MaxMatchLen + 1;
|
||||
} else {
|
||||
if (match2.search(s, lb_pos, lb_len, best_pos, _storage->buffer) && s.wind_sz >= 3) {
|
||||
for (uint32_t i = 0; i < match_count; ++i, match_pos = match3.chain[match_pos]) {
|
||||
auto ref_ptr = _storage->buffer + s.wind_b;
|
||||
auto match_ptr = _storage->buffer + match_pos;
|
||||
auto mismatch = std::mismatch(ref_ptr, ref_ptr + s.wind_sz, match_ptr);
|
||||
auto match_len = uint32_t(mismatch.first - ref_ptr);
|
||||
if (match_len < 2)
|
||||
continue;
|
||||
if (match_len < MaxMatchByLengthLen && best_pos[match_len] == 0)
|
||||
best_pos[match_len] = match_pos + 1;
|
||||
if (match_len > lb_len) {
|
||||
lb_len = match_len;
|
||||
lb_pos = match_pos;
|
||||
if (match_len == s.wind_sz || match_len > match3.best_len[match_pos])
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (lb_len > best_len)
|
||||
lb_off = s.pos2off(lb_pos);
|
||||
match3.best_len[s.wind_b] = uint16_t(lb_len);
|
||||
for (auto posit = std::begin(best_pos) + 2, offit = best_off + 2;
|
||||
posit != std::end(best_pos); ++posit, ++offit) {
|
||||
*offit = (*posit > 0) ? s.pos2off(*posit - 1) : 0;
|
||||
}
|
||||
}
|
||||
|
||||
reset_next_input_entry(s, match3, match2);
|
||||
|
||||
match2.add(uint16_t(s.wind_b), _storage->buffer);
|
||||
|
||||
s.get_byte(_storage->buffer);
|
||||
|
||||
if (best_char < 0) {
|
||||
s.buf_sz = 0;
|
||||
lb_len = 0;
|
||||
/* Signal exit */
|
||||
} else {
|
||||
s.buf_sz = s.wind_sz + 1;
|
||||
}
|
||||
s.bufp = s.inp - s.buf_sz;
|
||||
}
|
||||
};
|
||||
|
||||
static void find_better_match(const uint32_t best_off[MaxMatchByLengthLen], uint32_t& lb_len, uint32_t& lb_off) {
|
||||
if (lb_len <= M2MinLen || lb_off <= M2MaxOffset)
|
||||
return;
|
||||
if (lb_off > M2MaxOffset && lb_len >= M2MinLen + 1 && lb_len <= M2MaxLen + 1 &&
|
||||
best_off[lb_len - 1] != 0 && best_off[lb_len - 1] <= M2MaxOffset) {
|
||||
lb_len -= 1;
|
||||
lb_off = best_off[lb_len];
|
||||
} else if (lb_off > M3MaxOffset && lb_len >= M4MaxLen + 1 && lb_len <= M2MaxLen + 2 &&
|
||||
best_off[lb_len - 2] && best_off[lb_len] <= M2MaxOffset) {
|
||||
lb_len -= 2;
|
||||
lb_off = best_off[lb_len];
|
||||
} else if (lb_off > M3MaxOffset && lb_len >= M4MaxLen + 1 && lb_len <= M3MaxLen + 1 &&
|
||||
best_off[lb_len - 1] != 0 && best_off[lb_len - 2] <= M3MaxOffset) {
|
||||
lb_len -= 1;
|
||||
lb_off = best_off[lb_len];
|
||||
}
|
||||
}
|
||||
|
||||
static EResult encode_literal_run(uint8_t*& outp, const uint8_t* outp_end, const uint8_t* dst, std::size_t& dst_size,
|
||||
const uint8_t* lit_ptr, uint32_t lit_len) {
|
||||
if (outp == dst && lit_len <= 238) {
|
||||
NEEDS_OUT(1);
|
||||
*outp++ = uint8_t(17 + lit_len);
|
||||
} else if (lit_len <= 3) {
|
||||
outp[-2] = uint8_t(outp[-2] | lit_len);
|
||||
} else if (lit_len <= 18) {
|
||||
NEEDS_OUT(1);
|
||||
*outp++ = uint8_t(lit_len - 3);
|
||||
} else {
|
||||
NEEDS_OUT((lit_len - 18) / 255 + 2);
|
||||
*outp++ = 0;
|
||||
WRITE_ZERO_BYTE_LENGTH(lit_len - 18);
|
||||
}
|
||||
NEEDS_OUT(lit_len);
|
||||
outp = std::copy_n(lit_ptr, lit_len, outp);
|
||||
return EResult::Success;
|
||||
}
|
||||
|
||||
static EResult encode_lookback_match(uint8_t*& outp, const uint8_t* outp_end, const uint8_t* dst, std::size_t& dst_size,
|
||||
uint32_t lb_len, uint32_t lb_off, uint32_t last_lit_len) {
|
||||
if (lb_len == 2) {
|
||||
lb_off -= 1;
|
||||
NEEDS_OUT(2);
|
||||
*outp++ = uint8_t(M1Marker | ((lb_off & 0x3) << 2));
|
||||
*outp++ = uint8_t(lb_off >> 2);
|
||||
} else if (lb_len <= M2MaxLen && lb_off <= M2MaxOffset) {
|
||||
lb_off -= 1;
|
||||
NEEDS_OUT(2);
|
||||
*outp++ = uint8_t((lb_len - 1) << 5 | ((lb_off & 0x7) << 2));
|
||||
*outp++ = uint8_t(lb_off >> 3);
|
||||
} else if (lb_len == M2MinLen && lb_off <= M1MaxOffset + M2MaxOffset && last_lit_len >= 4) {
|
||||
lb_off -= 1 + M2MaxOffset;
|
||||
NEEDS_OUT(2);
|
||||
*outp++ = uint8_t(M1Marker | ((lb_off & 0x3) << 2));
|
||||
*outp++ = uint8_t(lb_off >> 2);
|
||||
} else if (lb_off <= M3MaxOffset) {
|
||||
lb_off -= 1;
|
||||
if (lb_len <= M3MaxLen) {
|
||||
NEEDS_OUT(1);
|
||||
*outp++ = uint8_t(M3Marker | (lb_len - 2));
|
||||
} else {
|
||||
lb_len -= M3MaxLen;
|
||||
NEEDS_OUT(lb_len / 255 + 2);
|
||||
*outp++ = uint8_t(M3Marker);
|
||||
WRITE_ZERO_BYTE_LENGTH(lb_len);
|
||||
}
|
||||
NEEDS_OUT(2);
|
||||
*outp++ = uint8_t(lb_off << 2);
|
||||
*outp++ = uint8_t(lb_off >> 6);
|
||||
} else {
|
||||
lb_off -= 0x4000;
|
||||
if (lb_len <= M4MaxLen) {
|
||||
NEEDS_OUT(1);
|
||||
*outp++ = uint8_t(M4Marker | ((lb_off & 0x4000) >> 11) | (lb_len - 2));
|
||||
} else {
|
||||
lb_len -= M4MaxLen;
|
||||
NEEDS_OUT(lb_len / 255 + 2);
|
||||
*outp++ = uint8_t(M4Marker | ((lb_off & 0x4000) >> 11));
|
||||
WRITE_ZERO_BYTE_LENGTH(lb_len);
|
||||
}
|
||||
NEEDS_OUT(2);
|
||||
*outp++ = uint8_t(lb_off << 2);
|
||||
*outp++ = uint8_t(lb_off >> 6);
|
||||
}
|
||||
return EResult::Success;
|
||||
}
|
||||
|
||||
EResult compress(const uint8_t* src, std::size_t src_size,
|
||||
uint8_t* dst, std::size_t init_dst_size,
|
||||
std::size_t& dst_size, DictBase& dict) {
|
||||
EResult err;
|
||||
State s;
|
||||
auto& d = static_cast<DictImpl&>(dict);
|
||||
dst_size = init_dst_size;
|
||||
uint8_t* outp = dst;
|
||||
uint8_t* outp_end = dst + dst_size;
|
||||
uint32_t lit_len = 0;
|
||||
uint32_t lb_off, lb_len;
|
||||
uint32_t best_off[MaxMatchByLengthLen];
|
||||
d.init(s, src, src_size);
|
||||
const uint8_t* lit_ptr = s.inp;
|
||||
d.advance(s, lb_off, lb_len, best_off, false);
|
||||
while (s.buf_sz > 0) {
|
||||
if (lit_len == 0)
|
||||
lit_ptr = s.bufp;
|
||||
if (lb_len < 2 || (lb_len == 2 && (lb_off > M1MaxOffset || lit_len == 0 || lit_len >= 4)) ||
|
||||
(lb_len == 2 && outp == dst) || (outp == dst && lit_len == 0)) {
|
||||
lb_len = 0;
|
||||
} else if (lb_len == M2MinLen && lb_off > M1MaxOffset + M2MaxOffset && lit_len >= 4) {
|
||||
lb_len = 0;
|
||||
}
|
||||
if (lb_len == 0) {
|
||||
++lit_len;
|
||||
d.advance(s, lb_off, lb_len, best_off, false);
|
||||
continue;
|
||||
}
|
||||
find_better_match(best_off, lb_len, lb_off);
|
||||
if ((err = encode_literal_run(outp, outp_end, dst, dst_size, lit_ptr, lit_len)) < EResult::Success)
|
||||
return err;
|
||||
if ((err = encode_lookback_match(outp, outp_end, dst, dst_size, lb_len, lb_off, lit_len)) < EResult::Success)
|
||||
return err;
|
||||
lit_len = 0;
|
||||
d.advance(s, lb_off, lb_len, best_off, true);
|
||||
}
|
||||
if ((err = encode_literal_run(outp, outp_end, dst, dst_size, lit_ptr, lit_len)) < EResult::Success)
|
||||
return err;
|
||||
|
||||
/* Terminating M4 */
|
||||
NEEDS_OUT(3);
|
||||
*outp++ = M4Marker | 1;
|
||||
*outp++ = 0;
|
||||
*outp++ = 0;
|
||||
|
||||
dst_size = outp - dst;
|
||||
return EResult::Success;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,79 +0,0 @@
|
||||
#pragma once
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
namespace lzokay {
|
||||
|
||||
enum class EResult {
|
||||
LookbehindOverrun = -4,
|
||||
OutputOverrun = -3,
|
||||
InputOverrun = -2,
|
||||
Error = -1,
|
||||
Success = 0,
|
||||
InputNotConsumed = 1,
|
||||
};
|
||||
|
||||
class DictBase {
|
||||
protected:
|
||||
static constexpr uint32_t HashSize = 0x4000;
|
||||
static constexpr uint32_t MaxDist = 0xbfff;
|
||||
static constexpr uint32_t MaxMatchLen = 0x800;
|
||||
static constexpr uint32_t BufSize = MaxDist + MaxMatchLen;
|
||||
|
||||
/* List encoding of previous 3-byte data matches */
|
||||
struct Match3 {
|
||||
uint16_t head[HashSize]; /* key -> chain-head-pos */
|
||||
uint16_t chain_sz[HashSize]; /* key -> chain-size */
|
||||
uint16_t chain[BufSize]; /* chain-pos -> next-chain-pos */
|
||||
uint16_t best_len[BufSize]; /* chain-pos -> best-match-length */
|
||||
};
|
||||
/* Encoding of 2-byte data matches */
|
||||
struct Match2 {
|
||||
uint16_t head[1 << 16]; /* 2-byte-data -> head-pos */
|
||||
};
|
||||
|
||||
struct Data {
|
||||
Match3 match3;
|
||||
Match2 match2;
|
||||
|
||||
/* Circular buffer caching enough data to access the maximum lookback
|
||||
* distance of 48K + maximum match length of 2K. An additional 2K is
|
||||
* allocated so the start of the buffer may be replicated at the end,
|
||||
* therefore providing efficient circular access.
|
||||
*/
|
||||
uint8_t buffer[BufSize + MaxMatchLen];
|
||||
};
|
||||
using storage_type = Data;
|
||||
storage_type* _storage;
|
||||
DictBase() = default;
|
||||
friend struct State;
|
||||
friend EResult compress(const uint8_t* src, std::size_t src_size,
|
||||
uint8_t* dst, std::size_t& dst_size, DictBase& dict);
|
||||
};
|
||||
template <template<typename> class _Alloc = std::allocator>
|
||||
class Dict : public DictBase {
|
||||
_Alloc<DictBase::storage_type> _allocator;
|
||||
public:
|
||||
Dict() { _storage = _allocator.allocate(1); }
|
||||
~Dict() { _allocator.deallocate(_storage, 1); }
|
||||
};
|
||||
|
||||
EResult decompress(const uint8_t* src, std::size_t src_size,
|
||||
uint8_t* dst, std::size_t dst_size,
|
||||
std::size_t& out_size);
|
||||
EResult compress(const uint8_t* src, std::size_t src_size,
|
||||
uint8_t* dst, std::size_t dst_size,
|
||||
std::size_t& out_size, DictBase& dict);
|
||||
inline EResult compress(const uint8_t* src, std::size_t src_size,
|
||||
uint8_t* dst, std::size_t dst_size,
|
||||
std::size_t& out_size) {
|
||||
Dict<> dict;
|
||||
return compress(src, src_size, dst, dst_size, out_size, dict);
|
||||
}
|
||||
|
||||
constexpr std::size_t compress_worst_size(std::size_t s) {
|
||||
return s + s / 16 + 64 + 3;
|
||||
}
|
||||
|
||||
}
|
||||
6359
libs/compression/minilzo.c
Normal file
99
libs/compression/minilzo.h
Normal file
@ -0,0 +1,99 @@
|
||||
/* minilzo.h -- mini subset of the LZO real-time data compression library
|
||||
|
||||
This file is part of the LZO real-time data compression library.
|
||||
|
||||
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer
|
||||
All Rights Reserved.
|
||||
|
||||
The LZO library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
The LZO library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with the LZO library; see the file COPYING.
|
||||
If not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
Markus F.X.J. Oberhumer
|
||||
<markus@oberhumer.com>
|
||||
http://www.oberhumer.com/opensource/lzo/
|
||||
*/
|
||||
|
||||
#ifndef __MINILZO_H_INCLUDED
|
||||
#define __MINILZO_H_INCLUDED 1
|
||||
|
||||
#define MINILZO_VERSION 0x20a0 /* 2.10 */
|
||||
|
||||
#if defined(__LZOCONF_H_INCLUDED)
|
||||
# error "you cannot use both LZO and miniLZO"
|
||||
#endif
|
||||
|
||||
/* internal Autoconf configuration file - only used when building miniLZO */
|
||||
#ifdef MINILZO_HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#ifndef __LZODEFS_H_INCLUDED
|
||||
#include "lzodefs.h"
|
||||
#endif
|
||||
#undef LZO_HAVE_CONFIG_H
|
||||
#include "lzoconf.h"
|
||||
|
||||
#if !defined(LZO_VERSION) || (LZO_VERSION != MINILZO_VERSION)
|
||||
# error "version mismatch in header files"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
//
|
||||
************************************************************************/
|
||||
|
||||
/* Memory required for the wrkmem parameter.
|
||||
* When the required size is 0, you can also pass a NULL pointer.
|
||||
*/
|
||||
|
||||
#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS
|
||||
#define LZO1X_1_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
|
||||
#define LZO1X_MEM_DECOMPRESS (0)
|
||||
|
||||
|
||||
/* compression */
|
||||
LZO_EXTERN(int)
|
||||
lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len,
|
||||
lzo_bytep dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem );
|
||||
|
||||
/* decompression */
|
||||
LZO_EXTERN(int)
|
||||
lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len,
|
||||
lzo_bytep dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem /* NOT USED */ );
|
||||
|
||||
/* safe decompression with overrun testing */
|
||||
LZO_EXTERN(int)
|
||||
lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
|
||||
lzo_bytep dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem /* NOT USED */ );
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* already included */
|
||||
|
||||
|
||||
/* vim:set ts=4 sw=4 et: */
|
||||
@ -2,15 +2,15 @@ QT += core widgets
|
||||
TEMPLATE = lib
|
||||
CONFIG += staticlib c++17
|
||||
|
||||
SOURCES += \
|
||||
logmanager.cpp \
|
||||
statusbarmanager.cpp
|
||||
SOURCES += $$files($$PWD/*.cpp, true) \
|
||||
xdatastream.cpp
|
||||
HEADERS += $$files($$PWD/*.h, true) \
|
||||
xdatastream.h
|
||||
|
||||
HEADERS += \
|
||||
enums.h \
|
||||
logmanager.h \
|
||||
stringutils.h \
|
||||
utils.h \
|
||||
statusbarmanager.h
|
||||
LIBS += -L$$OUT_PWD/../libs/xassets -lxassets
|
||||
|
||||
INCLUDEPATH += $$PWD/../xassets
|
||||
|
||||
DEPENDPATH += $$PWD/../xassets
|
||||
|
||||
DESTDIR = $$OUT_PWD/../
|
||||
|
||||
@ -3,28 +3,6 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
enum FF_PLATFORM {
|
||||
FF_PLATFORM_NONE = 0x00, // No platform
|
||||
FF_PLATFORM_XBOX = 0x01, // Xbox 360
|
||||
FF_PLATFORM_PS3 = 0x02, // Playstation 3
|
||||
FF_PLATFORM_PC = 0x03, // PC
|
||||
FF_PLATFORM_WII = 0x04, // WII
|
||||
FF_PLATFORM_WIIU = 0x05 // WII U
|
||||
};
|
||||
|
||||
enum FF_GAME {
|
||||
FF_GAME_NONE = 0x00, // No game
|
||||
FF_GAME_COD1 = 0x01, // Call of Duty
|
||||
FF_GAME_COD2 = 0x02, // Call of Duty 2
|
||||
FF_GAME_COD3 = 0x03, // Call of Duty 3
|
||||
FF_GAME_COD4 = 0x04, // Modern Warware 1
|
||||
FF_GAME_COD5 = 0x05, // World at War
|
||||
FF_GAME_COD6 = 0x06, // Modern Warfare 2
|
||||
FF_GAME_COD7 = 0x07, // Black Ops 1
|
||||
FF_GAME_COD8 = 0x08, // Modern Warfare 3
|
||||
FF_GAME_COD9 = 0x09, // Black Ops 2
|
||||
};
|
||||
|
||||
enum IWI_VERSION {
|
||||
IWI_VERSION_COD2 = 0x05, // 05 CoD2
|
||||
IWI_VERSION_COD4 = 0x06, // 06 CoD4
|
||||
@ -432,7 +410,7 @@ enum MENU_FONT_TYPE{
|
||||
UI_FONT_DEFAULT = 0, // auto-chose betwen big/reg/small
|
||||
UI_FONT_NORMAL = 1,
|
||||
UI_FONT_BIG = 2,
|
||||
UI_FONT_SMALL = 3,
|
||||
UI_GameFontMALL = 3,
|
||||
UI_FONT_BOLD = 4,
|
||||
UI_FONT_CONSOLE = 5,
|
||||
UI_FONT_OBJECTIVE = 6,
|
||||
@ -650,25 +628,6 @@ enum MENU_BUTTON {
|
||||
APAD_RIGHT = 31
|
||||
};
|
||||
|
||||
enum ASSET_TYPE {
|
||||
ASSET_UNKNOWN = 0,
|
||||
ASSET_ANIMATION = 4, // x_anim PARTIALLY VERIFIED
|
||||
ASSET_MODEL = 5, // xmodel PARTIALLY VERIFIED
|
||||
ASSET_MATERIAL = 6, // material VERIFIED
|
||||
ASSET_BIK_FILE = 7, // .bik file PARTIALLY VERIFIED
|
||||
ASSET_SOUND = 9, // loaded_sound VERIFIED
|
||||
ASSET_COLLISION_MAP = 12, // collision_map PARTIALLY VERIFIED
|
||||
ASSET_SHADER = 13, // shader PARTIALLY VERIFIED
|
||||
ASSET_D3DBSP_DUMP = 17, // d3dbsp dump VERIFIED
|
||||
ASSET_FONT = 20, // font PARTIALLY VERIFIED
|
||||
ASSET_MENU = 21, // menu_file VERIFIED
|
||||
ASSET_LOCAL_STRING = 23, // localized string VERIFIED
|
||||
ASSET_WEAPON = 24, // weapon VERIFIED
|
||||
ASSET_EFFECT = 26, // fx VERIFIED
|
||||
ASSET_RAW_FILE = 32, // raw_file VERIFIED
|
||||
ASSET_STRING_TABLE = 33 // string_table PARTIALLY VERIFIED
|
||||
};
|
||||
|
||||
enum SHADER_TYPE {
|
||||
SHADER_NONE = 0x00,
|
||||
SHADER_PIXEL = 0x01,
|
||||
|
||||