[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38918] trunk/blender/source/blender/ editors/space_view3d/view3d_fly.c: add back timer based redraw, not sure why this was removed r38908.

Campbell Barton ideasman42 at gmail.com
Tue Aug 2 09:49:35 CEST 2011


Revision: 38918
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38918
Author:   campbellbarton
Date:     2011-08-02 07:49:34 +0000 (Tue, 02 Aug 2011)
Log Message:
-----------
add back timer based redraw, not sure why this was removed r38908.
Zealous redraws now use commented define. 

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38908

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_view3d/view3d_fly.c

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_fly.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_fly.c	2011-08-02 07:17:15 UTC (rev 38917)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_fly.c	2011-08-02 07:49:34 UTC (rev 38918)
@@ -30,6 +30,7 @@
 /* defines VIEW3D_OT_fly modal operator */
 
 //#define NDOF_FLY_DEBUG
+//#define NDOF_FLY_DRAW_TOOMUCH // is this needed for ndof? - commented so redraw doesnt thrash - campbell
 
 #include "DNA_anim_types.h"
 #include "DNA_scene_types.h"
@@ -289,8 +290,10 @@
 	fly->zlock_momentum=0.0f;
 	fly->grid= 1.0f;
 	fly->use_precision= 0;
+
+#ifdef NDOF_FLY_DRAW_TOOMUCH
 	fly->redraw= 1;
-
+#endif
 	fly->dvec_prev[0]= fly->dvec_prev[1]= fly->dvec_prev[2]= 0.0f;
 
 	fly->timer= WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.01f);
@@ -436,7 +439,10 @@
 
 static void flyEvent(FlyInfo *fly, wmEvent *event)
 {
-	if (event->type == MOUSEMOVE) {
+	if (event->type == TIMER && event->customdata == fly->timer) {
+		fly->redraw = 1;
+	}
+	else if (event->type == MOUSEMOVE) {
 		VECCOPY2D(fly->mval, event->mval);
 	}
 	else if (event->type == NDOF_MOTION) {
@@ -746,9 +752,9 @@
 			double time_current; /*time how fast it takes for us to redraw, this is so simple scenes dont fly too fast */
 			float time_redraw;
 			float time_redraw_clamped;
-
+#ifdef NDOF_FLY_DRAW_TOOMUCH
 			fly->redraw= 1;
-
+#endif
 			time_current= PIL_check_seconds_timer();
 			time_redraw= (float)(time_current - fly->time_lastdraw);
 			time_redraw_clamped= MIN2(0.05f, time_redraw); /* clamt the redraw time to avoid jitter in roll correction */
@@ -1125,7 +1131,7 @@
 			WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, fly_object);
 		}
 
-		// puts("redraw!"); // too frequent, fix tomorrow.
+		// puts("redraw!"); // too frequent, commented with NDOF_FLY_DRAW_TOOMUCH for now
 		ED_region_tag_redraw(CTX_wm_region(C));
 	}
 




More information about the Bf-blender-cvs mailing list