Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/blenkernel/BKE_shader_fx.h
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff)
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/blenkernel/BKE_shader_fx.h')
-rw-r--r--source/blender/blenkernel/BKE_shader_fx.h213
1 files changed, 114 insertions, 99 deletions
diff --git a/source/blender/blenkernel/BKE_shader_fx.h b/source/blender/blenkernel/BKE_shader_fx.h
index 020c682392e..0d5f1999193 100644
--- a/source/blender/blenkernel/BKE_shader_fx.h
+++ b/source/blender/blenkernel/BKE_shader_fx.h
@@ -20,7 +20,7 @@
* \ingroup bke
*/
-#include "DNA_shader_fx_types.h" /* needed for all enum typdefs */
+#include "DNA_shader_fx_types.h" /* needed for all enum typdefs */
#include "BLI_compiler_attrs.h"
#include "BKE_customdata.h"
@@ -41,123 +41,136 @@ struct bGPDframe;
struct bGPDlayer;
struct bGPDstroke;
-#define SHADER_FX_ACTIVE(_fx, _is_render) (((_fx->mode & eShaderFxMode_Realtime) && (_is_render == false)) || \
- ((_fx->mode & eShaderFxMode_Render) && (_is_render == true)))
+#define SHADER_FX_ACTIVE(_fx, _is_render) \
+ (((_fx->mode & eShaderFxMode_Realtime) && (_is_render == false)) || \
+ ((_fx->mode & eShaderFxMode_Render) && (_is_render == true)))
#define SHADER_FX_EDIT(_fx, _is_edit) (((_fx->mode & eShaderFxMode_Editmode) == 0) && (_is_edit))
typedef enum {
- /* Should not be used, only for None type */
- eShaderFxType_NoneType,
+ /* Should not be used, only for None type */
+ eShaderFxType_NoneType,
- /* grease pencil effects */
- eShaderFxType_GpencilType,
-} ShaderFxTypeType;
+ /* grease pencil effects */
+ eShaderFxType_GpencilType,
+} ShaderFxTypeType;
typedef enum {
- eShaderFxTypeFlag_SupportsEditmode = (1 << 0),
+ eShaderFxTypeFlag_SupportsEditmode = (1 << 0),
- /* For effects that support editmode this determines if the
- * effect should be enabled by default in editmode.
- */
- eShaderFxTypeFlag_EnableInEditmode = (1 << 2),
+ /* For effects that support editmode this determines if the
+ * effect should be enabled by default in editmode.
+ */
+ eShaderFxTypeFlag_EnableInEditmode = (1 << 2),
- /* max one per type */
- eShaderFxTypeFlag_Single = (1 << 4),
+ /* max one per type */
+ eShaderFxTypeFlag_Single = (1 << 4),
- /* can't be added manually by user */
- eShaderFxTypeFlag_NoUserAdd = (1 << 5),
+ /* can't be added manually by user */
+ eShaderFxTypeFlag_NoUserAdd = (1 << 5),
} ShaderFxTypeFlag;
/* IMPORTANT! Keep ObjectWalkFunc and IDWalkFunc signatures compatible. */
-typedef void(*ShaderFxObjectWalkFunc)(void *userData, struct Object *ob, struct Object **obpoin, int cb_flag);
-typedef void(*ShaderFxIDWalkFunc)(void *userData, struct Object *ob, struct ID **idpoin, int cb_flag);
-typedef void(*ShaderFxTexWalkFunc)(void *userData, struct Object *ob, struct ShaderFxData *fx, const char *propname);
+typedef void (*ShaderFxObjectWalkFunc)(void *userData,
+ struct Object *ob,
+ struct Object **obpoin,
+ int cb_flag);
+typedef void (*ShaderFxIDWalkFunc)(void *userData,
+ struct Object *ob,
+ struct ID **idpoin,
+ int cb_flag);
+typedef void (*ShaderFxTexWalkFunc)(void *userData,
+ struct Object *ob,
+ struct ShaderFxData *fx,
+ const char *propname);
typedef struct ShaderFxTypeInfo {
- /* The user visible name for this effect */
- char name[32];
-
- /* The DNA struct name for the effect data type, used to
- * write the DNA data out.
- */
- char struct_name[32];
-
- /* The size of the effect data type, used by allocation. */
- int struct_size;
-
- ShaderFxTypeType type;
- ShaderFxTypeFlag flags;
-
- /* Copy instance data for this effect type. Should copy all user
- * level settings to the target effect.
- */
- void(*copyData)(const struct ShaderFxData *fx, struct ShaderFxData *target);
-
- /* Initialize new instance data for this effect type, this function
- * should set effect variables to their default values.
- *
- * This function is optional.
- */
- void (*initData)(struct ShaderFxData *fx);
-
- /* Free internal effect data variables, this function should
- * not free the fx variable itself.
- *
- * This function is optional.
- */
- void (*freeData)(struct ShaderFxData *fx);
-
- /* Return a boolean value indicating if this effect is able to be
- * calculated based on the effect data. This is *not* regarding the
- * fx->flag, that is tested by the system, this is just if the data
- * validates (for example, a lattice will return false if the lattice
- * object is not defined).
- *
- * This function is optional (assumes never disabled if not present).
- */
- bool (*isDisabled)(struct ShaderFxData *fx, int userRenderParams);
-
- /* Add the appropriate relations to the dependency graph.
- *
- * This function is optional.
- */
- void (*updateDepsgraph)(struct ShaderFxData *fx,
- const struct ModifierUpdateDepsgraphContext *ctx);
-
- /* Should return true if the effect needs to be recalculated on time
- * changes.
- *
- * This function is optional (assumes false if not present).
- */
- bool (*dependsOnTime)(struct ShaderFxData *fx);
-
-
- /* Should call the given walk function on with a pointer to each Object
- * pointer that the effect data stores. This is used for linking on file
- * load and for unlinking objects or forwarding object references.
- *
- * This function is optional.
- */
- void (*foreachObjectLink)(struct ShaderFxData *fx, struct Object *ob,
- ShaderFxObjectWalkFunc walk, void *userData);
-
- /* Should call the given walk function with a pointer to each ID
- * pointer (i.e. each datablock pointer) that the effect data
- * stores. This is used for linking on file load and for
- * unlinking datablocks or forwarding datablock references.
- *
- * This function is optional. If it is not present, foreachObjectLink
- * will be used.
- */
- void (*foreachIDLink)(struct ShaderFxData *fx, struct Object *ob,
- ShaderFxIDWalkFunc walk, void *userData);
+ /* The user visible name for this effect */
+ char name[32];
+
+ /* The DNA struct name for the effect data type, used to
+ * write the DNA data out.
+ */
+ char struct_name[32];
+
+ /* The size of the effect data type, used by allocation. */
+ int struct_size;
+
+ ShaderFxTypeType type;
+ ShaderFxTypeFlag flags;
+
+ /* Copy instance data for this effect type. Should copy all user
+ * level settings to the target effect.
+ */
+ void (*copyData)(const struct ShaderFxData *fx, struct ShaderFxData *target);
+
+ /* Initialize new instance data for this effect type, this function
+ * should set effect variables to their default values.
+ *
+ * This function is optional.
+ */
+ void (*initData)(struct ShaderFxData *fx);
+
+ /* Free internal effect data variables, this function should
+ * not free the fx variable itself.
+ *
+ * This function is optional.
+ */
+ void (*freeData)(struct ShaderFxData *fx);
+
+ /* Return a boolean value indicating if this effect is able to be
+ * calculated based on the effect data. This is *not* regarding the
+ * fx->flag, that is tested by the system, this is just if the data
+ * validates (for example, a lattice will return false if the lattice
+ * object is not defined).
+ *
+ * This function is optional (assumes never disabled if not present).
+ */
+ bool (*isDisabled)(struct ShaderFxData *fx, int userRenderParams);
+
+ /* Add the appropriate relations to the dependency graph.
+ *
+ * This function is optional.
+ */
+ void (*updateDepsgraph)(struct ShaderFxData *fx,
+ const struct ModifierUpdateDepsgraphContext *ctx);
+
+ /* Should return true if the effect needs to be recalculated on time
+ * changes.
+ *
+ * This function is optional (assumes false if not present).
+ */
+ bool (*dependsOnTime)(struct ShaderFxData *fx);
+
+ /* Should call the given walk function on with a pointer to each Object
+ * pointer that the effect data stores. This is used for linking on file
+ * load and for unlinking objects or forwarding object references.
+ *
+ * This function is optional.
+ */
+ void (*foreachObjectLink)(struct ShaderFxData *fx,
+ struct Object *ob,
+ ShaderFxObjectWalkFunc walk,
+ void *userData);
+
+ /* Should call the given walk function with a pointer to each ID
+ * pointer (i.e. each datablock pointer) that the effect data
+ * stores. This is used for linking on file load and for
+ * unlinking datablocks or forwarding datablock references.
+ *
+ * This function is optional. If it is not present, foreachObjectLink
+ * will be used.
+ */
+ void (*foreachIDLink)(struct ShaderFxData *fx,
+ struct Object *ob,
+ ShaderFxIDWalkFunc walk,
+ void *userData);
} ShaderFxTypeInfo;
/* Initialize global data (type info and some common global storages). */
void BKE_shaderfx_init(void);
const ShaderFxTypeInfo *BKE_shaderfxType_getInfo(ShaderFxType type);
-struct ShaderFxData *BKE_shaderfx_new(int type);
+struct ShaderFxData *BKE_shaderfx_new(int type);
void BKE_shaderfx_free_ex(struct ShaderFxData *fx, const int flag);
void BKE_shaderfx_free(struct ShaderFxData *fx);
bool BKE_shaderfx_unique_name(struct ListBase *shaderfx, struct ShaderFxData *fx);
@@ -166,7 +179,9 @@ struct ShaderFxData *BKE_shaderfx_findByType(struct Object *ob, ShaderFxType typ
struct ShaderFxData *BKE_shaderfx_findByName(struct Object *ob, const char *name);
void BKE_shaderfx_copyData_generic(const struct ShaderFxData *fx_src, struct ShaderFxData *fx_dst);
void BKE_shaderfx_copyData(struct ShaderFxData *fx, struct ShaderFxData *target);
-void BKE_shaderfx_copyData_ex(struct ShaderFxData *fx, struct ShaderFxData *target, const int flag);
+void BKE_shaderfx_copyData_ex(struct ShaderFxData *fx,
+ struct ShaderFxData *target,
+ const int flag);
void BKE_shaderfx_foreachIDLink(struct Object *ob, ShaderFxIDWalkFunc walk, void *userData);
bool BKE_shaderfx_has_gpencil(struct Object *ob);