[Bf-blender-cvs] [150a1d158a7] master: Cleanup: remove some forward declared enums

Jacques Lucke noreply at git.blender.org
Fri Dec 11 11:49:43 CET 2020


Commit: 150a1d158a79582802bb17dacdd790f0f88aeedb
Author: Jacques Lucke
Date:   Fri Dec 11 11:48:58 2020 +0100
Branches: master
https://developer.blender.org/rB150a1d158a79582802bb17dacdd790f0f88aeedb

Cleanup: remove some forward declared enums

Forward declaring enums are not allowed in C++.

Differential Revision: https://developer.blender.org/D9811

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

M	source/blender/CMakeLists.txt
M	source/blender/blenkernel/BKE_multires.h
M	source/blender/blenkernel/BKE_paint.h
A	source/blender/makesdna/DNA_brush_enums.h
M	source/blender/makesdna/DNA_brush_types.h

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

diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt
index da6df831c0a..c38da14be96 100644
--- a/source/blender/CMakeLists.txt
+++ b/source/blender/CMakeLists.txt
@@ -24,6 +24,7 @@ set(SRC_DNA_INC
   ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_anim_types.h
   ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_armature_types.h
   ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_boid_types.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_brush_enums.h
   ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_brush_types.h
   ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_cachefile_types.h
   ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_camera_types.h
diff --git a/source/blender/blenkernel/BKE_multires.h b/source/blender/blenkernel/BKE_multires.h
index 5a668532033..fce25abba7f 100644
--- a/source/blender/blenkernel/BKE_multires.h
+++ b/source/blender/blenkernel/BKE_multires.h
@@ -23,14 +23,13 @@
  * \ingroup bke
  */
 
+#include "BKE_subsurf.h"
 #include "BLI_compiler_compat.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-enum MultiresModifiedFlags;
-
 struct Depsgraph;
 struct DerivedMesh;
 struct MDisps;
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index 479bc56b2dc..0a50dde1874 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -25,6 +25,7 @@
 
 #include "BLI_bitmap.h"
 #include "BLI_utildefines.h"
+#include "DNA_brush_enums.h"
 #include "DNA_object_enums.h"
 
 #ifdef __cplusplus
@@ -70,8 +71,6 @@ struct BlendWriter;
 struct BlendDataReader;
 struct BlendLibReader;
 
-enum eOverlayFlags;
-
 extern const char PAINT_CURSOR_SCULPT[3];
 extern const char PAINT_CURSOR_VERTEX_PAINT[3];
 extern const char PAINT_CURSOR_WEIGHT_PAINT[3];
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_enums.h
similarity index 66%
copy from source/blender/makesdna/DNA_brush_types.h
copy to source/blender/makesdna/DNA_brush_enums.h
index 7bd3c7d0117..96e870cff8e 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_enums.h
@@ -12,9 +12,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2005 Blender Foundation.
- * All rights reserved.
  */
 
 /** \file
@@ -23,127 +20,10 @@
 
 #pragma once
 
-#include "DNA_ID.h"
-#include "DNA_curve_types.h"
-#include "DNA_texture_types.h" /* for MTex */
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-struct CurveMapping;
-struct Image;
-struct MTex;
-struct Material;
-
-typedef struct BrushClone {
-  /** Image for clone tool. */
-  struct Image *image;
-  /** Offset of clone image from canvas. */
-  float offset[2];
-  /** Transparency for drawing of clone image. */
-  float alpha;
-  char _pad[4];
-} BrushClone;
-
-typedef struct BrushGpencilSettings {
-  /** Amount of smoothing to apply to newly created strokes. */
-  float draw_smoothfac;
-  char _pad2[4];
-  /** Amount of alpha strength to apply to newly created strokes. */
-  float draw_strength;
-  /** Amount of jitter to apply to newly created strokes. */
-  float draw_jitter;
-  /** Angle when the brush has full thickness. */
-  float draw_angle;
-  /** Factor to apply when angle change (only 90 degrees). */
-  float draw_angle_factor;
-  /** Factor of randomness for pressure. */
-  float draw_random_press;
-  /** Factor of strength for strength. */
-  float draw_random_strength;
-  /** Number of times to apply smooth factor to new strokes. */
-  short draw_smoothlvl;
-  /** Number of times to subdivide new strokes. */
-  short draw_subdivide;
-  /** Layers used for fill. */
-  short fill_layer_mode;
-  short fill_direction;
-
-  /** Factor for transparency. */
-  float fill_threshold;
-  /** Number of pixel to consider the leak is too small (x 2). */
-  short fill_leak;
-  /** Fill zoom factor */
-  short fill_factor;
-  int flag2;
-
-  /** Number of simplify steps. */
-  int fill_simplylvl;
-  /** Type of control lines drawing mode. */
-  int fill_draw_mode;
-  /** Icon identifier. */
-  int icon_id;
-
-  /** Maximum distance before generate new point for very fast mouse movements. */
-  int input_samples;
-  /** Random factor for UV rotation. */
-  float uv_random;
-  /** Moved to 'Brush.gpencil_tool'. */
-  int brush_type DNA_DEPRECATED;
-  /** Soft, hard or stroke. */
-  int eraser_mode;
-  /** Smooth while drawing factor. */
-  float active_smooth;
-  /** Factor to apply to strength for soft eraser. */
-  float era_strength_f;
-  /** Factor to apply to thickness for soft eraser. */
-  float era_thickness_f;
-  /** Internal grease pencil drawing flags. */
-  int flag;
-
-  /** gradient control along y for color */
-  float hardeness;
-  /** factor xy of shape for dots gradients */
-  float aspect_ratio[2];
-  /** Simplify adaptive factor */
-  float simplify_f;
-
-  /** Mix colorfactor */
-  float vertex_factor;
-  int vertex_mode;
-
-  /** eGP_Sculpt_Flag. */
-  int sculpt_flag;
-  /** eGP_Sculpt_Mode_Flag. */
-  int sculpt_mode_flag;
-  /** Preset type (used to reset brushes - internal). */
-  short preset_type;
-  /** Brush preselected mode (Active/Material/Vertexcolor). */
-  short brush_draw_mode;
-
-  /** Randomness for Hue. */
-  float random_hue;
-  /** Randomness for Saturation. */
-  float random_saturation;
-  /** Randomness for Value. */
-  float random_value;
-
-  struct CurveMapping *curve_sensitivity;
-  struct CurveMapping *curve_strength;
-  struct CurveMapping *curve_jitter;
-  struct CurveMapping *curve_rand_pressure;
-  struct CurveMapping *curve_rand_strength;
-  struct CurveMapping *curve_rand_uv;
-  struct CurveMapping *curve_rand_hue;
-  struct CurveMapping *curve_rand_saturation;
-  struct CurveMapping *curve_rand_value;
-
-  /* optional link of material to replace default in context */
-  /** Material. */
-  struct Material *material;
-} BrushGpencilSettings;
-
 /* BrushGpencilSettings->preset_type.
  * Use a range for each group and not continuous values.*/
 typedef enum eGPBrush_Presets {
@@ -459,272 +339,6 @@ typedef enum ePaintBrush_flag {
   BRUSH_PAINT_DENSITY_PRESSURE_INVERT = (1 << 9),
 } ePaintBrush_flag;
 
-typedef struct Brush {
-  ID id;
-
-  struct BrushClone clone;
-  /** Falloff curve. */
-  struct CurveMapping *curve;
-  struct MTex mtex;
-  struct MTex mask_mtex;
-
-  struct Brush *toggle_brush;
-
-  struct ImBuf *icon_imbuf;
-  PreviewImage *preview;
-  /** Color gradient. */
-  struct ColorBand *gradient;
-  struct PaintCurve *paint_curve;
-
-  /** 1024 = FILE_MAX. */
-  char icon_filepath[1024];
-
-  float normal_weight;
-  /** Rake actual data (not texture), used for sculpt. */
-  float rake_factor;
-
-  /** Blend mode. */
-  short blend;
-  /** #eObjectMode: to see if the brush is compatible, use for display only. */
-  short ob_mode;
-  /** Brush weight. */
-  float weight;
-  /** Brush diameter. */
-  int size;
-  /** General purpose flags. */
-  int flag;
-  int flag2;
-  int sampling_flag;
-
-  /** Pressure influence for mask. */
-  int mask_pressure;
-  /** Jitter the position of the brush. */
-  float jitter;
-  /** Absolute jitter in pixels. */
-  int jitter_absolute;
-  int overlay_flags;
-  /** Spacing of paint operations. */
-  int spacing;
-  /** Turning radius (in pixels) for smooth stroke. */
-  int smooth_stroke_radius;
-  /** Higher values limit fast changes in the stroke direction. */
-  float smooth_stroke_factor;
-  /** Paint operations / second (airbrush). */
-  float rate;
-
-  /** Color. */
-  float rgb[3];
-  /** Opacity. */
-  float alpha;
-  /** Hardness */
-  float hardness;
-  /** Flow */
-  float flow;
-  /** Wet Mix */
-  float wet_mix;
-  float wet_persistence;
-  /** Density */
-  float density;
-  int paint_flags;
-
-  /** Tip Shape */
-  /* Factor that controls the shape of the brush tip by rounding the corners of a square. */
-  /* 0.0 value produces a square, 1.0 produces a circle. */
-  float tip_roundness;
-  float tip_scale_x;
-
-  /** Background color. */
-  float secondary_rgb[3];
-
-  /** Rate */
-  float dash_ratio;
-  int dash_samples;
-
-  /** The direction of movement for sculpt vertices. */
-  int sculpt_plane;
-
-  /** Offset for plane brushes (clay, flatten, fill, scrape). */
-  float plane_offset;
-
-  int gradient_spacing;
-  /** Source for stroke color gradient application. */
-  char gradient_stroke_mode;
-  /** Source for fill tool color gradient application. */
-  char gradient_fill_mode;
-
-  char _pad0[5];
-
-  /** Projection shape (sphere, circle). */
-  char falloff_shape;
-  float falloff_angle;
-
-  /** Active sculpt tool. */
-  char sculpt_tool;
-  /** Active sculpt tool. */
-  char uv_sculpt_tool;
-  /** Active vertex paint. */
-  char vertexpaint_tool;
-  /** Active weight paint. */
-  char weightpaint_tool;
-  /** Active image paint tool. */
-  char imagepaint_tool;
-  /** Enum eBrushMaskTool, only used if sculpt_tool is SCULPT_TOOL_MASK. */
-  char mask_tool;
-  /** Active grease pencil tool. */
-  char gpencil_tool;
-  /** Active grease pencil vertex tool. */
-  char gpencil_vertex_tool;
-  /** Active grease pencil sculpt tool. */
-  char gpencil_sculpt_tool;
-  /** Active grease pencil weight tool. */
-  char gpencil_weight_tool;
-  char _pad1[6];
-
-  float autosmooth_factor;
-
-  float tilt_strength_factor;
-
-  float topology_rake_factor;
-
-  float crease_pinch_factor;
-
-  float normal_radius_factor;
-  float area_radius_factor;
-  float wet_paint_radius_factor;
-
-  float plane_trim;
-  /** Affectable height of brush (layer height for layer tool, i.e.). */
-  float height;
-
-  float texture_sample_bias;
-
-  int curve_preset;
-
-  /* Maximun distance to search fake neighbors from a vertex. */
-  float disconnected_distance_max;
-
-  int deform_target;
-
-  /* automasking */
-  int automasking_flags;
-  int automasking_boundary_edges_propagation_steps;
-
-  int elastic_deform_type;
-  float elastic_deform_volume_preservation;
-
-  /* snake hook */
-  int snake_hook_deform_type;
-
-  /* pose */
-  int pose_deform_type;
-  float pose_offset;
-  int pose_smooth_iterations;
-  int pose_ik_segments;
-  in

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list