[Bf-blender-cvs] [daf5570c429] xr-controller-support: Cleanup GHOST_Xr

Peter Kim noreply at git.blender.org
Wed May 26 10:36:10 CEST 2021


Commit: daf5570c429acd8175b31ec81f11636ed95921ad
Author: Peter Kim
Date:   Wed May 26 17:06:14 2021 +0900
Branches: xr-controller-support
https://developer.blender.org/rBdaf5570c429acd8175b31ec81f11636ed95921ad

Cleanup GHOST_Xr

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

M	intern/ghost/intern/GHOST_XrAction.cpp
M	intern/ghost/intern/GHOST_XrAction.h
M	intern/ghost/intern/GHOST_XrSession.cpp
M	intern/ghost/intern/GHOST_XrSession.h

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

diff --git a/intern/ghost/intern/GHOST_XrAction.cpp b/intern/ghost/intern/GHOST_XrAction.cpp
index 2b956c26ca7..e5a36e1cf38 100644
--- a/intern/ghost/intern/GHOST_XrAction.cpp
+++ b/intern/ghost/intern/GHOST_XrAction.cpp
@@ -342,9 +342,8 @@ void GHOST_XrAction::applyHapticFeedback(XrSession session,
   XrHapticActionInfo haptic_info{XR_TYPE_HAPTIC_ACTION_INFO};
   haptic_info.action = m_action;
 
-  for (std::vector<XrPath>::iterator it = m_subaction_paths.begin(); it != m_subaction_paths.end();
-       ++it) {
-    haptic_info.subactionPath = *it;
+  for (const XrPath &subaction_path : m_subaction_paths) {
+    haptic_info.subactionPath = subaction_path;
     CHECK_XR(xrApplyHapticFeedback(session, &haptic_info, (const XrHapticBaseHeader *)&vibration),
              (std::string("Failed to apply haptic action \"") + action_name + "\".").data());
   }
@@ -355,9 +354,8 @@ void GHOST_XrAction::stopHapticFeedback(XrSession session, const char *action_na
   XrHapticActionInfo haptic_info{XR_TYPE_HAPTIC_ACTION_INFO};
   haptic_info.action = m_action;
 
-  for (std::vector<XrPath>::iterator it = m_subaction_paths.begin(); it != m_subaction_paths.end();
-       ++it) {
-    haptic_info.subactionPath = *it;
+  for (const XrPath &subaction_path : m_subaction_paths) {
+    haptic_info.subactionPath = subaction_path;
     CHECK_XR(xrStopHapticFeedback(session, &haptic_info),
              (std::string("Failed to stop haptic action \"") + action_name + "\".").data());
   }
diff --git a/intern/ghost/intern/GHOST_XrAction.h b/intern/ghost/intern/GHOST_XrAction.h
index b915e1cd316..222b398e392 100644
--- a/intern/ghost/intern/GHOST_XrAction.h
+++ b/intern/ghost/intern/GHOST_XrAction.h
@@ -65,7 +65,7 @@ class GHOST_XrActionProfile {
 
  private:
   XrPath m_profile = XR_NULL_PATH;
-  /* Bindings identified by interaction (user (subaction) + component) path. */
+  /** Bindings identified by interaction (user (subaction) + component) path. */
   std::map<std::string, XrPath> m_bindings;
 };
 
@@ -108,9 +108,9 @@ class GHOST_XrAction {
 
   std::unique_ptr<GHOST_C_CustomDataWrapper> m_custom_data_ = nullptr; /* wmXrAction */
 
-  /* Spaces identified by user (subaction) path. */
+  /** Spaces identified by user (subaction) path. */
   std::map<std::string, GHOST_XrActionSpace> m_spaces;
-  /* Profiles identified by interaction profile path. */
+  /** Profiles identified by interaction profile path. */
   std::map<std::string, GHOST_XrActionProfile> m_profiles;
 };
 
diff --git a/intern/ghost/intern/GHOST_XrSession.cpp b/intern/ghost/intern/GHOST_XrSession.cpp
index 6ef1e3d43cd..2e3c4017cbb 100644
--- a/intern/ghost/intern/GHOST_XrSession.cpp
+++ b/intern/ghost/intern/GHOST_XrSession.cpp
@@ -36,8 +36,6 @@
 
 #include "GHOST_XrSession.h"
 
-struct OpenXRActionSet;
-
 struct OpenXRSessionData {
   XrSystemId system_id = XR_NULL_SYSTEM_ID;
   XrSession session = XR_NULL_HANDLE;
@@ -551,6 +549,7 @@ static GHOST_XrActionSet *find_action_set(OpenXRSessionData *oxr, const char *ac
   if (it == oxr->action_sets.end()) {
     return nullptr;
   }
+
   return &it->second;
 }
 
diff --git a/intern/ghost/intern/GHOST_XrSession.h b/intern/ghost/intern/GHOST_XrSession.h
index 3b156b57170..608704e8a63 100644
--- a/intern/ghost/intern/GHOST_XrSession.h
+++ b/intern/ghost/intern/GHOST_XrSession.h
@@ -85,7 +85,7 @@ class GHOST_XrSession {
                          const float &amplitude);
   void stopHapticAction(const char *action_set_name, const char *action_name);
 
-  /* Custom data (owned by Blender, not GHOST) accessors. */
+  /** Custom data (owned by Blender, not GHOST) accessors. */
   void *getActionSetCustomdata(const char *action_set_name);
   void *getActionCustomdata(const char *action_set_name, const char *action_name);
   uint32_t getActionCount(const char *action_set_name);



More information about the Bf-blender-cvs mailing list