gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash/plugin/win32 plugin.cpp


From: Vitaly Alexeev
Subject: [Gnash-commit] gnash/plugin/win32 plugin.cpp
Date: Fri, 15 Sep 2006 14:01:37 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Vitaly Alexeev <alexeev>        06/09/15 14:01:37

Modified files:
        plugin/win32   : plugin.cpp 

Log message:
        fixed delay bug

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/plugin/win32/plugin.cpp?cvsroot=gnash&r1=1.2&r2=1.3

Patches:
Index: plugin.cpp
===================================================================
RCS file: /sources/gnash/gnash/plugin/win32/plugin.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- plugin.cpp  9 Aug 2006 14:32:52 -0000       1.2
+++ plugin.cpp  15 Sep 2006 14:01:37 -0000      1.3
@@ -304,6 +304,8 @@
        float   scale = 1.0f;
        bool    background = true;
 
+       int delay = int(1000.0f / movie_fps);
+
        for (;;)
        {
                // We cannot do get_current_root() because it can belong to 
other thread
@@ -316,9 +318,8 @@
        
                uint64  ticks;
                ticks = tu_timer::get_ticks();
-               int     delta_ticks = ticks - last_ticks;
+               int     delta_ticks = tu_timer::get_ticks() - last_ticks;
                float   delta_t = delta_ticks / 1000.f;
-               last_ticks = ticks;
 
                // to place on the center
                int window_width = getWidth();
@@ -343,7 +344,12 @@
                glDisable(GL_DEPTH_TEST);       // Disable depth testing.
                glDrawBuffer(GL_BACK);
 
+//             dbglogfile << delta_ticks << " x " << delay << endl;
+               if (delta_ticks >= delay)
+               {
+                       last_ticks = ticks;
                m->advance(delta_t);
+               }
 
                // white background
                glClearColor(1.0f, 1.0f, 1.0f, 0.0f);




reply via email to

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