diff options
Diffstat (limited to 'tools/embedded.sh')
| -rwxr-xr-x | tools/embedded.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/embedded.sh b/tools/embedded.sh index 2f2ca8d..a9f7f0f 100755 --- a/tools/embedded.sh +++ b/tools/embedded.sh @@ -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\"" |
