[Bf-blender-cvs] [bf7727c9762] soc-2019-npr: Cleanup: Make format.
YimingWu
noreply at git.blender.org
Thu Jul 18 08:34:48 CEST 2019
Commit: bf7727c976221ff2715d717e2d79d9862a122937
Author: YimingWu
Date: Thu Jul 18 14:34:32 2019 +0800
Branches: soc-2019-npr
https://developer.blender.org/rBbf7727c976221ff2715d717e2d79d9862a122937
Cleanup: Make format.
===================================================================
M source/blender/blenkernel/intern/gpencil.c
M source/blender/draw/engines/lanpr/lanpr_engine.c
M source/blender/editors/include/ED_lanpr.h
M source/blender/editors/lanpr/lanpr_ops.c
M source/blender/editors/render/render_update.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c
M source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c
===================================================================
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index 46a0f51594d..740385d0cbb 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -1584,11 +1584,8 @@ static int stroke_march_next_point(bGPDstroke *gps,
}
}
-static int stroke_march_next_poin_no_interp(bGPDstroke *gps,
- int next_point_index,
- float *current,
- float dist,
- float* result)
+static int stroke_march_next_poin_no_interp(
+ bGPDstroke *gps, int next_point_index, float *current, float dist, float *result)
{
float remaining_till_next = 0.0f;
float remaining_march = dist;
@@ -1646,11 +1643,8 @@ static int stroke_march_count(bGPDstroke *gps, float dist)
copy_v3_v3(point, &pt->x);
point_count++;
- while ((next_point_index = stroke_march_next_poin_no_interp(gps,
- next_point_index,
- point,
- dist,
- point)) > -1) {
+ while ((next_point_index = stroke_march_next_poin_no_interp(
+ gps, next_point_index, point, dist, point)) > -1) {
point_count++;
if (next_point_index == 0) {
break; /* last point finished */
@@ -1659,7 +1653,6 @@ static int stroke_march_count(bGPDstroke *gps, float dist)
return point_count;
}
-
/**
* Resample a stroke
* \param gps: Stroke to sample
@@ -1699,7 +1692,7 @@ bool BKE_gpencil_sample_stroke(bGPDstroke *gps, float dist)
float pressure, strength, ratio_result;
int index_from, index_to;
float last_coord[3];
-
+
/* 1st point is always at the start */
pt1 = &gps->points[0];
copy_v3_v3(last_coord, &pt1->x);
diff --git a/source/blender/draw/engines/lanpr/lanpr_engine.c b/source/blender/draw/engines/lanpr/lanpr_engine.c
index d3d559518ed..cd028d1fe4a 100644
--- a/source/blender/draw/engines/lanpr/lanpr_engine.c
+++ b/source/blender/draw/engines/lanpr/lanpr_engine.c
@@ -417,23 +417,23 @@ static void lanpr_cache_init(void *vedata)
pd->atlas_nr = MEM_callocN(fsize, "atlas_normal_l");
pd->atlas_edge_mask = MEM_callocN(fsize, "atlas_edge_mask"); /* should always be float */
- LANPR_BatchItem* dpbi;
- while (dpbi = BLI_pophead(&lanpr_share.dpix_batch_list)){
+ LANPR_BatchItem *dpbi;
+ while (dpbi = BLI_pophead(&lanpr_share.dpix_batch_list)) {
GPU_batch_discard(dpbi->dpix_preview_batch);
GPU_batch_discard(dpbi->dpix_transform_batch);
}
- LANPR_RenderBuffer* rb=lanpr_share.render_buffer_shared;
- if(rb){
- if(rb->DPIXIntersectionBatch){
+ LANPR_RenderBuffer *rb = lanpr_share.render_buffer_shared;
+ if (rb) {
+ if (rb->DPIXIntersectionBatch) {
GPU_batch_discard(rb->DPIXIntersectionBatch);
- rb->DPIXIntersectionBatch=0;
+ rb->DPIXIntersectionBatch = 0;
}
- if(rb->DPIXIntersectionTransformBatch){
+ if (rb->DPIXIntersectionTransformBatch) {
GPU_batch_discard(rb->DPIXIntersectionTransformBatch);
- rb->DPIXIntersectionTransformBatch=0;
+ rb->DPIXIntersectionTransformBatch = 0;
}
}
-
+
BLI_mempool_clear(lanpr_share.mp_batch_list);
}
}
diff --git a/source/blender/editors/include/ED_lanpr.h b/source/blender/editors/include/ED_lanpr.h
index 7b570a244f4..4fb9e9cdf3c 100644
--- a/source/blender/editors/include/ED_lanpr.h
+++ b/source/blender/editors/include/ED_lanpr.h
@@ -837,6 +837,6 @@ LANPR_LineLayerComponent *ED_lanpr_new_line_component(struct SceneLANPR *lanpr);
LANPR_BoundingArea *ED_lanpr_get_point_bounding_area(LANPR_RenderBuffer *rb, real x, real y);
LANPR_BoundingArea *ED_lanpr_get_point_bounding_area_deep(LANPR_RenderBuffer *rb, real x, real y);
-void ED_lanpr_post_frame_update_external(struct Scene* s, struct Depsgraph* dg);
+void ED_lanpr_post_frame_update_external(struct Scene *s, struct Depsgraph *dg);
#endif /* __ED_LANPR_H__ */
diff --git a/source/blender/editors/lanpr/lanpr_ops.c b/source/blender/editors/lanpr/lanpr_ops.c
index 0c682652a8e..32b1bf97d3c 100644
--- a/source/blender/editors/lanpr/lanpr_ops.c
+++ b/source/blender/editors/lanpr/lanpr_ops.c
@@ -4068,7 +4068,7 @@ int ED_lanpr_compute_feature_lines_internal(Depsgraph *depsgraph, int intersecto
ED_lanpr_NO_THREAD_chain_feature_lines(rb);
- if(is_lanpr_engine){
+ if (is_lanpr_engine) {
/* Enough with it. We can provide an option after we have LANPR internal smoothing */
return;
}
@@ -4462,7 +4462,8 @@ static void lanpr_update_gp_strokes_collection(
col->lanpr.types);
DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_COPY_ON_WRITE);
}
-static void lanpr_update_gp_strokes_actual(Scene* scene, Depsgraph* dg){
+static void lanpr_update_gp_strokes_actual(Scene *scene, Depsgraph *dg)
+{
SceneLANPR *lanpr = &scene->lanpr;
int frame = scene->r.cfra;
@@ -4484,7 +4485,7 @@ static int lanpr_update_gp_strokes_exec(struct bContext *C, struct wmOperator *o
Scene *scene = CTX_data_scene(C);
Depsgraph *dg = CTX_data_depsgraph(C);
- lanpr_update_gp_strokes_actual(scene,dg);
+ lanpr_update_gp_strokes_actual(scene, dg);
WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED | ND_SPACE_PROPERTIES, NULL);
@@ -4629,52 +4630,48 @@ void OBJECT_OT_lanpr_update_gp_source(struct wmOperatorType *ot)
/* Post-frame updater */
-void ED_lanpr_post_frame_update_external(Scene* s, Depsgraph* dg){
- if(s->lanpr.master_mode != LANPR_MASTER_MODE_SOFTWARE || !s->lanpr.auto_update){
+void ED_lanpr_post_frame_update_external(Scene *s, Depsgraph *dg)
+{
+ if (s->lanpr.master_mode != LANPR_MASTER_MODE_SOFTWARE || !s->lanpr.auto_update) {
return;
}
- if(strcmp(s->r.engine, RE_engine_id_BLENDER_LANPR)){
+ if (strcmp(s->r.engine, RE_engine_id_BLENDER_LANPR)) {
/* Not LANPR engine, do GPencil updates. */
/* LANPR engine will automatically update when drawing the viewport. */
if (!lanpr_share.render_buffer_shared ||
- lanpr_share.render_buffer_shared->cached_for_frame != s->r.cfra) {
+ lanpr_share.render_buffer_shared->cached_for_frame != s->r.cfra) {
ED_lanpr_compute_feature_lines_internal(dg, 0);
- lanpr_update_gp_strokes_actual(s,dg);
+ lanpr_update_gp_strokes_actual(s, dg);
}
}
}
-
/* Inspect below */
-static void lanpr_post_frame_updater(struct Main *UNUSED(_1),
- struct ID *scene,
- void *UNUSED(_3))
+static void lanpr_post_frame_updater(struct Main *UNUSED(_1), struct ID *scene, void *UNUSED(_3))
{
- Scene* s = (Scene*)scene;
- if(s->lanpr.master_mode != LANPR_MASTER_MODE_SOFTWARE){
+ Scene *s = (Scene *)scene;
+ if (s->lanpr.master_mode != LANPR_MASTER_MODE_SOFTWARE) {
return;
}
- if(strcmp(s->r.engine, RE_engine_id_BLENDER_LANPR)){
+ if (strcmp(s->r.engine, RE_engine_id_BLENDER_LANPR)) {
/* No depsgraph reference here in the callback. Not working :? */
-
}
}
static bCallbackFuncStore lanpr_post_frame_callback = {
NULL,
- NULL, /* next, prev */
+ NULL, /* next, prev */
lanpr_post_frame_updater, /* func */
- NULL, /* arg */
- 0, /* alloc */
+ NULL, /* arg */
+ 0, /* alloc */
};
static int lanpr_post_frame_regisetered = 0;
void ED_register_lanpr_post_frame()
{
- if(!lanpr_post_frame_regisetered){
+ if (!lanpr_post_frame_regisetered) {
BLI_callback_add(&lanpr_post_frame_callback, BLI_CB_EVT_FRAME_CHANGE_POST);
}
}
-
diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c
index 114a81e87d7..cf630ab65dd 100644
--- a/source/blender/editors/render/render_update.c
+++ b/source/blender/editors/render/render_update.c
@@ -98,7 +98,7 @@ void ED_render_scene_update(const DEGEditorUpdateContext *update_ctx, int update
}
/* Temporary solution for updating LANPR GPencil targets. */
- ED_lanpr_post_frame_update_external(scene,update_ctx->depsgraph);
+ ED_lanpr_post_frame_update_external(scene, update_ctx->depsgraph);
recursive_check = true;
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c
index 6cf83068a6f..615850498a9 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c
@@ -79,10 +79,11 @@ static void deformStroke(GpencilModifierData *md,
BKE_gpencil_simplify_fixed(gps);
}
}
- else if(mmd->mode == GP_SIMPLIFY_ADAPTIVE) {
+ else if (mmd->mode == GP_SIMPLIFY_ADAPTIVE) {
/* simplify stroke using Ramer-Douglas-Peucker algorithm */
BKE_gpencil_simplify_stroke(gps, mmd->factor);
- }else if(mmd->mode == GP_SIMPLIFY_SAMPLE) {
+ }
+ else if (mmd->mode == GP_SIMPLIFY_SAMPLE) {
BKE_gpencil_sample_stroke(gps, mmd->length);
}
}
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c
index 0d5cc055e57..79f309212f9 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c
@@ -117,7 +117,6 @@ static void deformStroke(GpencilModifierData *md,
continue;
}
-
if ((mmd->flag & GP_THICK_CUSTOM_CURVE) && (mmd->curve_thickness)) {
/* normalize value to evaluate curve */
float value = (float)i / (gps->totpoints - 1);
@@ -128,7 +127,8 @@ static void deformStroke(GpencilModifierData *md,
if (mmd->flag & GP_THICK_NORMALIZE) {
pt->pressure = 1.0f * new_pressure;
- }else{
+ }
+ else {
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list