looper/assets/update-assets.sh

44 lines
No EOL
1.5 KiB
Bash
Executable file

#!/bin/bash
pushd "$(dirname "$0")"
if [ -z "$CXX" ]; then
export CXX=g++
fi
declare -a ASSETS
add_basic() {
ASSETS+=($2.h)
./btcc -nocompress $1 $2 > $2.h
}
add_base85() {
ASSETS+=($2.h)
./btcc -base85 $1 $2 > $2.h
}
$CXX ../imgui/misc/fonts/binary_to_compressed_c.cpp -o btcc
add_base85 forkawesome-webfont.ttf forkawesome
for i in Noto_Sans/*.ttf; do
FONT="$(echo -n "$i" | sed 's/^.*\///g' | sed 's/.ttf$//' | tr '[:upper:]' '[:lower:]' | sed 's/-/_/g')"
add_base85 "$i" "$FONT"
done
for i in Noto_Sans_JP/*.ttf; do
FONT="$(echo -n "$i" | sed 's/^.*\///g' | sed 's/.ttf$//' | tr '[:upper:]' '[:lower:]' | sed 's/-/_/g')"
add_base85 "$i" "$FONT"
done
add_base85 'icon.png' 'icon'
add_basic 'Noto_Sans/OFL.txt' 'notosans_license'
add_basic 'Noto_Sans_JP/OFL.txt' 'notosansjp_license'
add_basic '../LICENSE' 'nekoplayer_license'
add_basic '../subprojects/jsoncpp/LICENSE' 'jsoncpp_license'
add_basic '../subprojects/SDL-Mixer-X/COPYING.txt' 'sdl_mixer_x_license'
add_basic '../imgui-filebrowser/LICENSE' 'imgui_filebrowser_license'
add_basic '../imgui/LICENSE.txt' 'imgui_license'
add_basic 'licenses/SoundTouch.txt' 'soundtouch_license'
add_basic 'licenses/libportal.txt' 'libportal_license'
add_basic 'licenses/ForkAwesome.txt' 'forkawesome_license'
add_basic 'licenses/libintl.txt' 'libintl_license'
add_basic 'licenses/cli11.txt' 'cli11_license'
add_basic '../IconFontCppHeaders/licence.txt' 'icnfntcpphdrs_license'
echo '#pragma once' > 'assets.h'
for i in "${ASSETS[@]}"; do
echo "#include \"$i\"" >> 'assets.h'
done
rm btcc
popd