mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-05-01 09:17:46 +00:00
Cleaning UI icons code
This commit is contained in:
parent
77cded5da2
commit
df24fb019f
3 changed files with 399 additions and 400 deletions
|
@ -13,6 +13,7 @@ set -e
|
|||
wai=$(dirname $(readlink -f "$0")) # Current script directory
|
||||
dst="${wai}/../src/binres/binary_data.hpp"
|
||||
ui_icons_width=24
|
||||
ui_tmp=$(mktemp -d)
|
||||
|
||||
# Binary to C headers
|
||||
# $1 is the resource file and $2 the variable name to use in the C code
|
||||
|
@ -27,16 +28,17 @@ 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}"
|
||||
inkscape --export-type png --export-filename "${ui_tmp}/ui-${name}.png" -w "${ui_icons_width}" "${svg}"
|
||||
done
|
||||
|
||||
# Generate headers
|
||||
echo -n > "$dst"
|
||||
for res in $ressources $(find ${wai}/assets/icons/ -name "*.png")
|
||||
for res in $ressources $(find ${wai}/assets/icons/ -name "*.png") $(find ${ui_tmp} -name "*.png")
|
||||
do
|
||||
ext="${res##*.}"
|
||||
name="$(basename $res .${ext})"
|
||||
echo "Generating resources for ${name}.${ext}..."
|
||||
bin2c "$res" "${name}_${ext}" >> "$dst"
|
||||
done
|
||||
rm -rf ${ui_tmp}
|
||||
echo "Done! The generated resources are accessible here: \"$dst\""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue