| 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | ########################################################################### |
| 4 | # fheroes2: https://github.com/ihhub/fheroes2 # |
| 5 | # Copyright (C) 2023 # |
| 6 | # # |
| 7 | # This program is free software; you can redistribute it and/or modify # |
| 8 | # it under the terms of the GNU General Public License as published by # |
| 9 | # the Free Software Foundation; either version 2 of the License, or # |
| 10 | # (at your option) any later version. # |
| 11 | # # |
| 12 | # This program is distributed in the hope that it will be useful, # |
| 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # |
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # |
| 15 | # GNU General Public License for more details. # |
| 16 | # # |
| 17 | # You should have received a copy of the GNU General Public License # |
| 18 | # along with this program; if not, write to the # |
| 19 | # Free Software Foundation, Inc., # |
| 20 | # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # |
| 21 | ########################################################################### |
| 22 | |
| 23 | set -e -o pipefail |
| 24 | |
| 25 | PATH="$(dirname "$0"):$PATH" |
| 26 | |
| 27 | extractor agg *.AGG *.agg |
| 28 | pal2img agg/*/kb.pal palette.png |
| 29 | |
| 30 | for DIR in agg/*; do |
| 31 | if [[ ! -d "$DIR" ]]; then |
| 32 | continue |
| 33 | fi |
| 34 | |
| 35 | 82m2wav "wav/$(basename "$DIR")" "$DIR"/*.82m |
| 36 | bin2txt "txt/$(basename "$DIR")" "$DIR"/*.bin |
| 37 | icn2img "icn/$(basename "$DIR")" agg/*/kb.pal "$DIR"/*.icn |
| 38 | til2img "til/$(basename "$DIR")" agg/*/kb.pal "$DIR"/*.til |
| 39 | xmi2midi "midi/$(basename "$DIR")" "$DIR"/*.xmi |
| 40 | done |
| 41 | |
| 42 | echo -e "\nAsset extraction completed successfully." |