[AD] exxfade loop

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Here's a silly little patch to make exxfade loop through the images as many times as the user wants, i.e. it doesn't quit until he presses Escape.

Peter
Index: exxfade.c
===================================================================
RCS file: /cvsroot/alleg/allegro/examples/exxfade.c,v
retrieving revision 1.5
diff -u -r1.5 exxfade.c
--- exxfade.c	30 Oct 2004 22:36:08 -0000	1.5
+++ exxfade.c	31 Oct 2004 01:10:20 -0000
@@ -98,7 +98,8 @@
    set_color_conversion(COLORCONV_TOTAL);
 
    /* process all the files on our command line */
-   for (i=1; i<argc; i++) {
+   i=1;
+   for (;;) {
       switch (show(argv[i])) {
 
 	 case -1:
@@ -116,6 +117,9 @@
 	    allegro_exit();
 	    return 0;
       }
+
+      if (++i >= argc)
+         i=1;
    }
 
    return 0;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/