[Bf-blender-cvs] [db12505f51b] temp-lanpr-review: Cleanup: Fix compiler warnings.
YimingWu
noreply at git.blender.org
Wed Nov 20 10:23:37 CET 2019
Commit: db12505f51bc2094ce5cb0515ba00a55ba6a2e2c
Author: YimingWu
Date: Mon Nov 18 22:08:48 2019 +0800
Branches: temp-lanpr-review
https://developer.blender.org/rBdb12505f51bc2094ce5cb0515ba00a55ba6a2e2c
Cleanup: Fix compiler warnings.
===================================================================
M source/blender/draw/engines/lanpr/lanpr_engine.c
M source/blender/editors/include/ED_lanpr.h
M source/blender/editors/lanpr/lanpr_chain.c
M source/blender/editors/lanpr/lanpr_cpu.c
M source/blender/editors/lanpr/lanpr_util.c
===================================================================
diff --git a/source/blender/draw/engines/lanpr/lanpr_engine.c b/source/blender/draw/engines/lanpr/lanpr_engine.c
index d1e006f8fa6..460612c817b 100644
--- a/source/blender/draw/engines/lanpr/lanpr_engine.c
+++ b/source/blender/draw/engines/lanpr/lanpr_engine.c
@@ -213,8 +213,6 @@ static void lanpr_cache_init(void *vedata)
LANPR_StorageList *stl = ((LANPR_Data *)vedata)->stl;
LANPR_TextureList *txl = ((LANPR_Data *)vedata)->txl;
- DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
-
static float normal_object_direction[3] = {0, 0, 1};
/* Transfer reload state */
@@ -446,7 +444,6 @@ static void lanpr_cache_init(void *vedata)
}
/* Intersection cache must be calculated before drawing. */
- int updated = 0;
if (draw_ctx->scene->lanpr.flags & LANPR_AUTO_UPDATE) {
if (draw_ctx->scene->lanpr.master_mode == LANPR_MASTER_MODE_SOFTWARE) {
if (is_render) {
@@ -681,10 +678,6 @@ static void lanpr_render_to_image(void *vedata,
const rcti *rect)
{
const DRWContextState *draw_ctx = DRW_context_state_get();
- /* int update_mark = DEG_id_type_any_updated(draw_ctx->depsgraph); */
- Scene *scene = DEG_get_evaluated_scene(draw_ctx->depsgraph);
- SceneLANPR *lanpr = &scene->lanpr;
-
lanpr_share.re_render = engine;
RE_engine_update_stats(engine, NULL, "LANPR: Initializing");
diff --git a/source/blender/editors/include/ED_lanpr.h b/source/blender/editors/include/ED_lanpr.h
index 46b457ade56..a0365dd7703 100644
--- a/source/blender/editors/include/ED_lanpr.h
+++ b/source/blender/editors/include/ED_lanpr.h
@@ -105,13 +105,7 @@ typedef struct LANPR_RenderVert {
struct LANPR_RenderLine *intersecting_line2;
struct LANPR_RenderTriangle *intersecting_with;
- /** positive 1 Negative 0
- * <| |>
- * l---->|----->r l---->|----->r
- * <| |>
- * this means dot(r-l,face_normal)<0 then 1 otherwise 0
- */
- char positive;
+ /** This will used in future acceleration for intersection processing. */
char edge_used;
} LANPR_RenderVert;
@@ -566,9 +560,6 @@ void ED_lanpr_compute_feature_lines_background(struct Depsgraph *dg, int interse
LANPR_RenderBuffer *ED_lanpr_create_render_buffer(void);
void ED_lanpr_destroy_render_data(struct LANPR_RenderBuffer *rb);
-void ED_lanpr_calculation_set_flag(LANPR_RenderStatus flag);
-bool ED_lanpr_calculation_flag_check(LANPR_RenderStatus flag);
-
bool ED_lanpr_dpix_shader_error(void);
int ED_lanpr_max_occlusion_in_line_layers(struct SceneLANPR *lanpr);
diff --git a/source/blender/editors/lanpr/lanpr_chain.c b/source/blender/editors/lanpr/lanpr_chain.c
index 996070b93f9..b863ddac884 100644
--- a/source/blender/editors/lanpr/lanpr_chain.c
+++ b/source/blender/editors/lanpr/lanpr_chain.c
@@ -161,56 +161,6 @@ static LANPR_RenderLineChainItem *lanpr_push_render_line_chain_point(LANPR_Rende
return rlci;
}
-/* refer to http://karthaus.nl/rdp/ for description */
-static void lanpr_reduce_render_line_chain_recursive(LANPR_RenderLineChain *rlc,
- LANPR_RenderLineChainItem *from,
- LANPR_RenderLineChainItem *to,
- float dist_threshold)
-{
- LANPR_RenderLineChainItem *rlci, *next_rlci;
- float max_dist = 0;
- LANPR_RenderLineChainItem *max_rlci = 0;
-
- /* find the max distance item */
- for (rlci = from->next; rlci != to; rlci = next_rlci) {
- next_rlci = rlci->next;
-
- if (next_rlci &&
- (next_rlci->occlusion != rlci->occlusion || next_rlci->line_type != rlci->line_type)) {
- continue;
- }
-
- float dist = dist_to_line_segment_v2(rlci->pos, from->pos, to->pos);
- if (dist > dist_threshold && dist > max_dist) {
- max_dist = dist;
- max_rlci = rlci;
- }
- /* if (dist <= dist_threshold) BLI_remlink(&rlc->chain, (void*)rlci); */
- }
-
- if (max_rlci == NULL) {
- if (from->next == to) {
- return;
- }
- for (rlci = from->next; rlci != to; rlci = next_rlci) {
- next_rlci = rlci->next;
- if (next_rlci &&
- (next_rlci->occlusion != rlci->occlusion || next_rlci->line_type != rlci->line_type)) {
- continue;
- }
- BLI_remlink(&rlc->chain, (void *)rlci);
- }
- }
- else {
- if (from->next != max_rlci) {
- lanpr_reduce_render_line_chain_recursive(rlc, from, max_rlci, dist_threshold);
- }
- if (to->prev != max_rlci) {
- lanpr_reduce_render_line_chain_recursive(rlc, max_rlci, to, dist_threshold);
- }
- }
-}
-
void ED_lanpr_NO_THREAD_chain_feature_lines(LANPR_RenderBuffer *rb)
{
LANPR_RenderLineChain *rlc;
diff --git a/source/blender/editors/lanpr/lanpr_cpu.c b/source/blender/editors/lanpr/lanpr_cpu.c
index e40b665bc74..bee023be3d2 100644
--- a/source/blender/editors/lanpr/lanpr_cpu.c
+++ b/source/blender/editors/lanpr/lanpr_cpu.c
@@ -703,13 +703,15 @@ static void lanpr_calculate_single_line_occlusion(LANPR_RenderBuffer *rb,
nba = lanpr_get_next_bounding_area(nba, rl, x, y, k, PositiveX, PositiveY, &x, &y);
}
}
-static bool lanpr_calculation_is_canceled()
+
+static bool lanpr_calculation_is_canceled(void)
{
bool is_canceled;
BLI_spin_lock(&lanpr_share.lock_render_status);
switch (lanpr_share.flag_render_status) {
case LANPR_RENDER_INCOMPELTE:
is_canceled = true;
+ break;
default:
is_canceled = false;
}
@@ -1013,7 +1015,7 @@ static void lanpr_cull_triangles(LANPR_RenderBuffer *rb)
LANPR_RenderVert *rv;
LANPR_RenderElementLinkNode *reln, *veln, *teln;
LANPR_RenderLineSegment *rls;
- double **vp = rb->view_projection;
+ double (*vp)[4] = rb->view_projection;
int i;
real a;
int v_count = 0, t_count = 0;
@@ -1024,11 +1026,10 @@ static void lanpr_cull_triangles(LANPR_RenderBuffer *rb)
copy_v3_v3_db(clip_advance, rb->view_vector);
double cam_pos[3];
- double clip_start, clip_end;
+ double clip_start;
if (rb->viewport_override) {
copy_v3_v3_db(cam_pos, rb->camera_pos);
clip_start = rb->near_clip;
- clip_end = rb->far_clip;
mul_v3db_db(clip_advance, -clip_start);
}
else {
@@ -1817,7 +1818,6 @@ static void lanpr_make_render_geometry_buffers(Depsgraph *depsgraph,
{
double proj[4][4], view[4][4], result[4][4];
float inv[4][4];
- int cam_override;
/* lock becore accessing shared status data */
BLI_spin_lock(&lanpr_share.lock_render_status);
@@ -2253,13 +2253,6 @@ static LANPR_RenderVert *lanpr_triangle_line_intersection_test(LANPR_RenderBuffe
Result = mem_static_aquire(&rb->render_data_pool, sizeof(LANPR_RenderVert));
- if (DotL > 0 || DotR < 0) {
- Result->positive = 1;
- }
- else {
- Result->positive = 0;
- }
-
/* Result->IntersectingOnFace = testing; */
Result->edge_used = 1;
/* Result->IntersectL = l; */
@@ -2290,7 +2283,7 @@ static LANPR_RenderLine *lanpr_triangle_generate_intersection_line_only(
if (rb->viewport_override) {
ZMax = rb->far_clip;
ZMin = rb->near_clip;
- copy_v3db_v3fl(cl, rb->camera_pos);
+ copy_v3_v3_db(cl, rb->camera_pos);
}
else {
ZMax = ((Camera *)rb->camera->data)->clip_end;
@@ -2306,7 +2299,6 @@ static LANPR_RenderLine *lanpr_triangle_generate_intersection_line_only(
l = NewShare = mem_static_aquire(&rb->render_data_pool, (sizeof(LANPR_RenderVert)));
- NewShare->positive = 1;
NewShare->edge_used = 1;
/* NewShare->IntersectL = l; */
NewShare->v = (void *)r; /* Caution! */
@@ -3915,7 +3907,7 @@ void ED_lanpr_compute_feature_lines_background(Depsgraph *dg, int intersection_o
lanpr_share.background_render_task = tp;
BLI_spin_unlock(&lanpr_share.lock_render_status);
- BLI_task_pool_push(tp, lanpr_compute_feature_lines_worker, flw, true, TASK_PRIORITY_HIGH);
+ BLI_task_pool_push(tp, (TaskRunFunction)lanpr_compute_feature_lines_worker, flw, true, TASK_PRIORITY_HIGH);
}
static bool lanpr_camera_exists(struct bContext *c)
@@ -3970,14 +3962,6 @@ void SCENE_OT_lanpr_calculate_feature_lines(struct wmOperatorType *ot)
ot->exec = lanpr_compute_feature_lines_exec;
}
-static bool lanpr_render_buffer_found(struct bContext *UNUSED(C))
-{
- if (lanpr_share.render_buffer_shared) {
- return true;
- }
- return false;
-}
-
/* Access */
bool ED_lanpr_dpix_shader_error()
{
@@ -4115,7 +4099,6 @@ static void lanpr_update_gp_strokes_single(Depsgraph *dg,
bGPdata *gpd;
bGPDlayer *gpl;
bGPDframe *gpf;
- ObjectLANPR *obl = &ob->lanpr;
gpd = gpobj->data;
gpl = BKE_gpencil_layer_get_by_name(gpd, target_layer, 1);
if (gpl == NULL) {
@@ -4146,10 +4129,7 @@ static void lanpr_update_gp_strokes_recursive(
{
Object *ob;
Object *gpobj;
- ModifierData *md;
bGPdata *gpd;
- bGPDlayer *gpl;
- bGPDframe *gpf;
CollectionObject *co;
CollectionChild *cc;
@@ -4159,6 +4139,7 @@ static void lanpr_update_gp_strokes_recursive(
ObjectLANPR *obl = &ob->lanpr;
if (obl->target && obl->target->type == OB_GPENCIL) {
gpobj = obl->target;
+ gpd = gpobj->data;
if (target_only && target_only != gpobj) {
continue;
@@ -4267,9 +4248,7 @@ static void lanpr_update_gp_strokes_collection(
Depsgraph *dg, struct Collection *col, int frame, int this_only, Object *target_only)
{
Object *gpobj;
- bGPdata *gpd;
- bGPDlayer *gpl;
- bGPDframe *gpf;
+ bGPdata *gpd = NULL;
CollectionChild *cc;
/* depth first */
@@ -4369,7 +4348,9 @@ static void lanpr_update_gp_strokes_collection(
}
}
- DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_COPY_ON_WRITE);
+ if(gpd){
+ 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)
{
diff --git a/source/blender/editors/lanpr/lanpr_util.c b/source/blender/editors/lanpr/lanpr_util.c
index 47f7909403a..893a57d690d 100644
--- a/source/blender/editors/lanpr/lanpr_util.c
+++ b/source/blender/editors/lanpr/lanpr_util.c
@@ -139,17 +139,6 @@ void *mem_static_destroy(LANPR_StaticMemPool *smp)
/* =========================================================
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list