[Bf-blender-cvs] [d37679a] temp_localview_split: Move inline function defines into own source file

Julian Eisel noreply at git.blender.org
Fri Oct 7 23:25:02 CEST 2016


Commit: d37679ad7360816886d1e79e370812f78c56fbd8
Author: Julian Eisel
Date:   Fri Oct 7 23:23:16 2016 +0200
Branches: temp_localview_split
https://developer.blender.org/rBd37679ad7360816886d1e79e370812f78c56fbd8

Move inline function defines into own source file

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

M	source/blender/blenkernel/BKE_localview.h
M	source/blender/blenkernel/CMakeLists.txt
A	source/blender/blenkernel/intern/localview.c

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

diff --git a/source/blender/blenkernel/BKE_localview.h b/source/blender/blenkernel/BKE_localview.h
index 6443f5c..944be23 100644
--- a/source/blender/blenkernel/BKE_localview.h
+++ b/source/blender/blenkernel/BKE_localview.h
@@ -30,57 +30,20 @@
  */
 
 #include "BLI_compiler_attrs.h"
-#include "BLI_utildefines.h"
-
-#include "DNA_object_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_view3d_types.h"
+#include "BLI_compiler_compat.h"
 
+struct LocalViewInfo;
+struct Object;
+struct View3D;
 
 /* Forcing inline as some of these are called a lot, mostly in loops even. */
 
-BLI_INLINE bool BKE_localview_info_cmp(LocalViewInfo a, LocalViewInfo b) ATTR_WARN_UNUSED_RESULT;
-BLI_INLINE bool BKE_localview_is_valid(LocalViewInfo localview) ATTR_WARN_UNUSED_RESULT;
-
-BLI_INLINE void BKE_localview_object_assign(View3D *v3d, Object *ob) ATTR_NONNULL();
-BLI_INLINE void BKE_localview_object_unassign(View3D *v3d, Object *ob) ATTR_NONNULL();
+BLI_INLINE bool BKE_localview_info_cmp(struct LocalViewInfo a, struct LocalViewInfo b) ATTR_WARN_UNUSED_RESULT;
+BLI_INLINE bool BKE_localview_is_valid(struct LocalViewInfo localview) ATTR_WARN_UNUSED_RESULT;
 
+BLI_INLINE void BKE_localview_object_assign(struct View3D *v3d, struct Object *ob) ATTR_NONNULL();
+BLI_INLINE void BKE_localview_object_unassign(struct View3D *v3d, struct Object *ob) ATTR_NONNULL();
 
-/**
- * Local view main visibility checks.
- * \return if \a a is visible in \a b, or the other way around (order doesn't matter).
- */
-BLI_INLINE bool BKE_localview_info_cmp(LocalViewInfo a, LocalViewInfo b)
-{
-	return (a.viewbits & b.viewbits) != 0;
-}
-
-/**
- * Check if \a localview defines a visible local view.
- */
-BLI_INLINE bool BKE_localview_is_valid(LocalViewInfo localview)
-{
-	return localview.viewbits != 0;
-}
-
-/**
- * Adjust local view info of \a ob to be visible if \a v3d is in local view.
- */
-BLI_INLINE void BKE_localview_object_assign(View3D *v3d, Object *ob)
-{
-	if (v3d->localviewd) {
-		ob->localview.viewbits |= v3d->localviewd->info.viewbits;
-	}
-}
-
-/**
- * Remove \a from local view of \a v3d.
- */
-BLI_INLINE void BKE_localview_object_unassign(View3D *v3d, Object *ob)
-{
-	if (v3d->localviewd) {
-		ob->localview.viewbits &= ~v3d->localviewd->info.viewbits;
-	}
-}
+#include "intern/localview.c"
 
-#endif // __BKE_LOCALVIEW_H__
+#endif /* __BKE_LOCALVIEW_H__ */
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 6ea8e3c..eec4ba8 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -123,6 +123,7 @@ set(SRC
 	intern/library_query.c
 	intern/library_remap.c
 	intern/linestyle.c
+	intern/localview.c
 	intern/mask.c
 	intern/mask_evaluate.c
 	intern/mask_rasterize.c
diff --git a/source/blender/blenkernel/BKE_localview.h b/source/blender/blenkernel/intern/localview.c
similarity index 71%
copy from source/blender/blenkernel/BKE_localview.h
copy to source/blender/blenkernel/intern/localview.c
index 6443f5c..c3d2303 100644
--- a/source/blender/blenkernel/BKE_localview.h
+++ b/source/blender/blenkernel/intern/localview.c
@@ -18,15 +18,8 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#ifndef __BKE_LOCALVIEW_H__
-#define __BKE_LOCALVIEW_H__
-
-/** \file BKE_localview.h
+/** \file blender/blenkernel/intern/localview.c
  *  \ingroup bke
- *  \brief Local view utility functions
- *
- * Even though it's possible to access LocalView DNA structs directly,
- * please only access using these functions (or extend it if needed).
  */
 
 #include "BLI_compiler_attrs.h"
@@ -36,16 +29,6 @@
 #include "DNA_screen_types.h"
 #include "DNA_view3d_types.h"
 
-
-/* Forcing inline as some of these are called a lot, mostly in loops even. */
-
-BLI_INLINE bool BKE_localview_info_cmp(LocalViewInfo a, LocalViewInfo b) ATTR_WARN_UNUSED_RESULT;
-BLI_INLINE bool BKE_localview_is_valid(LocalViewInfo localview) ATTR_WARN_UNUSED_RESULT;
-
-BLI_INLINE void BKE_localview_object_assign(View3D *v3d, Object *ob) ATTR_NONNULL();
-BLI_INLINE void BKE_localview_object_unassign(View3D *v3d, Object *ob) ATTR_NONNULL();
-
-
 /**
  * Local view main visibility checks.
  * \return if \a a is visible in \a b, or the other way around (order doesn't matter).
@@ -82,5 +65,3 @@ BLI_INLINE void BKE_localview_object_unassign(View3D *v3d, Object *ob)
 		ob->localview.viewbits &= ~v3d->localviewd->info.viewbits;
 	}
 }
-
-#endif // __BKE_LOCALVIEW_H__




More information about the Bf-blender-cvs mailing list