animation playback window now pauses properly.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 17 Nov 2012 04:47:33 +0000 (04:47 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 17 Nov 2012 04:47:33 +0000 (04:47 +0000)
source/blender/windowmanager/intern/wm_playanim.c

index 008768d..dbdc77f 100644 (file)
@@ -433,6 +433,11 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void)
                ps->stopped = FALSE;
        }
 
+       if (ps->wait2) {
+               pupdate_time();
+               ptottime = 0;
+       }
+
        switch (type) {
                case GHOST_kEventKeyDown:
                case GHOST_kEventKeyUp:
@@ -940,6 +945,7 @@ void WM_main_playanim(int argc, const char **argv)
                if (ptottime > 0.0) ptottime = 0.0;
 
                while (ps.picture) {
+                       int hasevent;
 #ifndef USE_IMB_CACHE
                        if (ibuf != NULL && ibuf->ftype == 0) IMB_freeImBuf(ibuf);
 #endif
@@ -993,21 +999,12 @@ void WM_main_playanim(int argc, const char **argv)
                        ps.next = ps.direction;
 
 
-                       {
-                               int hasevent = GHOST_ProcessEvents(g_WS.ghost_system, 0);
+                       while ((hasevent = GHOST_ProcessEvents(g_WS.ghost_system, 0) || ps.wait2 != 0)) {
                                if (hasevent) {
                                        GHOST_DispatchEvents(g_WS.ghost_system);
                                }
                        }
 
-                       /* XXX25 - we should not have to do this, but it makes scrubbing functional! */
-                       if (g_WS.qual & WS_QUAL_LMOUSE) {
-                               ps.next = 0;
-                       }
-                       else {
-                               ps.sstep = 0;
-                       }
-
                        ps.wait2 = ps.sstep;
 
                        if (ps.wait2 == 0 && ps.stopped == 0) {