cm: Rework boot animation generation

Keep the largest bootanimation extracted
and resize it at build-time.

Change-Id: Iee32f18440ff955d13ed85b273e97cbd540721fc
This commit is contained in:
Griffin Millender
2016-10-07 18:16:06 -05:00
committed by Luca Stefani
parent 1b19f16eb7
commit 67ddf37281
39 changed files with 87 additions and 87 deletions

View File

@@ -0,0 +1,32 @@
#!/bin/bash
WIDTH="$1"
HEIGHT="$2"
HALF_RES="$3"
OUT="$ANDROID_PRODUCT_OUT/obj/BOOTANIMATION"
if [ "$HEIGHT" -lt "$WIDTH" ]; then
SIZE="$HEIGHT"
else
SIZE="$WIDTH"
fi
if [ "$HALF_RES" = "true" ]; then
IMAGESIZE=$(expr $SIZE / 2)
else
IMAGESIZE="$SIZE"
fi
RESOLUTION=""$IMAGESIZE"x"$IMAGESIZE""
mkdir -p $ANDROID_PRODUCT_OUT/obj/BOOTANIMATION/bootanimation/part{0..2}
tar xfp "vendor/cm/bootanimation/bootanimation.tar" --to-command="convert - -resize '$RESOLUTION' \"png8:$OUT/bootanimation/\$TAR_FILENAME\""
# Create desc.txt
echo "$SIZE" "$SIZE" 30 > "$OUT/bootanimation/desc.txt"
cat "vendor/cm/bootanimation/desc.txt" >> "$OUT/bootanimation/desc.txt"
# Create bootanimation.zip
cd "$OUT/bootanimation"
zip -qr0 "$OUT/bootanimation.zip" .