[Bf-blender-cvs] [134be85] HMD_viewport: Fixed memory addressing, should work on every system now

TheOnlyJoey noreply at git.blender.org
Thu Mar 17 22:03:38 CET 2016


Commit: 134be85218fcb9104cb880a7fd89ebc25072b839
Author: TheOnlyJoey
Date:   Thu Mar 17 22:03:13 2016 +0100
Branches: HMD_viewport
https://developer.blender.org/rB134be85218fcb9104cb880a7fd89ebc25072b839

Fixed memory addressing, should work on every system now

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

M	source/blender/windowmanager/intern/wm_event_system.c
M	source/blender/windowmanager/intern/wm_operators.c

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

diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index ee3fd21..2912c73 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -3505,7 +3505,9 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
 			GHOST_TEventOpenHMDData *e = customdata;
 
 			event.type = EVT_HMD_TRANSFORM;
-			event.customdata = e->orientation;
+			event.customdata = MEM_mallocN(sizeof(GHOST_TEventOpenHMDData), "GHOST_TEventOpenHMDData");
+			event.customdatafree = true;
+			memcpy(event.customdata, e, sizeof(*e));
 
 			wm_event_add(win, &event);
 
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index efc908b..a71bb5f 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -5103,6 +5103,7 @@ static void WM_OT_stereo3d_set(wmOperatorType *ot)
 
 /**
  * Same as #GHOST_TEventOpenHMDData.
+ * \warning Keep in sync!
  */
 typedef struct HMDData {
 	float orientation[4];
@@ -5264,7 +5265,7 @@ static int hmd_session_refresh_invoke(bContext *C, wmOperator *UNUSED(op), const
 	wmWindowManager *wm = CTX_wm_manager(C);
 	wmWindow *hmd_win = wm->win_hmd;
 	hmd_session_refresh(C, hmd_win, CTX_data_scene(C), event->customdata);
-	return OPERATOR_FINISHED;
+	return (OPERATOR_FINISHED | OPERATOR_PASS_THROUGH);
 }
 
 /**
@@ -5282,7 +5283,7 @@ static void WM_OT_hmd_session_refresh(wmOperatorType *ot)
 	ot->invoke = hmd_session_refresh_invoke;
 
 	/* flags */
-	ot->flag = OPTYPE_INTERNAL;
+	ot->flag = (OPTYPE_INTERNAL | OPTYPE_BLOCKING);
 }
 
 /* ******************************************************* */




More information about the Bf-blender-cvs mailing list