[Bf-blender-cvs] [691e8b1] HMD_viewport: More minor cleanup

Julian Eisel noreply at git.blender.org
Sun Apr 10 19:18:37 CEST 2016


Commit: 691e8b135c70164124ca92ef2983b0ae11b48d93
Author: Julian Eisel
Date:   Sun Apr 10 15:26:04 2016 +0200
Branches: HMD_viewport
https://developer.blender.org/rB691e8b135c70164124ca92ef2983b0ae11b48d93

More minor cleanup

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

M	intern/ghost/GHOST_Types.h
M	intern/ghost/intern/GHOST_EventOpenHMD.h
M	intern/ghost/intern/GHOST_OpenHMDManager.cpp
M	intern/ghost/intern/GHOST_SystemCocoa.mm
M	intern/ghost/intern/GHOST_SystemSDL.cpp
M	intern/ghost/intern/GHOST_SystemWin32.cpp
M	intern/ghost/intern/GHOST_SystemX11.cpp

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

diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h
index 052a5a5..381b339 100644
--- a/intern/ghost/GHOST_Types.h
+++ b/intern/ghost/GHOST_Types.h
@@ -518,7 +518,7 @@ typedef struct {
 } GHOST_TEventKeyData;
 
 typedef struct {
-    float orientation[4]; //orientation quaternion of the HMD
+	float orientation[4]; // Orientation quaternion of the HMD
 } GHOST_TEventOpenHMDData;
 
 typedef struct {
diff --git a/intern/ghost/intern/GHOST_EventOpenHMD.h b/intern/ghost/intern/GHOST_EventOpenHMD.h
index dab24ca..11af607 100644
--- a/intern/ghost/intern/GHOST_EventOpenHMD.h
+++ b/intern/ghost/intern/GHOST_EventOpenHMD.h
@@ -6,15 +6,14 @@
 class GHOST_EventOpenHMD : public GHOST_Event
 {
 public:
-    GHOST_EventOpenHMD (GHOST_TUns64 time, GHOST_IWindow *window)
+	GHOST_EventOpenHMD(GHOST_TUns64 time, GHOST_IWindow *window)
 		: GHOST_Event(time, GHOST_kEventHMD, window)
 	{
 		m_data = &m_orientationData;
 	}
 
 protected:
-    GHOST_TEventOpenHMDData m_orientationData;
-
+	GHOST_TEventOpenHMDData m_orientationData;
 };
 
 #endif // __GHOST_EVENTOPENHMD_H_
diff --git a/intern/ghost/intern/GHOST_OpenHMDManager.cpp b/intern/ghost/intern/GHOST_OpenHMDManager.cpp
index 13faef3..a48030c 100644
--- a/intern/ghost/intern/GHOST_OpenHMDManager.cpp
+++ b/intern/ghost/intern/GHOST_OpenHMDManager.cpp
@@ -45,18 +45,15 @@ GHOST_OpenHMDManager::~GHOST_OpenHMDManager()
 
 bool GHOST_OpenHMDManager::processEvents()
 {
-	if (!m_device)
-		return false;
-
-	GHOST_IWindow *window = m_system.getWindowManager()->getActiveWindow();
+	GHOST_IWindow *window;
 
-	if (!window)
+	if (!m_device || !(window = m_system.getWindowManager()->getActiveWindow()))
 		return false;
 
 
 	GHOST_TUns64 now = m_system.getMilliSeconds();
 	GHOST_EventOpenHMD *event = new GHOST_EventOpenHMD(now, window);
-	GHOST_TEventOpenHMDData* data = (GHOST_TEventOpenHMDData*) event->getData();
+	GHOST_TEventOpenHMDData* data = (GHOST_TEventOpenHMDData*)event->getData();
 
 	ohmd_ctx_update(m_context);
 	if (!getRotationQuat(data->orientation))
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index 4b188e2..2d266f4 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -731,8 +731,9 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent)
 			[pool drain];
 
 			/* Call base class to update os independent events */
-			if(GHOST_System::processEvents(anyProcessed))
+			if (GHOST_System::processEvents(anyProcessed)) {
 				anyProcessed = true;
+			}
 		} while (event != nil);
 #if 0
 	} while (waitForEvent && !anyProcessed); // Needed only for timer implementation
diff --git a/intern/ghost/intern/GHOST_SystemSDL.cpp b/intern/ghost/intern/GHOST_SystemSDL.cpp
index 13a7063..a9be35f 100644
--- a/intern/ghost/intern/GHOST_SystemSDL.cpp
+++ b/intern/ghost/intern/GHOST_SystemSDL.cpp
@@ -598,8 +598,9 @@ GHOST_SystemSDL::processEvents(bool waitForEvent)
 		}
 
 		/* Call base class to update os independent events */
-		if(GHOST_System::processEvents(anyProcessed))
+		if (GHOST_System::processEvents(anyProcessed)) {
 			anyProcessed = true;
+		}
 	} while (waitForEvent && !anyProcessed);
 
 	return anyProcessed;
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 077fd42..8ab680e 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -300,9 +300,9 @@ bool GHOST_SystemWin32::processEvents(bool waitForEvent)
 		}
 
 		/* Call base class to update os independent events */
-		if(GHOST_System::processEvents(anyProcessed))
+		if (GHOST_System::processEvents(anyProcessed)) {
 			anyProcessed = true;
-		
+		}
 	} while (waitForEvent && !anyProcessed);
 
 	return anyProcessed;
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index 9715b76..16df164 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -598,8 +598,9 @@ processEvents(
 		}
 #endif
 		/* Call base class to update os independent events */
-		if(GHOST_System::processEvents(anyProcessed))
+		if (GHOST_System::processEvents(anyProcessed)) {
 			anyProcessed = true;
+		}
 	} while (waitForEvent && !anyProcessed);
 
 	return anyProcessed;




More information about the Bf-blender-cvs mailing list