Compare commits
457 Commits
python3_te
...
fheroes2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e3a852855 | ||
|
|
1d85d74895 | ||
|
|
c6950836a0 | ||
|
|
39f7b7d6ef | ||
|
|
702329a932 | ||
|
|
abb3f4196b | ||
|
|
5936ff80b5 | ||
|
|
4fab6dc422 | ||
|
|
e6823997de | ||
|
|
068d7dba9e | ||
|
|
21e930fb6b | ||
|
|
a1516f415e | ||
|
|
7c23b880c7 | ||
|
|
29a26e824d | ||
|
|
1d6b705ff3 | ||
|
|
3a57177042 | ||
|
|
e00fcf1afe | ||
|
|
2bce9d6854 | ||
|
|
29fcb570f8 | ||
|
|
07952badae | ||
|
|
e02d772173 | ||
|
|
b7607f9618 | ||
|
|
807ad3113c | ||
|
|
13f410df61 | ||
|
|
b30a5bdf47 | ||
|
|
602ceec9ed | ||
|
|
4717519311 | ||
|
|
7203affdc7 | ||
|
|
9440f2227d | ||
|
|
a617b46dec | ||
|
|
72cba7bfd5 | ||
|
|
9731a00c15 | ||
|
|
5544e91d05 | ||
|
|
8e53731b2a | ||
|
|
6ffc00e13b | ||
|
|
9c2adfdcc8 | ||
|
|
fd6e3a02cd | ||
|
|
6b7505dc1f | ||
|
|
70f933c12a | ||
|
|
b60e0a1956 | ||
|
|
58b42e93aa | ||
|
|
af2fc34eb5 | ||
|
|
b0c05e67da | ||
|
|
517eb7572c | ||
|
|
409b173e25 | ||
|
|
6282c041cf | ||
|
|
83c8c657d4 | ||
|
|
4ea94c197d | ||
|
|
71d79c3703 | ||
|
|
2a58d4a24b | ||
|
|
d809f372a8 | ||
|
|
bb09438e1b | ||
|
|
610e43e388 | ||
|
|
ee825d7cee | ||
|
|
ddd9b70af3 | ||
|
|
2133b4bdbf | ||
|
|
1610fbf5b2 | ||
|
|
d49291b64e | ||
|
|
b340f77972 | ||
|
|
bc8d652517 | ||
|
|
2b0d961f8b | ||
|
|
bb387b5f07 | ||
|
|
a64f771e39 | ||
|
|
954676633e | ||
|
|
14692c5794 | ||
|
|
690ab0fdc4 | ||
|
|
9e879a3758 | ||
|
|
4081383cd4 | ||
|
|
4a13c9b8d1 | ||
|
|
7207c9cbaa | ||
|
|
341ea4820e | ||
|
|
de0a2aa094 | ||
|
|
12ee2980ed | ||
|
|
f3490e5a97 | ||
|
|
6d8fc056b7 | ||
|
|
a1f3b803f3 | ||
|
|
74283b9a01 | ||
|
|
3b33a27350 | ||
|
|
f1b5cb5eef | ||
|
|
30ca76a91b | ||
|
|
cd7d7f23b1 | ||
|
|
1aaf5fecb8 | ||
|
|
ae4e375c8e | ||
|
|
12a164f19c | ||
|
|
7d1d1dcce3 | ||
|
|
d00a448056 | ||
|
|
84c3b8f4d9 | ||
|
|
e34e808c15 | ||
|
|
24dbe40bd9 | ||
|
|
d25053ce9f | ||
|
|
720c08d15a | ||
|
|
97c152e6a6 | ||
|
|
428f6b89d7 | ||
|
|
99882fa19e | ||
|
|
8b8597fbc3 | ||
|
|
c2d67139f7 | ||
|
|
11acddec22 | ||
|
|
c4ae2ef53c | ||
|
|
924a106e01 | ||
|
|
3926496d5f | ||
|
|
249f602165 | ||
|
|
d30158b7dd | ||
|
|
769a99cbd8 | ||
|
|
ae4f496106 | ||
|
|
34f00a6c54 | ||
|
|
e32502ed64 | ||
|
|
117074777f | ||
|
|
32442641dc | ||
|
|
b5012d86ad | ||
|
|
5b2b990b29 | ||
|
|
b3e81dfab1 | ||
|
|
9bbfbd2131 | ||
|
|
6d3990058b | ||
|
|
5458d5ffe3 | ||
|
|
7c88857742 | ||
|
|
01dc04fe17 | ||
|
|
5e9c45f330 | ||
|
|
91bfe0b6c4 | ||
|
|
a967016781 | ||
|
|
1e71441946 | ||
|
|
5413bfb6f3 | ||
|
|
63f9c475c1 | ||
|
|
ce74e0fee3 | ||
|
|
b7084f90e1 | ||
|
|
a46c43f459 | ||
|
|
4e8bf7a5ae | ||
|
|
1157101b4b | ||
|
|
43810f8585 | ||
|
|
a07c617cbf | ||
|
|
747e660578 | ||
|
|
3f8e0ea9a9 | ||
|
|
f2074457a4 | ||
|
|
8cc60c9d4b | ||
|
|
4527f9f619 | ||
|
|
d2495a80ce | ||
|
|
7c74e86010 | ||
|
|
0dd74132ab | ||
|
|
959a7a8c66 | ||
|
|
697ba47bf8 | ||
|
|
31f306976f | ||
|
|
cde94796a7 | ||
|
|
dcdcaa2c1a | ||
|
|
f89164b152 | ||
|
|
dd184b184e | ||
|
|
ff8594202d | ||
|
|
63e5356a5b | ||
|
|
89ecc43d8f | ||
|
|
8c34faa475 | ||
|
|
65fe44f66a | ||
|
|
f0ff49906c | ||
|
|
2ff9d7cb2c | ||
|
|
d0f0e4cfea | ||
|
|
7662f2acae | ||
|
|
3bed7f054e | ||
|
|
f78c911f0a | ||
|
|
90f5ab5684 | ||
|
|
20d59c5920 | ||
|
|
b5a391b0dd | ||
|
|
20eef1b149 | ||
|
|
f0425aa9af | ||
|
|
d9ce299843 | ||
|
|
9c3259a969 | ||
|
|
bb46839637 | ||
|
|
22a34468d2 | ||
|
|
ab3e3aa1a7 | ||
|
|
56ae8d528e | ||
|
|
15ee9faf9b | ||
|
|
4d6a8dcd88 | ||
|
|
639a2e7e69 | ||
|
|
054ac50e0a | ||
|
|
9397c0079c | ||
|
|
e887896edf | ||
|
|
8be8471285 | ||
|
|
2f49dd6e30 | ||
|
|
657ab95852 | ||
|
|
3425c4b372 | ||
|
|
5ba2b00a1e | ||
|
|
d431337433 | ||
|
|
1f32270a80 | ||
|
|
0186aa0786 | ||
|
|
8c632cd6e0 | ||
|
|
b5fec3dd68 | ||
|
|
6b1bd79e2f | ||
|
|
da55d86723 | ||
|
|
63178dd22b | ||
|
|
f3ee09e047 | ||
|
|
5b778604b5 | ||
|
|
264f7aa43f | ||
|
|
eec2e53f0f | ||
|
|
bf0eb74ea8 | ||
|
|
969d785ec1 | ||
|
|
76d93ca1fa | ||
|
|
61c5b7352b | ||
|
|
68d6923357 | ||
|
|
fd5babab77 | ||
|
|
71a72389e3 | ||
|
|
2b18728ed5 | ||
|
|
4be95b0d36 | ||
|
|
d1554371a5 | ||
|
|
51790527e9 | ||
|
|
de301f6c59 | ||
|
|
37ad3763ab | ||
|
|
f9a91856ec | ||
|
|
f0a8e491e9 | ||
|
|
b0f344098f | ||
|
|
9087c622ae | ||
|
|
16d326c1c5 | ||
|
|
8333b99596 | ||
|
|
c3f89273e3 | ||
|
|
0c172d10fb | ||
|
|
bef5f545c5 | ||
|
|
aa7919811f | ||
|
|
d169cf6d89 | ||
|
|
b66d0f6af0 | ||
|
|
286b105fc5 | ||
|
|
2f0fa55d2e | ||
|
|
35400851ca | ||
|
|
0299387ea8 | ||
|
|
40b87eb9ac | ||
|
|
e61973a837 | ||
|
|
61a08630ed | ||
|
|
1fe8654d71 | ||
|
|
2c182128c6 | ||
|
|
98062856c6 | ||
|
|
0dd82bd0f7 | ||
|
|
a5a7fea8a7 | ||
|
|
659bf32161 | ||
|
|
1950b85d8b | ||
|
|
4527235f0e | ||
|
|
11090a082e | ||
|
|
9b9768ed8d | ||
|
|
372a73207b | ||
|
|
7f4b9162ba | ||
|
|
d4afed131a | ||
|
|
52cda7c82f | ||
|
|
d74fcef25b | ||
|
|
fc7e6e63b2 | ||
|
|
d98d33b244 | ||
|
|
e700d64cfb | ||
|
|
d9d6289924 | ||
|
|
ed9446c4a3 | ||
|
|
8c64964f4b | ||
|
|
98a442e80d | ||
|
|
f391b0b3ca | ||
|
|
a328e741aa | ||
|
|
c475fbf816 | ||
|
|
65520b847e | ||
|
|
88ab438ba1 | ||
|
|
9865a6dcfe | ||
|
|
cff1d6b9b9 | ||
|
|
853e3f3307 | ||
|
|
b0b78fbf0b | ||
|
|
19ad345143 | ||
|
|
3988790916 | ||
|
|
114f1541c3 | ||
|
|
4a0abd4561 | ||
|
|
059c60acc2 | ||
|
|
49664669ab | ||
|
|
83690c7843 | ||
|
|
836173c6bd | ||
|
|
54daeba17c | ||
|
|
ab388c164b | ||
|
|
451189dd41 | ||
|
|
5857572dc9 | ||
|
|
d7a074409e | ||
|
|
93c3984615 | ||
|
|
16f944d3c6 | ||
|
|
781877ebb6 | ||
|
|
5e0cf567cb | ||
|
|
5452ff026f | ||
|
|
0c407de81c | ||
|
|
d705fee605 | ||
|
|
e4d00b6202 | ||
|
|
73d25fe6cc | ||
|
|
c12c63c66d | ||
|
|
e9843f8a61 | ||
|
|
da45b67d94 | ||
|
|
816ce71085 | ||
|
|
fb816c7a6a | ||
|
|
5d05a7cff2 | ||
|
|
4503bcbc56 | ||
|
|
d359e80b9b | ||
|
|
4b3a2136c7 | ||
|
|
f7b1b69008 | ||
|
|
2face2a79a | ||
|
|
30b7f93467 | ||
|
|
671d537df9 | ||
|
|
38663832d2 | ||
|
|
91735433b1 | ||
|
|
c22928a018 | ||
|
|
eab9c26fa3 | ||
|
|
e000bf3ea4 | ||
|
|
fba592f1c5 | ||
|
|
a5c932a0fa | ||
|
|
ad4a0bc52c | ||
|
|
fd8735fe6f | ||
|
|
334e7114d8 | ||
|
|
49c47093c0 | ||
|
|
fc1bedf1ca | ||
|
|
4c73f4c220 | ||
|
|
1d3e4fce94 | ||
|
|
c582c7e40e | ||
|
|
3116b316bb | ||
|
|
eadd178cfc | ||
|
|
76053bb69f | ||
|
|
6459e79ea9 | ||
|
|
dcad4c156c | ||
|
|
da05e8dfc6 | ||
|
|
3af69bf25c | ||
|
|
f31a9b10cb | ||
|
|
a67e53fe48 | ||
|
|
fd79ad08d2 | ||
|
|
3556067039 | ||
|
|
cdf1c7347d | ||
|
|
1cf8c094a3 | ||
|
|
4799ff9e9f | ||
|
|
96b9a2e36d | ||
|
|
3b65df4624 | ||
|
|
3165576211 | ||
|
|
b176328777 | ||
|
|
6a76b40436 | ||
|
|
b9538af7c3 | ||
|
|
d0f7f72bd7 | ||
|
|
144f485758 | ||
|
|
9a2e67c05d | ||
|
|
bc94fe76d6 | ||
|
|
e15c2ff3d6 | ||
|
|
7301ae0c62 | ||
|
|
d416f94ce4 | ||
|
|
374dbd86b3 | ||
|
|
66f7cc1cfd | ||
|
|
e0d9c99a7c | ||
|
|
4c182a5370 | ||
|
|
7aa2cd0726 | ||
|
|
df9ffa1c2b | ||
|
|
e618b3a2d0 | ||
|
|
0fd27781c6 | ||
|
|
9f5414c407 | ||
|
|
f02e93636f | ||
|
|
9f486346f1 | ||
|
|
49fb9a98e8 | ||
|
|
7d7b6e7997 | ||
|
|
169a2bf551 | ||
|
|
b12fc6e402 | ||
|
|
b742ebaf72 | ||
|
|
9c86e109dd | ||
|
|
f5570a7dae | ||
|
|
2a60bdec8a | ||
|
|
b3b9730c19 | ||
|
|
212e761d33 | ||
|
|
25a86103ec | ||
|
|
54c1b4b0b8 | ||
|
|
95ebb73426 | ||
|
|
d378ee692f | ||
|
|
70b37b6565 | ||
|
|
637eb27e07 | ||
|
|
bb08c6ab43 | ||
|
|
0aba1e43d7 | ||
|
|
5cda8aa8be | ||
|
|
6fe05d83e3 | ||
|
|
ef3c4cf714 | ||
|
|
7babe228b6 | ||
|
|
6356415030 | ||
|
|
af61cce12a | ||
|
|
173d4f193b | ||
|
|
c66e3d5ae1 | ||
|
|
4b47ea502c | ||
|
|
8d9f655db9 | ||
|
|
1ae4bbbfc8 | ||
|
|
a6f20b699b | ||
|
|
a209bee64f | ||
|
|
1db6fb623c | ||
|
|
4336c5e9b8 | ||
|
|
18837e9b8c | ||
|
|
d8b6a2d088 | ||
|
|
bc9842ee59 | ||
|
|
5af764f5ff | ||
|
|
fb9d42b6f5 | ||
|
|
3a9b31a41f | ||
|
|
b8c5dd1d70 | ||
|
|
209a16fd9f | ||
|
|
bd36a07c7b | ||
|
|
4701548e01 | ||
|
|
5223f423d8 | ||
|
|
7953493704 | ||
|
|
5d82a28be3 | ||
|
|
468791d212 | ||
|
|
34824e3300 | ||
|
|
0d524669d0 | ||
|
|
457c6c32af | ||
|
|
91d27beb04 | ||
|
|
3b7eed55a5 | ||
|
|
32488523e1 | ||
|
|
efbdcb1a71 | ||
|
|
2cc2d7bca5 | ||
|
|
6850c719d4 | ||
|
|
bc5f26d089 | ||
|
|
a322e85cd7 | ||
|
|
75eddb701a | ||
|
|
8e87817255 | ||
|
|
90b8790fc0 | ||
|
|
2920b61519 | ||
|
|
d738bd6f53 | ||
|
|
181532e165 | ||
|
|
630d0fb234 | ||
|
|
ca601438d7 | ||
|
|
8fbefc99de | ||
|
|
c985b70f59 | ||
|
|
a6db262f17 | ||
|
|
eafba393be | ||
|
|
b224a4d100 | ||
|
|
5132ae8020 | ||
|
|
35e838c20d | ||
|
|
d89960517c | ||
|
|
2efd15f6b5 | ||
|
|
a361998ee2 | ||
|
|
55194b43e3 | ||
|
|
cdb6e76177 | ||
|
|
132988b141 | ||
|
|
5ab39a579a | ||
|
|
d179d4d2c7 | ||
|
|
39b5b5efb5 | ||
|
|
b42a8623df | ||
|
|
8f54771340 | ||
|
|
d94bfa11f7 | ||
|
|
360fc0b112 | ||
|
|
9e2035c21d | ||
|
|
0eaf0356fc | ||
|
|
74c2b15e22 | ||
|
|
a26e52ca94 | ||
|
|
4fcb4fce72 | ||
|
|
2b0ad6e7d3 | ||
|
|
c398280513 | ||
|
|
f432fb316b | ||
|
|
46e4118ba8 | ||
|
|
78d3c8ca27 | ||
|
|
5497773f96 | ||
|
|
28015f4cca | ||
|
|
f37cf67a7e | ||
|
|
ecb29827af | ||
|
|
d4897280f0 | ||
|
|
485d66ea25 | ||
|
|
09f8a53a22 | ||
|
|
d7ea0a43fb | ||
|
|
bf211679e1 | ||
|
|
32f1ca882e | ||
|
|
4e9dad66bb | ||
|
|
2b64c864f0 | ||
|
|
58beecc25a | ||
|
|
69137dfa78 | ||
|
|
4ab58838d1 | ||
|
|
5edfb74432 | ||
|
|
2d9acc5aee | ||
|
|
7629e64762 | ||
|
|
c67f348338 | ||
|
|
f4727eb466 | ||
|
|
9aa0a1ae36 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -11,6 +11,7 @@
|
||||
/project/jni/Settings.mk
|
||||
/project/jni/application/*/libapplication*.so
|
||||
/project/jni/application/src
|
||||
/project/jni/boost_*
|
||||
/project/res/drawable-xhdpi/ouya_icon.png
|
||||
/project/res/drawable/app_icon.png
|
||||
/project/proguard-project.txt
|
||||
@@ -19,3 +20,6 @@
|
||||
/project/jni/android-support
|
||||
/project/res/drawable/banner.png
|
||||
/project/res/drawable-xhdpi/ouya_icon.png
|
||||
/project/app/build.gradle
|
||||
/project/app/.gradle
|
||||
/project/app/build
|
||||
|
||||
79
.gitmodules
vendored
79
.gitmodules
vendored
@@ -1,81 +1,86 @@
|
||||
[submodule "project/jni/application/NewRAW"]
|
||||
path = project/jni/application/NewRAW
|
||||
url = git@github.com:usineur/android-newraw.git
|
||||
url = https://github.com/usineur/android-newraw.git
|
||||
[submodule "project/jni/boost/src"]
|
||||
path = project/jni/boost/src
|
||||
url = git@github.com:pelya/Boost-for-Android.git
|
||||
branch = master2
|
||||
url = https://github.com/moritz-wundke/Boost-for-Android.git
|
||||
branch = master
|
||||
update = merge
|
||||
[submodule "project/jni/application/commandergenius/commandergenius"]
|
||||
path = project/jni/application/commandergenius/commandergenius
|
||||
url = git@github.com:gerstrong/Commander-Genius.git
|
||||
url = https://github.com/gerstrong/Commander-Genius.git
|
||||
[submodule "project/jni/application/openarena/engine"]
|
||||
path = project/jni/application/openarena/engine
|
||||
url = git@github.com:pelya/openarena-engine.git
|
||||
[submodule "project/jni/application/scummvm/scummvm"]
|
||||
path = project/jni/application/scummvm/scummvm
|
||||
url = git@github.com:scummvm/scummvm.git
|
||||
url = https://github.com/pelya/openarena-engine.git
|
||||
[submodule "project/jni/application/openarena/vm"]
|
||||
path = project/jni/application/openarena/vm
|
||||
url = git@github.com:pelya/openarena-vm
|
||||
url = https://github.com/pelya/openarena-vm
|
||||
[submodule "project/jni/application/teeworlds/src"]
|
||||
path = project/jni/application/teeworlds/src
|
||||
url = git@github.com:pelya/teeworlds.git
|
||||
[submodule "project/jni/application/c-dogs/src"]
|
||||
path = project/jni/application/c-dogs/src
|
||||
url = git@github.com:cxong/cdogs-sdl.git
|
||||
url = https://github.com/pelya/teeworlds.git
|
||||
[submodule "project/jni/application/xserver/xserver"]
|
||||
path = project/jni/application/xserver/xserver
|
||||
url = git@github.com:pelya/xserver.git
|
||||
branch = xsdl2
|
||||
url = https://github.com/pelya/xserver.git
|
||||
branch = xsdl-1.20
|
||||
update = merge
|
||||
[submodule "android-shmem"]
|
||||
path = project/jni/shmem
|
||||
url = git@github.com:pelya/android-shmem.git
|
||||
url = https://github.com/pelya/android-shmem.git
|
||||
branch = master
|
||||
update = merge
|
||||
[submodule "project/jni/application/hid-pc-keyboard/src"]
|
||||
path = project/jni/application/hid-pc-keyboard/src
|
||||
url = git@github.com:pelya/android-keyboard-gadget.git
|
||||
url = https://github.com/pelya/android-keyboard-gadget.git
|
||||
branch = master
|
||||
update = merge
|
||||
[submodule "project/jni/iconv/src"]
|
||||
path = project/jni/iconv/src
|
||||
url = git@github.com:pelya/libiconv-libicu-android.git
|
||||
[submodule "project/jni/icuuc/src"]
|
||||
path = project/jni/icuuc/src
|
||||
url = git@github.com:pelya/libiconv-libicu-android.git
|
||||
url = https://github.com/pelya/libiconv-libicu-android.git
|
||||
branch = master
|
||||
update = merge
|
||||
[submodule "project/jni/application/openttd/src"]
|
||||
path = project/jni/application/openttd/src
|
||||
url = git@github.com:pelya/openttd-android.git
|
||||
url = https://github.com/pelya/openttd-android.git
|
||||
branch = 1.10
|
||||
[submodule "project/jni/application/uae4all2"]
|
||||
path = project/jni/application/uae4all2
|
||||
url = git@github.com:lubomyr/uae4all2.git
|
||||
url = https://github.com/lubomyr/uae4all2.git
|
||||
[submodule "project/jni/application/basiliskii/basiliskii"]
|
||||
path = project/jni/application/basiliskii/basiliskii
|
||||
url = git@github.com:pelya/BasiliskII-android.git
|
||||
url = https://github.com/pelya/BasiliskII-android.git
|
||||
[submodule "project/jni/vncserver/src"]
|
||||
path = project/jni/vncserver/src
|
||||
url = git@github.com:LibVNC/libvncserver.git
|
||||
url = https://github.com/LibVNC/libvncserver.git
|
||||
[submodule "project/jni/application/vice/vice"]
|
||||
path = project/jni/application/vice/vice
|
||||
url = git@github.com:lubomyr/vice-2.4.git
|
||||
url = https://github.com/lubomyr/vice-2.4.git
|
||||
[submodule "project/jni/application/xserver/pulseaudio"]
|
||||
path = project/jni/application/xserver/pulseaudio
|
||||
url = git@github.com:pelya/pulseaudio-android.git
|
||||
[submodule "project/jni/application/bochs/bochs"]
|
||||
path = project/jni/application/bochs/bochs
|
||||
url = git@github.com:lubomyr/bochs.git
|
||||
url = https://github.com/pelya/pulseaudio-android.git
|
||||
branch = master
|
||||
[submodule "project/jni/application/supertux/supertux"]
|
||||
path = project/jni/application/supertux/supertux
|
||||
url = git@github.com:pelya/supertux.git
|
||||
url = https://github.com/pelya/supertux.git
|
||||
[submodule "project/jni/application/fheroes2/fheroes2"]
|
||||
path = project/jni/application/fheroes2/fheroes2
|
||||
url = http://github.com/gerstrong/fheroes2plus.git
|
||||
url = https://github.com/gerstrong/fheroes2plus.git
|
||||
[submodule "project/jni/application/ninslash/src"]
|
||||
path = project/jni/application/ninslash/src
|
||||
url = git@github.com:pelya/Ninslash.git
|
||||
[submodule "project/jni/python3/python3-android"]
|
||||
path = project/jni/python3/python3-android
|
||||
url = http://github.com/gerstrong/python3-android.git
|
||||
|
||||
url = https://github.com/pelya/Ninslash.git
|
||||
branch = master
|
||||
update = merge
|
||||
[submodule "project/jni/application/openttd-jgrpp/src"]
|
||||
path = project/jni/application/openttd-jgrpp/src
|
||||
url = https://github.com/pelya/OpenTTD-JGR-patchpack.git
|
||||
branch = android-desktop
|
||||
[submodule "project/jni/application/liero/src"]
|
||||
path = project/jni/application/liero/src
|
||||
url = https://github.com/pelya/liero-android.git
|
||||
[submodule "project/jni/application/openlierox/src"]
|
||||
path = project/jni/application/openlierox/src
|
||||
url = https://github.com/albertz/openlierox.git
|
||||
branch = half-assed-android-port
|
||||
[submodule "project/jni/application/xserver-debian/debian-image"]
|
||||
path = project/jni/application/xserver-debian/debian-image
|
||||
url = https://github.com/pelya/debian-noroot
|
||||
branch = master
|
||||
|
||||
107
aar2jar.py
107
aar2jar.py
@@ -1,107 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
# aar2jar.py (c) kak2 <doanngocbao@gmail.com>
|
||||
# https://github.com/kak2/aar2jar
|
||||
|
||||
import sys, getopt, os
|
||||
import shutil
|
||||
import zipfile
|
||||
|
||||
mswindows = (sys.platform == "win32")
|
||||
def main(argv):
|
||||
project_name = ''
|
||||
output_dir = ''
|
||||
if len(argv) == 0:
|
||||
help()
|
||||
sys.exit(2)
|
||||
try:
|
||||
opts, args = getopt.getopt(argv,"hi:o:",["iname=","odir="])
|
||||
except getopt.GetoptError:
|
||||
help()
|
||||
sys.exit(2)
|
||||
for opt, arg in opts:
|
||||
if opt == '-h':
|
||||
help()
|
||||
sys.exit()
|
||||
elif opt in ("-i", "--iname"):
|
||||
project_name = arg
|
||||
elif opt in ("-o", "--odir"):
|
||||
output_dir = arg
|
||||
|
||||
convert(project_name, output_dir)
|
||||
|
||||
def help():
|
||||
print 'convert.py -i <your-project-name-without-aar> -o <output-dir>'
|
||||
|
||||
def convert(project_name, output_dir):
|
||||
if not existProject(project_name):
|
||||
print project_name, " is not existed in current directory"
|
||||
sys.exit(2)
|
||||
createOrCleanOutputDir(output_dir)
|
||||
|
||||
# Convert your project first
|
||||
convert_project(project_name, output_dir)
|
||||
# Move all jar and convert other aar files
|
||||
files = os.listdir(os.curdir)
|
||||
for file in files:
|
||||
file_name, extension = os.path.splitext(file)
|
||||
print file_name, extension
|
||||
if extension == '.jar':
|
||||
shutil.move(file, os.path.join(output_dir, project_name, 'libs', file))
|
||||
elif extension == '.aar':
|
||||
if file_name != project_name:
|
||||
convert_project(file_name, output_dir)
|
||||
|
||||
|
||||
def convert_project(project_name, output_dir):
|
||||
# Extract your project's file
|
||||
your_file_dest_path = os.path.join(output_dir, project_name)
|
||||
os.makedirs(your_file_dest_path)
|
||||
with zipfile.ZipFile(project_name + '.aar' , "r") as z:
|
||||
z.extractall(your_file_dest_path)
|
||||
#
|
||||
# Make it into ant library project
|
||||
#
|
||||
if not os.path.exists(os.path.join(your_file_dest_path, 'src')):
|
||||
os.makedirs(os.path.join(your_file_dest_path, 'src')) # Make src directory in project, but leave it empty
|
||||
if not os.path.exists(os.path.join(your_file_dest_path, 'libs')):
|
||||
os.makedirs(os.path.join(your_file_dest_path, 'libs')) # Make lib directory in project if it does not exists
|
||||
# Rename classes.jar to project_name.jar and move it into libs directory
|
||||
os.rename(os.path.join(your_file_dest_path, 'classes.jar'), os.path.join(your_file_dest_path, project_name + '.jar'))
|
||||
shutil.move(os.path.join(your_file_dest_path, project_name + '.jar'), os.path.join(your_file_dest_path, 'libs/' + project_name + '.jar'))
|
||||
# Call android update. So we have to install android first, then add it into PATH
|
||||
command = "android update lib-project -p " + os.path.join(output_dir, project_name) + " -t android-25"
|
||||
os.system(command)
|
||||
# Update project.properties file
|
||||
with open(os.path.join(output_dir, project_name, 'project.properties'), "a") as myfile:
|
||||
myfile.write("android.library=true\n")
|
||||
|
||||
def createOrCleanOutputDir(output_dir):
|
||||
files = os.listdir(os.curdir)
|
||||
if os.path.exists(output_dir):
|
||||
deleteDir(output_dir)
|
||||
os.makedirs(output_dir)
|
||||
|
||||
def remove_readonly(fn, path, excinfo):
|
||||
#removes readonly tag from files/folders so they can be deleted
|
||||
if fn is os.rmdir:
|
||||
os.chmod(path, stat.S_IWRITE)
|
||||
os.rmdir(path)
|
||||
elif fn is os.remove:
|
||||
os.chmod(path, stat.S_IWRITE)
|
||||
os.remove(path)
|
||||
|
||||
def deleteDir(directory):
|
||||
shutil.rmtree(directory, onerror=remove_readonly)
|
||||
|
||||
def existProject(project_name):
|
||||
project_file = project_name + ".aar"
|
||||
files = os.listdir(os.curdir)
|
||||
try:
|
||||
files.index(project_file)
|
||||
return True
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv[1:])
|
||||
35
app2sd.sh
35
app2sd.sh
@@ -1,35 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
APK=$1
|
||||
if [ -z "$APK" ] ; then
|
||||
APK=project/bin/MainActivity-debug.apk
|
||||
fi
|
||||
|
||||
echo Moving shared libraries on $APK to SD card
|
||||
APK=`pwd`/$APK
|
||||
|
||||
[ -e $APK ] || { echo File $APK does not exist; exit 1; }
|
||||
|
||||
TMPDIR=app2sd-$$
|
||||
|
||||
mkdir -p $TMPDIR
|
||||
cd $TMPDIR
|
||||
|
||||
unzip $APK "lib/armeabi/*" || { echo "This apk file has already been app2sd-ed, or improperly compiled"; exit 1; }
|
||||
|
||||
zip -j bindata.zip lib/armeabi/*
|
||||
mkdir assets
|
||||
split -b 1048576 -d -a 1 bindata.zip assets/bindata
|
||||
rm bindata.zip
|
||||
|
||||
zip -d $APK "lib/armeabi/*" "META-INF/*"
|
||||
|
||||
zip -0 $APK assets/bindata*
|
||||
|
||||
jarsigner -verbose -keystore ~/.android/debug.keystore -storepass "android" $APK androiddebugkey
|
||||
|
||||
zipalign 4 $APK $APK-tmp
|
||||
mv -f $APK-tmp $APK
|
||||
|
||||
cd ..
|
||||
rm -rf $TMPDIR
|
||||
4
bugs.txt
4
bugs.txt
@@ -29,3 +29,7 @@ Requested features, might never get implemented, see todo.txt for features that
|
||||
- OpenArena: Shift and Ctrl keys on USB keyboard do not work for text input.
|
||||
|
||||
- OpenArena: When entering with USB keyboard into chatbox, first 't' disappears.
|
||||
|
||||
- USB Keyboard: options for camera feed size and for redefining remote menu hotkey.
|
||||
|
||||
- UQM HD: add fonts from http://mosc-portal.bursa.ru/showthread.php?t=206 and switch back to joystick controls, set 4:3 aspect ratio as default.
|
||||
|
||||
85
build.sh
85
build.sh
@@ -79,23 +79,14 @@ NDK_TOOLCHAIN_VERSION=$GCCVER
|
||||
# export PATH=$PATH:~/src/endless_space/android-ndk-r7
|
||||
NDKBUILDPATH=$PATH
|
||||
export `grep "AppFullName=" AndroidAppSettings.cfg`
|
||||
if ( grep "package $AppFullName;" project/src/Globals.java > /dev/null 2>&1 && \
|
||||
[ "`readlink AndroidAppSettings.cfg`" -ot "project/src/Globals.java" ] && \
|
||||
[ -z "`find project/java/* project/AndroidManifestTemplate.xml -cnewer project/src/Globals.java`" ] ) ; then true ; else
|
||||
if [ -e project/local.properties ] && \
|
||||
( grep "package $AppFullName;" project/src/Globals.java > /dev/null 2>&1 && \
|
||||
[ "`readlink AndroidAppSettings.cfg`" -ot "project/src/Globals.java" ] && \
|
||||
[ -z "`find project/java/* project/AndroidManifestTemplate.xml -cnewer project/src/Globals.java`" ] ) ; then true ; else
|
||||
./changeAppSettings.sh -a || exit 1
|
||||
sleep 1
|
||||
touch project/src/Globals.java
|
||||
fi
|
||||
if $build_release ; then
|
||||
sed -i 's/android:debuggable="true"/android:debuggable="false"/g' project/AndroidManifest.xml
|
||||
else
|
||||
sed -i 's/android:debuggable="false"/android:debuggable="true"/g' project/AndroidManifest.xml
|
||||
fi
|
||||
|
||||
[ -e project/local.properties ] || {
|
||||
android update project -p project -t android-23 || exit 1
|
||||
rm -f project/src/Globals.java
|
||||
}
|
||||
|
||||
MYARCH=linux-x86_64
|
||||
if [ -z "$NCPU" ]; then
|
||||
@@ -120,12 +111,6 @@ $quick_rebuild || rm -r -f project/bin/* # New Android SDK introduced some lame-
|
||||
}
|
||||
|
||||
strip_libs() {
|
||||
grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
|
||||
echo Stripping libapplication-armeabi.so by hand && \
|
||||
rm obj/local/armeabi/libapplication.so && \
|
||||
cp jni/application/src/libapplication-armeabi.so obj/local/armeabi/libapplication.so && \
|
||||
cp jni/application/src/libapplication-armeabi.so libs/armeabi/libapplication.so && \
|
||||
`which ndk-build | sed 's@/ndk-build@@'`/toolchains/arm-linux-androideabi-${NDK_TOOLCHAIN_VERSION}/prebuilt/$MYARCH/bin/arm-linux-androideabi-strip --strip-unneeded libs/armeabi/libapplication.so
|
||||
grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
|
||||
grep "MultiABI=" ../AndroidAppSettings.cfg | grep "y\\|all\\|armeabi-v7a" > /dev/null && \
|
||||
echo Stripping libapplication-armeabi-v7a.so by hand && \
|
||||
@@ -133,13 +118,6 @@ strip_libs() {
|
||||
cp jni/application/src/libapplication-armeabi-v7a.so obj/local/armeabi-v7a/libapplication.so && \
|
||||
cp jni/application/src/libapplication-armeabi-v7a.so libs/armeabi-v7a/libapplication.so && \
|
||||
`which ndk-build | sed 's@/ndk-build@@'`/toolchains/arm-linux-androideabi-${NDK_TOOLCHAIN_VERSION}/prebuilt/$MYARCH/bin/arm-linux-androideabi-strip --strip-unneeded libs/armeabi-v7a/libapplication.so
|
||||
grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
|
||||
grep "MultiABI=" ../AndroidAppSettings.cfg | grep "all\\|mips" > /dev/null && \
|
||||
echo Stripping libapplication-mips.so by hand && \
|
||||
rm obj/local/mips/libapplication.so && \
|
||||
cp jni/application/src/libapplication-mips.so obj/local/mips/libapplication.so && \
|
||||
cp jni/application/src/libapplication-mips.so libs/mips/libapplication.so && \
|
||||
`which ndk-build | sed 's@/ndk-build@@'`/toolchains/mipsel-linux-android-${NDK_TOOLCHAIN_VERSION}/prebuilt/$MYARCH/bin/mipsel-linux-android-strip --strip-unneeded libs/mips/libapplication.so
|
||||
grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
|
||||
grep "MultiABI=" ../AndroidAppSettings.cfg | grep "all\\|x86" > /dev/null && \
|
||||
echo Stripping libapplication-x86.so by hand && \
|
||||
@@ -161,48 +139,53 @@ strip_libs() {
|
||||
cp jni/application/src/libapplication-arm64-v8a.so obj/local/arm64-v8a/libapplication.so && \
|
||||
cp jni/application/src/libapplication-arm64-v8a.so libs/arm64-v8a/libapplication.so && \
|
||||
`which ndk-build | sed 's@/ndk-build@@'`/toolchains/aarch64-linux-android-${NDK_TOOLCHAIN_VERSION}/prebuilt/$MYARCH/bin/aarch64-linux-android-strip --strip-unneeded libs/arm64-v8a/libapplication.so
|
||||
grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
|
||||
grep "MultiABI=" ../AndroidAppSettings.cfg | grep "all\\|mips64" > /dev/null && \
|
||||
echo Stripping libapplication-mips64.so by hand && \
|
||||
rm obj/local/mips64/libapplication.so && \
|
||||
cp jni/application/src/libapplication-mips64.so obj/local/mips64/libapplication.so && \
|
||||
cp jni/application/src/libapplication-mips64.so libs/mips64/libapplication.so && \
|
||||
`which ndk-build | sed 's@/ndk-build@@'`/toolchains/mips64el-linux-android-${NDK_TOOLCHAIN_VERSION}/prebuilt/$MYARCH/bin/mips64el-linux-android-strip --strip-unneeded libs/mips64/libapplication.so
|
||||
return 0
|
||||
}
|
||||
|
||||
cd project && env PATH=$NDKBUILDPATH BUILD_NUM_CPUS=$NCPU nice -n19 ndk-build -j$NCPU V=1 $QUICK_REBUILD_ARGS && \
|
||||
# Fix Gradle compilation error
|
||||
[ -z "$ANDROID_NDK_HOME" ] && export ANDROID_NDK_HOME="`which ndk-build | sed 's@/ndk-build@@'`"
|
||||
|
||||
cd project && env PATH=$NDKBUILDPATH BUILD_NUM_CPUS=$NCPU ndk-build -j$NCPU V=1 $QUICK_REBUILD_ARGS && \
|
||||
strip_libs && \
|
||||
cd .. && ./copyAssets.sh && cd project && \
|
||||
{ if $build_release ; then \
|
||||
$quick_rebuild && { \
|
||||
ln -s -f libs lib ; \
|
||||
zip -u -r bin/MainActivity-release-unsigned.apk lib assets || exit 1 ; \
|
||||
} || ant release || exit 1 ; \
|
||||
zip -u -r app/build/outputs/apk/release/app-release-unsigned.apk lib assets || exit 1 ; \
|
||||
} || ./gradlew assembleRelease || exit 1 ; \
|
||||
[ '!' -x jni/application/src/AndroidPostBuild.sh ] || {
|
||||
cd jni/application/src ; \
|
||||
./AndroidPostBuild.sh `pwd`/../../../bin/MainActivity-release-unsigned.apk || exit 1 ; \
|
||||
./AndroidPostBuild.sh `pwd`/../../../app/build/outputs/apk/release/app-release-unsigned.apk || exit 1 ; \
|
||||
cd ../../.. ; \
|
||||
} || exit 1 ; \
|
||||
jarsigner -verbose -keystore ~/.android/debug.keystore -storepass android -sigalg MD5withRSA -digestalg SHA1 bin/MainActivity-release-unsigned.apk androiddebugkey || exit 1 ; \
|
||||
rm -f bin/MainActivity-debug.apk ; \
|
||||
zipalign 4 bin/MainActivity-release-unsigned.apk bin/MainActivity-debug.apk || exit 1 ; \
|
||||
../copyAssets.sh pack-binaries app/build/outputs/apk/release/app-release-unsigned.apk ; \
|
||||
rm -f app/build/outputs/apk/release/app-release.apk ; \
|
||||
zipalign 4 app/build/outputs/apk/release/app-release-unsigned.apk app/build/outputs/apk/release/app-release.apk || exit 1 ; \
|
||||
apksigner sign --ks ~/.android/debug.keystore --ks-key-alias androiddebugkey --ks-pass pass:android app/build/outputs/apk/release/app-release.apk || exit 1 ; \
|
||||
else \
|
||||
$quick_rebuild && { \
|
||||
ln -s -f libs lib ; \
|
||||
zip -u -r bin/MainActivity-debug-unaligned.apk lib assets || exit 1 ; \
|
||||
jarsigner -verbose -keystore ~/.android/debug.keystore -storepass android -sigalg MD5withRSA -digestalg SHA1 bin/MainActivity-debug-unaligned.apk androiddebugkey || exit 1 ; \
|
||||
rm -f bin/MainActivity-debug.apk ; \
|
||||
zipalign 4 bin/MainActivity-debug-unaligned.apk bin/MainActivity-debug.apk || exit 1 ; \
|
||||
} || ant debug || exit 1 ; \
|
||||
./gradlew assembleDebug || exit 1 ; \
|
||||
[ '!' -x jni/application/src/AndroidPostBuild.sh ] || {
|
||||
cd jni/application/src ; \
|
||||
./AndroidPostBuild.sh `pwd`/../../../app/build/outputs/apk/debug/app-debug.apk || exit 1 ; \
|
||||
cd ../../.. ; \
|
||||
} || exit 1 ; \
|
||||
mkdir -p app/build/outputs/apk/release ; \
|
||||
../copyAssets.sh pack-binaries app/build/outputs/apk/debug/app-debug.apk && \
|
||||
rm -f app/build/outputs/apk/release/app-release.apk && \
|
||||
zipalign 4 app/build/outputs/apk/debug/app-debug.apk app/build/outputs/apk/release/app-release.apk &&
|
||||
apksigner sign --ks ~/.android/debug.keystore --ks-key-alias androiddebugkey --ks-pass pass:android app/build/outputs/apk/release/app-release.apk || exit 1 ; \
|
||||
fi ; } && \
|
||||
{ if $sign_apk; then cd .. && ./sign.sh && cd project ; else true ; fi ; } && \
|
||||
{ $install_apk && [ -n "`adb devices | tail -n +2`" ] && \
|
||||
{ cd bin && adb install -r MainActivity-debug.apk | grep 'Failure' && \
|
||||
adb uninstall `grep AppFullName ../../AndroidAppSettings.cfg | sed 's/.*=//'` && adb install -r MainActivity-debug.apk ; } ; \
|
||||
{ if $sign_apk; then \
|
||||
APPNAME=`grep AppName ../AndroidAppSettings.cfg | sed 's/.*=//' | tr -d '"' | tr " '/" '---'` ; \
|
||||
APPVER=`grep AppVersionName ../AndroidAppSettings.cfg | sed 's/.*=//' | tr -d '"' | tr " '/" '---'` ; \
|
||||
adb install -r ../$APPNAME-$APPVER.apk ; \
|
||||
else \
|
||||
adb install -r app/build/outputs/apk/release/app-release.apk ; \
|
||||
fi ; } ; \
|
||||
true ; } && \
|
||||
{ $run_apk && { \
|
||||
ActivityName="`grep AppFullName ../../AndroidAppSettings.cfg | sed 's/.*=//'`/.MainActivity" ; \
|
||||
ActivityName="`grep AppFullName ../AndroidAppSettings.cfg | sed 's/.*=//'`/.MainActivity" ; \
|
||||
RUN_APK="adb shell am start -n $ActivityName" ; \
|
||||
echo "Running $ActivityName on the USB-connected device:" ; \
|
||||
echo "$RUN_APK" ; \
|
||||
|
||||
1320
build/envsetup.sh
1320
build/envsetup.sh
File diff suppressed because it is too large
Load Diff
@@ -81,7 +81,7 @@ if [ -z "$CompatibilityHacksForceScreenUpdate" ]; then
|
||||
fi
|
||||
|
||||
if [ -z "$CompatibilityHacksForceScreenUpdateMouseClick" ]; then
|
||||
CompatibilityHacksForceScreenUpdateMouseClick=y
|
||||
CompatibilityHacksForceScreenUpdateMouseClick=n
|
||||
fi
|
||||
|
||||
if [ -z "$TouchscreenKeysTheme" ]; then
|
||||
@@ -146,11 +146,13 @@ echo "# Application user-visible version name (string)" >> AndroidAppSettings.cf
|
||||
echo AppVersionName=\"$AppVersionName\" >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
echo "# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'" >> AndroidAppSettings.cfg
|
||||
echo "# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu" >> AndroidAppSettings.cfg
|
||||
echo "# If you'll start Description with '!' symbol it will be enabled by default, '!!' will also hide the entry from the menu, so it cannot be disabled" >> AndroidAppSettings.cfg
|
||||
echo "# If the URL in in the form ':dir/file.dat:http://URL/' it will be downloaded as binary BLOB to the application dir and not unzipped" >> AndroidAppSettings.cfg
|
||||
echo "# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -" >> AndroidAppSettings.cfg
|
||||
echo "# these files are put inside .apk package by build system" >> AndroidAppSettings.cfg
|
||||
echo "# You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version, first associated with the file" >> AndroidAppSettings.cfg
|
||||
echo "# If the URL does not contain 'http://' or 'https://', it is treated as file from 'project/jni/application/src/AndroidData' dir -" >> AndroidAppSettings.cfg
|
||||
echo "# these files are put inside .apk package by the build system" >> AndroidAppSettings.cfg
|
||||
echo "# You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version for obb file" >> AndroidAppSettings.cfg
|
||||
echo "# You can use .zip.xz archives for better compression, but you need to add 'lzma' to CompiledLibraries" >> AndroidAppSettings.cfg
|
||||
echo "# Generate .zip.xz files like this: zip -0 -r data.zip your-data/* ; xz -8 data.zip" >> AndroidAppSettings.cfg
|
||||
echo AppDataDownloadUrl=\"$AppDataDownloadUrl\" >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
echo "# Reset SDL config when updating application to the new version (y) / (n)" >> AndroidAppSettings.cfg
|
||||
@@ -310,15 +312,21 @@ echo "# API is defined in file SDL_android.h: int SDL_ANDROID_OpenAudioRecording
|
||||
echo "# This option will add additional permission to Android manifest (y)/(n)" >> AndroidAppSettings.cfg
|
||||
echo AppRecordsAudio=$AppRecordsAudio >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
echo "# Application needs to access SD card. Always disable it, unless you want to access user photos and downloads. (y) / (n)" >> AndroidAppSettings.cfg
|
||||
echo "# Application needs read/write access SD card. Always disable it, unless you want to access user photos and downloads. (y) / (n)" >> AndroidAppSettings.cfg
|
||||
echo AccessSdCard=$AccessSdCard >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
echo "# Application needs to read it's own OBB file. Enable this if you are using Play Store expansion files. (y) / (n)" >> AndroidAppSettings.cfg
|
||||
echo ReadObbFile=$ReadObbFile >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
echo "# Application needs Internet access. If you disable it, you'll have to bundle all your data files inside .apk (y) / (n)" >> AndroidAppSettings.cfg
|
||||
echo AccessInternet=$AccessInternet >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
echo "# Immersive mode - Android will hide on-screen Home/Back keys. Looks bad if you invoke Android keyboard. (y) / (n)" >> AndroidAppSettings.cfg
|
||||
echo ImmersiveMode=$ImmersiveMode >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
echo "# Hide Android system mouse cursor image when USB mouse is attached (y) or (n) - the app must draw it's own mouse cursor" >> AndroidAppSettings.cfg
|
||||
echo HideSystemMousePointer=$HideSystemMousePointer >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
echo "# Application implements Android-specific routines to put to background, and will not draw anything to screen" >> AndroidAppSettings.cfg
|
||||
echo "# between SDL_ACTIVEEVENT lost / gained notifications - you should check for them" >> AndroidAppSettings.cfg
|
||||
echo "# rigth after SDL_Flip(), if (n) then SDL_Flip() will block till app in background (y) or (n)" >> AndroidAppSettings.cfg
|
||||
@@ -355,9 +363,18 @@ echo "# 9 = Nintendo64 from RetroArch" >> AndroidAppSettings.cfg
|
||||
echo TouchscreenKeysTheme=$TouchscreenKeysTheme >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
echo "# Redefine gamepad keys to SDL keysyms, button order is:" >> AndroidAppSettings.cfg
|
||||
echo "# A B X Y L1 R1 L2 R2 LThumb RThumb" >> AndroidAppSettings.cfg
|
||||
echo "# A B X Y L1 R1 L2 R2 LThumb RThumb Start Select Up Down Left Right LThumbUp LThumbDown LThumbLeft LThumbRight RThumbUp RThumbDown RThumbLeft RThumbRight" >> AndroidAppSettings.cfg
|
||||
echo RedefinedKeysGamepad=\"$RedefinedKeysGamepad\" >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
echo "# Redefine keys for the second gamepad, same as the first gamepad if not set:" >> AndroidAppSettings.cfg
|
||||
echo RedefinedKeysSecondGamepad=\"$RedefinedKeysSecondGamepad\" >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
echo "# Redefine keys for the third gamepad, same as the first gamepad if not set:" >> AndroidAppSettings.cfg
|
||||
echo RedefinedKeysThirdGamepad=\"$RedefinedKeysThirdGamepad\" >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
echo "# Redefine keys for the fourth gamepad, same as the first gamepad if not set:" >> AndroidAppSettings.cfg
|
||||
echo RedefinedKeysFourthGamepad=\"$RedefinedKeysFourthGamepad\" >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
echo "# How long to show startup menu button, in msec, 0 to disable startup menu" >> AndroidAppSettings.cfg
|
||||
echo StartupMenuButtonTimeout=$StartupMenuButtonTimeout >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
@@ -378,17 +395,17 @@ echo "# GCC version, or 'clang' for CLANG" >> AndroidAppSettings.cfg
|
||||
echo NDK_TOOLCHAIN_VERSION=$NDK_TOOLCHAIN_VERSION >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
echo "# Android platform version." >> AndroidAppSettings.cfg
|
||||
echo "# android-9 = Android 2.3, the earliest supported version." >> AndroidAppSettings.cfg
|
||||
echo "# android-16 = Android 4.1, the earliest supported version in NDK r18." >> AndroidAppSettings.cfg
|
||||
echo "# android-18 = Android 4.3, the first version supporting GLES3." >> AndroidAppSettings.cfg
|
||||
echo "# android-21 = Android 5.1, the first version with SO_REUSEPORT defined." >> AndroidAppSettings.cfg
|
||||
echo APP_PLATFORM=$APP_PLATFORM >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
echo "# Specify architectures to compile, 'all' or 'y' to compile for all architectures." >> AndroidAppSettings.cfg
|
||||
echo "# Available architectures: armeabi armeabi-v7a x86 mips arm64-v8a" >> AndroidAppSettings.cfg
|
||||
echo "# Available architectures: armeabi-v7a arm64-v8a x86 x86_64" >> AndroidAppSettings.cfg
|
||||
echo MultiABI=\'$MultiABI\' >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
echo "# Optional shared libraries to compile - removing some of them will save space" >> AndroidAppSettings.cfg
|
||||
echo "# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed" >> AndroidAppSettings.cfg
|
||||
echo "# MP3 patents are expired, but libmad license is GPL, not LGPL" >> AndroidAppSettings.cfg
|
||||
grep 'Available' project/jni/SettingsTemplate.mk >> AndroidAppSettings.cfg
|
||||
echo CompiledLibraries=\"$CompiledLibraries\" >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
@@ -432,6 +449,9 @@ echo >> AndroidAppSettings.cfg
|
||||
echo "# Google Play Game Services application ID, required for cloud saves to work" >> AndroidAppSettings.cfg
|
||||
echo GooglePlayGameServicesId=$GooglePlayGameServicesId >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
echo "# The app will open files with following extension, file path will be added to commandline params" >> AndroidAppSettings.cfg
|
||||
echo AppOpenFileExtension=\'$AppOpenFileExtension\' >> AndroidAppSettings.cfg
|
||||
echo >> AndroidAppSettings.cfg
|
||||
fi
|
||||
|
||||
AppShortName=`echo $AppName | sed 's/ //g'`
|
||||
@@ -476,12 +496,6 @@ else
|
||||
InhibitSuspend=false
|
||||
fi
|
||||
|
||||
if [ "$CreateService" = "y" ] ; then
|
||||
CreateService=true
|
||||
else
|
||||
CreateService=false
|
||||
fi
|
||||
|
||||
if [ "$NeedDepthBuffer" = "y" ] ; then
|
||||
NeedDepthBuffer=true
|
||||
else
|
||||
@@ -699,24 +713,46 @@ done
|
||||
|
||||
KEY2=0
|
||||
for KEY in $RedefinedKeysGamepad; do
|
||||
RedefinedKeycodesGamepad="$RedefinedKeycodesGamepad -DSDL_ANDROID_GAMEPAD_KEYCODE_$KEY2=$KEY"
|
||||
RedefinedKeycodesGamepad="$RedefinedKeycodesGamepad -DSDL_ANDROID_GAMEPAD_0_KEYCODE_$KEY2=$KEY"
|
||||
KEY2=`expr $KEY2 '+' 1`
|
||||
done
|
||||
|
||||
KEY2=0
|
||||
for KEY in $RedefinedKeysSecondGamepad; do
|
||||
RedefinedKeycodesGamepad="$RedefinedKeycodesGamepad -DSDL_ANDROID_GAMEPAD_1_KEYCODE_$KEY2=$KEY"
|
||||
KEY2=`expr $KEY2 '+' 1`
|
||||
done
|
||||
|
||||
KEY2=0
|
||||
for KEY in $RedefinedKeysThirdGamepad; do
|
||||
RedefinedKeycodesGamepad="$RedefinedKeycodesGamepad -DSDL_ANDROID_GAMEPAD_2_KEYCODE_$KEY2=$KEY"
|
||||
KEY2=`expr $KEY2 '+' 1`
|
||||
done
|
||||
|
||||
KEY2=0
|
||||
for KEY in $RedefinedKeysFourthGamepad; do
|
||||
RedefinedKeycodesGamepad="$RedefinedKeycodesGamepad -DSDL_ANDROID_GAMEPAD_3_KEYCODE_$KEY2=$KEY"
|
||||
KEY2=`expr $KEY2 '+' 1`
|
||||
done
|
||||
|
||||
if [ "$APP_PLATFORM" = "" ]; then
|
||||
APP_PLATFORM=android-18
|
||||
APP_PLATFORM=android-16
|
||||
fi
|
||||
|
||||
if [ "$MultiABI" = "y" ] ; then
|
||||
MultiABI="all"
|
||||
elif [ "$MultiABI" = "n" ] ; then
|
||||
MultiABI="armeabi"
|
||||
MultiABI="armeabi-v7a"
|
||||
else
|
||||
MultiABI="$MultiABI"
|
||||
fi
|
||||
|
||||
LibrariesToLoad="\\\"sdl_native_helpers\\\", \\\"sdl-$LibSdlVersion\\\""
|
||||
StaticLibraries=`grep 'APP_AVAILABLE_STATIC_LIBS' project/jni/SettingsTemplate.mk | sed 's/.*=\(.*\)/\1/'`
|
||||
StaticLibraries="`echo '
|
||||
include project/jni/SettingsTemplate.mk
|
||||
all:
|
||||
@echo $(APP_AVAILABLE_STATIC_LIBS)
|
||||
.PHONY: all' | make -s -f -`"
|
||||
for lib in $CompiledLibraries; do
|
||||
process=true
|
||||
for lib1 in $StaticLibraries; do
|
||||
@@ -803,6 +839,10 @@ else
|
||||
cat $F | sed "s/^package .*;/package $AppFullName;/" >> project/src/Advertisement.java
|
||||
fi
|
||||
|
||||
cat project/app/build-template.gradle | \
|
||||
sed 's/applicationId .*/applicationId "'"$AppFullName"'"/' > \
|
||||
project/app/build.gradle
|
||||
|
||||
echo "-keep class $AppFullName.** { *; }" > project/proguard-local.cfg
|
||||
|
||||
if [ "$AppRecordsAudio" = "n" -o -z "$AppRecordsAudio" ] ; then
|
||||
@@ -826,20 +866,47 @@ esac
|
||||
|
||||
if [ "$AccessSdCard" = "y" ]; then
|
||||
$SEDI "/==NOT_EXTERNAL_STORAGE==/ d" project/AndroidManifest.xml
|
||||
$SEDI "/==READ_OBB==/ d" project/AndroidManifest.xml
|
||||
else
|
||||
$SEDI "/==EXTERNAL_STORAGE==/ d" project/AndroidManifest.xml # Disabled by default
|
||||
if [ "$ReadObbFile" = "y" ]; then
|
||||
$SEDI "/==EXTERNAL_STORAGE==/ d" project/AndroidManifest.xml # Disabled by default
|
||||
$SEDI "/==NOT_EXTERNAL_STORAGE==/ d" project/AndroidManifest.xml
|
||||
else
|
||||
$SEDI "/==EXTERNAL_STORAGE==/ d" project/AndroidManifest.xml # Disabled by default
|
||||
$SEDI "/==READ_OBB==/ d" project/AndroidManifest.xml
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$AccessInternet" = "n" ]; then
|
||||
$SEDI "/==INTERNET==/ d" project/AndroidManifest.xml
|
||||
fi
|
||||
|
||||
if [ -z "$AppOpenFileExtension" ]; then
|
||||
$SEDI "/==OPENFILE==/ d" project/AndroidManifest.xml
|
||||
else
|
||||
EXTS="`for EXT in $AppOpenFileExtension; do echo -n '\\\\1'$EXT'\\\\2' ; done`"
|
||||
$SEDI "s/\(.*\)==OPENFILE-EXT==\(.*\)/$EXTS/g" project/AndroidManifest.xml
|
||||
fi
|
||||
|
||||
if [ "$ImmersiveMode" = "n" ]; then
|
||||
ImmersiveMode=false
|
||||
else
|
||||
ImmersiveMode=true
|
||||
fi
|
||||
|
||||
if [ "$HideSystemMousePointer" = "n" ]; then
|
||||
HideSystemMousePointer=false
|
||||
else
|
||||
HideSystemMousePointer=true
|
||||
fi
|
||||
|
||||
if [ "$CreateService" = "y" ] ; then
|
||||
CreateService=true
|
||||
else
|
||||
CreateService=false
|
||||
$SEDI "/==FOREGROUND_SERVICE==/ d" project/AndroidManifest.xml
|
||||
fi
|
||||
|
||||
GLESLib=-lGLESv1_CM
|
||||
GLESVersion=-DSDL_VIDEO_OPENGL_ES_VERSION=1
|
||||
|
||||
@@ -861,6 +928,7 @@ else
|
||||
$SEDI "/==GLES3==/ d" project/AndroidManifest.xml
|
||||
fi
|
||||
|
||||
|
||||
echo Patching project/src/Globals.java
|
||||
$SEDI "s/public static String ApplicationName = .*;/public static String ApplicationName = \"$AppShortName\";/" project/src/Globals.java
|
||||
$SEDI "s/public static final boolean Using_SDL_1_3 = .*;/public static final boolean Using_SDL_1_3 = $UsingSdl13;/" project/src/Globals.java
|
||||
@@ -909,6 +977,7 @@ $SEDI "s/public static boolean AppUsesMultitouch = .*;/public static boolean App
|
||||
$SEDI "s/public static boolean NonBlockingSwapBuffers = .*;/public static boolean NonBlockingSwapBuffers = $NonBlockingSwapBuffers;/" project/src/Globals.java
|
||||
$SEDI "s/public static boolean ResetSdlConfigForThisVersion = .*;/public static boolean ResetSdlConfigForThisVersion = $ResetSdlConfigForThisVersion;/" project/src/Globals.java
|
||||
$SEDI "s/public static boolean ImmersiveMode = .*;/public static boolean ImmersiveMode = $ImmersiveMode;/" project/src/Globals.java
|
||||
$SEDI "s/public static boolean HideSystemMousePointer = .*;/public static boolean HideSystemMousePointer = $HideSystemMousePointer;/" project/src/Globals.java
|
||||
$SEDI "s|public static String DeleteFilesOnUpgrade = .*;|public static String DeleteFilesOnUpgrade = \"$DeleteFilesOnUpgrade\";|" project/src/Globals.java
|
||||
$SEDI "s/public static int AppTouchscreenKeyboardKeysAmount = .*;/public static int AppTouchscreenKeyboardKeysAmount = $AppTouchscreenKeyboardKeysAmount;/" project/src/Globals.java
|
||||
$SEDI "s@public static String\\[\\] AppTouchscreenKeyboardKeysNames = .*;@public static String[] AppTouchscreenKeyboardKeysNames = \"$RedefinedKeysScreenKbNames\".split(\" \");@" project/src/Globals.java
|
||||
@@ -973,15 +1042,15 @@ done
|
||||
cd ../../..
|
||||
|
||||
SDK_DIR=`grep '^sdk.dir' project/local.properties | sed 's/.*=//'`
|
||||
[ -z "$SDK_DIR" ] && SDK_DIR=`which android | sed 's@/tools/android$@@'`
|
||||
mkdir -p project/libs
|
||||
echo "sdk.dir=$SDK_DIR" > project/local.properties
|
||||
echo 'proguard.config=proguard.cfg;proguard-local.cfg' >> project/local.properties
|
||||
|
||||
if [ "$GooglePlayGameServicesId" = "n" -o -z "$GooglePlayGameServicesId" ] ; then
|
||||
$SEDI "/==GOOGLEPLAYGAMESERVICES==/ d" project/AndroidManifest.xml
|
||||
$SEDI "/==GOOGLEPLAYGAMESERVICES==/ d" project/app/build.gradle
|
||||
GooglePlayGameServicesId=""
|
||||
grep '=play-services' project/local.properties > /dev/null && {
|
||||
$SEDI 's/.*=play-services.*//g' project/local.properties
|
||||
rm -f project/libs/android-support-v4.jar
|
||||
}
|
||||
else
|
||||
for F in $JAVA_SRC_PATH/googleplaygameservices/*.java; do
|
||||
OUT=`echo $F | sed 's@.*/@@'` # basename tool is not available everywhere
|
||||
@@ -990,76 +1059,43 @@ else
|
||||
cat $F | sed "s/^package .*;/package $AppFullName;/" >> project/src/$OUT
|
||||
done
|
||||
|
||||
PLAY_SERVICES_VER=9.4.0
|
||||
rm -rf project/play-services
|
||||
|
||||
CURDIR=`pwd`
|
||||
cd $SDK_DIR/extras/google/m2repository/com/google/android/gms/play-services-games/$PLAY_SERVICES_VER || exit 1
|
||||
$CURDIR/aar2jar.py -o $CURDIR/project/play-services/games -i play-services-games-$PLAY_SERVICES_VER || exit 1
|
||||
cd $SDK_DIR/extras/google/m2repository/com/google/android/gms/play-services-drive/$PLAY_SERVICES_VER || exit 1
|
||||
$CURDIR/aar2jar.py -o $CURDIR/project/play-services/drive -i play-services-drive-$PLAY_SERVICES_VER || exit 1
|
||||
cd $SDK_DIR/extras/google/m2repository/com/google/android/gms/play-services-base/$PLAY_SERVICES_VER || exit 1
|
||||
$CURDIR/aar2jar.py -o $CURDIR/project/play-services/base -i play-services-base-$PLAY_SERVICES_VER || exit 1
|
||||
cd $SDK_DIR/extras/google/m2repository/com/google/android/gms/play-services-tasks/$PLAY_SERVICES_VER || exit 1
|
||||
$CURDIR/aar2jar.py -o $CURDIR/project/play-services/tasks -i play-services-tasks-$PLAY_SERVICES_VER || exit 1
|
||||
cd $SDK_DIR/extras/google/m2repository/com/google/android/gms/play-services-basement/$PLAY_SERVICES_VER || exit 1
|
||||
$CURDIR/aar2jar.py -o $CURDIR/project/play-services/basement -i play-services-basement-$PLAY_SERVICES_VER || exit 1
|
||||
cd $CURDIR
|
||||
|
||||
$SEDI "s/==GOOGLEPLAYGAMESERVICES_APP_ID==/$GooglePlayGameServicesId/g" project/res/values/strings.xml
|
||||
grep 'play-services' project/local.properties > /dev/null || {
|
||||
|
||||
PROGUARD=`which android`
|
||||
PROGUARD=`dirname $PROGUARD`/proguard/lib/proguard.jar
|
||||
java -jar $PROGUARD | grep 'ProGuard, version 5.3.2' || {
|
||||
echo "Error: ProGuard is too old"
|
||||
echo "You need to update ProGuard. Download it here:"
|
||||
echo "https://sourceforge.net/projects/proguard/files/proguard/5.3/proguard5.3.2.tar.gz"
|
||||
echo "Unpack it, then place file proguard.jar to $PROGUARD"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Ant is way too smart, and adds current project path in front of the ${sdk.dir}
|
||||
echo "android.library.reference.1=play-services/games/play-services-games-$PLAY_SERVICES_VER" >> project/local.properties
|
||||
echo "android.library.reference.2=play-services/drive/play-services-drive-$PLAY_SERVICES_VER" >> project/local.properties
|
||||
echo "android.library.reference.3=play-services/base/play-services-base-$PLAY_SERVICES_VER" >> project/local.properties
|
||||
echo "android.library.reference.4=play-services/tasks/play-services-tasks-$PLAY_SERVICES_VER" >> project/local.properties
|
||||
echo "android.library.reference.5=play-services/basement/play-services-basement-$PLAY_SERVICES_VER" >> project/local.properties
|
||||
#echo 'android.library.reference.6=../../../../../../../../../../../../../../${sdk.dir}/extras/android/compatibility/v7/mediarouter' >> project/local.properties
|
||||
#echo 'android.library.reference.7=../../../../../../../../../../../../../../${sdk.dir}/extras/android/compatibility/v7/appcompat' >> project/local.properties
|
||||
#echo 'android.library.reference.8=../../../../../../../../../../../../../../${sdk.dir}/extras/android/compatibility/v7/palette' >> project/local.properties
|
||||
echo 'proguard.config=proguard.cfg;proguard-local.cfg' >> project/local.properties
|
||||
ln -s -f $SDK_DIR/extras/android/compatibility/v4/android-support-v4.jar project/libs
|
||||
PROGUARD=`which android`
|
||||
[ -z "$PROGUARD" ] && PROGUARD=$ANDROID_SDK_ROOT/tools/android
|
||||
PROGUARD=`dirname $PROGUARD`/proguard/lib/proguard.jar
|
||||
java -jar $PROGUARD | grep 'ProGuard, version 5.3' || {
|
||||
echo "Error: ProGuard is too old"
|
||||
echo "You need to update ProGuard. Download it here:"
|
||||
echo "https://sourceforge.net/projects/proguard/files/proguard/5.3/proguard5.3.3.zip"
|
||||
echo "Unpack it, then place file proguard.jar to $PROGUARD"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
|
||||
if [ -e project/jni/application/src/project.patch ]; then patch -p1 --dry-run -f -R < project/jni/application/src/project.patch > /dev/null 2>&1 || patch -p1 --no-backup-if-mismatch < project/jni/application/src/project.patch || exit 1 ; fi
|
||||
|
||||
rm -f project/lib
|
||||
ln -s -f libs project/lib
|
||||
|
||||
echo Cleaning up dependencies
|
||||
|
||||
rm -rf project/libs/*/* project/gen
|
||||
for OUT in obj; do
|
||||
rm -rf project/$OUT/local/*/objs*/sdl_main/* project/$OUT/local/*/libsdl_main.so
|
||||
rm -rf project/$OUT/local/*/libsdl-*.so
|
||||
rm -rf project/$OUT/local/*/libsdl_*.so
|
||||
rm -rf project/$OUT/local/*/objs*/sdl-*/src/*/android
|
||||
rm -rf project/$OUT/local/*/objs*/sdl-*/src/video/SDL_video.o
|
||||
rm -rf project/$OUT/local/*/objs*/sdl-*/SDL_renderer_gles.o
|
||||
rm -rf project/$OUT/local/*/objs*/sdl_*
|
||||
rm -rf project/obj/local/*/objs*/sdl_main/* project/$OUT/local/*/libsdl_main.so
|
||||
rm -rf project/obj/local/*/libsdl-*.so
|
||||
rm -rf project/obj/local/*/libsdl_*.so
|
||||
rm -rf project/obj/local/*/objs*/sdl-*/src/*/android
|
||||
rm -rf project/obj/local/*/objs*/sdl-*/src/video/SDL_video.o
|
||||
rm -rf project/obj/local/*/objs*/sdl-*/SDL_renderer_gles.o
|
||||
rm -rf project/obj/local/*/objs*/sdl_*
|
||||
rm -rf project/obj/local/*/objs*/lzma/src/XZInputStream.o
|
||||
rm -rf project/obj/local/*/objs*/liblzma.so
|
||||
# Do not rebuild several huge libraries that do not depend on SDL version
|
||||
for LIB in freetype intl jpeg png lua mad tremor xerces xml2 curl lua mikmod \
|
||||
boost boost_signals boost_thread boost_filesystem boost_date_time boost_system boost_regex boost_iostreams boost_program_options \
|
||||
ffmpeg swscale avcodec avdevice avresample avutil avfilter swresample avformat; do
|
||||
for ARCH in armeabi armeabi-v7a; do
|
||||
if [ -e "project/$OUT/local/$ARCH/objs*/$LIB" ] ; then
|
||||
find project/$OUT/local/$ARCH/objs*/$LIB -name "*.o" | xargs touch -c
|
||||
fi
|
||||
done
|
||||
done
|
||||
done
|
||||
|
||||
rm -rf project/jni/application/src/AndroidData/lib
|
||||
|
||||
rm -rf project/bin/classes
|
||||
rm -rf project/bin/res
|
||||
rm -rf project/app/build
|
||||
|
||||
# Generate OUYA icon, for that one user who still got an OUYA in his living room and won't throw it away just because someone else decides that it's dead
|
||||
rm -rf project/res/drawable-xhdpi/ouya_icon.png
|
||||
@@ -1073,8 +1109,6 @@ fi
|
||||
./copyAssets.sh || exit 1
|
||||
|
||||
rm -rf project/jni/android-support
|
||||
echo "$NDK_TOOLCHAIN_VERSION" | grep 'clang' > /dev/null || \
|
||||
ln -s "`which ndk-build | sed 's@/ndk-build@@'`/sources/android/support" project/jni/android-support
|
||||
|
||||
rm -rf project/res/drawable/banner.png
|
||||
if [ -e project/jni/application/src/banner.png ]; then
|
||||
@@ -1089,6 +1123,16 @@ fi
|
||||
|
||||
echo Compiling prebuilt libraries
|
||||
|
||||
make -C project/jni -f Makefile.prebuilt
|
||||
if echo "$CompiledLibraries" | grep -E 'crypto|ssl' > /dev/null; then
|
||||
make -C project/jni -f Makefile.prebuilt openssl
|
||||
fi
|
||||
|
||||
if echo "$CompiledLibraries" | grep -E 'iconv|charset|icu|harfbuzz' > /dev/null; then
|
||||
make -C project/jni -f Makefile.prebuilt icu
|
||||
fi
|
||||
|
||||
if echo "$CompiledLibraries" | grep 'boost_' > /dev/null; then
|
||||
make -C project/jni -f Makefile.prebuilt boost
|
||||
fi
|
||||
|
||||
echo Done
|
||||
|
||||
@@ -1,16 +1,38 @@
|
||||
#!/bin/sh
|
||||
|
||||
ARCHES="arm64-v8a armeabi-v7a x86 x86_64"
|
||||
|
||||
if [ "$1" = "pack-binaries" -o "$1" = "pack-binaries-bundle" ]; then
|
||||
[ -e jni/application/src/AndroidData/lib ] || exit 0
|
||||
[ -e jni/application/src/AndroidData/binaries*.zip ] && {
|
||||
echo "Error: binaries.zip no longer supported in Android 10"
|
||||
echo "Copy your executable binaries to AndroidData/lib/arm64-v8a"
|
||||
echo "Then execute them using \$LIBDIR or getenv(\"LIBDIR\")"
|
||||
exit 0
|
||||
}
|
||||
APK="`pwd`/$2"
|
||||
echo "Copying binaries to .apk file"
|
||||
cd jni/application/src/AndroidData/ || exit 1
|
||||
if [ "$1" = "pack-binaries-bundle" ]; then
|
||||
rm -rf base
|
||||
mkdir -p base
|
||||
mv lib base/
|
||||
zip -r "$APK" base || exit 1
|
||||
mv base/lib ./
|
||||
rm -rf base
|
||||
else
|
||||
zip -r "$APK" lib || exit 1
|
||||
fi
|
||||
cd ../../../../
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Copying app data files from project/jni/application/src/AndroidData to project/assets"
|
||||
mkdir -p project/assets
|
||||
rm -f -r project/assets/*
|
||||
if [ -d "project/jni/application/src/AndroidData" ] ; then
|
||||
cp -L -r project/jni/application/src/AndroidData/* project/assets/
|
||||
exit 0 # Do not split assets, this was needed only for Andorid 2.3 with it's stupid limitations
|
||||
for F in project/assets/*; do
|
||||
if [ `cat $F | wc -c` -gt 1000000 ] ; then
|
||||
echo "The file $F is bigger than 1 megabyte - splitting it into smaller chunks"
|
||||
split -b 1000000 -a 3 -d $F $F && rm $F || { echo "Error: 'split' command not installed" ; exit 1 ; }
|
||||
fi
|
||||
done
|
||||
rm -rf project/assets/lib
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -5,16 +5,19 @@ APPVER=`grep AppVersionName AndroidAppSettings.cfg | sed 's/.*=//' | tr -d '"' |
|
||||
|
||||
ARCHIVER=gzip
|
||||
EXT=gz
|
||||
which xz > /dev/null && ARCHIVER="xz -z" && EXT=xz
|
||||
which pxz > /dev/null && ARCHIVER=pxz && EXT=xz || echo "Install pxz for faster archiving: sudo apt-get isntall pxz"
|
||||
which xz > /dev/null && ARCHIVER="xz -z -T 0" && EXT=xz
|
||||
#which pxz > /dev/null && ARCHIVER=pxz && EXT=xz || echo "Install pxz for faster archiving: sudo apt-get install pxz"
|
||||
|
||||
# TODO: Boost, Python and ffmpeg are stored in repository as precompiled binaries, the proper way to fix that is to build them using scripts, and remove that binaries
|
||||
# --exclude="*.a" --exclude="*.so"
|
||||
tar -c --exclude-vcs --exclude="*.o" --exclude="*.d" --exclude="*.dep" \
|
||||
--exclude="libboost_*.a" --exclude="libcharset.so" --exclude="libiconv.so" \
|
||||
--exclude="libicu*.a" --exclude="libharfbuzz.a" --exclude="libcrypto.so*" --exclude="libssl.so*" \
|
||||
`git ls-files --exclude-standard | grep -v '^project/jni/application/.*'` \
|
||||
`find project/jni/application -maxdepth 1 -type f -o -type l` \
|
||||
project/jni/application/src \
|
||||
project/jni/application/`readlink project/jni/application/src` \
|
||||
project/AndroidManifest.xml project/src \
|
||||
project/obj/local/armeabi-v7a/*.so project/obj/local/x86/*.so \
|
||||
project/obj/local/armeabi-v7a/*.so project/obj/local/arm64-v8a/*.so project/obj/local/x86/*.so project/obj/local/x86_64/*.so \
|
||||
project/app/build/outputs/mapping/release/mapping.txt \
|
||||
"$@" | $ARCHIVER > $APPNAME-$APPVER-src.tar.$EXT
|
||||
|
||||
3
project/.gitignore
vendored
Normal file
3
project/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/.gradle
|
||||
/build
|
||||
|
||||
@@ -7,10 +7,12 @@
|
||||
>
|
||||
<application android:label="@string/app_name"
|
||||
android:icon="@drawable/icon"
|
||||
android:debuggable="true"
|
||||
android:allowBackup="true"
|
||||
android:banner="@drawable/banner"
|
||||
android:isGame="true"
|
||||
android:extractNativeLibs="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
>
|
||||
<activity android:name=".MainActivity"
|
||||
android:label="@string/app_name"
|
||||
@@ -27,6 +29,18 @@
|
||||
<category android:name="android.intent.category.LEANBACK_LAUNCHER" /> <!-- Android TV requires this -->
|
||||
<category android:name="tv.ouya.intent.category.GAME" /> <!-- For that one user who still got an OUYA in his living room and won't throw it away just because someone else decides that it's dead -->
|
||||
</intent-filter>
|
||||
<!-- ==OPENFILE== --> <intent-filter>
|
||||
<!-- ==OPENFILE== --> <action android:name="android.intent.action.VIEW" />
|
||||
<!-- ==OPENFILE== --> <category android:name="android.intent.category.DEFAULT" />
|
||||
<!-- ==OPENFILE== --> <category android:name="android.intent.category.BROWSABLE" />
|
||||
<!-- ==OPENFILE== --> <data android:scheme="file" />
|
||||
<!-- ==OPENFILE== --> <data android:mimeType="*/*" />
|
||||
<!-- ==OPENFILE== --> <data android:host="*" />
|
||||
<!-- ==OPENFILE== --> <data android:pathPattern=".*\\.==OPENFILE-EXT==" />
|
||||
<!-- ==OPENFILE== --> <data android:pathPattern=".*\\..*\\.==OPENFILE-EXT==" />
|
||||
<!-- ==OPENFILE== --> <data android:pathPattern=".*\\..*\\..*\\.==OPENFILE-EXT==" />
|
||||
<!-- ==OPENFILE== --> <data android:pathPattern=".*\\..*\\..*\\..*\\.==OPENFILE-EXT==" />
|
||||
<!-- ==OPENFILE== --> </intent-filter>
|
||||
</activity>
|
||||
<!-- ==ADMOB== --> <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize|layoutDirection"/>
|
||||
<!-- ==ADMOB== --> <meta-data android:name="com.google.android.gms.version" android:value="4323000" /> <!-- Change this value to the actual Google Play SDK version -->
|
||||
@@ -48,20 +62,29 @@
|
||||
/>
|
||||
</application>
|
||||
|
||||
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="25"/>
|
||||
<!-- ==INTERNET== --> <uses-permission android:name="android.permission.INTERNET" />
|
||||
<!-- ==EXTERNAL_STORAGE== --> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<!-- ==EXTERNAL_STORAGE== --> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<!-- ==NOT_EXTERNAL_STORAGE== --> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="18" /> <!-- App has write access to it's own dir on SD card without this permission on Android 4.4 and above -->
|
||||
<!-- ==NOT_EXTERNAL_STORAGE== --> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18" />
|
||||
<!-- ==NOT_EXTERNAL_STORAGE== --> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="18" /> <!-- App has write access to it's own dir on SD card without this permission on Android 4.4 and above -->
|
||||
<!-- ==READ_OBB== --> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18" />
|
||||
<!-- ==READ_OBB== --> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="23" /> <!-- OBB file requires explicit permission before Marshmallow -->
|
||||
<!-- ==RECORD_AUDIO== --> <uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<!-- ==ADMOB== --> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<!-- ==FOREGROUND_SERVICE== --> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.VIBRATE"></uses-permission> --> <!-- Vibrator not supported yet by SDL -->
|
||||
|
||||
<uses-feature android:name="android.hardware.touchscreen" android:required="false" /> <!-- Allow TV boxes -->
|
||||
<uses-feature android:name="android.hardware.faketouch" android:required="false"/> <!-- Allow TV boxes -->
|
||||
<uses-feature android:name="android.software.leanback" android:required="false" /> <!-- Android TV requires this -->
|
||||
<uses-feature android:name="android.hardware.microphone" android:required="false" /> <!-- Android TV requires this -->
|
||||
<uses-feature android:name="android.hardware.gamepad" android:required="false"/> <!-- Android TV requires this -->
|
||||
<uses-feature android:name="android.hardware.telephony" android:required="false"/> <!-- Android TV requires this -->
|
||||
<uses-feature android:name="android.hardware.camera" android:required="false"/> <!-- Android TV requires this -->
|
||||
<uses-feature android:name="android.hardware.nfc" android:required="false"/> <!-- Android TV requires this -->
|
||||
<uses-feature android:name="android.hardware.location.gps" android:required="false"/> <!-- Android TV requires this -->
|
||||
<uses-feature android:name="android.hardware.sensor" android:required="false"/> <!-- Android TV requires this -->
|
||||
<!-- ==SCREEN-SIZE-SMALL== --> <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" />
|
||||
<!-- ==SCREEN-SIZE-NORMAL== --> <supports-screens android:smallScreens="false" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" />
|
||||
<!-- ==SCREEN-SIZE-LARGE== --> <supports-screens android:smallScreens="false" android:normalScreens="false" android:largeScreens="true" android:xlargeScreens="true" />
|
||||
|
||||
26
project/app/build-template.gradle
Normal file
26
project/app/build-template.gradle
Normal file
@@ -0,0 +1,26 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion "30.0.0"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "net.olofson.ballfield"
|
||||
minSdkVersion 16 // Must match version numbers in project/AndroidManifestTemplate.xml
|
||||
targetSdkVersion 29
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled true
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), '../proguard-local.cfg', '../proguard.cfg'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies { compile 'com.google.android.gms:play-services-games:19.0.0' } // ==GOOGLEPLAYGAMESERVICES==
|
||||
dependencies { compile 'com.google.android.gms:play-services-drive:17.0.0' } // ==GOOGLEPLAYGAMESERVICES==
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
}
|
||||
1
project/app/src/main/AndroidManifest.xml
Symbolic link
1
project/app/src/main/AndroidManifest.xml
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../AndroidManifest.xml
|
||||
1
project/app/src/main/assets
Symbolic link
1
project/app/src/main/assets
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../assets
|
||||
1
project/app/src/main/java
Symbolic link
1
project/app/src/main/java
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../src/
|
||||
1
project/app/src/main/jniLibs
Symbolic link
1
project/app/src/main/jniLibs
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../libs/
|
||||
1
project/app/src/main/res
Symbolic link
1
project/app/src/main/res
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../res
|
||||
25
project/build.gradle
Normal file
25
project/build.gradle
Normal file
@@ -0,0 +1,25 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath "com.android.tools.build:gradle:4.0.0"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="MainActivity" default="help">
|
||||
|
||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||
It contains the path to the SDK. It should *NOT* be checked into
|
||||
Version Control Systems. -->
|
||||
<property file="local.properties" />
|
||||
|
||||
<!-- The ant.properties file can be created by you. It is only edited by the
|
||||
'android' tool to add properties to it.
|
||||
This is the place to change some Ant specific build properties.
|
||||
Here are some properties you may want to change/update:
|
||||
|
||||
source.dir
|
||||
The name of the source directory. Default is 'src'.
|
||||
out.dir
|
||||
The name of the output directory. Default is 'bin'.
|
||||
|
||||
For other overridable properties, look at the beginning of the rules
|
||||
files in the SDK, at tools/ant/build.xml
|
||||
|
||||
Properties related to the SDK location or the project target should
|
||||
be updated using the 'android' tool with the 'update' action.
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems.
|
||||
|
||||
-->
|
||||
<property file="ant.properties" />
|
||||
|
||||
<!-- if sdk.dir was not set from one of the property file, then
|
||||
get it from the ANDROID_HOME env var.
|
||||
This must be done before we load project.properties since
|
||||
the proguard config can use sdk.dir -->
|
||||
<property environment="env" />
|
||||
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
|
||||
<isset property="env.ANDROID_HOME" />
|
||||
</condition>
|
||||
|
||||
<!-- The project.properties file is created and updated by the 'android'
|
||||
tool, as well as ADT.
|
||||
|
||||
This contains project specific properties such as project target, and library
|
||||
dependencies. Lower level build properties are stored in ant.properties
|
||||
(or in .classpath for Eclipse projects).
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems. -->
|
||||
<loadproperties srcFile="project.properties" />
|
||||
|
||||
<!-- quick check on sdk.dir -->
|
||||
<fail
|
||||
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
|
||||
unless="sdk.dir"
|
||||
/>
|
||||
|
||||
<!--
|
||||
Import per project custom build rules if present at the root of the project.
|
||||
This is the place to put custom intermediary targets such as:
|
||||
-pre-build
|
||||
-pre-compile
|
||||
-post-compile (This is typically used for code obfuscation.
|
||||
Compiled code location: ${out.classes.absolute.dir}
|
||||
If this is not done in place, override ${out.dex.input.absolute.dir})
|
||||
-post-package
|
||||
-post-build
|
||||
-pre-clean
|
||||
-->
|
||||
<import file="custom_rules.xml" optional="true" />
|
||||
|
||||
<!-- Import the actual build file.
|
||||
|
||||
To customize existing targets, there are two options:
|
||||
- Customize only one target:
|
||||
- copy/paste the target into this file, *before* the
|
||||
<import> task.
|
||||
- customize it to your needs.
|
||||
- Customize the whole content of build.xml
|
||||
- copy/paste the content of the rules files (minus the top node)
|
||||
into this file, replacing the <import> task.
|
||||
- customize to your needs.
|
||||
|
||||
***********************
|
||||
****** IMPORTANT ******
|
||||
***********************
|
||||
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
|
||||
in order to avoid having your file be overridden by tools such as "android update project"
|
||||
-->
|
||||
<!-- version-tag: 1 -->
|
||||
<import file="${sdk.dir}/tools/ant/build.xml" />
|
||||
|
||||
</project>
|
||||
19
project/gradle.properties
Normal file
19
project/gradle.properties
Normal file
@@ -0,0 +1,19 @@
|
||||
# Project-wide Gradle settings.
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
# For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx2048m
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||
# Android operating system, and which are packaged with your app"s APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
android.useAndroidX=true
|
||||
# Automatically convert third-party libraries to use AndroidX
|
||||
android.enableJetifier=true
|
||||
BIN
project/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
project/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
6
project/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
6
project/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
#Tue Jul 07 20:59:38 EEST 2020
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
|
||||
172
project/gradlew
vendored
Executable file
172
project/gradlew
vendored
Executable file
@@ -0,0 +1,172 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
84
project/gradlew.bat
vendored
Normal file
84
project/gradlew.bat
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -29,6 +29,7 @@ import android.view.KeyEvent;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.os.Environment;
|
||||
import android.view.View;
|
||||
|
||||
import android.widget.TextView;
|
||||
import java.net.URLConnection;
|
||||
@@ -186,7 +187,8 @@ class DataDownloader extends Thread
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
Parent.keyListener = new BackKeyListener(Parent);
|
||||
Parent.getVideoLayout().setOnKeyListener(new BackKeyListener(Parent));
|
||||
|
||||
String [] downloadFiles = Globals.DataDownloadUrl;
|
||||
int total = 0;
|
||||
int count = 0;
|
||||
@@ -217,7 +219,7 @@ class DataDownloader extends Thread
|
||||
}
|
||||
}
|
||||
DownloadComplete = true;
|
||||
Parent.keyListener = null;
|
||||
Parent.getVideoLayout().setOnKeyListener(null);
|
||||
initParent();
|
||||
}
|
||||
|
||||
@@ -287,7 +289,7 @@ class DataDownloader extends Thread
|
||||
Log.i("SDL", "Downloading data to: '" + outFilesDir + "'");
|
||||
try {
|
||||
File outDir = new File( outFilesDir );
|
||||
if( !(outDir.exists() && outDir.isDirectory()) )
|
||||
if( !outDir.exists() )
|
||||
outDir.mkdirs();
|
||||
OutputStream out = new FileOutputStream( getOutFilePath(".nomedia") );
|
||||
out.flush();
|
||||
@@ -803,7 +805,7 @@ class DataDownloader extends Thread
|
||||
Parent.getPackageName() + "/" + url.substring("obb:".length()) + "." + Parent.getPackageName() + ".obb";
|
||||
}
|
||||
|
||||
public class BackKeyListener implements MainActivity.KeyEventsListener
|
||||
public class BackKeyListener implements View.OnKeyListener
|
||||
{
|
||||
MainActivity p;
|
||||
public BackKeyListener(MainActivity _p)
|
||||
@@ -811,7 +813,8 @@ class DataDownloader extends Thread
|
||||
p = _p;
|
||||
}
|
||||
|
||||
public void onKeyEvent(final int keyCode)
|
||||
@Override
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event)
|
||||
{
|
||||
if( DownloadFailed )
|
||||
System.exit(1);
|
||||
@@ -844,6 +847,7 @@ class DataDownloader extends Thread
|
||||
AlertDialog alert = builder.create();
|
||||
alert.setOwnerActivity(p);
|
||||
alert.show();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -92,6 +92,8 @@ import android.inputmethodservice.Keyboard;
|
||||
import android.app.Notification;
|
||||
import android.app.PendingIntent;
|
||||
import android.widget.RemoteViews;
|
||||
import android.os.Build;
|
||||
import android.app.NotificationChannel;
|
||||
|
||||
public class DummyService extends Service
|
||||
{
|
||||
@@ -110,13 +112,29 @@ public class DummyService extends Service
|
||||
System.exit(0);
|
||||
}
|
||||
Log.v("SDL", "Starting dummy service - displaying notification");
|
||||
Notification ntf = new Notification();
|
||||
ntf.icon = R.drawable.icon;
|
||||
ntf.flags |= Notification.FLAG_NO_CLEAR;
|
||||
Notification.Builder builder;
|
||||
if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.O )
|
||||
{
|
||||
String channelId = "app_running_ntf";
|
||||
NotificationChannel channel = new NotificationChannel(channelId,
|
||||
getString(R.string.notification_app_is_running, getString(getApplicationInfo().labelRes)),
|
||||
NotificationManager.IMPORTANCE_LOW);
|
||||
NotificationManager mgr = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
mgr.createNotificationChannel(channel);
|
||||
builder = new Notification.Builder(this, channelId);
|
||||
}
|
||||
else
|
||||
{
|
||||
builder = new Notification.Builder(this);
|
||||
}
|
||||
Notification ntf = builder
|
||||
.setSmallIcon(R.drawable.icon)
|
||||
.setTicker(getString(getApplicationInfo().labelRes))
|
||||
.setOngoing(true)
|
||||
.build();
|
||||
PendingIntent killIntent = PendingIntent.getService(this, 5, new Intent(Intent.ACTION_DELETE, null, this, DummyService.class), PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
PendingIntent showIntent = PendingIntent.getActivity(this, 0, new Intent("", null, this, MainActivity.class), PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
ntf.deleteIntent = killIntent;
|
||||
ntf.tickerText = getString(getApplicationInfo().labelRes);
|
||||
RemoteViews view = new RemoteViews(getPackageName(), R.layout.notification);
|
||||
view.setCharSequence(R.id.notificationText, "setText", getString(R.string.notification_app_is_running, getString(getApplicationInfo().labelRes)));
|
||||
view.setOnClickPendingIntent(R.id.notificationText, showIntent);
|
||||
|
||||
@@ -1015,7 +1015,7 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call
|
||||
mRenderMode = RENDERMODE_CONTINUOUSLY;
|
||||
mRenderer = renderer;
|
||||
mRenderer.setSwapBuffersCallback(this);
|
||||
setName("GLThread");
|
||||
setName("SDLVideoThread");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -32,7 +32,13 @@ class Globals
|
||||
public static String ApplicationName = "CommanderGenius";
|
||||
public static String AppLibraries[] = { "sdl-1.2", };
|
||||
public static String AppMainLibraries[] = { "application", "sdl_main" };
|
||||
public static String LibraryNamesMap[][] = { { "crypto", "crypto.so.sdl.1" }, { "ssl", "ssl.so.sdl.1" }, { "curl", "curl-sdl" } }; // Because some libraries are named differently to not clash with system libs
|
||||
public static String LibraryNamesMap[][] = {
|
||||
{ "crypto", "crypto.so.sdl.1" },
|
||||
{ "ssl", "ssl.so.sdl.1" },
|
||||
{ "curl", "curl-sdl" },
|
||||
{ "expat", "expat-sdl" },
|
||||
{ "sqlite3", "sqlite3-sdl" },
|
||||
}; // Because some libraries are named differently to not clash with system libs
|
||||
public static final boolean Using_SDL_1_3 = false;
|
||||
public static final boolean Using_SDL_2_0 = false;
|
||||
public static String[] DataDownloadUrl = { "Data files are 2 Mb|https://sourceforge.net/projects/libsdl-android/files/CommanderGenius/commandergenius-data.zip/download", "High-quality GFX and music - 40 Mb|https://sourceforge.net/projects/libsdl-android/files/CommanderGenius/commandergenius-hqp.zip/download" };
|
||||
@@ -42,7 +48,7 @@ class Globals
|
||||
public static boolean NeedGles2 = false;
|
||||
public static boolean NeedGles3 = false;
|
||||
public static boolean CompatibilityHacksVideo = false;
|
||||
public static boolean CompatibilityHacksForceScreenUpdateMouseClick = true;
|
||||
public static boolean CompatibilityHacksForceScreenUpdateMouseClick = false;
|
||||
public static boolean CompatibilityHacksStaticInit = false;
|
||||
public static boolean CompatibilityHacksTextInputEmulatesHwKeyboard = false;
|
||||
public static int TextInputKeyboard = 0;
|
||||
@@ -85,13 +91,14 @@ class Globals
|
||||
public static boolean HorizontalOrientation = true;
|
||||
public static boolean AutoDetectOrientation = false;
|
||||
public static boolean ImmersiveMode = true;
|
||||
public static boolean HideSystemMousePointer = false;
|
||||
public static boolean DownloadToSdcard = true;
|
||||
public static boolean PhoneHasArrowKeys = false;
|
||||
public static boolean UseAccelerometerAsArrowKeys = false;
|
||||
public static boolean UseTouchscreenKeyboard = true;
|
||||
public static int TouchscreenKeyboardSize = 1;
|
||||
public static final int TOUCHSCREEN_KEYBOARD_CUSTOM = 4;
|
||||
public static int TouchscreenKeyboardDrawSize = 1;
|
||||
public static int TouchscreenKeyboardDrawSize = 2;
|
||||
public static int TouchscreenKeyboardTheme = 2;
|
||||
public static int TouchscreenKeyboardTransparency = 2;
|
||||
public static boolean FloatingScreenJoystick = false;
|
||||
|
||||
@@ -97,6 +97,8 @@ import android.app.UiModeManager;
|
||||
import android.Manifest;
|
||||
import android.content.pm.PermissionInfo;
|
||||
import java.util.Arrays;
|
||||
import java.util.zip.ZipFile;
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
public class MainActivity extends Activity
|
||||
@@ -177,6 +179,9 @@ public class MainActivity extends Activity
|
||||
}
|
||||
|
||||
setContentView(_videoLayout);
|
||||
_videoLayout.setFocusable(true);
|
||||
_videoLayout.setFocusableInTouchMode(true);
|
||||
_videoLayout.requestFocus();
|
||||
|
||||
class Callback implements Runnable
|
||||
{
|
||||
@@ -205,7 +210,12 @@ public class MainActivity extends Activity
|
||||
loaded.release();
|
||||
loadedLibraries.release();
|
||||
if( _btn != null )
|
||||
{
|
||||
_btn.setEnabled(true);
|
||||
_btn.setFocusable(true);
|
||||
_btn.setFocusableInTouchMode(true);
|
||||
_btn.requestFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
Callback2 cb = new Callback2();
|
||||
@@ -392,7 +402,7 @@ public class MainActivity extends Activity
|
||||
layout.addRule(RelativeLayout.ALIGN_PARENT_LEFT, RelativeLayout.TRUE);
|
||||
layout.addRule(RelativeLayout.ALIGN_PARENT_TOP, RelativeLayout.TRUE);
|
||||
ImageView borderLeft = new ImageView(this);
|
||||
borderLeft.setId(R.drawable.b1); // Any random ID
|
||||
borderLeft.setId(R.id.left); // Any random ID
|
||||
borderLeft.setImageResource(R.drawable.tv_border_left);
|
||||
borderLeft.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
view.addView(borderLeft, layout);
|
||||
@@ -401,7 +411,7 @@ public class MainActivity extends Activity
|
||||
layout.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, RelativeLayout.TRUE);
|
||||
layout.addRule(RelativeLayout.ALIGN_PARENT_TOP, RelativeLayout.TRUE);
|
||||
ImageView borderRight = new ImageView(this);
|
||||
borderRight.setId(R.drawable.b2);
|
||||
borderRight.setId(R.id.right);
|
||||
borderRight.setImageResource(R.drawable.tv_border_left);
|
||||
borderRight.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
borderRight.setScaleX(-1f);
|
||||
@@ -412,7 +422,7 @@ public class MainActivity extends Activity
|
||||
layout.addRule(RelativeLayout.RIGHT_OF, borderLeft.getId());
|
||||
layout.addRule(RelativeLayout.LEFT_OF, borderRight.getId());
|
||||
ImageView borderTop = new ImageView(this);
|
||||
borderTop.setId(R.drawable.b3);
|
||||
borderTop.setId(R.id.top);
|
||||
borderTop.setImageResource(R.drawable.tv_border_top);
|
||||
borderTop.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
view.addView(borderTop, layout);
|
||||
@@ -422,7 +432,7 @@ public class MainActivity extends Activity
|
||||
layout.addRule(RelativeLayout.RIGHT_OF, borderLeft.getId());
|
||||
layout.addRule(RelativeLayout.LEFT_OF, borderRight.getId());
|
||||
ImageView borderBottom = new ImageView(this);
|
||||
borderBottom.setId(R.drawable.b4);
|
||||
borderBottom.setId(R.id.bottom);
|
||||
borderBottom.setImageResource(R.drawable.tv_border_top);
|
||||
borderBottom.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
borderBottom.setScaleY(-1f);
|
||||
@@ -443,9 +453,11 @@ public class MainActivity extends Activity
|
||||
{
|
||||
_videoLayout.addView(mGLView, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
|
||||
}
|
||||
mGLView.setFocusableInTouchMode(true);
|
||||
mGLView.setFocusable(true);
|
||||
mGLView.requestFocus();
|
||||
mGLView.captureMouse(true);
|
||||
if( Globals.HideSystemMousePointer && android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N )
|
||||
{
|
||||
mGLView.setPointerIcon(android.view.PointerIcon.getSystemIcon(this, android.view.PointerIcon.TYPE_NULL));
|
||||
}
|
||||
|
||||
|
||||
if( _ad.getView() != null )
|
||||
@@ -540,9 +552,13 @@ public class MainActivity extends Activity
|
||||
super.onWindowFocusChanged(hasFocus);
|
||||
Log.i("SDL", "libSDL: onWindowFocusChanged: " + hasFocus + " - sending onPause/onResume");
|
||||
if (hasFocus == false)
|
||||
{
|
||||
onPause();
|
||||
}
|
||||
else
|
||||
{
|
||||
onResume();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isPaused()
|
||||
@@ -585,6 +601,7 @@ public class MainActivity extends Activity
|
||||
public void onActivityResult(int request, int response, Intent data) {
|
||||
super.onActivityResult(request, response, data);
|
||||
cloudSave.onActivityResult(request, response, data);
|
||||
SettingsMenuMisc.StorageAccessConfig.onActivityResult(this, request, response, data);
|
||||
}
|
||||
|
||||
private int TextInputKeyboardList[][] =
|
||||
@@ -604,6 +621,7 @@ public class MainActivity extends Activity
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
mGLView.captureMouse(false);
|
||||
if (keyboard == 0)
|
||||
{
|
||||
_inputManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
|
||||
@@ -678,9 +696,9 @@ public class MainActivity extends Activity
|
||||
if (key > 100000)
|
||||
{
|
||||
key -= 100000;
|
||||
MainActivity.this.onKeyDown(KeyEvent.KEYCODE_SHIFT_LEFT, new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_SHIFT_LEFT));
|
||||
mGLView.onKeyDown(KeyEvent.KEYCODE_SHIFT_LEFT, new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_SHIFT_LEFT));
|
||||
}
|
||||
MainActivity.this.onKeyDown(key, new KeyEvent(KeyEvent.ACTION_DOWN, key));
|
||||
mGLView.onKeyDown(key, new KeyEvent(KeyEvent.ACTION_DOWN, key));
|
||||
}
|
||||
public void onRelease(int key)
|
||||
{
|
||||
@@ -694,9 +712,9 @@ public class MainActivity extends Activity
|
||||
{
|
||||
builtinKeyboard.shift = ! builtinKeyboard.shift;
|
||||
if (builtinKeyboard.shift && !builtinKeyboard.alt)
|
||||
MainActivity.this.onKeyDown(KeyEvent.KEYCODE_SHIFT_LEFT, new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_SHIFT_LEFT));
|
||||
mGLView.onKeyDown(KeyEvent.KEYCODE_SHIFT_LEFT, new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_SHIFT_LEFT));
|
||||
else
|
||||
MainActivity.this.onKeyUp(KeyEvent.KEYCODE_SHIFT_LEFT, new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_SHIFT_LEFT));
|
||||
mGLView.onKeyUp(KeyEvent.KEYCODE_SHIFT_LEFT, new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_SHIFT_LEFT));
|
||||
builtinKeyboard.ChangeKeyboard();
|
||||
return;
|
||||
}
|
||||
@@ -704,7 +722,7 @@ public class MainActivity extends Activity
|
||||
{
|
||||
builtinKeyboard.alt = ! builtinKeyboard.alt;
|
||||
if (builtinKeyboard.alt)
|
||||
MainActivity.this.onKeyUp(KeyEvent.KEYCODE_SHIFT_LEFT, new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_SHIFT_LEFT));
|
||||
mGLView.onKeyUp(KeyEvent.KEYCODE_SHIFT_LEFT, new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_SHIFT_LEFT));
|
||||
else
|
||||
builtinKeyboard.shift = false;
|
||||
builtinKeyboard.ChangeKeyboard();
|
||||
@@ -719,12 +737,12 @@ public class MainActivity extends Activity
|
||||
if (k.on)
|
||||
{
|
||||
builtinKeyboard.stickyKeys.add(key);
|
||||
MainActivity.this.onKeyDown(key, new KeyEvent(KeyEvent.ACTION_DOWN, key));
|
||||
mGLView.onKeyDown(key, new KeyEvent(KeyEvent.ACTION_DOWN, key));
|
||||
}
|
||||
else
|
||||
{
|
||||
builtinKeyboard.stickyKeys.remove(key);
|
||||
MainActivity.this.onKeyUp(key, new KeyEvent(KeyEvent.ACTION_UP, key));
|
||||
mGLView.onKeyUp(key, new KeyEvent(KeyEvent.ACTION_UP, key));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -737,11 +755,11 @@ public class MainActivity extends Activity
|
||||
shifted = true;
|
||||
}
|
||||
|
||||
MainActivity.this.onKeyUp(key, new KeyEvent(KeyEvent.ACTION_UP, key));
|
||||
mGLView.onKeyUp(key, new KeyEvent(KeyEvent.ACTION_UP, key));
|
||||
|
||||
if (shifted)
|
||||
{
|
||||
MainActivity.this.onKeyUp(KeyEvent.KEYCODE_SHIFT_LEFT, new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_SHIFT_LEFT));
|
||||
mGLView.onKeyUp(KeyEvent.KEYCODE_SHIFT_LEFT, new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_SHIFT_LEFT));
|
||||
builtinKeyboard.stickyKeys.remove(KeyEvent.KEYCODE_SHIFT_LEFT);
|
||||
for (Keyboard.Key k: builtinKeyboard.getKeyboard().getKeys())
|
||||
{
|
||||
@@ -763,6 +781,7 @@ public class MainActivity extends Activity
|
||||
_screenKeyboard = builtinKeyboard;
|
||||
FrameLayout.LayoutParams layout = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
|
||||
_videoLayout.addView(_screenKeyboard, layout);
|
||||
_videoLayout.bringChildToFront(_screenKeyboard);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -783,6 +802,7 @@ public class MainActivity extends Activity
|
||||
_inputManager.hideSoftInputFromWindow(mGLView.getWindowToken(), 0);
|
||||
DimSystemStatusBar.get().dim(_videoLayout);
|
||||
//DimSystemStatusBar.get().dim(mGLView);
|
||||
mGLView.captureMouse(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -794,6 +814,7 @@ public class MainActivity extends Activity
|
||||
if(Globals.CompatibilityHacksTextInputEmulatesHwKeyboard)
|
||||
{
|
||||
showScreenKeyboardWithoutTextInputField(Globals.TextInputKeyboard);
|
||||
mGLView.captureMouse(false);
|
||||
return;
|
||||
}
|
||||
if(_screenKeyboard != null)
|
||||
@@ -820,6 +841,7 @@ public class MainActivity extends Activity
|
||||
_parent.hideScreenKeyboard();
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
if (keyCode == KeyEvent.KEYCODE_DEL || keyCode == KeyEvent.KEYCODE_CLEAR)
|
||||
{
|
||||
// EditText deletes two characters at a time, here's a hacky fix
|
||||
@@ -842,41 +864,33 @@ public class MainActivity extends Activity
|
||||
return true;
|
||||
}
|
||||
}
|
||||
*/
|
||||
//Log.i("SDL", "Key " + keyCode + " flags " + event.getFlags() + " action " + event.getAction());
|
||||
return false;
|
||||
}
|
||||
};
|
||||
EditText screenKeyboard = new EditText(this);
|
||||
// This code does not work
|
||||
/*
|
||||
screenKeyboard.setMaxLines(100);
|
||||
ViewGroup.LayoutParams layout = _screenKeyboard.getLayoutParams();
|
||||
if( layout != null )
|
||||
{
|
||||
layout.width = ViewGroup.LayoutParams.FILL_PARENT;
|
||||
layout.height = ViewGroup.LayoutParams.FILL_PARENT;
|
||||
screenKeyboard.setLayoutParams(layout);
|
||||
}
|
||||
screenKeyboard.setGravity(android.view.Gravity.BOTTOM | android.view.Gravity.LEFT);
|
||||
*/
|
||||
EditText screenKeyboard = new EditText(this, null,
|
||||
android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP ? android.R.style.TextAppearance_Material_Widget_EditText : android.R.style.TextAppearance_Widget_EditText);
|
||||
String hint = _screenKeyboardHintMessage;
|
||||
screenKeyboard.setHint(hint != null ? hint : getString(R.string.text_edit_click_here));
|
||||
screenKeyboard.setText(oldText);
|
||||
screenKeyboard.setSelection(screenKeyboard.getText().length());
|
||||
screenKeyboard.setOnKeyListener(new simpleKeyListener(this));
|
||||
screenKeyboard.setBackgroundColor(Color.BLACK); // Full opaque - do not show semi-transparent edit box, it's confusing
|
||||
screenKeyboard.setTextColor(Color.WHITE); // Just to be sure about gamma
|
||||
screenKeyboard.setBackgroundColor(this.getResources().getColor(android.R.color.primary_text_light));
|
||||
screenKeyboard.setTextColor(this.getResources().getColor(android.R.color.background_light));
|
||||
if( isRunningOnOUYA() && Globals.TvBorders )
|
||||
screenKeyboard.setPadding(100, 100, 100, 100); // Bad bad HDMI TVs all have cropped borders
|
||||
else
|
||||
screenKeyboard.setPadding(20, 20, 20, 20); // Account for rounded screen corners
|
||||
_screenKeyboard = screenKeyboard;
|
||||
_videoLayout.addView(_screenKeyboard);
|
||||
//_screenKeyboard.setKeyListener(new TextKeyListener(TextKeyListener.Capitalize.NONE, false));
|
||||
screenKeyboard.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||
screenKeyboard.setFocusableInTouchMode(true);
|
||||
screenKeyboard.setFocusable(true);
|
||||
screenKeyboard.requestFocus();
|
||||
_inputManager.showSoftInput(screenKeyboard, InputMethodManager.SHOW_IMPLICIT);
|
||||
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
|
||||
mGLView.captureMouse(false);
|
||||
//_inputManager.showSoftInput(screenKeyboard, InputMethodManager.SHOW_IMPLICIT);
|
||||
//getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
|
||||
// Hack to try to force on-screen keyboard
|
||||
final EditText keyboard = screenKeyboard;
|
||||
keyboard.postDelayed( new Runnable()
|
||||
@@ -884,8 +898,7 @@ public class MainActivity extends Activity
|
||||
public void run()
|
||||
{
|
||||
keyboard.requestFocus();
|
||||
//_inputManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
|
||||
_inputManager.showSoftInput(keyboard, InputMethodManager.SHOW_FORCED);
|
||||
//_inputManager.showSoftInput(keyboard, InputMethodManager.SHOW_FORCED);
|
||||
// Hack from Stackoverflow, to force text input on Ouya
|
||||
keyboard.dispatchTouchEvent(MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN , 0, 0, 0));
|
||||
keyboard.dispatchTouchEvent(MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_UP , 0, 0, 0));
|
||||
@@ -893,17 +906,21 @@ public class MainActivity extends Activity
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
keyboard.requestFocus();
|
||||
keyboard.setSelection(keyboard.getText().length());
|
||||
}
|
||||
}, 100 );
|
||||
}
|
||||
}, 500 );
|
||||
}, 300 );
|
||||
};
|
||||
|
||||
public void hideScreenKeyboard()
|
||||
{
|
||||
if( keyboardWithoutTextInputShown )
|
||||
{
|
||||
showScreenKeyboardWithoutTextInputField(Globals.TextInputKeyboard);
|
||||
mGLView.captureMouse(true);
|
||||
}
|
||||
|
||||
if(_screenKeyboard == null || ! (_screenKeyboard instanceof EditText))
|
||||
return;
|
||||
@@ -920,9 +937,7 @@ public class MainActivity extends Activity
|
||||
_inputManager.hideSoftInputFromWindow(_screenKeyboard.getWindowToken(), 0);
|
||||
_videoLayout.removeView(_screenKeyboard);
|
||||
_screenKeyboard = null;
|
||||
mGLView.setFocusableInTouchMode(true);
|
||||
mGLView.setFocusable(true);
|
||||
mGLView.requestFocus();
|
||||
mGLView.captureMouse(true);
|
||||
DimSystemStatusBar.get().dim(_videoLayout);
|
||||
|
||||
_videoLayout.postDelayed( new Runnable()
|
||||
@@ -938,7 +953,7 @@ public class MainActivity extends Activity
|
||||
{
|
||||
return _screenKeyboard != null;
|
||||
};
|
||||
|
||||
|
||||
public void setScreenKeyboardHintMessage(String s)
|
||||
{
|
||||
_screenKeyboardHintMessage = s;
|
||||
@@ -1044,169 +1059,12 @@ public class MainActivity extends Activity
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, final KeyEvent event)
|
||||
{
|
||||
if( keyCode == KeyEvent.KEYCODE_BACK )
|
||||
{
|
||||
if( (event.getSource() & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE )
|
||||
{
|
||||
// Stupid Samsung and stupid Acer remaps right mouse button to BACK key
|
||||
DemoGLSurfaceView.nativeMouseButtonsPressed(2, 1);
|
||||
return true;
|
||||
}
|
||||
else if( keyboardWithoutTextInputShown )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if( _screenKeyboard != null && _screenKeyboard.onKeyDown(keyCode, event) )
|
||||
return true;
|
||||
|
||||
if( mGLView != null )
|
||||
{
|
||||
if( mGLView.nativeKey( keyCode, 1, event.getUnicodeChar() ) == 0 )
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
else
|
||||
if( keyListener != null )
|
||||
{
|
||||
keyListener.onKeyEvent(keyCode);
|
||||
}
|
||||
else
|
||||
if( _btn != null )
|
||||
return _btn.onKeyDown(keyCode, event);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyUp(int keyCode, final KeyEvent event)
|
||||
{
|
||||
if( keyCode == KeyEvent.KEYCODE_BACK )
|
||||
{
|
||||
if( (event.getSource() & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE )
|
||||
{
|
||||
// Stupid Samsung and stupid Acer remaps right mouse button to BACK key
|
||||
DemoGLSurfaceView.nativeMouseButtonsPressed(2, 0);
|
||||
return true;
|
||||
}
|
||||
else if( keyboardWithoutTextInputShown )
|
||||
{
|
||||
showScreenKeyboardWithoutTextInputField(0); // Hide keyboard
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if( _screenKeyboard != null && _screenKeyboard.onKeyUp(keyCode, event) )
|
||||
return true;
|
||||
|
||||
if( mGLView != null )
|
||||
{
|
||||
if( mGLView.nativeKey( keyCode, 0, event.getUnicodeChar() ) == 0 )
|
||||
return super.onKeyUp(keyCode, event);
|
||||
if( keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_MENU )
|
||||
{
|
||||
DimSystemStatusBar.get().dim(_videoLayout);
|
||||
//DimSystemStatusBar.get().dim(mGLView);
|
||||
}
|
||||
}
|
||||
else
|
||||
if( _btn != null )
|
||||
return _btn.onKeyUp(keyCode, event);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyMultiple(int keyCode, int repeatCount, final KeyEvent event)
|
||||
{
|
||||
if( _screenKeyboard != null )
|
||||
{
|
||||
_screenKeyboard.onKeyMultiple(keyCode, repeatCount, event);
|
||||
return true;
|
||||
}
|
||||
else if( mGLView != null && event.getCharacters() != null )
|
||||
{
|
||||
// International text input
|
||||
for(int i = 0; i < event.getCharacters().length(); i++ )
|
||||
{
|
||||
mGLView.nativeKey( event.getKeyCode(), 1, event.getCharacters().codePointAt(i) );
|
||||
mGLView.nativeKey( event.getKeyCode(), 0, event.getCharacters().codePointAt(i) );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyLongPress (int keyCode, KeyEvent event)
|
||||
{
|
||||
if( _screenKeyboard != null )
|
||||
{
|
||||
_screenKeyboard.onKeyLongPress(keyCode, event);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(final MotionEvent ev)
|
||||
{
|
||||
//Log.i("SDL", "dispatchTouchEvent: " + ev.getAction() + " coords " + ev.getX() + ":" + ev.getY() );
|
||||
if(_screenKeyboard != null && _screenKeyboard.dispatchTouchEvent(ev))
|
||||
return true;
|
||||
|
||||
if( _ad.getView() != null && // User clicked the advertisement, ignore when user moved finger from game screen to advertisement or touches screen with several fingers
|
||||
((ev.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_DOWN ||
|
||||
(ev.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_UP) &&
|
||||
_ad.getView().getLeft() <= (int)ev.getX() &&
|
||||
_ad.getView().getRight() > (int)ev.getX() &&
|
||||
_ad.getView().getTop() <= (int)ev.getY() &&
|
||||
_ad.getView().getBottom() > (int)ev.getY() )
|
||||
return super.dispatchTouchEvent(ev);
|
||||
else
|
||||
if(mGLView != null)
|
||||
mGLView.onTouchEvent(ev);
|
||||
else
|
||||
if( _btn != null )
|
||||
return _btn.dispatchTouchEvent(ev);
|
||||
else
|
||||
if( touchListener != null )
|
||||
touchListener.onTouchEvent(ev);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchGenericMotionEvent (MotionEvent ev)
|
||||
{
|
||||
//Log.i("SDL", "dispatchGenericMotionEvent: " + ev.getAction() + " coords " + ev.getX() + ":" + ev.getY() );
|
||||
// This code fails to run for Android 1.6, so there will be no generic motion event for Andorid screen keyboard
|
||||
/*
|
||||
if(_screenKeyboard != null)
|
||||
_screenKeyboard.dispatchGenericMotionEvent(ev);
|
||||
else
|
||||
*/
|
||||
if(mGLView != null)
|
||||
mGLView.onGenericMotionEvent(ev);
|
||||
return true;
|
||||
}
|
||||
|
||||
//private Configuration oldConfig = null;
|
||||
@Override
|
||||
public void onConfigurationChanged(Configuration newConfig)
|
||||
{
|
||||
super.onConfigurationChanged(newConfig);
|
||||
updateScreenOrientation();
|
||||
/*
|
||||
if (oldConfig != null)
|
||||
{
|
||||
int diff = newConfig.diff(oldConfig);
|
||||
Log.i("SDL", "onConfigurationChanged(): " + " diff " + diff +
|
||||
((diff & ActivityInfo.CONFIG_ORIENTATION) == ActivityInfo.CONFIG_ORIENTATION ? " orientation" : "") +
|
||||
((diff & ActivityInfo.CONFIG_SCREEN_SIZE) == ActivityInfo.CONFIG_SCREEN_SIZE ? " screen size" : "") +
|
||||
((diff & ActivityInfo.CONFIG_SMALLEST_SCREEN_SIZE) == ActivityInfo.CONFIG_SMALLEST_SCREEN_SIZE ? " smallest screen size" : "") +
|
||||
" " + newConfig.toString());
|
||||
}
|
||||
oldConfig = new Configuration(newConfig);
|
||||
*/
|
||||
}
|
||||
|
||||
public void updateScreenOrientation()
|
||||
@@ -1265,6 +1123,15 @@ public class MainActivity extends Activity
|
||||
Log.i("SDL", "libSDL: Cannot load GLESv3 or GLESv2 lib");
|
||||
}
|
||||
|
||||
String [] SupportedAbis = { android.os.Build.CPU_ABI };
|
||||
if (android.os.Build.CPU_ABI2 != null && !android.os.Build.CPU_ABI2.equals(""))
|
||||
{
|
||||
SupportedAbis = new String [] { android.os.Build.CPU_ABI, android.os.Build.CPU_ABI2 };
|
||||
}
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP)
|
||||
{
|
||||
SupportedAbis = android.os.Build.SUPPORTED_ABIS;
|
||||
}
|
||||
// Load all libraries
|
||||
try
|
||||
{
|
||||
@@ -1275,166 +1142,99 @@ public class MainActivity extends Activity
|
||||
{
|
||||
String libname = System.mapLibraryName(l);
|
||||
File libpath = new File(getFilesDir().getAbsolutePath() + "/../lib/" + libname);
|
||||
Log.i("SDL", "libSDL: loading lib " + libpath.getAbsolutePath());
|
||||
//Log.i("SDL", "libSDL: loading lib " + libpath.getAbsolutePath());
|
||||
System.load(libpath.getPath());
|
||||
Log.i("SDL", "libSDL: loaded lib " + libpath.getAbsolutePath());
|
||||
}
|
||||
catch( UnsatisfiedLinkError e )
|
||||
{
|
||||
Log.i("SDL", "libSDL: error loading lib " + l + ": " + e.toString());
|
||||
//Log.i("SDL", "libSDL: error loading lib " + l + ": " + e.toString());
|
||||
try
|
||||
{
|
||||
String libname = System.mapLibraryName(l);
|
||||
File libpath = new File(getFilesDir().getAbsolutePath() + "/" + libname);
|
||||
Log.i("SDL", "libSDL: loading lib " + libpath.getAbsolutePath());
|
||||
//Log.i("SDL", "libSDL: loading lib " + libpath.getAbsolutePath());
|
||||
System.load(libpath.getPath());
|
||||
Log.i("SDL", "libSDL: loaded lib " + libpath.getAbsolutePath());
|
||||
}
|
||||
catch( UnsatisfiedLinkError ee )
|
||||
{
|
||||
Log.i("SDL", "libSDL: error loading lib " + l + ": " + ee.toString());
|
||||
//Log.i("SDL", "libSDL: error loading lib " + l + ": " + ee.toString());
|
||||
System.loadLibrary(l);
|
||||
Log.i("SDL", "libSDL: loaded lib " + l + " from System.loadLibrary(l)");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch ( UnsatisfiedLinkError e )
|
||||
{
|
||||
try {
|
||||
Log.i("SDL", "libSDL: Extracting APP2SD-ed libs");
|
||||
|
||||
InputStream in = null;
|
||||
try
|
||||
{
|
||||
for( int i = 0; ; i++ )
|
||||
{
|
||||
InputStream in2 = getAssets().open("bindata" + String.valueOf(i));
|
||||
if( in == null )
|
||||
in = in2;
|
||||
else
|
||||
in = new SequenceInputStream( in, in2 );
|
||||
}
|
||||
}
|
||||
catch( IOException ee ) { }
|
||||
|
||||
if( in == null )
|
||||
throw new RuntimeException("libSDL: Extracting APP2SD-ed libs failed, the .apk file packaged incorrectly");
|
||||
|
||||
ZipInputStream zip = new ZipInputStream(in);
|
||||
|
||||
File libDir = getFilesDir();
|
||||
try {
|
||||
libDir.mkdirs();
|
||||
} catch( SecurityException ee ) { };
|
||||
|
||||
byte[] buf = new byte[16384];
|
||||
while(true)
|
||||
{
|
||||
ZipEntry entry = null;
|
||||
entry = zip.getNextEntry();
|
||||
/*
|
||||
if( entry != null )
|
||||
Log.i("SDL", "Extracting lib " + entry.getName());
|
||||
*/
|
||||
if( entry == null )
|
||||
{
|
||||
Log.i("SDL", "Extracting libs finished");
|
||||
break;
|
||||
}
|
||||
if( entry.isDirectory() )
|
||||
{
|
||||
File outDir = new File( libDir.getAbsolutePath() + "/" + entry.getName() );
|
||||
if( !(outDir.exists() && outDir.isDirectory()) )
|
||||
outDir.mkdirs();
|
||||
continue;
|
||||
}
|
||||
|
||||
OutputStream out = null;
|
||||
String path = libDir.getAbsolutePath() + "/" + entry.getName();
|
||||
try {
|
||||
File outDir = new File( path.substring(0, path.lastIndexOf("/") ));
|
||||
if( !(outDir.exists() && outDir.isDirectory()) )
|
||||
outDir.mkdirs();
|
||||
} catch( SecurityException eeeee ) { };
|
||||
|
||||
Log.i("SDL", "Saving to file '" + path + "'");
|
||||
|
||||
out = new FileOutputStream( path );
|
||||
int len = zip.read(buf);
|
||||
while (len >= 0)
|
||||
{
|
||||
if(len > 0)
|
||||
out.write(buf, 0, len);
|
||||
len = zip.read(buf);
|
||||
}
|
||||
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
|
||||
for(String l_unmapped : Globals.AppLibraries)
|
||||
{
|
||||
String l = GetMappedLibraryName(l_unmapped);
|
||||
String libname = System.mapLibraryName(l);
|
||||
File libpath = new File(libDir, libname);
|
||||
Log.i("SDL", "libSDL: loading lib " + libpath.getPath());
|
||||
System.load(libpath.getPath());
|
||||
libpath.delete();
|
||||
}
|
||||
}
|
||||
catch ( Exception ee )
|
||||
{
|
||||
Log.i("SDL", "libSDL: Error: " + ee.toString());
|
||||
}
|
||||
Log.i("SDL", "libSDL: Error: " + e.toString());
|
||||
}
|
||||
|
||||
String [] binaryZipNames = { "binaries-" + android.os.Build.CPU_ABI + ".zip", "binaries-" + android.os.Build.CPU_ABI2 + ".zip", "binaries.zip" };
|
||||
if ( android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN )
|
||||
binaryZipNames = new String[] { "binaries-" + android.os.Build.CPU_ABI + "-pie.zip", "binaries-" + android.os.Build.CPU_ABI2 + "-pie.zip", "binaries-" + android.os.Build.CPU_ABI + ".zip", "binaries-" + android.os.Build.CPU_ABI2 + ".zip", "binaries.zip" };
|
||||
for(String binaryZip: binaryZipNames)
|
||||
ZipFile myApk = null;
|
||||
try
|
||||
{
|
||||
myApk = new ZipFile(getPackageResourcePath());
|
||||
}
|
||||
catch( IOException eeeeeeeee ) {}
|
||||
|
||||
ArrayList<String> a = new ArrayList<String>();
|
||||
for( String arch: SupportedAbis )
|
||||
{
|
||||
a.add("binaries-" + arch + ".zip");
|
||||
}
|
||||
a.add("binaries.zip");
|
||||
String [] binaryZipNames = a.toArray(new String[0]);
|
||||
|
||||
for( String binaryZip: binaryZipNames )
|
||||
{
|
||||
try {
|
||||
Log.i("SDL", "libSDL: Trying to extract binaries from assets " + binaryZip);
|
||||
|
||||
InputStream in = null;
|
||||
try
|
||||
{
|
||||
for( int i = 0; ; i++ )
|
||||
{
|
||||
InputStream in2 = getAssets().open(binaryZip + String.format("%02d", i));
|
||||
if( in == null )
|
||||
in = in2;
|
||||
else
|
||||
in = new SequenceInputStream( in, in2 );
|
||||
}
|
||||
//Log.i("SDL", "libSDL: Trying to extract binaries from assets/" + binaryZip);
|
||||
if( in == null )
|
||||
in = getAssets().open(binaryZip);
|
||||
Log.i("SDL", "libSDL: Found binaries at assets/" + binaryZip);
|
||||
}
|
||||
catch( IOException ee )
|
||||
catch( Exception eee ) {}
|
||||
|
||||
if( binaryZip.equals("binaries.zip") )
|
||||
{
|
||||
try
|
||||
for( String arch: SupportedAbis )
|
||||
{
|
||||
if( in == null )
|
||||
in = getAssets().open(binaryZip);
|
||||
try
|
||||
{
|
||||
if( in == null && myApk != null )
|
||||
{
|
||||
//Log.i("SDL", "libSDL: Trying to extract binaries from lib/" + arch + "/" + binaryZip);
|
||||
in = myApk.getInputStream(myApk.getEntry("lib/" + arch + "/" + binaryZip));
|
||||
Log.i("SDL", "libSDL: Found binaries at lib/" + arch + "/" + binaryZip);
|
||||
}
|
||||
}
|
||||
catch( Exception eeee ) {}
|
||||
}
|
||||
catch( IOException eee ) {}
|
||||
}
|
||||
|
||||
if( in == null )
|
||||
throw new RuntimeException("libSDL: Extracting binaries failed, the .apk file packaged incorrectly");
|
||||
throw new RuntimeException("libSDL: Extracting binaries failed");
|
||||
|
||||
ZipInputStream zip = new ZipInputStream(in);
|
||||
|
||||
File libDir = getFilesDir();
|
||||
try {
|
||||
try
|
||||
{
|
||||
libDir.mkdirs();
|
||||
} catch( SecurityException ee ) { };
|
||||
}
|
||||
catch( SecurityException ee ) { };
|
||||
|
||||
byte[] buf = new byte[16384];
|
||||
while(true)
|
||||
{
|
||||
ZipEntry entry = null;
|
||||
entry = zip.getNextEntry();
|
||||
/*
|
||||
if( entry != null )
|
||||
Log.i("SDL", "Extracting lib " + entry.getName());
|
||||
*/
|
||||
//if( entry != null )
|
||||
// Log.i("SDL", "Extracting binary " + entry.getName());
|
||||
if( entry == null )
|
||||
{
|
||||
Log.i("SDL", "Extracting binaries finished");
|
||||
@@ -1450,13 +1250,16 @@ public class MainActivity extends Activity
|
||||
|
||||
OutputStream out = null;
|
||||
String path = libDir.getAbsolutePath() + "/" + entry.getName();
|
||||
try {
|
||||
try
|
||||
{
|
||||
File outDir = new File( path.substring(0, path.lastIndexOf("/") ));
|
||||
if( !(outDir.exists() && outDir.isDirectory()) )
|
||||
outDir.mkdirs();
|
||||
} catch( SecurityException eeeeeee ) { };
|
||||
}
|
||||
catch( SecurityException eeeeeee ) { };
|
||||
|
||||
try {
|
||||
try
|
||||
{
|
||||
CheckedInputStream check = new CheckedInputStream( new FileInputStream(path), new CRC32() );
|
||||
while( check.read(buf, 0, buf.length) > 0 ) {};
|
||||
check.close();
|
||||
@@ -1494,6 +1297,12 @@ public class MainActivity extends Activity
|
||||
//Log.i("SDL", "libSDL: Error: " + eee.toString());
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
if (myApk != null)
|
||||
myApk.close();
|
||||
}
|
||||
catch( IOException eeeeeeeeee ) {}
|
||||
};
|
||||
|
||||
public static String GetMappedLibraryName(final String s)
|
||||
@@ -1511,27 +1320,31 @@ public class MainActivity extends Activity
|
||||
Settings.nativeChdir(Globals.DataDir);
|
||||
for(String l: Globals.AppMainLibraries)
|
||||
{
|
||||
Log.i("SDL", "libSDL: loading library " + l);
|
||||
try
|
||||
{
|
||||
String libname = System.mapLibraryName(l);
|
||||
File libpath = new File(context.getFilesDir().getAbsolutePath() + "/../lib/" + libname);
|
||||
Log.i("SDL", "libSDL: loading lib " + libpath.getAbsolutePath());
|
||||
//Log.i("SDL", "libSDL: loading lib " + libpath.getAbsolutePath());
|
||||
System.load(libpath.getPath());
|
||||
Log.i("SDL", "libSDL: loaded library " + libpath.getPath());
|
||||
}
|
||||
catch( UnsatisfiedLinkError e )
|
||||
{
|
||||
Log.i("SDL", "libSDL: error loading lib " + l + ": " + e.toString());
|
||||
//Log.i("SDL", "libSDL: error loading lib " + l + ": " + e.toString());
|
||||
try
|
||||
{
|
||||
String libname = System.mapLibraryName(l);
|
||||
File libpath = new File(context.getFilesDir().getAbsolutePath() + "/" + libname);
|
||||
Log.i("SDL", "libSDL: loading lib " + libpath.getAbsolutePath());
|
||||
//Log.i("SDL", "libSDL: loading lib " + libpath.getAbsolutePath());
|
||||
System.load(libpath.getPath());
|
||||
Log.i("SDL", "libSDL: loaded library " + libpath.getPath());
|
||||
}
|
||||
catch( UnsatisfiedLinkError ee )
|
||||
{
|
||||
Log.i("SDL", "libSDL: error loading lib " + l + ": " + ee.toString());
|
||||
//Log.i("SDL", "libSDL: error loading lib " + l + ": " + ee.toString());
|
||||
System.loadLibrary(l);
|
||||
Log.i("SDL", "libSDL: loaded library " + l);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1614,6 +1427,14 @@ public class MainActivity extends Activity
|
||||
}
|
||||
}
|
||||
|
||||
public void setSystemMousePointerVisible(int visible)
|
||||
{
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N)
|
||||
{
|
||||
mGLView.setPointerIcon(android.view.PointerIcon.getSystemIcon(this, (visible == 0) ? android.view.PointerIcon.TYPE_NULL : android.view.PointerIcon.TYPE_DEFAULT));
|
||||
}
|
||||
}
|
||||
|
||||
public FrameLayout getVideoLayout() { return _videoLayout; }
|
||||
|
||||
DemoGLSurfaceView mGLView = null;
|
||||
@@ -1629,24 +1450,12 @@ public class MainActivity extends Activity
|
||||
public ProgressDialog loadingDialog = null;
|
||||
|
||||
FrameLayout _videoLayout = null;
|
||||
private View _screenKeyboard = null;
|
||||
public View _screenKeyboard = null;
|
||||
private String _screenKeyboardHintMessage = null;
|
||||
static boolean keyboardWithoutTextInputShown = false;
|
||||
private boolean sdlInited = false;
|
||||
public static boolean ApplicationLibraryLoaded = false;
|
||||
|
||||
public interface TouchEventsListener
|
||||
{
|
||||
public void onTouchEvent(final MotionEvent ev);
|
||||
}
|
||||
|
||||
public interface KeyEventsListener
|
||||
{
|
||||
public void onKeyEvent(final int keyCode);
|
||||
}
|
||||
|
||||
public TouchEventsListener touchListener = null;
|
||||
public KeyEventsListener keyListener = null;
|
||||
boolean _isPaused = false;
|
||||
private InputMethodManager _inputManager = null;
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ import android.widget.Toast;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
|
||||
|
||||
// TODO: too much code here, split into multiple files, possibly auto-generated menus?
|
||||
@@ -85,6 +86,7 @@ public class Settings
|
||||
static boolean settingsLoaded = false;
|
||||
static boolean settingsChanged = false;
|
||||
static final int SETTINGS_FILE_VERSION = 5;
|
||||
static boolean convertButtonSizeFromOldSdlVersion = false;
|
||||
|
||||
static void Save(final MainActivity p)
|
||||
{
|
||||
@@ -187,6 +189,8 @@ public class Settings
|
||||
out.writeBoolean(Globals.AutoDetectOrientation);
|
||||
out.writeBoolean(Globals.TvBorders);
|
||||
out.writeBoolean(Globals.ForceHardwareMouse);
|
||||
convertButtonSizeFromOldSdlVersion = false;
|
||||
out.writeBoolean(convertButtonSizeFromOldSdlVersion);
|
||||
|
||||
out.close();
|
||||
settingsLoaded = true;
|
||||
@@ -270,6 +274,7 @@ public class Settings
|
||||
// ICS update sends events in a proper way
|
||||
Globals.RemapHwKeycode[112] = SDL_1_2_Keycodes.SDLK_UNKNOWN;
|
||||
}
|
||||
convertButtonSizeFromOldSdlVersion = false;
|
||||
|
||||
try {
|
||||
ObjectInputStream settingsFile = new ObjectInputStream(new FileInputStream( p.getFilesDir().getAbsolutePath() + "/" + SettingsFileName ));
|
||||
@@ -281,6 +286,7 @@ public class Settings
|
||||
Globals.UseAccelerometerAsArrowKeys = settingsFile.readBoolean();
|
||||
Globals.UseTouchscreenKeyboard = settingsFile.readBoolean();
|
||||
Globals.TouchscreenKeyboardSize = settingsFile.readInt();
|
||||
convertButtonSizeFromOldSdlVersion = true; // Will be changed to false if we read the remainder of the config file
|
||||
Globals.AccelerometerSensitivity = settingsFile.readInt();
|
||||
Globals.AccelerometerCenterPos = settingsFile.readInt();
|
||||
settingsFile.readInt();
|
||||
@@ -381,6 +387,7 @@ public class Settings
|
||||
Globals.AutoDetectOrientation = settingsFile.readBoolean();
|
||||
Globals.TvBorders = settingsFile.readBoolean();
|
||||
Globals.ForceHardwareMouse = settingsFile.readBoolean();
|
||||
convertButtonSizeFromOldSdlVersion = settingsFile.readBoolean();
|
||||
|
||||
settingsLoaded = true;
|
||||
|
||||
@@ -403,12 +410,18 @@ public class Settings
|
||||
return;
|
||||
|
||||
} catch( FileNotFoundException e ) {
|
||||
Log.i("SDL", "libSDL: settings file not found: " + e);
|
||||
Log.i("SDL", "libSDL: settings file not found: " + e);
|
||||
} catch( SecurityException e ) {
|
||||
Log.i("SDL", "libSDL: settings file cannot be opened: " + e);
|
||||
} catch ( IOException e ) {
|
||||
Log.i("SDL", "libSDL: settings file cannot be read: " + e);
|
||||
Log.i("SDL", "libSDL: settings file cannot be opened: " + e);
|
||||
} catch( IOException e ) {
|
||||
Log.i("SDL", "libSDL: settings file cannot be read: " + e);
|
||||
DeleteFilesOnUpgrade(p);
|
||||
if (convertButtonSizeFromOldSdlVersion && Globals.TouchscreenKeyboardSize + 1 < Globals.TOUCHSCREEN_KEYBOARD_CUSTOM)
|
||||
{
|
||||
Globals.TouchscreenKeyboardSize ++; // New default button size is bigger, but we are keeping old button size for existing installations
|
||||
//if (Globals.AppTouchscreenKeyboardKeysAmount <= 4 && Globals.TouchscreenKeyboardSize + 1 < Globals.TOUCHSCREEN_KEYBOARD_CUSTOM)
|
||||
// Globals.TouchscreenKeyboardSize ++; // If there are only 4 buttons they are even bigger
|
||||
}
|
||||
if( Globals.ResetSdlConfigForThisVersion )
|
||||
{
|
||||
Log.i("SDL", "libSDL: old cfg version unknown or too old, our version " + p.getApplicationVersion() + " and we need to clean up config file");
|
||||
@@ -593,7 +606,8 @@ public class Settings
|
||||
Globals.TouchscreenKeyboardDrawSize,
|
||||
Globals.TouchscreenKeyboardTheme,
|
||||
Globals.TouchscreenKeyboardTransparency,
|
||||
Globals.FloatingScreenJoystick ? 1 : 0 );
|
||||
Globals.FloatingScreenJoystick ? 1 : 0,
|
||||
Globals.AppTouchscreenKeyboardKeysAmount );
|
||||
SetupTouchscreenKeyboardGraphics(p);
|
||||
for( int i = 0; i < Globals.RemapScreenKbKeycode.length; i++ )
|
||||
nativeSetKeymapKeyScreenKb(i, SDL_Keys.values[Globals.RemapScreenKbKeycode[i]]);
|
||||
@@ -629,9 +643,10 @@ public class Settings
|
||||
Log.i("SDL", "libSDL: setting envvar LANGUAGE to '" + lang + "'");
|
||||
nativeSetEnv( "LANG", lang );
|
||||
nativeSetEnv( "LANGUAGE", lang );
|
||||
// TODO: get current user name and set envvar USER, the API is not availalbe on Android 1.6 so I don't bother with this
|
||||
nativeSetEnv( "ARCH", android.os.Build.CPU_ABI );
|
||||
nativeSetEnv( "APPDIR", p.getFilesDir().getAbsolutePath() );
|
||||
nativeSetEnv( "SECURE_STORAGE_DIR", p.getFilesDir().getAbsolutePath() );
|
||||
nativeSetEnv( "LIBDIR", p.getApplicationInfo().nativeLibraryDir );
|
||||
nativeSetEnv( "DATADIR", Globals.DataDir );
|
||||
nativeSetEnv( "UNSECURE_STORAGE_DIR", Globals.DataDir );
|
||||
SdcardAppPath.get().setEnv(p);
|
||||
@@ -646,9 +661,19 @@ public class Settings
|
||||
nativeSetEnv( "ANDROID_PACKAGE_NAME", p.getPackageName() );
|
||||
nativeSetEnv( "ANDROID_PACKAGE_PATH", p.getPackageCodePath() );
|
||||
nativeSetEnv( "ANDROID_MY_OWN_APP_FILE", p.getPackageResourcePath() ); // This may be different from p.getPackageCodePath() on multi-user systems, but should still be the same .apk file
|
||||
nativeSetEnv( "ANDROID_OBB_DIR", Environment.getExternalStorageDirectory().getAbsolutePath() + "/Android/obb/" + p.getPackageName() );
|
||||
try {
|
||||
nativeSetEnv( "ANDROID_OBB_DIR", p.getObbDir().getAbsolutePath() );
|
||||
} catch (Exception eeeeeee) {}
|
||||
try {
|
||||
nativeSetEnv( "ANDROID_APP_NAME", p.getString(p.getApplicationInfo().labelRes) );
|
||||
} catch (Exception eeeeee) {}
|
||||
try {
|
||||
PackageInfo pInfo = p.getPackageManager().getPackageInfo(p.getPackageName(), 0);
|
||||
nativeSetEnv( "ANDROID_PACKAGE_VERSION_NAME", pInfo.versionName );
|
||||
nativeSetEnv( "ANDROID_PACKAGE_VERSION_CODE", String.valueOf(pInfo.versionCode) );
|
||||
} catch (PackageManager.NameNotFoundException eeeeeeee) {
|
||||
}
|
||||
Log.d("SDL", "libSDL: Is running on OUYA: " + p.isRunningOnOUYA());
|
||||
if( p.isRunningOnOUYA() )
|
||||
{
|
||||
@@ -967,7 +992,7 @@ public class Settings
|
||||
private static native void nativeSetCompatibilityHacks();
|
||||
private static native void nativeSetVideoMultithreaded();
|
||||
private static native void nativeSetVideoForceSoftwareMode();
|
||||
private static native void nativeSetupScreenKeyboard(int size, int drawsize, int theme, int transparency, int floatingScreenJoystick);
|
||||
public static native void nativeSetupScreenKeyboard(int size, int drawsize, int theme, int transparency, int floatingScreenJoystick, int buttonAmount);
|
||||
private static native void nativeSetupScreenKeyboardButtons(byte[] img);
|
||||
private static native void nativeInitKeymap();
|
||||
private static native int nativeGetKeymapKey(int key);
|
||||
@@ -976,10 +1001,11 @@ public class Settings
|
||||
private static native void nativeSetKeymapKeyScreenKb(int keynum, int key);
|
||||
private static native void nativeSetScreenKbKeyUsed(int keynum, int used);
|
||||
private static native void nativeSetScreenKbKeyLayout(int keynum, int x1, int y1, int x2, int y2);
|
||||
public static native int nativeGetScreenKeyboardButtonLayout(int button, int coord);
|
||||
private static native int nativeGetKeymapKeyMultitouchGesture(int keynum);
|
||||
private static native void nativeSetKeymapKeyMultitouchGesture(int keynum, int key);
|
||||
private static native void nativeSetMultitouchGestureSensitivity(int sensitivity);
|
||||
private static native void nativeSetTouchscreenCalibration(int x1, int y1, int x2, int y2);
|
||||
public static native void nativeSetTouchscreenCalibration(int x1, int y1, int x2, int y2);
|
||||
public static native void nativeSetEnv(final String name, final String value);
|
||||
public static native int nativeChmod(final String name, int mode);
|
||||
public static native void nativeChdir(final String dir);
|
||||
|
||||
@@ -248,6 +248,7 @@ class SettingsMenu
|
||||
new SettingsMenuKeyboard.ScreenGesturesConfig(),
|
||||
new SettingsMenuMisc.VideoSettingsConfig(),
|
||||
new SettingsMenuMisc.CommandlineConfig(),
|
||||
new SettingsMenuMisc.StorageAccessConfig(),
|
||||
new SettingsMenuMisc.ResetToDefaultsConfig(),
|
||||
new OkButton(),
|
||||
};
|
||||
|
||||
@@ -57,6 +57,7 @@ import android.widget.EditText;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.Button;
|
||||
import android.view.View;
|
||||
import android.view.Gravity;
|
||||
import android.widget.LinearLayout;
|
||||
import android.text.Editable;
|
||||
import android.text.SpannedString;
|
||||
@@ -276,10 +277,10 @@ class SettingsMenuKeyboard extends SettingsMenu
|
||||
void run (final MainActivity p)
|
||||
{
|
||||
p.setText(p.getResources().getString(R.string.remap_hwkeys_press));
|
||||
p.keyListener = new KeyRemapTool(p);
|
||||
p.getVideoLayout().setOnKeyListener(new KeyRemapTool(p));
|
||||
}
|
||||
|
||||
public static class KeyRemapTool implements MainActivity.KeyEventsListener
|
||||
public static class KeyRemapTool implements View.OnKeyListener
|
||||
{
|
||||
MainActivity p;
|
||||
public KeyRemapTool(MainActivity _p)
|
||||
@@ -287,9 +288,10 @@ class SettingsMenuKeyboard extends SettingsMenu
|
||||
p = _p;
|
||||
}
|
||||
|
||||
public void onKeyEvent(final int keyCode)
|
||||
@Override
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event)
|
||||
{
|
||||
p.keyListener = null;
|
||||
p.getVideoLayout().setOnKeyListener(null);
|
||||
int keyIndex = keyCode;
|
||||
if( keyIndex < 0 )
|
||||
keyIndex = 0;
|
||||
@@ -336,6 +338,7 @@ class SettingsMenuKeyboard extends SettingsMenu
|
||||
AlertDialog alert = builder.create();
|
||||
alert.setOwnerActivity(p);
|
||||
alert.show();
|
||||
return true;
|
||||
}
|
||||
public void ShowAllKeys(final int KeyIndex)
|
||||
{
|
||||
@@ -623,13 +626,19 @@ class SettingsMenuKeyboard extends SettingsMenu
|
||||
void run (final MainActivity p)
|
||||
{
|
||||
p.setText(p.getResources().getString(R.string.screenkb_custom_layout_help));
|
||||
CustomizeScreenKbLayoutTool tool = new CustomizeScreenKbLayoutTool(p);
|
||||
p.touchListener = tool;
|
||||
p.keyListener = tool;
|
||||
Globals.TouchscreenKeyboardSize = Globals.TOUCHSCREEN_KEYBOARD_CUSTOM;
|
||||
if (Globals.ImmersiveMode)
|
||||
DimSystemStatusBar.get().dim(p.getVideoLayout());
|
||||
p.getVideoLayout().getHandler().postDelayed(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
CustomizeScreenKbLayoutTool tool = new CustomizeScreenKbLayoutTool(p);
|
||||
Globals.TouchscreenKeyboardSize = Globals.TOUCHSCREEN_KEYBOARD_CUSTOM;
|
||||
}
|
||||
}, 200);
|
||||
}
|
||||
|
||||
static class CustomizeScreenKbLayoutTool implements MainActivity.TouchEventsListener, MainActivity.KeyEventsListener
|
||||
static class CustomizeScreenKbLayoutTool implements View.OnTouchListener, View.OnKeyListener
|
||||
{
|
||||
MainActivity p;
|
||||
FrameLayout layout = null;
|
||||
@@ -658,6 +667,11 @@ class SettingsMenuKeyboard extends SettingsMenu
|
||||
p = _p;
|
||||
layout = new FrameLayout(p);
|
||||
p.getVideoLayout().addView(layout);
|
||||
layout.setFocusable(true);
|
||||
layout.setFocusableInTouchMode(true);
|
||||
layout.requestFocus();
|
||||
layout.setOnTouchListener(this);
|
||||
layout.setOnKeyListener(this);
|
||||
boundary = new ImageView(p);
|
||||
boundary.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
|
||||
boundary.setScaleType(ImageView.ScaleType.MATRIX);
|
||||
@@ -665,30 +679,27 @@ class SettingsMenuKeyboard extends SettingsMenu
|
||||
boundary.setImageBitmap(boundaryBmp);
|
||||
layout.addView(boundary);
|
||||
currentButton = -1;
|
||||
if( Globals.TouchscreenKeyboardTheme == 2 )
|
||||
{
|
||||
buttons = new int[] {
|
||||
R.drawable.sun_dpad,
|
||||
R.drawable.sun_keyboard,
|
||||
R.drawable.sun_b1,
|
||||
R.drawable.sun_b2,
|
||||
R.drawable.sun_b3,
|
||||
R.drawable.sun_b4,
|
||||
R.drawable.sun_b5,
|
||||
R.drawable.sun_b6,
|
||||
R.drawable.sun_dpad,
|
||||
R.drawable.sun_dpad
|
||||
};
|
||||
}
|
||||
|
||||
int displayX = 800;
|
||||
int displayY = 480;
|
||||
try {
|
||||
DisplayMetrics dm = new DisplayMetrics();
|
||||
p.getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||
displayX = dm.widthPixels;
|
||||
displayY = dm.heightPixels;
|
||||
} catch (Exception eeeee) {}
|
||||
final int displayX = p.getVideoLayout().getWidth();
|
||||
final int displayY = p.getVideoLayout().getHeight();
|
||||
|
||||
if( Globals.TouchscreenKeyboardSize != Globals.TOUCHSCREEN_KEYBOARD_CUSTOM )
|
||||
{
|
||||
DemoRenderer.nativeResize(displayX, displayY, 0);
|
||||
Settings.nativeSetupScreenKeyboard( Globals.TouchscreenKeyboardSize,
|
||||
Globals.TouchscreenKeyboardDrawSize,
|
||||
Globals.TouchscreenKeyboardTheme,
|
||||
Globals.TouchscreenKeyboardTransparency,
|
||||
Globals.FloatingScreenJoystick ? 1 : 0,
|
||||
Globals.AppTouchscreenKeyboardKeysAmount );
|
||||
for( int i = 0; i < Globals.ScreenKbControlsLayout.length; i++ )
|
||||
{
|
||||
Globals.ScreenKbControlsLayout[i][0] = Settings.nativeGetScreenKeyboardButtonLayout(i, 0);
|
||||
Globals.ScreenKbControlsLayout[i][1] = Settings.nativeGetScreenKeyboardButtonLayout(i, 1);
|
||||
Globals.ScreenKbControlsLayout[i][2] = Settings.nativeGetScreenKeyboardButtonLayout(i, 2);
|
||||
Globals.ScreenKbControlsLayout[i][3] = Settings.nativeGetScreenKeyboardButtonLayout(i, 3);
|
||||
}
|
||||
}
|
||||
|
||||
for( int i = 0; i < Globals.ScreenKbControlsLayout.length; i++ )
|
||||
{
|
||||
@@ -696,37 +707,7 @@ class SettingsMenuKeyboard extends SettingsMenu
|
||||
continue;
|
||||
if( currentButton == -1 )
|
||||
currentButton = i;
|
||||
//Log.i("SDL", "Screen kb button " + i + " coords " + Globals.ScreenKbControlsLayout[i][0] + ":" + Globals.ScreenKbControlsLayout[i][1] + ":" + Globals.ScreenKbControlsLayout[i][2] + ":" + Globals.ScreenKbControlsLayout[i][3] );
|
||||
// Check if the button is off screen edge or shrunk to zero
|
||||
if( Globals.ScreenKbControlsLayout[i][0] > Globals.ScreenKbControlsLayout[i][2] - displayY/12 )
|
||||
Globals.ScreenKbControlsLayout[i][0] = Globals.ScreenKbControlsLayout[i][2] - displayY/12;
|
||||
if( Globals.ScreenKbControlsLayout[i][1] > Globals.ScreenKbControlsLayout[i][3] - displayY/12 )
|
||||
Globals.ScreenKbControlsLayout[i][1] = Globals.ScreenKbControlsLayout[i][3] - displayY/12;
|
||||
if( Globals.ScreenKbControlsLayout[i][0] < Globals.ScreenKbControlsLayout[i][2] - displayY*2/3 )
|
||||
Globals.ScreenKbControlsLayout[i][0] = Globals.ScreenKbControlsLayout[i][2] - displayY*2/3;
|
||||
if( Globals.ScreenKbControlsLayout[i][1] < Globals.ScreenKbControlsLayout[i][3] - displayY*2/3 )
|
||||
Globals.ScreenKbControlsLayout[i][1] = Globals.ScreenKbControlsLayout[i][3] - displayY*2/3;
|
||||
if( Globals.ScreenKbControlsLayout[i][0] < 0 )
|
||||
{
|
||||
Globals.ScreenKbControlsLayout[i][2] += -Globals.ScreenKbControlsLayout[i][0];
|
||||
Globals.ScreenKbControlsLayout[i][0] = 0;
|
||||
}
|
||||
if( Globals.ScreenKbControlsLayout[i][2] > displayX )
|
||||
{
|
||||
Globals.ScreenKbControlsLayout[i][0] -= Globals.ScreenKbControlsLayout[i][2] - displayX;
|
||||
Globals.ScreenKbControlsLayout[i][2] = displayX;
|
||||
}
|
||||
if( Globals.ScreenKbControlsLayout[i][1] < 0 )
|
||||
{
|
||||
Globals.ScreenKbControlsLayout[i][3] += -Globals.ScreenKbControlsLayout[i][1];
|
||||
Globals.ScreenKbControlsLayout[i][1] = 0;
|
||||
}
|
||||
if( Globals.ScreenKbControlsLayout[i][3] > displayY )
|
||||
{
|
||||
Globals.ScreenKbControlsLayout[i][1] -= Globals.ScreenKbControlsLayout[i][3] - displayY;
|
||||
Globals.ScreenKbControlsLayout[i][3] = displayY;
|
||||
}
|
||||
//Log.i("SDL", "After bounds check coords " + Globals.ScreenKbControlsLayout[i][0] + ":" + Globals.ScreenKbControlsLayout[i][1] + ":" + Globals.ScreenKbControlsLayout[i][2] + ":" + Globals.ScreenKbControlsLayout[i][3] );
|
||||
Log.i("SDL", "Screen kb button " + i + " coords " + Globals.ScreenKbControlsLayout[i][0] + ":" + Globals.ScreenKbControlsLayout[i][1] + ":" + Globals.ScreenKbControlsLayout[i][2] + ":" + Globals.ScreenKbControlsLayout[i][3] );
|
||||
|
||||
imgs[i] = new ImageView(p);
|
||||
imgs[i].setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
|
||||
@@ -744,9 +725,34 @@ class SettingsMenuKeyboard extends SettingsMenu
|
||||
}
|
||||
boundary.bringToFront();
|
||||
if( currentButton == -1 )
|
||||
onKeyEvent( KeyEvent.KEYCODE_BACK ); // All buttons disabled - do not show anything
|
||||
onKey( null, KeyEvent.KEYCODE_BACK, null ); // All buttons disabled - do not show anything
|
||||
else
|
||||
setupButton(currentButton);
|
||||
|
||||
final Button backButton = new Button(p);
|
||||
backButton.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||
backButton.setText(android.R.string.ok);
|
||||
//backButton.setTop(displayY / 30);
|
||||
//backButton.setLeft(displayX / 2);
|
||||
backButton.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
public void onClick(View v)
|
||||
{
|
||||
p.getVideoLayout().removeView(layout);
|
||||
layout = null;
|
||||
goBack(p);
|
||||
}
|
||||
});
|
||||
layout.addView(backButton, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
Gravity.TOP | Gravity.CENTER_HORIZONTAL));
|
||||
layout.getHandler().postDelayed(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
//backButton.setLeft(displayX / 2 - backButton.getWidth() / 2);
|
||||
//backButton.setLeft(displayX / 2);
|
||||
}
|
||||
}, 200);
|
||||
}
|
||||
|
||||
void setupButton(int i)
|
||||
@@ -777,7 +783,8 @@ class SettingsMenuKeyboard extends SettingsMenu
|
||||
p.setText(p.getResources().getString(R.string.screenkb_custom_layout_help) + "\n" + buttonText);
|
||||
}
|
||||
|
||||
public void onTouchEvent(final MotionEvent ev)
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent ev)
|
||||
{
|
||||
if( ev.getAction() == MotionEvent.ACTION_DOWN )
|
||||
{
|
||||
@@ -842,18 +849,19 @@ class SettingsMenuKeyboard extends SettingsMenu
|
||||
m.setRectToRect(src, dst, Matrix.ScaleToFit.FILL);
|
||||
boundary.setImageMatrix(m);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onKeyEvent(final int keyCode)
|
||||
@Override
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event)
|
||||
{
|
||||
if( keyCode == KeyEvent.KEYCODE_BACK )
|
||||
{
|
||||
p.getVideoLayout().removeView(layout);
|
||||
layout = null;
|
||||
p.touchListener = null;
|
||||
p.keyListener = null;
|
||||
goBack(p);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ class SettingsMenuMisc extends SettingsMenu
|
||||
String readmes[] = Globals.ReadmeText.split("\\^");
|
||||
String lang = new String(Locale.getDefault().getLanguage()) + ":";
|
||||
if( p.isRunningOnOUYA() )
|
||||
lang = "ouya:";
|
||||
lang = "tv:";
|
||||
String readme = readmes[0];
|
||||
String buttonName = "", buttonUrl = "";
|
||||
for( String r: readmes )
|
||||
@@ -469,10 +469,14 @@ class SettingsMenuMisc extends SettingsMenu
|
||||
text.setPadding(0, 5, 0, 20);
|
||||
text.setTextSize(20.0f);
|
||||
text.setGravity(Gravity.CENTER);
|
||||
text.setFocusable(false);
|
||||
text.setFocusableInTouchMode(false);
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(p);
|
||||
ScrollView scroll = new ScrollView(p);
|
||||
scroll.setFocusable(false);
|
||||
scroll.setFocusableInTouchMode(false);
|
||||
scroll.addView(text, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||
Button ok = new Button(p);
|
||||
final Button ok = new Button(p);
|
||||
final AlertDialog alertDismiss[] = new AlertDialog[1];
|
||||
ok.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@@ -485,7 +489,6 @@ class SettingsMenuMisc extends SettingsMenu
|
||||
LinearLayout layout = new LinearLayout(p);
|
||||
layout.setOrientation(LinearLayout.VERTICAL);
|
||||
layout.addView(scroll);
|
||||
//layout.addView(text);
|
||||
layout.addView(ok);
|
||||
if( buttonName.length() > 0 )
|
||||
{
|
||||
@@ -539,6 +542,42 @@ class SettingsMenuMisc extends SettingsMenu
|
||||
}
|
||||
}
|
||||
|
||||
public static class StorageAccessConfig extends Menu
|
||||
{
|
||||
public static int REQUEST_STORAGE_ID = 42;
|
||||
|
||||
public static void onActivityResult(final MainActivity p, final int requestCode, final int resultCode, final Intent resultData)
|
||||
{
|
||||
if (requestCode == REQUEST_STORAGE_ID)
|
||||
{
|
||||
if (resultCode == Activity.RESULT_OK)
|
||||
{
|
||||
Uri treeUri = resultData.getData();
|
||||
p.getContentResolver().takePersistableUriPermission(treeUri, Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
|
||||
Log.i("SDL", "Storage write permission granted to path " + treeUri.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.i("SDL", "Storage write permission rejected");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String title(final MainActivity p)
|
||||
{
|
||||
return p.getResources().getString(R.string.storage_access);
|
||||
}
|
||||
void run (final MainActivity p)
|
||||
{
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP)
|
||||
{
|
||||
p.startActivityForResult(new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE), REQUEST_STORAGE_ID);
|
||||
}
|
||||
|
||||
goBack(p);
|
||||
}
|
||||
}
|
||||
|
||||
static class CommandlineConfig extends Menu
|
||||
{
|
||||
String title(final MainActivity p)
|
||||
@@ -554,12 +593,10 @@ class SettingsMenuMisc extends SettingsMenu
|
||||
edit.setFocusableInTouchMode(true);
|
||||
edit.setFocusable(true);
|
||||
if (Globals.CommandLine.length() == 0)
|
||||
Globals.CommandLine = "SDL_app";
|
||||
if (Globals.CommandLine.indexOf(" ") == -1)
|
||||
Globals.CommandLine += " ";
|
||||
edit.setText(Globals.CommandLine.substring(Globals.CommandLine.indexOf(" ")).replace(" ", "\n").replace(" ", " "));
|
||||
Globals.CommandLine = "App";
|
||||
edit.setText(Globals.CommandLine.replace(" ", "\n").replace(" ", " "));
|
||||
edit.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
|
||||
edit.setMinLines(2);
|
||||
edit.setMinLines(1);
|
||||
//edit.setMaxLines(100);
|
||||
builder.setView(edit);
|
||||
|
||||
@@ -567,17 +604,22 @@ class SettingsMenuMisc extends SettingsMenu
|
||||
{
|
||||
public void onClick(DialogInterface dialog, int item)
|
||||
{
|
||||
Globals.CommandLine = "SDL_app";
|
||||
Globals.CommandLine = "";
|
||||
String args[] = edit.getText().toString().split("\n");
|
||||
boolean firstArg = true;
|
||||
for( String arg: args )
|
||||
if( args.length == 1 )
|
||||
{
|
||||
Globals.CommandLine += " ";
|
||||
if( firstArg )
|
||||
Globals.CommandLine += arg;
|
||||
else
|
||||
Globals.CommandLine = args[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
boolean firstArg = true;
|
||||
for( String arg: args )
|
||||
{
|
||||
if( !firstArg )
|
||||
Globals.CommandLine += " ";
|
||||
Globals.CommandLine += arg.replace(" ", " ");
|
||||
firstArg = false;
|
||||
firstArg = false;
|
||||
}
|
||||
}
|
||||
dialog.dismiss();
|
||||
goBack(p);
|
||||
|
||||
@@ -267,7 +267,7 @@ class SettingsMenuMouse extends SettingsMenu
|
||||
dialog.dismiss();
|
||||
Globals.LeftClickMethod = item;
|
||||
if( item == Mouse.LEFT_CLICK_WITH_KEY )
|
||||
p.keyListener = new KeyRemapToolMouseClick(p, true);
|
||||
p.getVideoLayout().setOnKeyListener(new KeyRemapToolMouseClick(p, true));
|
||||
else if( item == Mouse.LEFT_CLICK_WITH_TIMEOUT || item == Mouse.LEFT_CLICK_WITH_TAP_OR_TIMEOUT )
|
||||
showLeftClickTimeoutConfig(p);
|
||||
else
|
||||
@@ -343,7 +343,7 @@ class SettingsMenuMouse extends SettingsMenu
|
||||
Globals.RightClickMethod = item;
|
||||
dialog.dismiss();
|
||||
if( item == Mouse.RIGHT_CLICK_WITH_KEY )
|
||||
p.keyListener = new KeyRemapToolMouseClick(p, false);
|
||||
p.getVideoLayout().setOnKeyListener(new KeyRemapToolMouseClick(p, false));
|
||||
else if( item == Mouse.RIGHT_CLICK_WITH_TIMEOUT )
|
||||
showRightClickTimeoutConfig(p);
|
||||
else
|
||||
@@ -393,7 +393,7 @@ class SettingsMenuMouse extends SettingsMenu
|
||||
}
|
||||
}
|
||||
|
||||
public static class KeyRemapToolMouseClick implements MainActivity.KeyEventsListener
|
||||
public static class KeyRemapToolMouseClick implements View.OnKeyListener
|
||||
{
|
||||
MainActivity p;
|
||||
boolean leftClick;
|
||||
@@ -404,9 +404,10 @@ class SettingsMenuMouse extends SettingsMenu
|
||||
this.leftClick = leftClick;
|
||||
}
|
||||
|
||||
public void onKeyEvent(final int keyCode)
|
||||
@Override
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event)
|
||||
{
|
||||
p.keyListener = null;
|
||||
p.getVideoLayout().setOnKeyListener(null);
|
||||
int keyIndex = keyCode;
|
||||
if( keyIndex < 0 )
|
||||
keyIndex = 0;
|
||||
@@ -419,6 +420,7 @@ class SettingsMenuMouse extends SettingsMenu
|
||||
Globals.RightClickKey = keyIndex;
|
||||
|
||||
goBack(p);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -686,10 +688,10 @@ class SettingsMenuMouse extends SettingsMenu
|
||||
void run (final MainActivity p)
|
||||
{
|
||||
p.setText(p.getResources().getString(R.string.measurepressure_touchplease));
|
||||
p.touchListener = new TouchMeasurementTool(p);
|
||||
p.getVideoLayout().setOnTouchListener(new TouchMeasurementTool(p));
|
||||
}
|
||||
|
||||
public static class TouchMeasurementTool implements MainActivity.TouchEventsListener
|
||||
public static class TouchMeasurementTool implements View.OnTouchListener
|
||||
{
|
||||
MainActivity p;
|
||||
ArrayList<Integer> force = new ArrayList<Integer>();
|
||||
@@ -701,7 +703,8 @@ class SettingsMenuMouse extends SettingsMenu
|
||||
p = _p;
|
||||
}
|
||||
|
||||
public void onTouchEvent(final MotionEvent ev)
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent ev)
|
||||
{
|
||||
force.add(new Integer((int)(ev.getPressure() * 1000.0)));
|
||||
radius.add(new Integer((int)(ev.getSize() * 1000.0)));
|
||||
@@ -712,12 +715,13 @@ class SettingsMenuMouse extends SettingsMenu
|
||||
|
||||
if( force.size() >= maxEventAmount )
|
||||
{
|
||||
p.touchListener = null;
|
||||
p.getVideoLayout().setOnTouchListener(null);
|
||||
Globals.ClickScreenPressure = getAverageForce();
|
||||
Globals.ClickScreenTouchspotSize = getAverageRadius();
|
||||
Log.i("SDL", "SDL: measured average force " + Globals.ClickScreenPressure + " radius " + Globals.ClickScreenTouchspotSize);
|
||||
goBack(p);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int getAverageForce()
|
||||
@@ -756,11 +760,11 @@ class SettingsMenuMouse extends SettingsMenu
|
||||
Globals.TouchscreenCalibration[2] = 0;
|
||||
Globals.TouchscreenCalibration[3] = 0;
|
||||
ScreenEdgesCalibrationTool tool = new ScreenEdgesCalibrationTool(p);
|
||||
p.touchListener = tool;
|
||||
p.keyListener = tool;
|
||||
p.getVideoLayout().setOnTouchListener(tool);
|
||||
p.getVideoLayout().setOnKeyListener(tool);
|
||||
}
|
||||
|
||||
static class ScreenEdgesCalibrationTool implements MainActivity.TouchEventsListener, MainActivity.KeyEventsListener
|
||||
static class ScreenEdgesCalibrationTool implements View.OnTouchListener, View.OnKeyListener
|
||||
{
|
||||
MainActivity p;
|
||||
ImageView img;
|
||||
@@ -783,7 +787,8 @@ class SettingsMenuMouse extends SettingsMenu
|
||||
p.getVideoLayout().addView(img);
|
||||
}
|
||||
|
||||
public void onTouchEvent(final MotionEvent ev)
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent ev)
|
||||
{
|
||||
if( Globals.TouchscreenCalibration[0] == Globals.TouchscreenCalibration[1] &&
|
||||
Globals.TouchscreenCalibration[1] == Globals.TouchscreenCalibration[2] &&
|
||||
@@ -808,14 +813,17 @@ class SettingsMenuMouse extends SettingsMenu
|
||||
Globals.TouchscreenCalibration[2], Globals.TouchscreenCalibration[3]);
|
||||
m.setRectToRect(src, dst, Matrix.ScaleToFit.FILL);
|
||||
img.setImageMatrix(m);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onKeyEvent(final int keyCode)
|
||||
@Override
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event)
|
||||
{
|
||||
p.touchListener = null;
|
||||
p.keyListener = null;
|
||||
p.getVideoLayout().setOnTouchListener(null);
|
||||
p.getVideoLayout().setOnKeyListener(null);
|
||||
p.getVideoLayout().removeView(img);
|
||||
goBack(p);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ import android.view.Display;
|
||||
import android.net.Uri;
|
||||
import android.Manifest;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.hardware.input.InputManager;
|
||||
|
||||
|
||||
class Mouse
|
||||
@@ -107,6 +108,10 @@ abstract class DifferentTouchInput
|
||||
public abstract void processGenericEvent(final MotionEvent event);
|
||||
|
||||
public static int ExternalMouseDetected = Mouse.MOUSE_HW_INPUT_FINGER;
|
||||
public static int buttonState = 0;
|
||||
|
||||
public static float capturedMouseX = 0;
|
||||
public static float capturedMouseY = 0;
|
||||
|
||||
public static DifferentTouchInput touchInput = getInstance();
|
||||
|
||||
@@ -318,6 +323,12 @@ abstract class DifferentTouchInput
|
||||
int hwMouseEvent = ((event.getSource() & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE || Globals.ForceHardwareMouse) ? Mouse.MOUSE_HW_INPUT_MOUSE :
|
||||
((event.getSource() & InputDevice.SOURCE_STYLUS) == InputDevice.SOURCE_STYLUS) ? Mouse.MOUSE_HW_INPUT_STYLUS :
|
||||
Mouse.MOUSE_HW_INPUT_FINGER;
|
||||
if( android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O )
|
||||
{
|
||||
if( (event.getSource() & InputDevice.SOURCE_MOUSE_RELATIVE) == InputDevice.SOURCE_MOUSE_RELATIVE )
|
||||
hwMouseEvent = Mouse.MOUSE_HW_INPUT_MOUSE;
|
||||
}
|
||||
|
||||
if( ExternalMouseDetected != hwMouseEvent )
|
||||
{
|
||||
ExternalMouseDetected = hwMouseEvent;
|
||||
@@ -361,12 +372,10 @@ abstract class DifferentTouchInput
|
||||
}
|
||||
private static class IcsTouchInput extends GingerbreadTouchInput
|
||||
{
|
||||
float hatX = 0.0f, hatY = 0.0f;
|
||||
private static class Holder
|
||||
{
|
||||
private static final IcsTouchInput sInstance = new IcsTouchInput();
|
||||
}
|
||||
private int buttonState = 0;
|
||||
public void process(final MotionEvent event)
|
||||
{
|
||||
//Log.i("SDL", "Got motion event, type " + (int)(event.getAction()) + " X " + (int)event.getX() + " Y " + (int)event.getY() + " buttons " + buttonState + " source " + event.getSource());
|
||||
@@ -388,37 +397,16 @@ abstract class DifferentTouchInput
|
||||
}
|
||||
public void processGenericEvent(final MotionEvent event)
|
||||
{
|
||||
// Joysticks are supported since Honeycomb, but I don't care about it, because very little devices have it
|
||||
// Joysticks are supported since Honeycomb, but I don't care about it, because very few devices have it
|
||||
if( (event.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) == InputDevice.SOURCE_CLASS_JOYSTICK )
|
||||
{
|
||||
// event.getAxisValue(AXIS_HAT_X) and event.getAxisValue(AXIS_HAT_Y) are joystick arrow keys, on Nvidia Shield and some other joysticks
|
||||
if( event.getAxisValue(MotionEvent.AXIS_HAT_X) != hatX )
|
||||
{
|
||||
hatX = event.getAxisValue(MotionEvent.AXIS_HAT_X);
|
||||
if( hatX == 0.0f )
|
||||
{
|
||||
DemoGLSurfaceView.nativeKey(KeyEvent.KEYCODE_DPAD_LEFT, 0, 0);
|
||||
DemoGLSurfaceView.nativeKey(KeyEvent.KEYCODE_DPAD_RIGHT, 0, 0);
|
||||
}
|
||||
else
|
||||
DemoGLSurfaceView.nativeKey(hatX < 0.0f ? KeyEvent.KEYCODE_DPAD_LEFT : KeyEvent.KEYCODE_DPAD_RIGHT, 1, 0);
|
||||
}
|
||||
if( event.getAxisValue(MotionEvent.AXIS_HAT_Y) != hatY )
|
||||
{
|
||||
hatY = event.getAxisValue(MotionEvent.AXIS_HAT_Y);
|
||||
if( hatY == 0.0f )
|
||||
{
|
||||
DemoGLSurfaceView.nativeKey(KeyEvent.KEYCODE_DPAD_UP, 0, 0);
|
||||
DemoGLSurfaceView.nativeKey(KeyEvent.KEYCODE_DPAD_DOWN, 0, 0);
|
||||
}
|
||||
else
|
||||
DemoGLSurfaceView.nativeKey(hatY < 0.0f ? KeyEvent.KEYCODE_DPAD_UP : KeyEvent.KEYCODE_DPAD_DOWN, 1, 0);
|
||||
}
|
||||
DemoGLSurfaceView.nativeGamepadAnalogJoystickInput(
|
||||
event.getAxisValue(MotionEvent.AXIS_X), event.getAxisValue(MotionEvent.AXIS_Y),
|
||||
event.getAxisValue(MotionEvent.AXIS_Z), event.getAxisValue(MotionEvent.AXIS_RZ),
|
||||
event.getAxisValue(MotionEvent.AXIS_LTRIGGER), event.getAxisValue(MotionEvent.AXIS_RTRIGGER),
|
||||
(hatX == 0.0f && hatY == 0.0f) ? 0 : 1 );
|
||||
event.getAxisValue(MotionEvent.AXIS_LTRIGGER), event.getAxisValue(MotionEvent.AXIS_RTRIGGER),
|
||||
event.getAxisValue(MotionEvent.AXIS_HAT_X), event.getAxisValue(MotionEvent.AXIS_HAT_Y),
|
||||
processGamepadDeviceId(event.getDevice()) );
|
||||
return;
|
||||
}
|
||||
// Process mousewheel
|
||||
@@ -573,6 +561,78 @@ abstract class DifferentTouchInput
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int gamepadIds[] = new int[4]; // Maximum 4 gamepads at the moment
|
||||
|
||||
public static int processGamepadDeviceId(InputDevice device)
|
||||
{
|
||||
if( device == null )
|
||||
return 0;
|
||||
int source = device.getSources();
|
||||
if( (source & InputDevice.SOURCE_CLASS_JOYSTICK) != InputDevice.SOURCE_CLASS_JOYSTICK &&
|
||||
(source & InputDevice.SOURCE_GAMEPAD) != InputDevice.SOURCE_GAMEPAD )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int deviceId = device.getId();
|
||||
for( int i = 0; i < gamepadIds.length; i++ )
|
||||
{
|
||||
if (gamepadIds[i] == deviceId)
|
||||
return i + 1;
|
||||
}
|
||||
for( int i = 0; i < gamepadIds.length; i++ )
|
||||
{
|
||||
if (gamepadIds[i] == 0)
|
||||
{
|
||||
Log.i("SDL", "libSDL: gamepad added: deviceId " + deviceId + " gamepadId " + (i + 1));
|
||||
gamepadIds[i] = deviceId;
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void registerInputManagerCallbacks(Context context)
|
||||
{
|
||||
if( android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN )
|
||||
{
|
||||
JellyBeanInputManager.Holder.sInstance.register(context);
|
||||
}
|
||||
}
|
||||
|
||||
private static class JellyBeanInputManager
|
||||
{
|
||||
private static class Holder
|
||||
{
|
||||
private static final JellyBeanInputManager sInstance = new JellyBeanInputManager();
|
||||
}
|
||||
private static class Listener implements InputManager.InputDeviceListener
|
||||
{
|
||||
public void onInputDeviceAdded(int deviceId)
|
||||
{
|
||||
}
|
||||
public void onInputDeviceChanged(int deviceId)
|
||||
{
|
||||
onInputDeviceRemoved(deviceId);
|
||||
}
|
||||
public void onInputDeviceRemoved(int deviceId)
|
||||
{
|
||||
for( int i = 0; i < gamepadIds.length; i++ )
|
||||
{
|
||||
if (gamepadIds[i] == deviceId)
|
||||
{
|
||||
Log.i("SDL", "libSDL: gamepad removed: deviceId " + deviceId + " gamepadId "+ (i + 1));
|
||||
gamepadIds[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void register(Context context)
|
||||
{
|
||||
InputManager manager = (InputManager) context.getSystemService(Context.INPUT_SERVICE);
|
||||
manager.registerInputDeviceListener(new Listener(), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class DemoRenderer extends GLSurfaceView_SDL.Renderer
|
||||
@@ -613,6 +673,9 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer
|
||||
mHeight = h - h % 2;
|
||||
mGl = gl;
|
||||
nativeResize(mWidth, mHeight, Globals.KeepAspectRatio ? 1 : 0);
|
||||
if( Globals.TouchscreenCalibration[2] > Globals.TouchscreenCalibration[0] )
|
||||
Settings.nativeSetTouchscreenCalibration(Globals.TouchscreenCalibration[0], Globals.TouchscreenCalibration[1],
|
||||
Globals.TouchscreenCalibration[2], Globals.TouchscreenCalibration[3]);
|
||||
}
|
||||
|
||||
int mLastPendingResize = 0;
|
||||
@@ -644,30 +707,8 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer
|
||||
if (mWidth != 0 && mHeight != 0 && (mWidth != ww || mHeight != hh))
|
||||
{
|
||||
Log.i("SDL", "libSDL: DemoRenderer.onWindowResize(): screen size changed from " + mWidth + "x" + mHeight + " to " + ww + "x" + hh);
|
||||
if (Globals.SwVideoMode &&
|
||||
(Math.abs(display.getWidth() - ww) > display.getWidth() / 10 ||
|
||||
Math.abs(display.getHeight() - hh) > display.getHeight() / 10))
|
||||
{
|
||||
Log.i("SDL", "Multiwindow detected - enabling screen orientation autodetection");
|
||||
Globals.AutoDetectOrientation = true;
|
||||
context.setScreenOrientation();
|
||||
DemoRenderer.super.ResetVideoSurface();
|
||||
DemoRenderer.super.onWindowResize(ww, hh);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.i("SDL", "System button bar hidden - re-init video to avoid black bar at the top");
|
||||
DemoRenderer.super.ResetVideoSurface();
|
||||
DemoRenderer.super.onWindowResize(ww, hh);
|
||||
}
|
||||
}
|
||||
if (mWidth == 0 && mHeight == 0)
|
||||
{
|
||||
if ((ww > hh) != (display.getWidth() > display.getHeight()))
|
||||
{
|
||||
Log.i("SDL", "Multiwindow detected - app window size " + ww + "x" + hh + " but display dimensions are " + display.getWidth() + "x" + display.getHeight());
|
||||
Globals.AutoDetectOrientation = true;
|
||||
}
|
||||
DemoRenderer.super.ResetVideoSurface();
|
||||
DemoRenderer.super.onWindowResize(ww, hh);
|
||||
}
|
||||
if (Globals.AutoDetectOrientation && (ww > hh) != (mWidth > mHeight))
|
||||
Globals.HorizontalOrientation = (ww > hh);
|
||||
@@ -710,9 +751,16 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer
|
||||
// Tweak video thread priority, if user selected big audio buffer
|
||||
if( Globals.AudioBufferConfig >= 2 )
|
||||
Thread.currentThread().setPriority( (Thread.NORM_PRIORITY + Thread.MIN_PRIORITY) / 2 ); // Lower than normal
|
||||
// Calls main() and never returns, hehe - we'll call eglSwapBuffers() from native code
|
||||
// Calls main() and never returns, hehe - we'll call eglSwapBuffers() from native code
|
||||
String commandline = Globals.CommandLine;
|
||||
if( context.getIntent() != null && context.getIntent().getScheme() != null &&
|
||||
context.getIntent().getScheme().compareTo(android.content.ContentResolver.SCHEME_FILE) == 0 &&
|
||||
context.getIntent().getData() != null && context.getIntent().getData().getPath() != null )
|
||||
{
|
||||
commandline += " " + context.getIntent().getData().getPath();
|
||||
}
|
||||
nativeInit( Globals.DataDir,
|
||||
Globals.CommandLine,
|
||||
commandline,
|
||||
( (Globals.SwVideoMode && Globals.MultiThreadedVideo) || Globals.CompatibilityHacksVideo ) ? 1 : 0,
|
||||
0 );
|
||||
System.exit(0); // The main() returns here - I don't bother with deinit stuff, just terminate process
|
||||
@@ -722,13 +770,6 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer
|
||||
{
|
||||
if( ! super.SwapBuffers() && Globals.NonBlockingSwapBuffers )
|
||||
{
|
||||
if(mRatelimitTouchEvents)
|
||||
{
|
||||
synchronized(this)
|
||||
{
|
||||
this.notify();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -739,13 +780,6 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer
|
||||
}
|
||||
|
||||
// Unblock event processing thread only after we've finished rendering
|
||||
if(mRatelimitTouchEvents)
|
||||
{
|
||||
synchronized(this)
|
||||
{
|
||||
this.notify();
|
||||
}
|
||||
}
|
||||
if( context.isScreenKeyboardShown() && !context.keyboardWithoutTextInputShown )
|
||||
{
|
||||
try {
|
||||
@@ -836,6 +870,12 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer
|
||||
Clipboard.get().set(context, s);
|
||||
}
|
||||
|
||||
public void setCapturedMousePosition(int x, int y) // Called from native code
|
||||
{
|
||||
DifferentTouchInput.capturedMouseX = x;
|
||||
DifferentTouchInput.capturedMouseY = y;
|
||||
}
|
||||
|
||||
public void exitApp()
|
||||
{
|
||||
nativeDone();
|
||||
@@ -936,6 +976,11 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer
|
||||
}
|
||||
}
|
||||
|
||||
public void setSystemMousePointerVisible(int visible)
|
||||
{
|
||||
context.setSystemMousePointerVisible(visible);
|
||||
}
|
||||
|
||||
public void restartMyself(String restartParams)
|
||||
{
|
||||
Intent intent = new Intent(context, RestartMainActivity.class);
|
||||
@@ -959,7 +1004,7 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer
|
||||
|
||||
private native void nativeInitJavaCallbacks();
|
||||
private native void nativeInit(String CurrentPath, String CommandLine, int multiThreadedVideo, int unused);
|
||||
private native void nativeResize(int w, int h, int keepAspectRatio);
|
||||
public static native void nativeResize(int w, int h, int keepAspectRatio);
|
||||
private native void nativeDone();
|
||||
private native void nativeGlContextLost();
|
||||
public native void nativeGlContextRecreated();
|
||||
@@ -983,32 +1028,117 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer
|
||||
public int mWidth = 0;
|
||||
public int mHeight = 0;
|
||||
int mOrientationFrameHackyCounter = 0;
|
||||
|
||||
public static final boolean mRatelimitTouchEvents = true; //(Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO);
|
||||
}
|
||||
|
||||
class DemoGLSurfaceView extends GLSurfaceView_SDL {
|
||||
|
||||
public DemoGLSurfaceView(MainActivity context) {
|
||||
super(context);
|
||||
mParent = context;
|
||||
setEGLConfigChooser(Globals.VideoDepthBpp, Globals.NeedDepthBuffer, Globals.NeedStencilBuffer, Globals.NeedGles2, Globals.NeedGles3);
|
||||
mRenderer = new DemoRenderer(context);
|
||||
setRenderer(mRenderer);
|
||||
DifferentTouchInput.registerInputManagerCallbacks(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(final MotionEvent event)
|
||||
public boolean onKeyDown(int keyCode, final KeyEvent event)
|
||||
{
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH)
|
||||
//Log.v("SDL", "DemoGLSurfaceView::onKeyDown(): keyCode " + keyCode + " event.getSource() " + event.getSource());
|
||||
if( keyCode == KeyEvent.KEYCODE_BACK )
|
||||
{
|
||||
boolean mouseInput = false;
|
||||
if( (event.getSource() & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE )
|
||||
mouseInput = true;
|
||||
if( android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O )
|
||||
{
|
||||
if( (event.getSource() & InputDevice.SOURCE_MOUSE_RELATIVE) == InputDevice.SOURCE_MOUSE_RELATIVE )
|
||||
mouseInput = true;
|
||||
}
|
||||
if( mouseInput )
|
||||
{
|
||||
// Stupid Samsung and stupid Acer remaps right mouse button to BACK key
|
||||
nativeMouseButtonsPressed(2, 1);
|
||||
return true;
|
||||
}
|
||||
else if( mParent.keyboardWithoutTextInputShown )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if( nativeKey( keyCode, 1, event.getUnicodeChar(), DifferentTouchInput.processGamepadDeviceId(event.getDevice()) ) == 0 )
|
||||
return super.onKeyDown(keyCode, event);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyUp(int keyCode, final KeyEvent event)
|
||||
{
|
||||
if( keyCode == KeyEvent.KEYCODE_BACK )
|
||||
{
|
||||
boolean mouseInput = false;
|
||||
if( (event.getSource() & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE )
|
||||
mouseInput = true;
|
||||
if( android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O )
|
||||
{
|
||||
if( (event.getSource() & InputDevice.SOURCE_MOUSE_RELATIVE) == InputDevice.SOURCE_MOUSE_RELATIVE )
|
||||
mouseInput = true;
|
||||
}
|
||||
if( mouseInput )
|
||||
{
|
||||
// Stupid Samsung and stupid Acer remaps right mouse button to BACK key
|
||||
nativeMouseButtonsPressed(2, 0);
|
||||
return true;
|
||||
}
|
||||
else if( mParent.keyboardWithoutTextInputShown )
|
||||
{
|
||||
mParent.showScreenKeyboardWithoutTextInputField(0); // Hide keyboard
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if( nativeKey( keyCode, 0, event.getUnicodeChar(), DifferentTouchInput.processGamepadDeviceId(event.getDevice()) ) == 0 )
|
||||
return super.onKeyUp(keyCode, event);
|
||||
|
||||
//if( keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_MENU )
|
||||
// DimSystemStatusBar.get().dim(mParent._videoLayout);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyMultiple(int keyCode, int repeatCount, final KeyEvent event)
|
||||
{
|
||||
if( event.getCharacters() != null )
|
||||
{
|
||||
// Non-English text input
|
||||
for( int i = 0; i < event.getCharacters().length(); i++ )
|
||||
{
|
||||
nativeKey( event.getKeyCode(), 1, event.getCharacters().codePointAt(i), 0 );
|
||||
nativeKey( event.getKeyCode(), 0, event.getCharacters().codePointAt(i), 0 );
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(final MotionEvent event)
|
||||
{
|
||||
if( mParent.keyboardWithoutTextInputShown && mParent._screenKeyboard != null &&
|
||||
mParent._screenKeyboard.getY() <= event.getY() )
|
||||
{
|
||||
event.offsetLocation(-mParent._screenKeyboard.getX(), -mParent._screenKeyboard.getY());
|
||||
mParent._screenKeyboard.onTouchEvent(event);
|
||||
return true;
|
||||
}
|
||||
if( android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH )
|
||||
{
|
||||
if (getX() != 0)
|
||||
event.offsetLocation(-getX(), -getY());
|
||||
}
|
||||
DifferentTouchInput.touchInput.process(event);
|
||||
if( DemoRenderer.mRatelimitTouchEvents )
|
||||
{
|
||||
limitEventRate(event);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -1016,33 +1146,42 @@ class DemoGLSurfaceView extends GLSurfaceView_SDL {
|
||||
public boolean onGenericMotionEvent (final MotionEvent event)
|
||||
{
|
||||
DifferentTouchInput.touchInput.processGenericEvent(event);
|
||||
if( DemoRenderer.mRatelimitTouchEvents )
|
||||
{
|
||||
limitEventRate(event);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void limitEventRate(final MotionEvent event)
|
||||
|
||||
@Override
|
||||
public boolean onCapturedPointerEvent (final MotionEvent event)
|
||||
{
|
||||
// Wait a bit, and try to synchronize to app framerate, or event thread will eat all CPU and we'll lose FPS
|
||||
// With Froyo the rate of touch events seems to be limited by OS, but they are arriving faster then we're redrawing anyway
|
||||
if((event.getAction() == MotionEvent.ACTION_MOVE ||
|
||||
event.getAction() == MotionEvent.ACTION_HOVER_MOVE))
|
||||
{
|
||||
synchronized(mRenderer)
|
||||
{
|
||||
try
|
||||
{
|
||||
mRenderer.wait(300L); // And sometimes the app decides not to render at all, so this timeout should not be big.
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
Log.v("SDL", "DemoGLSurfaceView::limitEventRate(): Who dared to interrupt my slumber?");
|
||||
Thread.interrupted();
|
||||
}
|
||||
}
|
||||
}
|
||||
DifferentTouchInput.capturedMouseX += event.getX();
|
||||
DifferentTouchInput.capturedMouseY += event.getY();
|
||||
if (DifferentTouchInput.capturedMouseX < 0)
|
||||
DifferentTouchInput.capturedMouseX = 0;
|
||||
if (DifferentTouchInput.capturedMouseY < 0)
|
||||
DifferentTouchInput.capturedMouseY = 0;
|
||||
if (DifferentTouchInput.capturedMouseX >= this.getWidth())
|
||||
DifferentTouchInput.capturedMouseX = this.getWidth() - 1;
|
||||
if (DifferentTouchInput.capturedMouseY >= this.getHeight())
|
||||
DifferentTouchInput.capturedMouseY = this.getHeight() - 1;
|
||||
|
||||
//Log.v("SDL", "DemoGLSurfaceView::onCapturedPointerEvent(): X " + DifferentTouchInput.capturedMouseX + " Y " + DifferentTouchInput.capturedMouseY +
|
||||
// " W " + this.getWidth() + " H " + this.getHeight() + " getX " + event.getX() + " getY " + event.getY() +
|
||||
// " RelX " + event.getAxisValue(MotionEvent.AXIS_RELATIVE_X) + " RelY " + event.getAxisValue(MotionEvent.AXIS_RELATIVE_Y) );
|
||||
|
||||
event.setLocation(DifferentTouchInput.capturedMouseX, DifferentTouchInput.capturedMouseY);
|
||||
event.setAction(MotionEvent.ACTION_HOVER_MOVE);
|
||||
|
||||
//Log.v("SDL", "DemoGLSurfaceView::onCapturedPointerEvent(): XY " + event.getX() + " " + event.getY() + " action " + event.getAction());
|
||||
|
||||
return this.onTouchEvent(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPointerCaptureChange (boolean hasCapture)
|
||||
{
|
||||
Log.v("SDL", "DemoGLSurfaceView::onPointerCaptureChange(): " + hasCapture);
|
||||
super.onPointerCaptureChange(hasCapture);
|
||||
DifferentTouchInput.capturedMouseX = this.getWidth() / 2;
|
||||
DifferentTouchInput.capturedMouseY = this.getHeight() / 2;
|
||||
}
|
||||
|
||||
public void exitApp() {
|
||||
@@ -1076,17 +1215,53 @@ class DemoGLSurfaceView extends GLSurfaceView_SDL {
|
||||
mRenderer.nativeGlContextRecreated();
|
||||
if( mRenderer.accelerometer != null && mRenderer.accelerometer.openedBySDL ) // For some reason it crashes here often - are we getting this event before initialization?
|
||||
mRenderer.accelerometer.start();
|
||||
captureMouse(true);
|
||||
};
|
||||
|
||||
public void captureMouse(boolean capture)
|
||||
{
|
||||
if( capture )
|
||||
{
|
||||
setFocusableInTouchMode(true);
|
||||
setFocusable(true);
|
||||
requestFocus();
|
||||
if( Globals.HideSystemMousePointer && android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O )
|
||||
{
|
||||
postDelayed( new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
Log.v("SDL", "captureMouse::requestPointerCapture() delayed");
|
||||
requestPointerCapture();
|
||||
}
|
||||
}, 50 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( Globals.HideSystemMousePointer && android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O )
|
||||
{
|
||||
postDelayed( new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
Log.v("SDL", "captureMouse::releasePointerCapture()");
|
||||
releasePointerCapture();
|
||||
}
|
||||
}, 50 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DemoRenderer mRenderer;
|
||||
MainActivity mParent;
|
||||
|
||||
public static native void nativeMotionEvent( int x, int y, int action, int pointerId, int pressure, int radius );
|
||||
public static native int nativeKey( int keyCode, int down, int unicode );
|
||||
public static native int nativeKey( int keyCode, int down, int unicode, int gamepadId );
|
||||
public static native void nativeHardwareMouseDetected( int detected );
|
||||
public static native void nativeMouseButtonsPressed( int buttonId, int pressedState );
|
||||
public static native void nativeMouseWheel( int scrollX, int scrollY );
|
||||
public static native void nativeGamepadAnalogJoystickInput( float stick1x, float stick1y, float stick2x, float stick2y, float ltrigger, float rtrigger, int usingHat );
|
||||
public static native void nativeGamepadAnalogJoystickInput( float stick1x, float stick1y, float stick2x, float stick2y, float ltrigger, float rtrigger, float dpadx, float dpady, int gamepadId );
|
||||
public static native void nativeScreenVisibleRect( int x, int y, int w, int h );
|
||||
public static native void nativeScreenKeyboardShown( int shown );
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ public class CloudSave implements GameHelper.GameHelperListener {
|
||||
|
||||
// The game helper object. This class is mainly a wrapper around this object.
|
||||
protected GameHelper mHelper;
|
||||
public int REQUEST_CLOUD_SAVE_ID = 38;
|
||||
|
||||
MainActivity parent;
|
||||
|
||||
@@ -72,6 +73,8 @@ public class CloudSave implements GameHelper.GameHelperListener {
|
||||
boolean createNewSave = false;
|
||||
public void onActivityResult(int request, int response, Intent intent)
|
||||
{
|
||||
if (request != REQUEST_CLOUD_SAVE_ID)
|
||||
return;
|
||||
Log.d("SDL", "CloudSave: onActivityResult() response " + response + " intent " + (intent != null));
|
||||
try
|
||||
{
|
||||
@@ -119,7 +122,7 @@ public class CloudSave implements GameHelper.GameHelperListener {
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
parent.startActivityForResult(snapshotIntent, 0);
|
||||
parent.startActivityForResult(snapshotIntent, REQUEST_CLOUD_SAVE_ID);
|
||||
}
|
||||
});
|
||||
semaphore.acquireUninterruptibly();
|
||||
@@ -192,7 +195,7 @@ public class CloudSave implements GameHelper.GameHelperListener {
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
parent.startActivityForResult(snapshotIntent, 0);
|
||||
parent.startActivityForResult(snapshotIntent, REQUEST_CLOUD_SAVE_ID);
|
||||
}
|
||||
});
|
||||
semaphore.acquireUninterruptibly();
|
||||
@@ -361,10 +364,6 @@ public class CloudSave implements GameHelper.GameHelperListener {
|
||||
mHelper.enableDebugLog(enabled);
|
||||
}
|
||||
|
||||
public String getInvitationId() {
|
||||
return mHelper.getInvitationId();
|
||||
}
|
||||
|
||||
public void reconnectClient() {
|
||||
mHelper.reconnectClient();
|
||||
}
|
||||
|
||||
@@ -37,12 +37,6 @@ import com.google.android.gms.drive.Drive;
|
||||
import com.google.android.gms.games.Games;
|
||||
import com.google.android.gms.games.Games.GamesOptions;
|
||||
import com.google.android.gms.games.GamesActivityResultCodes;
|
||||
import com.google.android.gms.games.multiplayer.Invitation;
|
||||
import com.google.android.gms.games.multiplayer.Multiplayer;
|
||||
import com.google.android.gms.games.multiplayer.turnbased.TurnBasedMatch;
|
||||
import com.google.android.gms.games.request.GameRequest;
|
||||
//import com.google.android.gms.plus.Plus;
|
||||
//import com.google.android.gms.plus.Plus.PlusOptions;
|
||||
|
||||
public class GameHelper implements GoogleApiClient.ConnectionCallbacks,
|
||||
GoogleApiClient.OnConnectionFailedListener {
|
||||
@@ -121,11 +115,9 @@ public class GameHelper implements GoogleApiClient.ConnectionCallbacks,
|
||||
// Client request flags
|
||||
public final static int CLIENT_NONE = 0x00;
|
||||
public final static int CLIENT_GAMES = 0x01;
|
||||
//public final static int CLIENT_PLUS = 0x02;
|
||||
public final static int CLIENT_APPSTATE = 0x04;
|
||||
public final static int CLIENT_SNAPSHOT = 0x05;
|
||||
public final static int CLIENT_ALL = CLIENT_GAMES //| CLIENT_PLUS
|
||||
| CLIENT_APPSTATE | CLIENT_SNAPSHOT;
|
||||
public final static int CLIENT_ALL = CLIENT_GAMES | CLIENT_APPSTATE | CLIENT_SNAPSHOT;
|
||||
|
||||
// What clients were requested? (bit flags)
|
||||
int mRequestedClients = CLIENT_NONE;
|
||||
@@ -157,24 +149,6 @@ public class GameHelper implements GoogleApiClient.ConnectionCallbacks,
|
||||
|
||||
Handler mHandler;
|
||||
|
||||
/*
|
||||
* If we got an invitation when we connected to the games client, it's here.
|
||||
* Otherwise, it's null.
|
||||
*/
|
||||
Invitation mInvitation;
|
||||
|
||||
/*
|
||||
* If we got turn-based match when we connected to the games client, it's
|
||||
* here. Otherwise, it's null.
|
||||
*/
|
||||
TurnBasedMatch mTurnBasedMatch;
|
||||
|
||||
/*
|
||||
* If we have incoming requests when we connected to the games client, they
|
||||
* are here. Otherwise, it's null.
|
||||
*/
|
||||
ArrayList<GameRequest> mRequests;
|
||||
|
||||
// Listener
|
||||
GameHelperListener mListener = null;
|
||||
|
||||
@@ -414,101 +388,6 @@ public class GameHelper implements GoogleApiClient.ConnectionCallbacks,
|
||||
mActivity = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the invitation ID received through an invitation notification.
|
||||
* This should be called from your GameHelperListener's
|
||||
*
|
||||
* @link{GameHelperListener#onSignInSucceeded method, to check if there's an
|
||||
* invitation available. In that
|
||||
* case, accept the invitation.
|
||||
* @return The id of the invitation, or null if none was received.
|
||||
*/
|
||||
public String getInvitationId() {
|
||||
if (!mGoogleApiClient.isConnected()) {
|
||||
Log.w(TAG,
|
||||
"Warning: getInvitationId() should only be called when signed in, "
|
||||
+ "that is, after getting onSignInSuceeded()");
|
||||
}
|
||||
return mInvitation == null ? null : mInvitation.getInvitationId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the invitation received through an invitation notification. This
|
||||
* should be called from your GameHelperListener's
|
||||
*
|
||||
* @link{GameHelperListener#onSignInSucceeded method, to check if there's an
|
||||
* invitation available. In that
|
||||
* case, accept the invitation.
|
||||
* @return The invitation, or null if none was received.
|
||||
*/
|
||||
public Invitation getInvitation() {
|
||||
if (!mGoogleApiClient.isConnected()) {
|
||||
Log.w(TAG,
|
||||
"Warning: getInvitation() should only be called when signed in, "
|
||||
+ "that is, after getting onSignInSuceeded()");
|
||||
}
|
||||
return mInvitation;
|
||||
}
|
||||
|
||||
public boolean hasInvitation() {
|
||||
return mInvitation != null;
|
||||
}
|
||||
|
||||
public boolean hasTurnBasedMatch() {
|
||||
return mTurnBasedMatch != null;
|
||||
}
|
||||
|
||||
public boolean hasRequests() {
|
||||
return mRequests != null;
|
||||
}
|
||||
|
||||
public void clearInvitation() {
|
||||
mInvitation = null;
|
||||
}
|
||||
|
||||
public void clearTurnBasedMatch() {
|
||||
mTurnBasedMatch = null;
|
||||
}
|
||||
|
||||
public void clearRequests() {
|
||||
mRequests = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the tbmp match received through an invitation notification. This
|
||||
* should be called from your GameHelperListener's
|
||||
*
|
||||
* @link{GameHelperListener#onSignInSucceeded method, to check if there's a
|
||||
* match available.
|
||||
* @return The match, or null if none was received.
|
||||
*/
|
||||
public TurnBasedMatch getTurnBasedMatch() {
|
||||
if (!mGoogleApiClient.isConnected()) {
|
||||
Log.w(TAG,
|
||||
"Warning: getTurnBasedMatch() should only be called when signed in, "
|
||||
+ "that is, after getting onSignInSuceeded()");
|
||||
}
|
||||
return mTurnBasedMatch;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the requests received through the onConnected bundle. This should
|
||||
* be called from your GameHelperListener's
|
||||
*
|
||||
* @link{GameHelperListener#onSignInSucceeded method, to check if there are
|
||||
* incoming requests that must be
|
||||
* handled.
|
||||
* @return The requests, or null if none were received.
|
||||
*/
|
||||
public ArrayList<GameRequest> getRequests() {
|
||||
if (!mGoogleApiClient.isConnected()) {
|
||||
Log.w(TAG, "Warning: getRequests() should only be called "
|
||||
+ "when signed in, "
|
||||
+ "that is, after getting onSignInSuceeded()");
|
||||
}
|
||||
return mRequests;
|
||||
}
|
||||
|
||||
/** Enables debug logging */
|
||||
public void enableDebugLog(boolean enabled) {
|
||||
mDebugLog = enabled;
|
||||
@@ -686,8 +565,6 @@ public class GameHelper implements GoogleApiClient.ConnectionCallbacks,
|
||||
}
|
||||
debugLog("Starting connection.");
|
||||
mConnecting = true;
|
||||
mInvitation = null;
|
||||
mTurnBasedMatch = null;
|
||||
mGoogleApiClient.connect();
|
||||
}
|
||||
|
||||
@@ -712,27 +589,6 @@ public class GameHelper implements GoogleApiClient.ConnectionCallbacks,
|
||||
|
||||
if (connectionHint != null) {
|
||||
debugLog("onConnected: connection hint provided. Checking for invite.");
|
||||
Invitation inv = connectionHint
|
||||
.getParcelable(Multiplayer.EXTRA_INVITATION);
|
||||
if (inv != null && inv.getInvitationId() != null) {
|
||||
// retrieve and cache the invitation ID
|
||||
debugLog("onConnected: connection hint has a room invite!");
|
||||
mInvitation = inv;
|
||||
debugLog("Invitation ID: " + mInvitation.getInvitationId());
|
||||
}
|
||||
|
||||
// Do we have any requests pending?
|
||||
mRequests = Games.Requests
|
||||
.getGameRequestsFromBundle(connectionHint);
|
||||
if (!mRequests.isEmpty()) {
|
||||
// We have requests in onConnected's connectionHint.
|
||||
debugLog("onConnected: connection hint has " + mRequests.size()
|
||||
+ " request(s)");
|
||||
}
|
||||
|
||||
debugLog("onConnected: connection hint provided. Checking for TBMP game.");
|
||||
mTurnBasedMatch = connectionHint
|
||||
.getParcelable(Multiplayer.EXTRA_TURN_BASED_MATCH);
|
||||
}
|
||||
|
||||
// we're good to go
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<string name="storage_phone">Внутреннее хранение - %d Мб</string>
|
||||
<string name="storage_sd">SD карта - %d Мб</string>
|
||||
<string name="storage_question">Куда сохранять данные приложения</string>
|
||||
<string name="storage_access">Разрешение на запись на SD карту</string>
|
||||
<string name="optional_downloads">Дополнительные загрузки</string>
|
||||
<string name="ok">Продолжить</string>
|
||||
<string name="controls_arrows">Стрелки / джойстик / Dpad</string>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<string name="storage_phone">Внутрішнє зберігання - %d Мб</string>
|
||||
<string name="storage_sd">SD карта - %d Мб</string>
|
||||
<string name="storage_question">Куди зберігати дані програми</string>
|
||||
<string name="storage_access">Дозвіл на запис на SD карту</string>
|
||||
<string name="optional_downloads">Додаткові завантаження</string>
|
||||
<string name="ok">ОК</string>
|
||||
<string name="controls_arrows">Стрілки / джойстік / Dpad</string>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
<string name="init">初始化中</string>
|
||||
<string name="please_wait">正在下载数据,请稍等</string>
|
||||
<string name="please_wait">正在下载数据,请稍候</string>
|
||||
|
||||
<string name="device_config">设备配置</string>
|
||||
<string name="device_change_cfg">更改设备配置</string>
|
||||
@@ -26,7 +26,7 @@
|
||||
<string name="storage_question">数据文件安装位置</string>
|
||||
<string name="optional_downloads">下载</string>
|
||||
<string name="downloads">下载</string>
|
||||
<string name="ok">好</string>
|
||||
<string name="ok">完成</string>
|
||||
<string name="cancel">取消</string>
|
||||
|
||||
<string name="controls_arrows">箭头 / 操纵杆 / 方向键</string>
|
||||
@@ -163,6 +163,7 @@
|
||||
|
||||
<string name="display_size_mouse">鼠标仿真模式</string>
|
||||
<string name="display_size">显示仿真鼠标的大小</string>
|
||||
<string name="display_size_desktop">桌面版,无仿真</string>
|
||||
<string name="display_size_large">大(适用于平板电脑)</string>
|
||||
<string name="display_size_small">小,放大镜</string>
|
||||
<string name="display_size_small_touchpad">小,触摸模式</string>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<resources
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:ignore="MissingTranslation">
|
||||
<string name="app_name">Commander Genius</string>
|
||||
|
||||
|
||||
@@ -24,6 +26,7 @@
|
||||
<string name="storage_custom">Specify directory</string>
|
||||
<string name="storage_commandline">Command line parameters, one argument per line</string>
|
||||
<string name="storage_question">Data installation location</string>
|
||||
<string name="storage_access">Permission to write to SD card</string>
|
||||
<string name="optional_downloads">Downloads</string>
|
||||
<string name="downloads">Downloads</string>
|
||||
<string name="ok">OK</string>
|
||||
|
||||
@@ -7,7 +7,7 @@ endif
|
||||
NDK_VERSION := $(strip $(patsubst android-ndk-%,%,$(filter android-ndk-%, $(subst /, ,$(dir $(TARGET_CC))))))
|
||||
#$(info NDK version $(NDK_VERSION)) # This warning puzzles ndk-gdb
|
||||
ifneq ($(filter r1 r2 r3 r4 r5 r6 r7 r8,$(NDK_VERSION)),)
|
||||
$(error Your NDK $(NDK_VERSION) is too old, please download NDK r4b, r5c or r6 from http://developer.android.com)
|
||||
$(error Your NDK $(NDK_VERSION) is too old, please download NDK from http://developer.android.com)
|
||||
endif
|
||||
|
||||
NDK_PATH := $(shell dirname $(shell which ndk-build))
|
||||
|
||||
@@ -2,6 +2,16 @@ APP_PROJECT_PATH := $(call my-dir)/..
|
||||
|
||||
include jni/Settings.mk
|
||||
|
||||
APP_STL := $(if $(filter clang%, $(NDK_TOOLCHAIN_VERSION)), c++_static, gnustl_static)
|
||||
APP_CFLAGS := -O3 -DNDEBUG -g # arm-linux-androideabi-4.4.3 crashes in -O0 mode on SDL sources
|
||||
ifneq ($(filter c++_shared, $(APP_MODULES)),)
|
||||
APP_STL := c++_shared
|
||||
else
|
||||
APP_STL := none
|
||||
endif
|
||||
APP_CFLAGS := -g
|
||||
ifneq ($(NDK_DEBUG),1)
|
||||
APP_CFLAGS += -Oz -DNDEBUG # -Oz works best with clang
|
||||
endif
|
||||
APP_PIE := true # This feature makes executables incompatible to Android API 15 or lower, but executables without PIE will not run on Android 5.0 and newer
|
||||
SDL_EXCLUDE_LIBGCC := -Wl,--exclude-libs,libgcc.a
|
||||
SDL_EXCLUDE_LIBUNWIND := -Wl,--exclude-libs,libunwind.a
|
||||
APP_LDFLAGS = $(if $(filter clang%, $(NDK_TOOLCHAIN_VERSION)), $(SDL_EXCLUDE_LIBGCC) $(if $(filter armeabi%, $(APP_ABI)), $(SDL_EXCLUDE_LIBUNWIND)))
|
||||
|
||||
@@ -1,39 +1,100 @@
|
||||
# Makefile to build precompiled libraries, which cannot be built using standard NDK makefiles
|
||||
# TODO: libboost, libffmpeg, libpython (used only in GemRB)
|
||||
|
||||
ARCHES32 := armeabi armeabi-v7a x86 mips
|
||||
ARCHES64 := arm64-v8a
|
||||
ARCHES32 := armeabi-v7a x86
|
||||
ARCHES64 := arm64-v8a x86_64
|
||||
|
||||
ICONV := $(foreach ARCH, $(ARCHES32), iconv/lib/$(ARCH)/libiconv.so iconv/lib/$(ARCH)/libcharset.so)
|
||||
ICONV := $(foreach ARCH, $(ARCHES32) $(ARCHES64), iconv/lib/$(ARCH)/libiconv.so iconv/lib/$(ARCH)/libcharset.so)
|
||||
|
||||
ICU_LIBS := data i18n io le lx test tu uc
|
||||
ICU := $(foreach ARCH, $(ARCHES32), $(foreach NAME, $(ICU_LIBS), icuuc/lib/$(ARCH)/libicu$(NAME).a))
|
||||
ICU_LIBS := icudata icui18n icuio icutest icutu icuuc iculx icu-le-hb harfbuzz
|
||||
ICU := $(foreach ARCH, $(ARCHES32) $(ARCHES64), $(foreach NAME, $(ICU_LIBS), icuuc/lib/$(ARCH)/lib$(NAME).a))
|
||||
|
||||
OPENSSL := $(foreach ARCH, $(ARCHES32) $(ARCHES64), openssl/lib-$(ARCH)/libcrypto.so.sdl.1.so openssl/lib-$(ARCH)/libssl.so.sdl.1.so)
|
||||
|
||||
PYTHON3 := $(foreach ARCH, $(ARCHES32) $(ARCHES64), python3/lib-$(ARCH)/libcrypto.so.sdl.1.so python3/lib-$(ARCH)/libssl.so.sdl.1.so)
|
||||
LIBS := $(ICONV) $(ICU) $(OPENSSL)
|
||||
|
||||
LIBS := $(ICONV) $(ICU) $(OPENSSL) $(PYTHON3)
|
||||
.PHONY: all boost openssl icu
|
||||
all: $(LIBS)
|
||||
|
||||
prebuilt-libraries: $(LIBS)
|
||||
openssl: $(OPENSSL)
|
||||
|
||||
.NOTPARALLEL: $(LIBS)
|
||||
icu: $(ICONV) $(ICU)
|
||||
|
||||
$(ICONV) $(ICU):
|
||||
#.NOTPARALLEL: $(LIBS) $(BOOST)
|
||||
|
||||
$(ICONV) $(ICU): iconv/src/build.sh
|
||||
cd iconv/src && \
|
||||
./build.sh && \
|
||||
for ARCH in $(ARCHES32); do \
|
||||
mkdir -p ../lib/$$ARCH ; \
|
||||
for ARCH in $(ARCHES32) $(ARCHES64); do \
|
||||
mkdir -p ../lib/$$ARCH ../include ; \
|
||||
cp -f $$ARCH/libiconv.so $$ARCH/libcharset.so ../lib/$$ARCH/ ; \
|
||||
cp -f $$ARCH/include/*.h ../include/ ; \
|
||||
mkdir -p ../../icuuc/lib/$$ARCH ../../icuuc/include/layout ../../icuuc/include/unicode ; \
|
||||
cp -f $$ARCH/libicu*.a ../../icuuc/lib/$$ARCH/ ; \
|
||||
cp -f $$ARCH/include/layout/*.h ../../icuuc/include/layout/ ; \
|
||||
mkdir -p ../../icuuc/lib/$$ARCH ../../icuuc/include/unicode ../../icuuc/include/layout ; \
|
||||
cp -f $$ARCH/libicu*.a $$ARCH/libharfbuzz.a ../../icuuc/lib/$$ARCH/ ; \
|
||||
cp -f $$ARCH/include/unicode/*.h ../../icuuc/include/unicode/ ; \
|
||||
done
|
||||
cp -f $$ARCH/include/layout/*.h ../../icuuc/include/layout/ ; \
|
||||
cp -f $$ARCH/include/icu-le-hb/layout/*.h ../../icuuc/include/layout/ ; \
|
||||
done && \
|
||||
git clean -f -d -x
|
||||
|
||||
$(OPENSSL):
|
||||
$(OPENSSL): openssl/compile.sh
|
||||
cd openssl && ./compile.sh
|
||||
|
||||
$(PYTHON3):
|
||||
cd python3 && ./compile.sh
|
||||
BOOST_LIBS := \
|
||||
atomic \
|
||||
chrono \
|
||||
container \
|
||||
context \
|
||||
contract \
|
||||
coroutine \
|
||||
date_time \
|
||||
exception \
|
||||
fiber \
|
||||
filesystem \
|
||||
graph \
|
||||
iostreams \
|
||||
locale \
|
||||
log \
|
||||
log_setup \
|
||||
math_c99 \
|
||||
math_c99f \
|
||||
math_c99l \
|
||||
math_tr1 \
|
||||
math_tr1f \
|
||||
math_tr1l \
|
||||
prg_exec_monitor \
|
||||
program_options \
|
||||
random \
|
||||
regex \
|
||||
serialization \
|
||||
stacktrace_basic \
|
||||
stacktrace_noop \
|
||||
system \
|
||||
test_exec_monitor \
|
||||
thread \
|
||||
timer \
|
||||
type_erasure \
|
||||
unit_test_framework \
|
||||
wave \
|
||||
wserialization \
|
||||
|
||||
|
||||
BOOST := $(foreach ARCH, $(ARCHES32) $(ARCHES64), $(foreach NAME, $(BOOST_LIBS), boost/lib/$(ARCH)/libboost_$(NAME).a))
|
||||
|
||||
$(BOOST): boost/src/build-android.sh
|
||||
rm -rf boost/include boost/lib ; \
|
||||
cd boost/src && \
|
||||
./build-android.sh --boost=1.69.0 --with-iconv --arch=$(shell echo $(foreach ARCH, $(ARCHES32) $(ARCHES64),$(ARCH),) | tr -d ' ') && \
|
||||
for ARCH in $(ARCHES32) $(ARCHES64); do \
|
||||
mkdir -p ../lib/$$ARCH ../include ; \
|
||||
$(foreach NAME, $(BOOST_LIBS), cp -f build/out/$$ARCH/lib/libboost_$(NAME)-clang-mt-*.a ../lib/$$ARCH/libboost_$(NAME).a || exit 1 ;) \
|
||||
cp -r -f build/out/$$ARCH/include/boost-*/* ../include/ || exit 1 ; \
|
||||
done || exit 1 ; \
|
||||
git clean -f -d -x ; \
|
||||
$(foreach NAME, $(BOOST_LIBS), ln -sf boost ../../boost_$(NAME) ;)
|
||||
|
||||
boost: $(BOOST)
|
||||
|
||||
iconv/src/build.sh boost/src/build-android.sh:
|
||||
git submodule update --init --recursive
|
||||
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
|
||||
# To filter out static libs from all libs in makefile
|
||||
APP_AVAILABLE_STATIC_LIBS := jpeg png freetype fontconfig xerces ogg vorbis flac boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread boost_locale glu icudata icutest icui18n icuio icule iculx icutu icuuc sdl_savepng android_support gl4es nanogl
|
||||
APP_AVAILABLE_STATIC_LIBS := jpeg png freetype fontconfig xerces ogg vorbis flac \
|
||||
boost_atomic boost_chrono boost_container boost_context boost_coroutine boost_date_time boost_exception boost_filesystem \
|
||||
boost_graph boost_iostreams boost_locale boost_log boost_log_setup boost_prg_exec_monitor boost_program_options boost_random \
|
||||
boost_regex boost_serialization boost_signals boost_stacktrace_basic boost_stacktrace_noop \
|
||||
boost_system boost_test_exec_monitor boost_thread boost_timer boost_type_erasure boost_unit_test_framework boost_wave boost_wserialization \
|
||||
glu icudata icutest icui18n icuio icule iculx icutu icuuc icu-le-hb harfbuzz sdl_savepng android_support \
|
||||
gl4es nanogl gd guichan
|
||||
|
||||
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2
|
||||
APP_MODULES := application sdl-1.2 sdl_main sdl_native_helpers jpeg png ogg flac vorbis freetype tremor ogg
|
||||
|
||||
ifeq ($(APP_ABI),)
|
||||
APP_ABI := armeabi
|
||||
APP_ABI := armeabi-v7a
|
||||
endif
|
||||
|
||||
# The namespace in Java file, with dots replaced with underscores
|
||||
@@ -54,11 +60,6 @@ SDL_ADDITIONAL_CFLAGS := -DSDL_ANDROID_KEYCODE_MOUSE=UNKNOWN -DSDL_ANDROID_KEYCO
|
||||
|
||||
SDL_VERSION := 1.2
|
||||
|
||||
# Link-time optimization enabled for optimization junkies. -O999 etc
|
||||
#APP_CFLAGS := -flto
|
||||
#APP_CXXFLAGS := -flto
|
||||
#APP_LDFLAGS := -flto
|
||||
# Latest GCC got better LTO support
|
||||
NDK_TOOLCHAIN_VERSION := clang
|
||||
|
||||
APP_PLATFORM := android-18
|
||||
APP_PLATFORM := android-16
|
||||
|
||||
@@ -49,9 +49,7 @@ LOCAL_SHARED_LIBRARIES := sdl-$(SDL_VERSION) $(filter-out $(APP_AVAILABLE_STATIC
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := $(filter $(APP_AVAILABLE_STATIC_LIBS), $(COMPILED_LIBRARIES))
|
||||
|
||||
APP_STL := gnustl_static
|
||||
|
||||
LOCAL_LDLIBS := $(APPLICATION_GLES_LIBRARY) -ldl -llog -lz # -lgnustl_static
|
||||
LOCAL_LDLIBS := $(APPLICATION_GLES_LIBRARY) -ldl -llog -lz
|
||||
|
||||
LOCAL_LDFLAGS := -Lobj/local/$(TARGET_ARCH_ABI)
|
||||
|
||||
@@ -67,6 +65,7 @@ SDL_APP_LIB_DEPENDS-$(TARGET_ARCH_ABI) += $(foreach LIB, $(LOCAL_STATIC_LIBRARIE
|
||||
obj/local/$(TARGET_ARCH_ABI)/libcrypto.so: obj/local/$(TARGET_ARCH_ABI)/libcrypto.so.sdl.0.so
|
||||
obj/local/$(TARGET_ARCH_ABI)/libssl.so: obj/local/$(TARGET_ARCH_ABI)/libssl.so.sdl.0.so
|
||||
obj/local/$(TARGET_ARCH_ABI)/libcurl.so: obj/local/$(TARGET_ARCH_ABI)/libcurl-sdl.so
|
||||
obj/local/$(TARGET_ARCH_ABI)/libexpat.so: obj/local/$(TARGET_ARCH_ABI)/libexpat-sdl.so
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
@@ -87,31 +86,12 @@ LOCAL_PATH_SDL_APPLICATION := $(LOCAL_PATH)
|
||||
|
||||
$(shell cd $(LOCAL_PATH_SDL_APPLICATION)/src && $(PARALLEL_UNLOCK))
|
||||
|
||||
obj/local/armeabi/libapplication.so: $(LOCAL_PATH)/src/libapplication-armeabi.so
|
||||
|
||||
$(LOCAL_PATH)/src/libapplication-armeabi.so: $(SDL_APP_LIB_DEPENDS-armeabi) OVERRIDE_CUSTOM_LIB
|
||||
cd $(LOCAL_PATH_SDL_APPLICATION)/src && $(PARALLEL_LOCK) && \
|
||||
./AndroidBuild.sh armeabi arm-linux-androideabi && $(PARALLEL_UNLOCK) && \
|
||||
{ [ -e libapplication.so ] && ln -s libapplication.so libapplication-armeabi.so || true ; }
|
||||
|
||||
obj/local/armeabi-v7a/libapplication.so: $(LOCAL_PATH)/src/libapplication-armeabi-v7a.so
|
||||
|
||||
$(LOCAL_PATH)/src/libapplication-armeabi-v7a.so: $(SDL_APP_LIB_DEPENDS-armeabi-v7a) OVERRIDE_CUSTOM_LIB
|
||||
cd $(LOCAL_PATH_SDL_APPLICATION)/src && $(PARALLEL_LOCK) && \
|
||||
./AndroidBuild.sh armeabi-v7a arm-linux-androideabi && $(PARALLEL_UNLOCK)
|
||||
|
||||
obj/local/armeabi-v7a-hard/libapplication.so: $(LOCAL_PATH)/src/libapplication-armeabi-v7a-hard.so
|
||||
|
||||
$(LOCAL_PATH)/src/libapplication-armeabi-v7a-hard.so: $(SDL_APP_LIB_DEPENDS-armeabi-v7a-hard) OVERRIDE_CUSTOM_LIB
|
||||
cd $(LOCAL_PATH_SDL_APPLICATION)/src && $(PARALLEL_LOCK) && \
|
||||
./AndroidBuild.sh armeabi-v7a-hard arm-linux-androideabi && $(PARALLEL_UNLOCK)
|
||||
|
||||
obj/local/mips/libapplication.so: $(LOCAL_PATH)/src/libapplication-mips.so
|
||||
|
||||
$(LOCAL_PATH)/src/libapplication-mips.so: $(SDL_APP_LIB_DEPENDS-mips) OVERRIDE_CUSTOM_LIB
|
||||
cd $(LOCAL_PATH_SDL_APPLICATION)/src && $(PARALLEL_LOCK) && \
|
||||
./AndroidBuild.sh mips mipsel-linux-android && $(PARALLEL_UNLOCK)
|
||||
|
||||
obj/local/x86/libapplication.so: $(LOCAL_PATH)/src/libapplication-x86.so
|
||||
|
||||
$(LOCAL_PATH)/src/libapplication-x86.so: $(SDL_APP_LIB_DEPENDS-x86) OVERRIDE_CUSTOM_LIB
|
||||
|
||||
@@ -13,11 +13,13 @@ AppVersionCode=101
|
||||
AppVersionName="1.01"
|
||||
|
||||
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
|
||||
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
|
||||
# If you'll start Description with '!' symbol it will be enabled by default, '!!' will also hide the entry from the menu, so it cannot be disabled
|
||||
# If the URL in in the form ':dir/file.dat:http://URL/' it will be downloaded as binary BLOB to the application dir and not unzipped
|
||||
# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -
|
||||
# these files are put inside .apk package by build system
|
||||
# You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version, first associated with the file
|
||||
# If the URL does not contain 'http://' or 'https://', it is treated as file from 'project/jni/application/src/AndroidData' dir -
|
||||
# these files are put inside .apk package by the build system
|
||||
# You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version for obb file
|
||||
# You can use .zip.xz archives for better compression, but you need to add 'lzma' to CompiledLibraries
|
||||
# Generate .zip.xz files like this: zip -0 -r data.zip your-data/* ; xz -8 data.zip
|
||||
AppDataDownloadUrl="!!Game data is 1 Mb|ballfield3.zip"
|
||||
|
||||
# Reset SDL config when updating application to the new version (y) / (n)
|
||||
@@ -46,12 +48,16 @@ NeedDepthBuffer=n
|
||||
# Enable OpenGL stencil buffer (needed only for 3-d applications, small speed decrease) (y) or (n)
|
||||
NeedStencilBuffer=n
|
||||
|
||||
# Try to use GLES 2.x context - will revert to GLES 1.X if unsupported by device
|
||||
# Use GLES 2.x context
|
||||
# you need this option only if you're developing 3-d app (y) or (n)
|
||||
NeedGles2=n
|
||||
|
||||
# Use glshim library for provide OpenGL 1.x functionality to OpenGL ES accelerated cards (y) or (n)
|
||||
UseGlshim=
|
||||
# Use GLES 3.x context
|
||||
# you need this option only if you're developing 3-d app (y) or (n)
|
||||
NeedGles3=n
|
||||
|
||||
# Use gl4es library for provide OpenGL 1.x functionality to OpenGL ES accelerated cards (y) or (n)
|
||||
UseGl4es=
|
||||
|
||||
# Application uses software video buffer - you're calling SDL_SetVideoMode() without SDL_HWSURFACE and without SDL_OPENGL,
|
||||
# this will allow small speed optimization. Enable this even when you're using SDL_HWSURFACE. (y) or (n)
|
||||
@@ -64,10 +70,10 @@ SdlVideoResize=y
|
||||
SdlVideoResizeKeepAspect=n
|
||||
|
||||
# Do not allow device to sleep when the application is in foreground, set this for video players or apps which use accelerometer
|
||||
InhibitSuspend=n
|
||||
InhibitSuspend=y
|
||||
|
||||
# Create Android service, so the app is less likely to be killed while in background
|
||||
CreateService=y
|
||||
CreateService=n
|
||||
|
||||
# Application does not call SDL_Flip() or SDL_UpdateRects() appropriately, or draws from non-main thread -
|
||||
# enabling the compatibility mode will force screen update every 100 milliseconds, which is laggy and inefficient (y) or (n)
|
||||
@@ -75,7 +81,7 @@ CompatibilityHacksForceScreenUpdate=n
|
||||
|
||||
# Application does not call SDL_Flip() or SDL_UpdateRects() after mouse click (ScummVM and all Amiga emulators do that) -
|
||||
# force screen update by moving mouse cursor a little after each click (y) or (n)
|
||||
CompatibilityHacksForceScreenUpdateMouseClick=y
|
||||
CompatibilityHacksForceScreenUpdateMouseClick=n
|
||||
|
||||
# Application initializes SDL audio/video inside static constructors (which is bad, you won't be able to run ndk-gdb) (y)/(n)
|
||||
CompatibilityHacksStaticInit=n
|
||||
@@ -119,13 +125,13 @@ AppNeedsTwoButtonMouse=y
|
||||
|
||||
# Right mouse button can do long-press/drag&drop action, necessary for some games (y) or (n)
|
||||
# If you disable it, swiping with two fingers will send mouse wheel events
|
||||
RightMouseButtonLongPress=
|
||||
RightMouseButtonLongPress=n
|
||||
|
||||
# Show SDL mouse cursor, for applications that do not draw cursor at all (y) or (n)
|
||||
ShowMouseCursor=n
|
||||
|
||||
# Screen follows mouse cursor, when it's covered by soft keyboard, this works only in software video mode (y) or (n)
|
||||
ScreenFollowsMouse=
|
||||
ScreenFollowsMouse=n
|
||||
|
||||
# Generate more touch events, by default SDL generates one event per one video frame, this is useful for drawing apps (y) or (n)
|
||||
GenerateSubframeTouchEvents=n
|
||||
@@ -145,7 +151,7 @@ AppNeedsTextInput=y
|
||||
|
||||
# Application uses joystick (y) or (n), the on-screen DPAD will be used as joystick 0 axes 0-1
|
||||
# This will disable AppNeedsArrowKeys option
|
||||
AppUsesJoystick=n
|
||||
AppUsesJoystick=y
|
||||
|
||||
# Application uses second on-screen joystick, as SDL joystick 0 axes 2-3 (y)/(n)
|
||||
AppUsesSecondJoystick=n
|
||||
@@ -163,7 +169,7 @@ AppUsesGyroscope=y
|
||||
AppUsesOrientationSensor=
|
||||
|
||||
# Use gyroscope to move mouse cursor (y) or (n), it eats battery, and can be disabled in settings, do not use with AppUsesGyroscope setting
|
||||
MoveMouseWithGyroscope=
|
||||
MoveMouseWithGyroscope=n
|
||||
|
||||
# Application uses multitouch (y) or (n), multitouch events are passed as SDL_JOYBALLMOTION events for the joystick 0
|
||||
AppUsesMultitouch=y
|
||||
@@ -173,8 +179,11 @@ AppUsesMultitouch=y
|
||||
# This option will add additional permission to Android manifest (y)/(n)
|
||||
AppRecordsAudio=n
|
||||
|
||||
# Application needs to access SD card. Always disable it, unless you want to access user photos and downloads. (y) / (n)
|
||||
AccessSdCard=y
|
||||
# Application needs read/write access SD card. Always disable it, unless you want to access user photos and downloads. (y) / (n)
|
||||
AccessSdCard=n
|
||||
|
||||
# Application needs to read it's own OBB file. Enable this if you are using Play Store expansion files. (y) / (n)
|
||||
ReadObbFile=
|
||||
|
||||
# Application needs Internet access. If you disable it, you'll have to bundle all your data files inside .apk (y) / (n)
|
||||
AccessInternet=
|
||||
@@ -182,6 +191,9 @@ AccessInternet=
|
||||
# Immersive mode - Android will hide on-screen Home/Back keys. Looks bad if you invoke Android keyboard. (y) / (n)
|
||||
ImmersiveMode=y
|
||||
|
||||
# Hide Android system mouse cursor image when USB mouse is attached (y) or (n) - the app must draw it's own mouse cursor
|
||||
HideSystemMousePointer=
|
||||
|
||||
# Application implements Android-specific routines to put to background, and will not draw anything to screen
|
||||
# between SDL_ACTIVEEVENT lost / gained notifications - you should check for them
|
||||
# rigth after SDL_Flip(), if (n) then SDL_Flip() will block till app in background (y) or (n)
|
||||
@@ -215,24 +227,33 @@ RedefinedKeysScreenKbNames="0 1 2 3 4 5 6 7 8 9"
|
||||
# 7 = SuperNintendo from RetroArch
|
||||
# 8 = DualShock from RetroArch
|
||||
# 9 = Nintendo64 from RetroArch
|
||||
TouchscreenKeysTheme=4
|
||||
TouchscreenKeysTheme=1
|
||||
|
||||
# Redefine gamepad keys to SDL keysyms, button order is:
|
||||
# A B X Y L1 R1 L2 R2 LThumb RThumb
|
||||
RedefinedKeysGamepad="0 1 2 3 4 5 6 7 8 9"
|
||||
# A B X Y L1 R1 L2 R2 LThumb RThumb Start Select Up Down Left Right LThumbUp LThumbDown LThumbLeft LThumbRight RThumbUp RThumbDown RThumbLeft RThumbRight
|
||||
RedefinedKeysGamepad="0 1 2 3 4 5 6 7 8 9 j k UP DOWN LEFT RIGHT PAGEUP PAGEDOWN HOME END PLUS MINUS LEFTBRACKET RIGHTBRACKET"
|
||||
|
||||
# Redefine keys for the second gamepad, same as the first gamepad if not set:
|
||||
RedefinedKeysSecondGamepad="q w e r t y u i o p a s d f g h z x c v b n m COMMA"
|
||||
|
||||
# Redefine keys for the third gamepad, same as the first gamepad if not set:
|
||||
RedefinedKeysThirdGamepad="F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15 PRINT"
|
||||
|
||||
# Redefine keys for the fourth gamepad, same as the first gamepad if not set:
|
||||
RedefinedKeysFourthGamepad="KP0 KP1 KP2 KP3 KP4 KP5 KP6 KP7 KP8 KP9 KP_PERIOD KP_DIVIDE KP_MULTIPLY KP_MINUS KP_PLUS KP_ENTER"
|
||||
|
||||
# How long to show startup menu button, in msec, 0 to disable startup menu
|
||||
StartupMenuButtonTimeout=3000
|
||||
StartupMenuButtonTimeout=1000
|
||||
|
||||
# Menu items to hide from startup menu, available menu items:
|
||||
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.CommandlineConfig SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
|
||||
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.StorageAccessConfig SettingsMenuMisc.CommandlineConfig SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
|
||||
HiddenMenuOptions=''
|
||||
|
||||
# Menu items to show at startup - this is Java code snippet, leave empty for default
|
||||
# new SettingsMenuMisc.ShowReadme(), (AppUsesMouse \&\& \! ForceRelativeMouseMode \? new SettingsMenuMouse.DisplaySizeConfig(true) : new SettingsMenu.DummyMenu()), new SettingsMenuMisc.OptionalDownloadConfig(true), new SettingsMenuMisc.GyroscopeCalibration()
|
||||
# Available menu items:
|
||||
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.CommandlineConfig SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
|
||||
FirstStartMenuOptions='SettingsMenu.DummyMenu'
|
||||
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.StorageAccessConfig SettingsMenuMisc.CommandlineConfig SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
|
||||
FirstStartMenuOptions=''
|
||||
|
||||
# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower
|
||||
AppMinimumRAM=0
|
||||
@@ -240,20 +261,26 @@ AppMinimumRAM=0
|
||||
# GCC version, or 'clang' for CLANG
|
||||
NDK_TOOLCHAIN_VERSION=clang
|
||||
|
||||
# Android platform version.
|
||||
# android-16 = Android 4.1, the earliest supported version in NDK r18.
|
||||
# android-18 = Android 4.3, the first version supporting GLES3.
|
||||
# android-21 = Android 5.1, the first version with SO_REUSEPORT defined.
|
||||
APP_PLATFORM=
|
||||
|
||||
# Specify architectures to compile, 'all' or 'y' to compile for all architectures.
|
||||
# Available architectures: armeabi armeabi-v7a x86 mips arm64-v8a
|
||||
MultiABI='armeabi-v7a x86 arm64-v8a'
|
||||
# Available architectures: armeabi-v7a arm64-v8a x86 x86_64
|
||||
MultiABI='arm64-v8a'
|
||||
|
||||
# Optional shared libraries to compile - removing some of them will save space
|
||||
# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed
|
||||
# MP3 patents are expired, but libmad license is GPL, not LGPL
|
||||
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2
|
||||
CompiledLibraries="sdl_image"
|
||||
CompiledLibraries="sdl_image c++_shared"
|
||||
|
||||
# Application uses custom build script AndroidBuild.sh instead of Android.mk (y) or (n)
|
||||
CustomBuildScript=n
|
||||
|
||||
# Aditional CFLAGS for application
|
||||
AppCflags='-O2 -finline-functions'
|
||||
AppCflags=''
|
||||
|
||||
# Aditional C++-specific compiler flags for application, added after AppCflags
|
||||
AppCppflags=''
|
||||
@@ -271,7 +298,7 @@ AppSubdirsBuild=''
|
||||
AppBuildExclude=''
|
||||
|
||||
# Application command line parameters, including app name as 0-th param
|
||||
AppCmdline=''
|
||||
AppCmdline='ballfield'
|
||||
|
||||
# Screen size is used by Google Play to prevent an app to be installed on devices with smaller screens
|
||||
# Minimum screen size that application supports: (s)mall / (m)edium / (l)arge
|
||||
@@ -289,3 +316,6 @@ AdmobBannerSize=
|
||||
# Google Play Game Services application ID, required for cloud saves to work
|
||||
GooglePlayGameServicesId=
|
||||
|
||||
# The app will open files with following extension, file path will be added to commandline params
|
||||
AppOpenFileExtension='png PNG jpg JPG jpeg JPEG gif GIF'
|
||||
|
||||
|
||||
796
project/jni/application/ballfield/ballfield.c
Normal file
796
project/jni/application/ballfield/ballfield.c
Normal file
@@ -0,0 +1,796 @@
|
||||
/*
|
||||
* "Ballfield"
|
||||
*
|
||||
* (C) David Olofson <david@olofson.net>, 2002, 2003
|
||||
*
|
||||
* This software is released under the terms of the GPL.
|
||||
*
|
||||
* Contact author for permission if you want to use this
|
||||
* software, or work derived from it, under other terms.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <android/log.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#include <SDL/SDL.h>
|
||||
#include <SDL/SDL_image.h>
|
||||
#include <SDL/SDL_screenkeyboard.h>
|
||||
#include <SDL/SDL_android.h>
|
||||
|
||||
#define fprintf(X, ...) __android_log_print(ANDROID_LOG_INFO, "Ballfield", __VA_ARGS__)
|
||||
#define printf(...) __android_log_print(ANDROID_LOG_INFO, "Ballfield", __VA_ARGS__)
|
||||
|
||||
extern int create_server_socket(int portno);
|
||||
|
||||
|
||||
/*----------------------------------------------------------
|
||||
Definitions...
|
||||
----------------------------------------------------------*/
|
||||
|
||||
#define SCREEN_W 640
|
||||
#define SCREEN_H 540
|
||||
|
||||
|
||||
#define BALLS 300
|
||||
|
||||
#define COLORS 2
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Sint32 x, y, z; /* Position */
|
||||
Uint32 c; /* Color */
|
||||
} point_t;
|
||||
|
||||
|
||||
/*
|
||||
* Ballfield
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
point_t points[BALLS];
|
||||
SDL_Rect *frames;
|
||||
SDL_Surface *gfx[COLORS];
|
||||
int use_alpha;
|
||||
} ballfield_t;
|
||||
|
||||
|
||||
/*
|
||||
* Size of the biggest ball image in pixels
|
||||
*
|
||||
* Balls are scaled down and *packed*, one pixel
|
||||
* smaller for each frame down to 1x1. The actual
|
||||
* image width is (obviously...) the same as the
|
||||
* width of the first frame.
|
||||
*/
|
||||
#define BALL_W 32
|
||||
#define BALL_H 32
|
||||
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------
|
||||
General tool functions
|
||||
----------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
* Bump areas of low and high alpha to 0% or 100%
|
||||
* respectively, just in case the graphics contains
|
||||
* "alpha noise".
|
||||
*/
|
||||
SDL_Surface *clean_alpha(SDL_Surface *s)
|
||||
{
|
||||
SDL_Surface *work;
|
||||
SDL_Rect r;
|
||||
Uint32 *pixels;
|
||||
int pp;
|
||||
int x, y;
|
||||
|
||||
work = SDL_CreateRGBSurface(SDL_SWSURFACE, s->w, s->h,
|
||||
32, 0xff000000, 0x00ff0000, 0x0000ff00,
|
||||
0x000000ff);
|
||||
if(!work)
|
||||
return NULL;
|
||||
|
||||
r.x = r.y = 0;
|
||||
r.w = s->w;
|
||||
r.h = s->h;
|
||||
if(SDL_BlitSurface(s, &r, work, NULL) < 0)
|
||||
{
|
||||
SDL_FreeSurface(work);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SDL_LockSurface(work);
|
||||
pixels = (Uint32 *)work->pixels;
|
||||
pp = work->pitch / sizeof(Uint32);
|
||||
for(y = 0; y < work->h; ++y)
|
||||
for(x = 0; x < work->w; ++x)
|
||||
{
|
||||
Uint32 pix = pixels[y*pp + x];
|
||||
switch((pix & 0xff) >> 4)
|
||||
{
|
||||
case 0:
|
||||
pix = 0x00000000;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case 15:
|
||||
pix |= 0xff;
|
||||
break;
|
||||
}
|
||||
pixels[y*pp + x] = pix;
|
||||
}
|
||||
SDL_UnlockSurface(work);
|
||||
|
||||
return work;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Load and convert an antialiazed, zoomed set of sprites.
|
||||
*/
|
||||
SDL_Surface *load_zoomed(const char *name, int alpha)
|
||||
{
|
||||
SDL_Surface *sprites;
|
||||
SDL_Surface *temp = IMG_Load(name);
|
||||
if(!temp)
|
||||
return NULL;
|
||||
|
||||
/*
|
||||
sprites = temp;
|
||||
SDL_SetAlpha(sprites, 0, 255);
|
||||
temp = clean_alpha(sprites);
|
||||
SDL_FreeSurface(sprites);
|
||||
*/
|
||||
if(!temp)
|
||||
{
|
||||
fprintf(stderr, "Could not clean alpha!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(alpha)
|
||||
{
|
||||
SDL_SetAlpha(temp, 0, SDL_ALPHA_OPAQUE);
|
||||
sprites = SDL_DisplayFormatAlpha(temp);
|
||||
}
|
||||
else
|
||||
{
|
||||
SDL_SetColorKey(temp, SDL_SRCCOLORKEY,
|
||||
SDL_MapRGB(temp->format, 0, 0, 0));
|
||||
sprites = SDL_DisplayFormat(temp);
|
||||
}
|
||||
SDL_FreeSurface(temp);
|
||||
|
||||
return sprites;
|
||||
}
|
||||
|
||||
|
||||
void print_num(SDL_Surface *dst, SDL_Surface *font, int x, int y, float value)
|
||||
{
|
||||
char buf[16];
|
||||
int val = (int)(value * 10.0);
|
||||
int pos, p = 0;
|
||||
SDL_Rect from;
|
||||
|
||||
/* Sign */
|
||||
if(val < 0)
|
||||
{
|
||||
buf[p++] = 10;
|
||||
val = -val;
|
||||
}
|
||||
|
||||
/* Integer part */
|
||||
pos = 10000000;
|
||||
while(pos > 1)
|
||||
{
|
||||
int num = val / pos;
|
||||
val -= num * pos;
|
||||
pos /= 10;
|
||||
if(p || num)
|
||||
buf[p++] = num;
|
||||
}
|
||||
|
||||
/* Decimals */
|
||||
if(val / pos)
|
||||
{
|
||||
buf[p++] = 11;
|
||||
while(pos > 0)
|
||||
{
|
||||
int num = val / pos;
|
||||
val -= num * pos;
|
||||
pos /= 10;
|
||||
buf[p++] = num;
|
||||
}
|
||||
}
|
||||
|
||||
/* Render! */
|
||||
from.y = 0;
|
||||
from.w = 7;
|
||||
from.h = 10;
|
||||
for(pos = 0; pos < p; ++pos)
|
||||
{
|
||||
SDL_Rect to;
|
||||
to.x = x + pos * 7;
|
||||
to.y = y;
|
||||
from.x = buf[pos] * 7;
|
||||
SDL_BlitSurface(font, &from, dst, &to);
|
||||
}
|
||||
}
|
||||
|
||||
void print_num_hex(SDL_Surface *dst, SDL_Surface *font, int x, int y, unsigned val)
|
||||
{
|
||||
char buf[8];
|
||||
int pos, p = 0;
|
||||
SDL_Rect from;
|
||||
|
||||
//val = htonl(val); // Big-endian
|
||||
|
||||
/* Render! */
|
||||
from.y = 0;
|
||||
from.w = 7;
|
||||
from.h = 10;
|
||||
for(pos = 0; pos < 8; ++pos)
|
||||
{
|
||||
SDL_Rect to;
|
||||
to.x = 8 * 7 - (x + pos * 7); // Little-endian number wrapped backwards
|
||||
to.y = y;
|
||||
from.x = ( ( val >> (pos * 4) ) & 0xf ) * 7;
|
||||
SDL_BlitSurface(font, &from, dst, &to);
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------
|
||||
ballfield_t functions
|
||||
----------------------------------------------------------*/
|
||||
|
||||
ballfield_t *ballfield_init(void)
|
||||
{
|
||||
int i;
|
||||
ballfield_t *bf = (ballfield_t *)calloc(sizeof(ballfield_t), 1);
|
||||
if(!bf)
|
||||
return NULL;
|
||||
for(i = 0; i < BALLS; ++i)
|
||||
{
|
||||
bf->points[i].x = rand() % 0x20000;
|
||||
bf->points[i].y = rand() % 0x20000;
|
||||
bf->points[i].z = 0x20000 * i / BALLS;
|
||||
if(rand() % 100 > 80)
|
||||
bf->points[i].c = 1;
|
||||
else
|
||||
bf->points[i].c = 0;
|
||||
}
|
||||
return bf;
|
||||
}
|
||||
|
||||
|
||||
void ballfield_free(ballfield_t *bf)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; i < COLORS; ++i)
|
||||
SDL_FreeSurface(bf->gfx[i]);
|
||||
}
|
||||
|
||||
|
||||
static int ballfield_init_frames(ballfield_t *bf)
|
||||
{
|
||||
int i, j;
|
||||
/*
|
||||
* Set up source rects for all frames
|
||||
*/
|
||||
bf->frames = (SDL_Rect *)calloc(sizeof(SDL_Rect), bf->gfx[0]->w);
|
||||
if(!bf->frames)
|
||||
{
|
||||
fprintf(stderr, "No memory for frame rects!\n");
|
||||
return -1;
|
||||
}
|
||||
for(j = 0, i = 0; i < bf->gfx[0]->w; ++i)
|
||||
{
|
||||
bf->frames[i].x = 0;
|
||||
bf->frames[i].y = j;
|
||||
bf->frames[i].w = bf->gfx[0]->w - i;
|
||||
bf->frames[i].h = bf->gfx[0]->w - i;
|
||||
j += bf->gfx[0]->w - i;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int ballfield_load_gfx(ballfield_t *bf, const char *name, unsigned int color)
|
||||
{
|
||||
if(color >= COLORS)
|
||||
return -1;
|
||||
|
||||
bf->gfx[color] = load_zoomed(name, bf->use_alpha);
|
||||
if(!bf->gfx[color])
|
||||
return -2;
|
||||
|
||||
if(!bf->frames)
|
||||
return ballfield_init_frames(bf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void ballfield_move(ballfield_t *bf, Sint32 dx, Sint32 dy, Sint32 dz)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; i < BALLS; ++i)
|
||||
{
|
||||
bf->points[i].x += dx;
|
||||
bf->points[i].x &= 0x1ffff;
|
||||
bf->points[i].y += dy;
|
||||
bf->points[i].y &= 0x1ffff;
|
||||
bf->points[i].z += dz;
|
||||
bf->points[i].z &= 0x1ffff;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ballfield_render(ballfield_t *bf, SDL_Surface *screen)
|
||||
{
|
||||
int i, j, z;
|
||||
|
||||
/*
|
||||
* Find the ball with the highest Z.
|
||||
*/
|
||||
z = 0;
|
||||
j = 0;
|
||||
for(i = 0; i < BALLS; ++i)
|
||||
{
|
||||
if(bf->points[i].z > z)
|
||||
{
|
||||
j = i;
|
||||
z = bf->points[i].z;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Render all balls in back->front order.
|
||||
*/
|
||||
for(i = 0; i < BALLS; ++i)
|
||||
{
|
||||
SDL_Rect r;
|
||||
int f;
|
||||
z = bf->points[j].z;
|
||||
z += 50;
|
||||
f = ((bf->frames[0].w << 12) + 100000) / z;
|
||||
f = bf->frames[0].w - f;
|
||||
if(f < 0)
|
||||
f = 0;
|
||||
else if(f > bf->frames[0].w - 1)
|
||||
f = bf->frames[0].w - 1;
|
||||
z >>= 7;
|
||||
z += 1;
|
||||
r.x = (bf->points[j].x - 0x10000) / z;
|
||||
r.y = (bf->points[j].y - 0x10000) / z;
|
||||
r.x += (screen->w - bf->frames[f].w) >> 1;
|
||||
r.y += (screen->h - bf->frames[f].h) >> 1;
|
||||
SDL_BlitSurface(bf->gfx[bf->points[j].c],
|
||||
&bf->frames[f], screen, &r);
|
||||
if(--j < 0)
|
||||
j = BALLS - 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------
|
||||
Other rendering functions
|
||||
----------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
* Draw tiled background image with offset.
|
||||
*/
|
||||
void tiled_back(SDL_Surface *back, SDL_Surface *screen, int xo, int yo)
|
||||
{
|
||||
/*
|
||||
int x, y;
|
||||
SDL_Rect r;
|
||||
if(xo < 0)
|
||||
xo += back->w*(-xo/back->w + 1);
|
||||
if(yo < 0)
|
||||
yo += back->h*(-yo/back->h + 1);
|
||||
xo %= back->w;
|
||||
yo %= back->h;
|
||||
for(y = -yo; y < screen->h; y += back->h)
|
||||
for(x = -xo; x < screen->w; x += back->w)
|
||||
{
|
||||
r.x = x;
|
||||
r.y = y;
|
||||
SDL_BlitSurface(back, NULL, screen, &r);
|
||||
}
|
||||
*/
|
||||
SDL_Rect r;
|
||||
xo %= back->w/8;
|
||||
yo %= back->h/8;
|
||||
r.x = xo - back->w/2 + screen->w/2;
|
||||
r.y = yo - back->h/2 + screen->h/2;
|
||||
r.w = back->w;
|
||||
r.h = back->h;
|
||||
SDL_BlitSurface(back, NULL, screen, &r);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------
|
||||
main()
|
||||
----------------------------------------------------------*/
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
ballfield_t *balls;
|
||||
SDL_Surface *screen;
|
||||
SDL_Surface *temp_image;
|
||||
SDL_Surface *back, *logo, *font, *font_hex;
|
||||
SDL_Event event;
|
||||
int bpp = 16,
|
||||
flags = SDL_HWSURFACE,
|
||||
alpha = 1;
|
||||
int x_offs = 0, y_offs = 0;
|
||||
long tick,
|
||||
last_tick,
|
||||
last_avg_tick;
|
||||
double t = 0;
|
||||
float dt;
|
||||
int i;
|
||||
float fps = 0.0;
|
||||
int fps_count = 0;
|
||||
int fps_start = 0;
|
||||
float x_speed, y_speed, z_speed;
|
||||
enum { MAX_POINTERS = 16 };
|
||||
// some random colors
|
||||
int colors[MAX_POINTERS] = { 0xaaaaaa, 0xffffff, 0x888888, 0xcccccc, 0x666666, 0x999999, 0xdddddd, 0xeeeeee, 0xaaaaaa, 0xffffff, 0x888888, 0xcccccc, 0x666666, 0x999999, 0xdddddd, 0xeeeeee };
|
||||
struct TouchPointer_t { int x; int y; int pressure; int pressed; } touchPointers[MAX_POINTERS];
|
||||
int accel[5], screenjoy[4], gamepads[4][8];
|
||||
SDL_Surface *mouse[4];
|
||||
int screenKeyboardShown = 0;
|
||||
char asyncTextInputBuf[256];
|
||||
|
||||
|
||||
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK);
|
||||
SDL_EnableUNICODE(1);
|
||||
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||
SDL_Joystick * joysticks[6];
|
||||
for( i = 0; i < 6; i++ )
|
||||
joysticks[i] = SDL_JoystickOpen(i);
|
||||
|
||||
atexit(SDL_Quit);
|
||||
|
||||
screen = SDL_SetVideoMode(SCREEN_W, SCREEN_H, bpp, flags);
|
||||
if(!screen)
|
||||
{
|
||||
fprintf(stderr, "Failed to open screen!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
SDL_WM_SetCaption("Ballfield", "Ballfield");
|
||||
if(flags & SDL_FULLSCREEN)
|
||||
SDL_ShowCursor(0);
|
||||
|
||||
balls = ballfield_init();
|
||||
if(!balls)
|
||||
{
|
||||
fprintf(stderr, "Failed to create ballfield!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Load and prepare balls...
|
||||
*/
|
||||
balls->use_alpha = alpha;
|
||||
if( ballfield_load_gfx(balls, "blueball.png", 0)
|
||||
||
|
||||
ballfield_load_gfx(balls, "redball.png", 1) )
|
||||
{
|
||||
fprintf(stderr, "Could not load balls!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Load background image
|
||||
*/
|
||||
temp_image = IMG_Load(argc > 1 ? argv[1] : "sun.gif");
|
||||
if(!temp_image)
|
||||
{
|
||||
fprintf(stderr, "Could not load background!\n");
|
||||
exit(-1);
|
||||
}
|
||||
back = SDL_DisplayFormat(temp_image);
|
||||
SDL_FreeSurface(temp_image);
|
||||
|
||||
/*
|
||||
* Load logo
|
||||
*/
|
||||
temp_image = SDL_LoadBMP("logo.bmp");
|
||||
if(!temp_image)
|
||||
{
|
||||
fprintf(stderr, "Could not load logo!\n");
|
||||
exit(-1);
|
||||
}
|
||||
SDL_SetColorKey(temp_image, SDL_SRCCOLORKEY,
|
||||
SDL_MapRGB(temp_image->format, 255, 0, 255));
|
||||
logo = SDL_DisplayFormat(temp_image);
|
||||
SDL_FreeSurface(temp_image);
|
||||
|
||||
/*
|
||||
* Load font
|
||||
*/
|
||||
temp_image = SDL_LoadBMP("font7x10.bmp");
|
||||
if(!temp_image)
|
||||
{
|
||||
fprintf(stderr, "Could not load font!\n");
|
||||
exit(-1);
|
||||
}
|
||||
SDL_SetColorKey(temp_image, SDL_SRCCOLORKEY,
|
||||
SDL_MapRGB(temp_image->format, 255, 0, 255));
|
||||
font = SDL_DisplayFormat(temp_image);
|
||||
SDL_FreeSurface(temp_image);
|
||||
|
||||
temp_image = SDL_LoadBMP("font7x10-hex.bmp");
|
||||
if(!temp_image)
|
||||
{
|
||||
fprintf(stderr, "Could not load hex font!\n");
|
||||
exit(-1);
|
||||
}
|
||||
SDL_SetColorKey(temp_image, SDL_SRCCOLORKEY,
|
||||
SDL_MapRGB(temp_image->format, 255, 0, 255));
|
||||
font_hex = SDL_DisplayFormat(temp_image);
|
||||
SDL_FreeSurface(temp_image);
|
||||
|
||||
for(i = 0; i < 4; i++)
|
||||
{
|
||||
char name[32];
|
||||
sprintf(name, "mouse%d.png", i);
|
||||
temp_image = IMG_Load(name);
|
||||
if(!temp_image)
|
||||
{
|
||||
fprintf(stderr, "Could not load %s!\n", name);
|
||||
exit(-1);
|
||||
}
|
||||
//mouse[i] = SDL_DisplayFormat(temp_image);
|
||||
//SDL_FreeSurface(temp_image);
|
||||
mouse[i] = temp_image; // Keep alpha
|
||||
}
|
||||
|
||||
last_avg_tick = last_tick = SDL_GetTicks();
|
||||
|
||||
memset(touchPointers, 0, sizeof(touchPointers));
|
||||
memset(accel, 0, sizeof(accel));
|
||||
memset(screenjoy, 0, sizeof(screenjoy));
|
||||
memset(gamepads, 0, sizeof(gamepads));
|
||||
|
||||
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "sizeof(int) %d long %d long long %d size_t %d", sizeof(int), sizeof(long), sizeof(long long), sizeof(size_t));
|
||||
/*
|
||||
wchar_t ss[256];
|
||||
const wchar_t *ss2 = L"String 2 ЕНГ ---";
|
||||
swprintf(ss, 256, L"String ЙЦУК --- %ls", ss2);
|
||||
char ss3[512] = "";
|
||||
char ss4[512] = "";
|
||||
for(i = 0; i < wcslen(ss); i++)
|
||||
{
|
||||
char tmp[16];
|
||||
sprintf(tmp, "%04X ", (int)ss[i]);
|
||||
strcat(ss3, tmp);
|
||||
sprintf(ss4, "%ls", ss);
|
||||
}
|
||||
__android_log_print(ANDROID_LOG_VERBOSE, "Ballfield", "swprintf: len %d data %s: %s", wcslen(ss), ss3, ss4);
|
||||
*/
|
||||
|
||||
__android_log_print(ANDROID_LOG_VERBOSE, "Ballfield", "On-screen buttons:");
|
||||
for(i = 0; i < SDL_ANDROID_SCREENKEYBOARD_BUTTON_NUM; i++)
|
||||
{
|
||||
SDL_Rect r;
|
||||
SDL_ANDROID_GetScreenKeyboardButtonPos(i, &r);
|
||||
__android_log_print(ANDROID_LOG_VERBOSE, "Ballfield", "{ %d, %d, %d, %d },", r.x, r.y, r.x+r.h, r.y+r.w);
|
||||
}
|
||||
//SDL_ANDROID_SetScreenKeyboardButtonGenerateTouchEvents(SDL_ANDROID_SCREENKEYBOARD_BUTTON_0, 1);
|
||||
//SDL_ANDROID_SetScreenKeyboardButtonGenerateTouchEvents(SDL_ANDROID_SCREENKEYBOARD_BUTTON_3, 1);
|
||||
|
||||
while(1)
|
||||
{
|
||||
SDL_Rect r;
|
||||
|
||||
/* Timing */
|
||||
tick = SDL_GetTicks();
|
||||
dt = (tick - last_tick) * 0.001f;
|
||||
last_tick = tick;
|
||||
|
||||
if( bpp == 32 )
|
||||
SDL_FillRect(screen, NULL, 0); // Clear alpha channel
|
||||
|
||||
/* Background image */
|
||||
tiled_back(back, screen, x_offs>>11, y_offs>>11);
|
||||
|
||||
/* Ballfield */
|
||||
ballfield_render(balls, screen);
|
||||
|
||||
/* Logo */
|
||||
r.x = 2;
|
||||
r.y = 2;
|
||||
SDL_BlitSurface(logo, NULL, screen, &r);
|
||||
|
||||
/* FPS counter */
|
||||
if(tick > fps_start + 1000)
|
||||
{
|
||||
fps = (float)fps_count * 1000.0 / (tick - fps_start);
|
||||
fps_count = 0;
|
||||
fps_start = tick;
|
||||
}
|
||||
|
||||
print_num(screen, font, screen->w-37, screen->h-12, fps);
|
||||
++fps_count;
|
||||
|
||||
for(i=0; i<MAX_POINTERS; i++)
|
||||
{
|
||||
if( !touchPointers[i].pressed )
|
||||
continue;
|
||||
r.x = touchPointers[i].x;
|
||||
r.y = touchPointers[i].y;
|
||||
r.w = 50;// + touchPointers[i].pressure / 5;
|
||||
r.h = 50;// + touchPointers[i].pressure / 5;
|
||||
r.x -= r.w/2;
|
||||
r.y -= r.h/2;
|
||||
SDL_FillRect(screen, &r, colors[i]);
|
||||
}
|
||||
int joyInput[][3] = {
|
||||
{accel[0], accel[1], 10},
|
||||
{accel[2], accel[3], 10 + abs(accel[4]) * 100 / 32767},
|
||||
{screenjoy[0], screenjoy[1], 10},
|
||||
{screenjoy[2], screenjoy[3], 10},
|
||||
{gamepads[0][0], gamepads[0][1], 10 + gamepads[0][4] * 100 / 32767},
|
||||
{gamepads[0][2], gamepads[0][3], 10 + gamepads[0][5] * 100 / 32767},
|
||||
{gamepads[0][6], gamepads[0][7], 10},
|
||||
{gamepads[1][0], gamepads[1][1], 10 + gamepads[1][4] * 100 / 32767},
|
||||
{gamepads[1][2], gamepads[1][3], 10 + gamepads[1][5] * 100 / 32767},
|
||||
{gamepads[1][6], gamepads[1][7], 10},
|
||||
{gamepads[2][0], gamepads[2][1], 10 + gamepads[2][4] * 100 / 32767},
|
||||
{gamepads[2][2], gamepads[2][3], 10 + gamepads[2][5] * 100 / 32767},
|
||||
{gamepads[2][6], gamepads[2][7], 10},
|
||||
{gamepads[3][0], gamepads[3][1], 10 + gamepads[3][4] * 100 / 32767},
|
||||
{gamepads[3][2], gamepads[3][3], 10 + gamepads[3][5] * 100 / 32767},
|
||||
{gamepads[3][6], gamepads[3][7], 10},
|
||||
};
|
||||
for( i = 0; i < 15; i++ )
|
||||
{
|
||||
r.w = joyInput[i][2];
|
||||
r.h = joyInput[i][2];
|
||||
r.x = SCREEN_W/2 + joyInput[i][0] * SCREEN_H / 65536 - r.w/2;
|
||||
r.y = SCREEN_H/2 + joyInput[i][1] * SCREEN_H / 65536 - r.w/2;
|
||||
//__android_log_print(ANDROID_LOG_INFO, "Ballfield", "Joy input %d: %d %d %d", i, joyInput[i][0], joyInput[i][1], joyInput[i][2] );
|
||||
SDL_FillRect(screen, &r, i * 123);
|
||||
}
|
||||
|
||||
int mx, my;
|
||||
int b = SDL_GetMouseState(&mx, &my);
|
||||
//__android_log_print(ANDROID_LOG_INFO, "Ballfield", "Mouse: %04d %04d buttons %d", mx, my, b);
|
||||
int cursorIdx = 0;
|
||||
if( b & SDL_BUTTON_LMASK )
|
||||
cursorIdx |= 1;
|
||||
if( b & SDL_BUTTON_RMASK )
|
||||
cursorIdx |= 2;
|
||||
r.x = mx;
|
||||
r.y = my;
|
||||
r.w = mouse[cursorIdx]->w;
|
||||
r.h = mouse[cursorIdx]->h;
|
||||
r.x -= r.w/2;
|
||||
r.y -= r.h/2;
|
||||
SDL_BlitSurface(mouse[cursorIdx], NULL, screen, &r);
|
||||
|
||||
SDL_Flip(SDL_GetVideoSurface());
|
||||
SDL_Event evt;
|
||||
while( SDL_PollEvent(&evt) )
|
||||
{
|
||||
if(evt.type == SDL_KEYUP || evt.type == SDL_KEYDOWN)
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL key event: evt %s state %s key %4d %12s scancode %4d mod %2d unicode %d", evt.type == SDL_KEYUP ? "UP " : "DOWN" , evt.key.state == SDL_PRESSED ? "PRESSED " : "RELEASED", (int)evt.key.keysym.sym, SDL_GetKeyName(evt.key.keysym.sym), (int)evt.key.keysym.scancode, (int)evt.key.keysym.mod, (int)evt.key.keysym.unicode);
|
||||
if(evt.key.keysym.sym == SDLK_ESCAPE)
|
||||
return 0;
|
||||
if( evt.key.state == SDL_RELEASED )
|
||||
{
|
||||
if(evt.key.keysym.sym == SDLK_0)
|
||||
{
|
||||
SDL_ANDROID_SetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_2, 1);
|
||||
//SDL_ANDROID_SetMouseEmulationMode(0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
|
||||
}
|
||||
if(evt.key.keysym.sym == SDLK_1)
|
||||
{
|
||||
SDL_ANDROID_SetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_2, 0);
|
||||
//SDL_ANDROID_SetMouseEmulationMode(1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
|
||||
//*((int*) 0x1000) = 1000; // When you need to test your debugger
|
||||
}
|
||||
if(evt.key.keysym.sym == SDLK_2)
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "Async text input started");
|
||||
strcpy(asyncTextInputBuf, "async");
|
||||
SDL_ANDROID_GetScreenKeyboardTextInputAsync(asyncTextInputBuf, sizeof(asyncTextInputBuf));
|
||||
}
|
||||
if(evt.key.keysym.sym == SDLK_3)
|
||||
SDL_ANDROID_SetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_DPAD, 0);
|
||||
if(evt.key.keysym.sym == SDLK_4)
|
||||
SDL_ToggleScreenKeyboard(NULL);
|
||||
if(evt.key.keysym.sym == SDLK_5)
|
||||
SDL_ANDROID_ToggleScreenKeyboardWithoutTextInput();
|
||||
}
|
||||
}
|
||||
if(evt.type == SDL_MOUSEBUTTONUP || evt.type == SDL_MOUSEBUTTONDOWN)
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL mouse button event: evt %s state %s button %d coords %d:%d", evt.type == SDL_MOUSEBUTTONUP ? "UP " : "DOWN" , evt.button.state == SDL_PRESSED ? "PRESSED " : "RELEASED", (int)evt.button.button, (int)evt.button.x, (int)evt.button.y);
|
||||
}
|
||||
if(evt.type == SDL_VIDEORESIZE)
|
||||
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL resize event: %d x %d", evt.resize.w, evt.resize.h);
|
||||
if(evt.type == SDL_ACTIVEEVENT)
|
||||
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "======= SDL active event: gain %d state %d", evt.active.gain, evt.active.state);
|
||||
// Android-specific events - accelerometer, multitoush, and on-screen joystick
|
||||
if( evt.type == SDL_JOYAXISMOTION )
|
||||
{
|
||||
if(evt.jaxis.which == 0) // Multitouch and on-screen joysticks
|
||||
{
|
||||
if(evt.jaxis.axis < 4)
|
||||
screenjoy[evt.jaxis.axis] = evt.jaxis.value;
|
||||
else
|
||||
touchPointers[evt.jaxis.axis - 4].pressure = evt.jaxis.value;
|
||||
}
|
||||
if(evt.jaxis.which == 1)
|
||||
{
|
||||
accel[evt.jaxis.axis] = evt.jaxis.value; // accelerometer and gyroscope
|
||||
}
|
||||
if(evt.jaxis.which >= 2)
|
||||
{
|
||||
// Each gamepad has 8 axes - two joystick hats, two triggers, and Ouya touchpad
|
||||
gamepads[evt.jaxis.which - 2][evt.jaxis.axis] = evt.jaxis.value;
|
||||
}
|
||||
}
|
||||
if( evt.type == SDL_JOYBUTTONDOWN || evt.type == SDL_JOYBUTTONUP )
|
||||
{
|
||||
if(evt.jbutton.which == 0) // Multitouch and on-screen joystick
|
||||
touchPointers[evt.jbutton.button].pressed = (evt.jbutton.state == SDL_PRESSED);
|
||||
}
|
||||
if( evt.type == SDL_JOYBALLMOTION )
|
||||
{
|
||||
if(evt.jball.which == 0) // Multitouch and on-screen joystick
|
||||
{
|
||||
touchPointers[evt.jball.ball].x = evt.jball.xrel;
|
||||
touchPointers[evt.jball.ball].y = evt.jball.yrel;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( screenKeyboardShown != SDL_IsScreenKeyboardShown(NULL) )
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "Screen keyboard shown: %d -> %d", screenKeyboardShown, SDL_IsScreenKeyboardShown(NULL));
|
||||
screenKeyboardShown = SDL_IsScreenKeyboardShown(NULL);
|
||||
}
|
||||
if( SDL_IsScreenKeyboardShown(NULL) )
|
||||
{
|
||||
if(SDL_ANDROID_GetScreenKeyboardTextInputAsync(asyncTextInputBuf, sizeof(asyncTextInputBuf)) == SDL_ANDROID_TEXTINPUT_ASYNC_FINISHED)
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "Async text input: %s", asyncTextInputBuf);
|
||||
}
|
||||
}
|
||||
|
||||
/* Animate */
|
||||
x_speed = 500.0 * sin(t * 0.37);
|
||||
y_speed = 500.0 * sin(t * 0.53);
|
||||
z_speed = 400.0 * sin(t * 0.21);
|
||||
if( SDL_GetKeyState(NULL)[SDLK_LEFT] || SDL_GetKeyState(NULL)[SDLK_a] )
|
||||
x_speed -= 100000 * dt;
|
||||
if( SDL_GetKeyState(NULL)[SDLK_RIGHT] || SDL_GetKeyState(NULL)[SDLK_d] )
|
||||
x_speed += 100000 * dt;
|
||||
if( SDL_GetKeyState(NULL)[SDLK_UP] || SDL_GetKeyState(NULL)[SDLK_w] )
|
||||
y_speed -= 100000 * dt;
|
||||
if( SDL_GetKeyState(NULL)[SDLK_DOWN] || SDL_GetKeyState(NULL)[SDLK_s] )
|
||||
y_speed += 100000 * dt;
|
||||
|
||||
ballfield_move(balls, x_speed, y_speed, z_speed);
|
||||
x_offs -= x_speed;
|
||||
y_offs -= y_speed;
|
||||
|
||||
t += dt;
|
||||
}
|
||||
|
||||
ballfield_free(balls);
|
||||
SDL_FreeSurface(back);
|
||||
SDL_FreeSurface(logo);
|
||||
SDL_FreeSurface(font);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,795 +0,0 @@
|
||||
/*
|
||||
* "Ballfield"
|
||||
*
|
||||
* (C) David Olofson <david@olofson.net>, 2002, 2003
|
||||
*
|
||||
* This software is released under the terms of the GPL.
|
||||
*
|
||||
* Contact author for permission if you want to use this
|
||||
* software, or work derived from it, under other terms.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <android/log.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#include <SDL/SDL.h>
|
||||
#include <SDL/SDL_image.h>
|
||||
#include <SDL/SDL_screenkeyboard.h>
|
||||
#include <SDL/SDL_android.h>
|
||||
|
||||
#define fprintf(X, ...) __android_log_print(ANDROID_LOG_INFO, "Ballfield", __VA_ARGS__)
|
||||
#define printf(...) __android_log_print(ANDROID_LOG_INFO, "Ballfield", __VA_ARGS__)
|
||||
|
||||
/*----------------------------------------------------------
|
||||
Definitions...
|
||||
----------------------------------------------------------*/
|
||||
|
||||
#define SCREEN_W 640
|
||||
#define SCREEN_H 256
|
||||
|
||||
|
||||
#define BALLS 300
|
||||
|
||||
#define COLORS 2
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Sint32 x, y, z; /* Position */
|
||||
Uint32 c; /* Color */
|
||||
} point_t;
|
||||
|
||||
|
||||
/*
|
||||
* Ballfield
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
point_t points[BALLS];
|
||||
SDL_Rect *frames;
|
||||
SDL_Surface *gfx[COLORS];
|
||||
int use_alpha;
|
||||
} ballfield_t;
|
||||
|
||||
|
||||
/*
|
||||
* Size of the biggest ball image in pixels
|
||||
*
|
||||
* Balls are scaled down and *packed*, one pixel
|
||||
* smaller for each frame down to 1x1. The actual
|
||||
* image width is (obviously...) the same as the
|
||||
* width of the first frame.
|
||||
*/
|
||||
#define BALL_W 32
|
||||
#define BALL_H 32
|
||||
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------
|
||||
General tool functions
|
||||
----------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
* Bump areas of low and high alpha to 0% or 100%
|
||||
* respectively, just in case the graphics contains
|
||||
* "alpha noise".
|
||||
*/
|
||||
SDL_Surface *clean_alpha(SDL_Surface *s)
|
||||
{
|
||||
SDL_Surface *work;
|
||||
SDL_Rect r;
|
||||
Uint32 *pixels;
|
||||
int pp;
|
||||
int x, y;
|
||||
|
||||
work = SDL_CreateRGBSurface(SDL_SWSURFACE, s->w, s->h,
|
||||
32, 0xff000000, 0x00ff0000, 0x0000ff00,
|
||||
0x000000ff);
|
||||
if(!work)
|
||||
return NULL;
|
||||
|
||||
r.x = r.y = 0;
|
||||
r.w = s->w;
|
||||
r.h = s->h;
|
||||
if(SDL_BlitSurface(s, &r, work, NULL) < 0)
|
||||
{
|
||||
SDL_FreeSurface(work);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SDL_LockSurface(work);
|
||||
pixels = (Uint32 *)work->pixels;
|
||||
pp = work->pitch / sizeof(Uint32);
|
||||
for(y = 0; y < work->h; ++y)
|
||||
for(x = 0; x < work->w; ++x)
|
||||
{
|
||||
Uint32 pix = pixels[y*pp + x];
|
||||
switch((pix & 0xff) >> 4)
|
||||
{
|
||||
case 0:
|
||||
pix = 0x00000000;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case 15:
|
||||
pix |= 0xff;
|
||||
break;
|
||||
}
|
||||
pixels[y*pp + x] = pix;
|
||||
}
|
||||
SDL_UnlockSurface(work);
|
||||
|
||||
return work;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Load and convert an antialiazed, zoomed set of sprites.
|
||||
*/
|
||||
SDL_Surface *load_zoomed(char *name, int alpha)
|
||||
{
|
||||
SDL_Surface *sprites;
|
||||
SDL_Surface *temp = IMG_Load(name);
|
||||
if(!temp)
|
||||
return NULL;
|
||||
|
||||
/*
|
||||
sprites = temp;
|
||||
SDL_SetAlpha(sprites, 0, 255);
|
||||
temp = clean_alpha(sprites);
|
||||
SDL_FreeSurface(sprites);
|
||||
*/
|
||||
if(!temp)
|
||||
{
|
||||
fprintf(stderr, "Could not clean alpha!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(alpha)
|
||||
{
|
||||
SDL_SetAlpha(temp, 0, SDL_ALPHA_OPAQUE);
|
||||
sprites = SDL_DisplayFormatAlpha(temp);
|
||||
}
|
||||
else
|
||||
{
|
||||
SDL_SetColorKey(temp, SDL_SRCCOLORKEY,
|
||||
SDL_MapRGB(temp->format, 0, 0, 0));
|
||||
sprites = SDL_DisplayFormat(temp);
|
||||
}
|
||||
SDL_FreeSurface(temp);
|
||||
|
||||
return sprites;
|
||||
}
|
||||
|
||||
|
||||
void print_num(SDL_Surface *dst, SDL_Surface *font, int x, int y, float value)
|
||||
{
|
||||
char buf[16];
|
||||
int val = (int)(value * 10.0);
|
||||
int pos, p = 0;
|
||||
SDL_Rect from;
|
||||
|
||||
/* Sign */
|
||||
if(val < 0)
|
||||
{
|
||||
buf[p++] = 10;
|
||||
val = -val;
|
||||
}
|
||||
|
||||
/* Integer part */
|
||||
pos = 10000000;
|
||||
while(pos > 1)
|
||||
{
|
||||
int num = val / pos;
|
||||
val -= num * pos;
|
||||
pos /= 10;
|
||||
if(p || num)
|
||||
buf[p++] = num;
|
||||
}
|
||||
|
||||
/* Decimals */
|
||||
if(val / pos)
|
||||
{
|
||||
buf[p++] = 11;
|
||||
while(pos > 0)
|
||||
{
|
||||
int num = val / pos;
|
||||
val -= num * pos;
|
||||
pos /= 10;
|
||||
buf[p++] = num;
|
||||
}
|
||||
}
|
||||
|
||||
/* Render! */
|
||||
from.y = 0;
|
||||
from.w = 7;
|
||||
from.h = 10;
|
||||
for(pos = 0; pos < p; ++pos)
|
||||
{
|
||||
SDL_Rect to;
|
||||
to.x = x + pos * 7;
|
||||
to.y = y;
|
||||
from.x = buf[pos] * 7;
|
||||
SDL_BlitSurface(font, &from, dst, &to);
|
||||
}
|
||||
}
|
||||
|
||||
void print_num_hex(SDL_Surface *dst, SDL_Surface *font, int x, int y, unsigned val)
|
||||
{
|
||||
char buf[8];
|
||||
int pos, p = 0;
|
||||
SDL_Rect from;
|
||||
|
||||
//val = htonl(val); // Big-endian
|
||||
|
||||
/* Render! */
|
||||
from.y = 0;
|
||||
from.w = 7;
|
||||
from.h = 10;
|
||||
for(pos = 0; pos < 8; ++pos)
|
||||
{
|
||||
SDL_Rect to;
|
||||
to.x = 8 * 7 - (x + pos * 7); // Little-endian number wrapped backwards
|
||||
to.y = y;
|
||||
from.x = ( ( val >> (pos * 4) ) & 0xf ) * 7;
|
||||
SDL_BlitSurface(font, &from, dst, &to);
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------
|
||||
ballfield_t functions
|
||||
----------------------------------------------------------*/
|
||||
|
||||
ballfield_t *ballfield_init(void)
|
||||
{
|
||||
int i;
|
||||
ballfield_t *bf = (ballfield_t *)calloc(sizeof(ballfield_t), 1);
|
||||
if(!bf)
|
||||
return NULL;
|
||||
for(i = 0; i < BALLS; ++i)
|
||||
{
|
||||
bf->points[i].x = rand() % 0x20000;
|
||||
bf->points[i].y = rand() % 0x20000;
|
||||
bf->points[i].z = 0x20000 * i / BALLS;
|
||||
if(rand() % 100 > 80)
|
||||
bf->points[i].c = 1;
|
||||
else
|
||||
bf->points[i].c = 0;
|
||||
}
|
||||
return bf;
|
||||
}
|
||||
|
||||
|
||||
void ballfield_free(ballfield_t *bf)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; i < COLORS; ++i)
|
||||
SDL_FreeSurface(bf->gfx[i]);
|
||||
}
|
||||
|
||||
|
||||
static int ballfield_init_frames(ballfield_t *bf)
|
||||
{
|
||||
int i, j;
|
||||
/*
|
||||
* Set up source rects for all frames
|
||||
*/
|
||||
bf->frames = (SDL_Rect *)calloc(sizeof(SDL_Rect), bf->gfx[0]->w);
|
||||
if(!bf->frames)
|
||||
{
|
||||
fprintf(stderr, "No memory for frame rects!\n");
|
||||
return -1;
|
||||
}
|
||||
for(j = 0, i = 0; i < bf->gfx[0]->w; ++i)
|
||||
{
|
||||
bf->frames[i].x = 0;
|
||||
bf->frames[i].y = j;
|
||||
bf->frames[i].w = bf->gfx[0]->w - i;
|
||||
bf->frames[i].h = bf->gfx[0]->w - i;
|
||||
j += bf->gfx[0]->w - i;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int ballfield_load_gfx(ballfield_t *bf, char *name, unsigned int color)
|
||||
{
|
||||
if(color >= COLORS)
|
||||
return -1;
|
||||
|
||||
bf->gfx[color] = load_zoomed(name, bf->use_alpha);
|
||||
if(!bf->gfx[color])
|
||||
return -2;
|
||||
|
||||
if(!bf->frames)
|
||||
return ballfield_init_frames(bf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void ballfield_move(ballfield_t *bf, Sint32 dx, Sint32 dy, Sint32 dz)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; i < BALLS; ++i)
|
||||
{
|
||||
bf->points[i].x += dx;
|
||||
bf->points[i].x &= 0x1ffff;
|
||||
bf->points[i].y += dy;
|
||||
bf->points[i].y &= 0x1ffff;
|
||||
bf->points[i].z += dz;
|
||||
bf->points[i].z &= 0x1ffff;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ballfield_render(ballfield_t *bf, SDL_Surface *screen)
|
||||
{
|
||||
int i, j, z;
|
||||
|
||||
/*
|
||||
* Find the ball with the highest Z.
|
||||
*/
|
||||
z = 0;
|
||||
j = 0;
|
||||
for(i = 0; i < BALLS; ++i)
|
||||
{
|
||||
if(bf->points[i].z > z)
|
||||
{
|
||||
j = i;
|
||||
z = bf->points[i].z;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Render all balls in back->front order.
|
||||
*/
|
||||
for(i = 0; i < BALLS; ++i)
|
||||
{
|
||||
SDL_Rect r;
|
||||
int f;
|
||||
z = bf->points[j].z;
|
||||
z += 50;
|
||||
f = ((bf->frames[0].w << 12) + 100000) / z;
|
||||
f = bf->frames[0].w - f;
|
||||
if(f < 0)
|
||||
f = 0;
|
||||
else if(f > bf->frames[0].w - 1)
|
||||
f = bf->frames[0].w - 1;
|
||||
z >>= 7;
|
||||
z += 1;
|
||||
r.x = (bf->points[j].x - 0x10000) / z;
|
||||
r.y = (bf->points[j].y - 0x10000) / z;
|
||||
r.x += (screen->w - bf->frames[f].w) >> 1;
|
||||
r.y += (screen->h - bf->frames[f].h) >> 1;
|
||||
SDL_BlitSurface(bf->gfx[bf->points[j].c],
|
||||
&bf->frames[f], screen, &r);
|
||||
if(--j < 0)
|
||||
j = BALLS - 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------
|
||||
Other rendering functions
|
||||
----------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
* Draw tiled background image with offset.
|
||||
*/
|
||||
void tiled_back(SDL_Surface *back, SDL_Surface *screen, int xo, int yo)
|
||||
{
|
||||
/*
|
||||
int x, y;
|
||||
SDL_Rect r;
|
||||
if(xo < 0)
|
||||
xo += back->w*(-xo/back->w + 1);
|
||||
if(yo < 0)
|
||||
yo += back->h*(-yo/back->h + 1);
|
||||
xo %= back->w;
|
||||
yo %= back->h;
|
||||
for(y = -yo; y < screen->h; y += back->h)
|
||||
for(x = -xo; x < screen->w; x += back->w)
|
||||
{
|
||||
r.x = x;
|
||||
r.y = y;
|
||||
SDL_BlitSurface(back, NULL, screen, &r);
|
||||
}
|
||||
*/
|
||||
SDL_Rect r;
|
||||
xo %= back->w/8;
|
||||
yo %= back->h/8;
|
||||
r.x = xo - back->w/2 + screen->w/2;
|
||||
r.y = yo - back->h/2 + screen->h/2;
|
||||
r.w = back->w;
|
||||
r.h = back->h;
|
||||
SDL_BlitSurface(back, NULL, screen, &r);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------
|
||||
main()
|
||||
----------------------------------------------------------*/
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
ballfield_t *balls;
|
||||
SDL_Surface *screen;
|
||||
SDL_Surface *temp_image;
|
||||
SDL_Surface *back, *logo, *font, *font_hex;
|
||||
SDL_Event event;
|
||||
int bpp = 16,
|
||||
flags = SDL_HWSURFACE,
|
||||
alpha = 1;
|
||||
int x_offs = 0, y_offs = 0;
|
||||
long tick,
|
||||
last_tick,
|
||||
last_avg_tick;
|
||||
double t = 0;
|
||||
float dt;
|
||||
int i;
|
||||
float fps = 0.0;
|
||||
int fps_count = 0;
|
||||
int fps_start = 0;
|
||||
float x_speed, y_speed, z_speed;
|
||||
enum { MAX_POINTERS = 16 };
|
||||
// some random colors
|
||||
int colors[MAX_POINTERS] = { 0xaaaaaa, 0xffffff, 0x888888, 0xcccccc, 0x666666, 0x999999, 0xdddddd, 0xeeeeee, 0xaaaaaa, 0xffffff, 0x888888, 0xcccccc, 0x666666, 0x999999, 0xdddddd, 0xeeeeee };
|
||||
struct TouchPointer_t { int x; int y; int pressure; int pressed; } touchPointers[MAX_POINTERS];
|
||||
int accel[5], screenjoy[4], gamepads[4][8];
|
||||
SDL_Surface *mouse[4];
|
||||
int screenKeyboardShown = 0;
|
||||
int asyncTextInput = 0;
|
||||
char asyncTextInputBuf[256];
|
||||
|
||||
|
||||
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK);
|
||||
SDL_EnableUNICODE(1);
|
||||
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||
SDL_Joystick * joysticks[6];
|
||||
for( i = 0; i < 6; i++ )
|
||||
joysticks[i] = SDL_JoystickOpen(i);
|
||||
|
||||
atexit(SDL_Quit);
|
||||
|
||||
screen = SDL_SetVideoMode(SCREEN_W, SCREEN_H, bpp, flags);
|
||||
if(!screen)
|
||||
{
|
||||
fprintf(stderr, "Failed to open screen!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
SDL_WM_SetCaption("Ballfield", "Ballfield");
|
||||
if(flags & SDL_FULLSCREEN)
|
||||
SDL_ShowCursor(0);
|
||||
|
||||
balls = ballfield_init();
|
||||
if(!balls)
|
||||
{
|
||||
fprintf(stderr, "Failed to create ballfield!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Load and prepare balls...
|
||||
*/
|
||||
balls->use_alpha = alpha;
|
||||
if( ballfield_load_gfx(balls, "blueball.png", 0)
|
||||
||
|
||||
ballfield_load_gfx(balls, "redball.png", 1) )
|
||||
{
|
||||
fprintf(stderr, "Could not load balls!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Load background image
|
||||
*/
|
||||
temp_image = IMG_Load("sun.gif");
|
||||
if(!temp_image)
|
||||
{
|
||||
fprintf(stderr, "Could not load background!\n");
|
||||
exit(-1);
|
||||
}
|
||||
back = SDL_DisplayFormat(temp_image);
|
||||
SDL_FreeSurface(temp_image);
|
||||
|
||||
/*
|
||||
* Load logo
|
||||
*/
|
||||
temp_image = SDL_LoadBMP("logo.bmp");
|
||||
if(!temp_image)
|
||||
{
|
||||
fprintf(stderr, "Could not load logo!\n");
|
||||
exit(-1);
|
||||
}
|
||||
SDL_SetColorKey(temp_image, SDL_SRCCOLORKEY,
|
||||
SDL_MapRGB(temp_image->format, 255, 0, 255));
|
||||
logo = SDL_DisplayFormat(temp_image);
|
||||
SDL_FreeSurface(temp_image);
|
||||
|
||||
/*
|
||||
* Load font
|
||||
*/
|
||||
temp_image = SDL_LoadBMP("font7x10.bmp");
|
||||
if(!temp_image)
|
||||
{
|
||||
fprintf(stderr, "Could not load font!\n");
|
||||
exit(-1);
|
||||
}
|
||||
SDL_SetColorKey(temp_image, SDL_SRCCOLORKEY,
|
||||
SDL_MapRGB(temp_image->format, 255, 0, 255));
|
||||
font = SDL_DisplayFormat(temp_image);
|
||||
SDL_FreeSurface(temp_image);
|
||||
|
||||
temp_image = SDL_LoadBMP("font7x10-hex.bmp");
|
||||
if(!temp_image)
|
||||
{
|
||||
fprintf(stderr, "Could not load hex font!\n");
|
||||
exit(-1);
|
||||
}
|
||||
SDL_SetColorKey(temp_image, SDL_SRCCOLORKEY,
|
||||
SDL_MapRGB(temp_image->format, 255, 0, 255));
|
||||
font_hex = SDL_DisplayFormat(temp_image);
|
||||
SDL_FreeSurface(temp_image);
|
||||
|
||||
for(i = 0; i < 4; i++)
|
||||
{
|
||||
char name[32];
|
||||
sprintf(name, "mouse%d.png", i);
|
||||
temp_image = IMG_Load(name);
|
||||
if(!temp_image)
|
||||
{
|
||||
fprintf(stderr, "Could not load %s!\n", name);
|
||||
exit(-1);
|
||||
}
|
||||
//mouse[i] = SDL_DisplayFormat(temp_image);
|
||||
//SDL_FreeSurface(temp_image);
|
||||
mouse[i] = temp_image; // Keep alpha
|
||||
}
|
||||
|
||||
last_avg_tick = last_tick = SDL_GetTicks();
|
||||
|
||||
memset(touchPointers, 0, sizeof(touchPointers));
|
||||
memset(accel, 0, sizeof(accel));
|
||||
memset(screenjoy, 0, sizeof(screenjoy));
|
||||
memset(gamepads, 0, sizeof(gamepads));
|
||||
|
||||
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "sizeof(int) %d long %d long long %d size_t %d", sizeof(int), sizeof(long), sizeof(long long), sizeof(size_t));
|
||||
/*
|
||||
wchar_t ss[256];
|
||||
const wchar_t *ss2 = L"String 2 ЕНГ ---";
|
||||
swprintf(ss, 256, L"String ЙЦУК --- %ls", ss2);
|
||||
char ss3[512] = "";
|
||||
char ss4[512] = "";
|
||||
for(i = 0; i < wcslen(ss); i++)
|
||||
{
|
||||
char tmp[16];
|
||||
sprintf(tmp, "%04X ", (int)ss[i]);
|
||||
strcat(ss3, tmp);
|
||||
sprintf(ss4, "%ls", ss);
|
||||
}
|
||||
__android_log_print(ANDROID_LOG_VERBOSE, "Ballfield", "swprintf: len %d data %s: %s", wcslen(ss), ss3, ss4);
|
||||
*/
|
||||
|
||||
__android_log_print(ANDROID_LOG_VERBOSE, "Ballfield", "On-screen buttons:");
|
||||
for(i = 0; i < SDL_ANDROID_SCREENKEYBOARD_BUTTON_NUM; i++)
|
||||
{
|
||||
SDL_Rect r;
|
||||
SDL_ANDROID_GetScreenKeyboardButtonPos(i, &r);
|
||||
__android_log_print(ANDROID_LOG_VERBOSE, "Ballfield", "{ %d, %d, %d, %d },", r.x, r.y, r.x+r.h, r.y+r.w);
|
||||
}
|
||||
//SDL_ANDROID_SetScreenKeyboardButtonGenerateTouchEvents(SDL_ANDROID_SCREENKEYBOARD_BUTTON_0, 1);
|
||||
//SDL_ANDROID_SetScreenKeyboardButtonGenerateTouchEvents(SDL_ANDROID_SCREENKEYBOARD_BUTTON_3, 1);
|
||||
|
||||
while(1)
|
||||
{
|
||||
SDL_Rect r;
|
||||
|
||||
/* Timing */
|
||||
tick = SDL_GetTicks();
|
||||
dt = (tick - last_tick) * 0.001f;
|
||||
last_tick = tick;
|
||||
|
||||
if( bpp == 32 )
|
||||
SDL_FillRect(screen, NULL, 0); // Clear alpha channel
|
||||
|
||||
/* Background image */
|
||||
tiled_back(back, screen, x_offs>>11, y_offs>>11);
|
||||
|
||||
/* Ballfield */
|
||||
ballfield_render(balls, screen);
|
||||
|
||||
/* Logo */
|
||||
r.x = 2;
|
||||
r.y = 2;
|
||||
SDL_BlitSurface(logo, NULL, screen, &r);
|
||||
|
||||
/* FPS counter */
|
||||
if(tick > fps_start + 1000)
|
||||
{
|
||||
fps = (float)fps_count * 1000.0 / (tick - fps_start);
|
||||
fps_count = 0;
|
||||
fps_start = tick;
|
||||
}
|
||||
|
||||
print_num(screen, font, screen->w-37, screen->h-12, fps);
|
||||
++fps_count;
|
||||
|
||||
for(i=0; i<MAX_POINTERS; i++)
|
||||
{
|
||||
if( !touchPointers[i].pressed )
|
||||
continue;
|
||||
r.x = touchPointers[i].x;
|
||||
r.y = touchPointers[i].y;
|
||||
r.w = 50 + touchPointers[i].pressure / 5;
|
||||
r.h = 50 + touchPointers[i].pressure / 5;
|
||||
r.x -= r.w/2;
|
||||
r.y -= r.h/2;
|
||||
SDL_FillRect(screen, &r, colors[i]);
|
||||
}
|
||||
int joyInput[][3] = {
|
||||
{accel[0], accel[1], 10},
|
||||
{accel[2], accel[3], 10 + abs(accel[4]) * 100 / 32767},
|
||||
{screenjoy[0], screenjoy[1], 10},
|
||||
{screenjoy[2], screenjoy[3], 10},
|
||||
{gamepads[0][0], gamepads[0][1], 10 + gamepads[0][4] * 100 / 32767},
|
||||
{gamepads[0][2], gamepads[0][3], 10 + gamepads[0][5] * 100 / 32767},
|
||||
{gamepads[0][6], gamepads[0][7], 10},
|
||||
{gamepads[1][0], gamepads[1][1], 10 + gamepads[1][4] * 100 / 32767},
|
||||
{gamepads[1][2], gamepads[1][3], 10 + gamepads[1][5] * 100 / 32767},
|
||||
{gamepads[1][6], gamepads[1][7], 10},
|
||||
{gamepads[2][0], gamepads[2][1], 10 + gamepads[2][4] * 100 / 32767},
|
||||
{gamepads[2][2], gamepads[2][3], 10 + gamepads[2][5] * 100 / 32767},
|
||||
{gamepads[2][6], gamepads[2][7], 10},
|
||||
{gamepads[3][0], gamepads[3][1], 10 + gamepads[3][4] * 100 / 32767},
|
||||
{gamepads[3][2], gamepads[3][3], 10 + gamepads[3][5] * 100 / 32767},
|
||||
{gamepads[3][6], gamepads[3][7], 10},
|
||||
};
|
||||
for( i = 0; i < 15; i++ )
|
||||
{
|
||||
r.w = joyInput[i][2];
|
||||
r.h = joyInput[i][2];
|
||||
r.x = SCREEN_W/2 + joyInput[i][0] * SCREEN_H / 65536 - r.w/2;
|
||||
r.y = SCREEN_H/2 + joyInput[i][1] * SCREEN_H / 65536 - r.w/2;
|
||||
//__android_log_print(ANDROID_LOG_INFO, "Ballfield", "Joy input %d: %d %d %d", i, joyInput[i][0], joyInput[i][1], joyInput[i][2] );
|
||||
SDL_FillRect(screen, &r, i * 123);
|
||||
}
|
||||
|
||||
int mx, my;
|
||||
int b = SDL_GetMouseState(&mx, &my);
|
||||
//__android_log_print(ANDROID_LOG_INFO, "Ballfield", "Mouse: %04d %04d buttons %d", mx, my, b);
|
||||
int cursorIdx = 0;
|
||||
if( b & SDL_BUTTON_LMASK )
|
||||
cursorIdx |= 1;
|
||||
if( b & SDL_BUTTON_RMASK )
|
||||
cursorIdx |= 2;
|
||||
r.x = mx;
|
||||
r.y = my;
|
||||
r.w = mouse[cursorIdx]->w;
|
||||
r.h = mouse[cursorIdx]->h;
|
||||
r.x -= r.w/2;
|
||||
r.y -= r.h/2;
|
||||
SDL_BlitSurface(mouse[cursorIdx], NULL, screen, &r);
|
||||
|
||||
SDL_Flip(SDL_GetVideoSurface());
|
||||
SDL_Event evt;
|
||||
while( SDL_PollEvent(&evt) )
|
||||
{
|
||||
if(evt.type == SDL_KEYUP || evt.type == SDL_KEYDOWN)
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL key event: evt %s state %s key %4d %12s scancode %4d mod %2d unicode %d", evt.type == SDL_KEYUP ? "UP " : "DOWN" , evt.key.state == SDL_PRESSED ? "PRESSED " : "RELEASED", (int)evt.key.keysym.sym, SDL_GetKeyName(evt.key.keysym.sym), (int)evt.key.keysym.scancode, (int)evt.key.keysym.mod, (int)evt.key.keysym.unicode);
|
||||
if(evt.key.keysym.sym == SDLK_ESCAPE)
|
||||
return 0;
|
||||
if( evt.key.state == SDL_RELEASED )
|
||||
{
|
||||
if(evt.key.keysym.sym == SDLK_0)
|
||||
{
|
||||
SDL_ANDROID_SetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_2, 1);
|
||||
SDL_ANDROID_SetMouseEmulationMode(0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
|
||||
}
|
||||
if(evt.key.keysym.sym == SDLK_1)
|
||||
{
|
||||
SDL_ANDROID_SetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_2, 0);
|
||||
SDL_ANDROID_SetMouseEmulationMode(1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
|
||||
}
|
||||
if(evt.key.keysym.sym == SDLK_2)
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "Async text input started");
|
||||
asyncTextInput = 1;
|
||||
asyncTextInputBuf[0] = 0;
|
||||
SDL_ANDROID_GetScreenKeyboardTextInputAsync(asyncTextInputBuf, sizeof(asyncTextInputBuf));
|
||||
}
|
||||
if(evt.key.keysym.sym == SDLK_3)
|
||||
SDL_ANDROID_SetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_DPAD, 0);
|
||||
if(evt.key.keysym.sym == SDLK_4)
|
||||
SDL_ToggleScreenKeyboard(NULL);
|
||||
if(evt.key.keysym.sym == SDLK_5)
|
||||
SDL_ANDROID_ToggleScreenKeyboardWithoutTextInput();
|
||||
}
|
||||
}
|
||||
if(evt.type == SDL_MOUSEBUTTONUP || evt.type == SDL_MOUSEBUTTONDOWN)
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL mouse button event: evt %s state %s button %d coords %d:%d", evt.type == SDL_MOUSEBUTTONUP ? "UP " : "DOWN" , evt.button.state == SDL_PRESSED ? "PRESSED " : "RELEASED", (int)evt.button.button, (int)evt.button.x, (int)evt.button.y);
|
||||
}
|
||||
if(evt.type == SDL_VIDEORESIZE)
|
||||
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL resize event: %d x %d", evt.resize.w, evt.resize.h);
|
||||
if(evt.type == SDL_ACTIVEEVENT)
|
||||
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "======= SDL active event: gain %d state %d", evt.active.gain, evt.active.state);
|
||||
// Android-specific events - accelerometer, multitoush, and on-screen joystick
|
||||
if( evt.type == SDL_JOYAXISMOTION )
|
||||
{
|
||||
if(evt.jaxis.which == 0) // Multitouch and on-screen joysticks
|
||||
{
|
||||
if(evt.jaxis.axis < 4)
|
||||
screenjoy[evt.jaxis.axis] = evt.jaxis.value;
|
||||
else
|
||||
touchPointers[evt.jaxis.axis - 4].pressure = evt.jaxis.value;
|
||||
}
|
||||
if(evt.jaxis.which == 1)
|
||||
{
|
||||
accel[evt.jaxis.axis] = evt.jaxis.value; // accelerometer and gyroscope
|
||||
}
|
||||
if(evt.jaxis.which >= 2)
|
||||
{
|
||||
// Each gamepad has 8 axes - two joystick hats, two triggers, and Ouya touchpad
|
||||
gamepads[evt.jaxis.which - 2][evt.jaxis.axis] = evt.jaxis.value;
|
||||
}
|
||||
}
|
||||
if( evt.type == SDL_JOYBUTTONDOWN || evt.type == SDL_JOYBUTTONUP )
|
||||
{
|
||||
if(evt.jbutton.which == 0) // Multitouch and on-screen joystick
|
||||
touchPointers[evt.jbutton.button].pressed = (evt.jbutton.state == SDL_PRESSED);
|
||||
}
|
||||
if( evt.type == SDL_JOYBALLMOTION )
|
||||
{
|
||||
if(evt.jball.which == 0) // Multitouch and on-screen joystick
|
||||
{
|
||||
touchPointers[evt.jball.ball].x = evt.jball.xrel;
|
||||
touchPointers[evt.jball.ball].y = evt.jball.yrel;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( screenKeyboardShown != SDL_IsScreenKeyboardShown(NULL))
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "Screen keyboard shown: %d -> %d", screenKeyboardShown, SDL_IsScreenKeyboardShown(NULL));
|
||||
screenKeyboardShown = SDL_IsScreenKeyboardShown(NULL);
|
||||
}
|
||||
if( asyncTextInput )
|
||||
{
|
||||
if( SDL_ANDROID_GetScreenKeyboardTextInputAsync(asyncTextInputBuf, sizeof(asyncTextInputBuf)) == SDL_ANDROID_TEXTINPUT_ASYNC_FINISHED)
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "Async text input: %s", asyncTextInputBuf);
|
||||
asyncTextInput = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Animate */
|
||||
x_speed = 500.0 * sin(t * 0.37);
|
||||
y_speed = 500.0 * sin(t * 0.53);
|
||||
z_speed = 400.0 * sin(t * 0.21);
|
||||
if( SDL_GetKeyState(NULL)[SDLK_LEFT] )
|
||||
x_speed -= 100000 * dt;
|
||||
if( SDL_GetKeyState(NULL)[SDLK_RIGHT] )
|
||||
x_speed += 100000 * dt;
|
||||
if( SDL_GetKeyState(NULL)[SDLK_UP] )
|
||||
y_speed -= 100000 * dt;
|
||||
if( SDL_GetKeyState(NULL)[SDLK_DOWN] )
|
||||
y_speed += 100000 * dt;
|
||||
|
||||
ballfield_move(balls, x_speed, y_speed, z_speed);
|
||||
x_offs -= x_speed;
|
||||
y_offs -= y_speed;
|
||||
|
||||
t += dt;
|
||||
}
|
||||
|
||||
ballfield_free(balls);
|
||||
SDL_FreeSurface(back);
|
||||
SDL_FreeSurface(logo);
|
||||
SDL_FreeSurface(font);
|
||||
return 0;
|
||||
}
|
||||
@@ -7,10 +7,10 @@ AppName="BasiliskII"
|
||||
AppFullName=net.cebix.basilisk
|
||||
|
||||
# Application version code (integer)
|
||||
AppVersionCode=10001
|
||||
AppVersionCode=10005
|
||||
|
||||
# Application user-visible version name (string)
|
||||
AppVersionName="1.0.0.01"
|
||||
AppVersionName="1.0.0.05"
|
||||
|
||||
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
|
||||
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
|
||||
@@ -236,3 +236,6 @@ AdmobTestDeviceId=
|
||||
# Your AdMob banner size (BANNER/IAB_BANNER/IAB_LEADERBOARD/IAB_MRECT/IAB_WIDE_SKYSCRAPER/SMART_BANNER)
|
||||
AdmobBannerSize=
|
||||
|
||||
# Hide Android system mouse cursor image when USB mouse is attached (y) or (n) - the app must draw it's own mouse cursor
|
||||
HideSystemMousePointer=y
|
||||
|
||||
|
||||
@@ -9,16 +9,19 @@ ln -sf libsdl-1.2.so $LOCAL_PATH/../../../obj/local/$1/libpthread.so
|
||||
ln -sf libsdl_image.so $LOCAL_PATH/../../../obj/local/$1/libSDL_image.so
|
||||
ln -sf libsdl_ttf.so $LOCAL_PATH/../../../obj/local/$1/libSDL_ttf.so
|
||||
|
||||
JOBS=4
|
||||
|
||||
if [ \! -f basiliskii/src/Unix/configure ] ; then
|
||||
sh -c "cd basiliskii/src/Unix && ./autogen.sh"
|
||||
rm -f basiliskii/src/Unix/Makefile
|
||||
fi
|
||||
|
||||
if [ \! -f basiliskii/src/Unix/Makefile ] ; then
|
||||
env CFLAGS="-Ofast" \
|
||||
env LIBS="-lgnustl_static" \
|
||||
../setEnvironment-$1.sh sh -c "cd basiliskii/src/Unix && ./configure --build=x86_64-unknown-linux-gnu --host=$2 --enable-sdl-video --enable-sdl-audio --without-gtk --without-esd --without-x"
|
||||
env LIBS="-lgnustl_static -lc -lm" \
|
||||
../setEnvironment-$1.sh sh -c "cd basiliskii/src/Unix && env no_dev_ptmx=1 ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no ac_cv_sys_file_offset_bits=no \
|
||||
./configure --build=x86_64-unknown-linux-gnu --host=$2 --enable-sdl-video --enable-sdl-audio --without-gtk --without-esd --without-x" || exit 1
|
||||
fi
|
||||
|
||||
make -C basiliskii/src/Unix && mv -f basiliskii/src/Unix/BasiliskII libapplication-$1.so
|
||||
make -C basiliskii/src/Unix -j$JOBS && mv -f basiliskii/src/Unix/BasiliskII libapplication-$1.so
|
||||
|
||||
|
||||
BIN
project/jni/application/basiliskii/AndroidData/cfg.zip
Normal file → Executable file
BIN
project/jni/application/basiliskii/AndroidData/cfg.zip
Normal file → Executable file
Binary file not shown.
BIN
project/jni/application/basiliskii/AndroidData/guichan-gui.zip
Normal file → Executable file
BIN
project/jni/application/basiliskii/AndroidData/guichan-gui.zip
Normal file → Executable file
Binary file not shown.
Submodule project/jni/application/basiliskii/basiliskii updated: 3405babdd2...06a7bb327c
Binary file not shown.
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 7.9 KiB |
@@ -13,11 +13,13 @@ AppVersionCode=1406
|
||||
AppVersionName="1.4.06"
|
||||
|
||||
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
|
||||
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
|
||||
# If you'll start Description with '!' symbol it will be enabled by default, '!!' will also hide the entry from the menu, so it cannot be disabled
|
||||
# If the URL in in the form ':dir/file.dat:http://URL/' it will be downloaded as binary BLOB to the application dir and not unzipped
|
||||
# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -
|
||||
# these files are put inside .apk package by build system
|
||||
# Also please avoid 'https://' URLs, many Android devices do not have trust certificates and will fail to connect to SF.net over HTTPS
|
||||
# If the URL does not contain 'http://' or 'https://', it is treated as file from 'project/jni/application/src/AndroidData' dir -
|
||||
# these files are put inside .apk package by the build system
|
||||
# You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version for obb file
|
||||
# You can use .zip.xz archives for better compression, but you need to add 'lzma' to CompiledLibraries
|
||||
# Generate .zip.xz files like this: zip -0 -r data.zip your-data/* ; xz -8 data.zip
|
||||
AppDataDownloadUrl="!Game data|data3.zip"
|
||||
|
||||
# Reset SDL config when updating application to the new version (y) / (n)
|
||||
@@ -46,10 +48,17 @@ NeedDepthBuffer=n
|
||||
# Enable OpenGL stencil buffer (needed only for 3-d applications, small speed decrease) (y) or (n)
|
||||
NeedStencilBuffer=n
|
||||
|
||||
# Try to use GLES 2.x context - will revert to GLES 1.X if unsupported by device
|
||||
# Use GLES 2.x context
|
||||
# you need this option only if you're developing 3-d app (y) or (n)
|
||||
NeedGles2=n
|
||||
|
||||
# Use GLES 3.x context
|
||||
# you need this option only if you're developing 3-d app (y) or (n)
|
||||
NeedGles3=n
|
||||
|
||||
# Use gl4es library for provide OpenGL 1.x functionality to OpenGL ES accelerated cards (y) or (n)
|
||||
UseGl4es=
|
||||
|
||||
# Application uses software video buffer - you're calling SDL_SetVideoMode() without SDL_HWSURFACE and without SDL_OPENGL,
|
||||
# this will allow small speed optimization. Enable this even when you're using SDL_HWSURFACE. (y) or (n)
|
||||
SwVideoMode=y
|
||||
@@ -80,6 +89,14 @@ CompatibilityHacksStaticInit=n
|
||||
# On-screen Android soft text input emulates hardware keyboard, this will only work with Hackers Keyboard app (y)/(n)
|
||||
CompatibilityHacksTextInputEmulatesHwKeyboard=n
|
||||
|
||||
# Built-in text input keyboards with custom layouts for emulators, requires CompatibilityHacksTextInputEmulatesHwKeyboard=y
|
||||
# 0 or empty - standard Android keyboard
|
||||
# 1 - Simple QWERTY keyboard, no function keys, no arrow keys
|
||||
# 2 - Commodore 64 keyboard
|
||||
# 3 - Amiga keyboard
|
||||
# 4 - Atari800 keyboard
|
||||
TextInputKeyboard=
|
||||
|
||||
# Hack for broken devices: prevent audio chopping, by sleeping a bit after pushing each audio chunk (y)/(n)
|
||||
CompatibilityHacksPreventAudioChopping=n
|
||||
|
||||
@@ -113,6 +130,9 @@ RightMouseButtonLongPress=
|
||||
# Show SDL mouse cursor, for applications that do not draw cursor at all (y) or (n)
|
||||
ShowMouseCursor=n
|
||||
|
||||
# Screen follows mouse cursor, when it's covered by soft keyboard, this works only in software video mode (y) or (n)
|
||||
ScreenFollowsMouse=
|
||||
|
||||
# Generate more touch events, by default SDL generates one event per one video frame, this is useful for drawing apps (y) or (n)
|
||||
GenerateSubframeTouchEvents=
|
||||
|
||||
@@ -145,6 +165,9 @@ AppUsesAccelerometer=n
|
||||
# Application uses gyroscope (y) or (n), the gyroscope will be used as joystick 1 axes 2-4
|
||||
AppUsesGyroscope=n
|
||||
|
||||
# Application uses orientation sensor (y) or (n), reported as joystick 1 axes 8-10
|
||||
AppUsesOrientationSensor=
|
||||
|
||||
# Use gyroscope to move mouse cursor (y) or (n), it eats battery, and can be disabled in settings, do not use with AppUsesGyroscope setting
|
||||
MoveMouseWithGyroscope=
|
||||
|
||||
@@ -156,15 +179,21 @@ AppUsesMultitouch=n
|
||||
# This option will add additional permission to Android manifest (y)/(n)
|
||||
AppRecordsAudio=n
|
||||
|
||||
# Application needs to access SD card. If your data files are bigger than 5 Mb, enable it. (y) / (n)
|
||||
# Application needs read/write access SD card. Always disable it, unless you want to access user photos and downloads. (y) / (n)
|
||||
AccessSdCard=
|
||||
|
||||
# Application needs to read it's own OBB file. Enable this if you are using Play Store expansion files. (y) / (n)
|
||||
ReadObbFile=
|
||||
|
||||
# Application needs Internet access. If you disable it, you'll have to bundle all your data files inside .apk (y) / (n)
|
||||
AccessInternet=
|
||||
|
||||
# Immersive mode - Android will hide on-screen Home/Back keys. Looks bad if you invoke Android keyboard. (y) / (n)
|
||||
ImmersiveMode=
|
||||
|
||||
# Hide Android system mouse cursor image when USB mouse is attached (y) or (n) - the app must draw it's own mouse cursor
|
||||
HideSystemMousePointer=
|
||||
|
||||
# Application implements Android-specific routines to put to background, and will not draw anything to screen
|
||||
# between SDL_ACTIVEEVENT lost / gained notifications - you should check for them
|
||||
# rigth after SDL_Flip(), if (n) then SDL_Flip() will block till app in background (y) or (n)
|
||||
@@ -188,38 +217,62 @@ RedefinedKeysScreenKb="RETURN SPACE"
|
||||
RedefinedKeysScreenKbNames="RETURN SPACE"
|
||||
|
||||
# On-screen keys theme
|
||||
# 0 = Ultimate Droid by Sean Stieber (green, with gamepad joystick)
|
||||
# 1 = Simple Theme by Beholder (white, with gamepad joystick)
|
||||
# 0 = Ultimate Droid by Sean Stieber (green, with cross joystick)
|
||||
# 1 = Simple Theme by Beholder (white, with cross joystick)
|
||||
# 2 = Sun by Sirea (yellow, with round joystick)
|
||||
# 3 = Keen by Gerstrong (multicolor, with round joystick)
|
||||
# 4 = Retro by Santiago Radeff (red/white, with cross joystick)
|
||||
# 5 = GameBoy from RetroArch
|
||||
# 6 = PlayStation from RetroArch
|
||||
# 7 = SuperNintendo from RetroArch
|
||||
# 8 = DualShock from RetroArch
|
||||
# 9 = Nintendo64 from RetroArch
|
||||
TouchscreenKeysTheme=2
|
||||
|
||||
# Redefine gamepad keys to SDL keysyms, button order is:
|
||||
# A B X Y L1 R1 L2 R2 LThumb RThumb
|
||||
# A B X Y L1 R1 L2 R2 LThumb RThumb Start Select Up Down Left Right LThumbUp LThumbDown LThumbLeft LThumbRight RThumbUp RThumbDown RThumbLeft RThumbRight
|
||||
RedefinedKeysGamepad="RETURN ESCAPE SPACE SPACE"
|
||||
|
||||
# Redefine keys for the second gamepad, same as the first gamepad if not set:
|
||||
RedefinedKeysSecondGamepad=""
|
||||
|
||||
# Redefine keys for the third gamepad, same as the first gamepad if not set:
|
||||
RedefinedKeysThirdGamepad=""
|
||||
|
||||
# Redefine keys for the fourth gamepad, same as the first gamepad if not set:
|
||||
RedefinedKeysFourthGamepad=""
|
||||
|
||||
# How long to show startup menu button, in msec, 0 to disable startup menu
|
||||
StartupMenuButtonTimeout=0
|
||||
|
||||
# Menu items to hide from startup menu, available menu items:
|
||||
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
|
||||
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.StorageAccessConfig SettingsMenuMisc.CommandlineConfig SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
|
||||
HiddenMenuOptions='SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.MouseConfigMainMenu'
|
||||
|
||||
# Menu items to show at startup - this is Java code snippet, leave empty for default
|
||||
# new SettingsMenuMisc.ShowReadme(), (AppUsesMouse \&\& \! ForceRelativeMouseMode \? new SettingsMenuMouse.DisplaySizeConfig(true) : new SettingsMenu.DummyMenu()), new SettingsMenuMisc.OptionalDownloadConfig(true), new SettingsMenuMisc.GyroscopeCalibration()
|
||||
# Available menu items:
|
||||
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
|
||||
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.StorageAccessConfig SettingsMenuMisc.CommandlineConfig SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
|
||||
FirstStartMenuOptions=''
|
||||
|
||||
# Specify architectures to compile, 'all' or 'y' to compile for all architectures.
|
||||
# Available architectures: armeabi armeabi-v7a armeabi-v7a-hard x86 mips
|
||||
MultiABI='armeabi-v7a x86'
|
||||
|
||||
# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower
|
||||
AppMinimumRAM=0
|
||||
|
||||
# GCC version, or 'clang' for CLANG
|
||||
NDK_TOOLCHAIN_VERSION=
|
||||
|
||||
# Android platform version.
|
||||
# android-16 = Android 4.1, the earliest supported version in NDK r18.
|
||||
# android-18 = Android 4.3, the first version supporting GLES3.
|
||||
# android-21 = Android 5.1, the first version with SO_REUSEPORT defined.
|
||||
APP_PLATFORM=
|
||||
|
||||
# Specify architectures to compile, 'all' or 'y' to compile for all architectures.
|
||||
# Available architectures: armeabi-v7a arm64-v8a x86 x86_64
|
||||
MultiABI='arm64-v8a'
|
||||
|
||||
# Optional shared libraries to compile - removing some of them will save space
|
||||
# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed
|
||||
# MP3 patents are expired, but libmad license is GPL, not LGPL
|
||||
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2
|
||||
CompiledLibraries="sdl_image sdl_mixer"
|
||||
|
||||
@@ -229,6 +282,9 @@ CustomBuildScript=n
|
||||
# Aditional CFLAGS for application
|
||||
AppCflags=''
|
||||
|
||||
# Aditional C++-specific compiler flags for application, added after AppCflags
|
||||
AppCppflags=''
|
||||
|
||||
# Additional LDFLAGS for application
|
||||
AppLdflags=''
|
||||
|
||||
@@ -260,3 +316,6 @@ AdmobBannerSize=
|
||||
# Google Play Game Services application ID, required for cloud saves to work
|
||||
GooglePlayGameServicesId=520035027247
|
||||
|
||||
# The app will open files with following extension, file path will be added to commandline params
|
||||
AppOpenFileExtension=''
|
||||
|
||||
|
||||
1
project/jni/application/bochs/.gitignore
vendored
1
project/jni/application/bochs/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/*.so
|
||||
@@ -1 +0,0 @@
|
||||
bochs/android/bochs/AndroidAppSettings.cfg
|
||||
@@ -1 +0,0 @@
|
||||
bochs/android/bochs/AndroidBuild.sh
|
||||
@@ -1 +0,0 @@
|
||||
bochs/android/bochs/AndroidData
|
||||
Submodule project/jni/application/bochs/bochs deleted from 14678cc8ea
@@ -1 +0,0 @@
|
||||
bochs/android/bochs/icon.png
|
||||
1
project/jni/application/c-dogs/.gitignore
vendored
1
project/jni/application/c-dogs/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/AndroidData
|
||||
@@ -1,237 +0,0 @@
|
||||
# The application settings for Android libSDL port
|
||||
|
||||
# Specify application name (e.x. My Application)
|
||||
AppName="C-Dogs"
|
||||
|
||||
# Specify reversed site name of application (e.x. com.mysite.myapp)
|
||||
AppFullName=cxong.cdogs
|
||||
|
||||
# Application version code (integer)
|
||||
AppVersionCode=101
|
||||
|
||||
# Application user-visible version name (string)
|
||||
AppVersionName="1.01"
|
||||
|
||||
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
|
||||
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
|
||||
# If the URL in in the form ':dir/file.dat:http://URL/' it will be downloaded as binary BLOB to the application dir and not unzipped
|
||||
# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -
|
||||
# these files are put inside .apk package by build system
|
||||
# Also please avoid 'https://' URLs, many Android devices do not have trust certificates and will fail to connect to SF.net over HTTPS
|
||||
AppDataDownloadUrl="!!Game data|data.zip"
|
||||
|
||||
# Reset SDL config when updating application to the new version (y) / (n)
|
||||
ResetSdlConfigForThisVersion=n
|
||||
|
||||
# Delete application data files when upgrading (specify file/dir paths separated by spaces)
|
||||
DeleteFilesOnUpgrade="%"
|
||||
|
||||
# Here you may type readme text, which will be shown during startup. Format is:
|
||||
# Text in English, use \\\\n to separate lines (that's four backslashes)^de:Text in Deutsch^ru:Text in Russian^button:Button that will open some URL:http://url-to-open/
|
||||
ReadmeText='^Readme text'
|
||||
|
||||
# libSDL version to use (1.2/1.3/2.0)
|
||||
LibSdlVersion=1.2
|
||||
|
||||
# Specify screen orientation: (v)ertical/(p)ortrait or (h)orizontal/(l)andscape
|
||||
ScreenOrientation=h
|
||||
|
||||
# Do not allow device to sleep when the application is in foreground, set this for video players or apps which use accelerometer
|
||||
InhibitSuspend=n
|
||||
|
||||
# Video color depth - 16 BPP is the fastest and supported for all modes, 24 bpp is supported only
|
||||
# with SwVideoMode=y, SDL_OPENGL mode supports everything. (16)/(24)/(32)
|
||||
VideoDepthBpp=16
|
||||
|
||||
# Enable OpenGL depth buffer (needed only for 3-d applications, small speed decrease) (y) or (n)
|
||||
NeedDepthBuffer=n
|
||||
|
||||
# Enable OpenGL stencil buffer (needed only for 3-d applications, small speed decrease) (y) or (n)
|
||||
NeedStencilBuffer=n
|
||||
|
||||
# Try to use GLES 2.x context - will revert to GLES 1.X if unsupported by device
|
||||
# you need this option only if you're developing 3-d app (y) or (n)
|
||||
NeedGles2=n
|
||||
|
||||
# Application uses software video buffer - you're calling SDL_SetVideoMode() without SDL_HWSURFACE and without SDL_OPENGL,
|
||||
# this will allow small speed optimization. Enable this even when you're using SDL_HWSURFACE. (y) or (n)
|
||||
SwVideoMode=n
|
||||
|
||||
# Application video output will be resized to fit into native device screen (y)/(n)
|
||||
SdlVideoResize=y
|
||||
|
||||
# Application resizing will keep 4:3 aspect ratio, with black bars at sides (y)/(n)
|
||||
SdlVideoResizeKeepAspect=y
|
||||
|
||||
# Application does not call SDL_Flip() or SDL_UpdateRects() appropriately, or draws from non-main thread -
|
||||
# enabling the compatibility mode will force screen update every 100 milliseconds, which is laggy and inefficient (y) or (n)
|
||||
CompatibilityHacks=n
|
||||
|
||||
# Application initializes SDL audio/video inside static constructors (which is bad, you won't be able to run ndk-gdb) (y)/(n)
|
||||
CompatibilityHacksStaticInit=n
|
||||
|
||||
# On-screen Android soft text input emulates hardware keyboard, this will only work with Hackers Keyboard app (y)/(n)
|
||||
CompatibilityHacksTextInputEmulatesHwKeyboard=n
|
||||
|
||||
# Hack for broken devices: prevent audio chopping, by sleeping a bit after pushing each audio chunk (y)/(n)
|
||||
CompatibilityHacksPreventAudioChopping=n
|
||||
|
||||
# Hack for broken apps: application ignores audio buffer size returned by SDL (y)/(n)
|
||||
CompatibilityHacksAppIgnoresAudioBufferSize=n
|
||||
|
||||
# Hack for VCMI: preload additional shared libraries before aplication start
|
||||
CompatibilityHacksAdditionalPreloadedSharedLibraries=""
|
||||
|
||||
# Hack for Free Heroes 2, which redraws the screen inside SDL_PumpEvents(): slow and compatible SDL event queue -
|
||||
# do not use it with accelerometer/gyroscope, or your app may freeze at random (y)/(n)
|
||||
CompatibilityHacksSlowCompatibleEventQueue=n
|
||||
|
||||
# Save and restore OpenGL state when drawing on-screen keyboard for apps that use SDL_OPENGL
|
||||
CompatibilityHacksTouchscreenKeyboardSaveRestoreOpenGLState=n
|
||||
|
||||
# Application uses SDL_UpdateRects() properly, and does not draw in any region outside those rects.
|
||||
# This improves drawing speed, but I know only one application that does that, and it's written by me (y)/(n)
|
||||
CompatibilityHacksProperUsageOfSDL_UpdateRects=
|
||||
|
||||
# Application uses mouse (y) or (n), this will show mouse emulation dialog to the user
|
||||
AppUsesMouse=n
|
||||
|
||||
# Application needs two-button mouse, will also enable advanced point-and-click features (y) or (n)
|
||||
AppNeedsTwoButtonMouse=n
|
||||
|
||||
# Show SDL mouse cursor, for applications that do not draw cursor at all (y) or (n)
|
||||
ShowMouseCursor=n
|
||||
|
||||
# Generate more touch events, by default SDL generates one event per one video frame, this is useful for drawing apps (y) or (n)
|
||||
GenerateSubframeTouchEvents=
|
||||
|
||||
# Force relative (laptop) mouse movement mode, useful when both on-screen keyboard and mouse are needed (y) or (n)
|
||||
ForceRelativeMouseMode=n
|
||||
|
||||
# Application needs arrow keys (y) or (n), will show on-screen dpad/joystick (y) or (n)
|
||||
AppNeedsArrowKeys=y
|
||||
|
||||
# Application needs text input (y) or (n), enables button for text input on screen
|
||||
AppNeedsTextInput=y
|
||||
|
||||
# Application uses joystick (y) or (n), the on-screen DPAD will be used as joystick 0 axes 0-1
|
||||
AppUsesJoystick=n
|
||||
|
||||
# Application uses second on-screen joystick, as SDL joystick 0 axes 2-3 (y)/(n)
|
||||
AppUsesSecondJoystick=n
|
||||
|
||||
# Application uses accelerometer (y) or (n), the accelerometer will be used as joystick 1 axes 0-1 and 5-7
|
||||
AppUsesAccelerometer=n
|
||||
|
||||
# Application uses gyroscope (y) or (n), the gyroscope will be used as joystick 1 axes 2-4
|
||||
AppUsesGyroscope=n
|
||||
|
||||
# Application uses multitouch (y) or (n), multitouch events are passed as SDL_JOYBALLMOTION events for the joystick 0
|
||||
AppUsesMultitouch=n
|
||||
|
||||
# Application records audio (it will use any available source, such a s microphone)
|
||||
# API is defined in file SDL_android.h: int SDL_ANDROID_OpenAudioRecording(SDL_AudioSpec *spec); void SDL_ANDROID_CloseAudioRecording(void);
|
||||
# This option will add additional permission to Android manifest (y)/(n)
|
||||
AppRecordsAudio=n
|
||||
|
||||
# Application needs to access SD card. If your data files are bigger than 5 Mb, enable it. (y) / (n)
|
||||
AccessSdCard=
|
||||
|
||||
# Immersive mode - Android will hide on-screen Home/Back keys. Looks bad if you invoke Android keyboard. (y) / (n)
|
||||
ImmersiveMode=
|
||||
|
||||
# Application implements Android-specific routines to put to background, and will not draw anything to screen
|
||||
# between SDL_ACTIVEEVENT lost / gained notifications - you should check for them
|
||||
# rigth after SDL_Flip(), if (n) then SDL_Flip() will block till app in background (y) or (n)
|
||||
# This option is reported to be buggy, sometimes failing to restore video state
|
||||
NonBlockingSwapBuffers=n
|
||||
|
||||
# Redefine common hardware keys to SDL keysyms
|
||||
# BACK hardware key is available on all devices, MENU is available on pre-ICS devices, other keys may be absent
|
||||
# SEARCH and CALL by default return same keycode as DPAD_CENTER - one of those keys is available on most devices
|
||||
# Use word NO_REMAP if you want to preserve native functionality for certain key (volume keys are 3-rd and 4-th)
|
||||
# Keys: TOUCHSCREEN (works only when AppUsesMouse=n), DPAD_CENTER/SEARCH, VOLUMEUP, VOLUMEDOWN, MENU, BACK, CAMERA
|
||||
RedefinedKeys="SPACE RETURN NO_REMAP NO_REMAP SPACE ESCAPE"
|
||||
|
||||
# Number of virtual keyboard keys (currently 6 is maximum)
|
||||
AppTouchscreenKeyboardKeysAmount=3
|
||||
|
||||
# Number of virtual keyboard keys that support autofire (currently 2 is maximum)
|
||||
AppTouchscreenKeyboardKeysAmountAutoFire=0
|
||||
|
||||
# Redefine on-screen keyboard keys to SDL keysyms - 6 keyboard keys + 4 multitouch gestures (zoom in/out and rotate left/right)
|
||||
RedefinedKeysScreenKb="RETURN RSHIFT TAB"
|
||||
|
||||
# Names for on-screen keyboard keys, such as Fire, Jump, Run etc, separated by spaces, they are used in SDL config menu
|
||||
RedefinedKeysScreenKbNames="Fire Weapons Map"
|
||||
|
||||
# On-screen keys theme
|
||||
# 0 = Ultimate Droid by Sean Stieber (green, with gamepad joystick)
|
||||
# 1 = Simple Theme by Beholder (white, with gamepad joystick)
|
||||
# 2 = Sun by Sirea (yellow, with round joystick)
|
||||
# 3 = Keen by Gerstrong (multicolor, with round joystick)
|
||||
TouchscreenKeysTheme=1
|
||||
|
||||
# Redefine gamepad keys to SDL keysyms, button order is:
|
||||
# A B X Y L1 R1 L2 R2 LThumb RThumb
|
||||
RedefinedKeysGamepad="RETURN RSHIFT TAB TAB RSHIFT RETURN"
|
||||
|
||||
# How long to show startup menu button, in msec, 0 to disable startup menu
|
||||
StartupMenuButtonTimeout=0
|
||||
|
||||
# Menu items to hide from startup menu, available menu items:
|
||||
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout
|
||||
HiddenMenuOptions=''
|
||||
|
||||
# Menu items to show at startup - this is Java code snippet, leave empty for default
|
||||
# new SettingsMenuMisc.ShowReadme(), (AppUsesMouse \&\& \! ForceRelativeMouseMode \? new SettingsMenuMouse.DisplaySizeConfig(true) : new SettingsMenu.DummyMenu()), new SettingsMenuMisc.OptionalDownloadConfig(true), new SettingsMenuMisc.GyroscopeCalibration()
|
||||
# Available menu items:
|
||||
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout
|
||||
FirstStartMenuOptions=''
|
||||
|
||||
# Enable multi-ABI binary, with hardware FPU support - it will also work on old devices,
|
||||
# but .apk size is 2x bigger (y) / (n) / (x86) / (all)
|
||||
MultiABI=all
|
||||
|
||||
# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower
|
||||
AppMinimumRAM=0
|
||||
|
||||
# Optional shared libraries to compile - removing some of them will save space
|
||||
# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed
|
||||
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2
|
||||
CompiledLibraries="sdl_image sdl_mixer"
|
||||
|
||||
# Application uses custom build script AndroidBuild.sh instead of Android.mk (y) or (n)
|
||||
CustomBuildScript=n
|
||||
|
||||
# Aditional CFLAGS for application
|
||||
AppCflags='-O2 -finline-functions -D__MACTYPES__ --include jni/application/android_debug.h'
|
||||
|
||||
# Additional LDFLAGS for application
|
||||
AppLdflags=''
|
||||
|
||||
# If application has headers with the same name as system headers, this option tries to fix compiler flags to make it compilable
|
||||
AppOverlapsSystemHeaders=
|
||||
|
||||
# Build only following subdirs (empty will build all dirs, ignored with custom script)
|
||||
AppSubdirsBuild='src/src src/src/cdogs src/src/json src/src/missions src/src/tinydir src/src/cdogs/hqx/src'
|
||||
|
||||
# Exclude these files from build
|
||||
AppBuildExclude='src/src/cdogsed.c src/src/cdogs/hqx/src/hqx.c'
|
||||
|
||||
# Application command line parameters, including app name as 0-th param
|
||||
AppCmdline='cdogs --fullscreen --screen=800x480'
|
||||
|
||||
# Screen size is used by Google Play to prevent an app to be installed on devices with smaller screens
|
||||
# Minimum screen size that application supports: (s)mall / (m)edium / (l)arge
|
||||
MinimumScreenSize=s
|
||||
|
||||
# Your AdMob Publisher ID, (n) if you don't want advertisements
|
||||
AdmobPublisherId=n
|
||||
|
||||
# Your AdMob test device ID, to receive a test ad
|
||||
AdmobTestDeviceId=
|
||||
|
||||
# Your AdMob banner size (BANNER/IAB_BANNER/IAB_LEADERBOARD/IAB_MRECT/IAB_WIDE_SKYSCRAPER/SMART_BANNER)
|
||||
AdmobBannerSize=
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Patching..."
|
||||
[ -e src/patched.flag ] || { patch -p1 -d src < android.diff && touch src/patched.flag || exit 1 ; }
|
||||
|
||||
echo "Archiving data"
|
||||
mkdir -p AndroidData
|
||||
cd src
|
||||
#git submodule update --init --recursive
|
||||
cmake . -DCDOGS_DATA_DIR=\"./\" || { echo "Please install cmake: sudo apt-get install cmake" ; exit 1 ; } || exit 1
|
||||
zip -r ../AndroidData/data.zip doc dogfights graphics missions music sounds >/dev/null
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
diff --git a/src/cdogs/files.h b/src/cdogs/files.h
|
||||
index 2a231df..b42ce0d 100644
|
||||
--- a/src/cdogs/files.h
|
||||
+++ b/src/cdogs/files.h
|
||||
@@ -81,6 +81,8 @@ ssize_t f_read(FILE *f, void *buf, size_t size);
|
||||
ssize_t f_read32(FILE *f, void *buf, size_t size);
|
||||
ssize_t f_read16(FILE *f, void *buf, size_t size);
|
||||
|
||||
+#undef swap32
|
||||
+#undef swap16
|
||||
void swap32 (void *d);
|
||||
void swap16 (void *d);
|
||||
|
||||
diff --git a/src/json/json.c b/src/json/json.c
|
||||
index fb928d4..be53ea8 100644
|
||||
--- a/src/json/json.c
|
||||
+++ b/src/json/json.c
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <assert.h>
|
||||
#include <memory.h>
|
||||
#include <sys/types.h>
|
||||
+#include <limits.h>
|
||||
|
||||
|
||||
enum LEX_VALUE
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index c44844e..3d1170d 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -95,7 +95,7 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
-set(CDOGS_DATA_DIR "../")
|
||||
+set(CDOGS_DATA_DIR "./")
|
||||
set(CDOGS_CFG_DIR ".cdogs/")
|
||||
SET(SOURCE_DIRECTORY ".")
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ".")
|
||||
@@ -1 +0,0 @@
|
||||
src/build/linux/cdogs-icon.48.png
|
||||
@@ -1,9 +0,0 @@
|
||||
Quick compilation guide for Debian/Ubuntu (Windows is not supported, MacOsX should be okay though):
|
||||
Download SDL Git repo from https://github.com/pelya/commandergenius,
|
||||
install latest Android SDK, Android NDK r8b or newer, and "ant" tool (sudo apt-get install ant),
|
||||
then launch commands:
|
||||
git submodule update --init --recursive project/jni/application/c-dogs/src
|
||||
rm project/jni/application/src
|
||||
ln -s c-dogs project/jni/application/src
|
||||
./build.sh
|
||||
That should do it.
|
||||
Submodule project/jni/application/c-dogs/src deleted from f5b9c36b17
@@ -7,10 +7,10 @@ AppName="Commander Genius"
|
||||
AppFullName=net.sourceforge.clonekeenplus
|
||||
|
||||
# Application version code (integer)
|
||||
AppVersionCode=198700
|
||||
AppVersionCode=207010
|
||||
|
||||
# Application user-visible version name (string)
|
||||
AppVersionName="1.9.8.7 Beta"
|
||||
AppVersionName="2.0.7 Release"
|
||||
|
||||
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
|
||||
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
|
||||
@@ -18,7 +18,7 @@ AppVersionName="1.9.8.7 Beta"
|
||||
# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -
|
||||
# these files are put inside .apk package by build system
|
||||
# Also please avoid 'https://' URLs, many Android devices do not have trust certificates and will fail to connect to SF.net over HTTPS
|
||||
AppDataDownloadUrl="!Games Center|gamecatalogue.zip^!Keen1|keen1.zip^!Keen4|keen4.zip^!Python3 support - 20 Mb|http://sourceforge.net/projects/clonekeenplus/files/extras/python35-assets-android.zip/download ^High-quality GFX and music - 55 Mb|http://sourceforge.net/projects/clonekeenplus/files/High%20Quality%20Packs/Version%202.x/hqpv26.zip/download"
|
||||
AppDataDownloadUrl="!Games Center|gamecatalogue.zip^!Keen1|keen1.zip^!Keen4|keen4.zip^High-quality GFX and music - 55 Mb|http://sourceforge.net/projects/clonekeenplus/files/High%20Quality%20Packs/Version%202.x/hqpv26.zip/download"
|
||||
|
||||
# Reset SDL config when updating application to the new version (y) / (n)
|
||||
ResetSdlConfigForThisVersion=y
|
||||
@@ -201,33 +201,38 @@ FirstStartMenuOptions=''
|
||||
|
||||
# Enable multi-ABI binary, with hardware FPU support - it will also work on old devices,
|
||||
# but .apk size is 2x bigger (y) / (n) / (x86) / (all)
|
||||
MultiABI='x86'
|
||||
MultiABI='armeabi-v7a'
|
||||
#MultiABI='y'
|
||||
|
||||
# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower
|
||||
AppMinimumRAM=64
|
||||
|
||||
# Optional shared libraries to compile - removing some of them will save space
|
||||
# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed
|
||||
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python python3 boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2
|
||||
CompiledLibraries="sdl_image boost_system crypto ssl curl vorbis ogg python3"
|
||||
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2
|
||||
CompiledLibraries="sdl_image sdl_mixer boost_system crypto ssl curl vorbis ogg"
|
||||
|
||||
# Application uses custom build script AndroidBuild.sh instead of Android.mk (y) or (n)
|
||||
CustomBuildScript=n
|
||||
|
||||
# Aditional CFLAGS for application
|
||||
AppCflags='-frtti -fexceptions -finline-functions -DOGG=1 -DDOWNLOADER=1 -DANDROID=1 -DREFKEEN_VER_KDREAMS -DUSE_PYTHON3=1 -DGRMODE=EGAGR -DREFKEEN_VER_KDREAMS_ANYEGA_ALL -DIOAPI_NO_64 -DBUILD_TYPE=LINUX -DTARGET_LNX=1 -DNOTYPESAVE -Werror=strict-aliasing -Werror=cast-align -Werror=pointer-arith -Werror=address -std=c++11 -Ijni/../jni/application/commandergenius/commandergenius/lib/GsKit -Ijni/vorbis/include/vorbis -Ijni/curl/include -Ijni/python3/include/python3.5m'
|
||||
AppCflags='-frtti -fexceptions -finline-functions -DOGG=1 -DUSE_FILE32API -DDOWNLOADER=1 -DANDROID=1 -DREFKEEN_VER_KDREAMS -DGRMODE=EGAGR -DREFKEEN_VER_KDREAMS_ANYEGA_ALL -DIOAPI_NO_64 -DBUILD_TYPE=LINUX -DTARGET_LNX=1 -DNOTYPESAVE -Werror=strict-aliasing -Werror=cast-align -Werror=pointer-arith -Werror=address -std=c99 -Ijni/../jni/application/commandergenius/commandergenius/GsKit -Ijni/vorbis/include/vorbis -Ijni/curl/include'
|
||||
|
||||
# Aditional CXXFLAGS for application
|
||||
AppCppflags='-frtti -fexceptions -finline-functions -DOGG=1 -DUSE_FILE32API -DDOWNLOADER=1 -DANDROID=1 -DREFKEEN_VER_KDREAMS -DGRMODE=EGAGR -DREFKEEN_VER_KDREAMS_ANYEGA_ALL -DIOAPI_NO_64 -DBUILD_TYPE=LINUX -DTARGET_LNX=1 -DNOTYPESAVE -Werror=strict-aliasing -Werror=cast-align -Werror=pointer-arith -Werror=address -std=c++14 -Ijni/../jni/application/commandergenius/commandergenius/GsKit -Ijni/vorbis/include/vorbis -Ijni/curl/include'
|
||||
|
||||
|
||||
# Additional LDFLAGS for application
|
||||
#AppLdflags='-ltremor'
|
||||
#AppLdflags='-lvorbis -logg -lcrypto -lssl -lcurl'
|
||||
AppLdflags='-lz -lvorbis -logg -lpython3 -lpython3.5m'
|
||||
#AppLdflags='-lz -lvorbis -logg'
|
||||
AppLdflags='-lz'
|
||||
|
||||
# If application has headers with the same name as system headers, this option tries to fix compiler flags to make it compilable
|
||||
AppOverlapsSystemHeaders=
|
||||
|
||||
# Build only following subdirs (empty will build all dirs, ignored with custom script)
|
||||
AppSubdirsBuild='commandergenius/src/* commandergenius/lib/*'
|
||||
AppSubdirsBuild='commandergenius/src/* commandergenius/GsKit/*'
|
||||
|
||||
# Exclude these files from build
|
||||
AppBuildExclude='commandergenius/src/engine/dbfusion'
|
||||
|
||||
Binary file not shown.
Submodule project/jni/application/commandergenius/commandergenius updated: a67003b466...56265e00b3
1
project/jni/application/curl-config
Executable file
1
project/jni/application/curl-config
Executable file
@@ -0,0 +1 @@
|
||||
#!/bin/sh
|
||||
@@ -25,8 +25,8 @@ InhibitSuspend=n
|
||||
# If the URL in in the form ':dir/file.dat:http://URL/' it will be downloaded as binary BLOB to the application dir and not unzipped
|
||||
# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -
|
||||
# these files are put inside .apk package by build system
|
||||
# Also please avoid 'https://' URLs, many Android devices do not have trust certificates and will fail to connect to SF.net over HTTPS
|
||||
AppDataDownloadUrl="!Heroes 2 DEMO (45 Mb) - required if you don't own full version|http://sourceforge.net/projects/libsdl-android/files/FreeHeroes2/h2demo.zip/download^!MIDI music support (18 Mb)|http://sourceforge.net/projects/libsdl-android/files/timidity.zip/download^!Essential map pack (9 Mb)|http://sourceforge.net/projects/libsdl-android/files/FreeHeroes2/EssentialMapPack.zip/download^!T-800 Mod Compaign|http://sourceforge.net/projects/libsdl-android/files/FreeHeroes2/fheroes2_cam_v1.zip/download^Additional map pack (95 Mb)|http://sourceforge.net/projects/libsdl-android/files/FreeHeroes2/AdditionalMapPack.zip/download^Mega map pack (280 Mb)|http://sourceforge.net/projects/libsdl-android/files/FreeHeroes2/MegaMapPack.zip/download^!Engine files|data13.zip^!Engine fonts|data-cfg-fonts.zip^Russian translation|:fheroes2.cfg:fheroes2-ru.cfg^Czech translation|:fheroes2.cfg:fheroes2-cs.cfg^Spanish translation|:fheroes2.cfg:fheroes2-es.cfg^French translation|:fheroes2.cfg:fheroes2-fr.cfg^Hungarian translation|:fheroes2.cfg:fheroes2-hu.cfg^Polish translation|:fheroes2.cfg:fheroes2-pl.cfg^Portugese translation|:fheroes2.cfg:fheroes2-pt_BR.cfg^Swedish translation|:fheroes2.cfg:fheroes2-sv.cfg"
|
||||
# Using 'https://' URLs, since http connections to SF.net do not work anymore
|
||||
AppDataDownloadUrl="!Heroes 2 DEMO (45 Mb) - required if you don't own full version|https://sourceforge.net/projects/libsdl-android/files/FreeHeroes2/h2demo.zip/download^!MIDI music support (18 Mb)|https://sourceforge.net/projects/libsdl-android/files/timidity.zip/download^!Essential map pack (9 Mb)|https://sourceforge.net/projects/libsdl-android/files/FreeHeroes2/EssentialMapPack.zip/download^!T-800 Mod Compaign|https://sourceforge.net/projects/libsdl-android/files/FreeHeroes2/fheroes2_cam_v1.zip/download^Additional map pack (95 Mb)|https://sourceforge.net/projects/libsdl-android/files/FreeHeroes2/AdditionalMapPack.zip/download^Mega map pack (280 Mb)|https://sourceforge.net/projects/libsdl-android/files/FreeHeroes2/MegaMapPack.zip/download^!Engine files|data13.zip^!Engine fonts|data-cfg-fonts.zip^Russian translation|:fheroes2.cfg:fheroes2-ru.cfg^Czech translation|:fheroes2.cfg:fheroes2-cs.cfg^Spanish translation|:fheroes2.cfg:fheroes2-es.cfg^French translation|:fheroes2.cfg:fheroes2-fr.cfg^Hungarian translation|:fheroes2.cfg:fheroes2-hu.cfg^Polish translation|:fheroes2.cfg:fheroes2-pl.cfg^Portugese translation|:fheroes2.cfg:fheroes2-pt_BR.cfg^Swedish translation|:fheroes2.cfg:fheroes2-sv.cfg"
|
||||
|
||||
# Video color depth - 16 BPP is the fastest and supported for all modes, 24 bpp is supported only
|
||||
# with SwVideoMode=y, SDL_OPENGL mode supports everything. (16)/(24)/(32)
|
||||
@@ -180,10 +180,10 @@ MultiABI=n
|
||||
AppMinimumRAM=32
|
||||
|
||||
# Application version code (integer)
|
||||
AppVersionCode=327821
|
||||
AppVersionCode=327841
|
||||
|
||||
# Application user-visible version name (string)
|
||||
AppVersionName="3278.21"
|
||||
AppVersionName="3278.41"
|
||||
|
||||
# Reset SDL config when updating application to the new version (y) / (n)
|
||||
ResetSdlConfigForThisVersion=n
|
||||
@@ -194,7 +194,7 @@ DeleteFilesOnUpgrade="libsdl-DownloadFinished-5.flag libsdl-DownloadFinished-6.f
|
||||
# Optional shared libraries to compile - removing some of them will save space
|
||||
# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed
|
||||
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2
|
||||
CompiledLibraries="sdl_mixer sdl_image sdl_ttf sdl_net png intl"
|
||||
CompiledLibraries="c++_shared sdl_mixer sdl_image sdl_ttf sdl_net png intl"
|
||||
|
||||
# Application uses custom build script AndroidBuild.sh instead of Android.mk (y) or (n)
|
||||
CustomBuildScript=n
|
||||
|
||||
Submodule project/jni/application/hid-pc-keyboard/src updated: 7ea69c684a...0c75adc844
@@ -1,7 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
LOCAL_PATH=`dirname $0`
|
||||
LOCAL_PATH=`cd $LOCAL_PATH && pwd`
|
||||
|
||||
$LOCAL_PATH/setEnvironment.sh ./configure --host=arm-eabi "$@"
|
||||
|
||||
@@ -1,288 +0,0 @@
|
||||
# The application settings for Android libSDL port
|
||||
|
||||
# Specify application name (e.x. My Application)
|
||||
AppName="LBreakout2"
|
||||
|
||||
# Specify reversed site name of application (e.x. com.mysite.myapp)
|
||||
AppFullName=net.sourceforge.lgames.lbreakout2
|
||||
|
||||
# Application version code (integer)
|
||||
AppVersionCode=26501
|
||||
|
||||
# Application user-visible version name (string)
|
||||
AppVersionName="2.6.5.01"
|
||||
|
||||
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
|
||||
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
|
||||
# If the URL in in the form ':dir/file.dat:http://URL/' it will be downloaded as binary BLOB to the application dir and not unzipped
|
||||
# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -
|
||||
# these files are put inside .apk package by build system
|
||||
# You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version, first associated with the file
|
||||
AppDataDownloadUrl="!App data size is 5 Mb|https://sourceforge.net/projects/libsdl-android/files/LBreakout2/lbreakout2-2.6.1-data.zip/download|http://sites.google.com/site/xpelyax/Home/lbreakout2-2.6.1-data.zip?attredirects=0&d=1|http://sitesproxy.goapk.com/site/xpelyax/Home/lbreakout2-2.6.1-data.zip"
|
||||
|
||||
# Reset SDL config when updating application to the new version (y) / (n)
|
||||
ResetSdlConfigForThisVersion=n
|
||||
|
||||
# Delete application data files when upgrading (specify file/dir paths separated by spaces)
|
||||
DeleteFilesOnUpgrade=""
|
||||
|
||||
# Here you may type readme text, which will be shown during startup. Format is:
|
||||
# Text in English, use \\\\n to separate lines (that's four backslashes)^de:Text in Deutsch^ru:Text in Russian^button:Button that will open some URL:http://url-to-open/
|
||||
ReadmeText='^You may press "Home" now - the data will be downloaded in background'
|
||||
|
||||
# libSDL version to use (1.2/1.3/2.0)
|
||||
LibSdlVersion=1.2
|
||||
|
||||
# Specify screen orientation: (v)ertical/(p)ortrait or (h)orizontal/(l)andscape
|
||||
ScreenOrientation=h
|
||||
|
||||
# Video color depth - 16 BPP is the fastest and supported for all modes, 24 bpp is supported only
|
||||
# with SwVideoMode=y, SDL_OPENGL mode supports everything. (16)/(24)/(32)
|
||||
VideoDepthBpp=16
|
||||
|
||||
# Enable OpenGL depth buffer (needed only for 3-d applications, small speed decrease) (y) or (n)
|
||||
NeedDepthBuffer=n
|
||||
|
||||
# Enable OpenGL stencil buffer (needed only for 3-d applications, small speed decrease) (y) or (n)
|
||||
NeedStencilBuffer=
|
||||
|
||||
# Try to use GLES 2.x context - will revert to GLES 1.X if unsupported by device
|
||||
# you need this option only if you're developing 3-d app (y) or (n)
|
||||
NeedGles2=
|
||||
|
||||
# Use glshim library for provide OpenGL 1.x functionality to OpenGL ES accelerated cards (y) or (n)
|
||||
UseGlshim=
|
||||
|
||||
# Application uses software video buffer - you're calling SDL_SetVideoMode() without SDL_HWSURFACE and without SDL_OPENGL,
|
||||
# this will allow small speed optimization. Enable this even when you're using SDL_HWSURFACE. (y) or (n)
|
||||
SwVideoMode=
|
||||
|
||||
# Application video output will be resized to fit into native device screen (y)/(n)
|
||||
SdlVideoResize=y
|
||||
|
||||
# Application resizing will keep 4:3 aspect ratio, with black bars at sides (y)/(n)
|
||||
SdlVideoResizeKeepAspect=n
|
||||
|
||||
# Do not allow device to sleep when the application is in foreground, set this for video players or apps which use accelerometer
|
||||
InhibitSuspend=y
|
||||
|
||||
# Create Android service, so the app is less likely to be killed while in background
|
||||
CreateService=
|
||||
|
||||
# Application does not call SDL_Flip() or SDL_UpdateRects() appropriately, or draws from non-main thread -
|
||||
# enabling the compatibility mode will force screen update every 100 milliseconds, which is laggy and inefficient (y) or (n)
|
||||
CompatibilityHacksForceScreenUpdate=
|
||||
|
||||
# Application does not call SDL_Flip() or SDL_UpdateRects() after mouse click (ScummVM and all Amiga emulators do that) -
|
||||
# force screen update by moving mouse cursor a little after each click (y) or (n)
|
||||
CompatibilityHacksForceScreenUpdateMouseClick=y
|
||||
|
||||
# Application initializes SDL audio/video inside static constructors (which is bad, you won't be able to run ndk-gdb) (y)/(n)
|
||||
CompatibilityHacksStaticInit=
|
||||
|
||||
# On-screen Android soft text input emulates hardware keyboard, this will only work with Hackers Keyboard app (y)/(n)
|
||||
CompatibilityHacksTextInputEmulatesHwKeyboard=y
|
||||
|
||||
# Built-in text input keyboards with custom layouts for emulators, requires CompatibilityHacksTextInputEmulatesHwKeyboard=y
|
||||
# 0 or empty - standard Android keyboard
|
||||
# 1 - Simple QWERTY keyboard, no function keys, no arrow keys
|
||||
# 2 - Commodore 64 keyboard
|
||||
# 3 - Amiga keyboard
|
||||
# 4 - Atari800 keyboard
|
||||
TextInputKeyboard=
|
||||
|
||||
# Hack for broken devices: prevent audio chopping, by sleeping a bit after pushing each audio chunk (y)/(n)
|
||||
CompatibilityHacksPreventAudioChopping=
|
||||
|
||||
# Hack for broken apps: application ignores audio buffer size returned by SDL (y)/(n)
|
||||
CompatibilityHacksAppIgnoresAudioBufferSize=
|
||||
|
||||
# Hack for VCMI: preload additional shared libraries before aplication start
|
||||
CompatibilityHacksAdditionalPreloadedSharedLibraries=""
|
||||
|
||||
# Hack for Free Heroes 2, which redraws the screen inside SDL_PumpEvents(): slow and compatible SDL event queue -
|
||||
# do not use it with accelerometer/gyroscope, or your app may freeze at random (y)/(n)
|
||||
CompatibilityHacksSlowCompatibleEventQueue=
|
||||
|
||||
# Save and restore OpenGL state when drawing on-screen keyboard for apps that use SDL_OPENGL
|
||||
CompatibilityHacksTouchscreenKeyboardSaveRestoreOpenGLState=
|
||||
|
||||
# Application uses SDL_UpdateRects() properly, and does not draw in any region outside those rects.
|
||||
# This improves drawing speed, but I know only one application that does that, and it's written by me (y)/(n)
|
||||
CompatibilityHacksProperUsageOfSDL_UpdateRects=
|
||||
|
||||
# Application uses mouse (y) or (n), this will show mouse emulation dialog to the user
|
||||
AppUsesMouse=y
|
||||
|
||||
# Application needs two-button mouse, will also enable advanced point-and-click features (y) or (n)
|
||||
AppNeedsTwoButtonMouse=y
|
||||
|
||||
# Right mouse button can do long-press/drag&drop action, necessary for some games (y) or (n)
|
||||
# If you disable it, swiping with two fingers will send mouse wheel events
|
||||
RightMouseButtonLongPress=
|
||||
|
||||
# Show SDL mouse cursor, for applications that do not draw cursor at all (y) or (n)
|
||||
ShowMouseCursor=
|
||||
|
||||
# Screen follows mouse cursor, when it's covered by soft keyboard, this works only in software video mode (y) or (n)
|
||||
ScreenFollowsMouse=
|
||||
|
||||
# Generate more touch events, by default SDL generates one event per one video frame, this is useful for drawing apps (y) or (n)
|
||||
GenerateSubframeTouchEvents=
|
||||
|
||||
# Force relative (laptop) mouse movement mode, useful when both on-screen keyboard and mouse are needed (y) or (n)
|
||||
ForceRelativeMouseMode=
|
||||
|
||||
# Show on-screen dpad/joystick, that will act as arrow keys (y) or (n)
|
||||
AppNeedsArrowKeys=n
|
||||
|
||||
# On-screen dpad/joystick will appear under finger when it touches the screen (y) or (n)
|
||||
# Joystick always follows finger, so moving mouse requires touching the screen with other finger
|
||||
FloatingScreenJoystick=
|
||||
|
||||
# Application needs text input (y) or (n), enables button for text input on screen
|
||||
AppNeedsTextInput=y
|
||||
|
||||
# Application uses joystick (y) or (n), the on-screen DPAD will be used as joystick 0 axes 0-1
|
||||
# This will disable AppNeedsArrowKeys option
|
||||
AppUsesJoystick=n
|
||||
|
||||
# Application uses second on-screen joystick, as SDL joystick 0 axes 2-3 (y)/(n)
|
||||
AppUsesSecondJoystick=n
|
||||
|
||||
# Application uses third on-screen joystick, as SDL joystick 0 axes 20-21 (y)/(n)
|
||||
AppUsesThirdJoystick=
|
||||
|
||||
# Application uses accelerometer (y) or (n), the accelerometer will be used as joystick 1 axes 0-1 and 5-7
|
||||
AppUsesAccelerometer=
|
||||
|
||||
# Application uses gyroscope (y) or (n), the gyroscope will be used as joystick 1 axes 2-4
|
||||
AppUsesGyroscope=
|
||||
|
||||
# Application uses orientation sensor (y) or (n), reported as joystick 1 axes 8-10
|
||||
AppUsesOrientationSensor=
|
||||
|
||||
# Use gyroscope to move mouse cursor (y) or (n), it eats battery, and can be disabled in settings, do not use with AppUsesGyroscope setting
|
||||
MoveMouseWithGyroscope=
|
||||
|
||||
# Application uses multitouch (y) or (n), multitouch events are passed as SDL_JOYBALLMOTION events for the joystick 0
|
||||
AppUsesMultitouch=n
|
||||
|
||||
# Application records audio (it will use any available source, such a s microphone)
|
||||
# API is defined in file SDL_android.h: int SDL_ANDROID_OpenAudioRecording(SDL_AudioSpec *spec); void SDL_ANDROID_CloseAudioRecording(void);
|
||||
# This option will add additional permission to Android manifest (y)/(n)
|
||||
AppRecordsAudio=
|
||||
|
||||
# Application needs to access SD card. If your data files are bigger than 5 Mb, enable it. (y) / (n)
|
||||
AccessSdCard=
|
||||
|
||||
# Application needs Internet access. If you disable it, you'll have to bundle all your data files inside .apk (y) / (n)
|
||||
AccessInternet=
|
||||
|
||||
# Immersive mode - Android will hide on-screen Home/Back keys. Looks bad if you invoke Android keyboard. (y) / (n)
|
||||
ImmersiveMode=
|
||||
|
||||
# Application implements Android-specific routines to put to background, and will not draw anything to screen
|
||||
# between SDL_ACTIVEEVENT lost / gained notifications - you should check for them
|
||||
# rigth after SDL_Flip(), if (n) then SDL_Flip() will block till app in background (y) or (n)
|
||||
# This option is reported to be buggy, sometimes failing to restore video state
|
||||
NonBlockingSwapBuffers=y
|
||||
|
||||
# Redefine common hardware keys to SDL keysyms
|
||||
# BACK hardware key is available on all devices, MENU is available on pre-ICS devices, other keys may be absent
|
||||
# SEARCH and CALL by default return same keycode as DPAD_CENTER - one of those keys is available on most devices
|
||||
# Use word NO_REMAP if you want to preserve native functionality for certain key (volume keys are 3-rd and 4-th)
|
||||
# Keys: TOUCHSCREEN (works only when AppUsesMouse=n), DPAD_CENTER/SEARCH, VOLUMEUP, VOLUMEDOWN, MENU, BACK, CAMERA
|
||||
RedefinedKeys="RETURN SPACE NO_REMAP NO_REMAP"
|
||||
|
||||
# Number of virtual keyboard keys (currently 6 is maximum)
|
||||
AppTouchscreenKeyboardKeysAmount=0
|
||||
|
||||
# Redefine on-screen keyboard keys to SDL keysyms - 6 keyboard keys + 4 multitouch gestures (zoom in/out and rotate left/right)
|
||||
RedefinedKeysScreenKb="RETURN SPACE PAGEUP PAGEDOWN"
|
||||
|
||||
# Names for on-screen keyboard keys, such as Fire, Jump, Run etc, separated by spaces, they are used in SDL config menu
|
||||
RedefinedKeysScreenKbNames=""
|
||||
|
||||
# On-screen keys theme
|
||||
# 0 = Ultimate Droid by Sean Stieber (green, with cross joystick)
|
||||
# 1 = Simple Theme by Beholder (white, with cross joystick)
|
||||
# 2 = Sun by Sirea (yellow, with round joystick)
|
||||
# 3 = Keen by Gerstrong (multicolor, with round joystick)
|
||||
# 4 = Retro by Santiago Radeff (red/white, with cross joystick)
|
||||
# 5 = GameBoy from RetroArch
|
||||
# 6 = PlayStation from RetroArch
|
||||
# 7 = SuperNintendo from RetroArch
|
||||
# 8 = DualShock from RetroArch
|
||||
# 9 = Nintendo64 from RetroArch
|
||||
TouchscreenKeysTheme=2
|
||||
|
||||
# Redefine gamepad keys to SDL keysyms, button order is:
|
||||
# A B X Y L1 R1 L2 R2 LThumb RThumb
|
||||
RedefinedKeysGamepad=""
|
||||
|
||||
# How long to show startup menu button, in msec, 0 to disable startup menu
|
||||
StartupMenuButtonTimeout=3000
|
||||
|
||||
# Menu items to hide from startup menu, available menu items:
|
||||
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.CommandlineConfig SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
|
||||
HiddenMenuOptions='SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMouse.DisplaySizeConfig'
|
||||
|
||||
# Menu items to show at startup - this is Java code snippet, leave empty for default
|
||||
# new SettingsMenuMisc.ShowReadme(), (AppUsesMouse \&\& \! ForceRelativeMouseMode \? new SettingsMenuMouse.DisplaySizeConfig(true) : new SettingsMenu.DummyMenu()), new SettingsMenuMisc.OptionalDownloadConfig(true), new SettingsMenuMisc.GyroscopeCalibration()
|
||||
# Available menu items:
|
||||
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.CommandlineConfig SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
|
||||
FirstStartMenuOptions=''
|
||||
|
||||
# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower
|
||||
AppMinimumRAM=256
|
||||
|
||||
# GCC version, 4.6 (default) or 4.8, CLANG is not supported yet
|
||||
NDK_TOOLCHAIN_VERSION=
|
||||
|
||||
# Specify architectures to compile, 'all' or 'y' to compile for all architectures.
|
||||
# Available architectures: armeabi armeabi-v7a armeabi-v7a-hard x86 mips
|
||||
MultiABI='armeabi'
|
||||
|
||||
# Optional shared libraries to compile - removing some of them will save space
|
||||
# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed
|
||||
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2
|
||||
CompiledLibraries="sdl_mixer sdl_image sdl_net intl"
|
||||
|
||||
# Application uses custom build script AndroidBuild.sh instead of Android.mk (y) or (n)
|
||||
CustomBuildScript=y
|
||||
|
||||
# Aditional CFLAGS for application
|
||||
AppCflags='-DHAVE_CONFIG_H -finline-functions -O2'
|
||||
|
||||
# Additional LDFLAGS for application
|
||||
AppLdflags=''
|
||||
|
||||
# If application has headers with the same name as system headers, this option tries to fix compiler flags to make it compilable
|
||||
AppOverlapsSystemHeaders=
|
||||
|
||||
# Build only following subdirs (empty will build all dirs, ignored with custom script)
|
||||
AppSubdirsBuild='src/dummy'
|
||||
|
||||
# Exclude these files from build
|
||||
AppBuildExclude=''
|
||||
|
||||
# Application command line parameters, including app name as 0-th param
|
||||
AppCmdline=''
|
||||
|
||||
# Screen size is used by Google Play to prevent an app to be installed on devices with smaller screens
|
||||
# Minimum screen size that application supports: (s)mall / (m)edium / (l)arge
|
||||
MinimumScreenSize=
|
||||
|
||||
# Your AdMob Publisher ID, (n) if you don't want advertisements
|
||||
AdmobPublisherId=
|
||||
|
||||
# Your AdMob test device ID, to receive a test ad
|
||||
AdmobTestDeviceId=
|
||||
|
||||
# Your AdMob banner size (BANNER/FULL_BANNER/LEADERBOARD/MEDIUM_RECTANGLE/SMART_BANNER/WIDE_SKYSCRAPER/FULL_WIDTH:Height/Width:AUTO_HEIGHT/Width:Height)
|
||||
AdmobBannerSize=
|
||||
|
||||
# Google Play Game Services application ID, required for cloud saves to work
|
||||
GooglePlayGameServicesId=
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
LOCAL_PATH=`dirname $0`
|
||||
LOCAL_PATH=`cd $LOCAL_PATH && pwd`
|
||||
|
||||
ln -sf libsdl_mixer.so $LOCAL_PATH/../../../obj/local/$1/libSDL_mixer.so
|
||||
ln -sf libsdl_net.so $LOCAL_PATH/../../../obj/local/$1/libSDL_net.so
|
||||
|
||||
cd lbreakout2-2.6.5
|
||||
if [ \! -f Makefile ] ; then
|
||||
../../setEnvironment.sh ./configure --host=$2 --disable-install --enable-sdl-net LIBS=-lintl
|
||||
fi
|
||||
rm -f ../libapplication.so
|
||||
make
|
||||
mv -f client/lbreakout2 ../libapplication.so
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.0 KiB |
316
project/jni/application/liero/AndroidAppSettings.cfg
Normal file
316
project/jni/application/liero/AndroidAppSettings.cfg
Normal file
@@ -0,0 +1,316 @@
|
||||
# The application settings for Android libSDL port
|
||||
|
||||
# Specify application name (e.x. My Application)
|
||||
AppName="OpenLiero"
|
||||
|
||||
# Specify reversed site name of application (e.x. com.mysite.myapp)
|
||||
AppFullName=open.liero.be
|
||||
|
||||
# Application version code (integer)
|
||||
AppVersionCode=13706
|
||||
|
||||
# Application user-visible version name (string)
|
||||
AppVersionName="1.37.06"
|
||||
|
||||
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
|
||||
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
|
||||
# If the URL in in the form ':dir/file.dat:http://URL/' it will be downloaded as binary BLOB to the application dir and not unzipped
|
||||
# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -
|
||||
# these files are put inside .apk package by build system
|
||||
# You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version, first associated with the file
|
||||
AppDataDownloadUrl="!!Game data|data.zip"
|
||||
|
||||
# Reset SDL config when updating application to the new version (y) / (n)
|
||||
ResetSdlConfigForThisVersion=y
|
||||
|
||||
# Delete application data files when upgrading (specify file/dir paths separated by spaces)
|
||||
DeleteFilesOnUpgrade="libsdl-DownloadFinished-0.flag"
|
||||
|
||||
# Here you may type readme text, which will be shown during startup. Format is:
|
||||
# Text in English, use \\\\n to separate lines (that's four backslashes)^de:Text in Deutsch^ru:Text in Russian^button:Button that will open some URL:http://url-to-open/
|
||||
ReadmeText='This game is best played with a gamepad. Two-player mode requires two gamepads.^tv:'
|
||||
|
||||
# libSDL version to use (1.2/1.3/2.0)
|
||||
LibSdlVersion=1.2
|
||||
|
||||
# Specify screen orientation: (v)ertical/(p)ortrait or (h)orizontal/(l)andscape
|
||||
ScreenOrientation=h
|
||||
|
||||
# Video color depth - 16 BPP is the fastest and supported for all modes, 24 bpp is supported only
|
||||
# with SwVideoMode=y, SDL_OPENGL mode supports everything. (16)/(24)/(32)
|
||||
VideoDepthBpp=16
|
||||
|
||||
# Enable OpenGL depth buffer (needed only for 3-d applications, small speed decrease) (y) or (n)
|
||||
NeedDepthBuffer=n
|
||||
|
||||
# Enable OpenGL stencil buffer (needed only for 3-d applications, small speed decrease) (y) or (n)
|
||||
NeedStencilBuffer=n
|
||||
|
||||
# Use GLES 2.x context
|
||||
# you need this option only if you're developing 3-d app (y) or (n)
|
||||
NeedGles2=n
|
||||
|
||||
# Use GLES 3.x context
|
||||
# you need this option only if you're developing 3-d app (y) or (n)
|
||||
NeedGles3=n
|
||||
|
||||
# Use gl4es library for provide OpenGL 1.x functionality to OpenGL ES accelerated cards (y) or (n)
|
||||
UseGl4es=
|
||||
|
||||
# Application uses software video buffer - you're calling SDL_SetVideoMode() without SDL_HWSURFACE and without SDL_OPENGL,
|
||||
# this will allow small speed optimization. Enable this even when you're using SDL_HWSURFACE. (y) or (n)
|
||||
SwVideoMode=y
|
||||
|
||||
# Application video output will be resized to fit into native device screen (y)/(n)
|
||||
SdlVideoResize=y
|
||||
|
||||
# Application resizing will keep 4:3 aspect ratio, with black bars at sides (y)/(n)
|
||||
SdlVideoResizeKeepAspect=n
|
||||
|
||||
# Do not allow device to sleep when the application is in foreground, set this for video players or apps which use accelerometer
|
||||
InhibitSuspend=y
|
||||
|
||||
# Create Android service, so the app is less likely to be killed while in background
|
||||
CreateService=
|
||||
|
||||
# Application does not call SDL_Flip() or SDL_UpdateRects() appropriately, or draws from non-main thread -
|
||||
# enabling the compatibility mode will force screen update every 100 milliseconds, which is laggy and inefficient (y) or (n)
|
||||
CompatibilityHacksForceScreenUpdate=n
|
||||
|
||||
# Application does not call SDL_Flip() or SDL_UpdateRects() after mouse click (ScummVM and all Amiga emulators do that) -
|
||||
# force screen update by moving mouse cursor a little after each click (y) or (n)
|
||||
CompatibilityHacksForceScreenUpdateMouseClick=n
|
||||
|
||||
# Application initializes SDL audio/video inside static constructors (which is bad, you won't be able to run ndk-gdb) (y)/(n)
|
||||
CompatibilityHacksStaticInit=n
|
||||
|
||||
# On-screen Android soft text input emulates hardware keyboard, this will only work with Hackers Keyboard app (y)/(n)
|
||||
CompatibilityHacksTextInputEmulatesHwKeyboard=n
|
||||
|
||||
# Built-in text input keyboards with custom layouts for emulators, requires CompatibilityHacksTextInputEmulatesHwKeyboard=y
|
||||
# 0 or empty - standard Android keyboard
|
||||
# 1 - Simple QWERTY keyboard, no function keys, no arrow keys
|
||||
# 2 - Commodore 64 keyboard
|
||||
# 3 - Amiga keyboard
|
||||
# 4 - Atari800 keyboard
|
||||
TextInputKeyboard=
|
||||
|
||||
# Hack for broken devices: prevent audio chopping, by sleeping a bit after pushing each audio chunk (y)/(n)
|
||||
CompatibilityHacksPreventAudioChopping=n
|
||||
|
||||
# Hack for broken apps: application ignores audio buffer size returned by SDL (y)/(n)
|
||||
CompatibilityHacksAppIgnoresAudioBufferSize=n
|
||||
|
||||
# Hack for VCMI: preload additional shared libraries before aplication start
|
||||
CompatibilityHacksAdditionalPreloadedSharedLibraries=""
|
||||
|
||||
# Hack for Free Heroes 2, which redraws the screen inside SDL_PumpEvents(): slow and compatible SDL event queue -
|
||||
# do not use it with accelerometer/gyroscope, or your app may freeze at random (y)/(n)
|
||||
CompatibilityHacksSlowCompatibleEventQueue=n
|
||||
|
||||
# Save and restore OpenGL state when drawing on-screen keyboard for apps that use SDL_OPENGL
|
||||
CompatibilityHacksTouchscreenKeyboardSaveRestoreOpenGLState=n
|
||||
|
||||
# Application uses SDL_UpdateRects() properly, and does not draw in any region outside those rects.
|
||||
# This improves drawing speed, but I know only one application that does that, and it's written by me (y)/(n)
|
||||
CompatibilityHacksProperUsageOfSDL_UpdateRects=
|
||||
|
||||
# Application uses mouse (y) or (n), this will show mouse emulation dialog to the user
|
||||
AppUsesMouse=y
|
||||
|
||||
# Application needs two-button mouse, will also enable advanced point-and-click features (y) or (n)
|
||||
AppNeedsTwoButtonMouse=n
|
||||
|
||||
# Right mouse button can do long-press/drag&drop action, necessary for some games (y) or (n)
|
||||
# If you disable it, swiping with two fingers will send mouse wheel events
|
||||
RightMouseButtonLongPress=n
|
||||
|
||||
# Show SDL mouse cursor, for applications that do not draw cursor at all (y) or (n)
|
||||
ShowMouseCursor=n
|
||||
|
||||
# Screen follows mouse cursor, when it's covered by soft keyboard, this works only in software video mode (y) or (n)
|
||||
ScreenFollowsMouse=n
|
||||
|
||||
# Generate more touch events, by default SDL generates one event per one video frame, this is useful for drawing apps (y) or (n)
|
||||
GenerateSubframeTouchEvents=n
|
||||
|
||||
# Force relative (laptop) mouse movement mode, useful when both on-screen keyboard and mouse are needed (y) or (n)
|
||||
ForceRelativeMouseMode=n
|
||||
|
||||
# Show on-screen dpad/joystick, that will act as arrow keys (y) or (n)
|
||||
AppNeedsArrowKeys=y
|
||||
|
||||
# On-screen dpad/joystick will appear under finger when it touches the screen (y) or (n)
|
||||
# Joystick always follows finger, so moving mouse requires touching the screen with other finger
|
||||
FloatingScreenJoystick=n
|
||||
|
||||
# Application needs text input (y) or (n), enables button for text input on screen
|
||||
AppNeedsTextInput=n
|
||||
|
||||
# Application uses joystick (y) or (n), the on-screen DPAD will be used as joystick 0 axes 0-1
|
||||
# This will disable AppNeedsArrowKeys option
|
||||
AppUsesJoystick=n
|
||||
|
||||
# Application uses second on-screen joystick, as SDL joystick 0 axes 2-3 (y)/(n)
|
||||
AppUsesSecondJoystick=n
|
||||
|
||||
# Application uses third on-screen joystick, as SDL joystick 0 axes 20-21 (y)/(n)
|
||||
AppUsesThirdJoystick=n
|
||||
|
||||
# Application uses accelerometer (y) or (n), the accelerometer will be used as joystick 1 axes 0-1 and 5-7
|
||||
AppUsesAccelerometer=n
|
||||
|
||||
# Application uses gyroscope (y) or (n), the gyroscope will be used as joystick 1 axes 2-4
|
||||
AppUsesGyroscope=n
|
||||
|
||||
# Application uses orientation sensor (y) or (n), reported as joystick 1 axes 8-10
|
||||
AppUsesOrientationSensor=n
|
||||
|
||||
# Use gyroscope to move mouse cursor (y) or (n), it eats battery, and can be disabled in settings, do not use with AppUsesGyroscope setting
|
||||
MoveMouseWithGyroscope=n
|
||||
|
||||
# Application uses multitouch (y) or (n), multitouch events are passed as SDL_JOYBALLMOTION events for the joystick 0
|
||||
AppUsesMultitouch=n
|
||||
|
||||
# Application records audio (it will use any available source, such a s microphone)
|
||||
# API is defined in file SDL_android.h: int SDL_ANDROID_OpenAudioRecording(SDL_AudioSpec *spec); void SDL_ANDROID_CloseAudioRecording(void);
|
||||
# This option will add additional permission to Android manifest (y)/(n)
|
||||
AppRecordsAudio=n
|
||||
|
||||
# Application needs to access SD card. Always disable it, unless you want to access user photos and downloads. (y) / (n)
|
||||
AccessSdCard=n
|
||||
|
||||
# Application needs Internet access. If you disable it, you'll have to bundle all your data files inside .apk (y) / (n)
|
||||
AccessInternet=y
|
||||
|
||||
# Immersive mode - Android will hide on-screen Home/Back keys. Looks bad if you invoke Android keyboard. (y) / (n)
|
||||
ImmersiveMode=y
|
||||
|
||||
# Hide Android system mouse cursor image when USB mouse is attached (y) or (n) - the app must draw it's own mouse cursor
|
||||
HideSystemMousePointer=y
|
||||
|
||||
# Application implements Android-specific routines to put to background, and will not draw anything to screen
|
||||
# between SDL_ACTIVEEVENT lost / gained notifications - you should check for them
|
||||
# rigth after SDL_Flip(), if (n) then SDL_Flip() will block till app in background (y) or (n)
|
||||
# This option is reported to be buggy, sometimes failing to restore video state
|
||||
NonBlockingSwapBuffers=n
|
||||
|
||||
# Redefine common hardware keys to SDL keysyms
|
||||
# BACK hardware key is available on all devices, MENU is available on pre-ICS devices, other keys may be absent
|
||||
# SEARCH and CALL by default return same keycode as DPAD_CENTER - one of those keys is available on most devices
|
||||
# Use word NO_REMAP if you want to preserve native functionality for certain key (volume keys are 3-rd and 4-th)
|
||||
# Keys: TOUCHSCREEN (works only when AppUsesMouse=n), DPAD_CENTER/SEARCH, VOLUMEUP, VOLUMEDOWN, MENU, BACK, CAMERA
|
||||
RedefinedKeys="SPACE RETURN NO_REMAP NO_REMAP"
|
||||
|
||||
# Number of virtual keyboard keys (currently 6 is maximum)
|
||||
AppTouchscreenKeyboardKeysAmount=5
|
||||
|
||||
# Redefine on-screen keyboard keys to SDL keysyms - 6 keyboard keys + 4 multitouch gestures (zoom in/out and rotate left/right)
|
||||
RedefinedKeysScreenKb="RSHIFT SLASH RCTRL RETURN RALT"
|
||||
|
||||
# Names for on-screen keyboard keys, such as Fire, Jump, Run etc, separated by spaces, they are used in SDL config menu
|
||||
RedefinedKeysScreenKbNames="Jump Rope Fire Dig Change"
|
||||
|
||||
# On-screen keys theme
|
||||
# 0 = Ultimate Droid by Sean Stieber (green, with cross joystick)
|
||||
# 1 = Simple Theme by Beholder (white, with cross joystick)
|
||||
# 2 = Sun by Sirea (yellow, with round joystick)
|
||||
# 3 = Keen by Gerstrong (multicolor, with round joystick)
|
||||
# 4 = Retro by Santiago Radeff (red/white, with cross joystick)
|
||||
# 5 = GameBoy from RetroArch
|
||||
# 6 = PlayStation from RetroArch
|
||||
# 7 = SuperNintendo from RetroArch
|
||||
# 8 = DualShock from RetroArch
|
||||
# 9 = Nintendo64 from RetroArch
|
||||
TouchscreenKeysTheme=3
|
||||
|
||||
# Redefine gamepad keys to SDL keysyms, button order is:
|
||||
# A B X Y L1 R1 L2 R2 LThumb RThumb Start Select Up Down Left Right
|
||||
RedefinedKeysGamepad="RETURN RSHIFT RCTRL RALT RSHIFT RALT SLASH RCTRL RETURN RETURN ESCAPE ESCAPE UP DOWN LEFT RIGHT"
|
||||
|
||||
# Redefine keys for the second gamepad, same as the first gamepad if not set:
|
||||
RedefinedKeysSecondGamepad="TAB LALT LCTRL LSHIFT LALT LSHIFT BACKQUOTE LCTRL TAB TAB ESCAPE ESCAPE R F D G"
|
||||
|
||||
# Redefine keys for the third gamepad, same as the first gamepad if not set:
|
||||
RedefinedKeysThirdGamepad=""
|
||||
|
||||
# Redefine keys for the fourth gamepad, same as the first gamepad if not set:
|
||||
RedefinedKeysFourthGamepad=""
|
||||
|
||||
# How long to show startup menu button, in msec, 0 to disable startup menu
|
||||
StartupMenuButtonTimeout=3000
|
||||
|
||||
# Menu items to hide from startup menu, available menu items:
|
||||
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.CommandlineConfig SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
|
||||
HiddenMenuOptions='SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMouse.DisplaySizeConfig'
|
||||
|
||||
# Menu items to show at startup - this is Java code snippet, leave empty for default
|
||||
# new SettingsMenuMisc.ShowReadme(), (AppUsesMouse \&\& \! ForceRelativeMouseMode \? new SettingsMenuMouse.DisplaySizeConfig(true) : new SettingsMenu.DummyMenu()), new SettingsMenuMisc.OptionalDownloadConfig(true), new SettingsMenuMisc.GyroscopeCalibration()
|
||||
# Available menu items:
|
||||
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.CommandlineConfig SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
|
||||
FirstStartMenuOptions='SettingsMenuMisc.ShowReadme'
|
||||
|
||||
# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower
|
||||
AppMinimumRAM=0
|
||||
|
||||
# GCC version, or 'clang' for CLANG
|
||||
NDK_TOOLCHAIN_VERSION=
|
||||
|
||||
# Android platform version.
|
||||
# android-9 = Android 2.3, the earliest supported version.
|
||||
# android-18 = Android 4.3, the first version supporting GLES3.
|
||||
# android-21 = Android 5.1, the first version with SO_REUSEPORT defined.
|
||||
APP_PLATFORM=android-21
|
||||
|
||||
# Specify architectures to compile, 'all' or 'y' to compile for all architectures.
|
||||
# Available architectures: armeabi armeabi-v7a x86 mips arm64-v8a
|
||||
MultiABI='armeabi-v7a x86 arm64-v8a'
|
||||
|
||||
# Optional shared libraries to compile - removing some of them will save space
|
||||
# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed
|
||||
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2
|
||||
CompiledLibraries=""
|
||||
|
||||
# Application uses custom build script AndroidBuild.sh instead of Android.mk (y) or (n)
|
||||
CustomBuildScript=n
|
||||
|
||||
# Aditional CFLAGS for application
|
||||
AppCflags='-O3 -ffast-math -Werror=format -flto'
|
||||
|
||||
# Aditional C++-specific compiler flags for application, added after AppCflags
|
||||
AppCppflags='-O3 -ffast-math -Werror=format -flto -std=c++11 -frtti -fexceptions'
|
||||
|
||||
# Additional LDFLAGS for application
|
||||
AppLdflags='-flto'
|
||||
|
||||
# If application has headers with the same name as system headers, this option tries to fix compiler flags to make it compilable
|
||||
AppOverlapsSystemHeaders=n
|
||||
|
||||
# Build only following subdirs (empty will build all dirs, ignored with custom script)
|
||||
AppSubdirsBuild='src src/mixer src/gfx src/gvl/zlib/miniz.c src/gvl/system/system.c src/gvl/support src/gvl/io2 src/gvl/containers src/ai src/controller src/menu'
|
||||
|
||||
# Exclude these files from build
|
||||
AppBuildExclude='src/common_exereader.cpp src/common_writer.cpp src/tc_tool_main.cpp src/videotest.c src/bench.cpp src/bench_format.cpp src/tools_main.cpp src/replay_to_video.cpp src/video_recorder.c'
|
||||
|
||||
# Application command line parameters, including app name as 0-th param
|
||||
AppCmdline=''
|
||||
|
||||
# Screen size is used by Google Play to prevent an app to be installed on devices with smaller screens
|
||||
# Minimum screen size that application supports: (s)mall / (m)edium / (l)arge
|
||||
MinimumScreenSize=n
|
||||
|
||||
# Your AdMob Publisher ID, (n) if you don't want advertisements
|
||||
AdmobPublisherId=n
|
||||
|
||||
# Your AdMob test device ID, to receive a test ad
|
||||
AdmobTestDeviceId=
|
||||
|
||||
# Your AdMob banner size (BANNER/FULL_BANNER/LEADERBOARD/MEDIUM_RECTANGLE/SMART_BANNER/WIDE_SKYSCRAPER/FULL_WIDTH:Height/Width:AUTO_HEIGHT/Width:Height)
|
||||
AdmobBannerSize=
|
||||
|
||||
# Google Play Game Services application ID, required for cloud saves to work
|
||||
GooglePlayGameServicesId=
|
||||
|
||||
# The app will open files with following extension, file path will be added to commandline params
|
||||
AppOpenFileExtension=''
|
||||
|
||||
1
project/jni/application/liero/AndroidData/data.zip
Symbolic link
1
project/jni/application/liero/AndroidData/data.zip
Symbolic link
@@ -0,0 +1 @@
|
||||
../src/data/data.zip
|
||||
1
project/jni/application/liero/AndroidData/logo.png
Symbolic link
1
project/jni/application/liero/AndroidData/logo.png
Symbolic link
@@ -0,0 +1 @@
|
||||
../banner.png
|
||||
1
project/jni/application/liero/banner.png
Symbolic link
1
project/jni/application/liero/banner.png
Symbolic link
@@ -0,0 +1 @@
|
||||
src/data/banner.png
|
||||
1
project/jni/application/liero/icon.png
Symbolic link
1
project/jni/application/liero/icon.png
Symbolic link
@@ -0,0 +1 @@
|
||||
src/data/icon.png
|
||||
13
project/jni/application/liero/java.patch
Normal file
13
project/jni/application/liero/java.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/project/java/Globals.java b/project/java/Globals.java
|
||||
index 2f2e8a77d..47eec2430 100644
|
||||
--- a/project/java/Globals.java
|
||||
+++ b/project/java/Globals.java
|
||||
@@ -137,7 +137,7 @@ class Globals
|
||||
public static int MultitouchGestureSensitivity = 1;
|
||||
public static int TouchscreenCalibration[] = new int[4];
|
||||
public static String DataDir = new String("");
|
||||
- public static boolean VideoLinearFilter = true;
|
||||
+ public static boolean VideoLinearFilter = false;
|
||||
public static boolean MultiThreadedVideo = false;
|
||||
|
||||
public static boolean OuyaEmulation = false; // For debugging
|
||||
1
project/jni/application/liero/src
Submodule
1
project/jni/application/liero/src
Submodule
Submodule project/jni/application/liero/src added at c1d0395749
@@ -7,10 +7,10 @@ AppName="Ninslash"
|
||||
AppFullName=ninslash.com
|
||||
|
||||
# Application version code (integer)
|
||||
AppVersionCode=02219
|
||||
AppVersionCode=03231
|
||||
|
||||
# Application user-visible version name (string)
|
||||
AppVersionName="0.2.2.19"
|
||||
AppVersionName="0.3.2.31"
|
||||
|
||||
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
|
||||
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
|
||||
@@ -21,10 +21,10 @@ AppVersionName="0.2.2.19"
|
||||
AppDataDownloadUrl="!!Game data|data.zip"
|
||||
|
||||
# Reset SDL config when updating application to the new version (y) / (n)
|
||||
ResetSdlConfigForThisVersion=y
|
||||
ResetSdlConfigForThisVersion=n
|
||||
|
||||
# Delete application data files when upgrading (specify file/dir paths separated by spaces)
|
||||
DeleteFilesOnUpgrade="libsdl-DownloadFinished-0.flag .ninslash/settings.cfg"
|
||||
DeleteFilesOnUpgrade="libsdl-DownloadFinished-0.flag data"
|
||||
|
||||
# Here you may type readme text, which will be shown during startup. Format is:
|
||||
# Text in English, use \\\\n to separate lines (that's four backslashes)^de:Text in Deutsch^ru:Text in Russian^button:Button that will open some URL:http://url-to-open/
|
||||
@@ -54,8 +54,8 @@ NeedGles2=y
|
||||
# you need this option only if you're developing 3-d app (y) or (n)
|
||||
NeedGles3=n
|
||||
|
||||
# Use glshim library for provide OpenGL 1.x functionality to OpenGL ES accelerated cards (y) or (n)
|
||||
UseGlshim=
|
||||
# Use gl4es library for provide OpenGL 1.x functionality to OpenGL ES accelerated cards (y) or (n)
|
||||
UseGl4es=
|
||||
|
||||
# Application uses software video buffer - you're calling SDL_SetVideoMode() without SDL_HWSURFACE and without SDL_OPENGL,
|
||||
# this will allow small speed optimization. Enable this even when you're using SDL_HWSURFACE. (y) or (n)
|
||||
@@ -186,6 +186,9 @@ AccessInternet=y
|
||||
# Immersive mode - Android will hide on-screen Home/Back keys. Looks bad if you invoke Android keyboard. (y) / (n)
|
||||
ImmersiveMode=y
|
||||
|
||||
# Hide Android system mouse cursor image when USB mouse is attached (y) or (n) - the app must draw it's own mouse cursor
|
||||
HideSystemMousePointer=y
|
||||
|
||||
# Application implements Android-specific routines to put to background, and will not draw anything to screen
|
||||
# between SDL_ACTIVEEVENT lost / gained notifications - you should check for them
|
||||
# rigth after SDL_Flip(), if (n) then SDL_Flip() will block till app in background (y) or (n)
|
||||
@@ -226,7 +229,7 @@ TouchscreenKeysTheme=2
|
||||
RedefinedKeysGamepad="LCTRL M Q TAB SPACE MOUSE_LEFT MOUSE_RIGHT E SPACE E"
|
||||
|
||||
# How long to show startup menu button, in msec, 0 to disable startup menu
|
||||
StartupMenuButtonTimeout=3000
|
||||
StartupMenuButtonTimeout=0
|
||||
|
||||
# Menu items to hide from startup menu, available menu items:
|
||||
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.CommandlineConfig SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
|
||||
@@ -252,7 +255,7 @@ APP_PLATFORM=android-21
|
||||
|
||||
# Specify architectures to compile, 'all' or 'y' to compile for all architectures.
|
||||
# Available architectures: armeabi armeabi-v7a x86 mips arm64-v8a
|
||||
MultiABI='armeabi-v7a x86'
|
||||
MultiABI='armeabi-v7a x86 arm64-v8a'
|
||||
|
||||
# Optional shared libraries to compile - removing some of them will save space
|
||||
# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed
|
||||
@@ -263,13 +266,13 @@ CompiledLibraries="sdl_image freetype glu"
|
||||
CustomBuildScript=n
|
||||
|
||||
# Aditional CFLAGS for application
|
||||
AppCflags='-O2 -Werror=format -isystem jni/application/src/src/src/base/android' # -flto
|
||||
AppCflags='-O2 -Werror=format -isystem jni/application/src/src/src/base/android'
|
||||
|
||||
# Aditional C++-specific compiler flags for application, added after AppCflags
|
||||
AppCppflags='-std=c++11'
|
||||
|
||||
# Additional LDFLAGS for application
|
||||
AppLdflags='-lEGL' # -flto
|
||||
AppLdflags='-lEGL'
|
||||
|
||||
# If application has headers with the same name as system headers, this option tries to fix compiler flags to make it compilable
|
||||
AppOverlapsSystemHeaders=n
|
||||
|
||||
@@ -20,15 +20,13 @@ python datasrc/compile.py server_content_header > src/game/generated/server_data
|
||||
python scripts/cmd5.py src/engine/shared/protocol.h src/game/generated/protocol.h src/game/tuning.h src/game/gamecore.cpp src/game/generated/protocol.h > src/game/generated/nethash.cpp
|
||||
}
|
||||
|
||||
|
||||
echo "Archiving data"
|
||||
mkdir -p ../AndroidData
|
||||
ln -sf ../src/logo.png ../AndroidData
|
||||
rm -f ../AndroidData/data.zip
|
||||
zip -r ../AndroidData/data.zip data *.txt *.cfg "example configs" >/dev/null
|
||||
zip -r ../AndroidData/data.zip data *.txt *.cfg "example configs" cfg >/dev/null
|
||||
|
||||
|
||||
for ARCH in armeabi-v7a x86; do
|
||||
for ARCH in armeabi-v7a x86 arm64-v8a; do
|
||||
[ -e ../AndroidData/binaries-$ARCH.zip ] && \
|
||||
find `cat ../server-sources.txt` -cnewer ../AndroidData/binaries-$ARCH.zip | \
|
||||
[ `wc -c` -eq 0 ] && continue
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
src/game/server/*.cpp
|
||||
src/game/server/*/*.cpp
|
||||
src/game/server/*/*/*.cpp
|
||||
src/game/*.cpp
|
||||
src/engine/server/*.cpp
|
||||
src/engine/shared/*.cpp
|
||||
|
||||
Submodule project/jni/application/ninslash/src updated: 5836a629b9...e098563dfe
Submodule project/jni/application/openarena/vm updated: 20040462fa...02113650ba
1
project/jni/application/openlierox/.gitignore
vendored
Normal file
1
project/jni/application/openlierox/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/AndroidData/data.zip.xz
|
||||
317
project/jni/application/openlierox/AndroidAppSettings.cfg
Normal file
317
project/jni/application/openlierox/AndroidAppSettings.cfg
Normal file
@@ -0,0 +1,317 @@
|
||||
# The application settings for Android libSDL port
|
||||
|
||||
# Specify application name (e.x. My Application)
|
||||
AppName="OpenLieroX"
|
||||
|
||||
# Specify reversed site name of application (e.x. com.mysite.myapp)
|
||||
AppFullName=openlierox.net
|
||||
|
||||
# Application version code (integer)
|
||||
AppVersionCode=10580526
|
||||
|
||||
# Application user-visible version name (string)
|
||||
AppVersionName="0.58rc5a26"
|
||||
|
||||
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
|
||||
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
|
||||
# If the URL in in the form ':dir/file.dat:http://URL/' it will be downloaded as binary BLOB to the application dir and not unzipped
|
||||
# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -
|
||||
# these files are put inside .apk package by build system
|
||||
# You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version, first associated with the file
|
||||
AppDataDownloadUrl="!!Game data|data.zip.xz"
|
||||
|
||||
# Reset SDL config when updating application to the new version (y) / (n)
|
||||
ResetSdlConfigForThisVersion=y
|
||||
|
||||
# Delete application data files when upgrading (specify file/dir paths separated by spaces)
|
||||
DeleteFilesOnUpgrade="libsdl-DownloadFinished-0.flag"
|
||||
|
||||
# Here you may type readme text, which will be shown during startup. Format is:
|
||||
# Text in English, use \\\\n to separate lines (that's four backslashes)^de:Text in Deutsch^ru:Text in Russian^button:Button that will open some URL:http://url-to-open/
|
||||
ReadmeText='This game is best played with a gamepad. Two-player mode requires two gamepads. Tap the screen to dig.^tv:'
|
||||
|
||||
# libSDL version to use (1.2/1.3/2.0)
|
||||
LibSdlVersion=1.2
|
||||
|
||||
# Specify screen orientation: (v)ertical/(p)ortrait or (h)orizontal/(l)andscape
|
||||
ScreenOrientation=h
|
||||
|
||||
# Video color depth - 16 BPP is the fastest and supported for all modes, 24 bpp is supported only
|
||||
# with SwVideoMode=y, SDL_OPENGL mode supports everything. (16)/(24)/(32)
|
||||
VideoDepthBpp=16
|
||||
|
||||
# Enable OpenGL depth buffer (needed only for 3-d applications, small speed decrease) (y) or (n)
|
||||
NeedDepthBuffer=n
|
||||
|
||||
# Enable OpenGL stencil buffer (needed only for 3-d applications, small speed decrease) (y) or (n)
|
||||
NeedStencilBuffer=n
|
||||
|
||||
# Use GLES 2.x context
|
||||
# you need this option only if you're developing 3-d app (y) or (n)
|
||||
NeedGles2=n
|
||||
|
||||
# Use GLES 3.x context
|
||||
# you need this option only if you're developing 3-d app (y) or (n)
|
||||
NeedGles3=n
|
||||
|
||||
# Use gl4es library for provide OpenGL 1.x functionality to OpenGL ES accelerated cards (y) or (n)
|
||||
UseGl4es=
|
||||
|
||||
# Application uses software video buffer - you're calling SDL_SetVideoMode() without SDL_HWSURFACE and without SDL_OPENGL,
|
||||
# this will allow small speed optimization. Enable this even when you're using SDL_HWSURFACE. (y) or (n)
|
||||
SwVideoMode=y
|
||||
|
||||
# Application video output will be resized to fit into native device screen (y)/(n)
|
||||
SdlVideoResize=y
|
||||
|
||||
# Application resizing will keep 4:3 aspect ratio, with black bars at sides (y)/(n)
|
||||
SdlVideoResizeKeepAspect=n
|
||||
|
||||
# Do not allow device to sleep when the application is in foreground, set this for video players or apps which use accelerometer
|
||||
InhibitSuspend=y
|
||||
|
||||
# Create Android service, so the app is less likely to be killed while in background
|
||||
CreateService=
|
||||
|
||||
# Application does not call SDL_Flip() or SDL_UpdateRects() appropriately, or draws from non-main thread -
|
||||
# enabling the compatibility mode will force screen update every 100 milliseconds, which is laggy and inefficient (y) or (n)
|
||||
CompatibilityHacksForceScreenUpdate=n
|
||||
|
||||
# Application does not call SDL_Flip() or SDL_UpdateRects() after mouse click (ScummVM and all Amiga emulators do that) -
|
||||
# force screen update by moving mouse cursor a little after each click (y) or (n)
|
||||
CompatibilityHacksForceScreenUpdateMouseClick=n
|
||||
|
||||
# Application initializes SDL audio/video inside static constructors (which is bad, you won't be able to run ndk-gdb) (y)/(n)
|
||||
CompatibilityHacksStaticInit=n
|
||||
|
||||
# On-screen Android soft text input emulates hardware keyboard, this will only work with Hackers Keyboard app (y)/(n)
|
||||
CompatibilityHacksTextInputEmulatesHwKeyboard=n
|
||||
|
||||
# Built-in text input keyboards with custom layouts for emulators, requires CompatibilityHacksTextInputEmulatesHwKeyboard=y
|
||||
# 0 or empty - standard Android keyboard
|
||||
# 1 - Simple QWERTY keyboard, no function keys, no arrow keys
|
||||
# 2 - Commodore 64 keyboard
|
||||
# 3 - Amiga keyboard
|
||||
# 4 - Atari800 keyboard
|
||||
TextInputKeyboard=
|
||||
|
||||
# Hack for broken devices: prevent audio chopping, by sleeping a bit after pushing each audio chunk (y)/(n)
|
||||
CompatibilityHacksPreventAudioChopping=n
|
||||
|
||||
# Hack for broken apps: application ignores audio buffer size returned by SDL (y)/(n)
|
||||
CompatibilityHacksAppIgnoresAudioBufferSize=n
|
||||
|
||||
# Hack for VCMI: preload additional shared libraries before aplication start
|
||||
CompatibilityHacksAdditionalPreloadedSharedLibraries=""
|
||||
|
||||
# Hack for Free Heroes 2, which redraws the screen inside SDL_PumpEvents(): slow and compatible SDL event queue -
|
||||
# do not use it with accelerometer/gyroscope, or your app may freeze at random (y)/(n)
|
||||
CompatibilityHacksSlowCompatibleEventQueue=n
|
||||
|
||||
# Save and restore OpenGL state when drawing on-screen keyboard for apps that use SDL_OPENGL
|
||||
CompatibilityHacksTouchscreenKeyboardSaveRestoreOpenGLState=n
|
||||
|
||||
# Application uses SDL_UpdateRects() properly, and does not draw in any region outside those rects.
|
||||
# This improves drawing speed, but I know only one application that does that, and it's written by me (y)/(n)
|
||||
CompatibilityHacksProperUsageOfSDL_UpdateRects=
|
||||
|
||||
# Application uses mouse (y) or (n), this will show mouse emulation dialog to the user
|
||||
AppUsesMouse=y
|
||||
|
||||
# Application needs two-button mouse, will also enable advanced point-and-click features (y) or (n)
|
||||
AppNeedsTwoButtonMouse=n
|
||||
|
||||
# Right mouse button can do long-press/drag&drop action, necessary for some games (y) or (n)
|
||||
# If you disable it, swiping with two fingers will send mouse wheel events
|
||||
RightMouseButtonLongPress=n
|
||||
|
||||
# Show SDL mouse cursor, for applications that do not draw cursor at all (y) or (n)
|
||||
ShowMouseCursor=n
|
||||
|
||||
# Screen follows mouse cursor, when it's covered by soft keyboard, this works only in software video mode (y) or (n)
|
||||
ScreenFollowsMouse=n
|
||||
|
||||
# Generate more touch events, by default SDL generates one event per one video frame, this is useful for drawing apps (y) or (n)
|
||||
GenerateSubframeTouchEvents=n
|
||||
|
||||
# Force relative (laptop) mouse movement mode, useful when both on-screen keyboard and mouse are needed (y) or (n)
|
||||
ForceRelativeMouseMode=n
|
||||
|
||||
# Show on-screen dpad/joystick, that will act as arrow keys (y) or (n)
|
||||
AppNeedsArrowKeys=n
|
||||
|
||||
# On-screen dpad/joystick will appear under finger when it touches the screen (y) or (n)
|
||||
# Joystick always follows finger, so moving mouse requires touching the screen with other finger
|
||||
FloatingScreenJoystick=n
|
||||
|
||||
# Application needs text input (y) or (n), enables button for text input on screen
|
||||
AppNeedsTextInput=n
|
||||
|
||||
# Application uses joystick (y) or (n), the on-screen DPAD will be used as joystick 0 axes 0-1
|
||||
# This will disable AppNeedsArrowKeys option
|
||||
AppUsesJoystick=y
|
||||
|
||||
# Application uses second on-screen joystick, as SDL joystick 0 axes 2-3 (y)/(n)
|
||||
AppUsesSecondJoystick=n
|
||||
|
||||
# Application uses third on-screen joystick, as SDL joystick 0 axes 20-21 (y)/(n)
|
||||
AppUsesThirdJoystick=n
|
||||
|
||||
# Application uses accelerometer (y) or (n), the accelerometer will be used as joystick 1 axes 0-1 and 5-7
|
||||
AppUsesAccelerometer=n
|
||||
|
||||
# Application uses gyroscope (y) or (n), the gyroscope will be used as joystick 1 axes 2-4
|
||||
AppUsesGyroscope=n
|
||||
|
||||
# Application uses orientation sensor (y) or (n), reported as joystick 1 axes 8-10
|
||||
AppUsesOrientationSensor=n
|
||||
|
||||
# Use gyroscope to move mouse cursor (y) or (n), it eats battery, and can be disabled in settings, do not use with AppUsesGyroscope setting
|
||||
MoveMouseWithGyroscope=n
|
||||
|
||||
# Application uses multitouch (y) or (n), multitouch events are passed as SDL_JOYBALLMOTION events for the joystick 0
|
||||
AppUsesMultitouch=n
|
||||
|
||||
# Application records audio (it will use any available source, such a s microphone)
|
||||
# API is defined in file SDL_android.h: int SDL_ANDROID_OpenAudioRecording(SDL_AudioSpec *spec); void SDL_ANDROID_CloseAudioRecording(void);
|
||||
# This option will add additional permission to Android manifest (y)/(n)
|
||||
AppRecordsAudio=n
|
||||
|
||||
# Application needs to access SD card. Always disable it, unless you want to access user photos and downloads. (y) / (n)
|
||||
AccessSdCard=n
|
||||
|
||||
# Application needs Internet access. If you disable it, you'll have to bundle all your data files inside .apk (y) / (n)
|
||||
AccessInternet=y
|
||||
|
||||
# Immersive mode - Android will hide on-screen Home/Back keys. Looks bad if you invoke Android keyboard. (y) / (n)
|
||||
ImmersiveMode=y
|
||||
|
||||
# Hide Android system mouse cursor image when USB mouse is attached (y) or (n) - the app must draw it's own mouse cursor
|
||||
HideSystemMousePointer=y
|
||||
|
||||
# Application implements Android-specific routines to put to background, and will not draw anything to screen
|
||||
# between SDL_ACTIVEEVENT lost / gained notifications - you should check for them
|
||||
# rigth after SDL_Flip(), if (n) then SDL_Flip() will block till app in background (y) or (n)
|
||||
# This option is reported to be buggy, sometimes failing to restore video state
|
||||
NonBlockingSwapBuffers=n
|
||||
|
||||
# Redefine common hardware keys to SDL keysyms
|
||||
# BACK hardware key is available on all devices, MENU is available on pre-ICS devices, other keys may be absent
|
||||
# SEARCH and CALL by default return same keycode as DPAD_CENTER - one of those keys is available on most devices
|
||||
# Use word NO_REMAP if you want to preserve native functionality for certain key (volume keys are 3-rd and 4-th)
|
||||
# Keys: TOUCHSCREEN (works only when AppUsesMouse=n), DPAD_CENTER/SEARCH, VOLUMEUP, VOLUMEDOWN, MENU, BACK, CAMERA
|
||||
RedefinedKeys="SPACE RETURN NO_REMAP NO_REMAP"
|
||||
|
||||
# Number of virtual keyboard keys (currently 6 is maximum)
|
||||
AppTouchscreenKeyboardKeysAmount=4
|
||||
|
||||
# Redefine on-screen keyboard keys to SDL keysyms - 6 keyboard keys + 4 multitouch gestures (zoom in/out and rotate left/right)
|
||||
RedefinedKeysScreenKb="LALT X LCTRL LSHIFT I"
|
||||
|
||||
# Names for on-screen keyboard keys, such as Fire, Jump, Run etc, separated by spaces, they are used in SDL config menu
|
||||
RedefinedKeysScreenKbNames="Jump Rope Shoot SelectWeapon Chat"
|
||||
|
||||
# On-screen keys theme
|
||||
# 0 = Ultimate Droid by Sean Stieber (green, with cross joystick)
|
||||
# 1 = Simple Theme by Beholder (white, with cross joystick)
|
||||
# 2 = Sun by Sirea (yellow, with round joystick)
|
||||
# 3 = Keen by Gerstrong (multicolor, with round joystick)
|
||||
# 4 = Retro by Santiago Radeff (red/white, with cross joystick)
|
||||
# 5 = GameBoy from RetroArch
|
||||
# 6 = PlayStation from RetroArch
|
||||
# 7 = SuperNintendo from RetroArch
|
||||
# 8 = DualShock from RetroArch
|
||||
# 9 = Nintendo64 from RetroArch
|
||||
TouchscreenKeysTheme=3
|
||||
|
||||
# Redefine gamepad keys to SDL keysyms, button order is:
|
||||
# A B X Y L1 R1 L2 R2 LThumb RThumb Start Select Up Down Left Right
|
||||
RedefinedKeysGamepad="A LALT LCTRL X LALT LSHIFT X LCTRL LSHIFT 1 ESCAPE ESCAPE UP DOWN LEFT RIGHT UP DOWN LEFT RIGHT 2 3 4 5"
|
||||
|
||||
# Redefine keys for the second gamepad, same as the first gamepad if not set:
|
||||
RedefinedKeysSecondGamepad="KP_DIVIDE KP_ENTER KP_PLUS KP_MINUS KP_ENTER KP_0 KP_MINUS KP_PLUS KP_0 6 ESCAPE ESCAPE KP_8 KP_5 KP_4 KP_6 KP_8 KP_5 KP_4 KP_6 7 8 9 0"
|
||||
|
||||
# Redefine keys for the third gamepad, same as the first gamepad if not set:
|
||||
RedefinedKeysThirdGamepad=""
|
||||
|
||||
# Redefine keys for the fourth gamepad, same as the first gamepad if not set:
|
||||
RedefinedKeysFourthGamepad=""
|
||||
|
||||
# How long to show startup menu button, in msec, 0 to disable startup menu
|
||||
StartupMenuButtonTimeout=1000
|
||||
|
||||
# Menu items to hide from startup menu, available menu items:
|
||||
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.CommandlineConfig SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
|
||||
HiddenMenuOptions='SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMouse.DisplaySizeConfig'
|
||||
|
||||
# Menu items to show at startup - this is Java code snippet, leave empty for default
|
||||
# new SettingsMenuMisc.ShowReadme(), (AppUsesMouse \&\& \! ForceRelativeMouseMode \? new SettingsMenuMouse.DisplaySizeConfig(true) : new SettingsMenu.DummyMenu()), new SettingsMenuMisc.OptionalDownloadConfig(true), new SettingsMenuMisc.GyroscopeCalibration()
|
||||
# Available menu items:
|
||||
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.CommandlineConfig SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
|
||||
FirstStartMenuOptions='SettingsMenuMisc.ShowReadme'
|
||||
|
||||
# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower
|
||||
AppMinimumRAM=0
|
||||
|
||||
# GCC version, or 'clang' for CLANG
|
||||
NDK_TOOLCHAIN_VERSION=clang
|
||||
|
||||
# Android platform version.
|
||||
# android-9 = Android 2.3, the earliest supported version.
|
||||
# android-18 = Android 4.3, the first version supporting GLES3.
|
||||
# android-21 = Android 5.1, the first version with SO_REUSEPORT defined.
|
||||
APP_PLATFORM=android-21
|
||||
|
||||
# Specify architectures to compile, 'all' or 'y' to compile for all architectures.
|
||||
# Available architectures: armeabi armeabi-v7a x86 mips arm64-v8a
|
||||
MultiABI='armeabi-v7a arm64-v8a x86 x86_64' # arm64-v8a x86 x86_64
|
||||
|
||||
# Optional shared libraries to compile - removing some of them will save space
|
||||
# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed
|
||||
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2
|
||||
CompiledLibraries="sdl_image sdl_mixer xml2 curl ssl crypto gd jpeg vorbis ogg lzma mad"
|
||||
|
||||
# Application uses custom build script AndroidBuild.sh instead of Android.mk (y) or (n)
|
||||
CustomBuildScript=n
|
||||
|
||||
# Aditional CFLAGS for application
|
||||
AppCflags='-O3 -ffast-math -Werror=format -DDISABLE_JOYSTICK -DHAVE_LINENOISE -DNBREAKPAD -DHAVE_EXECINFO=0' # -flto=thin
|
||||
|
||||
# Aditional C++-specific compiler flags for application, added after AppCflags
|
||||
AppCppflags='-O3 -ffast-math -Werror=format -std=c++11 -frtti -fexceptions -DDISABLE_JOYSTICK -DHAVE_LINENOISE -DNBREAKPAD -DHAVE_EXECINFO=0' #-flto=thin
|
||||
|
||||
# Additional LDFLAGS for application
|
||||
AppLdflags='-O3' #-flto=thin -flto-jobs=8
|
||||
|
||||
# If application has headers with the same name as system headers, this option tries to fix compiler flags to make it compilable
|
||||
AppOverlapsSystemHeaders=n
|
||||
|
||||
# Build only following subdirs (empty will build all dirs, ignored with custom script)
|
||||
# src/src/game/* src/src/gui/* src/src/gusanos/* src/src/level/* src/src/utils/*
|
||||
AppSubdirsBuild='src/include src/src src/src/client/* src/src/common/* src/src/server/* src/libs/hawknl/include src/libs/hawknl/src src/libs/libzip src/libs/linenoise src/libs/lua src/libs/pstreams'
|
||||
|
||||
# Exclude these files from build
|
||||
AppBuildExclude='src/libs/hawknl/src/ipx.c src/libs/linenoise/example.c'
|
||||
|
||||
# Application command line parameters, including app name as 0-th param
|
||||
AppCmdline=''
|
||||
|
||||
# Screen size is used by Google Play to prevent an app to be installed on devices with smaller screens
|
||||
# Minimum screen size that application supports: (s)mall / (m)edium / (l)arge
|
||||
MinimumScreenSize=n
|
||||
|
||||
# Your AdMob Publisher ID, (n) if you don't want advertisements
|
||||
AdmobPublisherId=n
|
||||
|
||||
# Your AdMob test device ID, to receive a test ad
|
||||
AdmobTestDeviceId=
|
||||
|
||||
# Your AdMob banner size (BANNER/FULL_BANNER/LEADERBOARD/MEDIUM_RECTANGLE/SMART_BANNER/WIDE_SKYSCRAPER/FULL_WIDTH:Height/Width:AUTO_HEIGHT/Width:Height)
|
||||
AdmobBannerSize=
|
||||
|
||||
# Google Play Game Services application ID, required for cloud saves to work
|
||||
GooglePlayGameServicesId=
|
||||
|
||||
# The app will open files with following extension, file path will be added to commandline params
|
||||
AppOpenFileExtension=''
|
||||
|
||||
1
project/jni/application/openlierox/AndroidData/logo.png
Symbolic link
1
project/jni/application/openlierox/AndroidData/logo.png
Symbolic link
@@ -0,0 +1 @@
|
||||
../src/share/gamedir/data/gfx/console.png
|
||||
11
project/jni/application/openlierox/AndroidPreBuild.sh
Executable file
11
project/jni/application/openlierox/AndroidPreBuild.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
cp -f liero.raw ../../../res/raw/
|
||||
|
||||
[ -e AndroidData/data.zip.xz ] && exit 0
|
||||
cd src/share/gamedir
|
||||
rm -f ../data.zip
|
||||
zip -0 -r ../data.zip .
|
||||
cd ../../..
|
||||
xz -9 < src/share/data.zip > AndroidData/data.zip.xz
|
||||
rm -f src/share/data.zip
|
||||
1
project/jni/application/openlierox/banner.png
Symbolic link
1
project/jni/application/openlierox/banner.png
Symbolic link
@@ -0,0 +1 @@
|
||||
src/share/tv-banner.png
|
||||
1
project/jni/application/openlierox/icon.png
Symbolic link
1
project/jni/application/openlierox/icon.png
Symbolic link
@@ -0,0 +1 @@
|
||||
src/share/android-icon.png
|
||||
131
project/jni/application/openlierox/java.patch
Normal file
131
project/jni/application/openlierox/java.patch
Normal file
@@ -0,0 +1,131 @@
|
||||
diff --git a/project/java/Settings.java b/project/java/Settings.java
|
||||
index 9e6150a..09ade66 100644
|
||||
--- a/project/java/Settings.java
|
||||
+++ b/project/java/Settings.java
|
||||
@@ -736,7 +736,7 @@ public class Settings
|
||||
if( Globals.TouchscreenKeyboardTheme == 2 )
|
||||
nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.sun));
|
||||
if( Globals.TouchscreenKeyboardTheme == 3 )
|
||||
- nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.keen));
|
||||
+ nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.liero));
|
||||
if( Globals.TouchscreenKeyboardTheme == 4 )
|
||||
nativeSetupScreenKeyboardButtons(loadRaw(p, R.raw.retro));
|
||||
if( Globals.TouchscreenKeyboardTheme == 5 )
|
||||
--- /dev/null 2018-12-13 18:37:19.876000065 +0200
|
||||
+++ Connect.java 2018-12-17 21:16:01.027001714 +0200
|
||||
@@ -0,0 +1,115 @@
|
||||
+/*
|
||||
+Simple DirectMedia Layer
|
||||
+Java source code (C) 2009-2014 Sergii Pylypenko
|
||||
+
|
||||
+This software is provided 'as-is', without any express or implied
|
||||
+warranty. In no event will the authors be held liable for any damages
|
||||
+arising from the use of this software.
|
||||
+
|
||||
+Permission is granted to anyone to use this software for any purpose,
|
||||
+including commercial applications, and to alter it and redistribute it
|
||||
+freely, subject to the following restrictions:
|
||||
+
|
||||
+1. The origin of this software must not be misrepresented; you must not
|
||||
+ claim that you wrote the original software. If you use this software
|
||||
+ in a product, an acknowledgment in the product documentation would be
|
||||
+ appreciated but is not required.
|
||||
+2. Altered source versions must be plainly marked as such, and must not be
|
||||
+ misrepresented as being the original software.
|
||||
+3. This notice may not be removed or altered from any source distribution.
|
||||
+*/
|
||||
+
|
||||
+package openlierox.net;
|
||||
+
|
||||
+import android.app.Activity;
|
||||
+import android.app.Service;
|
||||
+import android.content.Context;
|
||||
+import android.os.Bundle;
|
||||
+import android.os.IBinder;
|
||||
+import android.view.MotionEvent;
|
||||
+import android.view.KeyEvent;
|
||||
+import android.view.Window;
|
||||
+import android.view.WindowManager;
|
||||
+import android.view.View;
|
||||
+import android.view.ViewGroup;
|
||||
+import android.widget.TextView;
|
||||
+import android.widget.EditText;
|
||||
+import android.text.Editable;
|
||||
+import android.widget.Button;
|
||||
+import android.widget.ImageView;
|
||||
+import android.widget.LinearLayout;
|
||||
+import android.widget.FrameLayout;
|
||||
+import android.graphics.drawable.Drawable;
|
||||
+import android.graphics.Color;
|
||||
+import android.content.res.Configuration;
|
||||
+import android.app.Notification;
|
||||
+import android.app.NotificationManager;
|
||||
+import android.app.PendingIntent;
|
||||
+import android.content.Intent;
|
||||
+import android.view.View.OnKeyListener;
|
||||
+import android.view.MenuItem;
|
||||
+import android.view.Menu;
|
||||
+import android.view.Gravity;
|
||||
+import android.text.method.TextKeyListener;
|
||||
+import java.util.LinkedList;
|
||||
+import java.io.SequenceInputStream;
|
||||
+import java.io.BufferedInputStream;
|
||||
+import java.io.IOException;
|
||||
+import java.io.InputStream;
|
||||
+import java.io.OutputStream;
|
||||
+import java.io.FileOutputStream;
|
||||
+import java.io.File;
|
||||
+import java.io.FileInputStream;
|
||||
+import java.util.zip.*;
|
||||
+import java.util.zip.ZipEntry;
|
||||
+import java.util.zip.ZipInputStream;
|
||||
+import java.util.Set;
|
||||
+import android.text.SpannedString;
|
||||
+import java.io.BufferedReader;
|
||||
+import java.io.BufferedInputStream;
|
||||
+import java.io.InputStreamReader;
|
||||
+import android.view.inputmethod.InputMethodManager;
|
||||
+import android.content.pm.PackageInfo;
|
||||
+import android.content.pm.PackageManager;
|
||||
+import android.os.Handler;
|
||||
+import android.os.Message;
|
||||
+import android.os.SystemClock;
|
||||
+import java.util.concurrent.Semaphore;
|
||||
+import android.content.pm.ActivityInfo;
|
||||
+import android.view.Display;
|
||||
+import android.util.DisplayMetrics;
|
||||
+import android.text.InputType;
|
||||
+import android.util.Log;
|
||||
+import android.view.Surface;
|
||||
+import android.app.ProgressDialog;
|
||||
+import android.app.KeyguardManager;
|
||||
+import android.view.ViewTreeObserver;
|
||||
+import android.graphics.Rect;
|
||||
+import android.net.Uri;
|
||||
+import android.content.ComponentName;
|
||||
+
|
||||
+
|
||||
+public class Connect extends Activity
|
||||
+{
|
||||
+ @Override
|
||||
+ protected void onCreate(Bundle savedInstanceState)
|
||||
+ {
|
||||
+ super.onCreate(savedInstanceState);
|
||||
+
|
||||
+ Intent main = new Intent(this, MainActivity.class);
|
||||
+ main.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
+ if( getIntent().getScheme() != null && getIntent().getScheme().equals("openlierox") && getIntent().getData() != null && getIntent().getData().getHost().equals("connect") )
|
||||
+ {
|
||||
+ main.putExtra(RestartMainActivity.SDL_RESTART_PARAMS, getIntent().getData().getPath().replace("/","").replace("!",":"));
|
||||
+ }
|
||||
+ if( getIntent().getScheme() != null && getIntent().getScheme().equals("https") && getIntent().getData() != null && getIntent().getData().getPath().contains("connect") )
|
||||
+ {
|
||||
+ if( getIntent().getData().getQueryParameter("a") != null )
|
||||
+ main.putExtra(RestartMainActivity.SDL_RESTART_PARAMS, getIntent().getData().getQueryParameter("a").replace("!",":"));
|
||||
+ else
|
||||
+ main.putExtra(RestartMainActivity.SDL_RESTART_PARAMS, getIntent().getData().getPath().replace("/connect/","").replace("!",":"));
|
||||
+ }
|
||||
+ startActivity(main);
|
||||
+ finish();
|
||||
+ }
|
||||
+}
|
||||
BIN
project/jni/application/openlierox/liero.raw
Normal file
BIN
project/jni/application/openlierox/liero.raw
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user