[Bf-blender-cvs] [122e479] HMD_viewport: Fixes for WITH_OPENHMD and WITH_INPUT_HMD options

Julian Eisel noreply at git.blender.org
Tue Aug 2 00:40:21 CEST 2016


Commit: 122e479fe7c237d5f4ebc0bd4ce0b8e1c3ada3d6
Author: Julian Eisel
Date:   Tue Aug 2 00:39:07 2016 +0200
Branches: HMD_viewport
https://developer.blender.org/rB122e479fe7c237d5f4ebc0bd4ce0b8e1c3ada3d6

Fixes for WITH_OPENHMD and WITH_INPUT_HMD options

And cleanup.

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

M	intern/ghost/GHOST_C-api.h
M	intern/ghost/intern/GHOST_C-api.cpp
M	intern/ghost/intern/GHOST_OpenHMDManager.h
M	source/blender/makesrna/intern/rna_camera.c
M	source/blenderplayer/bad_level_call_stubs/stubs.c

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

diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index 8ef591d..852e744 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -937,10 +937,10 @@ extern int         GHOST_HMDgetOpenDeviceIndex(void);
 extern const char *GHOST_HMDgetDeviceName(int index);
 extern const char *GHOST_HMDgetVendorName(int index);
 extern float       GHOST_HMDgetDeviceIPD(void);
-extern void        GHOST_HMDgetLeftModelviewMatrix(float leftMatrix[4][4]);
-extern void        GHOST_HMDgetRightModelviewMatrix(float rightMatrix[4][4]);
-extern void        GHOST_HMDgetLeftProjectionMatrix(float leftMatrix[4][4]);
-extern void        GHOST_HMDgetRightProjectionMatrix(float rightMatrix[4][4]);
+extern void        GHOST_HMDgetLeftModelviewMatrix(float r_mat[4][4]);
+extern void        GHOST_HMDgetRightModelviewMatrix(float r_mat[4][4]);
+extern void        GHOST_HMDgetLeftProjectionMatrix(float r_mat[4][4]);
+extern void        GHOST_HMDgetRightProjectionMatrix(float r_mat[4][4]);
 
 #ifdef __cplusplus
 }
diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp
index c0e992a..bb7981e 100644
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@ -1012,43 +1012,48 @@ float GHOST_HMDgetDeviceIPD()
 #endif
 }
 
-void GHOST_HMDgetLeftModelviewMatrix(float leftMatrix[4][4])
+void GHOST_HMDgetLeftModelviewMatrix(float r_mat[4][4])
 {
 #ifdef WITH_OPENHMD
 	GHOST_ISystem *system = GHOST_ISystem::getSystem();
 	GHOST_OpenHMDManager *ohmd = system->getOpenHMDManager();
-	ohmd->getLeftEyeGLModelviewMatrix(leftMatrix);
+	ohmd->getLeftEyeGLModelviewMatrix(r_mat);
 #else
+	(void)r_mat;
 #endif
 }
 
-void GHOST_HMDgetRightModelviewMatrix(float rightMatrix[4][4])
+void GHOST_HMDgetRightModelviewMatrix(float r_mat[4][4])
 {
 #ifdef WITH_OPENHMD
 	GHOST_ISystem *system = GHOST_ISystem::getSystem();
 	GHOST_OpenHMDManager *ohmd = system->getOpenHMDManager();
-	ohmd->getRightEyeGLModelviewMatrix(rightMatrix);
+	ohmd->getRightEyeGLModelviewMatrix(r_mat);
 #else
+	(void)r_mat;
 #endif
 }
 
-void GHOST_HMDgetLeftProjectionMatrix(float leftMatrix[4][4])
+void GHOST_HMDgetLeftProjectionMatrix(float r_mat[4][4])
 {
 #ifdef WITH_OPENHMD
 	GHOST_ISystem *system = GHOST_ISystem::getSystem();
 	GHOST_OpenHMDManager *ohmd = system->getOpenHMDManager();
-	ohmd->getLeftEyeGLProjectionMatrix(leftMatrix);
+	ohmd->getLeftEyeGLProjectionMatrix(r_mat);
 #else
+	(void)r_mat;
 #endif
 }
 
-void GHOST_HMDgetRightProjectionMatrix(float rightMatrix[4][4])
+void GHOST_HMDgetRightProjectionMatrix(float r_mat[4][4])
 {
 #ifdef WITH_OPENHMD
 	GHOST_ISystem *system = GHOST_ISystem::getSystem();
 	GHOST_OpenHMDManager *ohmd = system->getOpenHMDManager();
-	ohmd->getRightEyeGLProjectionMatrix(rightMatrix);
+	ohmd->getRightEyeGLProjectionMatrix(r_mat);
 #else
+	(void)r_mat;
 #endif
 }
-#endif
+
+#endif /* WITH_INPUT_HMD */
diff --git a/intern/ghost/intern/GHOST_OpenHMDManager.h b/intern/ghost/intern/GHOST_OpenHMDManager.h
index d0d78cc..dcb6d8e 100644
--- a/intern/ghost/intern/GHOST_OpenHMDManager.h
+++ b/intern/ghost/intern/GHOST_OpenHMDManager.h
@@ -265,7 +265,7 @@ public:
 	 *  \return The context
 	 *  Context is only valid if available() is true.
 	 */
-	 ohmd_context *getOpenHMDContext();
+	struct ohmd_context *getOpenHMDContext();
 
 	/**
 	 *  Get the internal OpenHMD device for the currently selected device of this manager.
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c
index 3c71da1..9b68fcb 100644
--- a/source/blender/makesrna/intern/rna_camera.c
+++ b/source/blender/makesrna/intern/rna_camera.c
@@ -52,6 +52,8 @@ static int rna_camera_stereo_use_device_ipd_editeable(PointerRNA *ptr)
 		cam->stereo.flag |= CAM_S3D_CUSTOM_IPD;
 		return false;
 	}
+#else
+	UNUSED_VARS(ptr);
 #endif
 	return PROP_EDITABLE;
 }
diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c
index 8906b94..28d00a6 100644
--- a/source/blenderplayer/bad_level_call_stubs/stubs.c
+++ b/source/blenderplayer/bad_level_call_stubs/stubs.c
@@ -322,6 +322,7 @@ void WM_cursor_warp(struct wmWindow *win, int x, int y) RET_NONE
 
 void WM_ndof_deadzone_set(float deadzone) RET_NONE
 
+#ifdef WITH_INPUT_HMD
 int WM_device_HMD_num_devices_get(void) RET_ZERO
 int WM_device_HMD_current_get(void) RET_ZERO
 void WM_device_HMD_state_set(const int device, const bool enable) RET_NONE
@@ -330,6 +331,7 @@ const char *WM_device_HMD_name_get(int index) RET_NULL
 const char *WM_device_HMD_vendor_get(int index) RET_NULL
 void WM_device_HMD_left_projection_matrix_get(float leftMatrix[4][4]) RET_NONE
 void WM_device_HMD_right_projection_matrix_get(float rightMatrix[4][4]) RET_NONE
+#endif /* WITH_INPUT_HMD */
 
 void                WM_uilisttype_init(void) RET_NONE
 struct uiListType  *WM_uilisttype_find(const char *idname, bool quiet) RET_NULL




More information about the Bf-blender-cvs mailing list