From owner-svn-soc-all@FreeBSD.ORG Fri Jul 25 00:21:43 2014 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6C9BE9D for ; Fri, 25 Jul 2014 00:21:43 +0000 (UTC) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88FD02A42 for ; Fri, 25 Jul 2014 00:21:43 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6P0LhCK064543 for ; Fri, 25 Jul 2014 00:21:43 GMT (envelope-from seiya@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.8/8.14.8/Submit) id s6P0Lhak064312 for svn-soc-all@FreeBSD.org; Fri, 25 Jul 2014 00:21:43 GMT (envelope-from seiya@FreeBSD.org) Date: Fri, 25 Jul 2014 00:21:43 GMT Message-Id: <201407250021.s6P0Lhak064312@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to seiya@FreeBSD.org using -f From: seiya@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r271352 - soc2014/seiya/bootsplash/sys/dev/fb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jul 2014 00:21:43 -0000 Author: seiya Date: Fri Jul 25 00:21:42 2014 New Revision: 271352 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=271352 Log: support --repeat-animation Modified: soc2014/seiya/bootsplash/sys/dev/fb/bsplash.c Modified: soc2014/seiya/bootsplash/sys/dev/fb/bsplash.c ============================================================================== --- soc2014/seiya/bootsplash/sys/dev/fb/bsplash.c Fri Jul 25 00:07:11 2014 (r271351) +++ soc2014/seiya/bootsplash/sys/dev/fb/bsplash.c Fri Jul 25 00:21:42 2014 (r271352) @@ -52,12 +52,13 @@ static video_adapter_t *adp = NULL; static BMP_INFO bmp_info; -static int background_enabled = 1; // 1:enabled, 0:disabled +static int background_enabled = 1; // 1:enabled, 0:disabled static int background_y_origin; -static int animation_enabled = 1; // 1:enabled, 0:disabled +static int animation_enabled = 1; // 1:enabled, 0:disabled +static int repeat_animation; // 1:repeat, 0:don't repeat static int animation_y_origin, animation_y, animation_x; static int animation_width, animation_height; -static int progress_bar_enabled = 1; // 1:enabled, 0:disabled +static int progress_bar_enabled = 1; // 1:enabled, 0:disabled static int progress_bar_y_origin, progress_bar_y, progress_bar_x; static int progress_bar_width, progress_bar_height; @@ -92,6 +93,19 @@ } freeenv(s); + // load "bsplash_repeat_animation" + if ((s = getenv("bsplash_repeat_animation")) == NULL) { + if (bootverbose) + printf("bsplash: cannot load \"bsplash_repeat_animation\"\n"); + animation_enabled = 0; + } else { + if(strcmp(s, "YES") == 0) + repeat_animation = 1; + else + repeat_animation = 0; + } + freeenv(s); + // load "bsplash_animation_y_origin" if ((s = getenv("bsplash_animation_y_origin")) == NULL) { if (bootverbose) @@ -263,16 +277,26 @@ static int iy; char *s; int progress = 0; + int stop_animation = 0; iy = animation_y_origin; for (;;){ // update animation - if (draw_bmp(iy, animation_y, animation_x, animation_width, animation_height) == 0){ - iy += animation_height; - }else{ - iy = animation_y_origin; - if (draw_bmp(iy, animation_y, animation_x, animation_width, animation_height) == 0) + if(!stop_animation){ + if (draw_bmp(iy, animation_y, animation_x, animation_width, + animation_height) == 0){ iy += animation_height; + } else { + if (!repeat_animation){ + stop_animation = 1; + } else { + iy = animation_y_origin; + // try again + if (draw_bmp(iy, animation_y, animation_x, animation_width, + animation_height) == 0) + iy += animation_height; + } + } } // get the progress of boot