[Bf-blender-cvs] [f2af54a] master: NDOF/X11: skip getting the time when no ndof events are processed

Campbell Barton noreply at git.blender.org
Wed Feb 12 11:08:55 CET 2014


Commit: f2af54afd0a9c3858081a5a5ef4945171a4571c4
Author: Campbell Barton
Date:   Wed Feb 12 19:33:41 2014 +1100
https://developer.blender.org/rBf2af54afd0a9c3858081a5a5ef4945171a4571c4

NDOF/X11: skip getting the time when no ndof events are processed

===================================================================

M	intern/ghost/intern/GHOST_NDOFManagerX11.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_NDOFManagerX11.cpp b/intern/ghost/intern/GHOST_NDOFManagerX11.cpp
index 468a37d..947d8d7 100644
--- a/intern/ghost/intern/GHOST_NDOFManagerX11.cpp
+++ b/intern/ghost/intern/GHOST_NDOFManagerX11.cpp
@@ -82,14 +82,13 @@ bool GHOST_NDOFManagerX11::processEvents()
 	bool anyProcessed = false;
 
 	if (m_available) {
-		GHOST_TUns64 now = m_system.getMilliSeconds();
-
 		spnav_event e;
 		while (spnav_poll_event(&e)) {
 			switch (e.type) {
 				case SPNAV_EVENT_MOTION:
 				{
 					/* convert to blender view coords */
+					GHOST_TUns64 now = m_system.getMilliSeconds();
 					short t[3] = {(short)e.motion.x, (short)e.motion.y, (short)-e.motion.z};
 					short r[3] = {(short)-e.motion.rx, (short)-e.motion.ry, (short)e.motion.rz};
 
@@ -98,6 +97,7 @@ bool GHOST_NDOFManagerX11::processEvents()
 					break;
 				}
 				case SPNAV_EVENT_BUTTON:
+					GHOST_TUns64 now = m_system.getMilliSeconds();
 					updateButton(e.button.bnum, e.button.press, now);
 					break;
 			}




More information about the Bf-blender-cvs mailing list