Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba5738b3 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

bootanim: Allow configurable rescaling

Some themes carry bootanims on specific resolutions that look like
crap on different screen densities. We can have scale those into
the correct size, now.

Change-Id: Ib8ed04899dd46fed33b15d08fce4f7411b925f0c
TODO: Plug a sliding scale (and auto-adjust into the theme engine?)
parent a01c94ee
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -649,11 +649,16 @@ bool BootAnimation::movie()
        char path[ANIM_ENTRY_NAME_MAX];
        char color[7] = "000000"; // default to black if unspecified

        char value[PROPERTY_VALUE_MAX];
        char pathType;

        property_get("persist.bootanimation.scale", value, "1");
        double bas = atof(value);

        if (sscanf(l, "%d %d %d", &width, &height, &fps) == 3) {
            // ALOGD("> w=%d, h=%d, fps=%d", width, height, fps);
            animation.width = width;
            animation.height = height;
            animation.width = width * bas;
            animation.height = height * bas;
            animation.fps = fps;
        }
        else if (sscanf(l, " %c %d %d %s #%6s", &pathType, &count, &pause, path, color) >= 4) {