diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 0e1409f11be..054d29c865d 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -13,6 +13,11 @@ jobs: - name: Install dependencies run: | bash script/android/install_packages.sh + sudo apt-get -y update + sudo apt-get -y install gettext + - name: Generate translations + run: | + make -C files/lang -j 2 - name: Build run: | cd android @@ -38,3 +43,15 @@ jobs: name: fheroes2_android.zip path: fheroes2_android.zip if-no-files-found: error + - uses: ncipollo/release-action@v1 + if: ${{ github.event_name == 'push' }} + with: + artifacts: fheroes2_android.zip + body: ${{ github.event.head_commit.message }} + token: ${{ secrets.GITHUB_TOKEN }} + name: Android build (latest commit) + tag: fheroes2-android + allowUpdates: true + artifactErrorsFailBuild: true + prerelease: true + replacesArtifacts: true diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index 6f37742785d..2fd7c1a8ddf 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -12,9 +12,9 @@ jobs: os: ubuntu-latest dependencies: libsdl1.2-dev libsdl-mixer1.2-dev gettext env: { FHEROES2_STRICT_COMPILATION: ON, FHEROES2_WITH_TOOLS: ON, FHEROES2_WITH_SDL1: ON } - package_name: fheroes2_ubuntu_sdl1.zip + package_name: fheroes2_ubuntu_SDL1.zip package_files: fheroes2 LICENSE script/linux/install_sdl_1.sh download_demo_version.sh extract_homm2_resources.sh changelog.txt README.txt files/lang/*.mo files/data/*.h2d - release_name: Ubuntu (Linux) build with SDL 1.2 support (latest commit) + release_name: Ubuntu (Linux) build with SDL1 (latest commit) release_tag: fheroes2-linux-sdl1_dev - name: Linux SDL1 Debug os: ubuntu-latest @@ -24,9 +24,9 @@ jobs: os: ubuntu-latest dependencies: libsdl2-dev libsdl2-mixer-dev gettext env: { FHEROES2_STRICT_COMPILATION: ON, FHEROES2_WITH_TOOLS: ON } - package_name: fheroes2_ubuntu_sdl2.zip + package_name: fheroes2_ubuntu_SDL2.zip package_files: fheroes2 LICENSE script/linux/install_sdl_2.sh download_demo_version.sh extract_homm2_resources.sh changelog.txt README.txt files/lang/*.mo files/data/*.h2d - release_name: Ubuntu (Linux) build with SDL 2.0 support (latest commit) + release_name: Ubuntu (Linux) build with SDL2 (latest commit) release_tag: fheroes2-linux-sdl2_dev - name: Linux SDL2 Debug os: ubuntu-latest @@ -36,9 +36,9 @@ jobs: os: macos-11 dependencies: sdl sdl_mixer env: { FHEROES2_STRICT_COMPILATION: ON, FHEROES2_WITH_TOOLS: ON, FHEROES2_WITH_SDL1: ON } - package_name: fheroes2_macos11_sdl1_x86-64.zip + package_name: fheroes2_macos_x86-64_SDL1.zip package_files: fheroes2 LICENSE script/macos/install_sdl_1.sh download_demo_version.sh extract_homm2_resources.sh changelog.txt README.txt files/lang/*.mo files/data/*.h2d - release_name: MacOS build with SDL 1 support (latest commit) + release_name: macOS x86-64 build with SDL1 (latest commit) release_tag: fheroes2-osx-sdl1_dev - name: macOS SDL1 App Bundle os: macos-11 @@ -48,9 +48,9 @@ jobs: os: macos-11 dependencies: sdl2 sdl2_mixer env: { FHEROES2_STRICT_COMPILATION: ON, FHEROES2_WITH_TOOLS: ON } - package_name: fheroes2_macos11_sdl2_x86-64.zip + package_name: fheroes2_macos_x86-64_SDL2.zip package_files: fheroes2 LICENSE script/macos/install_sdl_2.sh download_demo_version.sh extract_homm2_resources.sh changelog.txt README.txt files/lang/*.mo files/data/*.h2d - release_name: MacOS build with SDL 2 support (latest commit) + release_name: macOS x86-64 build with SDL2 (latest commit) release_tag: fheroes2-osx-sdl2_dev - name: macOS SDL2 App Bundle os: macos-11 @@ -154,20 +154,20 @@ jobs: run: | cp docs/README.txt docs/README_PSV.md . # Translations and H2D files are already included in fheroes2.vpk - zip fheroes2_psv_sdl2.zip fheroes2.vpk LICENSE changelog.txt README.txt README_PSV.md + zip fheroes2_psv.zip fheroes2.vpk LICENSE changelog.txt README.txt README_PSV.md - uses: actions/upload-artifact@v3 if: ${{ github.event_name == 'pull_request' }} with: - name: fheroes2_psv_sdl2.zip - path: fheroes2_psv_sdl2.zip + name: fheroes2_psv.zip + path: fheroes2_psv.zip if-no-files-found: error - uses: ncipollo/release-action@v1 if: ${{ github.event_name == 'push' }} with: - artifacts: fheroes2_psv_sdl2.zip + artifacts: fheroes2_psv.zip body: ${{ github.event.head_commit.message }} token: ${{ secrets.GITHUB_TOKEN }} - name: PS Vita build with SDL 2.0 support (latest commit) + name: PS Vita build (latest commit) tag: fheroes2-psv-sdl2_dev allowUpdates: true artifactErrorsFailBuild: true @@ -197,20 +197,20 @@ jobs: - name: Create package run: | cp docs/README.txt docs/README_switch.md . - zip fheroes2_switch_sdl2.zip fheroes2.nro LICENSE changelog.txt README.txt README_switch.md files/lang/*.mo files/data/*.h2d + zip fheroes2_switch.zip fheroes2.nro LICENSE changelog.txt README.txt README_switch.md files/lang/*.mo files/data/*.h2d - uses: actions/upload-artifact@v3 if: ${{ github.event_name == 'pull_request' }} with: - name: fheroes2_switch_sdl2.zip - path: fheroes2_switch_sdl2.zip + name: fheroes2_switch.zip + path: fheroes2_switch.zip if-no-files-found: error - uses: ncipollo/release-action@v1 if: ${{ github.event_name == 'push' }} with: - artifacts: fheroes2_switch_sdl2.zip + artifacts: fheroes2_switch.zip body: ${{ github.event.head_commit.message }} token: ${{ secrets.GITHUB_TOKEN }} - name: Nintendo Switch build with SDL 2.0 support (latest commit) + name: Nintendo Switch build (latest commit) tag: fheroes2-switch-sdl2_dev allowUpdates: true artifactErrorsFailBuild: true diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index 74a07dd7831..891c5e86489 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -13,28 +13,28 @@ jobs: build_config: Release-SDL1 deploy_config: SDL1 package_name: fheroes2_windows_x86_SDL1 - release_name: Windows x86 build with SDL1 support (latest commit) + release_name: Windows x86 build with SDL1 (latest commit) release_tag: fheroes2-windows-x86-SDL1 - name: SDL1 x64 platform: x64 build_config: Release-SDL1 deploy_config: SDL1 package_name: fheroes2_windows_x64_SDL1 - release_name: Windows x64 build with SDL1 support (latest commit) + release_name: Windows x64 build with SDL1 (latest commit) release_tag: fheroes2-windows-x64-SDL1 - name: SDL2 x86 platform: x86 build_config: Release-SDL2 deploy_config: SDL2 package_name: fheroes2_windows_x86_SDL2 - release_name: Windows x86 build with SDL2 support (latest commit) + release_name: Windows x86 build with SDL2 (latest commit) release_tag: fheroes2-windows-x86-SDL2 - name: SDL2 x64 platform: x64 build_config: Release-SDL2 deploy_config: SDL2 package_name: fheroes2_windows_x64_SDL2 - release_name: Windows x64 build with SDL2 support (latest commit) + release_name: Windows x64 build with SDL2 (latest commit) release_tag: fheroes2-windows-x64-SDL2 name: MSVC (${{ matrix.config.name }}) runs-on: windows-2019 diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index b4689471705..cdcb9a8f4ed 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -9,6 +9,9 @@ concurrency: cancel-in-progress: true jobs: + android: + name: Android + uses: ./.github/workflows/android.yml make: name: Make uses: ./.github/workflows/make.yml @@ -23,6 +26,7 @@ jobs: translation: name: Translation update needs: + - android - make - msvc uses: ./.github/workflows/translation_update.yml diff --git a/.gitignore b/.gitignore index 29aa7665a69..eab636404b2 100644 --- a/.gitignore +++ b/.gitignore @@ -92,5 +92,8 @@ android/local.properties android/.idea android/.gradle +# Automatically created Android assets +android/app/src/main/assets/files/ + # Mac magic folders .DS_Store diff --git a/android/app/build.gradle b/android/app/build.gradle index bb5b7c45f36..e63ed96f90c 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -40,4 +40,23 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation project(':sdl2') + implementation 'org.apache.directory.studio:org.apache.commons.io:2.4' +} + +task copyH2D(type: Copy) { + from('../../files/data') { + include '*.h2d' + } + into 'src/main/assets/files/data' +} + +task copyTranslations(type: Copy) { + from('../../files/lang') { + include '*.mo' + } + into 'src/main/assets/files/lang' +} + +preBuild { + dependsOn copyH2D, copyTranslations } diff --git a/android/app/src/main/assets/instruments/README.txt b/android/app/src/main/assets/instruments/README.txt new file mode 100644 index 00000000000..a18670a7949 --- /dev/null +++ b/android/app/src/main/assets/instruments/README.txt @@ -0,0 +1,34 @@ +There has been some interest in using this patch set commercially. I am +flattered, but I'm not sure what to say here. I know that there are some +patches that came from the ultrasnd mirrors which contained notices that +they did not wish for them to be used commercially. Since I raided the +ultrasnd archives many years ago, I couldn't remember which ones were +covered by this, so I just flatly said that the whole set was for +non-commercial use only. Since then, I have extracted the *.txt and read*.* +files out of all the archives and grep'd them for "commercial". While several +of them came up as only being for non-commercial use, there are only a few in +my set to which this applies. These are: + +nearly the entire Analog drumset, drumset 25 +pistol.pat +pistol2.pat (not currently mapped in cfg files) +machgun1.pat (not currently mapped in cfg files) + +So, basicly you can not use the analog drums or the pistol files in any +commercial work. This is out of my hands. The rest of the patches are fully +public domain as far as I know. It should not be hard to find another +pistol which sounds almost as good. As for the analog drumset, just go buy +yourself a real TR808 or some other product far superior to these patches. + +If you DO use this patch set in a commercial production, I'd like to hear +about it. A free copy of the production might be nice too :) + + + + +Eric A. Welsh +ewelsh@gpc.ibc.wustl.edu +Center for Molecular Design +Institute for Biomedical Computing +Washington University +St. Louis, MO diff --git a/android/app/src/main/assets/instruments/acpiano.pat b/android/app/src/main/assets/instruments/acpiano.pat new file mode 100644 index 00000000000..9476e047453 Binary files /dev/null and b/android/app/src/main/assets/instruments/acpiano.pat differ diff --git a/android/app/src/main/assets/instruments/agogohi.pat b/android/app/src/main/assets/instruments/agogohi.pat new file mode 100644 index 00000000000..098cbd3a2f0 Binary files /dev/null and b/android/app/src/main/assets/instruments/agogohi.pat differ diff --git a/android/app/src/main/assets/instruments/agogolo.pat b/android/app/src/main/assets/instruments/agogolo.pat new file mode 100644 index 00000000000..1b5fc8d7f9b Binary files /dev/null and b/android/app/src/main/assets/instruments/agogolo.pat differ diff --git a/android/app/src/main/assets/instruments/bassoon.pat b/android/app/src/main/assets/instruments/bassoon.pat new file mode 100644 index 00000000000..d720351be52 Binary files /dev/null and b/android/app/src/main/assets/instruments/bassoon.pat differ diff --git a/android/app/src/main/assets/instruments/belltree.pat b/android/app/src/main/assets/instruments/belltree.pat new file mode 100644 index 00000000000..961278d61b1 Binary files /dev/null and b/android/app/src/main/assets/instruments/belltree.pat differ diff --git a/android/app/src/main/assets/instruments/bongohi.pat b/android/app/src/main/assets/instruments/bongohi.pat new file mode 100644 index 00000000000..89406692979 Binary files /dev/null and b/android/app/src/main/assets/instruments/bongohi.pat differ diff --git a/android/app/src/main/assets/instruments/bongolo.pat b/android/app/src/main/assets/instruments/bongolo.pat new file mode 100644 index 00000000000..8a3283a7c17 Binary files /dev/null and b/android/app/src/main/assets/instruments/bongolo.pat differ diff --git a/android/app/src/main/assets/instruments/bowglass.pat b/android/app/src/main/assets/instruments/bowglass.pat new file mode 100644 index 00000000000..3b54895bc07 Binary files /dev/null and b/android/app/src/main/assets/instruments/bowglass.pat differ diff --git a/android/app/src/main/assets/instruments/cabasa.pat b/android/app/src/main/assets/instruments/cabasa.pat new file mode 100644 index 00000000000..b92d278afaa Binary files /dev/null and b/android/app/src/main/assets/instruments/cabasa.pat differ diff --git a/android/app/src/main/assets/instruments/castinet.pat b/android/app/src/main/assets/instruments/castinet.pat new file mode 100644 index 00000000000..608186e2748 Binary files /dev/null and b/android/app/src/main/assets/instruments/castinet.pat differ diff --git a/android/app/src/main/assets/instruments/cello.pat b/android/app/src/main/assets/instruments/cello.pat new file mode 100644 index 00000000000..9895b1c5d58 Binary files /dev/null and b/android/app/src/main/assets/instruments/cello.pat differ diff --git a/android/app/src/main/assets/instruments/choir.pat b/android/app/src/main/assets/instruments/choir.pat new file mode 100644 index 00000000000..a6569370b28 Binary files /dev/null and b/android/app/src/main/assets/instruments/choir.pat differ diff --git a/android/app/src/main/assets/instruments/church.pat b/android/app/src/main/assets/instruments/church.pat new file mode 100644 index 00000000000..2af24c66b72 Binary files /dev/null and b/android/app/src/main/assets/instruments/church.pat differ diff --git a/android/app/src/main/assets/instruments/claps.pat b/android/app/src/main/assets/instruments/claps.pat new file mode 100644 index 00000000000..2e0b3dfd671 Binary files /dev/null and b/android/app/src/main/assets/instruments/claps.pat differ diff --git a/android/app/src/main/assets/instruments/clarinet.pat b/android/app/src/main/assets/instruments/clarinet.pat new file mode 100644 index 00000000000..0ee962a966f Binary files /dev/null and b/android/app/src/main/assets/instruments/clarinet.pat differ diff --git a/android/app/src/main/assets/instruments/clave.pat b/android/app/src/main/assets/instruments/clave.pat new file mode 100644 index 00000000000..569ef5adb93 Binary files /dev/null and b/android/app/src/main/assets/instruments/clave.pat differ diff --git a/android/app/src/main/assets/instruments/congahi1.pat b/android/app/src/main/assets/instruments/congahi1.pat new file mode 100644 index 00000000000..ad079f53d42 Binary files /dev/null and b/android/app/src/main/assets/instruments/congahi1.pat differ diff --git a/android/app/src/main/assets/instruments/congahi2.pat b/android/app/src/main/assets/instruments/congahi2.pat new file mode 100644 index 00000000000..850a8b825f5 Binary files /dev/null and b/android/app/src/main/assets/instruments/congahi2.pat differ diff --git a/android/app/src/main/assets/instruments/congalo.pat b/android/app/src/main/assets/instruments/congalo.pat new file mode 100644 index 00000000000..f4c4c44eeba Binary files /dev/null and b/android/app/src/main/assets/instruments/congalo.pat differ diff --git a/android/app/src/main/assets/instruments/contraba.pat b/android/app/src/main/assets/instruments/contraba.pat new file mode 100644 index 00000000000..d43a7c05a25 Binary files /dev/null and b/android/app/src/main/assets/instruments/contraba.pat differ diff --git a/android/app/src/main/assets/instruments/cowbell.pat b/android/app/src/main/assets/instruments/cowbell.pat new file mode 100644 index 00000000000..3ad57032056 Binary files /dev/null and b/android/app/src/main/assets/instruments/cowbell.pat differ diff --git a/android/app/src/main/assets/instruments/cuica1.pat b/android/app/src/main/assets/instruments/cuica1.pat new file mode 100644 index 00000000000..7a4c6408c83 Binary files /dev/null and b/android/app/src/main/assets/instruments/cuica1.pat differ diff --git a/android/app/src/main/assets/instruments/cuica2.pat b/android/app/src/main/assets/instruments/cuica2.pat new file mode 100644 index 00000000000..b169298a1f4 Binary files /dev/null and b/android/app/src/main/assets/instruments/cuica2.pat differ diff --git a/android/app/src/main/assets/instruments/cymbell.pat b/android/app/src/main/assets/instruments/cymbell.pat new file mode 100644 index 00000000000..9c62ba179f6 Binary files /dev/null and b/android/app/src/main/assets/instruments/cymbell.pat differ diff --git a/android/app/src/main/assets/instruments/cymchina.pat b/android/app/src/main/assets/instruments/cymchina.pat new file mode 100644 index 00000000000..ddd7bf4a919 Binary files /dev/null and b/android/app/src/main/assets/instruments/cymchina.pat differ diff --git a/android/app/src/main/assets/instruments/cymcrsh1.pat b/android/app/src/main/assets/instruments/cymcrsh1.pat new file mode 100644 index 00000000000..30e9e016419 Binary files /dev/null and b/android/app/src/main/assets/instruments/cymcrsh1.pat differ diff --git a/android/app/src/main/assets/instruments/cymcrsh2.pat b/android/app/src/main/assets/instruments/cymcrsh2.pat new file mode 100644 index 00000000000..3ee73a5f4c5 Binary files /dev/null and b/android/app/src/main/assets/instruments/cymcrsh2.pat differ diff --git a/android/app/src/main/assets/instruments/cymride1.pat b/android/app/src/main/assets/instruments/cymride1.pat new file mode 100644 index 00000000000..484e828c1d8 Binary files /dev/null and b/android/app/src/main/assets/instruments/cymride1.pat differ diff --git a/android/app/src/main/assets/instruments/cymride2.pat b/android/app/src/main/assets/instruments/cymride2.pat new file mode 100644 index 00000000000..2456b581ac2 Binary files /dev/null and b/android/app/src/main/assets/instruments/cymride2.pat differ diff --git a/android/app/src/main/assets/instruments/cymsplsh.pat b/android/app/src/main/assets/instruments/cymsplsh.pat new file mode 100644 index 00000000000..03023595868 Binary files /dev/null and b/android/app/src/main/assets/instruments/cymsplsh.pat differ diff --git a/android/app/src/main/assets/instruments/englhorn.pat b/android/app/src/main/assets/instruments/englhorn.pat new file mode 100644 index 00000000000..7e676086204 Binary files /dev/null and b/android/app/src/main/assets/instruments/englhorn.pat differ diff --git a/android/app/src/main/assets/instruments/flute.pat b/android/app/src/main/assets/instruments/flute.pat new file mode 100644 index 00000000000..9fc7c17931b Binary files /dev/null and b/android/app/src/main/assets/instruments/flute.pat differ diff --git a/android/app/src/main/assets/instruments/frenchrn.pat b/android/app/src/main/assets/instruments/frenchrn.pat new file mode 100644 index 00000000000..8a1559ddcea Binary files /dev/null and b/android/app/src/main/assets/instruments/frenchrn.pat differ diff --git a/android/app/src/main/assets/instruments/guiro1.pat b/android/app/src/main/assets/instruments/guiro1.pat new file mode 100644 index 00000000000..1fa05bbb901 Binary files /dev/null and b/android/app/src/main/assets/instruments/guiro1.pat differ diff --git a/android/app/src/main/assets/instruments/guiro2.pat b/android/app/src/main/assets/instruments/guiro2.pat new file mode 100644 index 00000000000..465baa3ecf3 Binary files /dev/null and b/android/app/src/main/assets/instruments/guiro2.pat differ diff --git a/android/app/src/main/assets/instruments/harp.pat b/android/app/src/main/assets/instruments/harp.pat new file mode 100644 index 00000000000..1491915b152 Binary files /dev/null and b/android/app/src/main/assets/instruments/harp.pat differ diff --git a/android/app/src/main/assets/instruments/highq.pat b/android/app/src/main/assets/instruments/highq.pat new file mode 100644 index 00000000000..3b6e3bdddb7 Binary files /dev/null and b/android/app/src/main/assets/instruments/highq.pat differ diff --git a/android/app/src/main/assets/instruments/hihatcl.pat b/android/app/src/main/assets/instruments/hihatcl.pat new file mode 100644 index 00000000000..0644e29e099 Binary files /dev/null and b/android/app/src/main/assets/instruments/hihatcl.pat differ diff --git a/android/app/src/main/assets/instruments/hihatop.pat b/android/app/src/main/assets/instruments/hihatop.pat new file mode 100644 index 00000000000..84420631bd3 Binary files /dev/null and b/android/app/src/main/assets/instruments/hihatop.pat differ diff --git a/android/app/src/main/assets/instruments/hihatpd.pat b/android/app/src/main/assets/instruments/hihatpd.pat new file mode 100644 index 00000000000..55ddc481db2 Binary files /dev/null and b/android/app/src/main/assets/instruments/hihatpd.pat differ diff --git a/android/app/src/main/assets/instruments/hrpschrd.pat b/android/app/src/main/assets/instruments/hrpschrd.pat new file mode 100644 index 00000000000..c9abfe8074f Binary files /dev/null and b/android/app/src/main/assets/instruments/hrpschrd.pat differ diff --git a/android/app/src/main/assets/instruments/jingles.pat b/android/app/src/main/assets/instruments/jingles.pat new file mode 100644 index 00000000000..8304c1b21bd Binary files /dev/null and b/android/app/src/main/assets/instruments/jingles.pat differ diff --git a/android/app/src/main/assets/instruments/kick1.pat b/android/app/src/main/assets/instruments/kick1.pat new file mode 100644 index 00000000000..1c8a097be0b Binary files /dev/null and b/android/app/src/main/assets/instruments/kick1.pat differ diff --git a/android/app/src/main/assets/instruments/kick2.pat b/android/app/src/main/assets/instruments/kick2.pat new file mode 100644 index 00000000000..35d22b7c309 Binary files /dev/null and b/android/app/src/main/assets/instruments/kick2.pat differ diff --git a/android/app/src/main/assets/instruments/maracas.pat b/android/app/src/main/assets/instruments/maracas.pat new file mode 100644 index 00000000000..500a1e881c2 Binary files /dev/null and b/android/app/src/main/assets/instruments/maracas.pat differ diff --git a/android/app/src/main/assets/instruments/marcato.pat b/android/app/src/main/assets/instruments/marcato.pat new file mode 100644 index 00000000000..54361cf5380 Binary files /dev/null and b/android/app/src/main/assets/instruments/marcato.pat differ diff --git a/android/app/src/main/assets/instruments/metbell.pat b/android/app/src/main/assets/instruments/metbell.pat new file mode 100644 index 00000000000..59c1178dad4 Binary files /dev/null and b/android/app/src/main/assets/instruments/metbell.pat differ diff --git a/android/app/src/main/assets/instruments/metclick.pat b/android/app/src/main/assets/instruments/metclick.pat new file mode 100644 index 00000000000..d23b521877e Binary files /dev/null and b/android/app/src/main/assets/instruments/metclick.pat differ diff --git a/android/app/src/main/assets/instruments/nyguitar.pat b/android/app/src/main/assets/instruments/nyguitar.pat new file mode 100644 index 00000000000..e93cd458080 Binary files /dev/null and b/android/app/src/main/assets/instruments/nyguitar.pat differ diff --git a/android/app/src/main/assets/instruments/oboe.pat b/android/app/src/main/assets/instruments/oboe.pat new file mode 100644 index 00000000000..e5997410e2b Binary files /dev/null and b/android/app/src/main/assets/instruments/oboe.pat differ diff --git a/android/app/src/main/assets/instruments/piccolo.pat b/android/app/src/main/assets/instruments/piccolo.pat new file mode 100644 index 00000000000..daf7e116db5 Binary files /dev/null and b/android/app/src/main/assets/instruments/piccolo.pat differ diff --git a/android/app/src/main/assets/instruments/pizzcato.pat b/android/app/src/main/assets/instruments/pizzcato.pat new file mode 100644 index 00000000000..33f40b31f25 Binary files /dev/null and b/android/app/src/main/assets/instruments/pizzcato.pat differ diff --git a/android/app/src/main/assets/instruments/scratch1.pat b/android/app/src/main/assets/instruments/scratch1.pat new file mode 100644 index 00000000000..edd5f7b92d7 Binary files /dev/null and b/android/app/src/main/assets/instruments/scratch1.pat differ diff --git a/android/app/src/main/assets/instruments/scratch2.pat b/android/app/src/main/assets/instruments/scratch2.pat new file mode 100644 index 00000000000..e0deb4a5b93 Binary files /dev/null and b/android/app/src/main/assets/instruments/scratch2.pat differ diff --git a/android/app/src/main/assets/instruments/shaker.pat b/android/app/src/main/assets/instruments/shaker.pat new file mode 100644 index 00000000000..3da2465b0e5 Binary files /dev/null and b/android/app/src/main/assets/instruments/shaker.pat differ diff --git a/android/app/src/main/assets/instruments/slap.pat b/android/app/src/main/assets/instruments/slap.pat new file mode 100644 index 00000000000..0d92ceeeb9a Binary files /dev/null and b/android/app/src/main/assets/instruments/slap.pat differ diff --git a/android/app/src/main/assets/instruments/slowstr.pat b/android/app/src/main/assets/instruments/slowstr.pat new file mode 100644 index 00000000000..c5a1b84e4bf Binary files /dev/null and b/android/app/src/main/assets/instruments/slowstr.pat differ diff --git a/android/app/src/main/assets/instruments/snap.pat b/android/app/src/main/assets/instruments/snap.pat new file mode 100644 index 00000000000..ca6f8554ed8 Binary files /dev/null and b/android/app/src/main/assets/instruments/snap.pat differ diff --git a/android/app/src/main/assets/instruments/snare1.pat b/android/app/src/main/assets/instruments/snare1.pat new file mode 100644 index 00000000000..e8121318993 Binary files /dev/null and b/android/app/src/main/assets/instruments/snare1.pat differ diff --git a/android/app/src/main/assets/instruments/snare2.pat b/android/app/src/main/assets/instruments/snare2.pat new file mode 100644 index 00000000000..284e9f8c584 Binary files /dev/null and b/android/app/src/main/assets/instruments/snare2.pat differ diff --git a/android/app/src/main/assets/instruments/snarerol.pat b/android/app/src/main/assets/instruments/snarerol.pat new file mode 100644 index 00000000000..4550dd370d8 Binary files /dev/null and b/android/app/src/main/assets/instruments/snarerol.pat differ diff --git a/android/app/src/main/assets/instruments/sqrclick.pat b/android/app/src/main/assets/instruments/sqrclick.pat new file mode 100644 index 00000000000..fc6c8add06a Binary files /dev/null and b/android/app/src/main/assets/instruments/sqrclick.pat differ diff --git a/android/app/src/main/assets/instruments/stickrim.pat b/android/app/src/main/assets/instruments/stickrim.pat new file mode 100644 index 00000000000..e2a86f53c4b Binary files /dev/null and b/android/app/src/main/assets/instruments/stickrim.pat differ diff --git a/android/app/src/main/assets/instruments/sticks.pat b/android/app/src/main/assets/instruments/sticks.pat new file mode 100644 index 00000000000..7084064835b Binary files /dev/null and b/android/app/src/main/assets/instruments/sticks.pat differ diff --git a/android/app/src/main/assets/instruments/surdo1.pat b/android/app/src/main/assets/instruments/surdo1.pat new file mode 100644 index 00000000000..52582b25b03 Binary files /dev/null and b/android/app/src/main/assets/instruments/surdo1.pat differ diff --git a/android/app/src/main/assets/instruments/surdo2.pat b/android/app/src/main/assets/instruments/surdo2.pat new file mode 100644 index 00000000000..689c43746d1 Binary files /dev/null and b/android/app/src/main/assets/instruments/surdo2.pat differ diff --git a/android/app/src/main/assets/instruments/synstr2.pat b/android/app/src/main/assets/instruments/synstr2.pat new file mode 100644 index 00000000000..a31c874dff6 Binary files /dev/null and b/android/app/src/main/assets/instruments/synstr2.pat differ diff --git a/android/app/src/main/assets/instruments/taiko.pat b/android/app/src/main/assets/instruments/taiko.pat new file mode 100644 index 00000000000..8ce2398d780 Binary files /dev/null and b/android/app/src/main/assets/instruments/taiko.pat differ diff --git a/android/app/src/main/assets/instruments/tamborin.pat b/android/app/src/main/assets/instruments/tamborin.pat new file mode 100644 index 00000000000..1293f8e6f97 Binary files /dev/null and b/android/app/src/main/assets/instruments/tamborin.pat differ diff --git a/android/app/src/main/assets/instruments/timbaleh.pat b/android/app/src/main/assets/instruments/timbaleh.pat new file mode 100644 index 00000000000..2cc1dfe8d64 Binary files /dev/null and b/android/app/src/main/assets/instruments/timbaleh.pat differ diff --git a/android/app/src/main/assets/instruments/timbalel.pat b/android/app/src/main/assets/instruments/timbalel.pat new file mode 100644 index 00000000000..2729bf80436 Binary files /dev/null and b/android/app/src/main/assets/instruments/timbalel.pat differ diff --git a/android/app/src/main/assets/instruments/timpani.pat b/android/app/src/main/assets/instruments/timpani.pat new file mode 100644 index 00000000000..05d758a7ca8 Binary files /dev/null and b/android/app/src/main/assets/instruments/timpani.pat differ diff --git a/android/app/src/main/assets/instruments/tomhi1.pat b/android/app/src/main/assets/instruments/tomhi1.pat new file mode 100644 index 00000000000..51f7fa2a8a8 Binary files /dev/null and b/android/app/src/main/assets/instruments/tomhi1.pat differ diff --git a/android/app/src/main/assets/instruments/tomhi2.pat b/android/app/src/main/assets/instruments/tomhi2.pat new file mode 100644 index 00000000000..1597c7ffa63 Binary files /dev/null and b/android/app/src/main/assets/instruments/tomhi2.pat differ diff --git a/android/app/src/main/assets/instruments/tomlo1.pat b/android/app/src/main/assets/instruments/tomlo1.pat new file mode 100644 index 00000000000..46d4b056adb Binary files /dev/null and b/android/app/src/main/assets/instruments/tomlo1.pat differ diff --git a/android/app/src/main/assets/instruments/tomlo2.pat b/android/app/src/main/assets/instruments/tomlo2.pat new file mode 100644 index 00000000000..c976efc11ad Binary files /dev/null and b/android/app/src/main/assets/instruments/tomlo2.pat differ diff --git a/android/app/src/main/assets/instruments/tommid1.pat b/android/app/src/main/assets/instruments/tommid1.pat new file mode 100644 index 00000000000..2f5e231abdc Binary files /dev/null and b/android/app/src/main/assets/instruments/tommid1.pat differ diff --git a/android/app/src/main/assets/instruments/tommid2.pat b/android/app/src/main/assets/instruments/tommid2.pat new file mode 100644 index 00000000000..dd6638c3ad5 Binary files /dev/null and b/android/app/src/main/assets/instruments/tommid2.pat differ diff --git a/android/app/src/main/assets/instruments/tremstr.pat b/android/app/src/main/assets/instruments/tremstr.pat new file mode 100644 index 00000000000..8c875accc7d Binary files /dev/null and b/android/app/src/main/assets/instruments/tremstr.pat differ diff --git a/android/app/src/main/assets/instruments/triangl1.pat b/android/app/src/main/assets/instruments/triangl1.pat new file mode 100644 index 00000000000..1eae2af88c7 Binary files /dev/null and b/android/app/src/main/assets/instruments/triangl1.pat differ diff --git a/android/app/src/main/assets/instruments/triangl2.pat b/android/app/src/main/assets/instruments/triangl2.pat new file mode 100644 index 00000000000..ce42e94d31b Binary files /dev/null and b/android/app/src/main/assets/instruments/triangl2.pat differ diff --git a/android/app/src/main/assets/instruments/trombone.pat b/android/app/src/main/assets/instruments/trombone.pat new file mode 100644 index 00000000000..93d5b15307b Binary files /dev/null and b/android/app/src/main/assets/instruments/trombone.pat differ diff --git a/android/app/src/main/assets/instruments/vibslap.pat b/android/app/src/main/assets/instruments/vibslap.pat new file mode 100644 index 00000000000..eecaa4d99b8 Binary files /dev/null and b/android/app/src/main/assets/instruments/vibslap.pat differ diff --git a/android/app/src/main/assets/instruments/viola.pat b/android/app/src/main/assets/instruments/viola.pat new file mode 100644 index 00000000000..9519af2eff6 Binary files /dev/null and b/android/app/src/main/assets/instruments/viola.pat differ diff --git a/android/app/src/main/assets/instruments/whistle1.pat b/android/app/src/main/assets/instruments/whistle1.pat new file mode 100644 index 00000000000..a191869a770 Binary files /dev/null and b/android/app/src/main/assets/instruments/whistle1.pat differ diff --git a/android/app/src/main/assets/instruments/whistle2.pat b/android/app/src/main/assets/instruments/whistle2.pat new file mode 100644 index 00000000000..6dc3ee273d4 Binary files /dev/null and b/android/app/src/main/assets/instruments/whistle2.pat differ diff --git a/android/app/src/main/assets/instruments/woodblk1.pat b/android/app/src/main/assets/instruments/woodblk1.pat new file mode 100644 index 00000000000..ac1909d3363 Binary files /dev/null and b/android/app/src/main/assets/instruments/woodblk1.pat differ diff --git a/android/app/src/main/assets/instruments/woodblk2.pat b/android/app/src/main/assets/instruments/woodblk2.pat new file mode 100644 index 00000000000..fcfe2cf4916 Binary files /dev/null and b/android/app/src/main/assets/instruments/woodblk2.pat differ diff --git a/android/app/src/main/assets/timidity.cfg b/android/app/src/main/assets/timidity.cfg new file mode 100644 index 00000000000..c10996da7e3 --- /dev/null +++ b/android/app/src/main/assets/timidity.cfg @@ -0,0 +1,98 @@ +# +# Set of GUS patches with MIDI instrument characteristics is taken from here: +# http://www.libsdl.org/projects/mixer/timidity/timidity.tar.gz +# + +bank 0 + +0 instruments/acpiano amp=125 +6 instruments/hrpschrd amp=115 +19 instruments/church +24 instruments/nyguitar amp=150 +41 instruments/viola +42 instruments/cello +43 instruments/contraba amp=150 +44 instruments/tremstr +45 instruments/pizzcato amp=85 +46 instruments/harp +47 instruments/timpani +48 instruments/marcato +49 instruments/slowstr +51 instruments/synstr2 amp=125 +52 instruments/choir +57 instruments/trombone amp=100 +60 instruments/frenchrn amp=115 +68 instruments/oboe +69 instruments/englhorn +70 instruments/bassoon +71 instruments/clarinet +72 instruments/piccolo +73 instruments/flute amp=100 +92 instruments/bowglass amp=200 +116 instruments/taiko amp=200 + +drumset 0 + +25 instruments/snarerol keep=env amp=225 note=60 +26 instruments/snap note=65 +27 instruments/highq amp=50 note=65 +28 instruments/slap +29 instruments/scratch1 amp=30 +30 instruments/scratch2 amp=30 +31 instruments/sticks note=60 +32 instruments/sqrclick note=60 +33 instruments/metclick note=60 +34 instruments/metbell keep=loop keep=env note=60 +35 instruments/kick1 +36 instruments/kick2 +37 instruments/stickrim +38 instruments/snare1 +39 instruments/claps strip=tail +40 instruments/snare2 +41 instruments/tomlo2 +42 instruments/hihatcl +43 instruments/tomlo1 +44 instruments/hihatpd +45 instruments/tommid2 +46 instruments/hihatop +47 instruments/tommid1 +48 instruments/tomhi2 +49 instruments/cymcrsh1 +50 instruments/tomhi1 +51 instruments/cymride1 note=60 +52 instruments/cymchina +53 instruments/cymbell +54 instruments/tamborin note=60 +55 instruments/cymsplsh +56 instruments/cowbell +57 instruments/cymcrsh2 +58 instruments/vibslap +59 instruments/cymride2 note=60 +60 instruments/bongohi +61 instruments/bongolo +62 instruments/congahi1 +63 instruments/congahi2 note=62 +64 instruments/congalo note=62 +65 instruments/timbaleh note=60 +66 instruments/timbalel note=60 +67 instruments/agogohi note=60 +68 instruments/agogolo note=60 +69 instruments/cabasa +70 instruments/maracas note=60 +71 instruments/whistle1 note=60 keep=loop keep=env +72 instruments/whistle2 note=60 keep=loop keep=env +73 instruments/guiro1 +74 instruments/guiro2 note=60 keep=env +75 instruments/clave +76 instruments/woodblk1 note=60 +77 instruments/woodblk2 note=60 +78 instruments/cuica1 +79 instruments/cuica2 +80 instruments/triangl1 note=60 amp=40 +81 instruments/triangl2 note=60 amp=40 +82 instruments/shaker +83 instruments/jingles note=92 +84 instruments/belltree keep=loop keep=env +85 instruments/castinet +86 instruments/surdo1 +87 instruments/surdo2 diff --git a/android/app/src/main/java/org/fheroes2/MainActivity.java b/android/app/src/main/java/org/fheroes2/MainActivity.java index c553edc45b5..8d0686b013b 100644 --- a/android/app/src/main/java/org/fheroes2/MainActivity.java +++ b/android/app/src/main/java/org/fheroes2/MainActivity.java @@ -20,10 +20,32 @@ package org.fheroes2; +import android.os.Bundle; +import android.util.Log; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import org.apache.commons.io.IOUtils; import org.libsdl.app.SDLActivity; public class MainActivity extends SDLActivity { + @Override + protected void onCreate( Bundle savedInstanceState ) + { + // Extract H2D and translations to the external app-specific storage (sdcard) + extractAssets( "files", getExternalFilesDir( null ) ); + + // Extract TiMidity GUS patches and config file to the internal app-specific storage + extractAssets( "instruments", getFilesDir() ); + extractAssets( "timidity.cfg", getFilesDir() ); + + super.onCreate( savedInstanceState ); + } + @Override protected void onDestroy() { @@ -37,4 +59,62 @@ protected void onDestroy() // TODO: This workaround terminates the whole app when this Activity exits, allowing SDL to initialize normally on startup System.exit( 0 ); } + + private void extractAssets( String srcPath, File dstDir ) + { + ArrayList assetsPaths; + + try { + assetsPaths = getAssetsPaths( srcPath ); + } + catch ( Exception ex ) { + Log.e( "fheroes2", "Failed to get a list of assets.", ex ); + + return; + } + + for ( String path : assetsPaths ) { + try ( InputStream in = getAssets().open( path ) ) { + File outFile = new File( dstDir, path ); + + String outFileDir = outFile.getParent(); + if ( outFileDir != null ) { + ( new File( outFileDir ) ).mkdirs(); + } + + try ( OutputStream out = new FileOutputStream( outFile ) ) { + IOUtils.copy( in, out ); + } + } + catch ( Exception ex ) { + Log.e( "fheroes2", "Failed to extract the asset.", ex ); + } + } + } + + private ArrayList getAssetsPaths( String path ) throws IOException + { + ArrayList result = new ArrayList<>(); + + String[] assets = getAssets().list( path ); + + // There is no such path at all + if ( assets == null ) { + return result; + } + + // Leaf node + if ( assets.length == 0 ) { + result.add( path ); + + return result; + } + + // Regular node + for ( String asset : assets ) { + result.addAll( getAssetsPaths( path + File.separator + asset ) ); + } + + return result; + } } diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 50b23c9c608..87a66504b09 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -273,7 +273,7 @@ You can download the precompiled binaries of the latest commit (snapshot) for [**x86 SDL2**](https://github.com/ihhub/fheroes2/releases/tag/fheroes2-windows-x86-SDL2) and [**x86 SDL1**](https://github.com/ihhub/fheroes2/releases/tag/fheroes2-windows-x86-SDL1) ), -**macOS** ( +**macOS x86-64** ( [**SDL2**](https://github.com/ihhub/fheroes2/releases/tag/fheroes2-osx-sdl2_dev) and [**SDL1**](https://github.com/ihhub/fheroes2/releases/tag/fheroes2-osx-sdl1_dev) ), @@ -281,6 +281,7 @@ You can download the precompiled binaries of the latest commit (snapshot) for [**SDL2**](https://github.com/ihhub/fheroes2/releases/tag/fheroes2-linux-sdl2_dev) and [**SDL1**](https://github.com/ihhub/fheroes2/releases/tag/fheroes2-linux-sdl1_dev) ), +[**Android**](https://github.com/ihhub/fheroes2/releases/tag/fheroes2-android), [**PlayStation Vita**](https://github.com/ihhub/fheroes2/releases/tag/fheroes2-psv-sdl2_dev) and [**Nintendo Switch**](https://github.com/ihhub/fheroes2/releases/tag/fheroes2-switch-sdl2_dev). **These binaries incorporate all the latest changes, but also all the latest bugs, and are mainly intended for developers.