Improve ui icons

This commit is contained in:
Loic Guegan 2023-06-03 15:44:46 +02:00
parent 9bc06b941a
commit 8b37da88aa
19 changed files with 536 additions and 2742 deletions

View file

@ -5,12 +5,6 @@
ressources=$(cat <<-EndOfResources
assets/boards/chesscom_8bits.png
assets/pieces/cburnett.png
assets/icons/hide.png
assets/icons/mat.png
assets/icons/ochess.png
assets/icons/swap.png
assets/icons/zoomin.png
assets/icons/zoomout.png
EndOfResources
)
###############################
@ -18,6 +12,7 @@ EndOfResources
set -e
wai=$(dirname $(readlink -f "$0")) # Current script directory
dst="${wai}/../src/binres/binary_data.hpp"
ui_icons_width=24
# Binary to C headers
# $1 is the resource file and $2 the variable name to use in the C code
@ -25,9 +20,19 @@ bin2c () {
xxd -n "$2" -i "$1"
}
# Generate ui icons png from svg
rm -f "${wai}"/assets/icons/ui/*.png # Clear previous data
for svg in $(find ${wai}/assets/icons/ui -name "*.svg")
do
ext="${svg##*.}"
name="$(basename $svg .${ext})"
echo "Generating png for ${name}.${ext}..."
inkscape --export-type png --export-filename "${wai}/assets/icons/ui/ui-${name}.png" -w "${ui_icons_width}" "${svg}"
done
# Generate headers
echo -n > "$dst"
for res in $ressources
for res in $ressources $(find ${wai}/assets/icons/ -name "*.png")
do
ext="${res##*.}"
name="$(basename $res .${ext})"