cm: New boot animation from Cameron Behzadpour
* Promo video here: http://www.youtube.com/watch?v=ogp9f4_yEoU
* It looks *way* better on a device, though :)
* The animation is square, so the names have changed.
Change-Id: I8eebdf29a7d30632d75210a6d3975d7ea17d5246
diff --git a/config/common.mk b/config/common.mk
index 289ee4b..fc32ec7 100644
--- a/config/common.mk
+++ b/config/common.mk
@@ -1,8 +1,49 @@
PRODUCT_BRAND ?= cyanogenmod
+# To deal with CM9 specifications
+# TODO: remove once all devices have been switched
ifneq ($(TARGET_BOOTANIMATION_NAME),)
- PRODUCT_COPY_FILES += \
- vendor/cm/prebuilt/common/bootanimation/$(TARGET_BOOTANIMATION_NAME).zip:system/media/bootanimation.zip
+TARGET_SCREEN_DIMENSIONS := $(subst -, $(space), $(subst x, $(space), $(TARGET_BOOTANIMATION_NAME)))
+ifeq ($(TARGET_SCREEN_WIDTH),)
+TARGET_SCREEN_WIDTH := $(word 2, $(TARGET_SCREEN_DIMENSIONS))
+endif
+ifeq ($(TARGET_SCREEN_HEIGHT),)
+TARGET_SCREEN_HEIGHT := $(word 3, $(TARGET_SCREEN_DIMENSIONS))
+endif
+endif
+
+ifneq ($(TARGET_SCREEN_WIDTH) $(TARGET_SCREEN_HEIGHT),$(space))
+
+# clear TARGET_BOOTANIMATION_NAME in case it was set for CM9 purposes
+TARGET_BOOTANIMATION_NAME :=
+
+# determine the smaller dimension
+TARGET_BOOTANIMATION_SIZE := $(shell \
+ if [ $(TARGET_SCREEN_WIDTH) -lt $(TARGET_SCREEN_HEIGHT) ]; then \
+ echo $(TARGET_SCREEN_WIDTH); \
+ else \
+ echo $(TARGET_SCREEN_HEIGHT); \
+ fi )
+
+# get a sorted list of the sizes
+bootanimation_sizes := $(subst .zip,, $(shell ls vendor/cm/prebuilt/common/bootanimation))
+bootanimation_sizes := $(shell echo -e $(subst $(space),'\n',$(bootanimation_sizes)) | sort -rn)
+
+# find the appropriate size and set
+define check_and_set_bootanimation
+$(eval TARGET_BOOTANIMATION_NAME := $(shell \
+ if [ -z "$(TARGET_BOOTANIMATION_NAME)" ]; then
+ if [ $(1) -le $(TARGET_BOOTANIMATION_SIZE) ]; then \
+ echo $(1); \
+ exit 0; \
+ fi;
+ fi;
+ echo $(TARGET_BOOTANIMATION_NAME); ))
+endef
+$(foreach size,$(bootanimation_sizes), $(call check_and_set_bootanimation,$(size)))
+
+PRODUCT_COPY_FILES += \
+ vendor/cm/prebuilt/common/bootanimation/$(TARGET_BOOTANIMATION_NAME).zip:system/media/bootanimation.zip
endif
ifdef CM_NIGHTLY
diff --git a/config/common_full_phone.mk b/config/common_full_phone.mk
index 5ee0f7d..f764ce0 100644
--- a/config/common_full_phone.mk
+++ b/config/common_full_phone.mk
@@ -27,7 +27,7 @@
system/bluetooth/data/main.conf:system/etc/bluetooth/main.conf
-ifeq ($(TARGET_BOOTANIMATION_NAME),)
+ifeq ($(TARGET_SCREEN_WIDTH) $(TARGET_SCREEN_HEIGHT),$(space))
PRODUCT_COPY_FILES += \
- vendor/cm/prebuilt/common/bootanimation/vertical-480x800.zip:system/media/bootanimation.zip
+ vendor/cm/prebuilt/common/bootanimation/480.zip:system/media/bootanimation.zip
endif
diff --git a/config/common_full_tablet_wifionly.mk b/config/common_full_tablet_wifionly.mk
index 963dfd7..fd0ef2e 100644
--- a/config/common_full_tablet_wifionly.mk
+++ b/config/common_full_tablet_wifionly.mk
@@ -23,7 +23,7 @@
PRODUCT_COPY_FILES += \
system/bluetooth/data/main.nonsmartphone.conf:system/etc/bluetooth/main.conf
-ifeq ($(TARGET_BOOTANIMATION_NAME),)
+ifeq ($(TARGET_SCREEN_WIDTH) $(TARGET_SCREEN_HEIGHT),$(space))
PRODUCT_COPY_FILES += \
- vendor/cm/prebuilt/common/bootanimation/horizontal-1280x800.zip:system/media/bootanimation.zip
+ vendor/cm/prebuilt/common/bootanimation/800.zip:system/media/bootanimation.zip
endif
diff --git a/config/common_mini_phone.mk b/config/common_mini_phone.mk
index 43bbe61..6c939da 100644
--- a/config/common_mini_phone.mk
+++ b/config/common_mini_phone.mk
@@ -16,7 +16,7 @@
PRODUCT_PACKAGES += \
Mms
-ifeq ($(TARGET_BOOTANIMATION_NAME),)
+ifeq ($(TARGET_SCREEN_WIDTH) $(TARGET_SCREEN_HEIGHT),$(space))
PRODUCT_COPY_FILES += \
- vendor/cm/prebuilt/common/bootanimation/vertical-320x480.zip:system/media/bootanimation.zip
+ vendor/cm/prebuilt/common/bootanimation/320.zip:system/media/bootanimation.zip
endif