[Bf-blender-cvs] [7c11e45f5fa] soc-2019-openxr: Cleanup: Address various review comments

Julian Eisel noreply at git.blender.org
Wed Mar 11 20:28:25 CET 2020


Commit: 7c11e45f5fa140a14738dbec0eca277bdd5e2145
Author: Julian Eisel
Date:   Wed Mar 11 12:34:23 2020 +0100
Branches: soc-2019-openxr
https://developer.blender.org/rB7c11e45f5fa140a14738dbec0eca277bdd5e2145

Cleanup: Address various review comments

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

M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/makesdna/DNA_windowmanager_types.h
M	source/blender/makesdna/DNA_xr_types.h
M	source/blender/makesrna/intern/rna_xr.c
M	source/blender/windowmanager/intern/wm_draw.c
M	source/blender/windowmanager/intern/wm_operators.c
M	source/blender/windowmanager/intern/wm_xr.c
M	source/blender/windowmanager/wm.h

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

diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index b885950c581..d6e9826d542 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -4800,7 +4800,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
     }
 
     /* Keep this block, even when empty. */
-    if (!DNA_struct_find(fd->filesdna, "bXrSessionSettings")) {
+    if (!DNA_struct_find(fd->filesdna, "XrSessionSettings")) {
       for (wmWindowManager *wm = bmain->wm.first; wm; wm = wm->id.next) {
         const View3D *v3d_default = DNA_struct_default_get(View3D);
 
@@ -4864,7 +4864,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
    */
   {
     /* Keep this block, even when empty. */
-    if (!DNA_struct_find(fd->filesdna, "bXrSessionSettings")) {
+    if (!DNA_struct_find(fd->filesdna, "XrSessionSettings")) {
       for (wmWindowManager *wm = bmain->wm.first; wm; wm = wm->id.next) {
         const View3D *v3d_default = DNA_struct_default_get(View3D);
 
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index 09316ebdf09..9226ff20ae6 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -125,7 +125,7 @@ typedef struct ReportTimerInfo {
 typedef struct wmXrData {
   void *context; /* GHOST_XrContextHandle */
 
-  bXrSessionSettings session_settings;
+  XrSessionSettings session_settings;
 } wmXrData;
 //#endif
 
diff --git a/source/blender/makesdna/DNA_xr_types.h b/source/blender/makesdna/DNA_xr_types.h
index 0d23668a59f..70927399a32 100644
--- a/source/blender/makesdna/DNA_xr_types.h
+++ b/source/blender/makesdna/DNA_xr_types.h
@@ -21,7 +21,7 @@
 #ifndef __DNA_XR_TYPES_H__
 #define __DNA_XR_TYPES_H__
 
-typedef struct bXrSessionSettings {
+typedef struct XrSessionSettings {
   /** Shading type (OB_SOLID, ...). */
   char shading_type;
   /** View3D draw flags (V3D_OFSDRAW_NONE, V3D_OFSDRAW_SHOW_ANNOTATION, ...). */
@@ -32,6 +32,6 @@ typedef struct bXrSessionSettings {
   float clip_start, clip_end;
 
   char _pad2[4];
-} bXrSessionSettings;
+} XrSessionSettings;
 
 #endif /* __DNA_XR_TYPES_H__ */
diff --git a/source/blender/makesrna/intern/rna_xr.c b/source/blender/makesrna/intern/rna_xr.c
index f2f73984801..7fdb77c3d0e 100644
--- a/source/blender/makesrna/intern/rna_xr.c
+++ b/source/blender/makesrna/intern/rna_xr.c
@@ -35,7 +35,6 @@ static void rna_def_xr_session_settings(BlenderRNA *brna)
   PropertyRNA *prop;
 
   srna = RNA_def_struct(brna, "XrSessionSettings", NULL);
-  RNA_def_struct_sdna(srna, "bXrSessionSettings");
   RNA_def_struct_ui_text(srna, "XR-Session Settings", "");
 
   prop = RNA_def_property(srna, "shading_type", PROP_ENUM, PROP_NONE);
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index 3dac245c9b1..1610bec59e7 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -314,7 +314,7 @@ static void wm_draw_region_buffer_free(ARegion *region)
   }
 }
 
-void wm_draw_offscreen_texture_parameters(GPUOffScreen *offscreen)
+static void wm_draw_offscreen_texture_parameters(GPUOffScreen *offscreen)
 {
   /* Setup offscreen color texture for drawing. */
   GPUTexture *texture = GPU_offscreen_color_texture(offscreen);
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 2b27b02bf04..d1b4400ff13 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -3666,7 +3666,7 @@ static void WM_OT_xr_session_toggle(wmOperatorType *ot)
   ot->name = "Toggle VR Session";
   ot->idname = "WM_OT_xr_session_toggle";
   ot->description =
-      "Attempt to open a view for use with virtual reality headsets, or close it if already "
+      "Open a view for use with virtual reality headsets, or close it if already "
       "opened";
 
   /* callbacks */
diff --git a/source/blender/windowmanager/intern/wm_xr.c b/source/blender/windowmanager/intern/wm_xr.c
index 5601da740fd..bd80e668258 100644
--- a/source/blender/windowmanager/intern/wm_xr.c
+++ b/source/blender/windowmanager/intern/wm_xr.c
@@ -31,6 +31,8 @@
 #include "BLI_math_geom.h"
 #include "BLI_math_matrix.h"
 
+#include "CLG_log.h"
+
 #include "DNA_object_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_view3d_types.h"
@@ -60,6 +62,7 @@
 #include "wm_window.h"
 
 static wmSurface *g_xr_surface = NULL;
+static CLG_LogRef LOG = {"wm.xr"};
 
 typedef struct {
   GHOST_TXrGraphicsBinding gpu_binding_type;
@@ -308,7 +311,7 @@ static bool wm_xr_session_surface_offscreen_ensure(const GHOST_XrDrawViewInfo *d
   }
 
   if (failure) {
-    fprintf(stderr, "%s: failed to get buffer, %s\n", __func__, err_out);
+    CLOG_ERROR(&LOG, "Failed to get buffer, %s\n", err_out);
     return false;
   }
 
@@ -428,7 +431,7 @@ void wm_xr_draw_view(const GHOST_XrDrawViewInfo *draw_view, void *customdata)
   bContext *C = customdata;
   wmWindowManager *wm = CTX_wm_manager(C);
   wmXrSurfaceData *surface_data = g_xr_surface->customdata;
-  bXrSessionSettings *settings = &wm->xr.session_settings;
+  XrSessionSettings *settings = &wm->xr.session_settings;
   const float display_flags = V3D_OFSDRAW_OVERRIDE_SCENE_SETTINGS | settings->draw_flags;
 
   View3DShading shading;
diff --git a/source/blender/windowmanager/wm.h b/source/blender/windowmanager/wm.h
index 0a5806a0667..c79f5376c25 100644
--- a/source/blender/windowmanager/wm.h
+++ b/source/blender/windowmanager/wm.h
@@ -99,9 +99,6 @@ void wm_stereo3d_set_cancel(bContext *C, wmOperator *op);
 void wm_open_init_load_ui(wmOperator *op, bool use_prefs);
 void wm_open_init_use_scripts(wmOperator *op, bool use_prefs);
 
-/* wm_draw.c */
-void wm_draw_offscreen_texture_parameters(struct GPUOffScreen *offscreen);
-
 #ifdef WITH_XR_OPENXR
 /* wm_xr.c */
 bool wm_xr_context_ensure(bContext *C, wmWindowManager *wm);



More information about the Bf-blender-cvs mailing list