gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/movie_root.h gui/fb.cpp


From: Udo Giacomozzi
Subject: [Gnash-commit] gnash ChangeLog server/movie_root.h gui/fb.cpp
Date: Thu, 22 Feb 2007 14:04:42 +0000

CVSROOT:        /cvsroot/gnash
Module name:    gnash
Changes by:     Udo Giacomozzi <udog>   07/02/22 14:04:42

Modified files:
        .              : ChangeLog 
        server         : movie_root.h 
        gui            : fb.cpp 

Log message:
        made getTimer() work at least with FB GUI

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2435&r2=1.2436
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.h?cvsroot=gnash&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/fb.cpp?cvsroot=gnash&r1=1.25&r2=1.26

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/gnash/gnash/ChangeLog,v
retrieving revision 1.2435
retrieving revision 1.2436
diff -u -b -r1.2435 -r1.2436
--- ChangeLog   22 Feb 2007 13:44:25 -0000      1.2435
+++ ChangeLog   22 Feb 2007 14:04:42 -0000      1.2436
@@ -13,6 +13,9 @@
     inside for-loop.
   * extensions/fileio/fileio.cpp: Fixed fgets() to avoid segfauls; call 
fclose()
     in destructor to close file descriptor in any case.    
+  * server/movie_root.h: Provided write access for m_timer
+  * gui/fb.cpp: Update global timer to make getTimer() work at least with the
+    FB GUI        
 
 2007-02-22 Sandro Santilli <address@hidden>
 

Index: server/movie_root.h
===================================================================
RCS file: /cvsroot/gnash/gnash/server/movie_root.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- server/movie_root.h 20 Feb 2007 10:00:48 -0000      1.37
+++ server/movie_root.h 22 Feb 2007 14:04:42 -0000      1.38
@@ -14,7 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: movie_root.h,v 1.37 2007/02/20 10:00:48 strk Exp $ */
+/* $Id: movie_root.h,v 1.38 2007/02/22 14:04:42 udog Exp $ */
 
 /// \page events_handling Handling of user events
 ///
@@ -262,6 +262,12 @@
 
        float   get_timer() const { return m_timer; }
 
+       /// Sets the current movie timer in seconds.
+       ///
+       /// (Udo): I think getTimer() should be handled *completely* 
+  /// in the AS VM... 
+       void set_timer(float value) { m_timer = value; }
+
        /// Delegate to current top-level root sprite
        void    restart() { _movie->restart(); }
 

Index: gui/fb.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/gui/fb.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- gui/fb.cpp  19 Feb 2007 18:14:03 -0000      1.25
+++ gui/fb.cpp  22 Feb 2007 14:04:42 -0000      1.26
@@ -36,6 +36,7 @@
 #include "gui.h"
 #include "fbsup.h"
 #include "log.h"
+#include "movie_root.h"
 
 #include "render_handler.h"
 #include "render_handler_agg.h"
@@ -323,7 +324,16 @@
 
 bool FBGui::run()
 {
+  struct timeval tv;
+
   double timer = 0.0;
+  double start_timer;
+  
+  if (!gettimeofday(&tv, NULL))
+    start_timer = (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0;
+  else
+    start_timer = 0.0;
+    
   
   // let the GUI recompute the x/y scale factors to best fit the whole screen
   resize_view(_validbounds.width(), _validbounds.height());
@@ -338,11 +348,16 @@
                  
                  check_mouse(); // TODO: Exit delay loop on mouse events! 
                  
-      struct timeval tv;
       if (!gettimeofday(&tv, NULL))
         timer = (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0;
     }
        
+    // update global timer (getTimer())    
+    // (Udo): Just a quick hack. I suggest we solve this in a different way
+    gnash::movie_root* m = gnash::get_current_root();
+    m->set_timer(timer - start_timer);
+    
+    // advance movie   
                Gui::advance_movie(this);
        }
        return true;




reply via email to

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