gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog utilities/processor.cpp


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog utilities/processor.cpp
Date: Sat, 30 Dec 2006 21:57:56 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  06/12/30 21:57:56

Modified files:
        .              : ChangeLog 
        utilities      : processor.cpp 

Log message:
                * utilities/processor.cpp: add -r switch to control
                  allowed number of runs (restarts).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2014&r2=1.2015
http://cvs.savannah.gnu.org/viewcvs/gnash/utilities/processor.cpp?cvsroot=gnash&r1=1.43&r2=1.44

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2014
retrieving revision 1.2015
diff -u -b -r1.2014 -r1.2015
--- ChangeLog   30 Dec 2006 10:11:29 -0000      1.2014
+++ ChangeLog   30 Dec 2006 21:57:56 -0000      1.2015
@@ -1,5 +1,14 @@
 2006-12-30 Sandro Santilli <address@hidden>
 
+       * utilities/processor.cpp: add -r switch to control
+         allowed number of runs (restarts).
+       * testsuite/misc-ming.all/: Makefile.am,
+         place_and_remove_object_test.c: 
+         turned last testcase into a self-contained
+         one.
+
+2006-12-30 Sandro Santilli <address@hidden>
+
        * testsuite/misc-ming.all/: Makefile.am,
          place_and_remove_object_test.c:
          Added new test from Zou (missing a testrunner).

Index: utilities/processor.cpp
===================================================================
RCS file: /sources/gnash/gnash/utilities/processor.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- utilities/processor.cpp     18 Dec 2006 09:28:01 -0000      1.43
+++ utilities/processor.cpp     30 Dec 2006 21:57:56 -0000      1.44
@@ -17,7 +17,7 @@
 //
 //
 
-/* $Id: processor.cpp,v 1.43 2006/12/18 09:28:01 strk Exp $ */
+/* $Id: processor.cpp,v 1.44 2006/12/30 21:57:56 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -98,6 +98,9 @@
 static bool s_do_output = false;
 static bool s_stop_on_errors = true;
 
+// How many time do we allow to hit the end ?
+static size_t allowed_end_hits = 1;
+
 int
 main(int argc, char *argv[])
 {
@@ -138,7 +141,7 @@
         dbglogfile.setVerbosity();
     }
 
-    while ((c = getopt (argc, argv, "hwvap")) != -1) {
+    while ((c = getopt (argc, argv, "hwvapr:")) != -1) {
        switch (c) {
          case 'h':
              usage (argv[0]);
@@ -165,6 +168,9 @@
               dbglogfile << "Verbose parsing disabled at compile time" << endl;
 #endif
              break;
+         case 'r':
+              allowed_end_hits = strtol(optarg, NULL, 0);
+             break;
        }
     }
     
@@ -276,6 +282,7 @@
     int stop_count=0;
     size_t loop_back_count=0;
     size_t latest_frame=0;
+    size_t end_hitcount=0;
     // Run through the movie.
     for (;;) {
        // @@ do we also have to run through all sprite frames
@@ -295,9 +302,13 @@
        size_t curr_frame = m.get_current_frame();
        
        // We reached the end, done !
-       if (curr_frame >= md->get_frame_count() - 1) {
+       if (curr_frame >= md->get_frame_count() - 1 )
+       {
+               if ( allowed_end_hits && ++end_hitcount >= allowed_end_hits )
+               {
            break;
        }
+       }
 
        // We didn't advance 
        if (curr_frame == last_frame)
@@ -308,6 +319,11 @@
                        stop_count=0;
 
                        // Kick the movie.
+                       if ( last_frame + 1 > md->get_frame_count() -1 )
+                       {
+                               printf("exiting after %d times in STOP mode at 
last frame\n", maxstops);
+                               break;
+                       }
                        printf("kicking movie after %d frames in STOP mode, 
kick ct = %d\n", maxstops, kick_count);
                        m.goto_frame(last_frame + 1);
                        m.set_play_state(gnash::sprite_instance::PLAY);
@@ -397,8 +413,12 @@
        "  -vp         Be verbose about movie parsing\n"
 #endif
 #if VERBOSE_ACTION
-       "  -va         Be verbose about ActionScript\n", name
+       "  -va         Be verbose about ActionScript\n"
 #endif
+       "  -r <times>  Allow the given number of runs.\n"
+       "              Keep looping undefinitely if set to 0.\n"
+       "              Default is 1 (end as soon as the last frame is 
reached).\n"
+       , name
        );
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]