Compare commits
2066 Commits
releasing-
...
latest-cma
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af0c423359 | ||
|
|
45253e0008 | ||
|
|
e32e5c2a47 | ||
|
|
3a4f9f06cb | ||
|
|
a563030440 | ||
|
|
80d43896ff | ||
|
|
1c5949411f | ||
|
|
699b151939 | ||
|
|
e6af1a08b9 | ||
|
|
7eac02f8d4 | ||
|
|
58e70e2500 | ||
|
|
56ca2021dc | ||
|
|
e4e431dcee | ||
|
|
abfff205ee | ||
|
|
6416e4e0d9 | ||
|
|
86f4730db7 | ||
|
|
33a5479512 | ||
|
|
891859f4ca | ||
|
|
d5bfb8201b | ||
|
|
f49ef92f90 | ||
|
|
02d004b5bf | ||
|
|
55f8a8a1d0 | ||
|
|
068a69c80b | ||
|
|
375e66489f | ||
|
|
cbbd034862 | ||
|
|
f7fe948da5 | ||
|
|
478ce0863b | ||
|
|
329011460f | ||
|
|
48ec51a923 | ||
|
|
9936962c56 | ||
|
|
15111d1b20 | ||
|
|
07e6d90c98 | ||
|
|
85231cda01 | ||
|
|
8549b7b1b4 | ||
|
|
9f58ef9916 | ||
|
|
c734ee9fd1 | ||
|
|
77d87902d9 | ||
|
|
b5c8656ac9 | ||
|
|
28f6b73da6 | ||
|
|
521b505543 | ||
|
|
c5a3310103 | ||
|
|
0c053c713a | ||
|
|
bc06f93aae | ||
|
|
8e919aeeb1 | ||
|
|
6bd09e42e0 | ||
|
|
1f670b9919 | ||
|
|
c805a58fb0 | ||
|
|
34517004df | ||
|
|
b0506bcd96 | ||
|
|
7a3a6c04a6 | ||
|
|
54e4b08e1f | ||
|
|
67c22c5186 | ||
|
|
87aba86fa8 | ||
|
|
28ea300f42 | ||
|
|
858c26b46a | ||
|
|
70a6c7149c | ||
|
|
b4a34216c8 | ||
|
|
3868f4eb98 | ||
|
|
44304ee5b3 | ||
|
|
9f4b8d65c8 | ||
|
|
665f8ce755 | ||
|
|
e1d5348f23 | ||
|
|
b596dc9eea | ||
|
|
eb8370b86b | ||
|
|
fa69686f0a | ||
|
|
3fe5372d28 | ||
|
|
3058d42b49 | ||
|
|
4975ee0028 | ||
|
|
d4e1d809f3 | ||
|
|
44cb0d995e | ||
|
|
c73d08187b | ||
|
|
4382c34539 | ||
|
|
cb173b7bf9 | ||
|
|
b5d4674471 | ||
|
|
be1803dfb6 | ||
|
|
417c1af21e | ||
|
|
00bccd02da | ||
|
|
8596443da5 | ||
|
|
a2eda76a26 | ||
|
|
b4e25838bd | ||
|
|
44d703887c | ||
|
|
29fd3e4c96 | ||
|
|
0778b13e2b | ||
|
|
bef1f6d8b8 | ||
|
|
d6a0b04930 | ||
|
|
87ae60f323 | ||
|
|
85df061701 | ||
|
|
4ed44c638f | ||
|
|
54f0cd7864 | ||
|
|
4f523b1b9b | ||
|
|
d492481a4f | ||
|
|
3975a45858 | ||
|
|
5f2fbb370c | ||
|
|
d9bd6bbb32 | ||
|
|
31814bda37 | ||
|
|
8f61b590f8 | ||
|
|
37642c1f78 | ||
|
|
8ea7b4d4cb | ||
|
|
245f5c6e93 | ||
|
|
88d1c29621 | ||
|
|
44926393ac | ||
|
|
5d790c9406 | ||
|
|
66261b0f51 | ||
|
|
e99a9abacd | ||
|
|
b01c1455f5 | ||
|
|
650d794eec | ||
|
|
acf74e7f6e | ||
|
|
53f0c2421d | ||
|
|
01d46615a7 | ||
|
|
57f55e4270 | ||
|
|
5c159e86d7 | ||
|
|
fb03037923 | ||
|
|
ff6e4aec9a | ||
|
|
c78db0eb26 | ||
|
|
324e206b74 | ||
|
|
030dca051a | ||
|
|
24e3fd3267 | ||
|
|
a28f6b1194 | ||
|
|
38e97aa79f | ||
|
|
8adfd1b10b | ||
|
|
ffda7a53fe | ||
|
|
20ddd9157f | ||
|
|
a3f329bd7a | ||
|
|
13c6837b60 | ||
|
|
84fe9fbc74 | ||
|
|
e5ec92ac2a | ||
|
|
12155f9390 | ||
|
|
00da0bd0d1 | ||
|
|
4bf5943ac5 | ||
|
|
f205de7205 | ||
|
|
f782c535f9 | ||
|
|
030d6bc4bb | ||
|
|
9c10574e49 | ||
|
|
9512e5c3db | ||
|
|
8686fef96a | ||
|
|
06285c11c7 | ||
|
|
3b58790c96 | ||
|
|
a8b494f960 | ||
|
|
72c6f448d0 | ||
|
|
ce3c75817c | ||
|
|
56c943d6d1 | ||
|
|
21b0b4c524 | ||
|
|
51daf691b3 | ||
|
|
e889aff42c | ||
|
|
df07b6dc9e | ||
|
|
63c15b54d6 | ||
|
|
b76a231083 | ||
|
|
e0f58e1916 | ||
|
|
78bfa604e2 | ||
|
|
dcbe0c40b0 | ||
|
|
f384d75de8 | ||
|
|
cf6084071b | ||
|
|
0150796064 | ||
|
|
f91186ffa4 | ||
|
|
ba73da321b | ||
|
|
8ae3e1ea98 | ||
|
|
fa5b075af5 | ||
|
|
a66fced2f7 | ||
|
|
33492602fb | ||
|
|
b7dae1025b | ||
|
|
7627a00dce | ||
|
|
d761bac85c | ||
|
|
3bf1cca118 | ||
|
|
cdb056e8ba | ||
|
|
e47256eae7 | ||
|
|
5f1874edae | ||
|
|
22376e873e | ||
|
|
02d882a7c3 | ||
|
|
d878e0c450 | ||
|
|
1430cfd6b4 | ||
|
|
5a3493c0c9 | ||
|
|
911f8f6de6 | ||
|
|
fe8fbd058b | ||
|
|
c4529a0949 | ||
|
|
6ec3a68f0a | ||
|
|
458731778d | ||
|
|
64547271dc | ||
|
|
9e584951ac | ||
|
|
c859fdd08e | ||
|
|
1380ee6f20 | ||
|
|
2da2272a53 | ||
|
|
17b6996ae4 | ||
|
|
0f82b6efba | ||
|
|
178fcb9717 | ||
|
|
19f0c653d1 | ||
|
|
7dc76876e4 | ||
|
|
60457886cc | ||
|
|
ec078b6ccc | ||
|
|
ec730a4383 | ||
|
|
b2b3255f59 | ||
|
|
df925cfcb0 | ||
|
|
5b96f30b1a | ||
|
|
8feb870c8f | ||
|
|
d0b2340a73 | ||
|
|
efac298eb0 | ||
|
|
453c5b0d6e | ||
|
|
816010582a | ||
|
|
a260eb11a8 | ||
|
|
b1d271f1c2 | ||
|
|
3faa959c09 | ||
|
|
a12a5e1637 | ||
|
|
7c6d59a292 | ||
|
|
9836d8595c | ||
|
|
c9d5dfaf1b | ||
|
|
028f6cbb4e | ||
|
|
c56d1b0bec | ||
|
|
2e61f6c13d | ||
|
|
8437467320 | ||
|
|
039be43c2b | ||
|
|
a1af7d9b9f | ||
|
|
4ce37964f4 | ||
|
|
c1cdfa78d3 | ||
|
|
ff4911116c | ||
|
|
bb9d98cc0c | ||
|
|
2d93d9b3cc | ||
|
|
1c60ba6e7f | ||
|
|
11b3989615 | ||
|
|
c9f26a48c7 | ||
|
|
75cbaf0f06 | ||
|
|
de1dc6828d | ||
|
|
e6bf23e536 | ||
|
|
5b16ff4a69 | ||
|
|
ed42c3fd29 | ||
|
|
9cd67eedc1 | ||
|
|
acc589bdb6 | ||
|
|
2d78512ca2 | ||
|
|
84023a5f66 | ||
|
|
443f378d1b | ||
|
|
d4989d7576 | ||
|
|
860b0b64e3 | ||
|
|
ba40253a46 | ||
|
|
95b81b6425 | ||
|
|
b664c2bed1 | ||
|
|
c6c4c17b30 | ||
|
|
5e46016c4d | ||
|
|
da874738d6 | ||
|
|
0a68a056d8 | ||
|
|
5a3a32462d | ||
|
|
c70762f871 | ||
|
|
6c28496dd8 | ||
|
|
90ed6e1fdd | ||
|
|
60d7675a36 | ||
|
|
a9b42127d1 | ||
|
|
01fdcfdfec | ||
|
|
2d383e237f | ||
|
|
143b3d98b1 | ||
|
|
6f4377de76 | ||
|
|
722056e78a | ||
|
|
21710ddfb3 | ||
|
|
13f590c6a2 | ||
|
|
d604ae2d77 | ||
|
|
7a35c253cb | ||
|
|
b5129f702e | ||
|
|
6b1e51b4f6 | ||
|
|
3776bff594 | ||
|
|
3afcc7fdf9 | ||
|
|
e74921cbdf | ||
|
|
e9c33e3bea | ||
|
|
36d4db49ca | ||
|
|
2c40c77403 | ||
|
|
15febaf851 | ||
|
|
02dce1af2e | ||
|
|
5915ceb0a5 | ||
|
|
d6f666d9a0 | ||
|
|
37fa69fc39 | ||
|
|
8e47927805 | ||
|
|
f1c1161da5 | ||
|
|
392382e3e3 | ||
|
|
d6403918b6 | ||
|
|
fc9b0b233c | ||
|
|
f16755b86b | ||
|
|
f45e975b14 | ||
|
|
b3de6a283d | ||
|
|
7fa204fc9c | ||
|
|
f284a9691b | ||
|
|
9bb63a68f5 | ||
|
|
77d20e89c8 | ||
|
|
66f664207a | ||
|
|
bac69f95d8 | ||
|
|
75e372ac9b | ||
|
|
ef31192f33 | ||
|
|
fde707b726 | ||
|
|
e158e95245 | ||
|
|
5b23cc2e33 | ||
|
|
c72cdff0f1 | ||
|
|
831c8f73b0 | ||
|
|
2dc6c62acb | ||
|
|
9e1d1a056c | ||
|
|
9a32ae2c6d | ||
|
|
b1a2003a84 | ||
|
|
e2c1d62552 | ||
|
|
db0f6d6c0b | ||
|
|
bc44ee8056 | ||
|
|
65a9bd55d8 | ||
|
|
2aa0668c28 | ||
|
|
9f5e37a03c | ||
|
|
f27763870c | ||
|
|
ab22e02db8 | ||
|
|
257afd3525 | ||
|
|
eec38de558 | ||
|
|
35de677999 | ||
|
|
8b9dfdf96d | ||
|
|
c830ef88ca | ||
|
|
ba0daed776 | ||
|
|
f37d946b4e | ||
|
|
477419cc32 | ||
|
|
70e8d1c4b3 | ||
|
|
732f795be4 | ||
|
|
00536fa3d9 | ||
|
|
042f00cc58 | ||
|
|
acef89ea03 | ||
|
|
d7770d285f | ||
|
|
7932941a01 | ||
|
|
c4eac5e62b | ||
|
|
763bd60e74 | ||
|
|
3fa52e7ac5 | ||
|
|
9104afdef7 | ||
|
|
942c95e736 | ||
|
|
dc696a0f45 | ||
|
|
d26e9da6c4 | ||
|
|
ea09b1f6bc | ||
|
|
da033eb28e | ||
|
|
b2a0ccba05 | ||
|
|
3f146c94e5 | ||
|
|
9d92bdcd75 | ||
|
|
6354d8ccca | ||
|
|
1d0237f15d | ||
|
|
c535d033ec | ||
|
|
fcf900c5e0 | ||
|
|
c265ce8222 | ||
|
|
658b90067a | ||
|
|
80b6496780 | ||
|
|
711934a249 | ||
|
|
ea5e397595 | ||
|
|
c8dc416071 | ||
|
|
30026fc307 | ||
|
|
7b0fdcd721 | ||
|
|
c0afb3b95e | ||
|
|
5504bf23d1 | ||
|
|
28b51d3335 | ||
|
|
fb91726c35 | ||
|
|
a97a7edca6 | ||
|
|
92b4909fc8 | ||
|
|
3998c21178 | ||
|
|
41d925d7c9 | ||
|
|
7029636291 | ||
|
|
a916c1067f | ||
|
|
7322d4da8b | ||
|
|
31f15b12cb | ||
|
|
4d3e463aba | ||
|
|
166526dbbe | ||
|
|
348ada3f0d | ||
|
|
2c5f6d8332 | ||
|
|
e128d548f4 | ||
|
|
bb2ab1c1fe | ||
|
|
715bedb71a | ||
|
|
8fed9e47d1 | ||
|
|
89f8f7e25e | ||
|
|
7bbba293a6 | ||
|
|
d57a694d3c | ||
|
|
f31d5c04c8 | ||
|
|
85f66a8fec | ||
|
|
48ec606bc5 | ||
|
|
75cc809b16 | ||
|
|
2a27a491e7 | ||
|
|
3e75d70632 | ||
|
|
cf2d094df6 | ||
|
|
18a7955240 | ||
|
|
22ebc27997 | ||
|
|
c53ee24b5b | ||
|
|
25e681c04a | ||
|
|
365e0b49ae | ||
|
|
e3dc78b28e | ||
|
|
e3319f6fe4 | ||
|
|
0a9b006a94 | ||
|
|
5692be3b66 | ||
|
|
6ea5dea849 | ||
|
|
8debcf0fa2 | ||
|
|
1cf4845cb2 | ||
|
|
b9d1292add | ||
|
|
19063fd8db | ||
|
|
76cf732100 | ||
|
|
30a7eef611 | ||
|
|
99f0020583 | ||
|
|
f2e0da47ed | ||
|
|
ca66a428d8 | ||
|
|
f077a4e074 | ||
|
|
e46631a960 | ||
|
|
2da1957c70 | ||
|
|
ad6c48688d | ||
|
|
71da7fb384 | ||
|
|
0159e0e41e | ||
|
|
457a3fdc7a | ||
|
|
8507c0138d | ||
|
|
4f7901b946 | ||
|
|
e239dc039b | ||
|
|
1428eeba06 | ||
|
|
adcf6fb86d | ||
|
|
de2d663968 | ||
|
|
60f6c683a3 | ||
|
|
f8009672e9 | ||
|
|
9fe5ac1994 | ||
|
|
58efb51c07 | ||
|
|
5c3a064746 | ||
|
|
94aefa6dba | ||
|
|
7f6e96459c | ||
|
|
6fe57be115 | ||
|
|
37b3f28065 | ||
|
|
0b9468da1b | ||
|
|
e558f21ebc | ||
|
|
71c1512ef2 | ||
|
|
d03ebdace8 | ||
|
|
d86b9119a4 | ||
|
|
0ab872e152 | ||
|
|
5e7f81678d | ||
|
|
ff510248e9 | ||
|
|
bba5d4380d | ||
|
|
39ad95d4db | ||
|
|
e9adde8ac6 | ||
|
|
8fc120d9f9 | ||
|
|
7f8339aedf | ||
|
|
d2183f3b91 | ||
|
|
11b4aa7308 | ||
|
|
51481daf03 | ||
|
|
1bdd0f6e26 | ||
|
|
1de492973e | ||
|
|
eea96dac73 | ||
|
|
ebc378a620 | ||
|
|
3d08ca0cc1 | ||
|
|
f11cc41df8 | ||
|
|
19ce59b1b4 | ||
|
|
5101ac9d8e | ||
|
|
5149882bb5 | ||
|
|
26222ee853 | ||
|
|
0394e2cda9 | ||
|
|
501b310efa | ||
|
|
53e0b1b81c | ||
|
|
81be616847 | ||
|
|
b9b2c9afb0 | ||
|
|
848cd9a485 | ||
|
|
75921e1130 | ||
|
|
0b14639c66 | ||
|
|
5c54f85de4 | ||
|
|
0202313bc8 | ||
|
|
2671826b19 | ||
|
|
7dc89ad090 | ||
|
|
c54f0ea329 | ||
|
|
d90f3ce309 | ||
|
|
bcc6ced47c | ||
|
|
1b5c61a285 | ||
|
|
ca95192de3 | ||
|
|
c2e04443e3 | ||
|
|
f4f8c94c6a | ||
|
|
f957fca162 | ||
|
|
9671711bf5 | ||
|
|
ea3d4c67f8 | ||
|
|
cab1f59181 | ||
|
|
8c01611850 | ||
|
|
d6b682ab88 | ||
|
|
d2beaa0ab9 | ||
|
|
ce0fafd45b | ||
|
|
c0dbd00b74 | ||
|
|
a556aed34f | ||
|
|
8d19ee8ab3 | ||
|
|
8c4c80731c | ||
|
|
de6619b383 | ||
|
|
941dc253fb | ||
|
|
25705a6b02 | ||
|
|
4d56269130 | ||
|
|
96236df293 | ||
|
|
f447482e32 | ||
|
|
401b8fc496 | ||
|
|
2e2a2aaf03 | ||
|
|
66c2ab38ed | ||
|
|
6e0b7e2c23 | ||
|
|
f335623f69 | ||
|
|
f8369ee39a | ||
|
|
2a1bacdfa4 | ||
|
|
a93dd6586d | ||
|
|
f3dd1be125 | ||
|
|
5b49530df9 | ||
|
|
00555e3c75 | ||
|
|
972746d388 | ||
|
|
db3aaf96c7 | ||
|
|
e12c87b869 | ||
|
|
ad80b000c9 | ||
|
|
9bcc54c56c | ||
|
|
3e6d207bf0 | ||
|
|
6c836e0fde | ||
|
|
5f9e123571 | ||
|
|
20ba624de2 | ||
|
|
12426cf8a7 | ||
|
|
1cd6f00c59 | ||
|
|
365d5784b7 | ||
|
|
a90cddf589 | ||
|
|
5f71017142 | ||
|
|
c81402b8ce | ||
|
|
6122410db1 | ||
|
|
42e240c9ab | ||
|
|
01459b7759 | ||
|
|
cd2f4480f4 | ||
|
|
ce92679be0 | ||
|
|
e9705b2cc5 | ||
|
|
a2007dd59e | ||
|
|
d6052b718e | ||
|
|
6bfc79fb03 | ||
|
|
e9a5f30c71 | ||
|
|
9a61b7f13b | ||
|
|
2073f3d7ed | ||
|
|
774cd46892 | ||
|
|
f593ee7c9f | ||
|
|
47d35446e2 | ||
|
|
3e16969808 | ||
|
|
3e95f5cd05 | ||
|
|
15a8437d79 | ||
|
|
6a213bffa6 | ||
|
|
5be01a7577 | ||
|
|
89b8eabe0c | ||
|
|
3cecc34a9c | ||
|
|
9e76214be8 | ||
|
|
5b059f974f | ||
|
|
ecb4f64f91 | ||
|
|
992121c659 | ||
|
|
cbc41214d8 | ||
|
|
53c7a81666 | ||
|
|
a63065b44f | ||
|
|
cec4494ce6 | ||
|
|
60411027ca | ||
|
|
8d7b9293b5 | ||
|
|
2133dfd80c | ||
|
|
1a75f51aa6 | ||
|
|
2a8c036c63 | ||
|
|
c90f357bff | ||
|
|
4d381452b5 | ||
|
|
087b53c1c5 | ||
|
|
58a2769f2b | ||
|
|
ce38c3e5c5 | ||
|
|
12f7d5e4b6 | ||
|
|
fd703dd4d1 | ||
|
|
3ef4c1f6e0 | ||
|
|
0e95444552 | ||
|
|
aca90db2c2 | ||
|
|
09edd055e6 | ||
|
|
892ef6b1b3 | ||
|
|
ed838815ef | ||
|
|
8d8c4d1a95 | ||
|
|
debdf917ea | ||
|
|
f03961bc19 | ||
|
|
fb4572264d | ||
|
|
d7445a70f9 | ||
|
|
78bcf9a738 | ||
|
|
d71c85412f | ||
|
|
f5c9ab72ef | ||
|
|
5c4cd74c39 | ||
|
|
5a1daf5dc9 | ||
|
|
4de2a45195 | ||
|
|
91d3a6ecb7 | ||
|
|
763918e129 | ||
|
|
525c166f62 | ||
|
|
6b2ed24fc3 | ||
|
|
1eae3a032f | ||
|
|
755cfe19d5 | ||
|
|
559331cf82 | ||
|
|
18fddb1537 | ||
|
|
861620cb6e | ||
|
|
568f3ae94f | ||
|
|
0af00a313e | ||
|
|
ff52f020e2 | ||
|
|
55bf7bcbda | ||
|
|
bccb740c45 | ||
|
|
b7307adc10 | ||
|
|
edb71dcef0 | ||
|
|
7ddf232615 | ||
|
|
a7cdb0a514 | ||
|
|
7157e571c8 | ||
|
|
d073b7b3c0 | ||
|
|
27d67398fb | ||
|
|
cc6ced9197 | ||
|
|
712e42c71f | ||
|
|
53efc96e30 | ||
|
|
5b2ac0f022 | ||
|
|
b5cdcc29bc | ||
|
|
df3e6e5fb7 | ||
|
|
27145bdabe | ||
|
|
71aedfd96d | ||
|
|
8530292fef | ||
|
|
f1bc268f58 | ||
|
|
2e79f5a369 | ||
|
|
1427b1709a | ||
|
|
960d4d35fb | ||
|
|
7a467ce860 | ||
|
|
cd46314b4e | ||
|
|
9c81acff53 | ||
|
|
d8b2e2873b | ||
|
|
98cd6675d9 | ||
|
|
002085ad32 | ||
|
|
2e525dfdcc | ||
|
|
a378e3a72d | ||
|
|
7e14b2fc5a | ||
|
|
51016f9258 | ||
|
|
adad723110 | ||
|
|
a10e7ab279 | ||
|
|
0c124327de | ||
|
|
6c5f706064 | ||
|
|
2422e72713 | ||
|
|
e49e4a5e67 | ||
|
|
14d8d65de0 | ||
|
|
d3305cadb6 | ||
|
|
17c28ca584 | ||
|
|
151905c5f3 | ||
|
|
ab49ea07e8 | ||
|
|
8e436e6b55 | ||
|
|
de5414ec19 | ||
|
|
e5d71579af | ||
|
|
5ec4c9714c | ||
|
|
eafb2558c2 | ||
|
|
4cefcb26c2 | ||
|
|
8a86e7d0f7 | ||
|
|
b20fb61e1c | ||
|
|
feeed99c62 | ||
|
|
aa5008f865 | ||
|
|
c4ce2aa977 | ||
|
|
7cc31a473c | ||
|
|
a8193012aa | ||
|
|
eb0ecedecf | ||
|
|
de44abd529 | ||
|
|
9807ca99f9 | ||
|
|
8c9d2d6f1d | ||
|
|
65ef1f384c | ||
|
|
bf2cc36719 | ||
|
|
34ffe7eefa | ||
|
|
b756c8b9ec | ||
|
|
19a98c9ad6 | ||
|
|
e159025ebb | ||
|
|
05e81ad923 | ||
|
|
8e1a0eb20f | ||
|
|
a881b8fa5a | ||
|
|
6982030013 | ||
|
|
01da4c6af5 | ||
|
|
a42805d4cc | ||
|
|
01145c4581 | ||
|
|
4d1dfb58ff | ||
|
|
43f44a4142 | ||
|
|
b314d3cafe | ||
|
|
9bbf28e44b | ||
|
|
d995d25f69 | ||
|
|
1f58b8e6a7 | ||
|
|
eeb881cdc2 | ||
|
|
807874ce5d | ||
|
|
213d11c8e9 | ||
|
|
dfd0761506 | ||
|
|
4c30086896 | ||
|
|
1efdca399e | ||
|
|
4f27c8051a | ||
|
|
d43693fef0 | ||
|
|
88f0202b16 | ||
|
|
be98e0b543 | ||
|
|
8a907bb3f3 | ||
|
|
1b34a478a1 | ||
|
|
cda0bba555 | ||
|
|
dae1b10de1 | ||
|
|
0c4e72ece2 | ||
|
|
77dfd51b28 | ||
|
|
b601a549d0 | ||
|
|
c4907edd76 | ||
|
|
dcf4148d75 | ||
|
|
8afeef568f | ||
|
|
dd5635d9cd | ||
|
|
62a6ddf3ca | ||
|
|
195daa97f3 | ||
|
|
b1c5c87443 | ||
|
|
1ab88940f9 | ||
|
|
8ba97b8a74 | ||
|
|
e7f5442a64 | ||
|
|
066dd866b1 | ||
|
|
fa0722a9e2 | ||
|
|
5f276f6b22 | ||
|
|
c45b5751af | ||
|
|
161802cf9d | ||
|
|
0679832b04 | ||
|
|
b20d6f8820 | ||
|
|
52fb40d543 | ||
|
|
067279d2e8 | ||
|
|
a0bbed6c6c | ||
|
|
9371125eb0 | ||
|
|
0a0f6cdce9 | ||
|
|
fc350be3a1 | ||
|
|
be731a99c0 | ||
|
|
c65fd1d7ae | ||
|
|
be899159f3 | ||
|
|
2400e6578b | ||
|
|
1aac2b8e75 | ||
|
|
c7581220b8 | ||
|
|
f3968215e0 | ||
|
|
56a8011b78 | ||
|
|
adccae7937 | ||
|
|
1c63c1937a | ||
|
|
4753f7bb51 | ||
|
|
d7fec7d10a | ||
|
|
3c90a29b1e | ||
|
|
98de361bf4 | ||
|
|
c1df10e064 | ||
|
|
3743e0bc03 | ||
|
|
12e6a4d0ae | ||
|
|
969511953a | ||
|
|
223e2e04b0 | ||
|
|
0b0368ffcc | ||
|
|
9e4684b524 | ||
|
|
d825c7e4ea | ||
|
|
c38c996773 | ||
|
|
71a9ef00ee | ||
|
|
89a30ae5ee | ||
|
|
94bd0e057b | ||
|
|
0efc6338bb | ||
|
|
3b98da1d86 | ||
|
|
6927c68811 | ||
|
|
f0909ba3a0 | ||
|
|
2f7d2873f7 | ||
|
|
7a6b6aa335 | ||
|
|
2861ef0c73 | ||
|
|
059fc06f3a | ||
|
|
a971576de0 | ||
|
|
a4e059e3ec | ||
|
|
07408b7bc3 | ||
|
|
9722f7b71e | ||
|
|
45d8413d59 | ||
|
|
5c400457a9 | ||
|
|
3e9ee5890f | ||
|
|
1acdb40498 | ||
|
|
1dc0b00133 | ||
|
|
f2208389bd | ||
|
|
ab92c3e15b | ||
|
|
018e35295a | ||
|
|
2c9e90eee0 | ||
|
|
847f21f7dc | ||
|
|
b90dfbe3b0 | ||
|
|
c230794c82 | ||
|
|
7f83aa7253 | ||
|
|
1039815017 | ||
|
|
2c43eac80d | ||
|
|
4aa6ad3203 | ||
|
|
730b05ad1b | ||
|
|
5a7b2c5029 | ||
|
|
7ae551de9d | ||
|
|
96dd3faef0 | ||
|
|
ffdc8cd9ff | ||
|
|
8256ac3bee | ||
|
|
037ab83519 | ||
|
|
a56e77310d | ||
|
|
5350fb7f5d | ||
|
|
9161f89057 | ||
|
|
1d2abeb20b | ||
|
|
833c21192a | ||
|
|
86168e454f | ||
|
|
a20c2ce29a | ||
|
|
874b27c56d | ||
|
|
a7dc44e4e1 | ||
|
|
047d08882e | ||
|
|
52df1ad963 | ||
|
|
c2cec37928 | ||
|
|
239a186b36 | ||
|
|
5aeb2ebc05 | ||
|
|
a7e87aaae5 | ||
|
|
eb545eca57 | ||
|
|
44ab1827bf | ||
|
|
96b4f024b4 | ||
|
|
b070035770 | ||
|
|
1b0c3d8c00 | ||
|
|
2e71cb08d0 | ||
|
|
3da5d12bee | ||
|
|
e8019bbb92 | ||
|
|
30dab27202 | ||
|
|
cc7077d783 | ||
|
|
fda7e9f39d | ||
|
|
e178533493 | ||
|
|
e3ad9296bc | ||
|
|
01042a62ae | ||
|
|
7bd940ddb3 | ||
|
|
f168702aad | ||
|
|
2a33c0c375 | ||
|
|
eea240d7f2 | ||
|
|
afb98a374c | ||
|
|
ed0d28eaf6 | ||
|
|
50345101e5 | ||
|
|
c0e4010c88 | ||
|
|
193d7accb4 | ||
|
|
a9be34c627 | ||
|
|
0e14226968 | ||
|
|
068b03a0bb | ||
|
|
b99f9ae752 | ||
|
|
3519871f80 | ||
|
|
e9db853f28 | ||
|
|
a6fdd89e1d | ||
|
|
b8bfe7acc1 | ||
|
|
dd5d5589ff | ||
|
|
7d460e093c | ||
|
|
54e86915b0 | ||
|
|
ab2effd776 | ||
|
|
4f0da67a83 | ||
|
|
014ca36a4a | ||
|
|
2971e64182 | ||
|
|
d7737c13ff | ||
|
|
eebcc9c925 | ||
|
|
0c90b39a96 | ||
|
|
4f3f96337f | ||
|
|
e855ca72aa | ||
|
|
8ff47bf8e2 | ||
|
|
9d75f69a79 | ||
|
|
ae33977e10 | ||
|
|
07b5f35b98 | ||
|
|
c4acf006dd | ||
|
|
12b80307a7 | ||
|
|
43fd399d10 | ||
|
|
cc5d8940bf | ||
|
|
09ed1ab683 | ||
|
|
26c85fd18a | ||
|
|
894615bee6 | ||
|
|
aeed094be0 | ||
|
|
61068ee166 | ||
|
|
bdce25cb8c | ||
|
|
6a71bf5653 | ||
|
|
3007ddc093 | ||
|
|
4495e1649f | ||
|
|
f960cdea9b | ||
|
|
b70b2a65bc | ||
|
|
4a73e90da8 | ||
|
|
fc59bef156 | ||
|
|
512f4ca4e4 | ||
|
|
f254ca57c6 | ||
|
|
5e35dac1da | ||
|
|
44cbd408ce | ||
|
|
6fbe9de1a8 | ||
|
|
3b1410f913 | ||
|
|
f9265923a9 | ||
|
|
3282848631 | ||
|
|
f142363bfa | ||
|
|
c0e9800179 | ||
|
|
97308ca31c | ||
|
|
02992954c2 | ||
|
|
78d4f178a3 | ||
|
|
fe577d9dd0 | ||
|
|
007010067b | ||
|
|
bc2d8dab31 | ||
|
|
296f8645fb | ||
|
|
2d76c8ff0d | ||
|
|
0a3d9f9876 | ||
|
|
2a1d0b19ce | ||
|
|
a99c57ab1a | ||
|
|
6832049ccc | ||
|
|
6d72753216 | ||
|
|
b6b3898536 | ||
|
|
99922d38e2 | ||
|
|
161623a8d2 | ||
|
|
155a7a6582 | ||
|
|
6aafe9dee0 | ||
|
|
680c9d64cb | ||
|
|
ca395492d5 | ||
|
|
ea920d352f | ||
|
|
0c0031455b | ||
|
|
a8a9893ce4 | ||
|
|
5143743661 | ||
|
|
88a42b25cc | ||
|
|
b371bf6efa | ||
|
|
3bc7ed6f8c | ||
|
|
f996510969 | ||
|
|
58fd119636 | ||
|
|
f275792604 | ||
|
|
9f8ead5e4e | ||
|
|
a35ccbbe5b | ||
|
|
9a60a8838f | ||
|
|
bb9e02da6b | ||
|
|
0fd0c5ecc1 | ||
|
|
c89961ebf0 | ||
|
|
0f81e82206 | ||
|
|
7c7c8c4f34 | ||
|
|
3d7362aa9d | ||
|
|
f3061a2526 | ||
|
|
2657af1aef | ||
|
|
dd03ed4b30 | ||
|
|
64c6b05963 | ||
|
|
05017b0236 | ||
|
|
efd9cce4ef | ||
|
|
144c78fa4b | ||
|
|
3147aa539c | ||
|
|
ad4532932b | ||
|
|
ffac3462af | ||
|
|
7c163592b5 | ||
|
|
a6211e371e | ||
|
|
775085eca1 | ||
|
|
b3d580cada | ||
|
|
37987ddb57 | ||
|
|
a56ab4f561 | ||
|
|
6f649bd680 | ||
|
|
6316577ec7 | ||
|
|
61cd74fcd0 | ||
|
|
37fd0ebbd2 | ||
|
|
8e987a6718 | ||
|
|
520be9dbe8 | ||
|
|
322e6f7edf | ||
|
|
b6eea6fe2e | ||
|
|
dc84c50ea8 | ||
|
|
07d7df7271 | ||
|
|
5b9f3c70dc | ||
|
|
bd36590084 | ||
|
|
4e64ff4ff9 | ||
|
|
2dd882a7a5 | ||
|
|
fe4c102c7d | ||
|
|
1380bc9940 | ||
|
|
5cc549ad3a | ||
|
|
75395f6622 | ||
|
|
c9576e260e | ||
|
|
362d692879 | ||
|
|
acbaa69305 | ||
|
|
592a48c725 | ||
|
|
bfaaf7d893 | ||
|
|
9e73dc9c00 | ||
|
|
d37aac0c71 | ||
|
|
8314d4c9ae | ||
|
|
d860954c32 | ||
|
|
0b4b085095 | ||
|
|
c0334d0c94 | ||
|
|
6acd897e16 | ||
|
|
2adfc55339 | ||
|
|
208b4f68b5 | ||
|
|
33fd704a00 | ||
|
|
6d8ece6822 | ||
|
|
6b5cbd5f11 | ||
|
|
ea6017511b | ||
|
|
2477b8a3ea | ||
|
|
cdd1075384 | ||
|
|
c61c17f19c | ||
|
|
774b79f07e | ||
|
|
002172281b | ||
|
|
4e9d4bfaf6 | ||
|
|
894e9f244f | ||
|
|
189b45ab9b | ||
|
|
b0912de788 | ||
|
|
f435946f66 | ||
|
|
64d91ccaab | ||
|
|
e97fbb2784 | ||
|
|
0029e0ed43 | ||
|
|
088f235f29 | ||
|
|
dd5aa90498 | ||
|
|
c866e5dd45 | ||
|
|
6e8f74af15 | ||
|
|
d70fd8c208 | ||
|
|
9551c9bed4 | ||
|
|
06740564f8 | ||
|
|
ef94c31d42 | ||
|
|
093b370903 | ||
|
|
542845667a | ||
|
|
8ce08bc4f4 | ||
|
|
69158d55c1 | ||
|
|
d9a794e186 | ||
|
|
6cc146c0a5 | ||
|
|
b490328a45 | ||
|
|
30df5226df | ||
|
|
c8369ce316 | ||
|
|
ffb7e5d573 | ||
|
|
3d41531a84 | ||
|
|
f0fa6986d7 | ||
|
|
d908606527 | ||
|
|
886a26aa20 | ||
|
|
bc77ff45cd | ||
|
|
c1fb884dcd | ||
|
|
26992828f0 | ||
|
|
07670c6bc5 | ||
|
|
b2bc6b7740 | ||
|
|
c617ede243 | ||
|
|
0d7600d62c | ||
|
|
7a0ef10f9f | ||
|
|
2fc52c9abd | ||
|
|
9a56817bf8 | ||
|
|
e81346f881 | ||
|
|
01fd8fa406 | ||
|
|
f09e0db311 | ||
|
|
5dc72e88fe | ||
|
|
169e2b8477 | ||
|
|
9fe5ec6068 | ||
|
|
d4e0ca3f03 | ||
|
|
7690a27e60 | ||
|
|
748d9ef65d | ||
|
|
d88db28da8 | ||
|
|
e95b9f57fa | ||
|
|
6c14aa49ea | ||
|
|
1859fc87ae | ||
|
|
6c9d2e5db7 | ||
|
|
d6d147187d | ||
|
|
ab75c1d5e2 | ||
|
|
992178eb9a | ||
|
|
f61ce2884a | ||
|
|
21db8852d6 | ||
|
|
2900c1f914 | ||
|
|
8dd7bd8912 | ||
|
|
c6f1784d9d | ||
|
|
684cb086cc | ||
|
|
d2d8b06d97 | ||
|
|
4d346e0ca7 | ||
|
|
a6cbd10f3b | ||
|
|
416a49d87f | ||
|
|
f438548e5c | ||
|
|
cc75fc42db | ||
|
|
66e01b12f8 | ||
|
|
b3045726fb | ||
|
|
9b2b541e4d | ||
|
|
2d763d106d | ||
|
|
37d2feeaa5 | ||
|
|
66a33cd56e | ||
|
|
ae07844a71 | ||
|
|
e00484775e | ||
|
|
ed871db1f3 | ||
|
|
3c4f3146c4 | ||
|
|
5cde230723 | ||
|
|
6d4a068453 | ||
|
|
248e8e6beb | ||
|
|
4db11ba324 | ||
|
|
a97f862641 | ||
|
|
69db7f7384 | ||
|
|
a72fb6f01a | ||
|
|
53766b99c9 | ||
|
|
1b54cf56e0 | ||
|
|
05a553ffdc | ||
|
|
d6ea80843f | ||
|
|
8c2ce43053 | ||
|
|
34b33798a7 | ||
|
|
adbef081d0 | ||
|
|
5eb3a86467 | ||
|
|
bef2b34faa | ||
|
|
7516b44804 | ||
|
|
8b70f5a114 | ||
|
|
c4581a8889 | ||
|
|
fdde5b7fe9 | ||
|
|
d1bc246a35 | ||
|
|
262779b515 | ||
|
|
78e4407c71 | ||
|
|
d247c53136 | ||
|
|
bca9381903 | ||
|
|
a8cbdafe6e | ||
|
|
e595f141c1 | ||
|
|
4aa43de54d | ||
|
|
2e92838364 | ||
|
|
283cb64a01 | ||
|
|
517fd2d4f4 | ||
|
|
3467c976a9 | ||
|
|
f3166406ec | ||
|
|
b5b930dddb | ||
|
|
11c10f526a | ||
|
|
cf362f1a6a | ||
|
|
3b2ea8ea98 | ||
|
|
f82bc39473 | ||
|
|
b5976035e3 | ||
|
|
14f65c55b5 | ||
|
|
ee91e0698d | ||
|
|
aa23537354 | ||
|
|
242c7b623f | ||
|
|
c0c52e57df | ||
|
|
dff938e802 | ||
|
|
847e9dffc2 | ||
|
|
10d81bd47a | ||
|
|
3aa64697d2 | ||
|
|
fecaf64eec | ||
|
|
20cb8e4ead | ||
|
|
cb6e5a5e54 | ||
|
|
366de00950 | ||
|
|
f80b7a32c1 | ||
|
|
67f3d956f4 | ||
|
|
607301b35d | ||
|
|
9f5c3e9942 | ||
|
|
d34ecff3aa | ||
|
|
0ff7e54ff4 | ||
|
|
c4e508a090 | ||
|
|
58f15184b8 | ||
|
|
61d22eb498 | ||
|
|
34d10bba3c | ||
|
|
5ba8cc3439 | ||
|
|
4da7f77089 | ||
|
|
c544206437 | ||
|
|
7a65a7da1e | ||
|
|
014a153e49 | ||
|
|
066c40d9c1 | ||
|
|
5f7f4a23aa | ||
|
|
e39dee6e1d | ||
|
|
cf71f84e49 | ||
|
|
8265253388 | ||
|
|
b1293b70cf | ||
|
|
7b8b197a35 | ||
|
|
867e1b8731 | ||
|
|
5cdcf47994 | ||
|
|
a500920bb2 | ||
|
|
a748e0337d | ||
|
|
2f4c00c602 | ||
|
|
78d3828f1e | ||
|
|
4505f51fbd | ||
|
|
2ca7b2310b | ||
|
|
861366dd71 | ||
|
|
4cada08cbe | ||
|
|
1d80d97d22 | ||
|
|
935849142c | ||
|
|
4e048f775d | ||
|
|
f45adb5b9e | ||
|
|
d4cc7ca232 | ||
|
|
2b342ca33b | ||
|
|
97e6df7f59 | ||
|
|
51d06d8234 | ||
|
|
16f7ae54b8 | ||
|
|
e15734d17e | ||
|
|
2cb773dd48 | ||
|
|
09672ce89b | ||
|
|
c476262288 | ||
|
|
84c73bb11f | ||
|
|
f8b5519ced | ||
|
|
01b7f36750 | ||
|
|
759c5222ac | ||
|
|
9847edbce1 | ||
|
|
19789b6d90 | ||
|
|
7b2ba7f3b1 | ||
|
|
9a5ed11c83 | ||
|
|
3fc8b6fc5c | ||
|
|
a2bb67a828 | ||
|
|
c018e3dcc2 | ||
|
|
2b8f1b350c | ||
|
|
806c82c30c | ||
|
|
76f1591b58 | ||
|
|
2a5fc931b6 | ||
|
|
a392e631d0 | ||
|
|
f3da8f7353 | ||
|
|
fda4d43678 | ||
|
|
a09868c397 | ||
|
|
fdddee415f | ||
|
|
d239048817 | ||
|
|
88e146f4ba | ||
|
|
a709a7fec0 | ||
|
|
8d5d7bdf8d | ||
|
|
ffe3317228 | ||
|
|
71adcb338d | ||
|
|
62b46f6ef5 | ||
|
|
65149ece6c | ||
|
|
b0318f6939 | ||
|
|
d14e28d7b3 | ||
|
|
b98fe6bda5 | ||
|
|
6e6274a2dd | ||
|
|
52988f154b | ||
|
|
b590ea8caa | ||
|
|
3c7570aab9 | ||
|
|
3b8c92f5c2 | ||
|
|
164cf79613 | ||
|
|
a216a6989b | ||
|
|
050bf5f73c | ||
|
|
0a0ee3cc98 | ||
|
|
8ff94669f2 | ||
|
|
775f9eb6b3 | ||
|
|
aeff6b60e9 | ||
|
|
94989a1109 | ||
|
|
e1c6c4e6b6 | ||
|
|
48bd49cf2f | ||
|
|
385a48bb43 | ||
|
|
ad2b9a3640 | ||
|
|
df249895e6 | ||
|
|
c7005ef933 | ||
|
|
2489be93a3 | ||
|
|
fa916c4fab | ||
|
|
a8fcb909fe | ||
|
|
1262c5e8ff | ||
|
|
6edc3bcd02 | ||
|
|
4e9e709816 | ||
|
|
d24bc0cf94 | ||
|
|
a4bb0f40cc | ||
|
|
37d7693e3c | ||
|
|
9fd1c4bb0a | ||
|
|
9561cea8f9 | ||
|
|
cfdfe6e567 | ||
|
|
c3736f8dd8 | ||
|
|
6232c2e894 | ||
|
|
a2cce876db | ||
|
|
d3791e1316 | ||
|
|
9cbbdc422f | ||
|
|
f76c28fa64 | ||
|
|
cabc3e2441 | ||
|
|
f208e755c2 | ||
|
|
9841ce32ae | ||
|
|
4f6456635e | ||
|
|
6dc69ded22 | ||
|
|
6ce67a95a2 | ||
|
|
6cc943d15d | ||
|
|
b23314b408 | ||
|
|
9c32e4d66a | ||
|
|
1b9ddabcab | ||
|
|
6259333a70 | ||
|
|
bedb28c073 | ||
|
|
65d93267a9 | ||
|
|
6ee041b374 | ||
|
|
c46a6d3440 | ||
|
|
92fc016f20 | ||
|
|
8983ee5239 | ||
|
|
45291b4f05 | ||
|
|
6cfbdf2f30 | ||
|
|
44613dc416 | ||
|
|
1f95ff0fe7 | ||
|
|
a939021304 | ||
|
|
fc88d9b248 | ||
|
|
46e268e4e3 | ||
|
|
f9f8ccc088 | ||
|
|
78c8e64e81 | ||
|
|
ba54bd43aa | ||
|
|
f61542ea6b | ||
|
|
21b162b192 | ||
|
|
91e7af4867 | ||
|
|
89968bf449 | ||
|
|
7f2f68ec58 | ||
|
|
a5ebfd56e1 | ||
|
|
99e6a254e1 | ||
|
|
68714ebad8 | ||
|
|
19cb8e3301 | ||
|
|
48ef4144bc | ||
|
|
78a4da4945 | ||
|
|
a2014be118 | ||
|
|
3cde9a654b | ||
|
|
2f277171d1 | ||
|
|
43dba06074 | ||
|
|
c0737c40a7 | ||
|
|
beb2eb99fb | ||
|
|
62a52745df | ||
|
|
25e156297b | ||
|
|
fd2aa5d046 | ||
|
|
547a9fcc17 | ||
|
|
90ea36d0fe | ||
|
|
c3467f7204 | ||
|
|
e6aafbc8a6 | ||
|
|
76bb777f4d | ||
|
|
39f6867ab0 | ||
|
|
fbaef2f103 | ||
|
|
af0861877a | ||
|
|
db19fa507e | ||
|
|
27fd1942d0 | ||
|
|
975df3625d | ||
|
|
92a37e1e44 | ||
|
|
cd33754a3c | ||
|
|
69d92bc0ea | ||
|
|
6d09c12f93 | ||
|
|
ba0f4dbcf5 | ||
|
|
e1bf3b4b82 | ||
|
|
d647309587 | ||
|
|
140ee7b183 | ||
|
|
745eaf8a17 | ||
|
|
b16e70c363 | ||
|
|
6ee00c138c | ||
|
|
0a4da47492 | ||
|
|
9439b347c9 | ||
|
|
e24eb30c98 | ||
|
|
f53573261e | ||
|
|
d5b8337121 | ||
|
|
a23b96ba75 | ||
|
|
47704f7591 | ||
|
|
b816facf44 | ||
|
|
a6a5cf8755 | ||
|
|
83f7ed56fa | ||
|
|
755f90f38b | ||
|
|
8a56406c19 | ||
|
|
887ea94a4d | ||
|
|
499b3ddf3e | ||
|
|
e88edd11af | ||
|
|
0b1be02c38 | ||
|
|
b98b8b6f2e | ||
|
|
83e55b1074 | ||
|
|
1f87ed77e4 | ||
|
|
93b7d210dc | ||
|
|
10d9d84f84 | ||
|
|
fc9a4d5431 | ||
|
|
154358efd4 | ||
|
|
63c710047b | ||
|
|
d0f4eeff1f | ||
|
|
4d3277f41b | ||
|
|
7c9d52abbf | ||
|
|
4b3a2531a6 | ||
|
|
ed4871548e | ||
|
|
cf6eccf565 | ||
|
|
1284b8da8b | ||
|
|
1499baf8d9 | ||
|
|
37a0e95675 | ||
|
|
fd62705fd7 | ||
|
|
dc5fc2b544 | ||
|
|
70165a8c62 | ||
|
|
68f888baf0 | ||
|
|
3a8bc599ee | ||
|
|
9d79021678 | ||
|
|
7d339ccc23 | ||
|
|
95455603a1 | ||
|
|
3dd839c8bf | ||
|
|
7db5b6fbda | ||
|
|
1b7d199744 | ||
|
|
6bac099369 | ||
|
|
d5cc1b970f | ||
|
|
06f8fb0406 | ||
|
|
7b6de7bbd8 | ||
|
|
503159ff6f | ||
|
|
813c54a166 | ||
|
|
fa2a2d51a5 | ||
|
|
4b68b636ce | ||
|
|
0a01b0af69 | ||
|
|
e4e809f3fe | ||
|
|
1667b79fa8 | ||
|
|
c22c674de1 | ||
|
|
de3ce6f676 | ||
|
|
cd34c4ebdf | ||
|
|
ba0cab3743 | ||
|
|
a73030ac9b | ||
|
|
f57bba22cc | ||
|
|
e315cad0f5 | ||
|
|
3f40a6db4b | ||
|
|
eb99680986 | ||
|
|
2aa4f2da2d | ||
|
|
a48568526b | ||
|
|
7247abd5f1 | ||
|
|
bae2502d8f | ||
|
|
cd645b33b2 | ||
|
|
07ad69c08f | ||
|
|
6bc7de3370 | ||
|
|
f3ca247865 | ||
|
|
0167cf052d | ||
|
|
9a3b3013a3 | ||
|
|
0f9bbc1561 | ||
|
|
3ef6b3a76a | ||
|
|
3c7ccddfcc | ||
|
|
42019917ce | ||
|
|
68b632857d | ||
|
|
eaf7b72dc7 | ||
|
|
ff9cc83ef0 | ||
|
|
4e3dffad98 | ||
|
|
7662d974b9 | ||
|
|
a78bdc4912 | ||
|
|
6b84de3ccd | ||
|
|
fda537635e | ||
|
|
c633ceb695 | ||
|
|
a4c536740e | ||
|
|
923ebbc3c8 | ||
|
|
9d79a85b96 | ||
|
|
7b972142ba | ||
|
|
b38275123a | ||
|
|
a2249a7392 | ||
|
|
c0a6fd2288 | ||
|
|
149af25d22 | ||
|
|
b33ae0c92f | ||
|
|
1f54c7933b | ||
|
|
26346f5a42 | ||
|
|
dbf78e2bae | ||
|
|
9c9da27938 | ||
|
|
41e97134ef | ||
|
|
97186361a1 | ||
|
|
2db6635d73 | ||
|
|
9ac1540cdc | ||
|
|
70c0957248 | ||
|
|
c045811350 | ||
|
|
70bc60104f | ||
|
|
0f74558892 | ||
|
|
4e3543ace7 | ||
|
|
31272ff0fe | ||
|
|
1924ab09da | ||
|
|
a74e543429 | ||
|
|
00f67a57cf | ||
|
|
2244e62897 | ||
|
|
1569353779 | ||
|
|
40bb9e2c37 | ||
|
|
c87e2b99d7 | ||
|
|
4934699ecd | ||
|
|
c85f3aa7f7 | ||
|
|
9335063d68 | ||
|
|
7ea2086ec9 | ||
|
|
480e0ce9fa | ||
|
|
fe14fd0a58 | ||
|
|
e02e835053 | ||
|
|
26d88e15c6 | ||
|
|
5a9c13da86 | ||
|
|
3ee341cc4e | ||
|
|
b9f6a5ab0e | ||
|
|
ea03350ab9 | ||
|
|
06fdf3f0a5 | ||
|
|
39dfaf3acb | ||
|
|
3e7ecd51fd | ||
|
|
76e7827ebf | ||
|
|
6c6f1f23ee | ||
|
|
8c47b666c5 | ||
|
|
bad1fc9e09 | ||
|
|
c9ee4a304e | ||
|
|
2f1bf7bdbe | ||
|
|
41890f6bb4 | ||
|
|
24cd7cab58 | ||
|
|
473d9387d4 | ||
|
|
e4817038c3 | ||
|
|
d8e28dad7f | ||
|
|
2c7921479a | ||
|
|
f5495adce1 | ||
|
|
22a0f945b6 | ||
|
|
1faf2e0694 | ||
|
|
0376d094cc | ||
|
|
873db7ef27 | ||
|
|
ecd4de48eb | ||
|
|
fb132173bd | ||
|
|
7ae8434ba3 | ||
|
|
edf33d85b0 | ||
|
|
2ae0a651b8 | ||
|
|
a4c7da6e20 | ||
|
|
fbfc712d4c | ||
|
|
5196424fbe | ||
|
|
cd83cfdc87 | ||
|
|
52de1e7b02 | ||
|
|
acfdab7dbb | ||
|
|
c7731a1bb2 | ||
|
|
f3c31697c8 | ||
|
|
7b6d14779f | ||
|
|
d802ec4b59 | ||
|
|
8f69e2a204 | ||
|
|
233cc24c9a | ||
|
|
87515de57f | ||
|
|
719a8b3420 | ||
|
|
6726166d2b | ||
|
|
ecc5720007 | ||
|
|
1400f33f64 | ||
|
|
edb1374c32 | ||
|
|
f1c21dc9a2 | ||
|
|
680ad99c9f | ||
|
|
375589c73d | ||
|
|
ce8e117b0b | ||
|
|
4e12de1629 | ||
|
|
bd76d40518 | ||
|
|
723516f56c | ||
|
|
771755c96b | ||
|
|
0026153a2c | ||
|
|
f7e0deafca | ||
|
|
be53c68d28 | ||
|
|
62fa9acc9f | ||
|
|
0493c4063f | ||
|
|
956d0a736d | ||
|
|
52dfe654b5 | ||
|
|
5437bbaf2e | ||
|
|
f4c17aaf45 | ||
|
|
20e365ea9c | ||
|
|
b407701d94 | ||
|
|
ed6755496f | ||
|
|
4530115506 | ||
|
|
aabb905313 | ||
|
|
aaf2d271bc | ||
|
|
1369a08863 | ||
|
|
ac9dfd570a | ||
|
|
5cd5f4b38e | ||
|
|
57c7796424 | ||
|
|
dd6c1c3d01 | ||
|
|
712fc26d56 | ||
|
|
fd89d51f84 | ||
|
|
9e50187740 | ||
|
|
a36b47e500 | ||
|
|
a454c3e564 | ||
|
|
26b30cb20d | ||
|
|
7639e18c39 | ||
|
|
80d0ee4dc3 | ||
|
|
8a6b4a49f5 | ||
|
|
00adb20dc7 | ||
|
|
22d4cbbd1e | ||
|
|
c3fc579907 | ||
|
|
1d81c12150 | ||
|
|
0fed1ba1ab | ||
|
|
c472a0215d | ||
|
|
506adf63c9 | ||
|
|
d4715ddc81 | ||
|
|
d7fd36ddeb | ||
|
|
e45290e834 | ||
|
|
e0cf5aa602 | ||
|
|
555cf9016f | ||
|
|
d6ab2e15bf | ||
|
|
95cec88742 | ||
|
|
18430dca25 | ||
|
|
8a374f53bc | ||
|
|
7a34543004 | ||
|
|
9568fe7d4d | ||
|
|
cc06370bcd | ||
|
|
ed15ec2469 | ||
|
|
3f7d5ff041 | ||
|
|
d5bcf40cbb | ||
|
|
49c196814f | ||
|
|
c4282ce936 | ||
|
|
cd1c09127f | ||
|
|
9afebe0851 | ||
|
|
9a7382ea06 | ||
|
|
7a7e723009 | ||
|
|
9d772284cc | ||
|
|
a981761deb | ||
|
|
fc13ffa242 | ||
|
|
878b2cd639 | ||
|
|
995922d2d7 | ||
|
|
0d100aa9be | ||
|
|
d4fabed317 | ||
|
|
9eff781103 | ||
|
|
0353da3d27 | ||
|
|
f5d00ddbef | ||
|
|
cccc21c035 | ||
|
|
090f365cee | ||
|
|
cd1b629191 | ||
|
|
406f68ac5b | ||
|
|
c6e76d78a2 | ||
|
|
0d480a67d8 | ||
|
|
4f9f84fc6a | ||
|
|
0f725a02db | ||
|
|
71fdbb6564 | ||
|
|
a22991758f | ||
|
|
3404eb708d | ||
|
|
c9439efcf8 | ||
|
|
6f4cf9e941 | ||
|
|
c99216c053 | ||
|
|
e592c331f9 | ||
|
|
efdc4071da | ||
|
|
e35c9f6087 | ||
|
|
71390046f5 | ||
|
|
1c8852a7a2 | ||
|
|
536a0e429a | ||
|
|
4f54e30e0e | ||
|
|
525453d677 | ||
|
|
3cbdc6e9fe | ||
|
|
ce71afd704 | ||
|
|
6fb4dbdc7b | ||
|
|
60ba4e3eeb | ||
|
|
603d491bed | ||
|
|
20a792f135 | ||
|
|
87f5e7f3a6 | ||
|
|
58b032627e | ||
|
|
7ffab1a821 | ||
|
|
e272925f3d | ||
|
|
19091ade7b | ||
|
|
e62c065e2c | ||
|
|
2312381b82 | ||
|
|
639942d444 | ||
|
|
55a5b9d0ba | ||
|
|
7303c7c253 | ||
|
|
4557748c29 | ||
|
|
d3cb13cfd8 | ||
|
|
1bd3b7743b | ||
|
|
a33517e5d0 | ||
|
|
c981586bcf | ||
|
|
b473238f02 | ||
|
|
1d9b92080f | ||
|
|
7f89d4d39f | ||
|
|
4f00ec2277 | ||
|
|
26db10a083 | ||
|
|
3ec2ceb725 | ||
|
|
591f7205ed | ||
|
|
3a9b4f3491 | ||
|
|
896b12c16b | ||
|
|
ba7355a831 | ||
|
|
c580d89c94 | ||
|
|
8793feb9ba | ||
|
|
40db1180df | ||
|
|
d2f3e2cd60 | ||
|
|
56fc735b36 | ||
|
|
bd5449a9a2 | ||
|
|
4853c8d314 | ||
|
|
cdf94b281f | ||
|
|
8eeaa40cec | ||
|
|
cf0f9d43fa | ||
|
|
667ac39e06 | ||
|
|
993d62a8c8 | ||
|
|
09a70d4573 | ||
|
|
3afa730751 | ||
|
|
0594822872 | ||
|
|
3245ddbfe7 | ||
|
|
def55943ed | ||
|
|
46d1e2e703 | ||
|
|
4accc9c018 | ||
|
|
579d612397 | ||
|
|
dd14ee7156 | ||
|
|
bab0d40c87 | ||
|
|
378a54fb62 | ||
|
|
2d5d367ee6 | ||
|
|
638c721d32 | ||
|
|
f464623d17 | ||
|
|
fe86514fb8 | ||
|
|
704f7f4494 | ||
|
|
3b0cd389e5 | ||
|
|
21eea225af | ||
|
|
743c2a6a5e | ||
|
|
abcb511a57 | ||
|
|
3669bab210 | ||
|
|
88b9f83d79 | ||
|
|
2178018b18 | ||
|
|
ae4d245232 | ||
|
|
509b21153f | ||
|
|
7810c65862 | ||
|
|
9f8d2b2d46 | ||
|
|
3bcb2985f9 | ||
|
|
0d8b2f4a01 | ||
|
|
b060c4205c | ||
|
|
f90775153c | ||
|
|
17a2d9b4d8 | ||
|
|
14a68d6ed4 | ||
|
|
c7535e38dc | ||
|
|
8c4fabb89a | ||
|
|
daabce1d2f | ||
|
|
1ad1bf7942 | ||
|
|
5885829585 | ||
|
|
4e115a2326 | ||
|
|
6900e60df0 | ||
|
|
61881ad656 | ||
|
|
d1e64a410b | ||
|
|
5e5de03055 | ||
|
|
f4bdfa43ca | ||
|
|
5ede956e7f | ||
|
|
1cd27210ac | ||
|
|
2819ec01af | ||
|
|
ca113497b2 | ||
|
|
15725c0302 | ||
|
|
851bd88de6 | ||
|
|
a207936231 | ||
|
|
9cb40e41fa | ||
|
|
0f0bdd7d13 | ||
|
|
297206b054 | ||
|
|
626f0677f7 | ||
|
|
7b5b25d113 | ||
|
|
3635137906 | ||
|
|
3e7b9e68d5 | ||
|
|
4a52139457 | ||
|
|
7ea02a316e | ||
|
|
9a66b0c6e4 | ||
|
|
8fe5000ce1 | ||
|
|
82fac5f80e | ||
|
|
94620504da | ||
|
|
59cab65fcf | ||
|
|
c7b9e6f9b8 | ||
|
|
79ea403273 | ||
|
|
397d7fa6c8 | ||
|
|
ac787a6f51 | ||
|
|
0418e77d34 | ||
|
|
a2c6a3669b | ||
|
|
b8d22240a8 | ||
|
|
b458d570a1 | ||
|
|
5022df0d14 | ||
|
|
220b48b144 | ||
|
|
8aeed46181 | ||
|
|
38b34eae2f | ||
|
|
648b21f972 | ||
|
|
09717a966b | ||
|
|
4c86cae7fe | ||
|
|
eef46fe743 | ||
|
|
5f91566fa7 | ||
|
|
c83a476ebe | ||
|
|
954bba274c | ||
|
|
d370a5c13d | ||
|
|
181189bee0 | ||
|
|
c678f5e85a | ||
|
|
0fabf83c62 | ||
|
|
b7e8d19290 | ||
|
|
6376596e49 | ||
|
|
91053965be | ||
|
|
d0db71602a | ||
|
|
4f9ee17ff9 | ||
|
|
2461b39fb7 | ||
|
|
ff7634a8ac | ||
|
|
6c41ae8e8e | ||
|
|
52803cf57c | ||
|
|
03f5ba430c | ||
|
|
91e317a497 | ||
|
|
a0b4d0f348 | ||
|
|
112efddb4e | ||
|
|
4cea81e564 | ||
|
|
3a40a34566 | ||
|
|
a4ff87a7d5 | ||
|
|
797077c47b | ||
|
|
674f4d5062 | ||
|
|
5cc2f5b645 | ||
|
|
3ca8aefad7 | ||
|
|
1d1b663f55 | ||
|
|
6a64b09452 | ||
|
|
c2c9e180ea | ||
|
|
fb89183767 | ||
|
|
45b570b6f7 | ||
|
|
075d950249 | ||
|
|
8e8e5d8da8 | ||
|
|
f59a7872b3 | ||
|
|
022c6fccf5 | ||
|
|
b750cf1f33 | ||
|
|
5495d772ea | ||
|
|
664589c642 | ||
|
|
22d14b2a4f | ||
|
|
6e9c965279 | ||
|
|
87e9ed8191 | ||
|
|
a5a0aa859a | ||
|
|
78693685d8 | ||
|
|
f39d4a688a | ||
|
|
0c30a4ba53 | ||
|
|
7db8b89b89 | ||
|
|
ec4a9ead74 | ||
|
|
d31f112967 | ||
|
|
4098c306e2 | ||
|
|
ddee2c08e2 | ||
|
|
e1c02c8bf5 | ||
|
|
956d21d431 | ||
|
|
8b3f474bca | ||
|
|
8eddcfb639 | ||
|
|
9b79602134 | ||
|
|
0bab560e89 | ||
|
|
4272e2e2b2 | ||
|
|
6458b46437 | ||
|
|
021343ca02 | ||
|
|
34279cfacf | ||
|
|
86a5890c36 | ||
|
|
04e53f2002 | ||
|
|
5dccd4b05f | ||
|
|
85f4a4c36a | ||
|
|
9e77899535 | ||
|
|
4185923d04 | ||
|
|
a19ccb6b49 | ||
|
|
5ae9d42480 | ||
|
|
f282a3346c | ||
|
|
ac8881a097 | ||
|
|
41daa83e3e | ||
|
|
2869460a7f | ||
|
|
0f168922d8 | ||
|
|
b8b5362ba5 | ||
|
|
b4e0f2c991 | ||
|
|
201b6d9cfa | ||
|
|
a6ec3e0a68 | ||
|
|
64578787a0 | ||
|
|
d068388e7f | ||
|
|
606d18aa6e | ||
|
|
106bcec7cf | ||
|
|
179e973b4e | ||
|
|
2223cd4f30 | ||
|
|
7db5345f9a | ||
|
|
df659f648e | ||
|
|
d7fd079ec4 | ||
|
|
800172f93e | ||
|
|
2fbfdbcb03 | ||
|
|
ae59e75be1 | ||
|
|
f01268ef76 | ||
|
|
4b9f94c9ae | ||
|
|
33868eef88 | ||
|
|
11bd885fb4 | ||
|
|
0e73168803 | ||
|
|
1eeb42a88d | ||
|
|
9ad852558c | ||
|
|
227a262e01 | ||
|
|
0abd368ccc | ||
|
|
f757dcab74 | ||
|
|
28f758e421 | ||
|
|
6fba81d7c8 | ||
|
|
8543977a2f | ||
|
|
7b3da0e2c2 | ||
|
|
b16b37e757 | ||
|
|
726b087d0d | ||
|
|
c3fb08da59 | ||
|
|
725a285e7f | ||
|
|
9bf329bd17 | ||
|
|
0517a73bfe | ||
|
|
a432f5cc3a | ||
|
|
72b119d622 | ||
|
|
18f09ab2ef | ||
|
|
5985c518f6 | ||
|
|
0dc4dbe642 | ||
|
|
0e90426cff | ||
|
|
900d045cf0 | ||
|
|
e9c4d70126 | ||
|
|
5c93d3e7c4 | ||
|
|
c372ffa111 | ||
|
|
8e15ad7ed0 | ||
|
|
a6f3fb19c8 | ||
|
|
64c6d19ae7 | ||
|
|
c9d9d3d4d3 | ||
|
|
e25b78953c | ||
|
|
81f0c916f5 | ||
|
|
ef690f6438 | ||
|
|
11124205e5 | ||
|
|
6cd0474eca | ||
|
|
bd89710478 | ||
|
|
fc54822b97 | ||
|
|
13bb6dbe93 | ||
|
|
8c9a98e3e9 | ||
|
|
7ce05fb4fc | ||
|
|
53153b237c | ||
|
|
478dea6af4 | ||
|
|
e097d38347 | ||
|
|
6cba14181d | ||
|
|
76c48a8c4e | ||
|
|
425b51de08 | ||
|
|
8e057379ce | ||
|
|
db649ddc96 | ||
|
|
6aab17d0b3 | ||
|
|
fdfb8e0c34 | ||
|
|
72aaa18a35 | ||
|
|
07e1c139ba | ||
|
|
7df76697e1 | ||
|
|
743b260813 | ||
|
|
24187b8413 | ||
|
|
acfd0bf104 | ||
|
|
59792b3456 | ||
|
|
fb9b0b8166 | ||
|
|
11d68c0e27 | ||
|
|
8b287cca0c | ||
|
|
38145957af | ||
|
|
69bdac52c7 | ||
|
|
10d7690ca6 | ||
|
|
b33a999458 | ||
|
|
d3a7ff7e11 | ||
|
|
c1e9fad271 | ||
|
|
9d668342be | ||
|
|
62dd54c886 | ||
|
|
93ed2b3bff | ||
|
|
acb0aa0532 | ||
|
|
ef707e6d5d | ||
|
|
56413c372f | ||
|
|
a57e919e44 | ||
|
|
5bdb80db35 | ||
|
|
3f63997694 | ||
|
|
022a15a5e9 | ||
|
|
a6c331042a | ||
|
|
17f5d8f0c2 | ||
|
|
45b880ef76 | ||
|
|
da34530d98 | ||
|
|
bcb75dac65 | ||
|
|
74bba5263a | ||
|
|
7878252692 | ||
|
|
7af6b31cca | ||
|
|
11a9766ba0 | ||
|
|
5175f439a0 | ||
|
|
cbb603818a | ||
|
|
7020121274 | ||
|
|
54f7030d68 | ||
|
|
b9e23fcf95 | ||
|
|
42d0480f77 | ||
|
|
886eaa4002 | ||
|
|
fd02e9ab22 | ||
|
|
9fb460c176 | ||
|
|
cbb753ae75 | ||
|
|
b2b54b7c5b | ||
|
|
29ac95362d | ||
|
|
9d2d6addb1 | ||
|
|
7c3f15f79b | ||
|
|
c8e4ec14f0 | ||
|
|
e1793fe276 | ||
|
|
a7bb43278f | ||
|
|
58b5e99979 | ||
|
|
915befbb3a | ||
|
|
4cf3f1bcd5 | ||
|
|
bfeeaeabfb | ||
|
|
410f2d4e69 | ||
|
|
474ad5c0fe | ||
|
|
c2b359ceed | ||
|
|
5af7de61d0 | ||
|
|
7436bf9e64 | ||
|
|
588f7fe2fb | ||
|
|
30f5a49988 | ||
|
|
2998e95a3b | ||
|
|
ac29367ff8 | ||
|
|
dbd7f82eab | ||
|
|
e28dd11b63 | ||
|
|
907274f9bd | ||
|
|
176b74489e | ||
|
|
f940f8e303 | ||
|
|
2679213121 | ||
|
|
59c0cf467f | ||
|
|
5a2637856f | ||
|
|
26ecb199d3 | ||
|
|
62d42fb61f | ||
|
|
19c96e496b | ||
|
|
e982ba50be | ||
|
|
27ad956034 | ||
|
|
8c6f694645 | ||
|
|
8ce85636d9 | ||
|
|
07683480b4 | ||
|
|
7d8fdbfd58 | ||
|
|
2a1cb03484 | ||
|
|
baa90fb605 | ||
|
|
1b67b736df | ||
|
|
e6514a8b33 | ||
|
|
636b07b350 | ||
|
|
4b5478530c | ||
|
|
4a721a7e18 | ||
|
|
2470629afd | ||
|
|
ccdd16bbc7 | ||
|
|
9cf6e621ab | ||
|
|
94a97a3032 | ||
|
|
f4ef7b9851 | ||
|
|
c2be7dd025 | ||
|
|
b51dfc7733 | ||
|
|
9999820a8f | ||
|
|
10bc8283ed | ||
|
|
66f3ba5a7b | ||
|
|
07f0175c5e | ||
|
|
7376ac382f | ||
|
|
3646219da4 | ||
|
|
bfbc073593 | ||
|
|
307be96fd6 | ||
|
|
22f4f21619 | ||
|
|
1738e216d0 | ||
|
|
567650357f | ||
|
|
32de6ac124 | ||
|
|
60f3c87de1 | ||
|
|
d9561118bc | ||
|
|
228e5342fb | ||
|
|
8574154071 | ||
|
|
80379ecde5 | ||
|
|
31b8ad248f | ||
|
|
2d02f97f7f | ||
|
|
6a37b5e461 | ||
|
|
38ed60bf63 | ||
|
|
e664ecfaf5 | ||
|
|
e2814c04f4 | ||
|
|
8c2836b0c2 | ||
|
|
fcfab4c756 | ||
|
|
ddd59c489a | ||
|
|
db922a0e77 | ||
|
|
793c4d1d7d | ||
|
|
24eab33b6d | ||
|
|
4985323ad9 | ||
|
|
9fc551982b | ||
|
|
8ee67b5af8 | ||
|
|
78ad22479c | ||
|
|
2041aa45f0 | ||
|
|
c8b0ce9669 | ||
|
|
11eb6de57e | ||
|
|
c451234bd5 | ||
|
|
b56862fcf8 | ||
|
|
21a6da91ca | ||
|
|
410108a005 | ||
|
|
51d5b166a6 | ||
|
|
1f77243881 | ||
|
|
f63afb2dd6 | ||
|
|
dbe1c6e2ae | ||
|
|
6a37425a38 | ||
|
|
02efa4745f | ||
|
|
e78754bcd5 | ||
|
|
16dcf3cc5e | ||
|
|
03d168f972 | ||
|
|
6f6c8b0eb6 | ||
|
|
fa14219e12 | ||
|
|
15cd86fad1 | ||
|
|
56ccebb720 | ||
|
|
8ef3789970 | ||
|
|
ed7769c373 | ||
|
|
5745006c35 | ||
|
|
16b243c52a | ||
|
|
bc91eaf5ca | ||
|
|
6962d1e888 | ||
|
|
4d1e8dfb36 | ||
|
|
6ff6f95044 | ||
|
|
5369983b35 | ||
|
|
46a8041c48 | ||
|
|
84185a7c78 | ||
|
|
4f41248978 | ||
|
|
92d52a78be | ||
|
|
a76594046b | ||
|
|
2214ec66f1 | ||
|
|
b8da46ac18 | ||
|
|
d656730d3a | ||
|
|
2f230e4b38 | ||
|
|
494f64acbd | ||
|
|
50978200d4 | ||
|
|
a38e1daec7 | ||
|
|
57a26b4583 | ||
|
|
c018c8fcd1 | ||
|
|
3ba4aca8bc | ||
|
|
870f6e3b58 | ||
|
|
83e0869548 | ||
|
|
90b08db038 | ||
|
|
c888e143a1 | ||
|
|
4e727bc164 | ||
|
|
b37afadb01 | ||
|
|
2c2744f6fb | ||
|
|
db2b2fa3b5 | ||
|
|
0127f7aab9 | ||
|
|
ce41791fa4 | ||
|
|
ec4be4f6b1 | ||
|
|
f82d89b3db | ||
|
|
202175f2a7 | ||
|
|
d7628b3eb2 | ||
|
|
7560db571c | ||
|
|
775143355d | ||
|
|
846ba30821 | ||
|
|
ad88592229 | ||
|
|
6b90956af1 | ||
|
|
26e905a36e | ||
|
|
1a9ff38f0c | ||
|
|
8b22d032cd | ||
|
|
8d58baf4a3 | ||
|
|
a447a0c9af | ||
|
|
555fb3ae93 | ||
|
|
7053531a4d | ||
|
|
7d4e5177b9 | ||
|
|
06f30eca3a | ||
|
|
ac5c14b977 | ||
|
|
c3d810bd3b | ||
|
|
1e24f25c18 | ||
|
|
28db884498 | ||
|
|
36ecc1ffef | ||
|
|
9ec6803a02 | ||
|
|
e87996a7f2 | ||
|
|
f2a5273029 | ||
|
|
9bc750da9a | ||
|
|
539c5bd18a | ||
|
|
bdc1ada090 | ||
|
|
2efc24a1ce | ||
|
|
63561e6122 | ||
|
|
d2390b1227 | ||
|
|
d0799ea3f2 | ||
|
|
44cbfbb1fb | ||
|
|
b078dd1f6a | ||
|
|
225dd23753 | ||
|
|
51b4755242 | ||
|
|
8f233b3027 | ||
|
|
197540763e | ||
|
|
5d7667dc01 | ||
|
|
18383579e9 | ||
|
|
03d4f8ffa1 | ||
|
|
30d92eb68c | ||
|
|
6e6a0fd5c2 | ||
|
|
cd4a980182 | ||
|
|
aad54fd98d | ||
|
|
6b7a49506c | ||
|
|
7ecf67c176 | ||
|
|
77aeb2d0ac | ||
|
|
7a9f989104 | ||
|
|
ae06bebd24 | ||
|
|
042fb7b376 | ||
|
|
c3583ade01 | ||
|
|
f97d9805dd | ||
|
|
1d33de59a9 | ||
|
|
0c4b09891b | ||
|
|
25955303e7 | ||
|
|
27b75eecb0 | ||
|
|
e40921cf13 | ||
|
|
083cebcc7e | ||
|
|
a722736335 | ||
|
|
c483c20c81 | ||
|
|
dec1caa43c | ||
|
|
9526e22118 | ||
|
|
d9816c7ad0 | ||
|
|
8e327a27df | ||
|
|
43fe67d7d8 | ||
|
|
a63991bb4e | ||
|
|
b09db0c60f | ||
|
|
928ca3497a | ||
|
|
60219411f6 | ||
|
|
642f5bb515 | ||
|
|
20e878a102 | ||
|
|
da31371d86 | ||
|
|
0df408793a | ||
|
|
9630bcd56b | ||
|
|
3c38e21b25 | ||
|
|
caec886e22 | ||
|
|
927f8955e9 | ||
|
|
d4e0296d2b | ||
|
|
8eb664f93d | ||
|
|
b180c3d1a7 | ||
|
|
db9f18a644 | ||
|
|
95805ea387 | ||
|
|
4765890d0a | ||
|
|
2e13f29945 | ||
|
|
22b1c3b5d8 | ||
|
|
c7bae65697 | ||
|
|
2381f0306c | ||
|
|
b12e15e4ff | ||
|
|
9e21751e12 | ||
|
|
db60c38eda | ||
|
|
1a4327a2e6 | ||
|
|
88095c67b8 | ||
|
|
ec34380668 | ||
|
|
89dcd6c71d | ||
|
|
fd3cf574cf | ||
|
|
f21452feec | ||
|
|
0f85471216 | ||
|
|
a8cff5ed8e |
6
.gitmodules
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[submodule "thirdparty/zlib"]
|
||||||
|
path = thirdparty/zlib
|
||||||
|
url = https://github.com/madler/zlib
|
||||||
|
[submodule "thirdparty/SDL2"]
|
||||||
|
path = thirdparty/SDL2
|
||||||
|
url = https://github.com/spurious/SDL-mirror.git
|
||||||
163
.travis.yml
@@ -2,27 +2,152 @@ language: cpp
|
|||||||
branches:
|
branches:
|
||||||
except:
|
except:
|
||||||
- latest-master
|
- latest-master
|
||||||
|
- latest-cmake
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: linux
|
||||||
|
env: BUILD_TYPE=PSP
|
||||||
|
sudo: required
|
||||||
|
- os: linux
|
||||||
|
env: BUILD_TYPE=SDL
|
||||||
|
sudo: required
|
||||||
|
- os: linux
|
||||||
|
env: BUILD_TYPE=Qt
|
||||||
|
sudo: required
|
||||||
|
- os: osx
|
||||||
|
env: BUILD_TYPE=Qt
|
||||||
|
- os: osx
|
||||||
|
env: BUILD_TYPE=iOS
|
||||||
|
- os: linux
|
||||||
|
language: android
|
||||||
|
env: BUILD_TYPE=ANDROID
|
||||||
|
sudo: required
|
||||||
|
- os: osx
|
||||||
|
env: BUILD_TYPE=Emscripten
|
||||||
|
|
||||||
|
android:
|
||||||
|
components:
|
||||||
|
- platform-tools
|
||||||
|
- build-tools-23.0.1
|
||||||
|
- android-10
|
||||||
|
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- opt/pspsdk
|
||||||
|
- android-ndk-r9
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- export PSPDEV="$TRAVIS_BUILD_DIR/opt/pspsdk"
|
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
|
||||||
- export PSPSDK="$PSPDEV/psp/sdk"
|
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty universe" &&
|
||||||
- export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin"
|
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty main" &&
|
||||||
- export ANDROID="android-sdk-linux/tools/android"
|
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test &&
|
||||||
|
sudo apt-get -qq update &&
|
||||||
|
sudo apt-get -qq install g++-4.8 &&
|
||||||
|
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90;
|
||||||
|
fi
|
||||||
|
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
||||||
|
brew update &&
|
||||||
|
brew install dpkg &&
|
||||||
|
pwd &&
|
||||||
|
ls;
|
||||||
|
fi
|
||||||
|
- if [ "$BUILD_TYPE" == "iOS" ]; then
|
||||||
|
curl -s -f -L https://raw.github.com/r-plus/dotfiles/master/install_theos.sh | bash &&
|
||||||
|
pwd &&
|
||||||
|
ls;
|
||||||
|
fi
|
||||||
|
# Building for PSP here
|
||||||
|
- if [ "$BUILD_TYPE" == "PSP" ]; then
|
||||||
|
export PSPDEV="$TRAVIS_BUILD_DIR/opt/pspsdk" &&
|
||||||
|
export PSPSDK="$PSPDEV/psp/sdk" &&
|
||||||
|
export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin" &&
|
||||||
|
wget -O sdk.lzma https://sourceforge.net/projects/minpspw/files/SDK%20%2B%20devpak/pspsdk%200.11.2/minpspw_0.11.2-amd64.tar.lzma/download;
|
||||||
|
fi
|
||||||
|
# Building for Android here
|
||||||
|
- if [ "$BUILD_TYPE" == "ANDROID" ]; then
|
||||||
|
export ANDROID="/usr/local/android-sdk-linux/tools/android" &&
|
||||||
|
export PATH=$PATH:"/usr/local/android-sdk-linux/tools" &&
|
||||||
|
wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv &&
|
||||||
|
wget https://bitbucket.org/ewing/sdl_androidcmake/get/4e9e88c03f04.zip -nv;
|
||||||
|
fi
|
||||||
|
# Building for Qt here
|
||||||
|
- if [ "$BUILD_TYPE" == "Qt" ] && [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
||||||
|
brew install qt5 &&
|
||||||
|
export QMAKE="qmake -qt=qt5";
|
||||||
|
fi
|
||||||
|
- if [ "$BUILD_TYPE" == "Qt" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then
|
||||||
|
sudo apt-get install -qq qt5-qmake qtbase5-dev qtdeclarative5-dev qttools5-dev qtmultimedia5-dev pulseaudio libpulse-dev &&
|
||||||
|
export QMAKE="qmake -qt=qt5";
|
||||||
|
fi
|
||||||
|
# Building for SDL here
|
||||||
|
- if [ "$BUILD_TYPE" == "SDL" ]; then
|
||||||
|
export SDL2DIR="$TRAVIS_BUILD_DIR/thirdparty/SDL2";
|
||||||
|
fi
|
||||||
|
# Building for Emscripten here
|
||||||
|
- if [ "$BUILD_TYPE" == "Emscripten" ] && [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
||||||
|
brew install emscripten && export LLVM=/usr/local/opt/emscripten/libexec/llvm/bin && emcc;
|
||||||
|
fi
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- sudo apt-get update -qq
|
- |
|
||||||
- if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch jq; fi
|
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
||||||
- wget -O sdk.lzma http://sourceforge.net/projects/minpspw/files/SDK%20%2B%20devpak/pspsdk%200.11.2/minpspw_0.11.2-amd64.tar.lzma/download
|
if [[ -z "$(ls -A ${DEPS_DIR}/cmake/bin)" ]]; then
|
||||||
- tar -x --xz -f sdk.lzma
|
CMAKE_URL="https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz"
|
||||||
- wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv
|
mkdir -p cmake && travis_retry wget --no-check-certificate --quiet -O - "${CMAKE_URL}" | tar --strip-components=1 -xz -C cmake
|
||||||
- wget http://dl.google.com/android/android-sdk_r22-linux.tgz -nv
|
fi
|
||||||
- tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2
|
export PATH="${DEPS_DIR}/cmake/bin:${PATH}"
|
||||||
- tar -zxf android-sdk_r22-linux.tgz
|
fi
|
||||||
- $ANDROID list sdk -a
|
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
||||||
- echo yes | $ANDROID update sdk -a --filter 1,2,4,18 --no-ui --force > log.txt
|
if ! brew ls --version cmake &>/dev/null; then brew install cmake; fi
|
||||||
- sudo pip install pyjavaproperties
|
fi
|
||||||
script: ./travis-script.sh
|
- if [ "$BUILD_TYPE" == "PSP" ]; then
|
||||||
|
tar -x --xz -f sdk.lzma;
|
||||||
|
fi
|
||||||
|
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_TYPE" == "ANDROID" ]; then
|
||||||
|
jdk_switcher use openjdk7 %%
|
||||||
|
tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2 &&
|
||||||
|
export ANDROID_NDK=`pwd`/android-ndk-r9 &&
|
||||||
|
unzip 4e9e88c03f04.zip &&
|
||||||
|
rm -rf thirdparty/SDL2/* &&
|
||||||
|
mv ewing-sdl_androidcmake-4e9e88c03f04/* thirdparty/SDL2/ &&
|
||||||
|
sudo pip install cpp-coveralls &&
|
||||||
|
sudo apt-get install --force-yes -qq libtinyxml-dev libjpeg-dev libpng-dev libgif-dev libz-dev libboost-system-dev libboost-thread-dev libboost-date-time-dev ant;
|
||||||
|
fi
|
||||||
|
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_TYPE" != "ANDROID" ]; then
|
||||||
|
jdk_switcher use openjdk7 &&
|
||||||
|
sudo pip install cpp-coveralls &&
|
||||||
|
sudo apt-get install --force-yes -qq libtinyxml-dev libjpeg-dev libpng-dev libgif-dev libz-dev libboost-system-dev libboost-thread-dev libboost-date-time-dev ant;
|
||||||
|
fi
|
||||||
|
- sudo pip install pyjavaproperties
|
||||||
|
- sudo pip install github3.py
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
secure: "fJgWlCFbde96OSQNGKUmowGX+ERPeqP+n1EOMf1+FJzOU4DdkTLRAlV5+5qnEX9jB/3mWN6iPpmG1qEz/SdDG3KHxJYs4ZU/Lu485O24zZ/+GdYBNsrvhPD9ckPGEMLDa1foEVTDnW0Dlkz3BCFcszjhtXGUJv7v6Pj6LRk1Mg8="
|
# - JAVA_HOME=/usr/lib/jvm/java-7-oracle # Force set JVM version to comply with Travis Ant version (1.8.2)
|
||||||
|
- secure: "EBzr1+qjQsOhn0s+tcFmXR1jP9B0xiOSXuXbRXWZ1OEHNvp8+A5/pS84LYVFlaZqmxr5dApxvPtwhgLIUbQ3EPXm8LpC3KgSD4dS+9/QMbxhe5TK4oczgFRGcDTMJQZsCzhOh7hp3tbcbJg5Gp+VT7aFjFQSHDGwhzSJXsXwh/8="
|
||||||
|
- secure: "X5dTQfofqAutnXxmu11Ep2MQ5QYnMN8m0AITRtwymhEF2UclcOudI1+skPtuhAGbWQnSO+lhunV3cvMfw2/Ml3k/VDz6VdFSKFrzAu7ja1VLJfcxr7chi0s8q30pVBb66tGydjIBac3B+RQyqgmZQW1frbRrhC/kPFQ6wPWOJdQ="
|
||||||
|
- secure: "T97NUPnxCpVZ/c5HH0zfo0FO3DPSRMSmze58ubW5EUTZOjAMtEt+OFdsrNZvUTCugUj2M1agtonZbAbczpaAL+lgZcHDgXgWMkfO0pMnsWX1yyCNqMuE/iTMpJr/xsLQeyWlftWjJLsseQU45abZsd1XVmda/G+ZhrDLF1y55SA="
|
||||||
|
|
||||||
script: "./travis-script.sh"
|
script: "tools/travis-script.sh"
|
||||||
after_success: ./upload-binaries.sh
|
|
||||||
|
after_success:
|
||||||
|
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_TYPE" == "Qt" ]; then
|
||||||
|
coveralls -b . -e JGE/src -e JGE/include -i projects/mtg/include -i projects/mtg/src --gcov-options '\-lp';
|
||||||
|
fi
|
||||||
|
- if [ "$BUILD_TYPE" == "ANDROID" ]; then
|
||||||
|
python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l core.zip -r Wagic-core.zip -b $TRAVIS_BRANCH &&
|
||||||
|
python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l build_android/package/bin/Wagic_*.apk -r Wagic-android.apk -b $TRAVIS_BRANCH;
|
||||||
|
fi
|
||||||
|
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_TYPE" == "PSP" ]; then
|
||||||
|
python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l build_psp/psprelease.zip -r Wagic-psp.zip -b $TRAVIS_BRANCH;
|
||||||
|
fi
|
||||||
|
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$BUILD_TYPE" == "iOS" ]; then
|
||||||
|
python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l net.wagic_0.19.2-1_iphoneos-arm.deb -r Wagic-iOS.deb -b $TRAVIS_BRANCH;
|
||||||
|
fi
|
||||||
|
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$BUILD_TYPE" == "Qt" ]; then
|
||||||
|
python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l build_qt_widget/wagic.dmg -r Wagic-macosx.dmg -b $TRAVIS_BRANCH;
|
||||||
|
fi
|
||||||
|
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$BUILD_TYPE" == "Emscripten" ]; then
|
||||||
|
./tools/deploy-emscripten.sh;
|
||||||
|
fi
|
||||||
|
|||||||
221
CHANGELOG.md
Normal file
@@ -0,0 +1,221 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## [latest-master] (https://github.com/WagicProject/wagic/tree/latest-master)
|
||||||
|
#### 8/3/16
|
||||||
|
- *Merged pull-request:* andAbility on ATokenCreator, Extend AAFlip [#\824] (https://github.com/WagicProject/wagic/pull/824) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 7/31/16
|
||||||
|
- *Merged pull-request:* Fix Chandra, Flamecaller & Cryptolith Rite [#\818] (https://github.com/WagicProject/wagic/pull/818) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 7/28/16
|
||||||
|
- *Merged pull-request:* changing some of the logic to the previous fixes, we want to avoid using code that looks for specific card names. [#\800] (https://github.com/WagicProject/wagic/pull/800) ([zethfoxster](https://github.com/zethfoxster))
|
||||||
|
|
||||||
|
#### 7/26/16
|
||||||
|
- *Merged pull-request:* granted flashback [#\791] (https://github.com/WagicProject/wagic/pull/791) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 7/23/16
|
||||||
|
- *Merged pull-request:* Fix Flying vs Moat (multiples of them). Fixes issue #526 [#\783] (https://github.com/WagicProject/wagic/pull/783) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 7/19/16
|
||||||
|
- *Merged pull-request:* pushing to master [#\770] (https://github.com/WagicProject/wagic/pull/770) ([zethfoxster](https://github.com/zethfoxster))
|
||||||
|
|
||||||
|
#### 7/18/16
|
||||||
|
- *Merged pull-request:* Fix Deck Menu layer, Change Main Menu Layout, Fix Crash cdaactive on tokens [#\765] (https://github.com/WagicProject/wagic/pull/765) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 7/12/16
|
||||||
|
- *Merged pull-request:* Pushing fixes [#\750] (https://github.com/WagicProject/wagic/pull/750) ([zethfoxster](https://github.com/zethfoxster))
|
||||||
|
|
||||||
|
- *Merged pull-request:* try to fix failed logic here [#\747] (https://github.com/WagicProject/wagic/pull/747) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 7/9/16
|
||||||
|
- *Merged pull-request:* pushing to master [#\738] (https://github.com/WagicProject/wagic/pull/738) ([zethfoxster](https://github.com/zethfoxster))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Sorted Primitives and Cleanup Tabs [#\736] (https://github.com/WagicProject/wagic/pull/736) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 7/7/16
|
||||||
|
- *Merged pull-request:* Sorted Primitives and Cleanup Tabs [#\727] (https://github.com/WagicProject/wagic/pull/719) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
- *Merged pull-request:* push to wagicproject [#\725] (https://github.com/WagicProject/wagic/pull/725) ([zethfoxster](https://github.com/zethfoxster))
|
||||||
|
|
||||||
|
#### 7/4/16
|
||||||
|
- *Merged pull-request:* Sorted Primitives & Updated Premium Deck Series [#\719] (https://github.com/WagicProject/wagic/pull/719) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Fails but I have no idea why [#\717] (https://github.com/WagicProject/wagic/pull/717) ([zethfoxster](https://github.com/zethfoxster))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Updated Sets [#\715] (https://github.com/WagicProject/wagic/pull/715) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 7/2/16
|
||||||
|
- *Merged pull-request:* Updated Masters, Beginners, Duels and Vault Sets [#\714] (https://github.com/WagicProject/wagic/pull/714) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 7/1/16
|
||||||
|
- *Merged pull-request:* Cleaned and Sorted all Core and Expansion Sets [#\713] (https://github.com/WagicProject/wagic/pull/713) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Soulbond Pair Indicator [#\712] (https://github.com/WagicProject/wagic/pull/712) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 6/30/16
|
||||||
|
- *Merged pull-request:* Sorted Primitives [#\711] (https://github.com/WagicProject/wagic/pull/711) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Add Shackle Ability [#\710] (https://github.com/WagicProject/wagic/pull/710) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Fix Cascade, Crash fix on lastController and some corrections [#\709] (https://github.com/WagicProject/wagic/pull/709) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 6/29/16
|
||||||
|
- *Merged pull-request:* Updated Primitives and Hide Highlight Border [#\707] (https://github.com/WagicProject/wagic/pull/707) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
- *Committed:* Pretty huge patch here(sorry old habits never die :( ) [#\6ee00c1] (https://github.com/WagicProject/wagic/commit/6ee00c138ce374d54cb3ee034575ce440288ca0e) ([zethfoxster](https://github.com/zethfoxster))
|
||||||
|
|
||||||
|
#### 6/23/16
|
||||||
|
- *Merged pull-request:* Fix producecolor:color [#\704] (https://github.com/WagicProject/wagic/pull/704) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 6/17/16
|
||||||
|
- *Merged pull-request:* Force Mounting 2 [#\699] (https://github.com/WagicProject/wagic/pull/699) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 6/16/16
|
||||||
|
- *Merged pull-request:* Import Deck Options [#\697] (https://github.com/WagicProject/wagic/pull/697) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 6/11/16
|
||||||
|
- *Merged pull-request:* Refactor & Devotion [#\690] (https://github.com/WagicProject/wagic/pull/690) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 6/9/16
|
||||||
|
- *Closed issue:* Clone goes to graveyard before being able to copy anything [\#546](https://github.com/WagicProject/wagic/issues/546)
|
||||||
|
|
||||||
|
- *Closed issue:* Blinking an aura causes freeze [\#541](https://github.com/WagicProject/wagic/issues/541)
|
||||||
|
|
||||||
|
- *Closed issue:* Profile name at upper left side is not being updated correctly [\#469](https://github.com/WagicProject/wagic/issues/469)
|
||||||
|
|
||||||
|
- *Closed issue:* Giving card C protection from X does not remove cards attached to C which have quality X [\#464](https://github.com/WagicProject/wagic/issues/464)
|
||||||
|
|
||||||
|
- *Closed issue:* (graphical glitch) wood / gold textures [\#461](https://github.com/WagicProject/wagic/issues/461)
|
||||||
|
|
||||||
|
- *Closed issue:* Clone does not get all P/T bonuses [\#448](https://github.com/WagicProject/wagic/issues/448)
|
||||||
|
|
||||||
|
- *Closed issue:* Card "threaten" messes up the GUI [\#473](https://github.com/WagicProject/wagic/issues/473)
|
||||||
|
|
||||||
|
#### 6/7/16
|
||||||
|
- *Closed issue:* Emrakul isn't killed by creatures with deathtouch [\#597](https://github.com/WagicProject/wagic/issues/597)
|
||||||
|
|
||||||
|
#### 6/3/16
|
||||||
|
- *Merged pull-request:* Cost Increaser & Reducer Fix [#\676] (https://github.com/WagicProject/wagic/pull/676) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 5/30/16
|
||||||
|
- *Fixed Bug:* deckstats crash when "unlock cards" is used [#\668] (https://github.com/WagicProject/wagic/issues/668) ([zethfoxster](https://github.com/zethfoxster))
|
||||||
|
|
||||||
|
#### 5/26/16
|
||||||
|
- *Closed issue:* Nasty memleak crashing devices and its fix. [#\664] (https://github.com/WagicProject/wagic/issues/664) ([zethfoxster](https://github.com/zethfoxster))
|
||||||
|
|
||||||
|
#### 11/08/15
|
||||||
|
- *Merged pull-request:* produce mana for lands you/opponent could produce [#\658] (https://github.com/WagicProject/wagic/pull/658) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 11/07/15
|
||||||
|
- *Merged pull-request:* Manacost Changes, Anyzone for CDA, PayZero Cost [#\656] (https://github.com/WagicProject/wagic/pull/656) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 10/31/15
|
||||||
|
- *Merged pull-request:* Exile Zone, Altercost and Hand modifier [#\653] (https://github.com/WagicProject/wagic/pull/653) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 10/17/15
|
||||||
|
- *Merged pull-request:* Fix issue #473 #784 [#\646] (https://github.com/WagicProject/wagic/pull/646) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 10/15/15
|
||||||
|
- *Merged pull-request:* Bug Fix: Planeswalker Rule & ABlink return to play ability for Aura cards [#\644] (https://github.com/WagicProject/wagic/pull/644) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 10/14/15
|
||||||
|
- *Merged pull-request:* Fix Legend Rule [#\643] (https://github.com/WagicProject/wagic/pull/643) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 10/12/15
|
||||||
|
- *Merged pull-request:* Fix crash bug, support doubled res texture for background, avatars, menutitle [#\641] (https://github.com/WagicProject/wagic/pull/641) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 10/02/15
|
||||||
|
- *Merged pull-request:* LKI for power, toughness and basic abilities, produceextra ability [#\636] (https://github.com/WagicProject/wagic/pull/636) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 09/29/15
|
||||||
|
- *Merged pull-request:* Fix Recover Cards, Cloner, Copier, and Preliminary support for Madness [#\635] (https://github.com/WagicProject/wagic/pull/635) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 09/22/15
|
||||||
|
- *Merged pull-request:* Auraward, unattach event and statebased action for protection from quality [#\631] (https://github.com/WagicProject/wagic/pull/631) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 09/19/15
|
||||||
|
- *Merged pull-request:* PT Switch like Layer 7e and Token Indicator [#\626] (https://github.com/WagicProject/wagic/pull/626) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 09/18/15
|
||||||
|
- *Merged pull-request:* Token Cloning fix and colored PT [#\624] (https://github.com/WagicProject/wagic/pull/624) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 09/15/15
|
||||||
|
- *Merged pull-request:* CDA and X manacost on stack [\#623] (https://github.com/WagicProject/wagic/pull/623) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
#### 08/12/14
|
||||||
|
- *Merged pull-request:* Fix for guild_keywords Devotion, added some "Chroma" cards [\#606](https://github.com/WagicProject/wagic/pull/606) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
- *Merged pull-request:* added guild keywords, added specific life cost [\#605](https://github.com/WagicProject/wagic/pull/605) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Buyback issue and a fix [\#604](https://github.com/WagicProject/wagic/pull/604) ([apollovy](https://github.com/apollovy))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Feature/ios update xcode5.1 [\#602](https://github.com/WagicProject/wagic/pull/602) ([mjnguyen](https://github.com/mjnguyen))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Remove dead code and fix circular initialization [\#601](https://github.com/WagicProject/wagic/pull/601) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||||
|
|
||||||
|
- *Merged pull-request:* update android build tools version [\#600](https://github.com/WagicProject/wagic/pull/600) ([Rolzad73](https://github.com/Rolzad73))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Attempt to make android tools fetching for TravisCI explicit and futureproof [\#599](https://github.com/WagicProject/wagic/pull/599) ([Rolzad73](https://github.com/Rolzad73))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Damager keyword [\#598](https://github.com/WagicProject/wagic/pull/598) ([bjornsnoen](https://github.com/bjornsnoen))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Fix a rarity mistake and a grammatical error [\#596](https://github.com/WagicProject/wagic/pull/596) ([bjornsnoen](https://github.com/bjornsnoen))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Fix bug where the phase wheel got out of sync [\#588](https://github.com/WagicProject/wagic/pull/588) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||||
|
|
||||||
|
- *Merged pull-request:* More easing [\#586](https://github.com/WagicProject/wagic/pull/586) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Added Avatar Tokens created by Ajani Goldmane. [\#585](https://github.com/WagicProject/wagic/pull/585) ([bjornsnoen](https://github.com/bjornsnoen))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Cleanup, usability fixes and source code documentation for DeckView.h and GridDeckView.h [\#583](https://github.com/WagicProject/wagic/pull/583) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||||
|
|
||||||
|
- *Fixed bug:* Blight does not destroy at the end of turn but right now [\#592](https://github.com/WagicProject/wagic/issues/592)
|
||||||
|
|
||||||
|
- *Fixed bug:* game freezes on Android when the phone returns from "sleep mode" [\#544](https://github.com/WagicProject/wagic/issues/544)
|
||||||
|
|
||||||
|
- *Fixed bug:* Android port needs to be able to respond to attaching/detaching devices to it [\#522](https://github.com/WagicProject/wagic/issues/522)
|
||||||
|
|
||||||
|
## [alpha-195] (https://github.com/WagicProject/wagic/tree/alpha-195)
|
||||||
|
#### 07/12/13
|
||||||
|
- *Merged pull-request:* Reset positions and filters when reopening the editor [\#578](https://github.com/WagicProject/wagic/pull/578) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Deck viewer [\#577](https://github.com/WagicProject/wagic/pull/577) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Do not specify the system directory in JGE [\#576](https://github.com/WagicProject/wagic/pull/576) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Changed Travis build file to use Android API 10 and Android build tools 18.1.1 [\#575](https://github.com/WagicProject/wagic/pull/575) ([Rolzad73](https://github.com/Rolzad73))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Feature/play from grave [\#574](https://github.com/WagicProject/wagic/pull/574) ([pankdm](https://github.com/pankdm))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Fix Valgrind warnings appearing during the test suit. [\#573](https://github.com/WagicProject/wagic/pull/573) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Strings 2 [\#572](https://github.com/WagicProject/wagic/pull/572) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Android travis ci [\#570](https://github.com/WagicProject/wagic/pull/570) ([xawotihs](https://github.com/xawotihs))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Android NDK build fix [\#569](https://github.com/WagicProject/wagic/pull/569) ([Rolzad73](https://github.com/Rolzad73))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Add a few namespaces and fix header guards. [\#564](https://github.com/WagicProject/wagic/pull/564) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Updated deckmenu.cpp to properly render deck description and summary [\#562](https://github.com/WagicProject/wagic/pull/562) ([citiral](https://github.com/citiral))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Fix some valgrind memcheck warnings. However there remains one... [\#561](https://github.com/WagicProject/wagic/pull/561) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Remove some dead code [\#560](https://github.com/WagicProject/wagic/pull/560) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Show output only for failing tests [\#559](https://github.com/WagicProject/wagic/pull/559) ([pankdm](https://github.com/pankdm))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Defines/Typos [\#557](https://github.com/WagicProject/wagic/pull/557) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Simplify Damage::resolve a bit [\#556](https://github.com/WagicProject/wagic/pull/556) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Fix cranial plating [\#555](https://github.com/WagicProject/wagic/pull/555) ([pankdm](https://github.com/pankdm))
|
||||||
|
|
||||||
|
- *Merged pull-request:* Android cleanup [\#1](https://github.com/WagicProject/wagic/pull/1) ([Rolzad73](https://github.com/Rolzad73))
|
||||||
|
|
||||||
|
- *Fixed bug:* Iona and Nin don't work [\#527](https://github.com/WagicProject/wagic/issues/527)
|
||||||
|
|
||||||
|
- *Closed issue:* Less verbose output of tests at Travis [\#558](https://github.com/WagicProject/wagic/issues/558)
|
||||||
|
|
||||||
|
## [wagic-0.19.2] (https://github.com/WagicProject/wagic/tree/wagic-v0.19.2)
|
||||||
|
#### 28/10/13
|
||||||
239
CMakeLists.txt
Normal file
@@ -0,0 +1,239 @@
|
|||||||
|
cmake_minimum_required(VERSION 2.8.7)
|
||||||
|
if(CMAKE_MAJOR_VERSION STRGREATER 3)
|
||||||
|
cmake_policy(SET CMP0054 NEW)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeModules)
|
||||||
|
|
||||||
|
#this block will fix install prefixes to install everything in a subdirectory
|
||||||
|
#of cmake_binary_dir if we are on windows/android to make packaging more easy
|
||||||
|
if(NOT CMAKE_TOOLCHAIN_FILE)
|
||||||
|
if(WIN32)
|
||||||
|
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Install directory")
|
||||||
|
else()
|
||||||
|
set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Install directory")
|
||||||
|
endif()
|
||||||
|
else() #we are cross-compiling (psp/android)
|
||||||
|
#Android: set output folder for platform/android to pick up
|
||||||
|
set(LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_BINARY_DIR} CACHE PATH "library output root")
|
||||||
|
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Install directory")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#set available build types (debug/release)
|
||||||
|
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
|
||||||
|
if(DEFINED CMAKE_BUILD_TYPE)
|
||||||
|
set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin" CACHE PATH "Application output directory")
|
||||||
|
|
||||||
|
|
||||||
|
project(wagic CXX C)
|
||||||
|
#todo: somehow determine wagics version
|
||||||
|
set(WAGIC_VERSION "0.19")
|
||||||
|
|
||||||
|
#add standard paths to search for libraries. borrowed from opencv
|
||||||
|
if(UNIX AND NOT ANDROID)
|
||||||
|
if(X86_64 OR CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
|
if(EXISTS /lib64)
|
||||||
|
list(APPEND CMAKE_LIBRARY_PATH /lib64)
|
||||||
|
else()
|
||||||
|
list(APPEND CMAKE_LIBRARY_PATH /lib)
|
||||||
|
endif()
|
||||||
|
if(EXISTS /usr/lib64)
|
||||||
|
list(APPEND CMAKE_LIBRARY_PATH /usr/lib64)
|
||||||
|
else()
|
||||||
|
list(APPEND CMAKE_LIBRARY_PATH /usr/lib)
|
||||||
|
endif()
|
||||||
|
elseif(X86 OR CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||||
|
if(EXISTS /lib32)
|
||||||
|
list(APPEND CMAKE_LIBRARY_PATH /lib32)
|
||||||
|
else()
|
||||||
|
list(APPEND CMAKE_LIBRARY_PATH /lib)
|
||||||
|
endif()
|
||||||
|
if(EXISTS /usr/lib32)
|
||||||
|
list(APPEND CMAKE_LIBRARY_PATH /usr/lib32)
|
||||||
|
else()
|
||||||
|
list(APPEND CMAKE_LIBRARY_PATH /usr/lib)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ANDROID OR PSP OR IOS)
|
||||||
|
#to allow finding of pathes/headers/libs within the source tree
|
||||||
|
#even if only search for target platform libs
|
||||||
|
set(CMAKE_FIND_ROOT_PATH ${CMAKE_SOURCE_DIR} ${CMAKE_FIND_ROOT_PATH})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#also borrowed from opencv
|
||||||
|
if(MINGW)
|
||||||
|
if(EXISTS /mingw)
|
||||||
|
list(APPEND CMAKE_INCLUDE_PATH /mingw)
|
||||||
|
endif()
|
||||||
|
if(EXISTS /mingw32)
|
||||||
|
list(APPEND CMAKE_INCLUDE_PATH /mingw32)
|
||||||
|
endif()
|
||||||
|
if(EXISTS /mingw64)
|
||||||
|
list(APPEND CMAKE_INCLUDE_PATH /mingw64)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(utils)
|
||||||
|
|
||||||
|
#select the target backend
|
||||||
|
if(PSP)
|
||||||
|
WAGIC_OPTION(backend_psp "build for psp" ON)
|
||||||
|
endif()
|
||||||
|
if(WIN32 OR ANDROID OR UNIX)
|
||||||
|
WAGIC_OPTION(backend_sdl "build for sdl" (WIN32 OR ANDROID OR EMSCRIPTEN))
|
||||||
|
endif()
|
||||||
|
if(NOT backend_sdl AND UNIX AND NOT ANDROID AND NOT IOS)
|
||||||
|
WAGIC_OPTION(backend_qt_console "build qt-console version with testsuit" ON)
|
||||||
|
WAGIC_OPTION(backend_qt_widget "build qt-widget version" OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#third party build options
|
||||||
|
WAGIC_OPTION(BUILD_ZLIB "build zlib from source" WIN32 OR APPLE)
|
||||||
|
WAGIC_OPTION(BUILD_JPEG "build jpeg from source" (WIN32 OR APPLE OR PSP OR ANDROID OR EMSCRIPTEN))
|
||||||
|
WAGIC_OPTION(BUILD_PNG "build png from source" (WIN32 OR APPLE OR PSP OR ANDROID OR EMSCRIPTEN))
|
||||||
|
WAGIC_OPTION(BUILD_UNZIP "build unzip from source" ON)
|
||||||
|
WAGIC_OPTION(BUILD_TINYXML "build tinyxml from source" (WIN32 OR APPLE OR PSP OR ANDROID OR EMSCRIPTEN OR IOS))
|
||||||
|
WAGIC_OPTION(BUILD_ZIPFS "build zipfs from source" ON)
|
||||||
|
WAGIC_OPTION(BUILD_SDL2 "build SDL2 from source" (backend_sdl AND (UNIX OR WIN32 OR ANDROID) AND (NOT EMSCRIPTEN AND NOT IOS)))
|
||||||
|
|
||||||
|
#project options
|
||||||
|
if(ANDROID)
|
||||||
|
WAGIC_OPTION(BUILD_ANDROID_PACKAGE "put the compiled code in an android package" ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if(ANDROID)
|
||||||
|
set(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib/${ANDROID_NDK_ABI_NAME}")
|
||||||
|
set(3P_LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/3rdparty/lib/${ANDROID_NDK_ABI_NAME}")
|
||||||
|
set(WAGIC_LIB_INSTALL_PATH sdk/native/libs/${ANDROID_NDK_ABI_NAME})
|
||||||
|
set(WAGIC_3P_LIB_INSTALL_PATH sdk/native/3rdparty/libs/${ANDROID_NDK_ABI_NAME})
|
||||||
|
set(WAGIC_CONFIG_INSTALL_PATH sdk/native/jni)
|
||||||
|
set(WAGIC_INCLUDE_INSTALL_PATH sdk/native/jni/include)
|
||||||
|
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/package/bin")
|
||||||
|
else()
|
||||||
|
set(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib")
|
||||||
|
set(3P_LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}")
|
||||||
|
set(WAGIC_LIB_INSTALL_PATH lib${LIB_SUFFIX})
|
||||||
|
set(WAGIC_3P_LIB_INSTALL_PATH share/wagic/3rdparty/${WAGIC_LIB_INSTALL_PATH})
|
||||||
|
set(WAGIC_INCLUDE_INSTALL_PATH "include")
|
||||||
|
set(WAGIC_CONFIG_INSTALL_PATH share/wagic)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${WAGIC_LIB_INSTALL_PATH}")
|
||||||
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||||
|
|
||||||
|
#if no build type is specified, we assume debug
|
||||||
|
if(CMAKE_GENERATOR MATCHES "Makefiles|Ninja" AND "${CMAKE_BUILD_TYPE}" STREQUAL "")
|
||||||
|
set(CMAKE_BUILD_TYPE Debug)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindOrBuild)
|
||||||
|
|
||||||
|
#set platform dependend configurations
|
||||||
|
if(PSP)
|
||||||
|
FindOrBuildPSPSDK()
|
||||||
|
include(platforms/psp/configure.cmake)
|
||||||
|
elseif(EMSCRIPTEN)
|
||||||
|
include(platforms/emscripten/configure.cmake)
|
||||||
|
elseif(WIN32)
|
||||||
|
include(platforms/win/configure.cmake)
|
||||||
|
elseif(APPLE)
|
||||||
|
include(platforms/macosx/configure.cmake)
|
||||||
|
elseif(UNIX AND NOT ANDROID)
|
||||||
|
include(platforms/unix/configure.cmake)
|
||||||
|
elseif(ANDROID)
|
||||||
|
include(platforms/android/configure.cmake)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#set backend dependend configurations
|
||||||
|
if(backend_qt_console OR backend_qt_widget)
|
||||||
|
add_definitions(-DQT_CONFIG)
|
||||||
|
if(backend_qt_console)
|
||||||
|
add_definitions(-DTESTSUITE -D_DEBUG)
|
||||||
|
add_definitions(-DCONSOLE_CONFIG -DCAPTURE_STDERR)
|
||||||
|
endif()
|
||||||
|
elseif(backend_sdl)
|
||||||
|
add_definitions(-DSDL_CONFIG)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# find or build 3rd party libraries
|
||||||
|
FindOrBuildZLIB()
|
||||||
|
FindOrBuildOpenGL()
|
||||||
|
FindOrBuildTinyXML()
|
||||||
|
FindOrBuildZipFS()
|
||||||
|
FindOrBuildUNZIP()
|
||||||
|
FindOrBuildPNG()
|
||||||
|
FindOrBuildJPEG()
|
||||||
|
FindOrBuildBoost()
|
||||||
|
if(PSP)
|
||||||
|
FindOrBuildGIF()
|
||||||
|
endif()
|
||||||
|
if(ANDROID)
|
||||||
|
FindOrBuildOpenSL()
|
||||||
|
endif()
|
||||||
|
if(backend_sdl)
|
||||||
|
FindOrBuildSDL2()
|
||||||
|
endif()
|
||||||
|
if(backend_psp)
|
||||||
|
FindOrBuildFreetype()
|
||||||
|
FindOrBuildHgeTools()
|
||||||
|
FindOrBuildMikMod()
|
||||||
|
endif()
|
||||||
|
if(backend_qt_console OR backend_qt_widget)
|
||||||
|
FindOrBuildQt()
|
||||||
|
endif()
|
||||||
|
if(ANDROID)
|
||||||
|
include(DetectAndroidSDK)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(BUILD_ANDROID_PACKAGE)
|
||||||
|
find_package(Ant REQUIRED)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#add jge and mtg projects
|
||||||
|
add_subdirectory(JGE)
|
||||||
|
add_subdirectory(projects/mtg)
|
||||||
|
|
||||||
|
if(BUILD_ANDROID_PACKAGE)
|
||||||
|
add_subdirectory(platforms/android/package)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(EMSCRIPTEN)
|
||||||
|
set(CMAKE_EXECUTABLE_SUFFIX ".html")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(IOS)
|
||||||
|
list_add_prefix(JGE_SOURCES " JGE/")
|
||||||
|
list_add_prefix(MTG_generic_src " projects/mtg/")
|
||||||
|
list_add_prefix(JGE_INCLUDE_DIRS " -IJGE/")
|
||||||
|
list_add_prefix(MTG_INCLUDE_DIRS " -Iprojects/mtg/")
|
||||||
|
list_add_prefix(TINYXML_SRC " thirdparty/tinyxml/")
|
||||||
|
list_add_prefix(UNZIP_SRC " thirdparty/unzip/")
|
||||||
|
list_add_prefix(ZIPFS_SRC " thirdparty/zipFS/")
|
||||||
|
|
||||||
|
file(WRITE makefile.ios
|
||||||
|
"ARCHS= armv7 armv7s \n"
|
||||||
|
"include ${THEOS_PATH}/makefiles/common.mk\n"
|
||||||
|
"TARGET= iphone:clang:latest:8.0 \n"
|
||||||
|
"APPLICATION_NAME = " ${PROJECT_NAME} "\n"
|
||||||
|
${PROJECT_NAME} "_FILES =" ${ZIPFS_SRC} ${UNZIP_SRC} ${TINYXML_SRC} ${JGE_SOURCES} ${MTG_generic_src} " thirdparty/Boost/lib/pthread/once.cpp thirdparty/Boost/lib/pthread/thread.cpp\n"
|
||||||
|
${PROJECT_NAME} "_LDFLAGS = -lz\n"
|
||||||
|
${PROJECT_NAME} "_FRAMEWORKS = UIKit CoreGraphics OpenGLES Foundation CFNetwork MobileCoreServices AVFoundation OpenAL AudioToolbox QuartzCore SystemConfiguration\n"
|
||||||
|
"include ${THEOS_PATH}/makefiles/application.mk\n"
|
||||||
|
"ADDITIONAL_CFLAGS = " ${MTG_INCLUDE_DIRS} ${JGE_INCLUDE_DIRS} " -I" ${ZIPFS_INCLUDE_DIR} " -I" ${UNZIP_INCLUDE_DIR} " -I" ${HGE_INCLUDE_DIR} ${TINYXML_INCLUDE_DIR} " -I" ${ZLIB_INCLUDE_DIRS} ${BOOST_INCLUDE_DIRS} " "
|
||||||
|
"-DIOS -D__arm__ -DTIXML_USE_STL -DVERSION=\"$(GIT_VERSION)\" "
|
||||||
|
"-Wno-parentheses-equality -Wno-delete-non-virtual-dtor "
|
||||||
|
"-Wno-tautological-undefined-compare -Wno-undefined-bool-conversion "
|
||||||
|
"-Wno-visibility -Wno-deprecated-declarations -Wno-non-literal-null-conversion "
|
||||||
|
"-Wno-format -Wno-distributed-object-modifiers -Wno-missing-braces -Wno-uninitialized "
|
||||||
|
"-Wno-unused-const-variable -Wno-unused-function -Wno-unknown-warning-option -Wno-unused-local-typedef "
|
||||||
|
"-x objective-c++ \n"
|
||||||
|
|
||||||
|
"_THEOS_TARGET_ONLY_OBJCFLAGS :=\"\"\n"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
373
CMakeModules/DetectAndroidSDK.cmake
Normal file
@@ -0,0 +1,373 @@
|
|||||||
|
if(EXISTS "${ANDROID_EXECUTABLE}")
|
||||||
|
set(ANDROID_SDK_DETECT_QUIET TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
file(TO_CMAKE_PATH "$ENV{ProgramFiles}" ProgramFiles_ENV_PATH)
|
||||||
|
file(TO_CMAKE_PATH "$ENV{HOME}" HOME_ENV_PATH)
|
||||||
|
|
||||||
|
if(CMAKE_HOST_WIN32)
|
||||||
|
set(ANDROID_SDK_OS windows)
|
||||||
|
elseif(CMAKE_HOST_APPLE)
|
||||||
|
set(ANDROID_SDK_OS macosx)
|
||||||
|
else()
|
||||||
|
set(ANDROID_SDK_OS linux)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#find android SDK: search in ANDROID_SDK first
|
||||||
|
find_host_program(ANDROID_EXECUTABLE
|
||||||
|
NAMES android.bat android
|
||||||
|
PATH_SUFFIXES tools
|
||||||
|
PATHS
|
||||||
|
ENV ANDROID_SDK
|
||||||
|
DOC "Android SDK location"
|
||||||
|
NO_DEFAULT_PATH
|
||||||
|
)
|
||||||
|
|
||||||
|
# Now search default paths
|
||||||
|
find_host_program(ANDROID_EXECUTABLE
|
||||||
|
NAMES android.bat android
|
||||||
|
PATH_SUFFIXES android-sdk-${ANDROID_SDK_OS}/tools
|
||||||
|
android-sdk-${ANDROID_SDK_OS}_x86/tools
|
||||||
|
android-sdk-${ANDROID_SDK_OS}_86/tools
|
||||||
|
android-sdk/tools
|
||||||
|
PATHS /opt
|
||||||
|
"${HOME_ENV_PATH}/NVPACK"
|
||||||
|
"$ENV{SystemDrive}/NVPACK"
|
||||||
|
"${ProgramFiles_ENV_PATH}/Android"
|
||||||
|
DOC "Android SDK location"
|
||||||
|
)
|
||||||
|
|
||||||
|
if(ANDROID_EXECUTABLE)
|
||||||
|
if(NOT ANDROID_SDK_DETECT_QUIET)
|
||||||
|
message(STATUS "Found android tool: ${ANDROID_EXECUTABLE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
get_filename_component(ANDROID_SDK_TOOLS_PATH "${ANDROID_EXECUTABLE}" PATH)
|
||||||
|
|
||||||
|
#read source.properties
|
||||||
|
if(EXISTS "${ANDROID_SDK_TOOLS_PATH}/source.properties")
|
||||||
|
file(STRINGS "${ANDROID_SDK_TOOLS_PATH}/source.properties" ANDROID_SDK_TOOLS_SOURCE_PROPERTIES_LINES REGEX "^[ ]*[^#].*$")
|
||||||
|
foreach(line ${ANDROID_SDK_TOOLS_SOURCE_PROPERTIES_LINES})
|
||||||
|
string(REPLACE "\\:" ":" line ${line})
|
||||||
|
string(REPLACE "=" ";" line ${line})
|
||||||
|
list(GET line 0 line_name)
|
||||||
|
list(GET line 1 line_value)
|
||||||
|
string(REPLACE "." "_" line_name ${line_name})
|
||||||
|
SET(ANDROID_TOOLS_${line_name} "${line_value}" CACHE INTERNAL "from ${ANDROID_SDK_TOOLS_PATH}/source.properties")
|
||||||
|
MARK_AS_ADVANCED(ANDROID_TOOLS_${line_name})
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#fix missing revision (SDK tools before r9 don't set revision number correctly)
|
||||||
|
if(NOT ANDROID_TOOLS_Pkg_Revision)
|
||||||
|
SET(ANDROID_TOOLS_Pkg_Revision "Unknown" CACHE INTERNAL "")
|
||||||
|
MARK_AS_ADVANCED(ANDROID_TOOLS_Pkg_Revision)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#fix missing description
|
||||||
|
if(NOT ANDROID_TOOLS_Pkg_Desc)
|
||||||
|
SET(ANDROID_TOOLS_Pkg_Desc "Android SDK Tools, revision ${ANDROID_TOOLS_Pkg_Revision}." CACHE INTERNAL "")
|
||||||
|
MARK_AS_ADVANCED(ANDROID_TOOLS_Pkg_Desc)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#warn about outdated SDK
|
||||||
|
if(NOT ANDROID_TOOLS_Pkg_Revision GREATER 13)
|
||||||
|
SET(ANDROID_TOOLS_Pkg_Desc "${ANDROID_TOOLS_Pkg_Desc} It is recommended to update your SDK tools to revision 14 or newer." CACHE INTERNAL "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ANDROID_TOOLS_Pkg_Revision GREATER 13)
|
||||||
|
SET(ANDROID_PROJECT_PROPERTIES_FILE project.properties)
|
||||||
|
SET(ANDROID_ANT_PROPERTIES_FILE ant.properties)
|
||||||
|
else()
|
||||||
|
SET(ANDROID_PROJECT_PROPERTIES_FILE default.properties)
|
||||||
|
SET(ANDROID_ANT_PROPERTIES_FILE build.properties)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(ANDROID_MANIFEST_FILE AndroidManifest.xml)
|
||||||
|
set(ANDROID_LIB_PROJECT_FILES build.xml local.properties proguard-project.txt ${ANDROID_PROJECT_PROPERTIES_FILE})
|
||||||
|
set(ANDROID_PROJECT_FILES ${ANDROID_LIB_PROJECT_FILES})
|
||||||
|
|
||||||
|
#get installed targets
|
||||||
|
if(ANDROID_TOOLS_Pkg_Revision GREATER 11)
|
||||||
|
execute_process(COMMAND ${ANDROID_EXECUTABLE} list target -c
|
||||||
|
RESULT_VARIABLE ANDROID_PROCESS
|
||||||
|
OUTPUT_VARIABLE ANDROID_SDK_TARGETS
|
||||||
|
ERROR_VARIABLE ANDROID_PROCESS_ERRORS
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
string(REGEX MATCHALL "[^\n]+" ANDROID_SDK_TARGETS "${ANDROID_SDK_TARGETS}")
|
||||||
|
else()
|
||||||
|
#old SDKs (r11 and older) don't provide compact list
|
||||||
|
execute_process(COMMAND ${ANDROID_EXECUTABLE} list target
|
||||||
|
RESULT_VARIABLE ANDROID_PROCESS
|
||||||
|
OUTPUT_VARIABLE ANDROID_SDK_TARGETS_FULL
|
||||||
|
ERROR_VARIABLE ANDROID_PROCESS_ERRORS
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
string(REGEX MATCHALL "(^|\n)id: [0-9]+ or \"([^\n]+[0-9+])\"(\n|$)" ANDROID_SDK_TARGETS_FULL "${ANDROID_SDK_TARGETS_FULL}")
|
||||||
|
|
||||||
|
SET(ANDROID_SDK_TARGETS "")
|
||||||
|
if(ANDROID_PROCESS EQUAL 0)
|
||||||
|
foreach(line ${ANDROID_SDK_TARGETS_FULL})
|
||||||
|
string(REGEX REPLACE "(^|\n)id: [0-9]+ or \"([^\n]+[0-9+])\"(\n|$)" "\\2" line "${line}")
|
||||||
|
list(APPEND ANDROID_SDK_TARGETS "${line}")
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT ANDROID_PROCESS EQUAL 0)
|
||||||
|
message(ERROR "Failed to get list of installed Android targets.")
|
||||||
|
set(ANDROID_EXECUTABLE "ANDROID_EXECUTABLE-NOTFOUND")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# clear ANDROID_SDK_TARGET if no target is provided by user
|
||||||
|
if(NOT ANDROID_SDK_TARGET)
|
||||||
|
set(ANDROID_SDK_TARGET "" CACHE STRING "Android SDK target for the Wagic Java API and samples")
|
||||||
|
endif()
|
||||||
|
if(ANDROID_SDK_TARGETS)
|
||||||
|
set_property( CACHE ANDROID_SDK_TARGET PROPERTY STRINGS ${ANDROID_SDK_TARGETS} )
|
||||||
|
endif()
|
||||||
|
endif(ANDROID_EXECUTABLE)
|
||||||
|
|
||||||
|
# finds minimal installed SDK target compatible with provided names or API levels
|
||||||
|
# usage:
|
||||||
|
# get_compatible_android_api_level(VARIABLE [level1] [level2] ...)
|
||||||
|
macro(android_get_compatible_target VAR)
|
||||||
|
set(${VAR} "${VAR}-NOTFOUND")
|
||||||
|
if(ANDROID_SDK_TARGETS)
|
||||||
|
list(GET ANDROID_SDK_TARGETS 0 __lvl)
|
||||||
|
string(REGEX MATCH "[0-9]+$" __lvl "${__lvl}")
|
||||||
|
|
||||||
|
#find minimal level mathing to all provided levels
|
||||||
|
foreach(lvl ${ARGN})
|
||||||
|
string(REGEX MATCH "[0-9]+$" __level "${lvl}")
|
||||||
|
if(__level GREATER __lvl)
|
||||||
|
set(__lvl ${__level})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
#search for compatible levels
|
||||||
|
foreach(lvl ${ANDROID_SDK_TARGETS})
|
||||||
|
string(REGEX MATCH "[0-9]+$" __level "${lvl}")
|
||||||
|
if(__level EQUAL __lvl)
|
||||||
|
#look for exact match
|
||||||
|
foreach(usrlvl ${ARGN})
|
||||||
|
if("${usrlvl}" STREQUAL "${lvl}")
|
||||||
|
set(${VAR} "${lvl}")
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
if("${${VAR}}" STREQUAL "${lvl}")
|
||||||
|
break() #exact match was found
|
||||||
|
elseif(NOT ${VAR})
|
||||||
|
set(${VAR} "${lvl}")
|
||||||
|
endif()
|
||||||
|
elseif(__level GREATER __lvl)
|
||||||
|
if(NOT ${VAR})
|
||||||
|
set(${VAR} "${lvl}")
|
||||||
|
endif()
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
unset(__lvl)
|
||||||
|
unset(__level)
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
unset(__android_project_chain CACHE)
|
||||||
|
|
||||||
|
# add_android_project(target_name ${path} NATIVE_DEPS opencv_core LIBRARY_DEPS ${Wagic_BINARY_DIR} SDK_TARGET 11)
|
||||||
|
macro(add_android_project target path)
|
||||||
|
# parse arguments
|
||||||
|
set(android_proj_arglist NATIVE_DEPS LIBRARY_DEPS SDK_TARGET IGNORE_JAVA IGNORE_MANIFEST)
|
||||||
|
set(__varname "android_proj_")
|
||||||
|
foreach(v ${android_proj_arglist})
|
||||||
|
set(${__varname}${v} "")
|
||||||
|
endforeach()
|
||||||
|
foreach(arg ${ARGN})
|
||||||
|
set(__var "${__varname}")
|
||||||
|
foreach(v ${android_proj_arglist})
|
||||||
|
if("${v}" STREQUAL "${arg}")
|
||||||
|
set(__varname "android_proj_${v}")
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
if(__var STREQUAL __varname)
|
||||||
|
list(APPEND ${__var} "${arg}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
# get compatible SDK target
|
||||||
|
android_get_compatible_target(android_proj_sdk_target ${ANDROID_NATIVE_API_LEVEL} ${android_proj_SDK_TARGET})
|
||||||
|
|
||||||
|
if(NOT android_proj_sdk_target)
|
||||||
|
message(WARNING "Can not find any SDK target compatible with: ${ANDROID_NATIVE_API_LEVEL} ${android_proj_SDK_TARGET}
|
||||||
|
The project ${target} will not be build")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# check native dependencies
|
||||||
|
if(android_proj_IGNORE_JAVA)
|
||||||
|
ocv_check_dependencies(${android_proj_NATIVE_DEPS})
|
||||||
|
else()
|
||||||
|
ocv_check_dependencies(${android_proj_NATIVE_DEPS} opencv_java)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(EXISTS "${path}/jni/Android.mk" )
|
||||||
|
# find if native_app_glue is used
|
||||||
|
file(STRINGS "${path}/jni/Android.mk" NATIVE_APP_GLUE REGEX ".*(call import-module,android/native_app_glue)" )
|
||||||
|
if(NATIVE_APP_GLUE)
|
||||||
|
if(ANDROID_NATIVE_API_LEVEL LESS 9 OR NOT EXISTS "${ANDROID_NDK}/sources/android/native_app_glue")
|
||||||
|
set(OCV_DEPENDENCIES_FOUND FALSE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(OCV_DEPENDENCIES_FOUND AND android_proj_sdk_target AND ANDROID_EXECUTABLE AND ANT_EXECUTABLE AND ANDROID_TOOLS_Pkg_Revision GREATER 13 AND EXISTS "${path}/${ANDROID_MANIFEST_FILE}")
|
||||||
|
|
||||||
|
project(${target})
|
||||||
|
set(android_proj_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/.build")
|
||||||
|
|
||||||
|
# get project sources
|
||||||
|
file(GLOB_RECURSE android_proj_files RELATIVE "${path}" "${path}/res/*" "${path}/src/*")
|
||||||
|
|
||||||
|
if(NOT android_proj_IGNORE_MANIFEST)
|
||||||
|
list(APPEND android_proj_files ${ANDROID_MANIFEST_FILE})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# copy sources out from the build tree
|
||||||
|
set(android_proj_file_deps "")
|
||||||
|
foreach(f ${android_proj_files})
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${android_proj_bin_dir}/${f}"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy "${path}/${f}" "${android_proj_bin_dir}/${f}"
|
||||||
|
MAIN_DEPENDENCY "${path}/${f}"
|
||||||
|
COMMENT "Copying ${f}")
|
||||||
|
list(APPEND android_proj_file_deps "${path}/${f}" "${android_proj_bin_dir}/${f}")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
set(android_proj_lib_deps_commands "")
|
||||||
|
set(android_proj_target_files ${ANDROID_PROJECT_FILES})
|
||||||
|
ocv_list_add_prefix(android_proj_target_files "${android_proj_bin_dir}/")
|
||||||
|
|
||||||
|
# process Android library dependencies
|
||||||
|
foreach(dep ${android_proj_LIBRARY_DEPS})
|
||||||
|
file(RELATIVE_PATH __dep "${android_proj_bin_dir}" "${dep}")
|
||||||
|
list(APPEND android_proj_lib_deps_commands
|
||||||
|
COMMAND ${ANDROID_EXECUTABLE} --silent update project --path "${android_proj_bin_dir}" --library "${__dep}")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
# fix Android project
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${android_proj_target_files}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E remove ${android_proj_target_files}
|
||||||
|
COMMAND ${ANDROID_EXECUTABLE} --silent update project --path "${android_proj_bin_dir}" --target "${android_proj_sdk_target}" --name "${target}"
|
||||||
|
${android_proj_lib_deps_commands}
|
||||||
|
MAIN_DEPENDENCY "${android_proj_bin_dir}/${ANDROID_MANIFEST_FILE}"
|
||||||
|
DEPENDS "${path}/${ANDROID_MANIFEST_FILE}"
|
||||||
|
COMMENT "Updating Android project at ${path}. SDK target: ${android_proj_sdk_target}"
|
||||||
|
)
|
||||||
|
|
||||||
|
list(APPEND android_proj_file_deps ${android_proj_target_files})
|
||||||
|
|
||||||
|
# build native part
|
||||||
|
file(GLOB_RECURSE android_proj_jni_files "${path}/jni/*.c" "${path}/jni/*.h" "${path}/jni/*.cpp" "${path}/jni/*.hpp")
|
||||||
|
ocv_list_filterout(android_proj_jni_files "\\\\.svn")
|
||||||
|
|
||||||
|
if(android_proj_jni_files AND EXISTS ${path}/jni/Android.mk AND NOT DEFINED JNI_LIB_NAME)
|
||||||
|
# find local module name in Android.mk file to build native lib
|
||||||
|
file(STRINGS "${path}/jni/Android.mk" JNI_LIB_NAME REGEX "LOCAL_MODULE[ ]*:=[ ]*.*" )
|
||||||
|
string(REGEX REPLACE "LOCAL_MODULE[ ]*:=[ ]*([a-zA-Z_][a-zA-Z_0-9]*)[ ]*" "\\1" JNI_LIB_NAME "${JNI_LIB_NAME}")
|
||||||
|
|
||||||
|
if(JNI_LIB_NAME)
|
||||||
|
ocv_include_modules_recurse(${android_proj_NATIVE_DEPS})
|
||||||
|
ocv_include_directories("${path}/jni")
|
||||||
|
|
||||||
|
if(NATIVE_APP_GLUE)
|
||||||
|
include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
|
||||||
|
list(APPEND android_proj_jni_files ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
|
||||||
|
ocv_warnings_disable(CMAKE_C_FLAGS -Wstrict-prototypes -Wunused-parameter -Wmissing-prototypes)
|
||||||
|
set(android_proj_NATIVE_DEPS ${android_proj_NATIVE_DEPS} android)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_library(${JNI_LIB_NAME} MODULE ${android_proj_jni_files})
|
||||||
|
target_link_libraries(${JNI_LIB_NAME} ${OPENCV_LINKER_LIBS} ${android_proj_NATIVE_DEPS})
|
||||||
|
|
||||||
|
set_target_properties(${JNI_LIB_NAME} PROPERTIES
|
||||||
|
OUTPUT_NAME "${JNI_LIB_NAME}"
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY "${android_proj_bin_dir}/libs/${ANDROID_NDK_ABI_NAME}"
|
||||||
|
)
|
||||||
|
|
||||||
|
get_target_property(android_proj_jni_location "${JNI_LIB_NAME}" LOCATION)
|
||||||
|
if (NOT (CMAKE_BUILD_TYPE MATCHES "debug"))
|
||||||
|
add_custom_command(TARGET ${JNI_LIB_NAME} POST_BUILD COMMAND ${CMAKE_STRIP} --strip-unneeded "${android_proj_jni_location}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# build java part
|
||||||
|
if(android_proj_IGNORE_JAVA)
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${android_proj_bin_dir}/bin/${target}-debug.apk"
|
||||||
|
COMMAND ${ANT_EXECUTABLE} -q -noinput -k debug
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E touch "${android_proj_bin_dir}/bin/${target}-debug.apk" # needed because ant does not update the timestamp of updated apk
|
||||||
|
WORKING_DIRECTORY "${android_proj_bin_dir}"
|
||||||
|
MAIN_DEPENDENCY "${android_proj_bin_dir}/${ANDROID_MANIFEST_FILE}"
|
||||||
|
DEPENDS ${android_proj_file_deps} ${JNI_LIB_NAME})
|
||||||
|
else()
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${android_proj_bin_dir}/bin/${target}-debug.apk"
|
||||||
|
COMMAND ${ANT_EXECUTABLE} -q -noinput -k debug
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E touch "${android_proj_bin_dir}/bin/${target}-debug.apk" # needed because ant does not update the timestamp of updated apk
|
||||||
|
WORKING_DIRECTORY "${android_proj_bin_dir}"
|
||||||
|
MAIN_DEPENDENCY "${android_proj_bin_dir}/${ANDROID_MANIFEST_FILE}"
|
||||||
|
DEPENDS "${Wagic_BINARY_DIR}/bin/classes.jar.dephelper" opencv_java # as we are part of Wagic we can just force this dependency
|
||||||
|
DEPENDS ${android_proj_file_deps} ${JNI_LIB_NAME})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
unset(JNI_LIB_NAME)
|
||||||
|
|
||||||
|
add_custom_target(${target} ALL SOURCES "${android_proj_bin_dir}/bin/${target}-debug.apk" )
|
||||||
|
if(NOT android_proj_IGNORE_JAVA)
|
||||||
|
add_dependencies(${target} opencv_java)
|
||||||
|
endif()
|
||||||
|
if(android_proj_native_deps)
|
||||||
|
add_dependencies(${target} ${android_proj_native_deps})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(__android_project_chain)
|
||||||
|
add_dependencies(${target} ${__android_project_chain})
|
||||||
|
endif()
|
||||||
|
set(__android_project_chain ${target} CACHE INTERNAL "auxiliary variable used for Android progects chaining")
|
||||||
|
|
||||||
|
# put the final .apk to the Wagic's bin folder
|
||||||
|
add_custom_command(TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${android_proj_bin_dir}/bin/${target}-debug.apk" "${Wagic_BINARY_DIR}/bin/${target}.apk")
|
||||||
|
if(INSTALL_ANDROID_EXAMPLES AND "${target}" MATCHES "^example-")
|
||||||
|
#apk
|
||||||
|
install(FILES "${Wagic_BINARY_DIR}/bin/${target}.apk" DESTINATION "samples" COMPONENT main)
|
||||||
|
get_filename_component(sample_dir "${path}" NAME)
|
||||||
|
#java part
|
||||||
|
list(REMOVE_ITEM android_proj_files ${ANDROID_MANIFEST_FILE})
|
||||||
|
foreach(f ${android_proj_files} ${ANDROID_MANIFEST_FILE})
|
||||||
|
get_filename_component(install_subdir "${f}" PATH)
|
||||||
|
install(FILES "${android_proj_bin_dir}/${f}" DESTINATION "samples/${sample_dir}/${install_subdir}" COMPONENT main)
|
||||||
|
endforeach()
|
||||||
|
#jni part + eclipse files
|
||||||
|
file(GLOB_RECURSE jni_files RELATIVE "${path}" "${path}/jni/*" "${path}/.cproject")
|
||||||
|
ocv_list_filterout(jni_files "\\\\.svn")
|
||||||
|
foreach(f ${jni_files} ".classpath" ".project" ".settings/org.eclipse.jdt.core.prefs")
|
||||||
|
get_filename_component(install_subdir "${f}" PATH)
|
||||||
|
install(FILES "${path}/${f}" DESTINATION "samples/${sample_dir}/${install_subdir}" COMPONENT main)
|
||||||
|
endforeach()
|
||||||
|
#update proj
|
||||||
|
if(android_proj_lib_deps_commands)
|
||||||
|
set(inst_lib_opt " --library ../../sdk/java")
|
||||||
|
endif()
|
||||||
|
install(CODE "EXECUTE_PROCESS(COMMAND ${ANDROID_EXECUTABLE} --silent update project --path . --target \"${android_proj_sdk_target}\" --name \"${target}\" ${inst_lib_opt}
|
||||||
|
WORKING_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/samples/${sample_dir}\"
|
||||||
|
)" COMPONENT main)
|
||||||
|
#empty 'gen'
|
||||||
|
install(CODE "MAKE_DIRECTORY(\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/samples/${sample_dir}/gen\")" COMPONENT main)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
13
CMakeModules/FindAnt.cmake
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
find_host_program(ANT_EXECUTABLE "ant")
|
||||||
|
|
||||||
|
if(ANT_EXECUTABLE)
|
||||||
|
set(ANT_FOUND ON)
|
||||||
|
else()
|
||||||
|
set(ANT_FOUND OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
INCLUDE(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ANT REQUIRED_VARS ANT_EXECUTABLE)
|
||||||
|
mark_as_advanced(ANT_EXECUTABLE ANT_FOUND)
|
||||||
29
CMakeModules/FindOpenSL.cmake
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# - Find OpenSL (actually OpenSLES)
|
||||||
|
# Find the OpenSLES includes and libraries
|
||||||
|
#
|
||||||
|
# OPENSL_INCLUDE_DIR - where to find dsound.h
|
||||||
|
# OPENSL_LIBRARIES - List of libraries when using dsound.
|
||||||
|
# OPENSL_FOUND - True if dsound found.
|
||||||
|
|
||||||
|
if(OPENSL_INCLUDE_DIR)
|
||||||
|
# Already in cache, be silent
|
||||||
|
set(OPENSL_FIND_QUIETLY TRUE)
|
||||||
|
endif(OPENSL_INCLUDE_DIR)
|
||||||
|
|
||||||
|
find_path(OPENSL_INCLUDE_DIR SLES/OpenSLES.h)
|
||||||
|
|
||||||
|
find_library(OPENSL_LIBRARY NAMES OpenSLES)
|
||||||
|
|
||||||
|
# Handle the QUIETLY and REQUIRED arguments and set OPENSL_FOUND to TRUE if
|
||||||
|
# all listed variables are TRUE.
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(OPENSL DEFAULT_MSG
|
||||||
|
OPENSL_INCLUDE_DIR OPENSL_LIBRARY)
|
||||||
|
|
||||||
|
if(OPENSL_FOUND)
|
||||||
|
set(OPENSL_LIBRARIES ${OPENSL_LIBRARY})
|
||||||
|
else(OPENSL_FOUND)
|
||||||
|
set(OPENSL_LIBRARIES)
|
||||||
|
endif(OPENSL_FOUND)
|
||||||
|
|
||||||
|
mark_as_advanced(OPENSL_INCLUDE_DIR OPENSL_LIBRARY)
|
||||||
231
CMakeModules/FindOrBuild.cmake
Normal file
@@ -0,0 +1,231 @@
|
|||||||
|
macro(FindOrBuildZipFS)
|
||||||
|
if(BUILD_ZIPFS)
|
||||||
|
add_subdirectory(
|
||||||
|
${CMAKE_SOURCE_DIR}/thirdparty/zipFS
|
||||||
|
${CMAKE_BINARY_DIR}/thirdparty/zipFS)
|
||||||
|
set(ZIPFS_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/zipFS)
|
||||||
|
set(ZIPFS_LIBRARY zipFS)
|
||||||
|
else()
|
||||||
|
message(WARNING "ZIPFS must get build")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(FindOrBuildTinyXML)
|
||||||
|
if(BUILD_TINYXML)
|
||||||
|
add_definitions(-DTIXML_USE_STL)
|
||||||
|
add_subdirectory(
|
||||||
|
${CMAKE_SOURCE_DIR}/thirdparty/tinyxml
|
||||||
|
${CMAKE_BINARY_DIR}/thirdparty/tinyxml)
|
||||||
|
set(TINYXML_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/tinyxml)
|
||||||
|
set(TINYXML_LIBRARIES tinyxml)
|
||||||
|
else()
|
||||||
|
find_package(TinyXML REQUIRED)
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(FindOrBuildSDL2)
|
||||||
|
if(BUILD_SDL2)
|
||||||
|
if(WIN32)
|
||||||
|
#SDL2 DirectX build is somehow broken...
|
||||||
|
set(SDL_AUDIO FALSE)
|
||||||
|
set(SDL_JOYSTICK FALSE)
|
||||||
|
set(SDL_HAPTIC FALSE)
|
||||||
|
set(SDL_SHARED FALSE)
|
||||||
|
endif()
|
||||||
|
add_subdirectory(${CMAKE_SOURCE_DIR}/thirdparty/SDL2)
|
||||||
|
set(SDL2_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/SDL2/include ${CMAKE_BINARY_DIR}/thirdparty/SDL2)
|
||||||
|
if(EMSCRIPTEN)
|
||||||
|
set(SDL2_LIBRARY SDL2-static)
|
||||||
|
else()
|
||||||
|
set(SDL2_LIBRARY SDL2)
|
||||||
|
endif()
|
||||||
|
elseif(NOT EMSCRIPTEN)
|
||||||
|
find_package(SDL2)
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(FindOrBuildUNZIP)
|
||||||
|
if(BUILD_UNZIP)
|
||||||
|
add_subdirectory(
|
||||||
|
${CMAKE_SOURCE_DIR}/thirdparty/unzip
|
||||||
|
${CMAKE_BINARY_DIR}/thirdparty/unzip)
|
||||||
|
set(UNZIP_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/unzip)
|
||||||
|
set(UNZIP_LIBRARY unzip)
|
||||||
|
else()
|
||||||
|
message(WARNING "UNZIP must get build")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(FindOrBuildBoost)
|
||||||
|
if(PSP OR UNIX OR WIN32 OR IOS)
|
||||||
|
#the psp build does not need more than a few headers
|
||||||
|
#todo: remove from the repository
|
||||||
|
set(BOOST_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/thirdparty/Boost)
|
||||||
|
# elseif(WIN32)
|
||||||
|
#set BOOST_ROOT to the root of boost
|
||||||
|
# set(Boost_USE_STATIC_LIBS ON)
|
||||||
|
# set(Boost_USE_MULTITHREADED ON)
|
||||||
|
# set(BOOST_ROOT $ENV{BOOST_ROOT})
|
||||||
|
|
||||||
|
# set(BOOST_LIBRARYDIR ${BOOST_ROOT}/libs)
|
||||||
|
# set(BOOST_INCLUDEDIR ${BOOST_ROOT})
|
||||||
|
|
||||||
|
# find_package(Boost COMPONENTS system thread date_time REQUIRED)
|
||||||
|
# if(NOT Boost_FOUND)
|
||||||
|
# message("Set the BOOST_ROOT environment variable to point to your boost installation.")
|
||||||
|
# message("We need system thread and date_time compiled static libs")
|
||||||
|
# message("These libs are compiler specific.")
|
||||||
|
# endif()
|
||||||
|
# elseif(UNIX AND NOT ANDROID)
|
||||||
|
# find_package(Boost COMPONENTS system thread date_time REQUIRED)
|
||||||
|
elseif(ANDROID)
|
||||||
|
#this is a hack. we compile a few boost libds directly into
|
||||||
|
#the application. we should require static libs for android
|
||||||
|
#to be available. maybe we could add the build option to
|
||||||
|
#download and build a compatible boost version
|
||||||
|
find_path(BOOST_INCLUDE_DIRS NAMES bind.hpp HINTS $ENV{ANDROID_BOOST_ROOT} PATH_SUFFIXES boost)
|
||||||
|
|
||||||
|
if(BOOST_INCLUDE_DIRS)
|
||||||
|
get_filename_component(BOOST_INCLUDE_DIRS ${BOOST_INCLUDE_DIRS} PATH)
|
||||||
|
set(ANDROID_BOOST_PTHREAD_SRC_DIR ${BOOST_INCLUDE_DIRS}/libs/thread/src/pthread)
|
||||||
|
set(ANDROID_BOOST_SYSTEM_SRC_DIR ${BOOST_INCLUDE_DIRS}/libs/system/src/)
|
||||||
|
else()
|
||||||
|
message(SEND_ERROR "We require a few boost sources to get compiled into wagic. Please point the ANDROID_BOOST_ROOT environment variable to a boost-source copy root.")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
|
||||||
|
macro(FindOrBuildZLIB)
|
||||||
|
if(BUILD_ZLIB)
|
||||||
|
add_subdirectory(${CMAKE_SOURCE_DIR}/thirdparty/zlib)
|
||||||
|
set(ZLIB_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/thirdparty/zlib ${CMAKE_BINARY_DIR}/thirdparty/zlib)
|
||||||
|
set(ZLIB_LIBRARIES zlib)
|
||||||
|
else()
|
||||||
|
if(WIN32)
|
||||||
|
set(ZLIB_ROOT ${CMAKE_SOURCE_DIR}/thirdparty/binary/win)
|
||||||
|
find_package(ZLIB)
|
||||||
|
else()
|
||||||
|
if(backend_qt_console OR backend_qt_widget OR EMSCRIPTEN)
|
||||||
|
set(ZLIB_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/thirdparty/zlib)
|
||||||
|
else()
|
||||||
|
find_package(ZLIB)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(FindOrBuildGIF)
|
||||||
|
if(BUILD_GIF)
|
||||||
|
message(WARNING "GIF sources are currently not included within the wagic tree")
|
||||||
|
else()
|
||||||
|
if(PSP)
|
||||||
|
find_package(GIF)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(FindOrBuildJPEG)
|
||||||
|
if(BUILD_JPEG)
|
||||||
|
add_subdirectory(${CMAKE_SOURCE_DIR}/thirdparty/libjpeg ${CMAKE_BINARY_DIR}/thirdparty/libjpeg)
|
||||||
|
set(JPEG_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/libjpeg)
|
||||||
|
set(JPEG_LIBRARY jpeg)
|
||||||
|
else()
|
||||||
|
if(WIN32)
|
||||||
|
#findJPEG does currently not provide prefix vars to guide it
|
||||||
|
find_path(JPEG_INCLUDE_DIR jpeglib.h HINTS ${CMAKE_SOURCE_DIR}/thirdparty/binary/win/include)
|
||||||
|
find_library(JPEG_LIBRARY NAMES libjpeg-static-mt HINTS ${CMAKE_SOURCE_DIR}/thirdparty/binary/win/lib)
|
||||||
|
|
||||||
|
if(JPEG_INCLUDE_DIR AND JPEG_LIBRARY)
|
||||||
|
set(JPEG_FOUND ON)
|
||||||
|
mark_as_advanced(JPEG_INCLUDE_DIR JPEG_LIBRARY)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Could not find JPEG on windows")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
find_package(JPEG)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(FindOrBuildPNG)
|
||||||
|
if(BUILD_PNG)
|
||||||
|
add_subdirectory(${CMAKE_SOURCE_DIR}/thirdparty/libpng ${CMAKE_BINARY_DIR}/thirdparty/libpng)
|
||||||
|
set(PNG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/thirdparty/libpng)
|
||||||
|
# find_path(PNG_INCLUDE_DIRS NAMES png.h HINTS ${CMAKE_SOURCE_DIR}/thirdparty/libpng)
|
||||||
|
set(PNG_LIBRARIES png)
|
||||||
|
else()
|
||||||
|
if(WIN32)
|
||||||
|
#findPNG does currently not provide prefix vars. so we find
|
||||||
|
find_path(PNG_INCLUDE_DIRS png.h HINTS ${CMAKE_SOURCE_DIR}/thirdparty/binary/win/include)
|
||||||
|
find_library(PNG_LIBRARIES libpng HINTS ${CMAKE_SOURCE_DIR}/thirdparty/binary/win/lib)
|
||||||
|
|
||||||
|
if (PNG_LIBRARIES AND PNG_INCLUDE_DIRS)
|
||||||
|
set(PNG_FOUND ON)
|
||||||
|
mark_as_advanced(PNG_INCLUDE_DIRS PNG_LIBRARIES)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Could not find PNG on windows")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
find_package(PNG)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(FindOrBuildFreetype)
|
||||||
|
if(PSP)
|
||||||
|
set(ENV{FREETYPE_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/thirdparty/binary/psp/include)
|
||||||
|
set(ENV{FREETYPE_LIBRARIES} freetype)
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(FindOrBuildHgeTools)
|
||||||
|
if(PSP)
|
||||||
|
find_library(HGETOOLS_LIBRARY NAMES hgetools HINTS "${CMAKE_SOURCE_DIR}/thirdparty/binary/psp/lib")
|
||||||
|
set(HGETOOLS_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/thirdparty/binary/psp/include")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(FindOrBuildMikMod)
|
||||||
|
if(PSP)
|
||||||
|
find_library(MIKMOD_LIBRARY NAMES mikmod HINTS "${CMAKE_SOURCE_DIR}/thirdparty/binary/psp/lib")
|
||||||
|
set(MIKMOD_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/thirdparty/binary/psp/include")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(FindOrBuildQt)
|
||||||
|
if(backend_qt_console)
|
||||||
|
add_definitions(-DCONSOLE_CONFIG -DTESTSUITE)
|
||||||
|
find_package(Qt5Core REQUIRED)
|
||||||
|
find_package(Qt5 COMPONENTS Core Network Multimedia REQUIRED)
|
||||||
|
elseif(backend_qt_widget)
|
||||||
|
add_definitions(-DQT_WIDGET)
|
||||||
|
find_package(OpenGL REQUIRED)
|
||||||
|
find_package(X11 REQUIRED)
|
||||||
|
find_package(Qt5 COMPONENTS Core Gui OpenGL Network Multimedia REQUIRED)
|
||||||
|
endif()
|
||||||
|
# include(${QT_USE_FILE})
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(FindOrBuildOpenGL)
|
||||||
|
if(backend_sdl OR backend_qt_console OR backend_qt_widget)
|
||||||
|
if(ANDROID)
|
||||||
|
#find openglesv on android
|
||||||
|
set(OPENGL_LIBRARIES "-ldl -lGLESv1_CM -lGLESv2 -llog -landroid")
|
||||||
|
elseif(EMSCRIPTEN)
|
||||||
|
set(OPENGL_LIBRARIES "")
|
||||||
|
else()
|
||||||
|
find_package(OpenGL)
|
||||||
|
# find_package(GLUT)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(FindOrBuildOpenSL)
|
||||||
|
find_package(OpenSL)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(FindOrBuildPSPSDK)
|
||||||
|
find_package(PSPSDK COMPONENTS psppower pspmpeg pspaudiocodec pspaudiolib pspaudio pspmp3 pspgum pspgu psprtc pspfpu REQUIRED)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
62
CMakeModules/FindPSPSDK.cmake
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
# - Try to find PSPSDK
|
||||||
|
# Once done this will define
|
||||||
|
# PSPSDK_FOUND - System has PSPSDK
|
||||||
|
# PSPSDK_INCLUDE_DIR - The PSPSDK include directories
|
||||||
|
# PSPSDK_LIB - The libraries requested with the components field
|
||||||
|
# PSPSDK_REQUIRED_LIB - The libriries the PSPSDK needs always
|
||||||
|
# PSPSDK_CFLAGS - The CFLAGS to use
|
||||||
|
# PSPSDK_PATH - The output of psp-config --pspsdk-path
|
||||||
|
# PSPSDK_PREFIX - The output of psp-config --psp-prefix
|
||||||
|
# PSPSDK_CXX_COMPILER - The PSPSDK CXX Compilers path
|
||||||
|
# PSPSDK_CXX_LINKER - The PSPSDK CXX Linker command
|
||||||
|
# PSPSDK_FIXUP_IMPORTS_COMMAND - psp-fixup-imports command
|
||||||
|
# PSPSDK_PRXGEN_COMMAND - psp-prxgen command
|
||||||
|
# PSPSDK_PACK_PBP_COMMAND - pack-pbp command
|
||||||
|
# PSPSDK_MKSFO_COMMAND - mksfo command
|
||||||
|
|
||||||
|
#find the psp-config progams absolute path
|
||||||
|
#psp-config needs to be reachable via the system shell (PATH)
|
||||||
|
find_program(PSP_CONFIG_PROGRAM psp-config)
|
||||||
|
|
||||||
|
#TODO: check if something is REQUIRED and throw errors instead of messages
|
||||||
|
if(PSP_CONFIG_PROGRAM)
|
||||||
|
find_program(PSPSDK_CXX_COMPILER psp-g++)
|
||||||
|
find_program(PSPSDK_CXX_LINKER psp-gcc)
|
||||||
|
find_program(PSPSDK_FIXUP_IMPORTS_COMMAND psp-fixup-imports)
|
||||||
|
find_program(PSPSDK_PRXGEN_COMMAND psp-prxgen)
|
||||||
|
find_program(PSPSDK_PACK_PBP_COMMAND pack-pbp)
|
||||||
|
find_program(PSPSDK_MKSFO_COMMAND mksfo)
|
||||||
|
|
||||||
|
#ask psp-config for the
|
||||||
|
execute_process(COMMAND psp-config --pspsdk-path OUTPUT_VARIABLE PSPSDK_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
execute_process(COMMAND psp-config --psp-prefix OUTPUT_VARIABLE PSPSDK_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
set(PSPSDK_INCLUDE_DIR "${PSPSDK_PATH}/include")
|
||||||
|
|
||||||
|
foreach(_COMPONENT ${PSPSDK_FIND_COMPONENTS})
|
||||||
|
find_library(PSPSDK_${_COMPONENT} NAMES ${_COMPONENT})
|
||||||
|
if(NOT PSPSDK_${_COMPONENT})
|
||||||
|
message(SEND_ERROR "PSPSDK: ${_COMPONENT} not found")
|
||||||
|
else()
|
||||||
|
set(PSPSDK_LIB ${PSPSDK_LIB} ${PSPSDK_${_COMPONENT}})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
#find libs which pspsdk does require to link even if the programs does not need one of them directly
|
||||||
|
foreach(_COMPONENT pspdebug pspdisplay pspge pspctrl pspsdk c pspnet pspnet_inet pspnet_apctl pspnet_resolver psputility pspuser)
|
||||||
|
find_library(PSPSDK_${_COMPONENT} NAMES ${_COMPONENT})
|
||||||
|
if(NOT PSPSDK_${_COMPONENT})
|
||||||
|
message(SEND_ERROR "PSPSDK: ${_COMPONENT} not found")
|
||||||
|
else()
|
||||||
|
set(PSPSDK_REQUIRED_LIB ${PSPSDK_REQUIRED_LIB} ${PSPSDK_${_COMPONENT}})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE
|
||||||
|
# if all listed variables are TRUE
|
||||||
|
find_package_handle_standard_args(PSPSDK DEFAULT_MSG
|
||||||
|
PSPSDK_CXX_LINKER PSPSDK_CXX_COMPILER PSPSDK_PATH PSPSDK_PREFIX PSPSDK_LIB PSPSDK_REQUIRED_LIB PSPSDK_INCLUDE_DIR)
|
||||||
|
|
||||||
|
mark_as_advanced(PSPSDK_CXX_LINKER PSPSDK_CXX_COMPILER PSPSDK_PATH PSPSDK_PREFIX PSPSDK_LIB PSPSDK_REQUIRED_LIB PSPSDK_INCLUDE_DIR)
|
||||||
181
CMakeModules/FindSDL2.cmake
Normal file
@@ -0,0 +1,181 @@
|
|||||||
|
|
||||||
|
# Locate SDL2 library
|
||||||
|
# This module defines
|
||||||
|
# SDL2_LIBRARY, the name of the library to link against
|
||||||
|
# SDL2_FOUND, if false, do not try to link to SDL2
|
||||||
|
# SDL2_INCLUDE_DIR, where to find SDL.h
|
||||||
|
#
|
||||||
|
# This module responds to the the flag:
|
||||||
|
# SDL2_BUILDING_LIBRARY
|
||||||
|
# If this is defined, then no SDL2_main will be linked in because
|
||||||
|
# only applications need main().
|
||||||
|
# Otherwise, it is assumed you are building an application and this
|
||||||
|
# module will attempt to locate and set the the proper link flags
|
||||||
|
# as part of the returned SDL2_LIBRARY variable.
|
||||||
|
#
|
||||||
|
# Don't forget to include SDL2main.h and SDL2main.m your project for the
|
||||||
|
# OS X framework based version. (Other versions link to -lSDL2main which
|
||||||
|
# this module will try to find on your behalf.) Also for OS X, this
|
||||||
|
# module will automatically add the -framework Cocoa on your behalf.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration
|
||||||
|
# and no SDL2_LIBRARY, it means CMake did not find your SDL2 library
|
||||||
|
# (SDL2.dll, libsdl2.so, SDL2.framework, etc).
|
||||||
|
# Set SDL2_LIBRARY_TEMP to point to your SDL2 library, and configure again.
|
||||||
|
# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value
|
||||||
|
# as appropriate. These values are used to generate the final SDL2_LIBRARY
|
||||||
|
# variable, but when these values are unset, SDL2_LIBRARY does not get created.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# $SDL2DIR is an environment variable that would
|
||||||
|
# correspond to the ./configure --prefix=$SDL2DIR
|
||||||
|
# used in building SDL2.
|
||||||
|
# l.e.galup 9-20-02
|
||||||
|
#
|
||||||
|
# Modified by Eric Wing.
|
||||||
|
# Added code to assist with automated building by using environmental variables
|
||||||
|
# and providing a more controlled/consistent search behavior.
|
||||||
|
# Added new modifications to recognize OS X frameworks and
|
||||||
|
# additional Unix paths (FreeBSD, etc).
|
||||||
|
# Also corrected the header search path to follow "proper" SDL2 guidelines.
|
||||||
|
# Added a search for SDL2main which is needed by some platforms.
|
||||||
|
# Added a search for threads which is needed by some platforms.
|
||||||
|
# Added needed compile switches for MinGW.
|
||||||
|
#
|
||||||
|
# On OSX, this will prefer the Framework version (if found) over others.
|
||||||
|
# People will have to manually change the cache values of
|
||||||
|
# SDL2_LIBRARY to override this selection or set the CMake environment
|
||||||
|
# CMAKE_INCLUDE_PATH to modify the search paths.
|
||||||
|
#
|
||||||
|
# Note that the header path has changed from SDL2/SDL.h to just SDL.h
|
||||||
|
# This needed to change because "proper" SDL2 convention
|
||||||
|
# is #include "SDL.h", not <SDL2/SDL.h>. This is done for portability
|
||||||
|
# reasons because not all systems place things in SDL2/ (see FreeBSD).
|
||||||
|
#
|
||||||
|
# Ported by Johnny Patterson. This is a literal port for SDL2 of the FindSDL.cmake
|
||||||
|
# module with the minor edit of changing "SDL" to "SDL2" where necessary. This
|
||||||
|
# was not created for redistribution, and exists temporarily pending official
|
||||||
|
# SDL2 CMake modules.
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2003-2009 Kitware, Inc.
|
||||||
|
#
|
||||||
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
# see accompanying file Copyright.txt for details.
|
||||||
|
#
|
||||||
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
# See the License for more information.
|
||||||
|
#=============================================================================
|
||||||
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
|
# License text for the above reference.)
|
||||||
|
|
||||||
|
FIND_PATH(SDL2_INCLUDE_DIR SDL.h
|
||||||
|
HINTS
|
||||||
|
$ENV{SDL2DIR}
|
||||||
|
PATH_SUFFIXES include/SDL2 include
|
||||||
|
PATHS
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/include/SDL2
|
||||||
|
/usr/include/SDL2
|
||||||
|
/sw # Fink
|
||||||
|
/opt/local # DarwinPorts
|
||||||
|
/opt/csw # Blastwave
|
||||||
|
/opt
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(SDL2_LIBRARY_TEMP
|
||||||
|
NAMES SDL2
|
||||||
|
HINTS
|
||||||
|
$ENV{SDL2DIR}
|
||||||
|
PATH_SUFFIXES lib64 lib
|
||||||
|
PATHS
|
||||||
|
/sw
|
||||||
|
/opt/local
|
||||||
|
/opt/csw
|
||||||
|
/opt
|
||||||
|
)
|
||||||
|
|
||||||
|
#MESSAGE("SDL2_LIBRARY_TEMP is ${SDL2_LIBRARY_TEMP}")
|
||||||
|
|
||||||
|
IF(NOT SDL2_BUILDING_LIBRARY)
|
||||||
|
IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
|
||||||
|
# Non-OS X framework versions expect you to also dynamically link to
|
||||||
|
# SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
|
||||||
|
# seem to provide SDL2main for compatibility even though they don't
|
||||||
|
# necessarily need it.
|
||||||
|
FIND_LIBRARY(SDL2MAIN_LIBRARY
|
||||||
|
NAMES SDL2main
|
||||||
|
HINTS
|
||||||
|
$ENV{SDL2DIR}
|
||||||
|
PATH_SUFFIXES lib64 lib
|
||||||
|
PATHS
|
||||||
|
/sw
|
||||||
|
/opt/local
|
||||||
|
/opt/csw
|
||||||
|
/opt
|
||||||
|
)
|
||||||
|
ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
|
||||||
|
ENDIF(NOT SDL2_BUILDING_LIBRARY)
|
||||||
|
|
||||||
|
# SDL2 may require threads on your system.
|
||||||
|
# The Apple build may not need an explicit flag because one of the
|
||||||
|
# frameworks may already provide it.
|
||||||
|
# But for non-OSX systems, I will use the CMake Threads package.
|
||||||
|
IF(NOT APPLE)
|
||||||
|
FIND_PACKAGE(Threads)
|
||||||
|
ENDIF(NOT APPLE)
|
||||||
|
|
||||||
|
# MinGW needs an additional library, mwindows
|
||||||
|
# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -lmwindows
|
||||||
|
# (Actually on second look, I think it only needs one of the m* libraries.)
|
||||||
|
IF(MINGW)
|
||||||
|
SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
|
||||||
|
ENDIF(MINGW)
|
||||||
|
|
||||||
|
SET(SDL2_FOUND "NO")
|
||||||
|
IF(SDL2_LIBRARY_TEMP)
|
||||||
|
# For SDL2main
|
||||||
|
IF(NOT SDL2_BUILDING_LIBRARY)
|
||||||
|
IF(SDL2MAIN_LIBRARY)
|
||||||
|
SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP})
|
||||||
|
ENDIF(SDL2MAIN_LIBRARY)
|
||||||
|
ENDIF(NOT SDL2_BUILDING_LIBRARY)
|
||||||
|
|
||||||
|
# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
|
||||||
|
# CMake doesn't display the -framework Cocoa string in the UI even
|
||||||
|
# though it actually is there if I modify a pre-used variable.
|
||||||
|
# I think it has something to do with the CACHE STRING.
|
||||||
|
# So I use a temporary variable until the end so I can set the
|
||||||
|
# "real" variable in one-shot.
|
||||||
|
IF(APPLE)
|
||||||
|
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
|
||||||
|
ENDIF(APPLE)
|
||||||
|
|
||||||
|
# For threads, as mentioned Apple doesn't need this.
|
||||||
|
# In fact, there seems to be a problem if I used the Threads package
|
||||||
|
# and try using this line, so I'm just skipping it entirely for OS X.
|
||||||
|
IF(NOT APPLE)
|
||||||
|
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
ENDIF(NOT APPLE)
|
||||||
|
|
||||||
|
# For MinGW library
|
||||||
|
IF(MINGW)
|
||||||
|
SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
|
||||||
|
ENDIF(MINGW)
|
||||||
|
|
||||||
|
# Set the final string here so the GUI reflects the final state.
|
||||||
|
SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
|
||||||
|
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
|
||||||
|
SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
|
||||||
|
|
||||||
|
SET(SDL2_FOUND "YES")
|
||||||
|
ENDIF(SDL2_LIBRARY_TEMP)
|
||||||
|
|
||||||
|
INCLUDE(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2
|
||||||
|
REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)
|
||||||
|
mark_as_advanced(SDL2MAIN_LIBRARY SDL2_LIBRARY SDL2_INCLUDE_DIR)
|
||||||
26
CMakeModules/FindTinyXML.cmake
Executable file
@@ -0,0 +1,26 @@
|
|||||||
|
# - Find TinyXML
|
||||||
|
# Find the native TinyXML includes and library
|
||||||
|
#
|
||||||
|
# TINYXML_FOUND - True if TinyXML found.
|
||||||
|
# TINYXML_INCLUDE_DIR - where to find tinyxml.h, etc.
|
||||||
|
# TINYXML_LIBRARIES - List of libraries when using TinyXML.
|
||||||
|
#
|
||||||
|
|
||||||
|
IF( TINYXML_INCLUDE_DIR )
|
||||||
|
# Already in cache, be silent
|
||||||
|
SET( TinyXML_FIND_QUIETLY TRUE )
|
||||||
|
ENDIF( TINYXML_INCLUDE_DIR )
|
||||||
|
|
||||||
|
FIND_PATH( TINYXML_INCLUDE_DIR "tinyxml.h"
|
||||||
|
PATH_SUFFIXES "tinyxml" )
|
||||||
|
|
||||||
|
FIND_LIBRARY( TINYXML_LIBRARIES
|
||||||
|
NAMES "tinyxml"
|
||||||
|
PATH_SUFFIXES "tinyxml" )
|
||||||
|
|
||||||
|
# handle the QUIETLY and REQUIRED arguments and set TINYXML_FOUND to TRUE if
|
||||||
|
# all listed variables are TRUE
|
||||||
|
INCLUDE( "FindPackageHandleStandardArgs" )
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS( "TinyXML" DEFAULT_MSG TINYXML_INCLUDE_DIR TINYXML_LIBRARIES )
|
||||||
|
|
||||||
|
MARK_AS_ADVANCED( TINYXML_INCLUDE_DIR TINYXML_LIBRARIES )
|
||||||
1693
CMakeModules/android.toolchain.cmake
Normal file
48
CMakeModules/ios-theos.toolchain.cmake
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
include(CMakeForceCompiler)
|
||||||
|
|
||||||
|
# this one is important
|
||||||
|
SET(CMAKE_SYSTEM_NAME "Generic")
|
||||||
|
#this one not so much
|
||||||
|
SET(CMAKE_SYSTEM_VERSION 1)
|
||||||
|
|
||||||
|
set (CMAKE_SYSTEM_NAME Generic)
|
||||||
|
|
||||||
|
# Just point to anything that exists.
|
||||||
|
# We don't need CMake to generate proper build files.
|
||||||
|
set(CMAKE_C_COMPILER ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
set(CMAKE_CXX_COMPILER ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
|
# Skip the platform compiler checks
|
||||||
|
set (CMAKE_CXX_COMPILER_WORKS TRUE)
|
||||||
|
set (CMAKE_C_COMPILER_WORKS TRUE)
|
||||||
|
|
||||||
|
#how libraries look
|
||||||
|
SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
|
||||||
|
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
|
||||||
|
|
||||||
|
SET(CMAKE_SYSTEM_INCLUDE_PATH
|
||||||
|
${THEOS_PATH}/include
|
||||||
|
${CMAKE_INSTALL_PREFIX}/include
|
||||||
|
${CMAKE_SYSTEM_INCLUDE_PATH})
|
||||||
|
|
||||||
|
# where is the target environment
|
||||||
|
SET(CMAKE_SYSTEM_LIBRARY_PATH
|
||||||
|
${THEOS_PATH}/lib
|
||||||
|
${CMAKE_INSTALL_PREFIX}/lib
|
||||||
|
${CMAKE_SYSTEM_LIBRARY_PATH})
|
||||||
|
|
||||||
|
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH
|
||||||
|
${CMAKE_SOURCE_DIR}
|
||||||
|
${THEOS_PATH}
|
||||||
|
${THEOS_PATH}/lib
|
||||||
|
${THEOS_PATH}/include
|
||||||
|
)
|
||||||
|
|
||||||
|
# search for programs in the build host directories
|
||||||
|
# for libraries and headers in the target directories and then in the host
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY FIRST)
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE FIRST)
|
||||||
|
|
||||||
|
set(IOS 1)
|
||||||
62
CMakeModules/psp.toolchain.cmake
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
include(CMakeForceCompiler)
|
||||||
|
|
||||||
|
# this one is important
|
||||||
|
SET(CMAKE_SYSTEM_NAME "Generic")
|
||||||
|
#this one not so much
|
||||||
|
SET(CMAKE_SYSTEM_VERSION 1)
|
||||||
|
|
||||||
|
find_program(PSP_CONFIG_PROGRAM psp-config)
|
||||||
|
|
||||||
|
execute_process(COMMAND psp-config --pspsdk-path OUTPUT_VARIABLE PSPSDK_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
execute_process(COMMAND psp-config --psp-prefix OUTPUT_VARIABLE PSPSDK_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
# specify compiler and linker:
|
||||||
|
find_program(PSP_GPP psp-g++)
|
||||||
|
find_program(PSP_GCC psp-gcc)
|
||||||
|
|
||||||
|
CMAKE_FORCE_C_COMPILER(${PSP_GCC} GNU)
|
||||||
|
CMAKE_FORCE_CXX_COMPILER(${PSP_GPP} GNU)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -G0")
|
||||||
|
|
||||||
|
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
|
||||||
|
set(CMAKE_CXX_LINK_EXECUTABLE "${PSP_GCC} <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||||
|
|
||||||
|
#how libraries look
|
||||||
|
SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
|
||||||
|
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
|
||||||
|
|
||||||
|
# where is the target environment
|
||||||
|
SET(CMAKE_SYSTEM_INCLUDE_PATH
|
||||||
|
${CMAKE_SOURCE_DIR}/thirdparty/binary/psp/include
|
||||||
|
${PSPSDK_PATH}/include
|
||||||
|
${PSPSDK_PREFIX}/include
|
||||||
|
${CMAKE_INSTALL_PREFIX}/include
|
||||||
|
${CMAKE_SYSTEM_INCLUDE_PATH})
|
||||||
|
|
||||||
|
SET(CMAKE_SYSTEM_LIBRARY_PATH
|
||||||
|
${CMAKE_SOURCE_DIR}/thirdparty/binary/psp/lib
|
||||||
|
${PSPSDK_PATH}/lib
|
||||||
|
${PSPSDK_PREFIX}/lib
|
||||||
|
${CMAKE_INSTALL_PREFIX}/lib
|
||||||
|
${CMAKE_SYSTEM_LIBRARY_PATH})
|
||||||
|
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH
|
||||||
|
${CMAKE_SOURCE_DIR}/thirdparty/binary/psp
|
||||||
|
${CMAKE_SOURCE_DIR}/thirdparty/binary/psp/lib
|
||||||
|
${CMAKE_SOURCE_DIR}/thirdparty/binary/psp/include
|
||||||
|
${PSPSDK_PATH}
|
||||||
|
${PSPSDK_PATH}/lib
|
||||||
|
${PSPSDK_PATH}/include
|
||||||
|
${PSPSDK_PREFIX}
|
||||||
|
${PSPSDK_PREFIX}/lib
|
||||||
|
${PSPSDK_PREFIX}/include
|
||||||
|
)
|
||||||
|
|
||||||
|
# search for programs in the build host directories
|
||||||
|
# for libraries and headers in the target directories and then in the host
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY FIRST)
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE FIRST)
|
||||||
|
|
||||||
|
set(PSP 1)
|
||||||
57
CMakeModules/utils.cmake
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
macro(WAGIC_OPTION variable description value)
|
||||||
|
set(__value ${value})
|
||||||
|
set(__condition "")
|
||||||
|
set(__varname "__value")
|
||||||
|
foreach(arg ${ARGN})
|
||||||
|
if(arg STREQUAL "IF" OR arg STREQUAL "if")
|
||||||
|
set(__varname "__condition")
|
||||||
|
else()
|
||||||
|
list(APPEND ${__varname} ${arg})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
unset(__varname)
|
||||||
|
if("${__condition}" STREQUAL "")
|
||||||
|
set(__condition 2 GREATER 1)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(${__condition})
|
||||||
|
if("${__value}" MATCHES ";")
|
||||||
|
if(${__value})
|
||||||
|
option(${variable} "${description}" ON)
|
||||||
|
else()
|
||||||
|
option(${variable} "${description}" OFF)
|
||||||
|
endif()
|
||||||
|
elseif(DEFINED ${__value})
|
||||||
|
if(${__value})
|
||||||
|
option(${variable} "${description}" ON)
|
||||||
|
else()
|
||||||
|
option(${variable} "${description}" OFF)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
option(${variable} "${description}" ${__value})
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
unset(${variable} CACHE)
|
||||||
|
endif()
|
||||||
|
unset(__condition)
|
||||||
|
unset(__value)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
# add prefix to each item in the list
|
||||||
|
macro(list_add_prefix LST PREFIX)
|
||||||
|
set(__tmp "")
|
||||||
|
foreach(item ${${LST}})
|
||||||
|
list(APPEND __tmp "${PREFIX}${item}")
|
||||||
|
endforeach()
|
||||||
|
set(${LST} ${__tmp})
|
||||||
|
unset(__tmp)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
|
||||||
|
macro(find_host_program)
|
||||||
|
set(_find_program ${CMAKE_FIND_ROOT_PATH_MODE_PROGRAM})
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
find_program(${ARGN})
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ${_find_program})
|
||||||
|
unset(_find_program)
|
||||||
|
endmacro()
|
||||||
165
JGE/CMakeLists.txt
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
#the sources, jge will need always
|
||||||
|
set(JGE_generic_src
|
||||||
|
src/Encoding.cpp
|
||||||
|
src/JAnimator.cpp
|
||||||
|
src/JApp.cpp
|
||||||
|
src/JDistortionMesh.cpp
|
||||||
|
src/JFileSystem.cpp
|
||||||
|
src/JGameObject.cpp
|
||||||
|
src/JGE.cpp
|
||||||
|
src/JGui.cpp
|
||||||
|
src/JLogger.cpp
|
||||||
|
src/JLBFont.cpp
|
||||||
|
src/JOBJModel.cpp
|
||||||
|
src/JParticle.cpp
|
||||||
|
src/JParticleEffect.cpp
|
||||||
|
src/JParticleEmitter.cpp
|
||||||
|
src/JParticleSystem.cpp
|
||||||
|
src/JResourceManager.cpp
|
||||||
|
src/JSpline.cpp
|
||||||
|
src/JSprite.cpp
|
||||||
|
src/Vector2D.cpp)
|
||||||
|
|
||||||
|
set(JGE_hge_src
|
||||||
|
src/hge/hgecolor.cpp
|
||||||
|
src/hge/hgedistort.cpp
|
||||||
|
src/hge/hgefont.cpp
|
||||||
|
src/hge/hgeparticle.cpp
|
||||||
|
src/hge/hgerect.cpp
|
||||||
|
src/hge/hgevector.cpp)
|
||||||
|
|
||||||
|
#the sources we need to get graphical output desktops
|
||||||
|
#used by qt-widget build option
|
||||||
|
set(JGE_graphics_src
|
||||||
|
src/Downloader.cpp
|
||||||
|
include/Downloader.h
|
||||||
|
src/JMD2Model.cpp
|
||||||
|
src/pc/JGfx.cpp)
|
||||||
|
|
||||||
|
#the sources we need to fake graphical output on desktops
|
||||||
|
#these are used for the console-only testsuit
|
||||||
|
set(JGE_console_src
|
||||||
|
src/OutputCapturer.cpp
|
||||||
|
src/JGfx-fake.cpp)
|
||||||
|
|
||||||
|
#the sources we need on linux
|
||||||
|
set(JGE_linux_src
|
||||||
|
src/JNetwork.cpp
|
||||||
|
src/pc/JSocket.cpp
|
||||||
|
src/pc/JSfx.cpp)
|
||||||
|
|
||||||
|
set(JGE_android_src
|
||||||
|
src/JNetwork.cpp
|
||||||
|
src/JSocket.cpp
|
||||||
|
src/android/JSfx.cpp)
|
||||||
|
|
||||||
|
#the sources we need if we compile for psp
|
||||||
|
#note: main.cpp contains the main-function.
|
||||||
|
#the other main functions reside in projects/mtg to reduce cross-library dependencies.
|
||||||
|
#there may be a way to get all main-functions into the same project
|
||||||
|
set(JGE_psp_src
|
||||||
|
src/JNetwork.cpp
|
||||||
|
src/JSocket.cpp
|
||||||
|
src/JGfx.cpp
|
||||||
|
src/JSfx.cpp
|
||||||
|
src/JAudio.cpp
|
||||||
|
src/JMP3.cpp
|
||||||
|
src/decoder_prx.cpp
|
||||||
|
src/main.cpp
|
||||||
|
src/vram.cpp)
|
||||||
|
|
||||||
|
set(JGE_ios_src
|
||||||
|
src/iOS/main.m
|
||||||
|
src/iOS/wagicAppDelegate.m
|
||||||
|
src/iOS/ES2Renderer.m
|
||||||
|
src/iOS/EAGLView.m
|
||||||
|
src/iOS/EAGLViewController.m
|
||||||
|
src/iOS/JSfx.cpp)
|
||||||
|
|
||||||
|
set(JGE_windows_src
|
||||||
|
src/JNetwork.cpp
|
||||||
|
src/pc/JSocket.cpp
|
||||||
|
src/windows/JSfx.cpp)
|
||||||
|
|
||||||
|
set(JGE_INCLUDE_DIRS include include/hge)
|
||||||
|
set(EXTRA_INCLUDE_DIR ../projects/mtg/extra)
|
||||||
|
|
||||||
|
#turn moc on
|
||||||
|
if(backend_qt_console OR backend_qt_widget)
|
||||||
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
set(CMAKE_AUTOMOC TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if(backend_qt_console)
|
||||||
|
if(UNIX AND NOT ANDROID)
|
||||||
|
set(JGE_INTERNAL_INCLUDE_DIRS ${TINYXML_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR}
|
||||||
|
${UNZIP_INCLUDE_DIR} ${QT_MKSPECS_DIR}/default ${Qt5Core_INCLUDE_DIRS} ${Qt5Multimedia_INCLUDE_DIRS})
|
||||||
|
set(JGE_SOURCES ${JGE_generic_src} ${JGE_console_src} ${JGE_linux_src} ${JGE_hge_src})
|
||||||
|
set(JGE_LINK_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Multimedia_LIBRARIES} ${ZIPFS_LIBRARY} ${UNZIP_LIRARY}
|
||||||
|
${JPEG_LIBRARIES} ${PNG_LIBRARIES})
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "qt builds of jge platforms other than linux are not supported")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(backend_qt_widget)
|
||||||
|
if(UNIX AND NOT ANDROID)
|
||||||
|
set(JGE_INTERNAL_INCLUDE_DIRS ${TINYXML_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR}
|
||||||
|
${UNZIP_INCLUDE_DIR} ${QT_MKSPECS_DIR}/default ${Qt5Core_INCLUDE_DIRS} ${Qt5Multimedia_INCLUDE_DIRS} ${Qt5OpenGL_INCLUDE_DIRS} )
|
||||||
|
set(JGE_SOURCES ${JGE_generic_src} ${JGE_graphics_src} ${JGE_linux_src} ${JGE_hge_src})
|
||||||
|
set(JGE_LINK_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Multimedia_LIBRARIES} ${Qt5OpenGL_LIBRARIES} ${ZIPFS_LIBRARY} ${UNZIP_LIRARY}
|
||||||
|
${JPEG_LIBRARIES} ${PNG_LIBRARIES})
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "qt builds of jge platforms other than linux are not supported")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(backend_sdl)
|
||||||
|
if((UNIX OR EMSCRIPTEN) AND NOT ANDROID)
|
||||||
|
set(JGE_INTERNAL_INCLUDE_DIRS ${TINYXML_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIR}
|
||||||
|
${SDL2_INCLUDE_DIR} ${UNZIP_INCLUDE_DIR} ${PNG_INCLUDE_DIRS} ${JPEG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS})
|
||||||
|
set(JGE_SOURCES ${JGE_generic_src} ${JGE_graphics_src} ${JGE_linux_src} ${JGE_hge_src})
|
||||||
|
set(JGE_LINK_LIBRARIES ${ZIPFS_LIBRARY} ${UNZIP_LIRARY} ${JPEG_LIBRARY}
|
||||||
|
${PNG_LIBRARIES} ${OPENGL_LIBRARIES} ${GLUT_LIBRARY})
|
||||||
|
elseif(ANDROID)
|
||||||
|
set(JGE_INTERNAL_INCLUDE_DIRS ${BOOST_INCLUDE_DIRS} ${TINYXML_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR}
|
||||||
|
${SDL2_INCLUDE_DIR} ${UNZIP_INCLUDE_DIR} ${PNG_INCLUDE_DIRS} ${JPEG_INCLUDE_DIR}
|
||||||
|
${OPENSL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS})
|
||||||
|
set(JGE_SOURCES ${JGE_generic_src} ${JGE_android_src} ${JGE_graphics_src} ${JGE_hge_src})
|
||||||
|
set(JGE_LINK_LIBRARIES ${ZIPFS_LIBRARY} ${UNZIP_LIRARY} ${JPEG_LIBRARY} ${PNG_LIBRARIES}
|
||||||
|
${OPENSL_LIBRARIES})
|
||||||
|
elseif(WIN32)
|
||||||
|
set(JGE_INTERNAL_INCLUDE_DIRS ${EXTRA_INCLUDE_DIR} ${TINYXML_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR} ${SDL2_INCLUDE_DIR}
|
||||||
|
${UNZIP_INCLUDE_DIR} ${PNG_INCLUDE_DIRS} ${JPEG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/thirdparty/binary/win/include)
|
||||||
|
set(JGE_SOURCES ${JGE_generic_src} ${JGE_graphics_src} ${JGE_windows_src} ${JGE_hge_src})
|
||||||
|
set(JGE_LINK_LIBRARIES ${ZIPFS_LIBRARY} ${UNZIP_LIRARY} ${JPEG_LIBRARY} ${PNG_LIBRARIES})
|
||||||
|
set(JGE_LINK_DIRECTORIES ${Boost_LIBRARY_DIR})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(backend_psp)
|
||||||
|
if(PSP)
|
||||||
|
#${PSPSDK_PATH}/include should be in system pathes
|
||||||
|
set(JGE_INTERNAL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/thirdparty/psp/include ${TINYXML_INCLUDE_DIR}
|
||||||
|
${ZIPFS_INCLUDE_DIR} ${UNZIP_INCLUDE_DIR} ${BOOST_INCLUDE_DIRS} ${GIF_INCLUDE_DIR} ${PNG_INCLUDE_DIRS} )
|
||||||
|
set(JGE_SOURCES ${JGE_generic_src} ${JGE_psp_src} ${JGE_hge_src})
|
||||||
|
set(JGE_LINK_LIBRARIES ${TINYXML_LIBRARIES} ${ZIPFS_LIBRARY} ${UNZIP_LIRARY})
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "use the cross-compile toolchain to build as the psp target")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(IOS)
|
||||||
|
set(JGE_SOURCES ${JGE_generic_src} ${JGE_ios_src} ${JGE_hge_src} src/pc/JGfx.cpp)
|
||||||
|
set(JGE_SOURCES ${JGE_SOURCES} PARENT_SCOPE)
|
||||||
|
set(JGE_INCLUDE_DIRS ${JGE_INCLUDE_DIRS} src/iOS PARENT_SCOPE)
|
||||||
|
set(JGE_LINK_LIBRARIES ${TINYXML_LIBRARIES} ${ZIPFS_LIBRARY} ${UNZIP_LIRARY})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_library(jge STATIC ${JGE_SOURCES})
|
||||||
|
include_directories(${JGE_INTERNAL_INCLUDE_DIRS} ${JGE_INCLUDE_DIRS})
|
||||||
|
target_link_libraries(jge ${JGE_LINK_LIBRARIES})
|
||||||
|
link_directories(${JGE_LINK_DIRECTORIES})
|
||||||
|
|
||||||
|
set(${JGE_LIBRARIES} jge)
|
||||||
@@ -32,6 +32,7 @@ HGE_OBJS = src/hge/hgecolor.o src/hge/hgeparticle.o \
|
|||||||
|
|
||||||
CXXFLAGS = -W -Wall -Werror -Wno-unused
|
CXXFLAGS = -W -Wall -Werror -Wno-unused
|
||||||
CXXFLAGS += -DTIXML_USE_STL
|
CXXFLAGS += -DTIXML_USE_STL
|
||||||
|
CXXFLAGS += -Wno-deprecated-declarations -Wno-sign-compare
|
||||||
|
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
CXXFLAGS += -ggdb3
|
CXXFLAGS += -ggdb3
|
||||||
@@ -82,7 +83,7 @@ ifeq ($(TARGET_ARCHITECTURE),linux)
|
|||||||
OBJS = $(GENERIC_OBJS) $(LINUX_OBJS)
|
OBJS = $(GENERIC_OBJS) $(LINUX_OBJS)
|
||||||
TARGET_LIB = libjge.a
|
TARGET_LIB = libjge.a
|
||||||
TARGET_HGE = libhgetools.a
|
TARGET_HGE = libhgetools.a
|
||||||
INCDIR = $(shell freetype-config --cflags 2> /dev/null) -I/usr/X11/include -I../Boost -Isrc/zipFS -Iinclude/
|
INCDIR = $(shell freetype-config --cflags 2> /dev/null) -I/usr/X11/include -I/usr/include/boost -Isrc/zipFS -Iinclude/
|
||||||
CXXFLAGS += -DLINUX $(FMOD)
|
CXXFLAGS += -DLINUX $(FMOD)
|
||||||
CXXFLAGS += $(INCDIR)
|
CXXFLAGS += $(INCDIR)
|
||||||
LIBDIR = lib/linux
|
LIBDIR = lib/linux
|
||||||
|
|||||||
@@ -18,13 +18,14 @@ using namespace std;
|
|||||||
template <class T>
|
template <class T>
|
||||||
std::string ToHex(T* pointer)
|
std::string ToHex(T* pointer)
|
||||||
{
|
{
|
||||||
std::ostringstream stream;
|
std::ostringstream stream;
|
||||||
stream << hex << showbase << setfill('0') << setw(8) << (uint64_t) pointer;
|
stream << hex << showbase << setfill('0') << setw(8) << (uint64_t) pointer;
|
||||||
return stream.str();
|
return stream.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
#define OutputDebugString(val) (std::cerr << val);
|
#define OutputDebugString(val) (std::cerr << val);
|
||||||
|
#define OutputDebugStringA(val) (std::cerr << val);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
@@ -42,9 +43,9 @@ std::string ToHex(T* pointer)
|
|||||||
#else // CAPTURE_STDERR
|
#else // CAPTURE_STDERR
|
||||||
#define DebugTrace(inString) \
|
#define DebugTrace(inString) \
|
||||||
{ \
|
{ \
|
||||||
std::ostringstream stream; \
|
std::ostringstream stream; \
|
||||||
stream << inString; \
|
stream << inString; \
|
||||||
qDebug("%s", stream.str().c_str()); \
|
qDebug("%s", stream.str().c_str()); \
|
||||||
}
|
}
|
||||||
#endif // CAPTURE_STDERR
|
#endif // CAPTURE_STDERR
|
||||||
|
|
||||||
@@ -52,16 +53,16 @@ std::string ToHex(T* pointer)
|
|||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
#define DebugTrace(inString) \
|
#define DebugTrace(inString) \
|
||||||
{ \
|
{ \
|
||||||
std::ostringstream stream; \
|
std::ostringstream stream; \
|
||||||
stream << inString; \
|
stream << inString; \
|
||||||
__android_log_write(ANDROID_LOG_DEBUG, "Wagic", stream.str().c_str());\
|
__android_log_write(ANDROID_LOG_DEBUG, "Wagic", stream.str().c_str());\
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define DebugTrace(inString) \
|
#define DebugTrace(inString) \
|
||||||
{ \
|
{ \
|
||||||
std::ostringstream stream; \
|
std::ostringstream stream; \
|
||||||
stream << inString << std::endl; \
|
stream << inString << std::endl; \
|
||||||
OutputDebugStringA(stream.str().c_str()); \
|
OutputDebugStringA(stream.str().c_str()); \
|
||||||
}
|
}
|
||||||
#endif // QT_CONFIG
|
#endif // QT_CONFIG
|
||||||
#endif // Win32, Linux
|
#endif // Win32, Linux
|
||||||
@@ -71,7 +72,7 @@ std::string ToHex(T* pointer)
|
|||||||
#ifndef DebugTrace
|
#ifndef DebugTrace
|
||||||
#define DebugTrace(inString) \
|
#define DebugTrace(inString) \
|
||||||
{ \
|
{ \
|
||||||
std::cerr << inString << std::endl; \
|
std::cerr << inString << std::endl; \
|
||||||
}
|
}
|
||||||
#endif //DEBUG
|
#endif //DEBUG
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
134
JGE/include/Downloader.h
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
#ifndef DOWNLOADER_H
|
||||||
|
#define DOWNLOADER_H
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This class handles download of remote resources (any kind of file)
|
||||||
|
// All the resources are stored locally in the userPath
|
||||||
|
// For every resources, the downloader verifies if the resource was modifed
|
||||||
|
// on the server before downloading the update. The Downloader maintains a catalogue
|
||||||
|
// of resource downloaded to be able to check if they need to be updated.
|
||||||
|
//
|
||||||
|
// The interface can be used completly synchronously by the application and some
|
||||||
|
// context or message loop is needed in the implementation of this interface
|
||||||
|
//
|
||||||
|
// Note that the Downloader could in theory by implemented on top of JNetwork.
|
||||||
|
//
|
||||||
|
//-------------------------------------------------------------------------------------
|
||||||
|
#include <string>
|
||||||
|
#include <ostream>
|
||||||
|
#include <istream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <map>
|
||||||
|
#include "Threading.h"
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
#include <QObject>
|
||||||
|
#include <QNetworkRequest>
|
||||||
|
#include <QNetworkReply>
|
||||||
|
#include <QNetworkAccessManager>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
class DownloadRequest
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
: public QObject
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
#endif
|
||||||
|
void fileDownloaded();
|
||||||
|
void downloadProgress(int64_t bytesReceived, int64_t bytesTotal);
|
||||||
|
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
signals:
|
||||||
|
void percentChanged(int percent);
|
||||||
|
void statusChanged(int);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public:
|
||||||
|
typedef enum {
|
||||||
|
NOT_PRESENT,
|
||||||
|
DOWNLOADING,
|
||||||
|
DOWNLOADED,
|
||||||
|
DOWNLOAD_ERROR
|
||||||
|
} DownloadStatus;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
string mLocalPath;
|
||||||
|
string mRemoteResourceURL;
|
||||||
|
// previous one is the original, next one can change after redirection
|
||||||
|
string mRequestedRemoteResourceURL;
|
||||||
|
string mETag;
|
||||||
|
DownloadStatus mDownloadStatus;
|
||||||
|
bool mUpgradeAvailable;
|
||||||
|
size_t mTotalSize;
|
||||||
|
size_t mCurrentSize;
|
||||||
|
ofstream mFile;
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
QNetworkReply* mNetworkReply;
|
||||||
|
static QNetworkAccessManager networkAccessManager;
|
||||||
|
#endif
|
||||||
|
#ifdef __EMSCRIPTEN__
|
||||||
|
static void onLoadCb(unsigned int handle, DownloadRequest* req, const char *buffer, unsigned int size);
|
||||||
|
static void onErrorCb(unsigned int handle, DownloadRequest* req, int errorCode, const char* errorText);
|
||||||
|
static void onProgressCb(unsigned int handle, DownloadRequest* req, int bytesReceived, int bytesTotal);
|
||||||
|
#endif
|
||||||
|
void processError(int errorCode, const char* errorText);
|
||||||
|
void processBufferDownloaded(unsigned int size, const char*buffer);
|
||||||
|
|
||||||
|
public:
|
||||||
|
DownloadRequest(string localPath="",
|
||||||
|
string remoteResourceURL="",
|
||||||
|
string ETag = "",
|
||||||
|
DownloadStatus downloadStatus=NOT_PRESENT,
|
||||||
|
size_t totalSize = 0,
|
||||||
|
size_t currentSize = 0);
|
||||||
|
~DownloadRequest();
|
||||||
|
static bool NetworkIsAccessible();
|
||||||
|
|
||||||
|
string getTempLocalPath() const { return (mLocalPath+".tmp"); };
|
||||||
|
string getLocalPath() const { return mLocalPath; };
|
||||||
|
string getRemoteResource() const { return mRemoteResourceURL; };
|
||||||
|
string getETag() const { return mETag; };
|
||||||
|
void startGet();
|
||||||
|
void startHead();
|
||||||
|
DownloadStatus getDownloadStatus() const { return mDownloadStatus; };
|
||||||
|
bool upgradeAvailable() const { return mUpgradeAvailable; };
|
||||||
|
void getSizes(size_t& totalSize, size_t¤tSize) {
|
||||||
|
totalSize = mTotalSize;
|
||||||
|
currentSize = mCurrentSize;
|
||||||
|
};
|
||||||
|
|
||||||
|
friend ostream& operator<<(ostream& out, const DownloadRequest& d);
|
||||||
|
friend istream& operator>>(istream&, DownloadRequest&);
|
||||||
|
friend class Downloader;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class Downloader
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
Downloader(string globalRemoteURL="", string localCacheRecords="");
|
||||||
|
virtual ~Downloader();
|
||||||
|
static Downloader* mInstance;
|
||||||
|
string mGlobalRemoteURL;
|
||||||
|
string mLocalCacheRecords;
|
||||||
|
boost::mutex mMutex;
|
||||||
|
map<string, DownloadRequest*> mRequestMap;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Downloader* GetInstance();
|
||||||
|
static void Release();
|
||||||
|
|
||||||
|
void Update();
|
||||||
|
DownloadRequest* Get(string localPath, string remoteResourceURL="");
|
||||||
|
|
||||||
|
friend ostream& operator<<(ostream& out, const Downloader& d);
|
||||||
|
friend istream& operator>>(istream&, Downloader&);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DOWNLOADER_H
|
||||||
@@ -297,7 +297,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
float mTimer;
|
float mTimer;
|
||||||
float mFrameTime;
|
float mFrameTime;
|
||||||
JAnimator* mAnimator;
|
|
||||||
vector<JAnimatorObject *> mObjects;
|
vector<JAnimatorObject *> mObjects;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ private:
|
|||||||
float mTexY;
|
float mTexY;
|
||||||
float mTexWidth;
|
float mTexWidth;
|
||||||
float mTexHeight;
|
float mTexHeight;
|
||||||
JTexture* mTexture;
|
|
||||||
JQuad* mQuad;
|
JQuad* mQuad;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -128,6 +128,7 @@ public:
|
|||||||
bool readIntoString(const string & FilePath, string & target);
|
bool readIntoString(const string & FilePath, string & target);
|
||||||
bool openForWrite(ofstream & File, const string & FilePath, ios_base::openmode mode = ios_base::out );
|
bool openForWrite(ofstream & File, const string & FilePath, ios_base::openmode mode = ios_base::out );
|
||||||
bool Rename(string from, string to);
|
bool Rename(string from, string to);
|
||||||
|
bool Remove(string aFile);
|
||||||
|
|
||||||
//Returns true if strFilename exists somewhere in the fileSystem
|
//Returns true if strFilename exists somewhere in the fileSystem
|
||||||
bool FileExists(const string& strFilename);
|
bool FileExists(const string& strFilename);
|
||||||
@@ -163,4 +164,4 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ typedef u32 LocalKeySym;
|
|||||||
|
|
||||||
#elif defined(SDL_CONFIG)
|
#elif defined(SDL_CONFIG)
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
typedef SDLKey LocalKeySym;
|
typedef SDL_Keycode LocalKeySym;
|
||||||
#define LOCAL_KEY_NONE SDLK_UNKNOWN
|
#define LOCAL_KEY_NONE SDLK_UNKNOWN
|
||||||
|
|
||||||
#elif defined(WIN32)
|
#elif defined(WIN32)
|
||||||
|
|||||||
@@ -178,8 +178,6 @@ private:
|
|||||||
float mSpacing;
|
float mSpacing;
|
||||||
|
|
||||||
PIXEL_TYPE mColor;
|
PIXEL_TYPE mColor;
|
||||||
int mBlend;
|
|
||||||
|
|
||||||
int mBase;
|
int mBase;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#if (!defined IOS) && (!defined ANDROID) && (!defined QT_CONFIG)
|
#if (!defined IOS) && (!defined ANDROID) && (!defined QT_CONFIG) && (!defined SDL_CONFIG)
|
||||||
#include <gif_lib.h>
|
#include <gif_lib.h>
|
||||||
#endif //IOS ANDROID
|
#endif //IOS ANDROID
|
||||||
|
|
||||||
@@ -567,7 +567,7 @@ private:
|
|||||||
#if (!defined IOS) && (!defined QT_CONFIG)
|
#if (!defined IOS) && (!defined QT_CONFIG)
|
||||||
void LoadJPG(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT);
|
void LoadJPG(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT);
|
||||||
int LoadPNG(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT);
|
int LoadPNG(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT);
|
||||||
#if (!defined ANDROID) && (!defined QT_CONFIG)
|
#if (!defined ANDROID) && (!defined QT_CONFIG) && (!defined SDL_CONFIG)
|
||||||
void LoadGIF(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT);
|
void LoadGIF(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT);
|
||||||
int image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bgcolor, InputFunc readFunc,int mode = 0, int TextureFormat = TEXTURE_FORMAT);
|
int image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bgcolor, InputFunc readFunc,int mode = 0, int TextureFormat = TEXTURE_FORMAT);
|
||||||
#endif // (ANDROID) How can we get gif support for android ?
|
#endif // (ANDROID) How can we get gif support for android ?
|
||||||
@@ -598,8 +598,6 @@ private:
|
|||||||
GLint prog2_positionLoc;
|
GLint prog2_positionLoc;
|
||||||
GLint prog2_texCoordLoc;
|
GLint prog2_texCoordLoc;
|
||||||
GLint prog2_colorLoc;
|
GLint prog2_colorLoc;
|
||||||
// MVP matrix
|
|
||||||
ESMatrix prog2_mvpMatrix;
|
|
||||||
// Uniform locations
|
// Uniform locations
|
||||||
GLint prog2_mvpLoc;
|
GLint prog2_mvpLoc;
|
||||||
|
|
||||||
@@ -612,13 +610,11 @@ private:
|
|||||||
int mCurrentTextureFormat;
|
int mCurrentTextureFormat;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PSP
|
||||||
bool mVsync;
|
bool mVsync;
|
||||||
|
int mTexCounter;
|
||||||
|
#endif
|
||||||
int mSwizzle;
|
int mSwizzle;
|
||||||
int mTexCounter;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int mCurrentTextureFilter;
|
int mCurrentTextureFilter;
|
||||||
|
|
||||||
int mCurrTexBlendSrc;
|
int mCurrTexBlendSrc;
|
||||||
|
|||||||
@@ -18,33 +18,37 @@
|
|||||||
|
|
||||||
#include "JTypes.h"
|
#include "JTypes.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
#include <SLES/OpenSLES.h>
|
#include <SLES/OpenSLES.h>
|
||||||
#include "SLES/OpenSLES_Android.h"
|
#include "SLES/OpenSLES_Android.h"
|
||||||
|
#elif defined(USE_PHONON)
|
||||||
#elif defined USE_PHONON
|
#include <phonon/AudioOutput>
|
||||||
#include <phonon/AudioOutput>
|
#include <phonon/MediaObject>
|
||||||
#include <phonon/MediaObject>
|
#elif defined (QT_CONFIG)
|
||||||
#elif defined WIN32
|
#include "QMediaPlayer"
|
||||||
#include <windows.h>
|
#include "QMediaPlaylist"
|
||||||
#define WITH_FMOD
|
#include "QSoundEffect"
|
||||||
|
#elif defined(WIN32)
|
||||||
|
#include <windows.h>
|
||||||
|
//#define WITH_FMOD
|
||||||
#elif defined (PSP)
|
#elif defined (PSP)
|
||||||
#include <pspgu.h>
|
#include <pspgu.h>
|
||||||
#include <pspkernel.h>
|
#include <pspkernel.h>
|
||||||
#include <pspdisplay.h>
|
#include <pspdisplay.h>
|
||||||
#include <pspdebug.h>
|
#include <pspdebug.h>
|
||||||
#include <pspctrl.h>
|
#include <pspctrl.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <pspaudiolib.h>
|
#include <pspaudiolib.h>
|
||||||
#include <psprtc.h>
|
#include <psprtc.h>
|
||||||
|
|
||||||
#include "JAudio.h"
|
#include "JAudio.h"
|
||||||
#include "JMP3.h"
|
#include "JMP3.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WITH_FMOD
|
#ifdef WITH_FMOD
|
||||||
#include "../Dependencies/include/fmod.h"
|
#include "fmod.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
@@ -67,7 +71,7 @@ public:
|
|||||||
#ifdef USE_PHONON
|
#ifdef USE_PHONON
|
||||||
Phonon::AudioOutput* mOutput;
|
Phonon::AudioOutput* mOutput;
|
||||||
Phonon::MediaObject* mMediaObject;
|
Phonon::MediaObject* mMediaObject;
|
||||||
public slots:
|
public slots:
|
||||||
void seekAtTheBegining();
|
void seekAtTheBegining();
|
||||||
#elif defined (PSP)
|
#elif defined (PSP)
|
||||||
JMP3* mTrack;
|
JMP3* mTrack;
|
||||||
@@ -75,16 +79,26 @@ public:
|
|||||||
std::string filename;
|
std::string filename;
|
||||||
std::string key;
|
std::string key;
|
||||||
std::string ext;
|
std::string ext;
|
||||||
|
void* mTrack;
|
||||||
#elif defined WITH_FMOD
|
#elif defined WITH_FMOD
|
||||||
FSOUND_SAMPLE* mTrack; // MP3 needed to be of "sample" type for FMOD, FMUSIC_MODULE is for MODs
|
FSOUND_SAMPLE* mTrack; // MP3 needed to be of "sample" type for FMOD, FMUSIC_MODULE is for MODs
|
||||||
|
void* mTrack;
|
||||||
#elif defined ANDROID
|
#elif defined ANDROID
|
||||||
SLObjectItf playerObject;
|
SLObjectItf playerObject;
|
||||||
SLPlayItf playInterface;
|
SLPlayItf playInterface;
|
||||||
SLSeekItf seekInterface;
|
SLSeekItf seekInterface;
|
||||||
SLVolumeItf musicVolumeInterface;
|
SLVolumeItf musicVolumeInterface;
|
||||||
#else
|
void* mTrack;
|
||||||
void* mTrack;
|
#elif (defined QT_CONFIG)
|
||||||
#endif //WITH_FMOD
|
QMediaPlaylist* playlist;
|
||||||
|
QMediaPlayer* player;
|
||||||
|
string fullpath;
|
||||||
|
void* mTrack;
|
||||||
|
#elif (defined WIN32)
|
||||||
|
std::string filename;
|
||||||
|
void* mTrack;
|
||||||
|
#endif
|
||||||
|
//#endif //WITH_FMOD
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -92,33 +106,37 @@ public:
|
|||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
class JSample
|
class JSample
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
JSample();
|
JSample();
|
||||||
~JSample();
|
~JSample();
|
||||||
|
|
||||||
unsigned long fileSize();
|
unsigned long fileSize();
|
||||||
|
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||||
#if defined (PSP)
|
QMediaPlayer* effect;
|
||||||
WAVDATA *mSample;
|
void* mSample;
|
||||||
|
#elif defined (PSP)
|
||||||
|
WAVDATA* mSample;
|
||||||
#elif defined (IOS)
|
#elif defined (IOS)
|
||||||
std::string filename;
|
std::string filename;
|
||||||
std::string key;
|
std::string key;
|
||||||
std::string ext;
|
std::string ext;
|
||||||
|
void* mSample;
|
||||||
void* mSample;
|
|
||||||
#elif defined (WITH_FMOD)
|
#elif defined (WITH_FMOD)
|
||||||
FSOUND_SAMPLE *mSample;
|
FSOUND_SAMPLE *mSample;
|
||||||
#elif defined (USE_PHONON)
|
#elif defined (USE_PHONON)
|
||||||
Phonon::AudioOutput* mOutput;
|
Phonon::AudioOutput* mOutput;
|
||||||
Phonon::MediaObject* mMediaObject;
|
Phonon::MediaObject* mMediaObject;
|
||||||
void* mSample;
|
void* mSample;
|
||||||
#elif defined ANDROID
|
#elif defined ANDROID
|
||||||
SLObjectItf playerObject;
|
SLObjectItf playerObject;
|
||||||
SLPlayItf playInterface;
|
SLPlayItf playInterface;
|
||||||
SLVolumeItf sampleVolumeInterface;
|
SLVolumeItf sampleVolumeInterface;
|
||||||
void* mSample;
|
void* mSample;
|
||||||
|
#elif (defined WIN32)
|
||||||
|
std::string filename;
|
||||||
|
void* mSample;
|
||||||
#else
|
#else
|
||||||
void* mSample;
|
void* mSample;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -133,126 +151,130 @@ class JSoundSystem
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Get the singleton instance
|
/// Get the singleton instance
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
static JSoundSystem* GetInstance();
|
static JSoundSystem* GetInstance();
|
||||||
|
|
||||||
static void Destroy();
|
static void Destroy();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Load music.
|
/// Load music.
|
||||||
///
|
///
|
||||||
/// @note MP3 is the only supported format for the moment.
|
/// @note MP3 is the only supported format for the moment.
|
||||||
///
|
///
|
||||||
/// @param filename - Name of the music file.
|
/// @param filename - Name of the music file.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
JMusic *LoadMusic(const char *fileName);
|
JMusic *LoadMusic(const char *fileName);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Delete music from memory.
|
/// Delete music from memory.
|
||||||
///
|
///
|
||||||
/// @param music - Music to be deleted.
|
/// @param music - Music to be deleted.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
//void FreeMusic(JMusic *music);
|
//void FreeMusic(JMusic *music);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Play music.
|
/// Play music.
|
||||||
///
|
///
|
||||||
/// @param music - Music to be played.
|
/// @param music - Music to be played.
|
||||||
/// @param looping - Play the music in a loop.
|
/// @param looping - Play the music in a loop.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void PlayMusic(JMusic *music, bool looping = false);
|
void PlayMusic(JMusic *music, bool looping = false);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Stop playing.
|
/// Stop playing.
|
||||||
///
|
///
|
||||||
/// @param music - Music to be stopped.
|
/// @param music - Music to be stopped.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void StopMusic(JMusic *music);
|
void StopMusic(JMusic *music);
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Resume playing.
|
/// Resume playing.
|
||||||
///
|
///
|
||||||
/// @param music - Music to be resumed.
|
/// @param music - Music to be resumed.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void ResumeMusic(JMusic *music);
|
void ResumeMusic(JMusic *music);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Pause playing.
|
/// Pause playing.
|
||||||
///
|
///
|
||||||
/// @param music - Music to be paused.
|
/// @param music - Music to be paused.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void PauseMusic(JMusic *music);
|
void PauseMusic(JMusic *music);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Load sound effect.
|
/// Load sound effect.
|
||||||
///
|
///
|
||||||
/// @note WAV sound effect only.
|
/// @note WAV sound effect only.
|
||||||
///
|
///
|
||||||
/// @param fileName - Sound effect for loading.
|
/// @param fileName - Sound effect for loading.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
JSample *LoadSample(const char *fileName);
|
JSample *LoadSample(const char *fileName);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Delete sound effect from memory.
|
/// Delete sound effect from memory.
|
||||||
///
|
///
|
||||||
/// @param sample - Sound to be deleted.
|
/// @param sample - Sound to be deleted.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
//void FreeSample(JSample *sample);
|
//void FreeSample(JSample *sample);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Play sound effect.
|
/// Play sound effect.
|
||||||
///
|
///
|
||||||
/// @param sample - Sound for playing.
|
/// @param sample - Sound for playing.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void PlaySample(JSample *sample);
|
void PlaySample(JSample *sample);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Set volume for audio playback.
|
/// Set volume for audio playback.
|
||||||
///
|
///
|
||||||
/// @param volume - New volume.
|
/// @param volume - New volume.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void SetVolume(int volume);
|
void SetVolume(int volume);
|
||||||
|
|
||||||
void SetMusicVolume(int volume);
|
void SetMusicVolume(int volume);
|
||||||
|
|
||||||
void SetSfxVolume(int volume);
|
void SetSfxVolume(int volume);
|
||||||
|
|
||||||
int mChannel;
|
int mChannel;
|
||||||
protected:
|
protected:
|
||||||
JSoundSystem();
|
JSoundSystem();
|
||||||
~JSoundSystem();
|
~JSoundSystem();
|
||||||
|
|
||||||
void InitSoundSystem();
|
void InitSoundSystem();
|
||||||
void DestroySoundSystem();
|
void DestroySoundSystem();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
#if (defined PSP || defined ANDROID)
|
||||||
JMusic *mCurrentMusic;
|
JMusic *mCurrentMusic;
|
||||||
JSample *mCurrentSample;
|
JSample *mCurrentSample;
|
||||||
|
#endif
|
||||||
|
|
||||||
int mVolume;
|
int mVolume;
|
||||||
int mMusicVolume;
|
#ifndef IOS
|
||||||
int mSampleVolume;
|
int mMusicVolume;
|
||||||
|
#endif
|
||||||
|
int mSampleVolume;
|
||||||
|
|
||||||
|
|
||||||
static JSoundSystem* mInstance;
|
static JSoundSystem* mInstance;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -18,12 +18,11 @@ using namespace std;
|
|||||||
|
|
||||||
#define MID_POINT_THRESHOLD 1.0f
|
#define MID_POINT_THRESHOLD 1.0f
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Position of a single dot on screen.
|
/// Position of a single dot on screen.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
class Point
|
class JPoint
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -34,13 +33,13 @@ public:
|
|||||||
/// @param _y - Y position.
|
/// @param _y - Y position.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
Point(float _x, float _y) { x = _x; y = _y; }
|
JPoint(float _x, float _y) { x = _x; y = _y; }
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Constructor, set position to default (0.0f, 0.0f)
|
/// Constructor, set position to default (0.0f, 0.0f)
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
Point() { x = 0.0f; y = 0.0f; }
|
JPoint() { x = 0.0f; y = 0.0f; }
|
||||||
|
|
||||||
float x; ///< X position.
|
float x; ///< X position.
|
||||||
float y; ///< Y position.
|
float y; ///< Y position.
|
||||||
@@ -95,7 +94,7 @@ public:
|
|||||||
/// @param pt - Control point.
|
/// @param pt - Control point.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void AddControlPoint(const Point &pt);
|
void AddControlPoint(const JPoint &pt);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Get a control point of the spline.
|
/// Get a control point of the spline.
|
||||||
@@ -105,7 +104,7 @@ public:
|
|||||||
/// @return Control point.
|
/// @return Control point.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void GetControlPoint(Point &point, int index);
|
void GetControlPoint(JPoint &point, int index);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Work out all pixels of the spline.
|
/// Work out all pixels of the spline.
|
||||||
@@ -128,7 +127,7 @@ public:
|
|||||||
/// @return Position of the desire point.
|
/// @return Position of the desire point.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void PointOnCurve(Point &out, float t, const Point &p0, const Point &p1, const Point &p2, const Point &p3);
|
void PointOnCurve(JPoint &out, float t, const JPoint &p0, const JPoint &p1, const JPoint &p2, const JPoint &p3);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Get a number of pixels for this spline.
|
/// Get a number of pixels for this spline.
|
||||||
@@ -146,7 +145,7 @@ public:
|
|||||||
/// @return Position of the desire point.
|
/// @return Position of the desire point.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void GetPixel(Point &point, int index);
|
void GetPixel(JPoint &point, int index);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Render the spline to screen.
|
/// Render the spline to screen.
|
||||||
@@ -156,8 +155,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
vector<Point> mMidPoints;
|
vector<JPoint> mMidPoints;
|
||||||
vector<Point> mPixels;
|
vector<JPoint> mPixels;
|
||||||
int mCount;
|
int mCount;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -26,8 +26,16 @@
|
|||||||
#include "JAudio.h"
|
#include "JAudio.h"
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
//#define __STDC_LIMIT_MACROS
|
||||||
#include <stdint.h>
|
#ifdef IOS
|
||||||
|
#include <tr1/cstdint>
|
||||||
|
#else
|
||||||
|
#include <cstdint>
|
||||||
|
#endif
|
||||||
|
//#include <stdint.h>
|
||||||
|
//the MSC version might only define _MSC_STDINT_H_
|
||||||
|
//and that might cause redefinition of standard types
|
||||||
|
//#define _STDINT_H_
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -140,9 +148,14 @@ typedef uint32_t u32;
|
|||||||
#include <GLES/gl.h>
|
#include <GLES/gl.h>
|
||||||
#include <GLES/glext.h>
|
#include <GLES/glext.h>
|
||||||
#elif defined (WIN32) || defined (LINUX)
|
#elif defined (WIN32) || defined (LINUX)
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
#include <OpenGL/gl.h>
|
||||||
|
#include <OpenGL/glu.h>
|
||||||
|
#else
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#include <GL/glu.h>
|
#include <GL/glu.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#include <QtOpenGL>
|
#include <QtOpenGL>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
29
JGE/include/PrecompiledHeader.h
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
#ifndef PRECOMPILEDHEADER_H
|
||||||
|
#define PRECOMPILEDHEADER_H
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#include <fstream>
|
||||||
|
#include <iostream>
|
||||||
|
#include <list>
|
||||||
|
#include <map>
|
||||||
|
#include <sstream>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "DebugRoutines.h"
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include "JGE.h"
|
||||||
|
#include "JFileSystem.h"
|
||||||
|
#include "JLogger.h"
|
||||||
|
|
||||||
|
//#ifndef WP8
|
||||||
|
//#include <boost/shared_ptr.hpp>
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
#if defined (WP8) || defined (IOS) || defined (ANDROID) || defined (QT_CONFIG) || defined (SDL_CONFIG)
|
||||||
|
#define TOUCH_ENABLED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif //PRECOMPILEDHEADER_H
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef THREADING_H
|
#ifndef THREADING_H
|
||||||
#define THREADING_H
|
#define THREADING_H
|
||||||
|
|
||||||
#if !defined(PSP) && !defined(QT_CONFIG)
|
#if !defined(PSP) && !defined(QT_CONFIG) && !(__cplusplus > 199711L) && !(_MSC_VER >= 1700)
|
||||||
#include <boost/date_time.hpp>
|
#include <boost/date_time.hpp>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
#elif !defined(QT_CONFIG)
|
#elif defined(PSP)
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
** PSP specific variant of a boost mutex & scoped_lock
|
** PSP specific variant of a boost mutex & scoped_lock
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <class Mutex>
|
template <class Mutex>
|
||||||
@@ -60,7 +60,7 @@ namespace boost
|
|||||||
{
|
{
|
||||||
sceKernelDeleteSema(mID);
|
sceKernelDeleteSema(mID);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lock()
|
void lock()
|
||||||
{
|
{
|
||||||
int result = sceKernelWaitSema(mID, 1, 0);
|
int result = sceKernelWaitSema(mID, 1, 0);
|
||||||
@@ -142,7 +142,7 @@ namespace boost
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int mID;
|
int mID;
|
||||||
int mThreadID;
|
int mThreadID;
|
||||||
volatile int mRecursionCount;
|
volatile int mRecursionCount;
|
||||||
@@ -164,7 +164,7 @@ namespace boost
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
** Emulating boost::thread configuration glue, with some shortcuts
|
** Emulating boost::thread configuration glue, with some shortcuts
|
||||||
** This detail namespace is a distillation of boost's thread.hpp, thread_data.hpp.
|
** This detail namespace is a distillation of boost's thread.hpp, thread_data.hpp.
|
||||||
*/
|
*/
|
||||||
namespace detail
|
namespace detail
|
||||||
@@ -212,13 +212,13 @@ namespace boost
|
|||||||
**
|
**
|
||||||
** The intent of its usage is this form only:
|
** The intent of its usage is this form only:
|
||||||
** mWorkerThread = boost::thread(ThreadProc, this);
|
** mWorkerThread = boost::thread(ThreadProc, this);
|
||||||
** where ThreadProc is a static member function of the 'this' class,eg:
|
** where ThreadProc is a static member function of the 'this' class,eg:
|
||||||
** static void FOO::ThreadProc(void* inParam)
|
** static void FOO::ThreadProc(void* inParam)
|
||||||
** {
|
** {
|
||||||
** FOO* instance = reinterpret_cast<FOO*>(inParam);
|
** FOO* instance = reinterpret_cast<FOO*>(inParam);
|
||||||
** // now you have class instance data available...
|
** // now you have class instance data available...
|
||||||
** }
|
** }
|
||||||
**
|
**
|
||||||
** Any other variant of a thread proc with more than one param is unimplemented.
|
** Any other variant of a thread proc with more than one param is unimplemented.
|
||||||
*/
|
*/
|
||||||
class thread
|
class thread
|
||||||
@@ -227,7 +227,7 @@ namespace boost
|
|||||||
** Helper class for sceKernelStartThread, which passes args by value, not by reference
|
** Helper class for sceKernelStartThread, which passes args by value, not by reference
|
||||||
** We use this struct to wrap any pointers that we want to pass to the worker thread.
|
** We use this struct to wrap any pointers that we want to pass to the worker thread.
|
||||||
*/
|
*/
|
||||||
struct CallbackData
|
struct CallbackData
|
||||||
{
|
{
|
||||||
CallbackData(detail::thread_data_ptr inThreadInfo)
|
CallbackData(detail::thread_data_ptr inThreadInfo)
|
||||||
: mThreadInfo(inThreadInfo)
|
: mThreadInfo(inThreadInfo)
|
||||||
@@ -307,13 +307,11 @@ namespace boost
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(QT_CONFIG)
|
#elif defined(QT_CONFIG) && (__cplusplus <= 199711L)
|
||||||
|
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
#include <QSharedPointer>
|
||||||
#include <boost/bind.hpp>
|
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
|
|
||||||
#include "../include/JLogger.h"
|
#include "../include/JLogger.h"
|
||||||
|
|
||||||
@@ -420,23 +418,25 @@ namespace boost
|
|||||||
virtual void run() = 0;
|
virtual void run() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef boost::shared_ptr<detail::thread_data_base> thread_data_ptr;
|
|
||||||
|
|
||||||
template<typename F>
|
typedef QSharedPointer<detail::thread_data_base> thread_data_ptr;
|
||||||
|
|
||||||
|
template<typename F, typename A1>
|
||||||
class thread_data : public detail::thread_data_base
|
class thread_data : public detail::thread_data_base
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
thread_data(F f_) : f(f_)
|
thread_data(F f_, A1 a1_) : f(f_), a1(a1_)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void run()
|
void run()
|
||||||
{
|
{
|
||||||
f();
|
f(a1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
F f;
|
F f;
|
||||||
|
A1 a1;
|
||||||
|
|
||||||
void operator=(thread_data&);
|
void operator=(thread_data&);
|
||||||
thread_data(thread_data&);
|
thread_data(thread_data&);
|
||||||
@@ -493,7 +493,7 @@ namespace boost
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class F,class A1>
|
template <class F,class A1>
|
||||||
thread(F f, A1 a1) : mThreadInfo(make_thread_info(boost::bind(boost::type<void>(), f, a1)))
|
thread(F f, A1 a1) : mThreadInfo(make_thread_info(f, a1))
|
||||||
{
|
{
|
||||||
mpThread = new threadImpl(mThreadInfo);
|
mpThread = new threadImpl(mThreadInfo);
|
||||||
LOG("Calling start func");
|
LOG("Calling start func");
|
||||||
@@ -510,10 +510,10 @@ namespace boost
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template<typename F>
|
template<typename F, typename A1>
|
||||||
static inline detail::thread_data_ptr make_thread_info(F f)
|
static inline detail::thread_data_ptr make_thread_info(F f, A1 a1)
|
||||||
{
|
{
|
||||||
return detail::thread_data_ptr(new detail::thread_data<F>(f));
|
return detail::thread_data_ptr(new detail::thread_data<F, A1>(f, a1));
|
||||||
}
|
}
|
||||||
|
|
||||||
detail::thread_data_ptr mThreadInfo;
|
detail::thread_data_ptr mThreadInfo;
|
||||||
@@ -537,6 +537,80 @@ namespace boost
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#elif (__cplusplus > 199711L) || (_MSC_VER >= 1700)
|
||||||
|
|
||||||
|
#include <thread>
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
typedef std::thread thread;
|
||||||
|
|
||||||
|
template <class Mutex>
|
||||||
|
struct unique_lock
|
||||||
|
{
|
||||||
|
unique_lock(Mutex& inMutex) : mMutex(&inMutex)
|
||||||
|
{
|
||||||
|
mMutex->lock();
|
||||||
|
}
|
||||||
|
|
||||||
|
~unique_lock()
|
||||||
|
{
|
||||||
|
mMutex->unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
Mutex* mMutex;
|
||||||
|
};
|
||||||
|
|
||||||
|
class mutex
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
typedef unique_lock<mutex> scoped_lock;
|
||||||
|
|
||||||
|
mutex()
|
||||||
|
: mQMutex()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
~mutex()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void lock()
|
||||||
|
{
|
||||||
|
mQMutex.lock();
|
||||||
|
}
|
||||||
|
|
||||||
|
void unlock()
|
||||||
|
{
|
||||||
|
mQMutex.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::mutex mQMutex;
|
||||||
|
|
||||||
|
private:
|
||||||
|
mutex(mutex const&);
|
||||||
|
mutex& operator=(mutex const&);
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace posix_time
|
||||||
|
{
|
||||||
|
typedef unsigned int milliseconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
** boost's platform neutral sleep call.
|
||||||
|
*/
|
||||||
|
namespace this_thread
|
||||||
|
{
|
||||||
|
inline void sleep(boost::posix_time::milliseconds const& time)
|
||||||
|
{
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(time));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // THREADING_H
|
#endif // THREADING_H
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void* vrelptr( void *ptr ); // make a pointer relative to memory base address (ATTENTION: A NULL rel ptr is not illegal/invalid!)
|
void* vrelptr( void *ptr ); // make a pointer relative to memory base address (ATTENTION: A NULL rel ptr is not illegal/invalid!)
|
||||||
|
|
||||||
void* vabsptr( void *ptr ); // make a pointer absolute (default return type of valloc)
|
void* vabsptr( void *ptr ); // make a pointer absolute (default return type of valloc)
|
||||||
|
|
||||||
void* valloc( size_t size );
|
void* valloc( size_t size );
|
||||||
|
|||||||
BIN
JGE/lib/linux/libhgetools.a
Normal file
BIN
JGE/lib/linux/libjge.a
Normal file
350
JGE/src/Downloader.cpp
Normal file
@@ -0,0 +1,350 @@
|
|||||||
|
#include "DebugRoutines.h"
|
||||||
|
#include "JFileSystem.h"
|
||||||
|
#include "Downloader.h"
|
||||||
|
|
||||||
|
#define RECORDS_DEFAULT_FILE "cache/records.txt"
|
||||||
|
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
QNetworkAccessManager DownloadRequest::networkAccessManager;
|
||||||
|
#endif
|
||||||
|
#ifdef __EMSCRIPTEN__
|
||||||
|
#include "emscripten.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
DownloadRequest::DownloadRequest(string localPath,
|
||||||
|
string remoteResourceURL,
|
||||||
|
string ETag,
|
||||||
|
DownloadStatus downloadStatus,
|
||||||
|
size_t totalSize,
|
||||||
|
size_t currentSize):
|
||||||
|
mLocalPath(localPath),
|
||||||
|
mRemoteResourceURL(remoteResourceURL),
|
||||||
|
mRequestedRemoteResourceURL(remoteResourceURL),
|
||||||
|
mETag(ETag),
|
||||||
|
mDownloadStatus(downloadStatus),
|
||||||
|
mUpgradeAvailable(false),
|
||||||
|
mTotalSize(totalSize),
|
||||||
|
mCurrentSize(currentSize)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
DownloadRequest::~DownloadRequest()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void DownloadRequest::startHead()
|
||||||
|
{
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
QNetworkRequest request(QUrl(QString(mRequestedRemoteResourceURL.c_str())));
|
||||||
|
request.setRawHeader("If-None-Match", mETag.c_str());
|
||||||
|
mNetworkReply = networkAccessManager.head(request);
|
||||||
|
connect(mNetworkReply, SIGNAL(finished()), SLOT(fileDownloaded()));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void DownloadRequest::startGet()
|
||||||
|
{
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
mNetworkReply = networkAccessManager.get(QNetworkRequest(QUrl(QString(mRequestedRemoteResourceURL.c_str()))));
|
||||||
|
#endif
|
||||||
|
mFile.close();
|
||||||
|
JFileSystem::GetInstance()->Remove(getTempLocalPath());
|
||||||
|
JFileSystem::GetInstance()->openForWrite(mFile, getTempLocalPath());
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
connect(mNetworkReply, SIGNAL(downloadProgress(int64_t, int64_t)),
|
||||||
|
SLOT(downloadProgress(int64_t, int64_t)));
|
||||||
|
connect(mNetworkReply, SIGNAL(finished()), SLOT(fileDownloaded()));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __EMSCRIPTEN__
|
||||||
|
emscripten_async_wget2_data(mRemoteResourceURL.c_str(), "GET", 0, this, 1,
|
||||||
|
(em_async_wget2_data_onload_func)DownloadRequest::onLoadCb,
|
||||||
|
(em_async_wget2_data_onerror_func)DownloadRequest::onErrorCb,
|
||||||
|
(em_async_wget2_data_onprogress_func)DownloadRequest::onProgressCb);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __EMSCRIPTEN__
|
||||||
|
void DownloadRequest::onLoadCb(unsigned int handle, DownloadRequest* req, const char *buffer, unsigned int size)
|
||||||
|
{
|
||||||
|
|
||||||
|
DebugTrace("DownloadRequest::onLoadCb: " << size);
|
||||||
|
req->processBufferDownloaded(size, buffer);
|
||||||
|
Downloader::GetInstance()->Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DownloadRequest::onErrorCb(unsigned int handle, DownloadRequest* req, int errorCode, const char* errorText)
|
||||||
|
{
|
||||||
|
DebugTrace("DownloadRequest::onErrorCb");
|
||||||
|
req->processError(errorCode, errorText);
|
||||||
|
Downloader::GetInstance()->Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DownloadRequest::onProgressCb(unsigned int handle, DownloadRequest* req, int bytesReceived, int bytesTotal)
|
||||||
|
{
|
||||||
|
DebugTrace("DownloadRequest::onProgressCb");
|
||||||
|
req->DownloadRequest::downloadProgress(bytesReceived, bytesTotal);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void DownloadRequest::processError(int errorCode, const char* errorText)
|
||||||
|
{
|
||||||
|
DebugTrace(errorText);
|
||||||
|
mDownloadStatus = DownloadRequest::DOWNLOAD_ERROR;
|
||||||
|
mFile.close();
|
||||||
|
JFileSystem::GetInstance()->Remove(getTempLocalPath());
|
||||||
|
}
|
||||||
|
|
||||||
|
void DownloadRequest::processBufferDownloaded(unsigned int size, const char*buffer)
|
||||||
|
{
|
||||||
|
if(mFile.is_open())
|
||||||
|
{
|
||||||
|
mTotalSize = size;
|
||||||
|
mFile.write(buffer, size);
|
||||||
|
mFile.close();
|
||||||
|
if(!JFileSystem::GetInstance()->Rename(getTempLocalPath(), mLocalPath)) {
|
||||||
|
mDownloadStatus = DownloadRequest::DOWNLOAD_ERROR;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mDownloadStatus = DownloadRequest::DOWNLOADED;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DownloadRequest::fileDownloaded()
|
||||||
|
{
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
do {
|
||||||
|
QByteArray eTagByteArray = mNetworkReply->rawHeader("ETag");
|
||||||
|
if(!eTagByteArray.isEmpty()) {
|
||||||
|
string oldETag = mETag;
|
||||||
|
mETag = QString(eTagByteArray).toStdString();
|
||||||
|
if(oldETag!="" && oldETag != mETag)
|
||||||
|
mUpgradeAvailable = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// let's check some error
|
||||||
|
if(mNetworkReply->error() != QNetworkReply::NoError) {
|
||||||
|
processError((int)mNetworkReply->error(), mNetworkReply->errorString().toStdString().c_str());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if we're getting redirected
|
||||||
|
QVariant redirectionTarget = mNetworkReply->attribute(QNetworkRequest::RedirectionTargetAttribute);
|
||||||
|
if (!redirectionTarget.isNull()) {
|
||||||
|
QUrl newUrl = QUrl(mRequestedRemoteResourceURL.c_str()).resolved(redirectionTarget.toUrl());
|
||||||
|
DebugTrace(string("Redirect to ")+ newUrl.toString().toStdString());
|
||||||
|
|
||||||
|
mRequestedRemoteResourceURL = newUrl.toString().toStdString();
|
||||||
|
mNetworkReply->deleteLater();
|
||||||
|
if(mFile.is_open())
|
||||||
|
startGet();
|
||||||
|
else
|
||||||
|
startHead();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QByteArray byteArray = mNetworkReply->readAll();
|
||||||
|
processBufferDownloaded(byteArray.size(), byteArray.constData());
|
||||||
|
} while(0);
|
||||||
|
|
||||||
|
Downloader::GetInstance()->Update();
|
||||||
|
|
||||||
|
mNetworkReply->deleteLater();
|
||||||
|
emit statusChanged((int)mDownloadStatus);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void DownloadRequest::downloadProgress(int64_t bytesReceived, int64_t bytesTotal)
|
||||||
|
{
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
QByteArray byteArray = mNetworkReply->readAll();
|
||||||
|
mFile.write(byteArray.constData(), byteArray.size());
|
||||||
|
#endif
|
||||||
|
mCurrentSize = bytesReceived;
|
||||||
|
mTotalSize = bytesTotal;
|
||||||
|
int percent = 0;
|
||||||
|
if(bytesTotal)
|
||||||
|
percent = (bytesReceived/bytesTotal)*100;
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
emit percentChanged(percent);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
Downloader* Downloader::mInstance = 0;
|
||||||
|
|
||||||
|
Downloader::Downloader(string globalRemoteURL, string localcacheRecords):
|
||||||
|
mGlobalRemoteURL(globalRemoteURL),
|
||||||
|
mLocalCacheRecords(localcacheRecords)
|
||||||
|
{
|
||||||
|
JFileSystem::GetInstance()->MakeDir("cache");
|
||||||
|
|
||||||
|
izfstream downloadRecords;
|
||||||
|
if(mLocalCacheRecords.empty())
|
||||||
|
mLocalCacheRecords = RECORDS_DEFAULT_FILE;
|
||||||
|
if(JFileSystem::GetInstance()->openForRead(downloadRecords, mLocalCacheRecords))
|
||||||
|
{// File exists, let's read it.
|
||||||
|
downloadRecords >> (*this);
|
||||||
|
}
|
||||||
|
JFileSystem::GetInstance()->CloseFile();
|
||||||
|
}
|
||||||
|
|
||||||
|
Downloader::~Downloader()
|
||||||
|
{
|
||||||
|
map<string, DownloadRequest*>::iterator ite;
|
||||||
|
for(ite = mRequestMap.begin(); ite != mRequestMap.end(); ite++)
|
||||||
|
{
|
||||||
|
delete (*ite).second;
|
||||||
|
}
|
||||||
|
mRequestMap.erase(mRequestMap.begin(), mRequestMap.end());
|
||||||
|
}
|
||||||
|
|
||||||
|
Downloader* Downloader::GetInstance()
|
||||||
|
{
|
||||||
|
if(!mInstance)
|
||||||
|
{
|
||||||
|
mInstance = new Downloader();
|
||||||
|
}
|
||||||
|
return mInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Downloader::Release()
|
||||||
|
{
|
||||||
|
if(mInstance)
|
||||||
|
{
|
||||||
|
delete mInstance;
|
||||||
|
mInstance = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DownloadRequest::NetworkIsAccessible()
|
||||||
|
{
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
networkAccessManager.setNetworkAccessible(QNetworkAccessManager::Accessible);
|
||||||
|
result = networkAccessManager.networkAccessible();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
DownloadRequest* Downloader::Get(string localPath, string remoteResourceURL)
|
||||||
|
{
|
||||||
|
map<string, DownloadRequest*>::iterator ite = mRequestMap.find(localPath);
|
||||||
|
if(ite == mRequestMap.end())
|
||||||
|
{ // request does not exist, let's create it
|
||||||
|
DownloadRequest* request = new DownloadRequest(localPath, remoteResourceURL);
|
||||||
|
std::pair<std::map<string,DownloadRequest*>::iterator,bool> ret;
|
||||||
|
ret = mRequestMap.insert ( std::pair<string,DownloadRequest*>(localPath, request) );
|
||||||
|
if (ret.second==false) {
|
||||||
|
DebugTrace("Downloader::Get Error inserting request in Map");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
ite = ret.first;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now, we can check the server
|
||||||
|
if((*ite).second->getDownloadStatus() == DownloadRequest::NOT_PRESENT ||
|
||||||
|
(*ite).second->upgradeAvailable())
|
||||||
|
{ // File is not here or an update is available, let's get it
|
||||||
|
(*ite).second->startGet();
|
||||||
|
(*ite).second->mDownloadStatus = DownloadRequest::DOWNLOADING;
|
||||||
|
}
|
||||||
|
else if ((*ite).second->getDownloadStatus() == DownloadRequest::DOWNLOADED)
|
||||||
|
{ // File is here, let's check if there is some update without blocking the playback
|
||||||
|
(*ite).second->startHead();
|
||||||
|
}
|
||||||
|
|
||||||
|
return (*ite).second;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Downloader::Update()
|
||||||
|
{
|
||||||
|
ofstream downloadRecords;
|
||||||
|
if(JFileSystem::GetInstance()->openForWrite(downloadRecords, mLocalCacheRecords))
|
||||||
|
{
|
||||||
|
downloadRecords << (*this);
|
||||||
|
}
|
||||||
|
downloadRecords.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
ostream& operator<<(ostream& out, const DownloadRequest& d)
|
||||||
|
{
|
||||||
|
// HEAD request fails, so this line erase cache record after upgrade check :(
|
||||||
|
// if(d.getDownloadStatus() == DownloadRequest::DOWNLOADED)
|
||||||
|
{
|
||||||
|
out << "localPath=" << d.mLocalPath << endl;
|
||||||
|
out << "remoteResource=" << d.mRemoteResourceURL << endl;
|
||||||
|
out << "ETag=" << d.mETag << endl;
|
||||||
|
out << "upgradeAvailable=" << d.mUpgradeAvailable <<endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
istream& operator>>(istream& in, DownloadRequest& d)
|
||||||
|
{
|
||||||
|
string s;
|
||||||
|
|
||||||
|
while(std::getline(in, s))
|
||||||
|
{
|
||||||
|
size_t limiter = s.find("=");
|
||||||
|
string areaS;
|
||||||
|
if (limiter != string::npos)
|
||||||
|
{
|
||||||
|
areaS = s.substr(0, limiter);
|
||||||
|
if (areaS.compare("localPath") == 0)
|
||||||
|
{
|
||||||
|
d.mLocalPath = s.substr(limiter + 1);
|
||||||
|
}
|
||||||
|
else if (areaS.compare("remoteResource") == 0)
|
||||||
|
{
|
||||||
|
d.mRemoteResourceURL = s.substr(limiter + 1);
|
||||||
|
d.mRequestedRemoteResourceURL = d.mRemoteResourceURL;
|
||||||
|
}
|
||||||
|
else if (areaS.compare("ETag") == 0)
|
||||||
|
{
|
||||||
|
d.mETag = s.substr(limiter + 1);
|
||||||
|
d.mDownloadStatus = DownloadRequest::DOWNLOADED;
|
||||||
|
}
|
||||||
|
else if (areaS.compare("upgradeAvailable") == 0)
|
||||||
|
{
|
||||||
|
d.mUpgradeAvailable = (bool)atoi(s.substr(limiter + 1).c_str());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
|
||||||
|
ostream& operator<<(ostream& out, const Downloader& d)
|
||||||
|
{
|
||||||
|
map<string, DownloadRequest*>::const_iterator ite;
|
||||||
|
for(ite = d.mRequestMap.begin(); ite != d.mRequestMap.end(); ite++)
|
||||||
|
{
|
||||||
|
out << (*(*ite).second) << endl;
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
istream& operator>>(istream& in, Downloader& d)
|
||||||
|
{
|
||||||
|
while(!in.eof())
|
||||||
|
{
|
||||||
|
DownloadRequest* downloadRequest = new DownloadRequest();
|
||||||
|
in >> (*downloadRequest);
|
||||||
|
|
||||||
|
if(!downloadRequest->getLocalPath().empty() &&
|
||||||
|
!downloadRequest->getRemoteResource().empty() &&
|
||||||
|
!downloadRequest->getETag().empty()) {
|
||||||
|
d.mRequestMap[downloadRequest->getLocalPath()] = downloadRequest;
|
||||||
|
} else {
|
||||||
|
delete downloadRequest;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
#include "../include/JSprite.h"
|
#include "../include/JSprite.h"
|
||||||
#include "../include/JAnimator.h"
|
#include "../include/JAnimator.h"
|
||||||
|
|
||||||
#include "tinyxml/tinyxml.h"
|
#include "tinyxml.h"
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -16,9 +16,7 @@ User folder is the only one that is really needed to guarantee both read and wri
|
|||||||
The content that users should not be touching.
|
The content that users should not be touching.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PSP
|
#include "dirent.h"
|
||||||
#include "PrecompiledHeader.h"
|
|
||||||
#endif //PSP
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#pragma warning(disable : 4786)
|
#pragma warning(disable : 4786)
|
||||||
@@ -32,12 +30,19 @@ The content that users should not be touching.
|
|||||||
#include "../include/JGE.h"
|
#include "../include/JGE.h"
|
||||||
#include "../include/JFileSystem.h"
|
#include "../include/JFileSystem.h"
|
||||||
#include "../include/JLogger.h"
|
#include "../include/JLogger.h"
|
||||||
#include <dirent.h>
|
#include "DebugRoutines.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef QT_CONFIG
|
#ifdef QT_CONFIG
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
#ifdef IOS
|
||||||
|
#include <Foundation/Foundation.h>
|
||||||
|
#endif
|
||||||
|
*/
|
||||||
|
|
||||||
JFileSystem* JFileSystem::mInstance = NULL;
|
JFileSystem* JFileSystem::mInstance = NULL;
|
||||||
|
|
||||||
JZipCache::JZipCache()
|
JZipCache::JZipCache()
|
||||||
@@ -119,6 +124,10 @@ JFileSystem::JFileSystem(const string & _userPath, const string & _systemPath)
|
|||||||
userPath = [[documentsDirectory stringByAppendingString: @"/User/"] cStringUsingEncoding:1];
|
userPath = [[documentsDirectory stringByAppendingString: @"/User/"] cStringUsingEncoding:1];
|
||||||
systemPath = [[documentsDirectory stringByAppendingString: @"/Res/"] cStringUsingEncoding:1];
|
systemPath = [[documentsDirectory stringByAppendingString: @"/Res/"] cStringUsingEncoding:1];
|
||||||
|
|
||||||
|
#elif defined (__EMSCRIPTEN__)
|
||||||
|
systemPath = "/";
|
||||||
|
DebugTrace("User path " << userPath);
|
||||||
|
DebugTrace("System path " << systemPath);
|
||||||
#elif defined (ANDROID)
|
#elif defined (ANDROID)
|
||||||
userPath = JGE::GetInstance()->getFileSystemLocation();
|
userPath = JGE::GetInstance()->getFileSystemLocation();
|
||||||
systemPath = "";
|
systemPath = "";
|
||||||
@@ -134,9 +143,9 @@ JFileSystem::JFileSystem(const string & _userPath, const string & _systemPath)
|
|||||||
userPath = QDir::toNativeSeparators(dir.absolutePath()).toStdString();
|
userPath = QDir::toNativeSeparators(dir.absolutePath()).toStdString();
|
||||||
systemPath = QDir::toNativeSeparators(sysDir.absolutePath()).toStdString();
|
systemPath = QDir::toNativeSeparators(sysDir.absolutePath()).toStdString();
|
||||||
|
|
||||||
DebugTrace("User path " << userPath);
|
DebugTrace("User path " + userPath);
|
||||||
DebugTrace("System path " << systemPath);
|
DebugTrace("System path " + systemPath);
|
||||||
DebugTrace("Current path " << QDir::currentPath().toStdString());
|
DebugTrace("Current path " + QDir::currentPath().toStdString());
|
||||||
#else
|
#else
|
||||||
//Find the Res.txt file and matching Res folders for backwards compatibility
|
//Find the Res.txt file and matching Res folders for backwards compatibility
|
||||||
ifstream mfile("Res.txt");
|
ifstream mfile("Res.txt");
|
||||||
@@ -248,7 +257,7 @@ void JFileSystem::clearZipCache()
|
|||||||
|
|
||||||
bool JFileSystem::AttachZipFile(const string &zipfile, char *password /* = NULL */)
|
bool JFileSystem::AttachZipFile(const string &zipfile, char *password /* = NULL */)
|
||||||
{
|
{
|
||||||
if (mZipAvailable && mZipFile != NULL)
|
if (mZipAvailable && mZipFile.is_open())
|
||||||
{
|
{
|
||||||
if (mZipFileName != zipfile)
|
if (mZipFileName != zipfile)
|
||||||
DetachZipFile(); // close the previous zip file
|
DetachZipFile(); // close the previous zip file
|
||||||
@@ -291,6 +300,7 @@ void JFileSystem::DetachZipFile()
|
|||||||
|
|
||||||
bool JFileSystem::openForRead(izfstream & File, const string & FilePath) {
|
bool JFileSystem::openForRead(izfstream & File, const string & FilePath) {
|
||||||
|
|
||||||
|
DebugTrace("JFileSystem::openForRead " << FilePath);
|
||||||
File.open(FilePath.c_str(), mUserFS);
|
File.open(FilePath.c_str(), mUserFS);
|
||||||
if (File)
|
if (File)
|
||||||
return true;
|
return true;
|
||||||
@@ -313,11 +323,15 @@ bool JFileSystem::readIntoString(const string & FilePath, string & target)
|
|||||||
|
|
||||||
int fileSize = GetFileSize(file);
|
int fileSize = GetFileSize(file);
|
||||||
|
|
||||||
|
#ifndef __MINGW32__
|
||||||
try {
|
try {
|
||||||
|
#endif
|
||||||
target.resize((std::string::size_type) fileSize);
|
target.resize((std::string::size_type) fileSize);
|
||||||
|
#ifndef __MINGW32__
|
||||||
} catch (bad_alloc&) {
|
} catch (bad_alloc&) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if (fileSize)
|
if (fileSize)
|
||||||
@@ -397,7 +411,6 @@ bool JFileSystem::OpenFile(const string &filename)
|
|||||||
mCurrentFileInZip = &(it2->second);
|
mCurrentFileInZip = &(it2->second);
|
||||||
mFileSize = it2->second.m_Size;
|
mFileSize = it2->second.m_Size;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -553,7 +566,13 @@ bool JFileSystem::Rename(string _from, string _to)
|
|||||||
string from = mUserFSPath + _from;
|
string from = mUserFSPath + _from;
|
||||||
string to = mUserFSPath + _to;
|
string to = mUserFSPath + _to;
|
||||||
std::remove(to.c_str());
|
std::remove(to.c_str());
|
||||||
return rename(from.c_str(), to.c_str()) ? true: false;
|
return (rename(from.c_str(), to.c_str()) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool JFileSystem::Remove(string aFile)
|
||||||
|
{
|
||||||
|
string toRemove = mUserFSPath + aFile;
|
||||||
|
return (std::remove(toRemove.c_str()) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int JFileSystem::GetFileSize(izfstream & file)
|
int JFileSystem::GetFileSize(izfstream & file)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
#if defined (WIN32) // WIN32 specific code
|
#if defined (WIN32) // WIN32 specific code
|
||||||
#include "../../Dependencies/include/fmod.h"
|
#include "fmod.h"
|
||||||
|
|
||||||
u8 JGE::GetAnalogX()
|
u8 JGE::GetAnalogX()
|
||||||
{
|
{
|
||||||
@@ -54,7 +54,7 @@ u8 JGE::GetAnalogY()
|
|||||||
#elif defined (LINUX) // Unix specific code
|
#elif defined (LINUX) // Unix specific code
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#ifdef WITH_FMOD
|
#ifdef WITH_FMOD
|
||||||
#include "../Dependencies/include/fmod.h"
|
#include "fmod.h"
|
||||||
#endif //WITH_FMOD
|
#endif //WITH_FMOD
|
||||||
|
|
||||||
|
|
||||||
@@ -249,6 +249,7 @@ u32 JGE::BindKey(LocalKeySym sym, JButton button)
|
|||||||
u32 JGE::UnbindKey(LocalKeySym sym, JButton button)
|
u32 JGE::UnbindKey(LocalKeySym sym, JButton button)
|
||||||
{
|
{
|
||||||
for (keycodes_it it = keyBinds.begin(); it != keyBinds.end(); )
|
for (keycodes_it it = keyBinds.begin(); it != keyBinds.end(); )
|
||||||
|
{
|
||||||
if (sym == it->first && button == it->second)
|
if (sym == it->first && button == it->second)
|
||||||
{
|
{
|
||||||
keycodes_it er = it;
|
keycodes_it er = it;
|
||||||
@@ -256,7 +257,8 @@ u32 JGE::UnbindKey(LocalKeySym sym, JButton button)
|
|||||||
keyBinds.erase(er);
|
keyBinds.erase(er);
|
||||||
}
|
}
|
||||||
else ++it;
|
else ++it;
|
||||||
return keyBinds.size();
|
}
|
||||||
|
return keyBinds.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 JGE::UnbindKey(LocalKeySym sym)
|
u32 JGE::UnbindKey(LocalKeySym sym)
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include <pspaudio.h>
|
#include <pspaudio.h>
|
||||||
#include <pspmp3.h>
|
#include <pspmp3.h>
|
||||||
#include <psputility.h>
|
#include <psputility.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define PSP_AUDIO_VOLUME_MAX 100
|
#define PSP_AUDIO_VOLUME_MAX 100
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#include "../include/JFileSystem.h"
|
#include "../include/JFileSystem.h"
|
||||||
#include "../include/JResourceManager.h"
|
#include "../include/JResourceManager.h"
|
||||||
|
|
||||||
#include "tinyxml/tinyxml.h"
|
#include "tinyxml.h"
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#include "../include/JResourceManager.h"
|
#include "../include/JResourceManager.h"
|
||||||
#include "../include/JFileSystem.h"
|
#include "../include/JFileSystem.h"
|
||||||
#include "../include/JLBFont.h"
|
#include "../include/JLBFont.h"
|
||||||
#include "tinyxml/tinyxml.h"
|
#include "tinyxml.h"
|
||||||
|
|
||||||
#if defined (_DEBUG) && defined (WIN32) && (!defined LINUX)
|
#if defined (_DEBUG) && defined (WIN32) && (!defined LINUX)
|
||||||
#include "crtdbg.h"
|
#include "crtdbg.h"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#include "../include/JFileSystem.h"
|
#include "../include/JFileSystem.h"
|
||||||
#include "../include/JSpline.h"
|
#include "../include/JSpline.h"
|
||||||
|
|
||||||
#include "tinyxml/tinyxml.h"
|
#include "tinyxml.h"
|
||||||
|
|
||||||
#define SMALL_NUMBER 0.0001f
|
#define SMALL_NUMBER 0.0001f
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ bool JSpline::Load(const char *filename, float xscale, float yscale)
|
|||||||
element->QueryFloatAttribute("x", &xx);
|
element->QueryFloatAttribute("x", &xx);
|
||||||
element->QueryFloatAttribute("y", &yy);
|
element->QueryFloatAttribute("y", &yy);
|
||||||
|
|
||||||
Point pt(xx*xscale, yy*yscale);
|
JPoint pt(xx*xscale, yy*yscale);
|
||||||
AddControlPoint(pt);
|
AddControlPoint(pt);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -84,7 +84,7 @@ bool JSpline::Load(const char *filename, float xscale, float yscale)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void JSpline::PointOnCurve(Point &out, float t, const Point &p0, const Point &p1, const Point &p2, const Point &p3)
|
void JSpline::PointOnCurve(JPoint &out, float t, const JPoint &p0, const JPoint &p1, const JPoint &p2, const JPoint &p3)
|
||||||
{
|
{
|
||||||
float t2 = t * t;
|
float t2 = t * t;
|
||||||
float t3 = t2 * t;
|
float t3 = t2 * t;
|
||||||
@@ -113,8 +113,8 @@ void JSpline::GeneratePixels()
|
|||||||
x = mMidPoints[1].x;
|
x = mMidPoints[1].x;
|
||||||
y = mMidPoints[1].y;
|
y = mMidPoints[1].y;
|
||||||
|
|
||||||
Point newPt(x, y);
|
JPoint newPt(x, y);
|
||||||
Point extraPt;
|
JPoint extraPt;
|
||||||
|
|
||||||
mPixels.push_back(newPt);
|
mPixels.push_back(newPt);
|
||||||
|
|
||||||
@@ -151,13 +151,13 @@ void JSpline::GeneratePixels()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JSpline::AddControlPoint(const Point &pt)
|
void JSpline::AddControlPoint(const JPoint &pt)
|
||||||
{
|
{
|
||||||
mMidPoints.push_back(pt);
|
mMidPoints.push_back(pt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JSpline::GetControlPoint(Point &point, int index)
|
void JSpline::GetControlPoint(JPoint &point, int index)
|
||||||
{
|
{
|
||||||
if (index < (int)mMidPoints.size())
|
if (index < (int)mMidPoints.size())
|
||||||
{
|
{
|
||||||
@@ -167,7 +167,7 @@ void JSpline::GetControlPoint(Point &point, int index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JSpline::GetPixel(Point &point, int index)
|
void JSpline::GetPixel(JPoint &point, int index)
|
||||||
{
|
{
|
||||||
if (index < (int)mPixels.size())
|
if (index < (int)mPixels.size())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,7 +19,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../include/decoder_prx.h"
|
#include "decoder_prx.h"
|
||||||
|
#include <psputility.h>
|
||||||
|
|
||||||
char *prx_static_init()
|
char *prx_static_init()
|
||||||
{
|
{
|
||||||
@@ -10,5 +10,6 @@ void resumeGame();
|
|||||||
@property (nonatomic, retain) id eaglView;
|
@property (nonatomic, retain) id eaglView;
|
||||||
@property (nonatomic, retain) UITextField *inputField;
|
@property (nonatomic, retain) UITextField *inputField;
|
||||||
@property (nonatomic, assign) BOOL bannerIsVisible;
|
@property (nonatomic, assign) BOOL bannerIsVisible;
|
||||||
|
- (void)toggleKeyboardWithState: (NSString *) initialText;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -53,28 +53,28 @@
|
|||||||
|
|
||||||
- (void)viewWillAppear:(BOOL)animated {
|
- (void)viewWillAppear:(BOOL)animated {
|
||||||
NSLog(@"EAGL ViewController - view Will Appear");
|
NSLog(@"EAGL ViewController - view Will Appear");
|
||||||
[self.view resumeGame];
|
[(id)self.view resumeGame];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (void)viewWillDisappear:(BOOL)animated
|
- (void)viewWillDisappear:(BOOL)animated
|
||||||
{
|
{
|
||||||
[self.view pauseGame];
|
[(id)self.view pauseGame];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)pauseGame
|
- (void)pauseGame
|
||||||
{
|
{
|
||||||
[self.view pauseGame];
|
[(id)self.view pauseGame];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)resumeGame
|
- (void)resumeGame
|
||||||
{
|
{
|
||||||
[self.view resumeGame];
|
[(id)self.view resumeGame];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)endGame
|
- (void)endGame
|
||||||
{
|
{
|
||||||
[self.view endGame];
|
[(id)self.view endGame];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewDidAppear:(BOOL)animated {
|
- (void)viewDidAppear:(BOOL)animated {
|
||||||
|
|||||||
@@ -337,7 +337,7 @@
|
|||||||
|
|
||||||
- (void)applicationWillTerminate:(UIApplication *)application
|
- (void)applicationWillTerminate:(UIApplication *)application
|
||||||
{
|
{
|
||||||
[self.glViewController.view destroyGame];
|
[(id)self.glViewController.view destroyGame];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)initializeKeyboard: (id) initialState
|
- (void)initializeKeyboard: (id) initialState
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#if (!defined IOS) && (!defined QT_CONFIG)
|
#if (!defined IOS) && (!defined QT_CONFIG)
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#pragma warning(disable : 4786)
|
#pragma warning(disable : 4786)
|
||||||
#pragma comment( lib, "giflib.lib" )
|
//#pragma comment( lib, "giflib.lib" )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <png.h>
|
#include <png.h>
|
||||||
@@ -1804,7 +1804,7 @@ static void PNGCustomReadDataFn(png_structp png_ptr, png_bytep data, png_size_t
|
|||||||
{
|
{
|
||||||
png_size_t check;
|
png_size_t check;
|
||||||
|
|
||||||
JFileSystem *fileSystem = (JFileSystem*)png_ptr->io_ptr;
|
JFileSystem *fileSystem = (JFileSystem*)png_get_io_ptr(png_ptr);
|
||||||
|
|
||||||
check = fileSystem->ReadFile(data, length);
|
check = fileSystem->ReadFile(data, length);
|
||||||
|
|
||||||
@@ -1887,7 +1887,7 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char *filename, int mode
|
|||||||
//fclose(fp);
|
//fclose(fp);
|
||||||
fileSystem->CloseFile();
|
fileSystem->CloseFile();
|
||||||
|
|
||||||
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
|
png_destroy_read_struct(&png_ptr, NULL, NULL);
|
||||||
|
|
||||||
return JGE_ERR_PNG;
|
return JGE_ERR_PNG;
|
||||||
}
|
}
|
||||||
@@ -1896,11 +1896,15 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char *filename, int mode
|
|||||||
|
|
||||||
png_set_sig_bytes(png_ptr, sig_read);
|
png_set_sig_bytes(png_ptr, sig_read);
|
||||||
png_read_info(png_ptr, info_ptr);
|
png_read_info(png_ptr, info_ptr);
|
||||||
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, int_p_NULL, int_p_NULL);
|
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, NULL, NULL);
|
||||||
png_set_strip_16(png_ptr);
|
png_set_strip_16(png_ptr);
|
||||||
png_set_packing(png_ptr);
|
png_set_packing(png_ptr);
|
||||||
if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png_ptr);
|
if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png_ptr);
|
||||||
|
#if PNG_LIBPNG_VER >= 10400
|
||||||
|
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) png_set_expand_gray_1_2_4_to_8(png_ptr);
|
||||||
|
#else
|
||||||
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) png_set_gray_1_2_4_to_8(png_ptr);
|
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) png_set_gray_1_2_4_to_8(png_ptr);
|
||||||
|
#endif
|
||||||
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr);
|
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr);
|
||||||
png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER);
|
png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER);
|
||||||
|
|
||||||
@@ -1910,7 +1914,7 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char *filename, int mode
|
|||||||
//fclose(fp);
|
//fclose(fp);
|
||||||
fileSystem->CloseFile();
|
fileSystem->CloseFile();
|
||||||
|
|
||||||
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
|
png_destroy_read_struct(&png_ptr, NULL, NULL);
|
||||||
return JGE_ERR_MALLOC_FAILED;
|
return JGE_ERR_MALLOC_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1932,7 +1936,7 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char *filename, int mode
|
|||||||
|
|
||||||
for (y = 0; y < (int)height; y++)
|
for (y = 0; y < (int)height; y++)
|
||||||
{
|
{
|
||||||
png_read_row(png_ptr, (BYTE*) line, png_bytep_NULL);
|
png_read_row(png_ptr, (BYTE*) line, NULL);
|
||||||
for (x = 0; x < (int)width; x++)
|
for (x = 0; x < (int)width; x++)
|
||||||
{
|
{
|
||||||
DWORD color32 = line[x];
|
DWORD color32 = line[x];
|
||||||
@@ -1955,7 +1959,7 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char *filename, int mode
|
|||||||
free (line);
|
free (line);
|
||||||
|
|
||||||
png_read_end(png_ptr, info_ptr);
|
png_read_end(png_ptr, info_ptr);
|
||||||
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
|
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||||
|
|
||||||
fileSystem->CloseFile();
|
fileSystem->CloseFile();
|
||||||
|
|
||||||
@@ -1998,8 +2002,15 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
|
|||||||
GifFileType *GifFileIn = NULL;
|
GifFileType *GifFileIn = NULL;
|
||||||
ColorMapObject *palette;
|
ColorMapObject *palette;
|
||||||
int ExtCode;
|
int ExtCode;
|
||||||
|
|
||||||
|
#if GIFLIB_MAJOR >= 5
|
||||||
|
if ((GifFileIn = DGifOpen(handle, readFunc, NULL)) == NULL)
|
||||||
|
return 1;
|
||||||
|
#else
|
||||||
if ((GifFileIn = DGifOpen(handle, readFunc)) == NULL)
|
if ((GifFileIn = DGifOpen(handle, readFunc)) == NULL)
|
||||||
return 1;
|
return 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
*bgcolor = 0;
|
*bgcolor = 0;
|
||||||
textureInfo.mWidth = 0;
|
textureInfo.mWidth = 0;
|
||||||
textureInfo.mHeight = 0;
|
textureInfo.mHeight = 0;
|
||||||
@@ -2008,7 +2019,11 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
|
|||||||
do {
|
do {
|
||||||
if (DGifGetRecordType(GifFileIn, &RecordType) == GIF_ERROR)
|
if (DGifGetRecordType(GifFileIn, &RecordType) == GIF_ERROR)
|
||||||
{
|
{
|
||||||
|
#if GIFLIB_MAJOR >= 5
|
||||||
|
DGifCloseFile(GifFileIn, NULL);
|
||||||
|
#else
|
||||||
DGifCloseFile(GifFileIn);
|
DGifCloseFile(GifFileIn);
|
||||||
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2017,12 +2032,20 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
|
|||||||
{
|
{
|
||||||
if (DGifGetImageDesc(GifFileIn) == GIF_ERROR)
|
if (DGifGetImageDesc(GifFileIn) == GIF_ERROR)
|
||||||
{
|
{
|
||||||
|
#if GIFLIB_MAJOR >= 5
|
||||||
|
DGifCloseFile(GifFileIn, NULL);
|
||||||
|
#else
|
||||||
DGifCloseFile(GifFileIn);
|
DGifCloseFile(GifFileIn);
|
||||||
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if((palette = (GifFileIn->SColorMap != NULL) ? GifFileIn->SColorMap : GifFileIn->Image.ColorMap) == NULL)
|
if((palette = (GifFileIn->SColorMap != NULL) ? GifFileIn->SColorMap : GifFileIn->Image.ColorMap) == NULL)
|
||||||
{
|
{
|
||||||
|
#if GIFLIB_MAJOR >= 5
|
||||||
|
DGifCloseFile(GifFileIn, NULL);
|
||||||
|
#else
|
||||||
DGifCloseFile(GifFileIn);
|
DGifCloseFile(GifFileIn);
|
||||||
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
textureInfo.mWidth = GifFileIn->Image.Width;
|
textureInfo.mWidth = GifFileIn->Image.Width;
|
||||||
@@ -2030,7 +2053,11 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
|
|||||||
*bgcolor = gif_color32(GifFileIn->SBackGroundColor);
|
*bgcolor = gif_color32(GifFileIn->SBackGroundColor);
|
||||||
if((LineIn = (GifRowType) malloc(GifFileIn->Image.Width * sizeof(GifPixelType))) == NULL)
|
if((LineIn = (GifRowType) malloc(GifFileIn->Image.Width * sizeof(GifPixelType))) == NULL)
|
||||||
{
|
{
|
||||||
|
#if GIFLIB_MAJOR >= 5
|
||||||
|
DGifCloseFile(GifFileIn, NULL);
|
||||||
|
#else
|
||||||
DGifCloseFile(GifFileIn);
|
DGifCloseFile(GifFileIn);
|
||||||
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
textureInfo.mTexWidth = getNextPower2(GifFileIn->Image.Width);
|
textureInfo.mTexWidth = getNextPower2(GifFileIn->Image.Width);
|
||||||
@@ -2040,7 +2067,11 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
|
|||||||
if((p32 = (DWORD *)malloc(sizeof(PIXEL_TYPE) * textureInfo.mTexWidth * textureInfo.mTexHeight)) == NULL)
|
if((p32 = (DWORD *)malloc(sizeof(PIXEL_TYPE) * textureInfo.mTexWidth * textureInfo.mTexHeight)) == NULL)
|
||||||
{
|
{
|
||||||
free((void *)LineIn);
|
free((void *)LineIn);
|
||||||
|
#if GIFLIB_MAJOR >= 5
|
||||||
|
DGifCloseFile(GifFileIn, NULL);
|
||||||
|
#else
|
||||||
DGifCloseFile(GifFileIn);
|
DGifCloseFile(GifFileIn);
|
||||||
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
DWORD * curr = p32;
|
DWORD * curr = p32;
|
||||||
@@ -2052,7 +2083,11 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
|
|||||||
{
|
{
|
||||||
free((void *)p32);
|
free((void *)p32);
|
||||||
free((void *)LineIn);
|
free((void *)LineIn);
|
||||||
|
#if GIFLIB_MAJOR >= 5
|
||||||
|
DGifCloseFile(GifFileIn, NULL);
|
||||||
|
#else
|
||||||
DGifCloseFile(GifFileIn);
|
DGifCloseFile(GifFileIn);
|
||||||
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
for (GifWord j = 0; j < GifFileIn->Image.Width; j ++)
|
for (GifWord j = 0; j < GifFileIn->Image.Width; j ++)
|
||||||
@@ -2081,7 +2116,11 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
|
|||||||
}
|
}
|
||||||
if(LineIn != NULL)
|
if(LineIn != NULL)
|
||||||
free((void *)LineIn);
|
free((void *)LineIn);
|
||||||
|
#if GIFLIB_MAJOR >= 5
|
||||||
|
DGifCloseFile(GifFileIn, NULL);
|
||||||
|
#else
|
||||||
DGifCloseFile(GifFileIn);
|
DGifCloseFile(GifFileIn);
|
||||||
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
while (Extension != NULL) {
|
while (Extension != NULL) {
|
||||||
@@ -2094,7 +2133,11 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
|
|||||||
}
|
}
|
||||||
if(LineIn != NULL)
|
if(LineIn != NULL)
|
||||||
free((void *)LineIn);
|
free((void *)LineIn);
|
||||||
|
#if GIFLIB_MAJOR >= 5
|
||||||
|
DGifCloseFile(GifFileIn, NULL);
|
||||||
|
#else
|
||||||
DGifCloseFile(GifFileIn);
|
DGifCloseFile(GifFileIn);
|
||||||
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2109,7 +2152,11 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
|
|||||||
|
|
||||||
if(LineIn != NULL)
|
if(LineIn != NULL)
|
||||||
free((void *)LineIn);
|
free((void *)LineIn);
|
||||||
|
#if GIFLIB_MAJOR >= 5
|
||||||
|
DGifCloseFile(GifFileIn, NULL);
|
||||||
|
#else
|
||||||
DGifCloseFile(GifFileIn);
|
DGifCloseFile(GifFileIn);
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,8 @@
|
|||||||
JMusic::JMusic()
|
JMusic::JMusic()
|
||||||
#ifdef USE_PHONON
|
#ifdef USE_PHONON
|
||||||
: mOutput(0), mMediaObject(0)
|
: mOutput(0), mMediaObject(0)
|
||||||
|
#elif defined QT_CONFIG
|
||||||
|
: playlist(0), player(0)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -40,11 +42,16 @@ int JMusic::getPlayTime(){
|
|||||||
|
|
||||||
JMusic::~JMusic()
|
JMusic::~JMusic()
|
||||||
{
|
{
|
||||||
#ifdef USE_PHONON
|
#if defined USE_PHONON
|
||||||
if(mOutput)
|
if(mOutput)
|
||||||
delete mOutput;
|
delete mOutput;
|
||||||
if(mMediaObject)
|
if(mMediaObject)
|
||||||
delete mMediaObject;
|
delete mMediaObject;
|
||||||
|
#elif defined QT_CONFIG
|
||||||
|
if(player)
|
||||||
|
delete player;
|
||||||
|
if(playlist)
|
||||||
|
delete playlist;
|
||||||
#elif defined WITH_FMOD
|
#elif defined WITH_FMOD
|
||||||
JSoundSystem::GetInstance()->StopMusic(this);
|
JSoundSystem::GetInstance()->StopMusic(this);
|
||||||
if (mTrack) FSOUND_Sample_Free(mTrack);
|
if (mTrack) FSOUND_Sample_Free(mTrack);
|
||||||
@@ -69,7 +76,10 @@ JSample::JSample()
|
|||||||
|
|
||||||
JSample::~JSample()
|
JSample::~JSample()
|
||||||
{
|
{
|
||||||
#ifdef USE_PHONON
|
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||||
|
if(effect)
|
||||||
|
delete effect;
|
||||||
|
#elif USE_PHONON
|
||||||
if(mOutput)
|
if(mOutput)
|
||||||
delete mOutput;
|
delete mOutput;
|
||||||
if(mMediaObject)
|
if(mMediaObject)
|
||||||
@@ -144,65 +154,84 @@ void JSoundSystem::DestroySoundSystem()
|
|||||||
|
|
||||||
JMusic *JSoundSystem::LoadMusic(const char *fileName)
|
JMusic *JSoundSystem::LoadMusic(const char *fileName)
|
||||||
{
|
{
|
||||||
#ifdef USE_PHONON
|
JMusic* music = NULL;
|
||||||
JMusic* music = new JMusic();
|
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||||
if (music)
|
music = new JMusic();
|
||||||
{
|
if (music)
|
||||||
music->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0);
|
|
||||||
music->mMediaObject = new Phonon::MediaObject(0);
|
|
||||||
string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
|
|
||||||
music->mMediaObject->setCurrentSource(QString(fullpath.c_str()));
|
|
||||||
Phonon::Path mediapath = Phonon::createPath(music->mMediaObject, music->mOutput);
|
|
||||||
Q_ASSERT(mediapath.isValid());
|
|
||||||
}
|
|
||||||
return music;
|
|
||||||
#elif (defined WITH_FMOD)
|
|
||||||
JMusic* music = new JMusic();
|
|
||||||
if (music)
|
|
||||||
{
|
{
|
||||||
JFileSystem* fileSystem = JFileSystem::GetInstance();
|
music->player = new QMediaPlayer;
|
||||||
if (fileSystem->OpenFile(fileName))
|
music->player->setVolume(100);
|
||||||
{
|
music->playlist = new QMediaPlaylist;
|
||||||
int size = fileSystem->GetFileSize();
|
music->fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
|
||||||
char *buffer = new char[size];
|
music->playlist->addMedia(QUrl::fromLocalFile(music->fullpath.c_str()));
|
||||||
fileSystem->ReadFile(buffer, size);
|
music->playlist->setCurrentIndex(0);
|
||||||
music->mTrack = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size);
|
}
|
||||||
|
#elif defined USE_PHONON
|
||||||
delete[] buffer;
|
music = new JMusic();
|
||||||
fileSystem->CloseFile();
|
if (music)
|
||||||
}
|
{
|
||||||
|
music->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0);
|
||||||
|
music->mMediaObject = new Phonon::MediaObject(0);
|
||||||
|
string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
|
||||||
|
music->mMediaObject->setCurrentSource(QString(fullpath.c_str()));
|
||||||
|
Phonon::Path mediapath = Phonon::createPath(music->mMediaObject, music->mOutput);
|
||||||
|
Q_ASSERT(mediapath.isValid());
|
||||||
|
}
|
||||||
|
#elif (defined WITH_FMOD)
|
||||||
|
music = new JMusic();
|
||||||
|
if (music)
|
||||||
|
{
|
||||||
|
JFileSystem* fileSystem = JFileSystem::GetInstance();
|
||||||
|
if (fileSystem->OpenFile(fileName))
|
||||||
|
{
|
||||||
|
int size = fileSystem->GetFileSize();
|
||||||
|
char *buffer = new char[size];
|
||||||
|
fileSystem->ReadFile(buffer, size);
|
||||||
|
music->mTrack = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size);
|
||||||
|
|
||||||
|
delete[] buffer;
|
||||||
|
fileSystem->CloseFile();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return music;
|
|
||||||
#else
|
#else
|
||||||
cerr << fileName << endl;
|
cerr << fileName << endl;
|
||||||
return NULL;
|
|
||||||
#endif
|
#endif
|
||||||
|
return music;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JSoundSystem::PlayMusic(JMusic *music, bool looping)
|
void JSoundSystem::PlayMusic(JMusic *music, bool looping)
|
||||||
{
|
{
|
||||||
#ifdef USE_PHONON
|
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||||
if (music && music->mMediaObject && music->mOutput)
|
if(music && music->player && music->playlist)
|
||||||
{
|
|
||||||
if(looping)
|
|
||||||
{
|
{
|
||||||
music->mMediaObject->connect(music->mMediaObject, SIGNAL(aboutToFinish()), music, SLOT(seekAtTheBegining()));
|
if(looping)
|
||||||
|
music->playlist->setPlaybackMode(QMediaPlaylist::Loop);
|
||||||
|
|
||||||
|
music->player->setPlaylist(music->playlist);
|
||||||
|
music->player->play();
|
||||||
}
|
}
|
||||||
music->mOutput->setVolume((qreal)mVolume*0.01);
|
#elif USE_PHONON
|
||||||
music->mMediaObject->play();
|
if (music && music->mMediaObject && music->mOutput)
|
||||||
|
|
||||||
}
|
|
||||||
#elif (defined WITH_FMOD)
|
|
||||||
if (music && music->mTrack)
|
|
||||||
{
|
{
|
||||||
mChannel = FSOUND_PlaySound(mChannel, music->mTrack);
|
if(looping)
|
||||||
SetMusicVolume(mVolume);
|
{
|
||||||
|
music->mMediaObject->connect(music->mMediaObject, SIGNAL(aboutToFinish()), music, SLOT(seekAtTheBegining()));
|
||||||
|
}
|
||||||
|
music->mOutput->setVolume((qreal)mVolume*0.01);
|
||||||
|
music->mMediaObject->play();
|
||||||
|
|
||||||
if (looping)
|
}
|
||||||
FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_NORMAL);
|
#elif (defined WITH_FMOD)
|
||||||
else
|
if (music && music->mTrack)
|
||||||
FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_OFF);
|
{
|
||||||
|
mChannel = FSOUND_PlaySound(mChannel, music->mTrack);
|
||||||
|
SetMusicVolume(mVolume);
|
||||||
|
|
||||||
|
if (looping)
|
||||||
|
FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_NORMAL);
|
||||||
|
else
|
||||||
|
FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_OFF);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
music = 0;
|
music = 0;
|
||||||
@@ -213,7 +242,12 @@ void JSoundSystem::PlayMusic(JMusic *music, bool looping)
|
|||||||
|
|
||||||
void JSoundSystem::StopMusic(JMusic *music)
|
void JSoundSystem::StopMusic(JMusic *music)
|
||||||
{
|
{
|
||||||
#ifdef USE_PHONON
|
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||||
|
if (music && music->player && music->playlist)
|
||||||
|
{
|
||||||
|
music->player->stop();
|
||||||
|
}
|
||||||
|
#elif defined USE_PHONON
|
||||||
if (music && music->mMediaObject && music->mOutput)
|
if (music && music->mMediaObject && music->mOutput)
|
||||||
{
|
{
|
||||||
music->mMediaObject->stop();
|
music->mMediaObject->stop();
|
||||||
@@ -264,47 +298,61 @@ void JSoundSystem::SetSfxVolume(int volume){
|
|||||||
|
|
||||||
JSample *JSoundSystem::LoadSample(const char *fileName)
|
JSample *JSoundSystem::LoadSample(const char *fileName)
|
||||||
{
|
{
|
||||||
#if (defined USE_PHONON)
|
JSample* sample = NULL;
|
||||||
JSample* sample = new JSample();
|
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||||
if (sample)
|
sample = new JSample();
|
||||||
{
|
if (sample)
|
||||||
sample->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0);
|
|
||||||
sample->mMediaObject = new Phonon::MediaObject(0);
|
|
||||||
string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
|
|
||||||
sample->mMediaObject->setCurrentSource(QString(fullpath.c_str()));
|
|
||||||
Phonon::Path mediapath = Phonon::createPath(sample->mMediaObject, sample->mOutput);
|
|
||||||
Q_ASSERT(mediapath.isValid());
|
|
||||||
}
|
|
||||||
return sample;
|
|
||||||
#elif (defined WITH_FMOD)
|
|
||||||
JSample* sample = new JSample();
|
|
||||||
if (sample)
|
|
||||||
{
|
{
|
||||||
JFileSystem* fileSystem = JFileSystem::GetInstance();
|
string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
|
||||||
if (fileSystem->OpenFile(fileName))
|
sample->effect = new QMediaPlayer;
|
||||||
{
|
sample->effect->setMedia(QUrl::fromLocalFile(fullpath.c_str()));
|
||||||
int size = fileSystem->GetFileSize();
|
sample->effect->setVolume(100);
|
||||||
char *buffer = new char[size];
|
sample->mSample = &(sample->effect);
|
||||||
fileSystem->ReadFile(buffer, size);
|
}
|
||||||
sample->mSample = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size);
|
#elif (defined USE_PHONON)
|
||||||
|
sample = new JSample();
|
||||||
|
if (sample)
|
||||||
|
{
|
||||||
|
sample->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0);
|
||||||
|
sample->mMediaObject = new Phonon::MediaObject(0);
|
||||||
|
string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
|
||||||
|
sample->mMediaObject->setCurrentSource(QString(fullpath.c_str()));
|
||||||
|
Phonon::Path mediapath = Phonon::createPath(sample->mMediaObject, sample->mOutput);
|
||||||
|
Q_ASSERT(mediapath.isValid());
|
||||||
|
}
|
||||||
|
#elif (defined WITH_FMOD)
|
||||||
|
sample = new JSample();
|
||||||
|
if (sample)
|
||||||
|
{
|
||||||
|
JFileSystem* fileSystem = JFileSystem::GetInstance();
|
||||||
|
if (fileSystem->OpenFile(fileName))
|
||||||
|
{
|
||||||
|
int size = fileSystem->GetFileSize();
|
||||||
|
char *buffer = new char[size];
|
||||||
|
fileSystem->ReadFile(buffer, size);
|
||||||
|
sample->mSample = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size);
|
||||||
|
|
||||||
delete[] buffer;
|
delete[] buffer;
|
||||||
fileSystem->CloseFile();
|
fileSystem->CloseFile();
|
||||||
}else
|
}else
|
||||||
sample->mSample = NULL;
|
sample->mSample = NULL;
|
||||||
|
|
||||||
}
|
}
|
||||||
return sample;
|
|
||||||
#else
|
#else
|
||||||
cerr << fileName << endl;
|
cerr << fileName << endl;
|
||||||
return NULL;
|
|
||||||
#endif
|
#endif
|
||||||
|
return sample;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JSoundSystem::PlaySample(JSample *sample)
|
void JSoundSystem::PlaySample(JSample *sample)
|
||||||
{
|
{
|
||||||
#ifdef USE_PHONON
|
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||||
|
if(sample)
|
||||||
|
{
|
||||||
|
sample->effect->play();
|
||||||
|
}
|
||||||
|
#elif defined USE_PHONON
|
||||||
if (sample && sample->mMediaObject && sample->mOutput)
|
if (sample && sample->mMediaObject && sample->mOutput)
|
||||||
{
|
{
|
||||||
sample->mOutput->setVolume((qreal)mSampleVolume*0.01);
|
sample->mOutput->setVolume((qreal)mSampleVolume*0.01);
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#elif LINUX
|
#elif LINUX
|
||||||
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ static int __largest_block = __MEM_BLOCKS;
|
|||||||
static int __mem_free = __MEM_BLOCKS;
|
static int __mem_free = __MEM_BLOCKS;
|
||||||
|
|
||||||
|
|
||||||
inline void* vrelptr( void *ptr )
|
void* vrelptr( void *ptr )
|
||||||
{
|
{
|
||||||
return (void*)((unsigned int)ptr & ~__MEM_START);
|
return (void*)((unsigned int)ptr & ~__MEM_START);
|
||||||
}
|
}
|
||||||
182
JGE/src/windows/JSfx.cpp
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
#include <Windows.h>
|
||||||
|
#include <Mmsystem.h>
|
||||||
|
#include <mciapi.h>
|
||||||
|
//these two headers are already included in the <Windows.h> header
|
||||||
|
#pragma comment(lib, "Winmm.lib")
|
||||||
|
|
||||||
|
#include "DebugRoutines.h"
|
||||||
|
#include "../../include/JSoundSystem.h"
|
||||||
|
#include "../../include/JFileSystem.h"
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
JMusic::JMusic()
|
||||||
|
:
|
||||||
|
mTrack(0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void JMusic::Update(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int JMusic::getPlayTime(){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
JMusic::~JMusic()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
JSample::JSample()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JSample::~JSample()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned long JSample::fileSize()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
JSoundSystem* JSoundSystem::mInstance = NULL;
|
||||||
|
|
||||||
|
JSoundSystem* JSoundSystem::GetInstance()
|
||||||
|
{
|
||||||
|
if (mInstance == NULL)
|
||||||
|
{
|
||||||
|
mInstance = new JSoundSystem();
|
||||||
|
mInstance->InitSoundSystem();
|
||||||
|
}
|
||||||
|
return mInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JSoundSystem::Destroy()
|
||||||
|
{
|
||||||
|
if (mInstance)
|
||||||
|
{
|
||||||
|
mInstance->DestroySoundSystem();
|
||||||
|
delete mInstance;
|
||||||
|
mInstance = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
JSoundSystem::JSoundSystem()
|
||||||
|
{
|
||||||
|
mVolume = 0;
|
||||||
|
mSampleVolume = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
JSoundSystem::~JSoundSystem()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void JSoundSystem::InitSoundSystem()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JSoundSystem::DestroySoundSystem()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
JMusic *JSoundSystem::LoadMusic(const char *fileName)
|
||||||
|
{
|
||||||
|
JMusic* music = NULL;
|
||||||
|
music = new JMusic();
|
||||||
|
if (music)
|
||||||
|
{
|
||||||
|
music->filename = JFileSystem::GetInstance()->GetResourceFile(fileName);
|
||||||
|
std::string aString = "open \"" + music->filename + "\" type mpegvideo alias mp3";
|
||||||
|
mciSendString(aString.c_str(), NULL, 0, NULL);
|
||||||
|
music->mTrack = (void*)-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return music;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JSoundSystem::PlayMusic(JMusic *music, bool looping)
|
||||||
|
{
|
||||||
|
if (music && music->mTrack)
|
||||||
|
{
|
||||||
|
if(looping)
|
||||||
|
mciSendString("play mp3 repeat", NULL, 0, NULL);
|
||||||
|
else
|
||||||
|
mciSendString("play mp3", NULL, 0, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JSoundSystem::StopMusic(JMusic *music)
|
||||||
|
{
|
||||||
|
if (music && music->mTrack)
|
||||||
|
{
|
||||||
|
mciSendString("stop mp3", NULL, 0, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JSoundSystem::PauseMusic(JMusic *music)
|
||||||
|
{
|
||||||
|
if (music && music->mTrack)
|
||||||
|
{
|
||||||
|
mciSendString("pause mp3", NULL, 0, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JSoundSystem::ResumeMusic(JMusic *music)
|
||||||
|
{
|
||||||
|
if (music && music->mTrack)
|
||||||
|
{
|
||||||
|
mciSendString("resume mp3", NULL, 0, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JSoundSystem::SetVolume(int volume)
|
||||||
|
{
|
||||||
|
SetMusicVolume(volume);
|
||||||
|
SetSfxVolume(volume);
|
||||||
|
}
|
||||||
|
|
||||||
|
void JSoundSystem::SetMusicVolume(int volume)
|
||||||
|
{
|
||||||
|
mVolume = volume;
|
||||||
|
}
|
||||||
|
|
||||||
|
void JSoundSystem::SetSfxVolume(int volume)
|
||||||
|
{
|
||||||
|
mSampleVolume = volume;
|
||||||
|
SetMusicVolume(mVolume);
|
||||||
|
}
|
||||||
|
|
||||||
|
JSample *JSoundSystem::LoadSample(const char *fileName)
|
||||||
|
{
|
||||||
|
JSample* sample = NULL;
|
||||||
|
sample = new JSample();
|
||||||
|
if (sample)
|
||||||
|
{
|
||||||
|
sample->filename = JFileSystem::GetInstance()->GetResourceFile(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
return sample;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JSoundSystem::PlaySample(JSample *sample)
|
||||||
|
{
|
||||||
|
if(sample)
|
||||||
|
{
|
||||||
|
sndPlaySound(sample->filename.c_str(), SND_FILENAME | SND_ASYNC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
11
README.md
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
|
|
||||||
[](https://travis-ci.org/WagicProject/wagic)
|
[](https://travis-ci.org/WagicProject/wagic)
|
||||||
|
[](https://ci.appveyor.com/project/xawotihs/wagic/branch/master)
|
||||||
|
[](https://coveralls.io/r/WagicProject/wagic?branch=master)
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
@@ -16,6 +18,11 @@ Wagic, the Homebrew, is a C++ game engine that allows to play card games against
|
|||||||
It is highly customizable and allows the player to tweak the rules / create their own cards, their own themes, etc...
|
It is highly customizable and allows the player to tweak the rules / create their own cards, their own themes, etc...
|
||||||
|
|
||||||
|
|
||||||
Info, Downloads, and more at http://wololo.net
|
Info, downloads, discussions and more at http://wololo.net/forum/index.php
|
||||||
|
|
||||||
-
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Sample round play-through video
|
||||||
|
[](http://www.youtube.com/watch?v=WUFSAPZuDIk)
|
||||||
|
|||||||
89
appveyor.yml
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
# Notes:
|
||||||
|
# - Minimal appveyor.yml file is an empty file. All sections are optional.
|
||||||
|
# - Indent each level of configuration with 2 spaces. Do not use tabs!
|
||||||
|
# - All section names are case-sensitive.
|
||||||
|
# - Section names should be unique on each level.
|
||||||
|
|
||||||
|
# branches to build
|
||||||
|
branches:
|
||||||
|
# blacklist
|
||||||
|
except:
|
||||||
|
- travis_mac_osx
|
||||||
|
# Do not build on tags (GitHub only)
|
||||||
|
skip_tags: true
|
||||||
|
|
||||||
|
#---------------------------------#
|
||||||
|
# environment configuration #
|
||||||
|
#---------------------------------#
|
||||||
|
|
||||||
|
environment:
|
||||||
|
DXSDK_DIR: "C:/Program Files (x86)/Microsoft DirectX SDK/"
|
||||||
|
GH_TOKEN:
|
||||||
|
secure: dYnBDQkiY5oVjIlswzBX9BJigNtBGXgGlp1tK3XbHzrDEDrs2vaKD5m+Oz5OSz1C
|
||||||
|
|
||||||
|
# scripts that run after cloning repository
|
||||||
|
install:
|
||||||
|
- ps: (new-object net.webclient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'C:/get-pip.py')
|
||||||
|
- "C:/Python27/python.exe C:/get-pip.py"
|
||||||
|
- "C:/Python27/Scripts/pip.exe install pyjavaproperties"
|
||||||
|
- "C:/Python27/Scripts/pip.exe install github3.py"
|
||||||
|
- git submodule update --init --recursive
|
||||||
|
- cd thirdparty/SDL2
|
||||||
|
# - git checkout release-2.0.3
|
||||||
|
- cd ../..
|
||||||
|
|
||||||
|
#---------------------------------#
|
||||||
|
# build configuration #
|
||||||
|
#---------------------------------#
|
||||||
|
|
||||||
|
# build Configuration, i.e. Debug, Release, etc.
|
||||||
|
configuration: Release
|
||||||
|
|
||||||
|
# scripts to run before build
|
||||||
|
before_build:
|
||||||
|
- echo Running cmake...
|
||||||
|
- mkdir build
|
||||||
|
- cd build
|
||||||
|
- cmake -Dbackend_sdl=ON ..
|
||||||
|
- cd ..
|
||||||
|
|
||||||
|
build:
|
||||||
|
project: build/wagic.sln # path to Visual Studio solution or project
|
||||||
|
|
||||||
|
#---------------------------------#
|
||||||
|
# tests configuration #
|
||||||
|
#---------------------------------#
|
||||||
|
|
||||||
|
# to disable automatic tests
|
||||||
|
test: off
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------#
|
||||||
|
# artifacts configuration #
|
||||||
|
#---------------------------------#
|
||||||
|
|
||||||
|
artifacts:
|
||||||
|
# pushing windows package
|
||||||
|
- path: projects\mtg\bin\Wagic-windows*.zip
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------#
|
||||||
|
# deployment configuration #
|
||||||
|
#---------------------------------#
|
||||||
|
|
||||||
|
# scripts to run before deployment
|
||||||
|
before_deploy:
|
||||||
|
- cd projects/mtg/bin
|
||||||
|
- "C:/Python27/python.exe createWindowsZip.py -b ../../../build"
|
||||||
|
- cd ../../..
|
||||||
|
|
||||||
|
# scripts to run after deployment
|
||||||
|
after_deploy:
|
||||||
|
|
||||||
|
# to run your custom scripts instead of provider deployments
|
||||||
|
deploy_script:
|
||||||
|
- "C:/Python27/python.exe tools/upload-binaries.py -t %GH_TOKEN% -s %APPVEYOR_REPO_COMMIT% -l projects/mtg/bin/Wagic-windows.zip -r Wagic-windows.zip -b %APPVEYOR_REPO_BRANCH%"
|
||||||
|
|
||||||
|
# to disable deployment
|
||||||
|
#deploy: off
|
||||||
|
|
||||||
3
platforms/android/configure.cmake
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
add_definitions(-DANDROID -DLINUX)
|
||||||
|
add_definitions(-D_STLP_USE_SIMPLE_NODE_ALLOC -D__arm__ -D_REENTRANT -D_GLIBCXX__PTHREADS)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||||
18
platforms/android/package/AndroidManifest.xml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="0192" android:versionName="@string/app_version" package="net.wagic.app">
|
||||||
|
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||||
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||||
|
<application android:debuggable="true" android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
|
||||||
|
<activity android:configChanges="keyboard|keyboardHidden|orientation" android:label="@string/app_name" android:name="org.libsdl.app.SDLActivity" android:screenOrientation="sensorLandscape">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity android:configChanges="keyboard|keyboardHidden|orientation" android:name="com.google.ads.AdActivity" android:screenOrientation="sensorLandscape"/>
|
||||||
|
</application>
|
||||||
|
<uses-sdk android:minSdkVersion="@ANDROID_NATIVE_API_LEVEL@" android:targetSdkVersion="@ANDROID_NATIVE_API_LEVEL@"/>
|
||||||
|
</manifest>
|
||||||
121
platforms/android/package/CMakeLists.txt
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
if(NOT ANDROID_PACKAGE_RELEASE)
|
||||||
|
set(ANDROID_PACKAGE_RELEASE 1)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT ANDROID_PACKAGE_PLATFORM)
|
||||||
|
if(ARMEABI_V7A)
|
||||||
|
if(NEON)
|
||||||
|
set(ANDROID_PACKAGE_PLATFORM armv7a_neon)
|
||||||
|
else()
|
||||||
|
set(ANDROID_PACKAGE_PLATFORM armv7a)
|
||||||
|
endif()
|
||||||
|
elseif(ARMEABI_V6)
|
||||||
|
set(ANDROID_PACKAGE_PLATFORM armv6)
|
||||||
|
elseif(ARMEABI)
|
||||||
|
set(ANDROID_PACKAGE_PLATFORM armv5)
|
||||||
|
elseif(X86)
|
||||||
|
set(ANDROID_PACKAGE_PLATFORM x86)
|
||||||
|
elseif(MIPS)
|
||||||
|
set(ANDROID_PACKAGE_PLATFORM mips)
|
||||||
|
else()
|
||||||
|
message(ERROR "Can not automatically determine the value for ANDROID_PACKAGE_PLATFORM")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT ANDROID_PACKAGE_PLATFORM_NAME)
|
||||||
|
if(ARMEABI_V7A)
|
||||||
|
if(NEON)
|
||||||
|
set(ANDROID_PACKAGE_PLATFORM_NAME "armeabi-v7a with NEON")
|
||||||
|
else()
|
||||||
|
set(ANDROID_PACKAGE_PLATFORM_NAME "armeabi-v7a")
|
||||||
|
endif()
|
||||||
|
elseif(ARMEABI_V6)
|
||||||
|
set(ANDROID_PACKAGE_PLATFORM_NAME "armeabi-v6")
|
||||||
|
elseif(ARMEABI)
|
||||||
|
set(ANDROID_PACKAGE_PLATFORM_NAME "armeabi")
|
||||||
|
elseif(X86)
|
||||||
|
set(ANDROID_PACKAGE_PLATFORM_NAME "x86")
|
||||||
|
elseif(MIPS)
|
||||||
|
set(ANDROID_PACKAGE_PLATFORM_NAME "mips")
|
||||||
|
else()
|
||||||
|
message(ERROR "Can not automatically determine the value for ANDROID_PACKAGE_PLATFORM_NAME")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if("${ANDROID_NATIVE_API_LEVEL}" MATCHES "[1-9][0-9]*$")
|
||||||
|
set(ANDROID_SDK_VERSION ${CMAKE_MATCH_0})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT ANDROID_SDK_VERSION GREATER 7)
|
||||||
|
set(ANDROID_SDK_VERSION 8)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(PACKAGE_DIR "${CMAKE_BINARY_DIR}/package")
|
||||||
|
|
||||||
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/AndroidManifest.xml"
|
||||||
|
"${PACKAGE_DIR}/AndroidManifest.xml" @ONLY)
|
||||||
|
#configure_file("${CMAKE_CURRENT_SOURCE_DIR}/build.xml"
|
||||||
|
# "${PACKAGE_DIR}/build.xml" COPYONLY)
|
||||||
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/res/values/strings.xml"
|
||||||
|
"${PACKAGE_DIR}/res/values/strings.xml" COPYONLY)
|
||||||
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/res/drawable-hdpi/icon.png"
|
||||||
|
"${PACKAGE_DIR}/res/drawable-hdpi/icon.png" COPYONLY)
|
||||||
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/res/drawable-ldpi/icon.png"
|
||||||
|
"${PACKAGE_DIR}/res/drawable-ldpi/icon.png" COPYONLY)
|
||||||
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/res/drawable-mdpi/icon.png"
|
||||||
|
"${PACKAGE_DIR}/res/drawable-mdpi/icon.png" COPYONLY)
|
||||||
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/res/layout/main.xml"
|
||||||
|
"${PACKAGE_DIR}/res/layout/main.xml" COPYONLY)
|
||||||
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/assets/_keystore/wagic-release.keystore"
|
||||||
|
"${PACKAGE_DIR}/assets/_keystore/wagic-release.keystore" COPYONLY)
|
||||||
|
|
||||||
|
string( REGEX MATCH "[0-9]+" ANDROID_NATIVE_API_LEVEL_NUMBER "${ANDROID_NATIVE_API_LEVEL}" )
|
||||||
|
|
||||||
|
set(target_name "Wagic_${WAGIC_VERSION}_binary_pack_${ANDROID_PACKAGE_PLATFORM}")
|
||||||
|
get_target_property(wagic_location wagic LOCATION)
|
||||||
|
|
||||||
|
string(TOLOWER ${CMAKE_BUILD_TYPE} android_build_type)
|
||||||
|
|
||||||
|
set(android_proj_target_files ${ANDROID_PROJECT_FILES})
|
||||||
|
list_add_prefix(android_proj_target_files "${PACKAGE_DIR}/")
|
||||||
|
set(APK_NAME "${PACKAGE_DIR}/bin/${target_name}-${android_build_type}-unsigned.apk")
|
||||||
|
|
||||||
|
file(GLOB camera_wrappers "${OpenCV_SOURCE_DIR}/3rdparty/lib/${ANDROID_NDK_ABI_NAME}/libnative_camera_r*.so")
|
||||||
|
set(CAMERA_LIB_COMMANDS "")
|
||||||
|
|
||||||
|
foreach(wrapper ${camera_wrappers})
|
||||||
|
list(APPEND CAMERA_LIB_COMMANDS COMMAND ${CMAKE_COMMAND} -E copy "${wrapper}" "${PACKAGE_DIR}/libs/${ANDROID_NDK_ABI_NAME}/")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${APK_NAME}"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E remove_directory "${PACKAGE_DIR}/libs"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E remove_directory "${PACKAGE_DIR}/bin"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E remove_directory "${PACKAGE_DIR}/gen"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E remove ${android_proj_target_files}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${PACKAGE_DIR}/src"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${PACKAGE_DIR}/libs/${ANDROID_NDK_ABI_NAME}/"
|
||||||
|
# COMMAND ${CMAKE_COMMAND} -E copy "${SDL2_LIBRARY}" "${PACKAGE_DIR}/libs/${ANDROID_NDK_ABI_NAME}/"
|
||||||
|
# COMMAND ${CMAKE_COMMAND} -E copy "${ZLIB_LIBRARY}" "${PACKAGE_DIR}/libs/${ANDROID_NDK_ABI_NAME}/"
|
||||||
|
# COMMAND ${CMAKE_COMMAND} -E copy "${OPENSL_LIBRARY}" "${PACKAGE_DIR}/libs/${ANDROID_NDK_ABI_NAME}/"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy "${wagic_location}" "${PACKAGE_DIR}/libs/${ANDROID_NDK_ABI_NAME}/"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/src" "${PACKAGE_DIR}/src"
|
||||||
|
# COMMAND ${ANDROID_EXECUTABLE} --silent update project --path "${PACKAGE_DIR}" --target "android-${ANDROID_NATIVE_API_LEVEL}" --name "${target_name}"
|
||||||
|
COMMAND ${ANDROID_EXECUTABLE} --silent update project --path "${PACKAGE_DIR}" --target "android-10" --name "${target_name}"
|
||||||
|
COMMAND ${ANT_EXECUTABLE} -noinput -k ${android_build_type}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E touch "${APK_NAME}"
|
||||||
|
WORKING_DIRECTORY "${PACKAGE_DIR}"
|
||||||
|
MAIN_DEPENDENCY "${PACKAGE_DIR}/${ANDROID_MANIFEST_FILE}"
|
||||||
|
DEPENDS
|
||||||
|
"${PACKAGE_DIR}/res/values/strings.xml"
|
||||||
|
"${PACKAGE_DIR}/res/layout/main.xml"
|
||||||
|
"${PACKAGE_DIR}/res/drawable-mdpi/icon.png"
|
||||||
|
"${PACKAGE_DIR}/res/drawable-ldpi/icon.png"
|
||||||
|
"${PACKAGE_DIR}/res/drawable-hdpi/icon.png"
|
||||||
|
"${PACKAGE_DIR}/${ANDROID_MANIFEST_FILE}"
|
||||||
|
wagic
|
||||||
|
)
|
||||||
|
|
||||||
|
install(FILES "${APK_NAME}" DESTINATION "apk/" COMPONENT main)
|
||||||
|
add_custom_target(android_package ALL SOURCES "${APK_NAME}" )
|
||||||
|
add_dependencies(android_package wagic)
|
||||||
BIN
platforms/android/package/assets/_keystore/wagic-release.keystore
Executable file
BIN
platforms/android/package/res/drawable-hdpi/icon.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
platforms/android/package/res/drawable-ldpi/icon.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
platforms/android/package/res/drawable-mdpi/icon.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
14
platforms/android/package/res/layout/main.xml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:id="@+id/mainLayout"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Wagic"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
6
platforms/android/package/res/values/strings.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="app_name">Wagic</string>
|
||||||
|
<string name="app_version">0.19.2</string>
|
||||||
|
<string name="info_text">Wagic v0.19.2\\nAll Rights Reserved.</string>
|
||||||
|
</resources>
|
||||||
@@ -0,0 +1,174 @@
|
|||||||
|
package net.wagic.utils;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
import android.os.Environment;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
public class StorageOptions
|
||||||
|
{
|
||||||
|
private static ArrayList<String> mMounts = new ArrayList<String>();
|
||||||
|
private static ArrayList<String> mVold = new ArrayList<String>();
|
||||||
|
|
||||||
|
public static String[] labels;
|
||||||
|
public static String[] paths;
|
||||||
|
public static int count = 0;
|
||||||
|
public static String defaultMountPoint;
|
||||||
|
|
||||||
|
public static void determineStorageOptions()
|
||||||
|
{
|
||||||
|
initializeMountPoints();
|
||||||
|
readMountsFile();
|
||||||
|
readVoldFile();
|
||||||
|
compareMountsWithVold();
|
||||||
|
testAndCleanMountsList();
|
||||||
|
setProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void initializeMountPoints()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
defaultMountPoint = Environment.getExternalStorageDirectory().getCanonicalPath();
|
||||||
|
} catch (Exception ioEx)
|
||||||
|
{
|
||||||
|
// an error occurred trying to get the canonical path, use '/mnt/sdcard' instead
|
||||||
|
defaultMountPoint = "/mnt/sdcard";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void readMountsFile()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Scan the /proc/mounts file and look for lines like this: /dev/block/vold/179:1 /mnt/sdcard vfat
|
||||||
|
* rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0602,dmask=0602,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
|
||||||
|
*
|
||||||
|
* When one is found, split it into its elements and then pull out the path to the that mount point and add it to the arraylist
|
||||||
|
*/
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Scanner scanner = new Scanner(new File("/proc/mounts"));
|
||||||
|
while (scanner.hasNext())
|
||||||
|
{
|
||||||
|
String line = scanner.nextLine();
|
||||||
|
if (line.startsWith("/dev/block/vold/"))
|
||||||
|
{
|
||||||
|
String[] lineElements = line.split(" ");
|
||||||
|
lineElements[1].replaceAll(":.*$", "");
|
||||||
|
mMounts.add(lineElements[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (FileNotFoundException fnfex)
|
||||||
|
{
|
||||||
|
// if proc/mount doesn't exist we just use
|
||||||
|
Log.i(StorageOptions.class.getCanonicalName(), fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
|
||||||
|
mMounts.add(defaultMountPoint);
|
||||||
|
} catch (Exception e)
|
||||||
|
{
|
||||||
|
Log.e(StorageOptions.class.getCanonicalName(), e.getMessage() + ": unknown exception while reading mounts file");
|
||||||
|
mMounts.add(defaultMountPoint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void readVoldFile()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Scan the /system/etc/vold.fstab file and look for lines like this: dev_mount sdcard /mnt/sdcard 1 /devices/platform/s3c-sdhci.0/mmc_host/mmc0
|
||||||
|
*
|
||||||
|
* When one is found, split it into its elements and then pull out the path to the that mount point and add it to the arraylist
|
||||||
|
*/
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Scanner scanner = new Scanner(new File("/system/etc/vold.fstab"));
|
||||||
|
while (scanner.hasNext())
|
||||||
|
{
|
||||||
|
String line = scanner.nextLine();
|
||||||
|
if (line.startsWith("dev_mount"))
|
||||||
|
{
|
||||||
|
String[] lineElements = line.split(" ");
|
||||||
|
lineElements[2] = lineElements[2].replaceAll(":.*$", "");
|
||||||
|
mVold.add(lineElements[2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (FileNotFoundException fnfex)
|
||||||
|
{
|
||||||
|
// if vold.fstab doesn't exist we use the value gathered from the Environment
|
||||||
|
Log.i(StorageOptions.class.getCanonicalName(), fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
|
||||||
|
mMounts.add(defaultMountPoint);
|
||||||
|
} catch (Exception e)
|
||||||
|
{
|
||||||
|
Log.e(StorageOptions.class.getCanonicalName(), e.getMessage() + ": unknown exception while reading mounts file");
|
||||||
|
mMounts.add(defaultMountPoint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void compareMountsWithVold()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Sometimes the two lists of mount points will be different. We only want those mount points that are in both list.
|
||||||
|
*
|
||||||
|
* Compare the two lists together and remove items that are not in both lists.
|
||||||
|
*/
|
||||||
|
|
||||||
|
for (int i = 0; i < mMounts.size(); i++)
|
||||||
|
{
|
||||||
|
String mount = mMounts.get(i);
|
||||||
|
if (!mVold.contains(mount))
|
||||||
|
mMounts.remove(i--);
|
||||||
|
}
|
||||||
|
|
||||||
|
// don't need this anymore, clear the vold list to reduce memory
|
||||||
|
// use and to prepare it for the next time it's needed.
|
||||||
|
mVold.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void testAndCleanMountsList()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Now that we have a cleaned list of mount paths Test each one to make sure it's a valid and available path. If it is not, remove it from the list.
|
||||||
|
*/
|
||||||
|
|
||||||
|
for (int i = 0; i < mMounts.size(); i++)
|
||||||
|
{
|
||||||
|
String mount = mMounts.get(i);
|
||||||
|
File root = new File(mount);
|
||||||
|
if (!root.exists() || !root.isDirectory() || !root.canWrite())
|
||||||
|
mMounts.remove(i--);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setProperties()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* At this point all the paths in the list should be valid. Build the public properties.
|
||||||
|
*/
|
||||||
|
|
||||||
|
ArrayList<String> mLabels = new ArrayList<String>();
|
||||||
|
|
||||||
|
int i = 1;
|
||||||
|
for (String path : mMounts)
|
||||||
|
{ // TODO: /mnt/sdcard is assumed to always mean internal storage. Use this comparison until there is a better way to do this
|
||||||
|
if ("/mnt/sdcard".equalsIgnoreCase(path))
|
||||||
|
mLabels.add("Built-in Storage");
|
||||||
|
else
|
||||||
|
mLabels.add("External SD Card " + i++);
|
||||||
|
}
|
||||||
|
|
||||||
|
labels = new String[mLabels.size()];
|
||||||
|
mLabels.toArray(labels);
|
||||||
|
|
||||||
|
paths = new String[mMounts.size()];
|
||||||
|
mMounts.toArray(paths);
|
||||||
|
|
||||||
|
count = Math.min(labels.length, paths.length);
|
||||||
|
|
||||||
|
// don't need this anymore, clear the mounts list to reduce memory
|
||||||
|
// use and to prepare it for the next time it's needed.
|
||||||
|
mMounts.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
771
platforms/android/package/src/org/libsdl/app/SDLActivity.java
Normal file
@@ -0,0 +1,771 @@
|
|||||||
|
package org.libsdl.app;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import android.app.*;
|
||||||
|
import android.content.*;
|
||||||
|
import android.view.*;
|
||||||
|
import android.view.inputmethod.BaseInputConnection;
|
||||||
|
import android.view.inputmethod.EditorInfo;
|
||||||
|
import android.view.inputmethod.InputConnection;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
import android.widget.AbsoluteLayout;
|
||||||
|
import android.os.*;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.graphics.*;
|
||||||
|
import android.media.*;
|
||||||
|
import android.hardware.*;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
SDL Activity
|
||||||
|
*/
|
||||||
|
public class SDLActivity extends Activity {
|
||||||
|
private static final String TAG = "SDL";
|
||||||
|
|
||||||
|
// Keep track of the paused state
|
||||||
|
public static boolean mIsPaused = false, mIsSurfaceReady = false, mHasFocus = true;
|
||||||
|
|
||||||
|
// Main components
|
||||||
|
protected static SDLActivity mSingleton;
|
||||||
|
protected static SDLSurface mSurface;
|
||||||
|
protected static View mTextEdit;
|
||||||
|
protected static ViewGroup mLayout;
|
||||||
|
|
||||||
|
// This is what SDL runs in. It invokes SDL_main(), eventually
|
||||||
|
protected static Thread mSDLThread;
|
||||||
|
|
||||||
|
// Audio
|
||||||
|
protected static Thread mAudioThread;
|
||||||
|
protected static AudioTrack mAudioTrack;
|
||||||
|
|
||||||
|
// Load the .so
|
||||||
|
static {
|
||||||
|
System.loadLibrary("SDL2");
|
||||||
|
//System.loadLibrary("SDL2_image");
|
||||||
|
//System.loadLibrary("SDL2_mixer");
|
||||||
|
//System.loadLibrary("SDL2_net");
|
||||||
|
//System.loadLibrary("SDL2_ttf");
|
||||||
|
System.loadLibrary("wagic");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setup
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
//Log.v("SDL", "onCreate()");
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
// So we can call stuff from static callbacks
|
||||||
|
mSingleton = this;
|
||||||
|
|
||||||
|
// Set up the surface
|
||||||
|
mSurface = new SDLSurface(getApplication());
|
||||||
|
|
||||||
|
mLayout = new AbsoluteLayout(this);
|
||||||
|
mLayout.addView(mSurface);
|
||||||
|
|
||||||
|
setContentView(mLayout);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Events
|
||||||
|
@Override
|
||||||
|
protected void onPause() {
|
||||||
|
Log.v("SDL", "onPause()");
|
||||||
|
super.onPause();
|
||||||
|
SDLActivity.handlePause();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
Log.v("SDL", "onResume()");
|
||||||
|
super.onResume();
|
||||||
|
SDLActivity.handleResume();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onWindowFocusChanged(boolean hasFocus) {
|
||||||
|
super.onWindowFocusChanged(hasFocus);
|
||||||
|
Log.v("SDL", "onWindowFocusChanged(): " + hasFocus);
|
||||||
|
|
||||||
|
SDLActivity.mHasFocus = hasFocus;
|
||||||
|
if (hasFocus) {
|
||||||
|
SDLActivity.handleResume();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLowMemory() {
|
||||||
|
Log.v("SDL", "onLowMemory()");
|
||||||
|
super.onLowMemory();
|
||||||
|
SDLActivity.nativeLowMemory();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
Log.v("SDL", "onDestroy()");
|
||||||
|
// Send a quit message to the application
|
||||||
|
SDLActivity.nativeQuit();
|
||||||
|
|
||||||
|
// Now wait for the SDL thread to quit
|
||||||
|
if (mSDLThread != null) {
|
||||||
|
try {
|
||||||
|
mSDLThread.join();
|
||||||
|
} catch(Exception e) {
|
||||||
|
Log.v("SDL", "Problem stopping thread: " + e);
|
||||||
|
}
|
||||||
|
mSDLThread = null;
|
||||||
|
|
||||||
|
//Log.v("SDL", "Finished waiting for SDL thread");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||||
|
int keyCode = event.getKeyCode();
|
||||||
|
// Ignore certain special keys so they're handled by Android
|
||||||
|
if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN ||
|
||||||
|
keyCode == KeyEvent.KEYCODE_VOLUME_UP ||
|
||||||
|
keyCode == KeyEvent.KEYCODE_CAMERA ||
|
||||||
|
keyCode == 168 || /* API 11: KeyEvent.KEYCODE_ZOOM_IN */
|
||||||
|
keyCode == 169 /* API 11: KeyEvent.KEYCODE_ZOOM_OUT */
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return super.dispatchKeyEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Called by onPause or surfaceDestroyed. Even if surfaceDestroyed
|
||||||
|
* is the first to be called, mIsSurfaceReady should still be set
|
||||||
|
* to 'true' during the call to onPause (in a usual scenario).
|
||||||
|
*/
|
||||||
|
public static void handlePause() {
|
||||||
|
if (!SDLActivity.mIsPaused && SDLActivity.mIsSurfaceReady) {
|
||||||
|
SDLActivity.mIsPaused = true;
|
||||||
|
SDLActivity.nativePause();
|
||||||
|
mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Called by onResume or surfaceCreated. An actual resume should be done only when the surface is ready.
|
||||||
|
* Note: Some Android variants may send multiple surfaceChanged events, so we don't need to resume
|
||||||
|
* every time we get one of those events, only if it comes after surfaceDestroyed
|
||||||
|
*/
|
||||||
|
public static void handleResume() {
|
||||||
|
if (SDLActivity.mIsPaused && SDLActivity.mIsSurfaceReady && SDLActivity.mHasFocus) {
|
||||||
|
SDLActivity.mIsPaused = false;
|
||||||
|
SDLActivity.nativeResume();
|
||||||
|
mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Messages from the SDLMain thread
|
||||||
|
static final int COMMAND_CHANGE_TITLE = 1;
|
||||||
|
static final int COMMAND_UNUSED = 2;
|
||||||
|
static final int COMMAND_TEXTEDIT_HIDE = 3;
|
||||||
|
|
||||||
|
protected static final int COMMAND_USER = 0x8000;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is called by SDL if SDL did not handle a message itself.
|
||||||
|
* This happens if a received message contains an unsupported command.
|
||||||
|
* Method can be overwritten to handle Messages in a different class.
|
||||||
|
* @param command the command of the message.
|
||||||
|
* @param param the parameter of the message. May be null.
|
||||||
|
* @return if the message was handled in overridden method.
|
||||||
|
*/
|
||||||
|
protected boolean onUnhandledMessage(int command, Object param) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A Handler class for Messages from native SDL applications.
|
||||||
|
* It uses current Activities as target (e.g. for the title).
|
||||||
|
* static to prevent implicit references to enclosing object.
|
||||||
|
*/
|
||||||
|
protected static class SDLCommandHandler extends Handler {
|
||||||
|
@Override
|
||||||
|
public void handleMessage(Message msg) {
|
||||||
|
Context context = getContext();
|
||||||
|
if (context == null) {
|
||||||
|
Log.e(TAG, "error handling message, getContext() returned null");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
switch (msg.arg1) {
|
||||||
|
case COMMAND_CHANGE_TITLE:
|
||||||
|
if (context instanceof Activity) {
|
||||||
|
((Activity) context).setTitle((String)msg.obj);
|
||||||
|
} else {
|
||||||
|
Log.e(TAG, "error handling message, getContext() returned no Activity");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case COMMAND_TEXTEDIT_HIDE:
|
||||||
|
if (mTextEdit != null) {
|
||||||
|
mTextEdit.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
imm.hideSoftInputFromWindow(mTextEdit.getWindowToken(), 0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
if ((context instanceof SDLActivity) && !((SDLActivity) context).onUnhandledMessage(msg.arg1, msg.obj)) {
|
||||||
|
Log.e(TAG, "error handling message, command is " + msg.arg1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handler for the messages
|
||||||
|
Handler commandHandler = new SDLCommandHandler();
|
||||||
|
|
||||||
|
// Send a message from the SDLMain thread
|
||||||
|
boolean sendCommand(int command, Object data) {
|
||||||
|
Message msg = commandHandler.obtainMessage();
|
||||||
|
msg.arg1 = command;
|
||||||
|
msg.obj = data;
|
||||||
|
return commandHandler.sendMessage(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
// C functions we call
|
||||||
|
public static native void nativeInit();
|
||||||
|
public static native void nativeLowMemory();
|
||||||
|
public static native void nativeQuit();
|
||||||
|
public static native void nativePause();
|
||||||
|
public static native void nativeResume();
|
||||||
|
public static native void onNativeResize(int x, int y, int format);
|
||||||
|
public static native void onNativeKeyDown(int keycode);
|
||||||
|
public static native void onNativeKeyUp(int keycode);
|
||||||
|
public static native void onNativeKeyboardFocusLost();
|
||||||
|
public static native void onNativeTouch(int touchDevId, int pointerFingerId,
|
||||||
|
int action, float x,
|
||||||
|
float y, float p);
|
||||||
|
public static native void onNativeAccel(float x, float y, float z);
|
||||||
|
public static native void onNativeSurfaceChanged();
|
||||||
|
public static native void onNativeSurfaceDestroyed();
|
||||||
|
public static native void nativeFlipBuffers();
|
||||||
|
|
||||||
|
public static void flipBuffers() {
|
||||||
|
SDLActivity.nativeFlipBuffers();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean setActivityTitle(String title) {
|
||||||
|
// Called from SDLMain() thread and can't directly affect the view
|
||||||
|
return mSingleton.sendCommand(COMMAND_CHANGE_TITLE, title);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean sendMessage(int command, int param) {
|
||||||
|
return mSingleton.sendCommand(command, Integer.valueOf(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Context getContext() {
|
||||||
|
return mSingleton;
|
||||||
|
}
|
||||||
|
|
||||||
|
static class ShowTextInputTask implements Runnable {
|
||||||
|
/*
|
||||||
|
* This is used to regulate the pan&scan method to have some offset from
|
||||||
|
* the bottom edge of the input region and the top edge of an input
|
||||||
|
* method (soft keyboard)
|
||||||
|
*/
|
||||||
|
static final int HEIGHT_PADDING = 15;
|
||||||
|
|
||||||
|
public int x, y, w, h;
|
||||||
|
|
||||||
|
public ShowTextInputTask(int x, int y, int w, int h) {
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
this.w = w;
|
||||||
|
this.h = h;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
AbsoluteLayout.LayoutParams params = new AbsoluteLayout.LayoutParams(
|
||||||
|
w, h + HEIGHT_PADDING, x, y);
|
||||||
|
|
||||||
|
if (mTextEdit == null) {
|
||||||
|
mTextEdit = new DummyEdit(getContext());
|
||||||
|
|
||||||
|
mLayout.addView(mTextEdit, params);
|
||||||
|
} else {
|
||||||
|
mTextEdit.setLayoutParams(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
mTextEdit.setVisibility(View.VISIBLE);
|
||||||
|
mTextEdit.requestFocus();
|
||||||
|
|
||||||
|
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
imm.showSoftInput(mTextEdit, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean showTextInput(int x, int y, int w, int h) {
|
||||||
|
// Transfer the task to the main thread as a Runnable
|
||||||
|
return mSingleton.commandHandler.post(new ShowTextInputTask(x, y, w, h));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Surface getNativeSurface() {
|
||||||
|
return SDLActivity.mSurface.getNativeSurface();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Audio
|
||||||
|
public static int audioInit(int sampleRate, boolean is16Bit, boolean isStereo, int desiredFrames) {
|
||||||
|
int channelConfig = isStereo ? AudioFormat.CHANNEL_CONFIGURATION_STEREO : AudioFormat.CHANNEL_CONFIGURATION_MONO;
|
||||||
|
int audioFormat = is16Bit ? AudioFormat.ENCODING_PCM_16BIT : AudioFormat.ENCODING_PCM_8BIT;
|
||||||
|
int frameSize = (isStereo ? 2 : 1) * (is16Bit ? 2 : 1);
|
||||||
|
|
||||||
|
Log.v("SDL", "SDL audio: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + (sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer");
|
||||||
|
|
||||||
|
// Let the user pick a larger buffer if they really want -- but ye
|
||||||
|
// gods they probably shouldn't, the minimums are horrifyingly high
|
||||||
|
// latency already
|
||||||
|
desiredFrames = Math.max(desiredFrames, (AudioTrack.getMinBufferSize(sampleRate, channelConfig, audioFormat) + frameSize - 1) / frameSize);
|
||||||
|
|
||||||
|
if (mAudioTrack == null) {
|
||||||
|
mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate,
|
||||||
|
channelConfig, audioFormat, desiredFrames * frameSize, AudioTrack.MODE_STREAM);
|
||||||
|
|
||||||
|
// Instantiating AudioTrack can "succeed" without an exception and the track may still be invalid
|
||||||
|
// Ref: https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/media/java/android/media/AudioTrack.java
|
||||||
|
// Ref: http://developer.android.com/reference/android/media/AudioTrack.html#getState()
|
||||||
|
|
||||||
|
if (mAudioTrack.getState() != AudioTrack.STATE_INITIALIZED) {
|
||||||
|
Log.e("SDL", "Failed during initialization of Audio Track");
|
||||||
|
mAudioTrack = null;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
mAudioTrack.play();
|
||||||
|
}
|
||||||
|
|
||||||
|
Log.v("SDL", "SDL audio: got " + ((mAudioTrack.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + (mAudioTrack.getSampleRate() / 1000f) + "kHz, " + desiredFrames + " frames buffer");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void audioWriteShortBuffer(short[] buffer) {
|
||||||
|
for (int i = 0; i < buffer.length; ) {
|
||||||
|
int result = mAudioTrack.write(buffer, i, buffer.length - i);
|
||||||
|
if (result > 0) {
|
||||||
|
i += result;
|
||||||
|
} else if (result == 0) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(1);
|
||||||
|
} catch(InterruptedException e) {
|
||||||
|
// Nom nom
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.w("SDL", "SDL audio: error return from write(short)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void audioWriteByteBuffer(byte[] buffer) {
|
||||||
|
for (int i = 0; i < buffer.length; ) {
|
||||||
|
int result = mAudioTrack.write(buffer, i, buffer.length - i);
|
||||||
|
if (result > 0) {
|
||||||
|
i += result;
|
||||||
|
} else if (result == 0) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(1);
|
||||||
|
} catch(InterruptedException e) {
|
||||||
|
// Nom nom
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.w("SDL", "SDL audio: error return from write(byte)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void audioQuit() {
|
||||||
|
if (mAudioTrack != null) {
|
||||||
|
mAudioTrack.stop();
|
||||||
|
mAudioTrack = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Input
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return an array which may be empty but is never null.
|
||||||
|
*/
|
||||||
|
public static int[] inputGetInputDeviceIds(int sources) {
|
||||||
|
int[] ids = InputDevice.getDeviceIds();
|
||||||
|
int[] filtered = new int[ids.length];
|
||||||
|
int used = 0;
|
||||||
|
for (int i = 0; i < ids.length; ++i) {
|
||||||
|
InputDevice device = InputDevice.getDevice(ids[i]);
|
||||||
|
if ((device != null) && ((device.getSources() & sources) != 0)) {
|
||||||
|
filtered[used++] = device.getId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Arrays.copyOf(filtered, used);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Simple nativeInit() runnable
|
||||||
|
*/
|
||||||
|
class SDLMain implements Runnable {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
// Runs SDL_main()
|
||||||
|
SDLActivity.nativeInit();
|
||||||
|
|
||||||
|
//Log.v("SDL", "SDL thread terminated");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
SDLSurface. This is what we draw on, so we need to know when it's created
|
||||||
|
in order to do anything useful.
|
||||||
|
|
||||||
|
Because of this, that's where we set up the SDL thread
|
||||||
|
*/
|
||||||
|
class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||||
|
View.OnKeyListener, View.OnTouchListener, SensorEventListener {
|
||||||
|
|
||||||
|
// Sensors
|
||||||
|
protected static SensorManager mSensorManager;
|
||||||
|
protected static Display mDisplay;
|
||||||
|
|
||||||
|
// Keep track of the surface size to normalize touch events
|
||||||
|
protected static float mWidth, mHeight;
|
||||||
|
|
||||||
|
// Startup
|
||||||
|
public SDLSurface(Context context) {
|
||||||
|
super(context);
|
||||||
|
getHolder().addCallback(this);
|
||||||
|
|
||||||
|
setFocusable(true);
|
||||||
|
setFocusableInTouchMode(true);
|
||||||
|
requestFocus();
|
||||||
|
setOnKeyListener(this);
|
||||||
|
setOnTouchListener(this);
|
||||||
|
|
||||||
|
mDisplay = ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
|
||||||
|
mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
|
||||||
|
|
||||||
|
// Some arbitrary defaults to avoid a potential division by zero
|
||||||
|
mWidth = 1.0f;
|
||||||
|
mHeight = 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Surface getNativeSurface() {
|
||||||
|
return getHolder().getSurface();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called when we have a valid drawing surface
|
||||||
|
@Override
|
||||||
|
public void surfaceCreated(SurfaceHolder holder) {
|
||||||
|
Log.v("SDL", "surfaceCreated()");
|
||||||
|
holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called when we lose the surface
|
||||||
|
@Override
|
||||||
|
public void surfaceDestroyed(SurfaceHolder holder) {
|
||||||
|
Log.v("SDL", "surfaceDestroyed()");
|
||||||
|
// Call this *before* setting mIsSurfaceReady to 'false'
|
||||||
|
SDLActivity.handlePause();
|
||||||
|
SDLActivity.mIsSurfaceReady = false;
|
||||||
|
SDLActivity.onNativeSurfaceDestroyed();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called when the surface is resized
|
||||||
|
@Override
|
||||||
|
public void surfaceChanged(SurfaceHolder holder,
|
||||||
|
int format, int width, int height) {
|
||||||
|
Log.v("SDL", "surfaceChanged()");
|
||||||
|
|
||||||
|
int sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565 by default
|
||||||
|
switch (format) {
|
||||||
|
case PixelFormat.A_8:
|
||||||
|
Log.v("SDL", "pixel format A_8");
|
||||||
|
break;
|
||||||
|
case PixelFormat.LA_88:
|
||||||
|
Log.v("SDL", "pixel format LA_88");
|
||||||
|
break;
|
||||||
|
case PixelFormat.L_8:
|
||||||
|
Log.v("SDL", "pixel format L_8");
|
||||||
|
break;
|
||||||
|
case PixelFormat.RGBA_4444:
|
||||||
|
Log.v("SDL", "pixel format RGBA_4444");
|
||||||
|
sdlFormat = 0x15421002; // SDL_PIXELFORMAT_RGBA4444
|
||||||
|
break;
|
||||||
|
case PixelFormat.RGBA_5551:
|
||||||
|
Log.v("SDL", "pixel format RGBA_5551");
|
||||||
|
sdlFormat = 0x15441002; // SDL_PIXELFORMAT_RGBA5551
|
||||||
|
break;
|
||||||
|
case PixelFormat.RGBA_8888:
|
||||||
|
Log.v("SDL", "pixel format RGBA_8888");
|
||||||
|
sdlFormat = 0x16462004; // SDL_PIXELFORMAT_RGBA8888
|
||||||
|
break;
|
||||||
|
case PixelFormat.RGBX_8888:
|
||||||
|
Log.v("SDL", "pixel format RGBX_8888");
|
||||||
|
sdlFormat = 0x16261804; // SDL_PIXELFORMAT_RGBX8888
|
||||||
|
break;
|
||||||
|
case PixelFormat.RGB_332:
|
||||||
|
Log.v("SDL", "pixel format RGB_332");
|
||||||
|
sdlFormat = 0x14110801; // SDL_PIXELFORMAT_RGB332
|
||||||
|
break;
|
||||||
|
case PixelFormat.RGB_565:
|
||||||
|
Log.v("SDL", "pixel format RGB_565");
|
||||||
|
sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565
|
||||||
|
break;
|
||||||
|
case PixelFormat.RGB_888:
|
||||||
|
Log.v("SDL", "pixel format RGB_888");
|
||||||
|
// Not sure this is right, maybe SDL_PIXELFORMAT_RGB24 instead?
|
||||||
|
sdlFormat = 0x16161804; // SDL_PIXELFORMAT_RGB888
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Log.v("SDL", "pixel format unknown " + format);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
mWidth = width;
|
||||||
|
mHeight = height;
|
||||||
|
SDLActivity.onNativeResize(width, height, sdlFormat);
|
||||||
|
Log.v("SDL", "Window size:" + width + "x"+height);
|
||||||
|
|
||||||
|
// Set mIsSurfaceReady to 'true' *before* making a call to handleResume
|
||||||
|
SDLActivity.mIsSurfaceReady = true;
|
||||||
|
SDLActivity.onNativeSurfaceChanged();
|
||||||
|
|
||||||
|
|
||||||
|
if (SDLActivity.mSDLThread == null) {
|
||||||
|
// This is the entry point to the C app.
|
||||||
|
// Start up the C app thread and enable sensor input for the first time
|
||||||
|
|
||||||
|
SDLActivity.mSDLThread = new Thread(new SDLMain(), "SDLThread");
|
||||||
|
enableSensor(Sensor.TYPE_ACCELEROMETER, true);
|
||||||
|
SDLActivity.mSDLThread.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// unused
|
||||||
|
@Override
|
||||||
|
public void onDraw(Canvas canvas) {}
|
||||||
|
|
||||||
|
|
||||||
|
// Key events
|
||||||
|
@Override
|
||||||
|
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||||
|
|
||||||
|
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||||
|
//Log.v("SDL", "key down: " + keyCode);
|
||||||
|
SDLActivity.onNativeKeyDown(keyCode);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||||
|
//Log.v("SDL", "key up: " + keyCode);
|
||||||
|
SDLActivity.onNativeKeyUp(keyCode);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Touch events
|
||||||
|
@Override
|
||||||
|
public boolean onTouch(View v, MotionEvent event) {
|
||||||
|
final int touchDevId = event.getDeviceId();
|
||||||
|
final int pointerCount = event.getPointerCount();
|
||||||
|
// touchId, pointerId, action, x, y, pressure
|
||||||
|
int actionPointerIndex = (event.getAction() & MotionEvent.ACTION_POINTER_ID_MASK) >> MotionEvent.ACTION_POINTER_ID_SHIFT; /* API 8: event.getActionIndex(); */
|
||||||
|
int pointerFingerId = event.getPointerId(actionPointerIndex);
|
||||||
|
int action = (event.getAction() & MotionEvent.ACTION_MASK); /* API 8: event.getActionMasked(); */
|
||||||
|
|
||||||
|
float x = event.getX(actionPointerIndex) / mWidth;
|
||||||
|
float y = event.getY(actionPointerIndex) / mHeight;
|
||||||
|
float p = event.getPressure(actionPointerIndex);
|
||||||
|
|
||||||
|
if (action == MotionEvent.ACTION_MOVE && pointerCount > 1) {
|
||||||
|
// TODO send motion to every pointer if its position has
|
||||||
|
// changed since prev event.
|
||||||
|
for (int i = 0; i < pointerCount; i++) {
|
||||||
|
pointerFingerId = event.getPointerId(i);
|
||||||
|
x = event.getX(i) / mWidth;
|
||||||
|
y = event.getY(i) / mHeight;
|
||||||
|
p = event.getPressure(i);
|
||||||
|
SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sensor events
|
||||||
|
public void enableSensor(int sensortype, boolean enabled) {
|
||||||
|
// TODO: This uses getDefaultSensor - what if we have >1 accels?
|
||||||
|
if (enabled) {
|
||||||
|
mSensorManager.registerListener(this,
|
||||||
|
mSensorManager.getDefaultSensor(sensortype),
|
||||||
|
SensorManager.SENSOR_DELAY_GAME, null);
|
||||||
|
} else {
|
||||||
|
mSensorManager.unregisterListener(this,
|
||||||
|
mSensorManager.getDefaultSensor(sensortype));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAccuracyChanged(Sensor sensor, int accuracy) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSensorChanged(SensorEvent event) {
|
||||||
|
if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
|
||||||
|
float x, y;
|
||||||
|
switch (mDisplay.getRotation()) {
|
||||||
|
case Surface.ROTATION_90:
|
||||||
|
x = -event.values[1];
|
||||||
|
y = event.values[0];
|
||||||
|
break;
|
||||||
|
case Surface.ROTATION_270:
|
||||||
|
x = event.values[1];
|
||||||
|
y = -event.values[0];
|
||||||
|
break;
|
||||||
|
case Surface.ROTATION_180:
|
||||||
|
x = -event.values[1];
|
||||||
|
y = -event.values[0];
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
x = event.values[0];
|
||||||
|
y = event.values[1];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
SDLActivity.onNativeAccel(-x / SensorManager.GRAVITY_EARTH,
|
||||||
|
y / SensorManager.GRAVITY_EARTH,
|
||||||
|
event.values[2] / SensorManager.GRAVITY_EARTH - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* This is a fake invisible editor view that receives the input and defines the
|
||||||
|
* pan&scan region
|
||||||
|
*/
|
||||||
|
class DummyEdit extends View implements View.OnKeyListener {
|
||||||
|
InputConnection ic;
|
||||||
|
|
||||||
|
public DummyEdit(Context context) {
|
||||||
|
super(context);
|
||||||
|
setFocusableInTouchMode(true);
|
||||||
|
setFocusable(true);
|
||||||
|
setOnKeyListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCheckIsTextEditor() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||||
|
|
||||||
|
// This handles the hardware keyboard input
|
||||||
|
if (event.isPrintingKey()) {
|
||||||
|
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||||
|
ic.commitText(String.valueOf((char) event.getUnicodeChar()), 1);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||||
|
SDLActivity.onNativeKeyDown(keyCode);
|
||||||
|
return true;
|
||||||
|
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||||
|
SDLActivity.onNativeKeyUp(keyCode);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
@Override
|
||||||
|
public boolean onKeyPreIme (int keyCode, KeyEvent event) {
|
||||||
|
// As seen on StackOverflow: http://stackoverflow.com/questions/7634346/keyboard-hide-event
|
||||||
|
// FIXME: Discussion at http://bugzilla.libsdl.org/show_bug.cgi?id=1639
|
||||||
|
// FIXME: This is not a 100% effective solution to the problem of detecting if the keyboard is showing or not
|
||||||
|
// FIXME: A more effective solution would be to change our Layout from AbsoluteLayout to Relative or Linear
|
||||||
|
// FIXME: And determine the keyboard presence doing this: http://stackoverflow.com/questions/2150078/how-to-check-visibility-of-software-keyboard-in-android
|
||||||
|
// FIXME: An even more effective way would be if Android provided this out of the box, but where would the fun be in that :)
|
||||||
|
if (event.getAction()==KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) {
|
||||||
|
if (SDLActivity.mTextEdit != null && SDLActivity.mTextEdit.getVisibility() == View.VISIBLE) {
|
||||||
|
SDLActivity.onNativeKeyboardFocusLost();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return super.onKeyPreIme(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
|
||||||
|
ic = new SDLInputConnection(this, true);
|
||||||
|
|
||||||
|
outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI
|
||||||
|
| 33554432 /* API 11: EditorInfo.IME_FLAG_NO_FULLSCREEN */;
|
||||||
|
|
||||||
|
return ic;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class SDLInputConnection extends BaseInputConnection {
|
||||||
|
|
||||||
|
public SDLInputConnection(View targetView, boolean fullEditor) {
|
||||||
|
super(targetView, fullEditor);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean sendKeyEvent(KeyEvent event) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This handles the keycodes from soft keyboard (and IME-translated
|
||||||
|
* input from hardkeyboard)
|
||||||
|
*/
|
||||||
|
int keyCode = event.getKeyCode();
|
||||||
|
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||||
|
if (event.isPrintingKey()) {
|
||||||
|
commitText(String.valueOf((char) event.getUnicodeChar()), 1);
|
||||||
|
}
|
||||||
|
SDLActivity.onNativeKeyDown(keyCode);
|
||||||
|
return true;
|
||||||
|
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||||
|
|
||||||
|
SDLActivity.onNativeKeyUp(keyCode);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.sendKeyEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean commitText(CharSequence text, int newCursorPosition) {
|
||||||
|
|
||||||
|
nativeCommitText(text.toString(), newCursorPosition);
|
||||||
|
|
||||||
|
return super.commitText(text, newCursorPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean setComposingText(CharSequence text, int newCursorPosition) {
|
||||||
|
|
||||||
|
nativeSetComposingText(text.toString(), newCursorPosition);
|
||||||
|
|
||||||
|
return super.setComposingText(text, newCursorPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
public native void nativeCommitText(String text, int newCursorPosition);
|
||||||
|
|
||||||
|
public native void nativeSetComposingText(String text, int newCursorPosition);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
8
platforms/emscripten/configure.cmake
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
set(CMAKE_CXX_FLAGS "-s USE_SDL=2 -s USE_ZLIB=1 -s FULL_ES2=1 -std=c++11 -s TOTAL_MEMORY=16777216 -O0 --preload-file ../../../projects/mtg/bin/Res@/")
|
||||||
|
#set(CMAKE_CXX_FLAGS "-s USE_SDL=2 -s FULL_ES2=1 -std=c++11 -g4 -s ALLOW_MEMORY_GROWTH=1 --preload-file ../../../projects/mtg/bin/Res@/")
|
||||||
|
set(CMAKE_EXECUTABLE_SUFFIX ".html")
|
||||||
|
add_definitions(-DLINUX)
|
||||||
|
add_definitions(-D_DEBUG)
|
||||||
|
add_definitions(-DUSERDIR=".wagic")
|
||||||
|
add_definitions(-DRESDIR="/")
|
||||||
|
add_definitions(-DGL_ES_VERSION_2_0)
|
||||||
5
platforms/macosx/configure.cmake
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
add_definitions(-DLINUX)
|
||||||
|
add_definitions(-DUSERDIR=".wagic")
|
||||||
|
add_definitions(-DRESDIR="Res")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++0x")
|
||||||
|
set(CMAKE_PREFIX_PATH "/usr/local/opt/qt5")
|
||||||
5
platforms/psp/configure.cmake
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
add_definitions(-DPSP -G0)
|
||||||
|
add_definitions(-D_PSP_FW_VERSION=371)
|
||||||
|
add_definitions(-DDEVHOOK -DPSPFW3XX)
|
||||||
|
|
||||||
|
include_directories(${PSPSDK_PATH}/include)
|
||||||
4
platforms/unix/configure.cmake
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
add_definitions(-DLINUX)
|
||||||
|
add_definitions(-DUSERDIR=".wagic")
|
||||||
|
add_definitions(-DRESDIR="Res")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||||
3
platforms/win/configure.cmake
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
add_definitions(-DWIN32)
|
||||||
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
|
||||||
1
projects/mtg/Android/.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
/gen
|
/gen
|
||||||
/bin
|
/bin
|
||||||
|
/libs
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="0192" android:versionName="@string/app_version" package="net.wagic.app">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="0201" android:versionName="@string/app_version" package="net.wagic.app">
|
||||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
|
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||||
<application android:debuggable="true" android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
|
<application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
|
||||||
<activity android:configChanges="keyboard|keyboardHidden|orientation" android:label="@string/app_name" android:name="org.libsdl.app.SDLActivity" android:screenOrientation="sensorLandscape">
|
<activity android:debuggable="false" android:configChanges="keyboard|keyboardHidden|orientation" android:label="@string/app_name" android:name="org.libsdl.app.SDLActivity" android:screenOrientation="sensorLandscape">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity android:configChanges="keyboard|keyboardHidden|orientation" android:name="com.google.ads.AdActivity" android:screenOrientation="sensorLandscape"/>
|
|
||||||
</application>
|
</application>
|
||||||
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10"/>
|
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10"/>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -11,9 +11,8 @@ SDL_PATH := $(JGE_PATH)/Dependencies/SDL
|
|||||||
BOOST_PATH := $(MY_WAGIC_ROOT)/Boost
|
BOOST_PATH := $(MY_WAGIC_ROOT)/Boost
|
||||||
JPEG_PATH := $(JGE_PATH)/Dependencies/libjpeg
|
JPEG_PATH := $(JGE_PATH)/Dependencies/libjpeg
|
||||||
PNG_PATH := $(JGE_PATH)/Dependencies/libpng
|
PNG_PATH := $(JGE_PATH)/Dependencies/libpng
|
||||||
DEBUG ?= DEBUG
|
|
||||||
|
|
||||||
LOCAL_CFLAGS += -DLINUX -DANDROID -DSDL_CONFIG -D_$(DEBUG)
|
LOCAL_CFLAGS += -DLINUX -DANDROID -DSDL_CONFIG
|
||||||
LOCAL_CFLAGS += -D_STLP_USE_SIMPLE_NODE_ALLOC -DTIXML_USE_STL
|
LOCAL_CFLAGS += -D_STLP_USE_SIMPLE_NODE_ALLOC -DTIXML_USE_STL
|
||||||
LOCAL_CFLAGS += -D__arm__ -D_REENTRANT -D_GLIBCXX__PTHREADS
|
LOCAL_CFLAGS += -D__arm__ -D_REENTRANT -D_GLIBCXX__PTHREADS
|
||||||
LOCAL_STATIC_LIBRARIES := libpng libjpeg
|
LOCAL_STATIC_LIBRARIES := libpng libjpeg
|
||||||
@@ -57,7 +56,6 @@ LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.cpp \
|
|||||||
$(MTG_PATH)/src/DeckMetaData.cpp \
|
$(MTG_PATH)/src/DeckMetaData.cpp \
|
||||||
$(MTG_PATH)/src/DeckStats.cpp \
|
$(MTG_PATH)/src/DeckStats.cpp \
|
||||||
$(MTG_PATH)/src/DuelLayers.cpp \
|
$(MTG_PATH)/src/DuelLayers.cpp \
|
||||||
$(MTG_PATH)/src/Effects.cpp \
|
|
||||||
$(MTG_PATH)/src/ExtraCost.cpp \
|
$(MTG_PATH)/src/ExtraCost.cpp \
|
||||||
$(MTG_PATH)/src/GameApp.cpp \
|
$(MTG_PATH)/src/GameApp.cpp \
|
||||||
$(MTG_PATH)/src/GameLauncher.cpp \
|
$(MTG_PATH)/src/GameLauncher.cpp \
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
APP_PROJECT_PATH := $(call my-dir)/..
|
APP_PROJECT_PATH := $(call my-dir)/..
|
||||||
APP_CPPFLAGS += -frtti -fexceptions
|
APP_CPPFLAGS += -frtti -fexceptions
|
||||||
APP_ABI := armeabi armeabi-v7a
|
APP_ABI := armeabi armeabi-v7a
|
||||||
|
#APP_ABI := x86 # mainly for emulators
|
||||||
APP_STL := gnustl_static
|
APP_STL := gnustl_static
|
||||||
APP_MODULES := libpng libjpeg main SDL
|
APP_MODULES := libpng libjpeg main SDL
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 3.5 KiB |
BIN
projects/mtg/Android/res/drawable-xhdpi/icon.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
projects/mtg/Android/res/drawable-xxhdpi/icon.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
projects/mtg/Android/res/drawable-xxxhdpi/icon.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Wagic</string>
|
<string name="app_name">Wagic</string>
|
||||||
<string name="app_version">0.19.2</string>
|
<string name="app_version">0.20.1</string>
|
||||||
<string name="info_text">Wagic v0.19.2\\nAll Rights Reserved.</string>
|
<string name="info_text">Wagic v0.20.1\\nAll Rights Reserved.</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
275
projects/mtg/Android/src/net/wagic/utils/DeckImporter.java
Normal file
@@ -0,0 +1,275 @@
|
|||||||
|
package net.wagic.utils;
|
||||||
|
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.FileReader;
|
||||||
|
import java.io.FileWriter;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
public class DeckImporter
|
||||||
|
{
|
||||||
|
public static String importDeck( File f, String mypath, String activePath )
|
||||||
|
{
|
||||||
|
String message = "";
|
||||||
|
String deck = "";
|
||||||
|
String deckname = "";
|
||||||
|
String prefix = "#SB:";
|
||||||
|
int cardcount = 0;
|
||||||
|
if(f.exists() && !f.isDirectory())
|
||||||
|
{
|
||||||
|
deckname = f.getName();
|
||||||
|
int pos = deckname.lastIndexOf(".");
|
||||||
|
if (pos > 0)
|
||||||
|
{
|
||||||
|
deckname = deckname.substring(0, pos);
|
||||||
|
}
|
||||||
|
deck += "#NAME:"+deckname+"\n";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Scanner scanner = new Scanner(new File(mypath));
|
||||||
|
if (scanner.hasNext())
|
||||||
|
{
|
||||||
|
while (scanner.hasNext())
|
||||||
|
{
|
||||||
|
String line = scanner.nextLine();
|
||||||
|
line = line.trim();
|
||||||
|
if (!line.equals("") && cardcount < 61) // don't write out blank lines
|
||||||
|
{
|
||||||
|
String[] slines = line.split("\\s+");
|
||||||
|
String arranged = "";
|
||||||
|
for (int idx = 1; idx < slines.length; idx++)
|
||||||
|
{
|
||||||
|
arranged += slines[idx] + " ";
|
||||||
|
}
|
||||||
|
if ((isNumeric(slines[0])) && arranged != null)
|
||||||
|
{
|
||||||
|
if (slines[1] != null && slines[1].startsWith("["))
|
||||||
|
{
|
||||||
|
arranged = arranged.substring(5);
|
||||||
|
slines[1] = slines[1].replaceAll("\\[", "").replaceAll("\\]", "");
|
||||||
|
deck += arranged + " (" + renameSet(slines[1]) + ") * " + slines[0] + "\n";
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
deck += arranged + "(*) * " + slines[0] + "\n";
|
||||||
|
}
|
||||||
|
cardcount += Integer.parseInt(slines[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
File profile = new File(activePath + "/Res/settings/options.txt");
|
||||||
|
if (profile.exists() && !profile.isDirectory())
|
||||||
|
{
|
||||||
|
String profileName = getActiveProfile(profile);
|
||||||
|
if (profileName != "Missing!")
|
||||||
|
{
|
||||||
|
File rootProfiles = new File(activePath + "/Res/profiles/" + profileName);
|
||||||
|
if (rootProfiles.exists() && rootProfiles.isDirectory())
|
||||||
|
{
|
||||||
|
//save deck
|
||||||
|
int countdeck = 1;
|
||||||
|
File[] files = rootProfiles.listFiles();
|
||||||
|
for (int i = 0; i < files.length; i++)
|
||||||
|
{//check if there is available deck...
|
||||||
|
if (files[i].getName().startsWith("deck"))
|
||||||
|
countdeck++;
|
||||||
|
}
|
||||||
|
File toSave = new File(rootProfiles + "/deck" + countdeck + ".txt");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FileOutputStream fop = new FileOutputStream(toSave);
|
||||||
|
|
||||||
|
// if file doesn't exists, then create it
|
||||||
|
if (!toSave.exists())
|
||||||
|
{
|
||||||
|
toSave.createNewFile();
|
||||||
|
}
|
||||||
|
// get the content in bytes
|
||||||
|
byte[] contentInBytes = deck.getBytes();
|
||||||
|
fop.write(contentInBytes);
|
||||||
|
fop.flush();
|
||||||
|
fop.close();
|
||||||
|
message = "Import Deck Success!\n" + cardcount + " total cards in this deck\n\n" + deck;
|
||||||
|
} catch (IOException e)
|
||||||
|
{
|
||||||
|
message = e.getMessage();
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
message = "Missing Folder!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
message = "Invalid Profile!";
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
message = "No errors, and file EMPTY";
|
||||||
|
}
|
||||||
|
} catch (IOException e)
|
||||||
|
{
|
||||||
|
message = e.getMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isNumeric(String input)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Integer.parseInt(input);
|
||||||
|
}
|
||||||
|
catch(NumberFormatException ex)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getActiveProfile(File mypath)
|
||||||
|
{
|
||||||
|
String name = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Scanner scanner = new Scanner(new File(mypath.toString()));
|
||||||
|
if (scanner.hasNext())
|
||||||
|
{
|
||||||
|
String line = scanner.nextLine();
|
||||||
|
name = line.substring(8);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "Missing!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(IOException e)
|
||||||
|
{
|
||||||
|
return "Missing!";
|
||||||
|
}
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String renameSet(String set)
|
||||||
|
{
|
||||||
|
if (set == "")
|
||||||
|
return "*";
|
||||||
|
if (set == "AL")
|
||||||
|
return "ALL";
|
||||||
|
if (set == "AQ")
|
||||||
|
return "ATQ";
|
||||||
|
if (set == "AP")
|
||||||
|
return "APC";
|
||||||
|
if (set == "AN")
|
||||||
|
return "ARN";
|
||||||
|
if (set == "AE")
|
||||||
|
return "ARC";
|
||||||
|
if (set == "BR")
|
||||||
|
return "BRB";
|
||||||
|
if (set == "BD")
|
||||||
|
return "BTD";
|
||||||
|
if (set == "CH")
|
||||||
|
return "CHR";
|
||||||
|
if (set == "6E")
|
||||||
|
return "6ED";
|
||||||
|
if (set == "CS")
|
||||||
|
return "CSP";
|
||||||
|
if (set == "DS")
|
||||||
|
return "DST";
|
||||||
|
if (set == "D2")
|
||||||
|
return "DD2";
|
||||||
|
if (set == "8E")
|
||||||
|
return "8ED";
|
||||||
|
if (set == "EX")
|
||||||
|
return "EXO";
|
||||||
|
if (set == "FE")
|
||||||
|
return "FEM";
|
||||||
|
if (set == "FD")
|
||||||
|
return "5DN";
|
||||||
|
if (set == "5E")
|
||||||
|
return "5ED";
|
||||||
|
if (set == "4E")
|
||||||
|
return "4ED";
|
||||||
|
if (set == "GP")
|
||||||
|
return "GPT";
|
||||||
|
if (set == "HL")
|
||||||
|
return "HML";
|
||||||
|
if (set == "IA")
|
||||||
|
return "ICE";
|
||||||
|
if (set == "IN")
|
||||||
|
return "INV";
|
||||||
|
if (set == "JU")
|
||||||
|
return "JUD";
|
||||||
|
if (set == "LG")
|
||||||
|
return "LEG";
|
||||||
|
if (set == "LE")
|
||||||
|
return "LGN";
|
||||||
|
if (set == "A")
|
||||||
|
return "LEA";
|
||||||
|
if (set == "B")
|
||||||
|
return "LEB";
|
||||||
|
if (set == "MM")
|
||||||
|
return "MMQ";
|
||||||
|
if (set == "MI")
|
||||||
|
return "MIR";
|
||||||
|
if (set == "MR")
|
||||||
|
return "MRD";
|
||||||
|
if (set == "NE")
|
||||||
|
return "NEM";
|
||||||
|
if (set == "9E")
|
||||||
|
return "9ED";
|
||||||
|
if (set == "OD")
|
||||||
|
return "ODY";
|
||||||
|
if (set == "ON")
|
||||||
|
return "ONS";
|
||||||
|
if (set == "PS")
|
||||||
|
return "PLS";
|
||||||
|
if (set == "PT")
|
||||||
|
return "POR";
|
||||||
|
if (set == "P2")
|
||||||
|
return "P02";
|
||||||
|
if (set == "P3")
|
||||||
|
return "PTK";
|
||||||
|
if (set == "PR")
|
||||||
|
return "PPR";
|
||||||
|
if (set == "PY")
|
||||||
|
return "PCY";
|
||||||
|
if (set == "R")
|
||||||
|
return "RV";
|
||||||
|
if (set == "SC")
|
||||||
|
return "SCG";
|
||||||
|
if (set == "7E")
|
||||||
|
return "7ED";
|
||||||
|
if (set == "ST")
|
||||||
|
return "S99";
|
||||||
|
if (set == "ST2K")
|
||||||
|
return "S00";
|
||||||
|
if (set == "SH")
|
||||||
|
return "STH";
|
||||||
|
if (set == "TE")
|
||||||
|
return "TMP";
|
||||||
|
if (set == "DK")
|
||||||
|
return "DRK";
|
||||||
|
if (set == "TO")
|
||||||
|
return "TOR";
|
||||||
|
if (set == "UG")
|
||||||
|
return "UGL";
|
||||||
|
if (set == "U")
|
||||||
|
return "2ED";
|
||||||
|
if (set == "UD")
|
||||||
|
return "UDS";
|
||||||
|
if (set == "UL")
|
||||||
|
return "ULG";
|
||||||
|
if (set == "US")
|
||||||
|
return "USG";
|
||||||
|
if (set == "VI")
|
||||||
|
return "VIS";
|
||||||
|
if (set == "WL")
|
||||||
|
return "WTH";
|
||||||
|
else
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,11 +5,16 @@ import java.io.FileNotFoundException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import android.os.Build;
|
||||||
|
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
public class StorageOptions
|
public class StorageOptions
|
||||||
{
|
{
|
||||||
|
private static final String TAG = StorageOptions.class.getCanonicalName();
|
||||||
private static ArrayList<String> mMounts = new ArrayList<String>();
|
private static ArrayList<String> mMounts = new ArrayList<String>();
|
||||||
private static ArrayList<String> mVold = new ArrayList<String>();
|
private static ArrayList<String> mVold = new ArrayList<String>();
|
||||||
|
|
||||||
@@ -21,8 +26,14 @@ public class StorageOptions
|
|||||||
public static void determineStorageOptions()
|
public static void determineStorageOptions()
|
||||||
{
|
{
|
||||||
initializeMountPoints();
|
initializeMountPoints();
|
||||||
|
if (findForcemount()){
|
||||||
|
readMountsFileTest();
|
||||||
|
}
|
||||||
readMountsFile();
|
readMountsFile();
|
||||||
readVoldFile();
|
readVoldFile();
|
||||||
|
if (findForcemount()){
|
||||||
|
removeDuplicates(mMounts);
|
||||||
|
}
|
||||||
compareMountsWithVold();
|
compareMountsWithVold();
|
||||||
testAndCleanMountsList();
|
testAndCleanMountsList();
|
||||||
setProperties();
|
setProperties();
|
||||||
@@ -40,6 +51,42 @@ public class StorageOptions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void readMountsFileTest()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Test mountpoints storage -kevlahnota
|
||||||
|
*/
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Scanner scanner = new Scanner(new File("/proc/mounts"));
|
||||||
|
while (scanner.hasNext())
|
||||||
|
{
|
||||||
|
String line = scanner.nextLine();
|
||||||
|
if (line.startsWith("/"))
|
||||||
|
{
|
||||||
|
String[] lineElements = line.split("\\s+");
|
||||||
|
if ("vfat".equals(lineElements[2]) || "fuse".equals(lineElements[2]) || "sdcardfs".equals(lineElements[2]))
|
||||||
|
{
|
||||||
|
File mountPoint = new File(lineElements[1]);
|
||||||
|
if (!lineElements[1].equals(defaultMountPoint))
|
||||||
|
if (mountPoint.isDirectory() && mountPoint.canRead())
|
||||||
|
mMounts.add(lineElements[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (FileNotFoundException fnfex)
|
||||||
|
{
|
||||||
|
// if proc/mount doesn't exist we just use
|
||||||
|
Log.i(TAG, fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
|
||||||
|
mMounts.add(defaultMountPoint);
|
||||||
|
} catch (Exception e)
|
||||||
|
{
|
||||||
|
Log.e(TAG, e.getMessage() + ": unknown exception while reading mounts file");
|
||||||
|
mMounts.add(defaultMountPoint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void readMountsFile()
|
private static void readMountsFile()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -65,11 +112,11 @@ public class StorageOptions
|
|||||||
} catch (FileNotFoundException fnfex)
|
} catch (FileNotFoundException fnfex)
|
||||||
{
|
{
|
||||||
// if proc/mount doesn't exist we just use
|
// if proc/mount doesn't exist we just use
|
||||||
Log.i(StorageOptions.class.getCanonicalName(), fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
|
Log.i(TAG, fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
|
||||||
mMounts.add(defaultMountPoint);
|
mMounts.add(defaultMountPoint);
|
||||||
} catch (Exception e)
|
} catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.e(StorageOptions.class.getCanonicalName(), e.getMessage() + ": unknown exception while reading mounts file");
|
Log.e(TAG, e.getMessage() + ": unknown exception while reading mounts file");
|
||||||
mMounts.add(defaultMountPoint);
|
mMounts.add(defaultMountPoint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,28 +145,48 @@ public class StorageOptions
|
|||||||
} catch (FileNotFoundException fnfex)
|
} catch (FileNotFoundException fnfex)
|
||||||
{
|
{
|
||||||
// if vold.fstab doesn't exist we use the value gathered from the Environment
|
// if vold.fstab doesn't exist we use the value gathered from the Environment
|
||||||
Log.i(StorageOptions.class.getCanonicalName(), fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
|
Log.i(TAG, fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
|
||||||
mMounts.add(defaultMountPoint);
|
mMounts.add(defaultMountPoint);
|
||||||
} catch (Exception e)
|
} catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.e(StorageOptions.class.getCanonicalName(), e.getMessage() + ": unknown exception while reading mounts file");
|
Log.e(TAG, e.getMessage() + ": unknown exception while reading vold.fstab file");
|
||||||
mMounts.add(defaultMountPoint);
|
mMounts.add(defaultMountPoint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static ArrayList<String> removeDuplicates(ArrayList<String> list)
|
||||||
|
{
|
||||||
|
ArrayList<String> result = new ArrayList<String>();
|
||||||
|
|
||||||
|
HashSet<String> set = new HashSet<String>();
|
||||||
|
|
||||||
|
for (String item : list)
|
||||||
|
{
|
||||||
|
if (!set.contains(item))
|
||||||
|
{
|
||||||
|
result.add(item);
|
||||||
|
set.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
private static void compareMountsWithVold()
|
private static void compareMountsWithVold()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Sometimes the two lists of mount points will be different. We only want those mount points that are in both list.
|
* Sometimes the two lists of mount points will be different. We only want those mount points that are in both list.
|
||||||
*
|
*
|
||||||
* Compare the two lists together and remove items that are not in both lists.
|
* Compare the two lists together and remove items that are not in both lists.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for (int i = 0; i < mMounts.size(); i++)
|
if (mVold.size() > 0)
|
||||||
{
|
{
|
||||||
String mount = mMounts.get(i);
|
for (int i = 0; i < mMounts.size(); i++)
|
||||||
if (!mVold.contains(mount))
|
{
|
||||||
mMounts.remove(i--);
|
String mount = mMounts.get(i);
|
||||||
|
if (!mVold.contains(mount))
|
||||||
|
mMounts.remove(i--);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// don't need this anymore, clear the vold list to reduce memory
|
// don't need this anymore, clear the vold list to reduce memory
|
||||||
@@ -132,18 +199,60 @@ public class StorageOptions
|
|||||||
/*
|
/*
|
||||||
* Now that we have a cleaned list of mount paths Test each one to make sure it's a valid and available path. If it is not, remove it from the list.
|
* Now that we have a cleaned list of mount paths Test each one to make sure it's a valid and available path. If it is not, remove it from the list.
|
||||||
*/
|
*/
|
||||||
|
int t = 0;
|
||||||
for (int i = 0; i < mMounts.size(); i++)
|
for (int i = 0; i < mMounts.size(); i++)
|
||||||
{
|
{
|
||||||
|
t++;
|
||||||
String mount = mMounts.get(i);
|
String mount = mMounts.get(i);
|
||||||
File root = new File(mount);
|
File root = new File(mount);
|
||||||
if (!root.exists() || !root.isDirectory() || !root.canWrite())
|
if (!root.exists() || !root.isDirectory() || !root.canWrite())
|
||||||
mMounts.remove(i--);
|
mMounts.remove(i--);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (t == 0 && Build.VERSION.SDK_INT >= 16 && findForcemount())
|
||||||
|
{
|
||||||
|
//if none is found lets force it for Jellybean and above...
|
||||||
|
if (System.getenv("EXTERNAL_STORAGE") != null)
|
||||||
|
{
|
||||||
|
File root = new File(System.getenv("EXTERNAL_STORAGE"));
|
||||||
|
if (root.exists() && root.isDirectory() && root.canWrite())
|
||||||
|
{
|
||||||
|
if(!isRooted())
|
||||||
|
{
|
||||||
|
File folder = new File(System.getenv("EXTERNAL_STORAGE")+"/Android/data/net.wagic.app/files");
|
||||||
|
folder.mkdirs();
|
||||||
|
mMounts.add(folder.toString());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mMounts.add(System.getenv("EXTERNAL_STORAGE"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (System.getenv("SECONDARY_STORAGE") != null)
|
||||||
|
{
|
||||||
|
File root = new File(System.getenv("SECONDARY_STORAGE"));
|
||||||
|
if (root.exists() && root.isDirectory() && root.canWrite())
|
||||||
|
{
|
||||||
|
if(!isRooted())
|
||||||
|
{
|
||||||
|
File folder = new File(System.getenv("SECONDARY_STORAGE")+"/Android/data/net.wagic.app/files");
|
||||||
|
folder.mkdirs();
|
||||||
|
mMounts.add(folder.toString());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mMounts.add(System.getenv("SECONDARY_STORAGE"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setProperties()
|
private static void setProperties()
|
||||||
{
|
{
|
||||||
|
Log.d(TAG, "setProperties()");
|
||||||
/*
|
/*
|
||||||
* At this point all the paths in the list should be valid. Build the public properties.
|
* At this point all the paths in the list should be valid. Build the public properties.
|
||||||
*/
|
*/
|
||||||
@@ -151,14 +260,29 @@ public class StorageOptions
|
|||||||
ArrayList<String> mLabels = new ArrayList<String>();
|
ArrayList<String> mLabels = new ArrayList<String>();
|
||||||
|
|
||||||
int i = 1;
|
int i = 1;
|
||||||
for (String path : mMounts)
|
if(findForcemount()){
|
||||||
{ // TODO: /mnt/sdcard is assumed to always mean internal storage. Use this comparison until there is a better way to do this
|
for (String path : mMounts)
|
||||||
if ("/mnt/sdcard".equalsIgnoreCase(path))
|
{//with forcemount menu
|
||||||
mLabels.add("Built-in Storage");
|
if ("/mnt/sdcard".equalsIgnoreCase(path) || "/storage/sdcard0".equalsIgnoreCase(path))
|
||||||
else
|
mLabels.add("Internal SD " + "[" + path + "]");
|
||||||
mLabels.add("External SD Card " + i++);
|
else if (path.contains("emulated"))
|
||||||
|
mLabels.add("Emulated SD " + " [" + path + "]");
|
||||||
|
else
|
||||||
|
mLabels.add("External SD " + " [" + path + "]");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (String path : mMounts)
|
||||||
|
{
|
||||||
|
// TODO: /mnt/sdcard is assumed to always mean internal storage. Use this comparison until there is a better way to do this
|
||||||
|
if ("/mnt/sdcard".equalsIgnoreCase(path))
|
||||||
|
mLabels.add("Built-in Storage");
|
||||||
|
else
|
||||||
|
mLabels.add("External SD Card " + i++);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
labels = new String[mLabels.size()];
|
labels = new String[mLabels.size()];
|
||||||
mLabels.toArray(labels);
|
mLabels.toArray(labels);
|
||||||
|
|
||||||
@@ -171,4 +295,119 @@ public class StorageOptions
|
|||||||
// use and to prepare it for the next time it's needed.
|
// use and to prepare it for the next time it's needed.
|
||||||
mMounts.clear();
|
mMounts.clear();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
private static boolean isExternalStorageReadOnly() {
|
||||||
|
String extStorageState = Environment.getExternalStorageState();
|
||||||
|
if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(extStorageState)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isExternalStorageAvailable() {
|
||||||
|
String extStorageState = Environment.getExternalStorageState();
|
||||||
|
if (Environment.MEDIA_MOUNTED.equals(extStorageState)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the device is rooted.
|
||||||
|
*
|
||||||
|
* @return <code>true</code> if the device is rooted, <code>false</code> otherwise.
|
||||||
|
*/
|
||||||
|
public static boolean isRooted()
|
||||||
|
{
|
||||||
|
// get from build info
|
||||||
|
String buildTags = android.os.Build.TAGS;
|
||||||
|
if (buildTags != null && buildTags.contains("test-keys"))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if /system/app/Superuser.apk is present
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File file = new File("/system/app/Superuser.apk");
|
||||||
|
if (file.exists())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} catch (Exception e1)
|
||||||
|
{
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File file = new File("/system/app/Superuser/Superuser.apk");
|
||||||
|
if (file.exists())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} catch (Exception e1)
|
||||||
|
{
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
//SuperSU
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File file = new File("/system/app/SuperSU.apk");
|
||||||
|
if (file.exists())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} catch (Exception e1)
|
||||||
|
{
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File file = new File("/system/app/SuperSU/SuperSU.apk");
|
||||||
|
if (file.exists())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} catch (Exception e1)
|
||||||
|
{
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
// try executing commands
|
||||||
|
return canExecuteCommand("/system/xbin/which su")
|
||||||
|
|| canExecuteCommand("/system/bin/which su") || canExecuteCommand("which su");
|
||||||
|
}
|
||||||
|
|
||||||
|
// executes a command on the system
|
||||||
|
private static boolean canExecuteCommand(String command)
|
||||||
|
{
|
||||||
|
boolean executedSuccesfully;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Runtime.getRuntime().exec(command);
|
||||||
|
executedSuccesfully = true;
|
||||||
|
} catch (Exception e)
|
||||||
|
{
|
||||||
|
executedSuccesfully = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return executedSuccesfully;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean findForcemount()
|
||||||
|
{
|
||||||
|
Log.d(TAG, "findForcemount()");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File file = new File(System.getenv("EXTERNAL_STORAGE") + "/forcemount");
|
||||||
|
if (file.exists())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} catch (Exception e)
|
||||||
|
{
|
||||||
|
Log.w(TAG, e.getMessage());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
package org.libsdl.app;
|
package org.libsdl.app;
|
||||||
|
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
import java.io.BufferedInputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.FileReader;
|
||||||
|
import java.io.FileWriter;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
import javax.microedition.khronos.egl.EGL10;
|
import javax.microedition.khronos.egl.EGL10;
|
||||||
import javax.microedition.khronos.egl.EGLConfig;
|
import javax.microedition.khronos.egl.EGLConfig;
|
||||||
@@ -16,6 +22,7 @@ import javax.microedition.khronos.egl.EGLSurface;
|
|||||||
|
|
||||||
import net.wagic.app.R;
|
import net.wagic.app.R;
|
||||||
import net.wagic.utils.StorageOptions;
|
import net.wagic.utils.StorageOptions;
|
||||||
|
import net.wagic.utils.DeckImporter;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@@ -59,9 +66,11 @@ import android.widget.FrameLayout.LayoutParams;
|
|||||||
*/
|
*/
|
||||||
public class SDLActivity extends Activity implements OnKeyListener
|
public class SDLActivity extends Activity implements OnKeyListener
|
||||||
{
|
{
|
||||||
|
private static final String TAG = SDLActivity.class.getCanonicalName();
|
||||||
|
|
||||||
// TAG used for debugging in DDMS
|
//import deck globals
|
||||||
public static String TAG = Activity.class.getCanonicalName();
|
public ArrayList<String> myresult = new ArrayList<String>();
|
||||||
|
public String myclickedItem = "";
|
||||||
|
|
||||||
// Main components
|
// Main components
|
||||||
private static SDLActivity mSingleton;
|
private static SDLActivity mSingleton;
|
||||||
@@ -80,7 +89,6 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
public Boolean mErrorHappened = false;
|
public Boolean mErrorHappened = false;
|
||||||
public final static String RES_FOLDER = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/";
|
public final static String RES_FOLDER = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/";
|
||||||
public static String RES_FILENAME = "core_0184.zip";
|
public static String RES_FILENAME = "core_0184.zip";
|
||||||
public static final String RES_URL = "http://wagic.googlecode.com/files/";
|
|
||||||
|
|
||||||
public String systemFolder = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/";
|
public String systemFolder = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/";
|
||||||
private String userFolder;
|
private String userFolder;
|
||||||
@@ -201,7 +209,60 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
|
|
||||||
setStorage.create().show();
|
setStorage.create().show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void importDeckOptions()
|
||||||
|
{
|
||||||
|
AlertDialog.Builder importDeck = new AlertDialog.Builder(this);
|
||||||
|
importDeck.setTitle("Choose Deck to Import:");
|
||||||
|
File root = new File(System.getenv("EXTERNAL_STORAGE")+"/Download");
|
||||||
|
File[] files = root.listFiles();
|
||||||
|
for( File f : files)
|
||||||
|
{
|
||||||
|
if( !myresult.contains(f.toString()) && (f.toString().contains(".txt")||f.toString().contains(".dck")||f.toString().contains(".dec")))
|
||||||
|
myresult.add(f.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
//get first item?
|
||||||
|
if(!myresult.isEmpty())
|
||||||
|
myclickedItem = myresult.get(0).toString();
|
||||||
|
|
||||||
|
importDeck.setSingleChoiceItems(myresult.toArray(new String[myresult.size()]), 0, new DialogInterface.OnClickListener()
|
||||||
|
{
|
||||||
|
public void onClick(DialogInterface dialog, int item)
|
||||||
|
{
|
||||||
|
myclickedItem = myresult.get(item).toString();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
importDeck.setPositiveButton("Import Deck", new DialogInterface.OnClickListener()
|
||||||
|
{
|
||||||
|
public void onClick(DialogInterface dialog, int which)
|
||||||
|
{
|
||||||
|
processSelectedDeck( myclickedItem );
|
||||||
|
if (mSurface == null)
|
||||||
|
mSingleton.initializeGame();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
importDeck.create().show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processSelectedDeck(String mypath)
|
||||||
|
{
|
||||||
|
AlertDialog.Builder infoDialog = new AlertDialog.Builder(this);
|
||||||
|
infoDialog.setTitle("Imported Deck:");
|
||||||
|
String activePath = sdcardPath;
|
||||||
|
if(activePath == ""){
|
||||||
|
activePath = internalPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
File f = new File(mypath);
|
||||||
|
//Call the deck importer....
|
||||||
|
String state = DeckImporter.importDeck(f, mypath, activePath);
|
||||||
|
infoDialog.setMessage(state);
|
||||||
|
infoDialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
private void checkStorageLocationPreference()
|
private void checkStorageLocationPreference()
|
||||||
{
|
{
|
||||||
SharedPreferences settings = getSharedPreferences(kWagicSharedPreferencesKey, MODE_PRIVATE);
|
SharedPreferences settings = getSharedPreferences(kWagicSharedPreferencesKey, MODE_PRIVATE);
|
||||||
@@ -288,7 +349,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
updateStorageLocations();
|
updateStorageLocations();
|
||||||
} catch (Exception ioex)
|
} catch (Exception ioex)
|
||||||
{
|
{
|
||||||
Log.e("SDL", "An error occurred in setting up the storage locations.");
|
Log.e(TAG, "An error occurred in setting up the storage locations.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,7 +368,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
|
|
||||||
private void startDownload()
|
private void startDownload()
|
||||||
{
|
{
|
||||||
String url = RES_URL + RES_FILENAME;
|
String url = getResourceUrl();
|
||||||
if (!checkStorageState())
|
if (!checkStorageState())
|
||||||
{
|
{
|
||||||
Log.e(TAG, "Error in initializing storage space.");
|
Log.e(TAG, "Error in initializing storage space.");
|
||||||
@@ -335,7 +396,8 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
public boolean onCreateOptionsMenu(Menu menu)
|
public boolean onCreateOptionsMenu(Menu menu)
|
||||||
{
|
{
|
||||||
SubMenu settingsMenu = menu.addSubMenu(Menu.NONE, 1, 1, "Settings");
|
SubMenu settingsMenu = menu.addSubMenu(Menu.NONE, 1, 1, "Settings");
|
||||||
menu.add(Menu.NONE, 2, 2, "About");
|
menu.add(Menu.NONE, 2, 2, "Import");
|
||||||
|
menu.add(Menu.NONE, 3, 3, "About");
|
||||||
settingsMenu.add(kStorageDataOptionsMenuId, kStorageDataOptionsMenuId, Menu.NONE, "Storage Data Options");
|
settingsMenu.add(kStorageDataOptionsMenuId, kStorageDataOptionsMenuId, Menu.NONE, "Storage Data Options");
|
||||||
// buildStorageOptionsMenu(settingsMenu);
|
// buildStorageOptionsMenu(settingsMenu);
|
||||||
|
|
||||||
@@ -351,6 +413,9 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
{
|
{
|
||||||
displayStorageOptions();
|
displayStorageOptions();
|
||||||
} else if (itemId == 2)
|
} else if (itemId == 2)
|
||||||
|
{
|
||||||
|
importDeckOptions();
|
||||||
|
} else if (itemId == 3)
|
||||||
{
|
{
|
||||||
// display some info about the app
|
// display some info about the app
|
||||||
AlertDialog.Builder infoDialog = new AlertDialog.Builder(this);
|
AlertDialog.Builder infoDialog = new AlertDialog.Builder(this);
|
||||||
@@ -429,15 +494,13 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState)
|
protected void onCreate(Bundle savedInstanceState)
|
||||||
{
|
{
|
||||||
// Log.v("SDL", "onCreate()");
|
//Log.d(TAG, "onCreate()");
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
// So we can call stuff from static callbacks
|
// So we can call stuff from static callbacks
|
||||||
mSingleton = this;
|
mSingleton = this;
|
||||||
mContext = this.getApplicationContext();
|
mContext = this.getApplicationContext();
|
||||||
// get the current version of the app to set the core filename
|
RES_FILENAME = getResourceName();
|
||||||
String versionCodeString = getApplicationCode();
|
|
||||||
RES_FILENAME = "core_" + versionCodeString + ".zip";
|
|
||||||
|
|
||||||
StorageOptions.determineStorageOptions();
|
StorageOptions.determineStorageOptions();
|
||||||
checkStorageLocationPreference();
|
checkStorageLocationPreference();
|
||||||
@@ -464,7 +527,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
@Override
|
@Override
|
||||||
protected void onPause()
|
protected void onPause()
|
||||||
{
|
{
|
||||||
// Log.v("SDL", "onPause()");
|
// Log.d(TAG, "onPause()");
|
||||||
super.onPause();
|
super.onPause();
|
||||||
SDLActivity.nativePause();
|
SDLActivity.nativePause();
|
||||||
}
|
}
|
||||||
@@ -472,7 +535,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume()
|
protected void onResume()
|
||||||
{
|
{
|
||||||
// Log.v("SDL", "onResume()");
|
// Log.d(TAG, "onResume()");
|
||||||
super.onResume();
|
super.onResume();
|
||||||
SDLActivity.nativeResume();
|
SDLActivity.nativeResume();
|
||||||
}
|
}
|
||||||
@@ -480,8 +543,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
@Override
|
@Override
|
||||||
public void onDestroy()
|
public void onDestroy()
|
||||||
{
|
{
|
||||||
// Log.v("SDL", "onDestroy()");
|
// Log.d(TAG, "onDestroy()");
|
||||||
|
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
mSurface.onDestroy();
|
mSurface.onDestroy();
|
||||||
}
|
}
|
||||||
@@ -525,6 +587,9 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
// C functions we call
|
// C functions we call
|
||||||
|
public static native String getResourceUrl();
|
||||||
|
public static native String getResourceName();
|
||||||
|
|
||||||
public static native void nativeInit();
|
public static native void nativeInit();
|
||||||
|
|
||||||
public static native void nativeQuit();
|
public static native void nativeQuit();
|
||||||
@@ -589,7 +654,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
int audioFormat = is16Bit ? AudioFormat.ENCODING_PCM_16BIT : AudioFormat.ENCODING_PCM_8BIT;
|
int audioFormat = is16Bit ? AudioFormat.ENCODING_PCM_16BIT : AudioFormat.ENCODING_PCM_8BIT;
|
||||||
int frameSize = (isStereo ? 2 : 1) * (is16Bit ? 2 : 1);
|
int frameSize = (isStereo ? 2 : 1) * (is16Bit ? 2 : 1);
|
||||||
|
|
||||||
// Log.v("SDL", "SDL audio: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + ((float)sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer");
|
// Log.d(TAG, "SDL audio: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + ((float)sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer");
|
||||||
|
|
||||||
// Let the user pick a larger buffer if they really want -- but ye
|
// Let the user pick a larger buffer if they really want -- but ye
|
||||||
// gods they probably shouldn't, the minimums are horrifyingly high
|
// gods they probably shouldn't, the minimums are horrifyingly high
|
||||||
@@ -600,7 +665,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
|
|
||||||
audioStartThread();
|
audioStartThread();
|
||||||
|
|
||||||
// Log.v("SDL", "SDL audio: got " + ((mAudioTrack.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + ((float)mAudioTrack.getSampleRate() / 1000f) +
|
// Log.d(TAG, "SDL audio: got " + ((mAudioTrack.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + ((float)mAudioTrack.getSampleRate() / 1000f) +
|
||||||
// "kHz, " + desiredFrames + " frames buffer");
|
// "kHz, " + desiredFrames + " frames buffer");
|
||||||
|
|
||||||
if (is16Bit)
|
if (is16Bit)
|
||||||
@@ -648,7 +713,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
Log.w("SDL", "SDL audio: error return from write(short)");
|
Log.w(TAG, "SDL audio: error return from write(short)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -673,7 +738,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
Log.w("SDL", "SDL audio: error return from write(short)");
|
Log.w(TAG, "SDL audio: error return from write(short)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -688,11 +753,11 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
mAudioThread.join();
|
mAudioThread.join();
|
||||||
} catch (Exception e)
|
} catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.v("SDL", "Problem stopping audio thread: " + e);
|
Log.e(TAG, "Problem stopping audio thread: " + e);
|
||||||
}
|
}
|
||||||
mAudioThread = null;
|
mAudioThread = null;
|
||||||
|
|
||||||
// Log.v("SDL", "Finished waiting for audio thread");
|
// Log.d(TAG, "Finished waiting for audio thread");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mAudioTrack != null)
|
if (mAudioTrack != null)
|
||||||
@@ -704,7 +769,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
|
|
||||||
class DownloadFileAsync extends AsyncTask<String, Integer, Long>
|
class DownloadFileAsync extends AsyncTask<String, Integer, Long>
|
||||||
{
|
{
|
||||||
final String TAG1 = DownloadFileAsync.class.getCanonicalName();
|
private final String TAG = DownloadFileAsync.class.getCanonicalName();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPreExecute()
|
protected void onPreExecute()
|
||||||
@@ -723,7 +788,6 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
//
|
//
|
||||||
// Prepare the sdcard folders in order to download the resource file
|
// Prepare the sdcard folders in order to download the resource file
|
||||||
//
|
//
|
||||||
@@ -744,7 +808,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
conexion.connect();
|
conexion.connect();
|
||||||
|
|
||||||
int lengthOfFile = conexion.getContentLength();
|
int lengthOfFile = conexion.getContentLength();
|
||||||
// Log.d("Wagic - " + TAG1, " Length of file: " + lengthOfFile);
|
// Log.d(TAG, " Length of file: " + lengthOfFile);
|
||||||
|
|
||||||
input = new BufferedInputStream(url.openStream());
|
input = new BufferedInputStream(url.openStream());
|
||||||
// create a File object for the output file
|
// create a File object for the output file
|
||||||
@@ -767,8 +831,8 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
{
|
{
|
||||||
String errorMessage = "An error happened while downloading the resources. It could be that our server is temporarily down, that your device is not connected to a network, or that we cannot write to " + mSingleton.getSystemStorageLocation() + ". Please check your phone settings and try again. For more help please go to http://wagic.net";
|
String errorMessage = "An error happened while downloading the resources. It could be that our server is temporarily down, that your device is not connected to a network, or that we cannot write to " + mSingleton.getSystemStorageLocation() + ". Please check your phone settings and try again. For more help please go to http://wagic.net";
|
||||||
mSingleton.downloadError(errorMessage);
|
mSingleton.downloadError(errorMessage);
|
||||||
Log.e(TAG1, errorMessage);
|
Log.e(TAG, errorMessage);
|
||||||
Log.e(TAG1, e.getMessage());
|
Log.e(TAG, e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
return Long.valueOf(totalBytes);
|
return Long.valueOf(totalBytes);
|
||||||
@@ -778,7 +842,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
{
|
{
|
||||||
if (progress[0] != mProgressDialog.getProgress())
|
if (progress[0] != mProgressDialog.getProgress())
|
||||||
{
|
{
|
||||||
// Log.d("Wagic - " + TAG1, "current progress : " + progress[0]);
|
// Log.d(TAG, "current progress : " + progress[0]);
|
||||||
mProgressDialog.setProgress(progress[0]);
|
mProgressDialog.setProgress(progress[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -851,6 +915,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
*/
|
*/
|
||||||
class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnKeyListener, View.OnTouchListener, SensorEventListener
|
class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnKeyListener, View.OnTouchListener, SensorEventListener
|
||||||
{
|
{
|
||||||
|
private static final String TAG = SDLSurface.class.getCanonicalName();
|
||||||
|
|
||||||
// This is what SDL runs in. It invokes SDL_main(), eventually
|
// This is what SDL runs in. It invokes SDL_main(), eventually
|
||||||
private Thread mSDLThread;
|
private Thread mSDLThread;
|
||||||
@@ -890,7 +955,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
|
|
||||||
SDLActivity.nativeQuit();
|
SDLActivity.nativeQuit();
|
||||||
|
|
||||||
Log.v("SDL", "SDL thread terminated");
|
Log.d(TAG, "SDL thread terminated");
|
||||||
|
|
||||||
// On exit, tear everything down for a fresh restart next time.
|
// On exit, tear everything down for a fresh restart next time.
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
@@ -917,7 +982,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
// Called when we have a valid drawing surface
|
// Called when we have a valid drawing surface
|
||||||
public void surfaceCreated(SurfaceHolder holder)
|
public void surfaceCreated(SurfaceHolder holder)
|
||||||
{
|
{
|
||||||
Log.v("SDL", "surfaceCreated()");
|
//Log.d(TAG, "surfaceCreated()");
|
||||||
|
|
||||||
enableSensor(Sensor.TYPE_ACCELEROMETER, true);
|
enableSensor(Sensor.TYPE_ACCELEROMETER, true);
|
||||||
}
|
}
|
||||||
@@ -937,18 +1002,18 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
mSDLThread.join();
|
mSDLThread.join();
|
||||||
} catch (Exception e)
|
} catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.v("SDL", "Problem stopping thread: " + e);
|
Log.e(TAG, "Problem stopping thread: " + e);
|
||||||
}
|
}
|
||||||
mSDLThread = null;
|
mSDLThread = null;
|
||||||
|
|
||||||
// Log.v("SDL", "Finished waiting for SDL thread");
|
// Log.d(TAG, "Finished waiting for SDL thread");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when we lose the surface
|
// Called when we lose the surface
|
||||||
public void surfaceDestroyed(SurfaceHolder holder)
|
public void surfaceDestroyed(SurfaceHolder holder)
|
||||||
{
|
{
|
||||||
Log.v("SDL", "surfaceDestroyed()");
|
Log.d(TAG, "surfaceDestroyed()");
|
||||||
synchronized (mSemSurface)
|
synchronized (mSemSurface)
|
||||||
{
|
{
|
||||||
mSurfaceValid = false;
|
mSurfaceValid = false;
|
||||||
@@ -960,51 +1025,51 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
// Called when the surface is resized
|
// Called when the surface is resized
|
||||||
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height)
|
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height)
|
||||||
{
|
{
|
||||||
Log.d("SDL", "surfaceChanged()");
|
Log.d(TAG, "surfaceChanged()");
|
||||||
|
|
||||||
int sdlFormat = 0x85151002; // SDL_PIXELFORMAT_RGB565 by default
|
int sdlFormat = 0x85151002; // SDL_PIXELFORMAT_RGB565 by default
|
||||||
switch (format)
|
switch (format)
|
||||||
{
|
{
|
||||||
case PixelFormat.A_8:
|
case PixelFormat.A_8:
|
||||||
Log.d("SDL", "pixel format A_8");
|
Log.d("TAG", "pixel format A_8");
|
||||||
break;
|
break;
|
||||||
case PixelFormat.LA_88:
|
case PixelFormat.LA_88:
|
||||||
Log.d("SDL", "pixel format LA_88");
|
Log.d("TAG", "pixel format LA_88");
|
||||||
break;
|
break;
|
||||||
case PixelFormat.L_8:
|
case PixelFormat.L_8:
|
||||||
Log.d("SDL", "pixel format L_8");
|
Log.d("TAG", "pixel format L_8");
|
||||||
break;
|
break;
|
||||||
case PixelFormat.RGBA_4444:
|
case PixelFormat.RGBA_4444:
|
||||||
Log.d("SDL", "pixel format RGBA_4444");
|
Log.d("TAG", "pixel format RGBA_4444");
|
||||||
sdlFormat = 0x85421002; // SDL_PIXELFORMAT_RGBA4444
|
sdlFormat = 0x85421002; // SDL_PIXELFORMAT_RGBA4444
|
||||||
break;
|
break;
|
||||||
case PixelFormat.RGBA_5551:
|
case PixelFormat.RGBA_5551:
|
||||||
Log.d("SDL", "pixel format RGBA_5551");
|
Log.d(TAG, "pixel format RGBA_5551");
|
||||||
sdlFormat = 0x85441002; // SDL_PIXELFORMAT_RGBA5551
|
sdlFormat = 0x85441002; // SDL_PIXELFORMAT_RGBA5551
|
||||||
break;
|
break;
|
||||||
case PixelFormat.RGBA_8888:
|
case PixelFormat.RGBA_8888:
|
||||||
Log.d("SDL", "pixel format RGBA_8888");
|
Log.d(TAG, "pixel format RGBA_8888");
|
||||||
sdlFormat = 0x86462004; // SDL_PIXELFORMAT_RGBA8888
|
sdlFormat = 0x86462004; // SDL_PIXELFORMAT_RGBA8888
|
||||||
break;
|
break;
|
||||||
case PixelFormat.RGBX_8888:
|
case PixelFormat.RGBX_8888:
|
||||||
Log.d("SDL", "pixel format RGBX_8888");
|
Log.d(TAG, "pixel format RGBX_8888");
|
||||||
sdlFormat = 0x86262004; // SDL_PIXELFORMAT_RGBX8888
|
sdlFormat = 0x86262004; // SDL_PIXELFORMAT_RGBX8888
|
||||||
break;
|
break;
|
||||||
case PixelFormat.RGB_332:
|
case PixelFormat.RGB_332:
|
||||||
Log.d("SDL", "pixel format RGB_332");
|
Log.d(TAG, "pixel format RGB_332");
|
||||||
sdlFormat = 0x84110801; // SDL_PIXELFORMAT_RGB332
|
sdlFormat = 0x84110801; // SDL_PIXELFORMAT_RGB332
|
||||||
break;
|
break;
|
||||||
case PixelFormat.RGB_565:
|
case PixelFormat.RGB_565:
|
||||||
Log.d("SDL", "pixel format RGB_565");
|
Log.d(TAG, "pixel format RGB_565");
|
||||||
sdlFormat = 0x85151002; // SDL_PIXELFORMAT_RGB565
|
sdlFormat = 0x85151002; // SDL_PIXELFORMAT_RGB565
|
||||||
break;
|
break;
|
||||||
case PixelFormat.RGB_888:
|
case PixelFormat.RGB_888:
|
||||||
Log.d("SDL", "pixel format RGB_888");
|
Log.d(TAG, "pixel format RGB_888");
|
||||||
// Not sure this is right, maybe SDL_PIXELFORMAT_RGB24 instead?
|
// Not sure this is right, maybe SDL_PIXELFORMAT_RGB24 instead?
|
||||||
sdlFormat = 0x86161804; // SDL_PIXELFORMAT_RGB888
|
sdlFormat = 0x86161804; // SDL_PIXELFORMAT_RGB888
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Log.d("SDL", "pixel format unknown " + format);
|
Log.d(TAG, "pixel format unknown " + format);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
SDLActivity.onNativeResize(width, height, sdlFormat);
|
SDLActivity.onNativeResize(width, height, sdlFormat);
|
||||||
@@ -1021,11 +1086,10 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
// EGL functions
|
// EGL functions
|
||||||
public boolean initEGL(int majorVersion, int minorVersion)
|
public boolean initEGL(int majorVersion, int minorVersion)
|
||||||
{
|
{
|
||||||
Log.d("SDL", "Starting up OpenGL ES " + majorVersion + "." + minorVersion);
|
Log.d(TAG, "Starting up OpenGL ES " + majorVersion + "." + minorVersion);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
EGL10 egl = (EGL10) EGLContext.getEGL();
|
EGL10 egl = (EGL10) EGLContext.getEGL();
|
||||||
|
|
||||||
EGLDisplay dpy = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
|
EGLDisplay dpy = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
|
||||||
@@ -1051,7 +1115,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
int[] num_config = new int[1];
|
int[] num_config = new int[1];
|
||||||
if (!egl.eglChooseConfig(dpy, configSpec, configs, 1, num_config) || num_config[0] == 0)
|
if (!egl.eglChooseConfig(dpy, configSpec, configs, 1, num_config) || num_config[0] == 0)
|
||||||
{
|
{
|
||||||
Log.e("SDL", "No EGL config available");
|
Log.e(TAG, "No EGL config available");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
mEGLConfig = configs[0];
|
mEGLConfig = configs[0];
|
||||||
@@ -1059,7 +1123,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
EGLContext ctx = egl.eglCreateContext(dpy, mEGLConfig, EGL10.EGL_NO_CONTEXT, null);
|
EGLContext ctx = egl.eglCreateContext(dpy, mEGLConfig, EGL10.EGL_NO_CONTEXT, null);
|
||||||
if (ctx == EGL10.EGL_NO_CONTEXT)
|
if (ctx == EGL10.EGL_NO_CONTEXT)
|
||||||
{
|
{
|
||||||
Log.e("SDL", "Couldn't create context");
|
Log.e(TAG, "Couldn't create context");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1073,10 +1137,10 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
|
|
||||||
} catch (Exception e)
|
} catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.e("SDL", e + "");
|
Log.e(TAG, e + "");
|
||||||
for (StackTraceElement s : e.getStackTrace())
|
for (StackTraceElement s : e.getStackTrace())
|
||||||
{
|
{
|
||||||
Log.e("SDL", s.toString());
|
Log.e(TAG, s.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1091,7 +1155,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
EGL10 egl = (EGL10) EGLContext.getEGL();
|
EGL10 egl = (EGL10) EGLContext.getEGL();
|
||||||
if (mEGLSurface != null)
|
if (mEGLSurface != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unbind and destroy the old EGL surface, if there is one.
|
* Unbind and destroy the old EGL surface, if there is one.
|
||||||
*/
|
*/
|
||||||
@@ -1105,7 +1168,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
mEGLSurface = egl.eglCreateWindowSurface(mEGLDisplay, mEGLConfig, holder, null);
|
mEGLSurface = egl.eglCreateWindowSurface(mEGLDisplay, mEGLConfig, holder, null);
|
||||||
if (mEGLSurface == EGL10.EGL_NO_SURFACE)
|
if (mEGLSurface == EGL10.EGL_NO_SURFACE)
|
||||||
{
|
{
|
||||||
Log.e("SDL", "Couldn't create surface");
|
Log.e(TAG, "Couldn't create surface");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1114,7 +1177,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
*/
|
*/
|
||||||
if (!egl.eglMakeCurrent(mEGLDisplay, mEGLSurface, mEGLSurface, mEGLContext))
|
if (!egl.eglMakeCurrent(mEGLDisplay, mEGLSurface, mEGLSurface, mEGLContext))
|
||||||
{
|
{
|
||||||
Log.e("SDL", "Couldn't make context current");
|
Log.e(TAG, "Couldn't make context current");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1126,7 +1189,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
// EGL buffer flip
|
// EGL buffer flip
|
||||||
public void flipEGL()
|
public void flipEGL()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!mSurfaceValid)
|
if (!mSurfaceValid)
|
||||||
{
|
{
|
||||||
createSurface(this.getHolder());
|
createSurface(this.getHolder());
|
||||||
@@ -1136,7 +1198,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
{
|
{
|
||||||
EGL10 egl = (EGL10) EGLContext.getEGL();
|
EGL10 egl = (EGL10) EGLContext.getEGL();
|
||||||
|
|
||||||
egl.eglWaitNative(EGL10.EGL_NATIVE_RENDERABLE, null);
|
egl.eglWaitNative(EGL10.EGL_CORE_NATIVE_ENGINE, null);
|
||||||
|
|
||||||
// drawing here
|
// drawing here
|
||||||
|
|
||||||
@@ -1146,13 +1208,12 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
|
|
||||||
} catch (Exception e)
|
} catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.e("SDL", "flipEGL(): " + e);
|
Log.e(TAG, "flipEGL(): " + e);
|
||||||
for (StackTraceElement s : e.getStackTrace())
|
for (StackTraceElement s : e.getStackTrace())
|
||||||
{
|
{
|
||||||
Log.e("SDL", s.toString());
|
Log.e(TAG, s.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Key events
|
// Key events
|
||||||
@@ -1163,14 +1224,15 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
|
|
||||||
if (keyCode == KeyEvent.KEYCODE_VOLUME_UP || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)
|
if (keyCode == KeyEvent.KEYCODE_VOLUME_UP || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (event.getAction() == KeyEvent.ACTION_DOWN)
|
if (event.getAction() == KeyEvent.ACTION_DOWN)
|
||||||
{
|
{
|
||||||
// Log.d("SDL", "key down: " + keyCode);
|
// Log.d(TAG, "key down: " + keyCode);
|
||||||
SDLActivity.onNativeKeyDown(keyCode);
|
SDLActivity.onNativeKeyDown(keyCode);
|
||||||
return true;
|
return true;
|
||||||
} else if (event.getAction() == KeyEvent.ACTION_UP)
|
} else if (event.getAction() == KeyEvent.ACTION_UP)
|
||||||
{
|
{
|
||||||
// Log.d("SDL", "key up: " + keyCode);
|
// Log.d(TAG, "key up: " + keyCode);
|
||||||
SDLActivity.onNativeKeyUp(keyCode);
|
SDLActivity.onNativeKeyUp(keyCode);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1181,7 +1243,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
// Touch events
|
// Touch events
|
||||||
public boolean onTouch(View v, MotionEvent event)
|
public boolean onTouch(View v, MotionEvent event)
|
||||||
{
|
{
|
||||||
|
|
||||||
for (int index = 0; index < event.getPointerCount(); ++index)
|
for (int index = 0; index < event.getPointerCount(); ++index)
|
||||||
{
|
{
|
||||||
int action = event.getActionMasked();
|
int action = event.getActionMasked();
|
||||||
@@ -1248,3 +1309,4 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
233
projects/mtg/CMakeLists.txt
Normal file
@@ -0,0 +1,233 @@
|
|||||||
|
#MTGs common sources
|
||||||
|
set(MTG_generic_src
|
||||||
|
src/AbilityParser.cpp
|
||||||
|
src/ActionElement.cpp
|
||||||
|
src/ActionLayer.cpp
|
||||||
|
src/ActionStack.cpp
|
||||||
|
src/AIHints.cpp
|
||||||
|
src/AIMomirPlayer.cpp
|
||||||
|
src/AIPlayer.cpp
|
||||||
|
src/AIPlayerBaka.cpp
|
||||||
|
src/AIStats.cpp
|
||||||
|
src/AllAbilities.cpp
|
||||||
|
src/CardDescriptor.cpp
|
||||||
|
src/CardDisplay.cpp
|
||||||
|
src/CardGui.cpp
|
||||||
|
src/CardPrimitive.cpp
|
||||||
|
src/CardSelector.cpp
|
||||||
|
src/CardSelectorSingleton.cpp
|
||||||
|
src/CarouselDeckView.cpp
|
||||||
|
src/Closest.cpp
|
||||||
|
src/Counters.cpp
|
||||||
|
src/Credits.cpp
|
||||||
|
src/Damage.cpp
|
||||||
|
src/DamagerDamaged.cpp
|
||||||
|
src/DeckDataWrapper.cpp
|
||||||
|
src/DeckEditorMenu.cpp
|
||||||
|
src/DeckManager.cpp
|
||||||
|
src/DeckMenu.cpp
|
||||||
|
src/DeckMenuItem.cpp
|
||||||
|
src/DeckMetaData.cpp
|
||||||
|
src/DeckStats.cpp
|
||||||
|
src/DeckView.cpp
|
||||||
|
src/DuelLayers.cpp
|
||||||
|
src/ExtraCost.cpp
|
||||||
|
src/GameApp.cpp
|
||||||
|
src/GameLauncher.cpp
|
||||||
|
src/GameObserver.cpp
|
||||||
|
src/GameOptions.cpp
|
||||||
|
src/GameStateAwards.cpp
|
||||||
|
src/GameState.cpp
|
||||||
|
src/GameStateDeckViewer.cpp
|
||||||
|
src/GameStateDuel.cpp
|
||||||
|
src/GameStateMenu.cpp
|
||||||
|
src/GameStateOptions.cpp
|
||||||
|
src/GameStateShop.cpp
|
||||||
|
src/GameStateStory.cpp
|
||||||
|
src/GameStateTransitions.cpp
|
||||||
|
src/GridDeckView.cpp
|
||||||
|
src/GuiAvatars.cpp
|
||||||
|
src/GuiBackground.cpp
|
||||||
|
src/GuiCardsController.cpp
|
||||||
|
src/GuiCombat.cpp
|
||||||
|
src/GuiFrame.cpp
|
||||||
|
src/GuiHand.cpp
|
||||||
|
src/GuiLayers.cpp
|
||||||
|
src/GuiMana.cpp
|
||||||
|
src/GuiPhaseBar.cpp
|
||||||
|
src/GuiPlay.cpp
|
||||||
|
src/GuiStatic.cpp
|
||||||
|
src/IconButton.cpp
|
||||||
|
src/InteractiveButton.cpp
|
||||||
|
src/ManaCost.cpp
|
||||||
|
src/ManaCostHybrid.cpp
|
||||||
|
src/MenuItem.cpp
|
||||||
|
src/ModRules.cpp
|
||||||
|
src/MTGAbility.cpp
|
||||||
|
src/MTGCard.cpp
|
||||||
|
src/MTGCardInstance.cpp
|
||||||
|
src/MTGDeck.cpp
|
||||||
|
src/MTGDefinitions.cpp
|
||||||
|
src/MTGGamePhase.cpp
|
||||||
|
src/MTGGameZones.cpp
|
||||||
|
src/MTGPack.cpp
|
||||||
|
src/MTGRules.cpp
|
||||||
|
src/ObjectAnalytics.cpp
|
||||||
|
src/OptionItem.cpp
|
||||||
|
src/PhaseRing.cpp
|
||||||
|
src/Player.cpp
|
||||||
|
src/PlayerData.cpp
|
||||||
|
src/PlayGuiObject.cpp
|
||||||
|
src/PlayGuiObjectController.cpp
|
||||||
|
src/PlayRestrictions.cpp
|
||||||
|
src/Pos.cpp
|
||||||
|
src/PriceList.cpp
|
||||||
|
src/ReplacementEffects.cpp
|
||||||
|
src/Rules.cpp
|
||||||
|
src/SimpleMenu.cpp
|
||||||
|
src/SimpleMenuItem.cpp
|
||||||
|
src/SimpleButton.cpp
|
||||||
|
src/SimplePad.cpp
|
||||||
|
src/SimplePopup.cpp
|
||||||
|
src/StoryFlow.cpp
|
||||||
|
src/Subtypes.cpp
|
||||||
|
src/StyleManager.cpp
|
||||||
|
src/TargetChooser.cpp
|
||||||
|
src/TargetsList.cpp
|
||||||
|
src/Tasks.cpp
|
||||||
|
src/TextScroller.cpp
|
||||||
|
src/ThisDescriptor.cpp
|
||||||
|
src/Token.cpp
|
||||||
|
src/Translate.cpp
|
||||||
|
src/TranslateKeys.cpp
|
||||||
|
src/Trash.cpp
|
||||||
|
src/utils.cpp
|
||||||
|
src/WCachedResource.cpp
|
||||||
|
src/WDataSrc.cpp
|
||||||
|
src/WEvent.cpp
|
||||||
|
src/WFilter.cpp
|
||||||
|
src/WFont.cpp
|
||||||
|
src/WGui.cpp
|
||||||
|
src/WResourceManager.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
set(MTG_network_src src/NetworkPlayer.cpp)
|
||||||
|
|
||||||
|
#the sources we need if we compile a graphical qt version
|
||||||
|
#TODO: add declarative version since this only works with QWidget right now
|
||||||
|
set(MTG_qt_graphic_src
|
||||||
|
src/qt/filedownloader.cpp
|
||||||
|
src/qt/corewrapper.cpp
|
||||||
|
include/qt/corewrapper.h #so automoc finds it
|
||||||
|
include/qt/filedownloader.h
|
||||||
|
src/Qtmain.cpp)
|
||||||
|
|
||||||
|
#the sources we need to compile the testsuit
|
||||||
|
set(MTG_qt_console_src
|
||||||
|
src/Qtconsole.cpp
|
||||||
|
src/TestSuiteAI.cpp)
|
||||||
|
|
||||||
|
set(MTG_sdl_src
|
||||||
|
src/SDLmain.cpp)
|
||||||
|
|
||||||
|
set(MTG_android_sdl_src
|
||||||
|
src/SDLmain.cpp)
|
||||||
|
|
||||||
|
set(MTG_iOS_src
|
||||||
|
iOS/UI/WagicDownloadProgressViewController.m
|
||||||
|
iOS/asi-http-request/ASIAuthenticationDialog.m
|
||||||
|
iOS/asi-http-request/ASIDataCompressor.m
|
||||||
|
iOS/asi-http-request/ASIDataDecompressor.m
|
||||||
|
iOS/asi-http-request/ASIDownloadCache.m
|
||||||
|
iOS/asi-http-request/ASIFormDataRequest.m
|
||||||
|
iOS/asi-http-request/ASIHTTPRequest.m
|
||||||
|
iOS/asi-http-request/ASIInputStream.m
|
||||||
|
iOS/asi-http-request/ASINetworkQueue.m
|
||||||
|
iOS/SoundManager/SoundManager.m
|
||||||
|
iOS/SoundManager/MyOpenALSupport.c
|
||||||
|
iOS/Reachability/Reachability/Reachability.m
|
||||||
|
iOS/ZipArchive/ZipArchive.mm)
|
||||||
|
|
||||||
|
|
||||||
|
set(MTG_iOS_INCLUDE_DIRS iOS/UI iOS/Reachability/Reachability iOS/asi-http-request iOS/ZipArchive iOS/SoundManager)
|
||||||
|
|
||||||
|
set(MTG_INCLUDE_DIRS include include/qt)
|
||||||
|
set(JGE_INCLUDE_DIRS ../../JGE/include ../../JGE/include/hge)
|
||||||
|
set(JGE_LIBRARY jge)
|
||||||
|
set(EXTRA_INCLUDE_DIR extra)
|
||||||
|
|
||||||
|
#turn moc on
|
||||||
|
if(backend_qt_console OR backend_qt_widget)
|
||||||
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
set(CMAKE_AUTOMOC TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(backend_qt_console)
|
||||||
|
if(UNIX AND NOT ANDROID)
|
||||||
|
include_directories(${MTG_INCLUDE_DIRS} ${JGE_INCLUDE_DIRS} ${ZIPFS_INCLUDE_DIR} ${Qt5Core_INCLUDE_DIRS} ${Qt5Multimedia_INCLUDE_DIRS}
|
||||||
|
${UNZIP_INCLUDE_DIR} ${HGE_INCLUDE_DIR} ${TINYXML_INCLUDE_DIR} ${QT_MKSPECS_DIR}/default)
|
||||||
|
add_executable(wagic ${MTG_generic_src} ${MTG_qt_console_src} ${MTG_network_src})
|
||||||
|
target_link_libraries(wagic ${JGE_LIBRARY} ${Qt5Core_INCLUDE_DIRS} ${Qt5Multimedia_INCLUDE_DIRS} ${TINYXML_LIBRARIES}
|
||||||
|
${HGE_LIBRARY} ${ZLIB_LIBRARIES})
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "qt-console builds are only supported on unix platforms")
|
||||||
|
endif()
|
||||||
|
elseif(backend_qt_widget)
|
||||||
|
if(UNIX AND NOT ANDROID)
|
||||||
|
include_directories(${MTG_INCLUDE_DIRS} ${JGE_INCLUDE_DIRS} ${ZIPFS_INCLUDE_DIR} ${Qt5Core_INCLUDE_DIRS} ${Qt5Multimedia_INCLUDE_DIRS}
|
||||||
|
${UNZIP_INCLUDE_DIR} ${HGE_INCLUDE_DIR} ${TINYXML_INCLUDE_DIR} ${QT_MKSPECS_DIR}/default)
|
||||||
|
add_executable(wagic ${MTG_generic_src} ${MTG_qt_graphic_src} ${MTG_network_src})
|
||||||
|
target_link_libraries(wagic ${JGE_LIBRARY} ${Qt5Core_INCLUDE_DIRS} ${Qt5Multimedia_INCLUDE_DIRS} ${OPENGL_LIBRARIES} ${TINYXML_LIBRARIES}
|
||||||
|
${HGE_LIBRARY} ${ZLIB_LIBRARIES})# ${X11_LIBRARIES})
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "qt-widget builds are only supported on unix platforms")
|
||||||
|
endif()
|
||||||
|
elseif(backend_sdl)
|
||||||
|
if((UNIX OR EMSCRIPTEN) AND NOT ANDROID)
|
||||||
|
include_directories(${MTG_INCLUDE_DIRS} ${JGE_INCLUDE_DIRS} ${SDL2_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR} ${UNZIP_INCLUDE_DIR} ${HGE_INCLUDE_DIR} ${TINYXML_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS})
|
||||||
|
add_executable(wagic ${MTG_generic_src} ${MTG_sdl_src} ${MTG_network_src} src/TestSuiteAI.cpp src/AIPlayerBakaB.cpp)
|
||||||
|
target_link_libraries(wagic ${JGE_LIBRARY} ${SDL2_LIBRARY} ${OPENGL_LIBRARIES} ${TINYXML_LIBRARIES} ${HGE_LIBRARY} ${ZLIB_LIBRARIES})
|
||||||
|
elseif(ANDROID)
|
||||||
|
include_directories(${MTG_INCLUDE_DIRS} ${JGE_INCLUDE_DIRS} ${SDL2_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR} ${BOOST_INCLUDE_DIRS} ${UNZIP_INCLUDE_DIR} ${HGE_INCLUDE_DIR} ${TINYXML_INCLUDE_DIR})
|
||||||
|
#we should try to get rid of this hack
|
||||||
|
add_library(wagic SHARED ${MTG_generic_src} ${MTG_network_src} ${MTG_android_sdl_src} src/TestSuiteAI.cpp)
|
||||||
|
target_link_libraries(wagic ${JGE_LIBRARY} ${SDL2_LIBRARY} ${OPENGL_LIBRARIES} ${TINYXML_LIBRARIES} ${HGE_LIBRARY} ${ZLIB_LIBRARIES})
|
||||||
|
elseif(WIN32)
|
||||||
|
include_directories(${EXTRA_INCLUDE_DIR} ${MTG_INCLUDE_DIRS} ${JGE_INCLUDE_DIRS} ${SDL2_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR}
|
||||||
|
${Boost_INCLUDE_DIRS} ${UNZIP_INCLUDE_DIR} ${HGE_INCLUDE_DIR} ${TINYXML_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS})
|
||||||
|
add_executable(wagic ${MTG_generic_src} ${MTG_sdl_src} src/TestSuiteAI.cpp src/AIPlayerBakaB.cpp)
|
||||||
|
link_directories(${Boost_LIBRARY_DIR} ${SDL2_LIBRARY_DIR})
|
||||||
|
target_link_libraries(wagic ${JGE_LIBRARY} ${SDL2_LIBRARY} ${OPENGL_LIBRARIES} ${TINYXML_LIBRARIES} ${BOOST_date_time} ${HGE_LIBRARY} ${ZLIB_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
elseif(backend_psp)
|
||||||
|
if(PSP)
|
||||||
|
#${PSPSDK_PATH}/include
|
||||||
|
include_directories(${MTG_INCLUDE_DIRS} ${JGE_INCLUDE_DIRS} ${TINYXML_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR}
|
||||||
|
${UNZIP_INCLUDE_DIR} ${BOOST_INCLUDE_DIRS} ${GIF_INCLUDE_DIR} ${HGETOOLS_INCLUDE_DIRS})
|
||||||
|
add_executable(wagic ${MTG_generic_src} ${MTG_network_src})
|
||||||
|
target_link_libraries(wagic ${JGE_LIBRARY} ${PSPSDK_LIB} ${HGETOOLS_LIBRARY} ${FREETYPE_LIB} ${JPEG_LIBRARY}
|
||||||
|
${GIF_LIBRARIES} ${PNG_LIBRARIES} z m ${MIKMOD_LIBRARY} ${TINYXML_LIBRARIES}
|
||||||
|
stdc++ ${PSPSDK_REQUIRED_LIB})
|
||||||
|
|
||||||
|
set(PRXSPECS_FILE "${PSPSDK_PATH}/lib/prxspecs")
|
||||||
|
set(LINKFILE_FILE "${PSPSDK_PATH}/lib/linkfile.prx")
|
||||||
|
|
||||||
|
get_property(wagic_elf_location TARGET wagic PROPERTY LOCATION)
|
||||||
|
get_filename_component(wagic_elf_directory ${wagic_elf_location} PATH)
|
||||||
|
|
||||||
|
set_target_properties(wagic PROPERTIES LINK_FLAGS "-specs=${PRXSPECS_FILE} -Wl,-q,-T${LINKFILE_FILE}")
|
||||||
|
|
||||||
|
add_custom_command(TARGET wagic POST_BUILD
|
||||||
|
COMMAND ${PSPSDK_MKSFO_COMMAND} ARGS "'Wagic, the Homebrew?!'" "${wagic_elf_directory}/PARAM.SFO"
|
||||||
|
COMMAND ${PSPSDK_FIXUP_IMPORTS_COMMAND} ARGS ${wagic_elf_location}
|
||||||
|
COMMAND ${PSPSDK_PRXGEN_COMMAND} ARGS ${wagic_elf_location} "${wagic_elf_directory}/wagic.prx"
|
||||||
|
COMMAND ${PSPSDK_PACK_PBP_COMMAND} ARGS ${wagic_elf_directory}/EBOOT.PBP ${wagic_elf_directory}/PARAM.SFO ${CMAKE_CURRENT_SOURCE_DIR}/icon.png NULL ${CMAKE_CURRENT_SOURCE_DIR}/pic0.png ${CMAKE_CURRENT_SOURCE_DIR}/pic1.png NULL "${wagic_elf_directory}/wagic.prx" NULL)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "use the cross-compile toolchain to build as the psp target")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if(IOS)
|
||||||
|
set(MTG_generic_src ${MTG_generic_src} ${MTG_iOS_src} PARENT_SCOPE)
|
||||||
|
set(MTG_INCLUDE_DIRS ${MTG_INCLUDE_DIRS} ${MTG_iOS_INCLUDE_DIRS} PARENT_SCOPE)
|
||||||
|
|
||||||
|
endif()
|
||||||
20
projects/mtg/MacOS/Info.plist
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>NSPrincipalClass</key>
|
||||||
|
<string>NSApplication</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleGetInfoString</key>
|
||||||
|
<string>Created by Qt/QMake</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>wagic.launcher</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>wagic.wagic</string>
|
||||||
|
<key>NOTE</key>
|
||||||
|
<string>This file was generated by Qt/QMake.</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
BIN
projects/mtg/MacOS/wagic.icns
Normal file
5
projects/mtg/MacOS/wagic.launcher
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd ${0%/*/*}/Resources
|
||||||
|
#cd ../Resources
|
||||||
|
exec ../MacOS/wagic -platformpluginpath ../PlugIns >> ../logs/out.log 2> ../logs/err.log
|
||||||
@@ -6,7 +6,7 @@ OBJS = objs/InteractiveButton.o objs/AbilityParser.o objs/ActionElement.o\
|
|||||||
objs/Counters.o objs/Credits.o objs/Damage.o objs/DamagerDamaged.o\
|
objs/Counters.o objs/Credits.o objs/Damage.o objs/DamagerDamaged.o\
|
||||||
objs/DeckDataWrapper.o objs/DeckEditorMenu.o objs/DeckMenu.o\
|
objs/DeckDataWrapper.o objs/DeckEditorMenu.o objs/DeckMenu.o\
|
||||||
objs/DeckMenuItem.o objs/DeckMetaData.o objs/DeckStats.o objs/DuelLayers.o\
|
objs/DeckMenuItem.o objs/DeckMetaData.o objs/DeckStats.o objs/DuelLayers.o\
|
||||||
objs/Effects.o objs/ExtraCost.o objs/GameApp.o objs/GameLauncher.o\
|
objs/ExtraCost.o objs/GameApp.o objs/GameLauncher.o\
|
||||||
objs/GameObserver.o objs/GameOptions.o objs/GameState.o\
|
objs/GameObserver.o objs/GameOptions.o objs/GameState.o\
|
||||||
objs/GameStateAwards.o objs/GameStateDeckViewer.o objs/GameStateDuel.o\
|
objs/GameStateAwards.o objs/GameStateDeckViewer.o objs/GameStateDuel.o\
|
||||||
objs/DeckManager.o objs/GameStateMenu.o objs/GameStateOptions.o\
|
objs/DeckManager.o objs/GameStateMenu.o objs/GameStateOptions.o\
|
||||||
@@ -59,7 +59,6 @@ endif
|
|||||||
|
|
||||||
ifeq ($(TARGET_ARCHITECTURE),psp)
|
ifeq ($(TARGET_ARCHITECTURE),psp)
|
||||||
DEFAULT_RULE = 3xx
|
DEFAULT_RULE = 3xx
|
||||||
TARGET_ARCHITECTURE = psp
|
|
||||||
PSP_FW_VERSION=371
|
PSP_FW_VERSION=371
|
||||||
BUILD_PRX = 1
|
BUILD_PRX = 1
|
||||||
SIGN_PRX = 1
|
SIGN_PRX = 1
|
||||||
@@ -74,19 +73,36 @@ PSP_EBOOT_PIC1 = pic1.png
|
|||||||
INCDIR = ../../JGE/include ../../JGE/src/zipFS ../../JGE/include/psp ../../JGE/include/psp/freetype2 ../../JGE/src ../../projects/mtg/include ../../Boost
|
INCDIR = ../../JGE/include ../../JGE/src/zipFS ../../JGE/include/psp ../../JGE/include/psp/freetype2 ../../JGE/src ../../projects/mtg/include ../../Boost
|
||||||
LIBDIR = ../../JGE/lib/psp
|
LIBDIR = ../../JGE/lib/psp
|
||||||
CFLAGS = -O2 -G0 -DPSPFW3XX -DDEVHOOK -DUSE_PRECOMPILED_HEADERS=1 -DPSP -DTIXML_USE_STL
|
CFLAGS = -O2 -G0 -DPSPFW3XX -DDEVHOOK -DUSE_PRECOMPILED_HEADERS=1 -DPSP -DTIXML_USE_STL
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
ifeq ($(MAKECMDGOALS),x11)
|
||||||
|
|
||||||
|
OBJS += objs/TestSuiteAI.o
|
||||||
|
INCDIR = -I../../JGE/include -I../../JGE/src -I/usr/X11/include -I../../projects/mtg/include -I/usr/include/boost -I../../JGE/src/zipFS
|
||||||
|
LIBDIR = -L../../JGE/lib/linux -L../../JGE -L/usr/X11/lib
|
||||||
|
LIBS = -ljge -lfreetype -ljpeg -lgif -lpng -lz -lm -lstdc++ -lhgetools -lGL -lGLU -lX11 -lpthread $(FMOD)
|
||||||
|
CFLAGS = $(INCDIR) -DLINUX -DUSE_PRECOMPILED_HEADERS=1 -DTIXML_USE_STL -Wno-nonnull-compare
|
||||||
|
|
||||||
|
ASFLAGS = $(CXXFLAGS)
|
||||||
|
|
||||||
|
all: $(DEFAULT_RULE)
|
||||||
|
else
|
||||||
|
|
||||||
OBJS += objs/TestSuiteAI.o
|
OBJS += objs/TestSuiteAI.o
|
||||||
INCDIR = -I../../JGE/include -I../../JGE/src -I/usr/X11/include -I../../projects/mtg/include -I../../Boost -I../../JGE/src/zipFS
|
INCDIR = -I../../JGE/include -I../../JGE/src -I/usr/X11/include -I../../projects/mtg/include -I../../Boost -I../../JGE/src/zipFS
|
||||||
LIBDIR = -L../../JGE/lib/linux -L../../JGE -L/usr/X11/lib -L../../Boost/lib
|
LIBDIR = -L../../JGE/lib/linux -L../../JGE -L/usr/X11/lib -L../../Boost/lib
|
||||||
LIBS = -ljge -lfreetype -ljpeg -lgif -lpng -lz -lm -lstdc++ -lhgetools -lGL -lGLU -lX11 -lboost_thread $(FMOD)
|
LIBS = -ljge -lfreetype -ljpeg -lgif -lpng -lz -lm -lstdc++ -lhgetools -lGL -lGLU -lX11 -lboost_thread $(FMOD)
|
||||||
CFLAGS = $(INCDIR) -DLINUX -DUSE_PRECOMPILED_HEADERS=1
|
CFLAGS = $(INCDIR) -DLINUX -DUSE_PRECOMPILED_HEADERS=1 -Wno-nonnull-compare
|
||||||
|
|
||||||
ASFLAGS = $(CXXFLAGS)
|
ASFLAGS = $(CXXFLAGS)
|
||||||
|
|
||||||
all: $(DEFAULT_RULE)
|
all: $(DEFAULT_RULE)
|
||||||
|
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS := -Wall -W -Werror -Wno-unused $(CFLAGS)
|
CFLAGS := -Wall -W -Werror -Wno-unused -Wno-deprecated-declarations $(CFLAGS)
|
||||||
CXXFLAGS += $(CFLAGS)
|
CXXFLAGS += $(CFLAGS)
|
||||||
# -fno-exceptions
|
# -fno-exceptions
|
||||||
|
|
||||||
@@ -110,8 +126,6 @@ debug: all
|
|||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(TARGET): Makefile.$(TARGET_ARCHITECTURE) $(OBJS) ../../JGE/lib/linux/libjge.a
|
$(TARGET): Makefile.$(TARGET_ARCHITECTURE) $(OBJS) ../../JGE/lib/linux/libjge.a
|
||||||
$(CXX) -o $(TARGET) $(OBJS) $(LIBS) $(LIBDIR)
|
$(CXX) -o $(TARGET) $(OBJS) $(LIBS) $(LIBDIR)
|
||||||
|
|
||||||
@@ -128,7 +142,7 @@ clean:
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
define compile
|
define compile
|
||||||
$(CXX) -c $(CXXFLAGS) $< -o $@
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
||||||
endef
|
endef
|
||||||
|
|
||||||
PrecompiledHeader.h.gch: ../../projects/mtg/include/PrecompiledHeader.h
|
PrecompiledHeader.h.gch: ../../projects/mtg/include/PrecompiledHeader.h
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
#NAME:Kill by Numbers
|
#NAME:Kill by Numbers
|
||||||
#DESC:They just keep multiplying.
|
#DESC:They just keep multiplying.
|
||||||
|
#HINT:castpriority(enchantment,instant,sorcery,artifact,creature)
|
||||||
|
#HINT:dontattackwith(Rhys the Redeemed)
|
||||||
|
#HINT:dontblockwith(Rhys the Redeemed)
|
||||||
|
#HINT:dontattackwith(Kazandu Tuskcaller)
|
||||||
|
#HINT:dontblockwith(Kazandu Tuskcaller)
|
||||||
|
|
||||||
Mox Emerald (LEA) *2
|
Mox Emerald (LEA) *2
|
||||||
Mox Pearl (LEA) *2
|
Mox Pearl (LEA) *2
|
||||||
Forest (LEA) *15
|
Forest (LEA) *15
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#NAME:Etched Affinity
|
#NAME:Etched Affinity
|
||||||
#DESC:Modern URB Aggro
|
#DESC:Modern URB Aggro
|
||||||
#HINT:dontattackwith(creature[power<=0])
|
#HINT:dontattackwith(creature[power<=0])
|
||||||
#HINT:combo hold(Glimmervoid|myhand)^until(artifact|mybattlefield)^cast(Glimmervoid|myhand)^totalmananeeded({0})
|
|
||||||
#HINT:combo hold(Galvanic Blast|myhand)^cast(Galvanic Blast|myhand)^restriction{type(artifact|mybattlefield)~morethan~2,turn:3}^totalmananeeded({R})
|
#HINT:combo hold(Galvanic Blast|myhand)^cast(Galvanic Blast|myhand)^restriction{type(artifact|mybattlefield)~morethan~2,turn:3}^totalmananeeded({R})
|
||||||
|
|
||||||
#25 creatures
|
#25 creatures
|
||||||
|
|||||||
@@ -23,23 +23,23 @@
|
|||||||
369072
|
369072
|
||||||
|
|
||||||
#4 x Armada Wurm (RTR), {2}{g}{g}{w}{w}, Creature Wurm, 5/5, trample;
|
#4 x Armada Wurm (RTR), {2}{g}{g}{w}{w}, Creature Wurm, 5/5, trample;
|
||||||
999009
|
253587
|
||||||
999009
|
253587
|
||||||
999009
|
253587
|
||||||
999009
|
253587
|
||||||
|
|
||||||
#2 x Precinct Captain (RTR), {w}{w}, Creature Human Soldier, 2/2, first strike;
|
#2 x Precinct Captain (RTR), {w}{w}, Creature Human Soldier, 2/2, first strike;
|
||||||
999171
|
270792
|
||||||
999171
|
270792
|
||||||
|
|
||||||
#4 x Wayfaring Temple (RTR), {1}{g}{w}, Creature Elemental, 0/0,
|
#4 x Wayfaring Temple (RTR), {1}{g}{w}, Creature Elemental, 0/0,
|
||||||
999260
|
253539
|
||||||
999260
|
253539
|
||||||
999260
|
253539
|
||||||
999260
|
253539
|
||||||
|
|
||||||
#1 x Worldspine Wurm (RTR), {8}{g}{g}{g}, Creature Wurm, 15/15, trample;
|
#1 x Worldspine Wurm (RTR), {8}{g}{g}{g}, Creature Wurm, 15/15, trample;
|
||||||
999262
|
253575
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -57,14 +57,14 @@
|
|||||||
369060
|
369060
|
||||||
|
|
||||||
#2 x Chromatic Lantern (RTR), {3}, Artifact,
|
#2 x Chromatic Lantern (RTR), {3}, Artifact,
|
||||||
999039
|
290542
|
||||||
999039
|
290542
|
||||||
|
|
||||||
#4 x Growing Ranks (RTR), {2}{g/w}{g/w}, Enchantment,
|
#4 x Growing Ranks (RTR), {2}{g/w}{g/w}, Enchantment,
|
||||||
999106
|
270957
|
||||||
999106
|
270957
|
||||||
999106
|
270957
|
||||||
999106
|
270957
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -84,26 +84,26 @@
|
|||||||
369018
|
369018
|
||||||
|
|
||||||
#4 x Forest (RTR), Basic Land Forest,
|
#4 x Forest (RTR), Basic Land Forest,
|
||||||
999086
|
289326
|
||||||
999086
|
289326
|
||||||
999086
|
289326
|
||||||
999086
|
289326
|
||||||
|
|
||||||
#4 x Plains (RTR), Basic Land Plains,
|
#4 x Plains (RTR), Basic Land Plains,
|
||||||
999168
|
289310
|
||||||
999168
|
289310
|
||||||
999168
|
289310
|
||||||
999168
|
289310
|
||||||
|
|
||||||
#2 x Temple Garden (RTR), Land Forest Plains,
|
#2 x Temple Garden (RTR), Land Forest Plains,
|
||||||
999238
|
253681
|
||||||
999238
|
253681
|
||||||
|
|
||||||
#4 x Plains (RTR), Basic Land Plains,
|
#4 x Plains (RTR), Basic Land Plains,
|
||||||
999265
|
289309
|
||||||
999265
|
289309
|
||||||
999265
|
289309
|
||||||
999265
|
289309
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ def createResZipFile(filename):
|
|||||||
zip_file.close()
|
zip_file.close()
|
||||||
|
|
||||||
if rename:
|
if rename:
|
||||||
os.rename('settings/options.txt', 'settings/options.orig.txt')
|
os.rename('settings/options.txt', 'settings/options.orig.txt')
|
||||||
os.rename('player/options.txt', 'player/options.orig.txt')
|
os.rename('player/options.txt', 'player/options.orig.txt')
|
||||||
|
|
||||||
def getFilename():
|
def getFilename():
|
||||||
p = Properties();
|
p = Properties();
|
||||||
@@ -44,16 +44,18 @@ def getFilename():
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
def createStandardResFile():
|
def createStandardResFile(filename):
|
||||||
print "Creating Standard Resource File"
|
print('Creating Standard Resource File')
|
||||||
filename = getFilename() + '.zip'
|
if not filename:
|
||||||
|
filename = getFilename() + '.zip'
|
||||||
createResZipFile( filename )
|
createResZipFile( filename )
|
||||||
print >> sys.stderr, 'Created Resource Package for Standard Distribution: {0}'.format( filename)
|
print >> sys.stderr, 'Created Resource Package for Standard Distribution: {0}'.format( filename)
|
||||||
|
|
||||||
def createIosResFile():
|
def createIosResFile(filename):
|
||||||
print 'Preparing Resource Package for iOS'
|
print('Preparing Resource Package for iOS')
|
||||||
utilities = ZipUtilities()
|
utilities = ZipUtilities()
|
||||||
filename = getFilename() + '_iOS.zip'
|
if not filename:
|
||||||
|
filename = getFilename() + '_iOS.zip'
|
||||||
#createResZipFile( filename )
|
#createResZipFile( filename )
|
||||||
zip_file = zipfile.ZipFile(filename, 'a', zipfile.ZIP_STORED)
|
zip_file = zipfile.ZipFile(filename, 'a', zipfile.ZIP_STORED)
|
||||||
zip_file.write("../../iOS/Res/rules/modrules.xml", "rules/modrules.xml", zipfile.ZIP_STORED)
|
zip_file.write("../../iOS/Res/rules/modrules.xml", "rules/modrules.xml", zipfile.ZIP_STORED)
|
||||||
@@ -78,10 +80,10 @@ class ZipUtilities:
|
|||||||
if file != '.svn':
|
if file != '.svn':
|
||||||
full_path = os.path.join(folder, file)
|
full_path = os.path.join(folder, file)
|
||||||
if os.path.isfile(full_path):
|
if os.path.isfile(full_path):
|
||||||
print 'File added: ' + str(full_path)
|
print('File added: ' + str(full_path))
|
||||||
zip_file.write(full_path)
|
zip_file.write(full_path)
|
||||||
elif os.path.isdir(full_path):
|
elif os.path.isdir(full_path):
|
||||||
print 'Entering folder: ' + str(full_path)
|
print('Entering folder: ' + str(full_path))
|
||||||
self.addFolderToZip(zip_file, full_path)
|
self.addFolderToZip(zip_file, full_path)
|
||||||
|
|
||||||
|
|
||||||
@@ -90,16 +92,17 @@ def main():
|
|||||||
|
|
||||||
parser = OptionParser()
|
parser = OptionParser()
|
||||||
parser.add_option("-p", "--platform", help="PLATFORM: specify custom build. (eg ios, android, etc)", metavar="PLATFORM", dest="platform")
|
parser.add_option("-p", "--platform", help="PLATFORM: specify custom build. (eg ios, android, etc)", metavar="PLATFORM", dest="platform")
|
||||||
|
parser.add_option("-n", "--name", help="NAME: specify resource file name", metavar="NAME", dest="name")
|
||||||
|
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
if (options.platform):
|
if (options.platform):
|
||||||
if (options.platform == "ios"):
|
if (options.platform == "ios"):
|
||||||
createIosResFile()
|
createIosResFile(options.name)
|
||||||
else:
|
else:
|
||||||
createStandardResFile()
|
createStandardResFile(options.name)
|
||||||
else:
|
else:
|
||||||
createStandardResFile()
|
createStandardResFile(options.name)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 522 KiB |
BIN
projects/mtg/bin/Res/graphics/alphabeta.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
projects/mtg/bin/Res/graphics/avatarholder.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 151 KiB |
BIN
projects/mtg/bin/Res/graphics/backdropframe.png
Normal file
|
After Width: | Height: | Size: 233 KiB |
BIN
projects/mtg/bin/Res/graphics/bgdeckeditor.jpg
Normal file
|
After Width: | Height: | Size: 63 KiB |
BIN
projects/mtg/bin/Res/graphics/blitz_unlocked.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 17 KiB |