Revert "YOLO"

This reverts commit 430f569db3ac2ae0a625c917d95459d634575f6d.

Change-Id: I99c4245625629940d83fe535fbdb79fe1b9b4887
diff --git a/bootanimation/generate-bootanimation.sh b/bootanimation/generate-bootanimation.sh
index 04c777a..cab7be8 100755
--- a/bootanimation/generate-bootanimation.sh
+++ b/bootanimation/generate-bootanimation.sh
@@ -11,14 +11,26 @@
     IMAGEWIDTH="$WIDTH"
 fi
 
-RESOLUTION=""$WIDTH"x"$HEIGHT""
+IMAGESCALEWIDTH="$IMAGEWIDTH"
+IMAGESCALEHEIGHT=$(expr $IMAGESCALEWIDTH / 3)
 
-mkdir -p $ANDROID_PRODUCT_OUT/obj/BOOTANIMATION/bootanimation/part0
+if [ "$HALF_RES" = "true" ]; then
+    IMAGEWIDTH=$(expr $IMAGEWIDTH / 2)
+fi
+
+IMAGEHEIGHT=$(expr $IMAGEWIDTH / 3)
+
+RESOLUTION=""$IMAGEWIDTH"x"$IMAGEHEIGHT""
+
+for part_cnt in 0 1 2 3 4
+do
+    mkdir -p $ANDROID_PRODUCT_OUT/obj/BOOTANIMATION/bootanimation/part$part_cnt
+done
 tar xfp "vendor/cm/bootanimation/bootanimation.tar" -C "$OUT/bootanimation/"
-mogrify -resize $RESOLUTION -colors 250 -background white -gravity center -extent $RESOLUTION "$OUT/bootanimation/"*"/"*".png"
+mogrify -resize $RESOLUTION -colors 250 "$OUT/bootanimation/"*"/"*".png"
 
 # Create desc.txt
-echo "$WIDTH $HEIGHT" 60 > "$OUT/bootanimation/desc.txt"
+echo "$IMAGESCALEWIDTH $IMAGESCALEHEIGHT" 60 > "$OUT/bootanimation/desc.txt"
 cat "vendor/cm/bootanimation/desc.txt" >> "$OUT/bootanimation/desc.txt"
 
 # Create bootanimation.zip