Cleanup: style
This commit is contained in:
		@@ -89,8 +89,8 @@ static int gpencil_len_datablock_duplicated(
 | 
			
		||||
	for (int i = 0; i < gp_cache_used; i++) {
 | 
			
		||||
		tGPencilObjectCache *cache_elem = &cache_array[i];
 | 
			
		||||
		if ((cache_elem->ob != ob) &&
 | 
			
		||||
			(cache_elem->gpd == gpd) &&
 | 
			
		||||
			(!cache_elem->is_dup_ob))
 | 
			
		||||
		    (cache_elem->gpd == gpd) &&
 | 
			
		||||
		    (!cache_elem->is_dup_ob))
 | 
			
		||||
		{
 | 
			
		||||
			tot++;
 | 
			
		||||
		}
 | 
			
		||||
@@ -134,9 +134,10 @@ tGPencilObjectCache *gpencil_object_cache_add(
 | 
			
		||||
	cache_elem->idx = *gp_cache_used;
 | 
			
		||||
 | 
			
		||||
	/* check if object is duplicated */
 | 
			
		||||
	cache_elem->is_dup_ob = gpencil_check_ob_duplicated(cache_array,
 | 
			
		||||
									*gp_cache_used, ob_orig,
 | 
			
		||||
									&cache_elem->data_idx);
 | 
			
		||||
	cache_elem->is_dup_ob = gpencil_check_ob_duplicated(
 | 
			
		||||
	        cache_array,
 | 
			
		||||
	        *gp_cache_used, ob_orig,
 | 
			
		||||
	        &cache_elem->data_idx);
 | 
			
		||||
 | 
			
		||||
	if (!cache_elem->is_dup_ob) {
 | 
			
		||||
		/* check if object reuse datablock */
 | 
			
		||||
 
 | 
			
		||||
@@ -1281,7 +1281,7 @@ void DRW_gpencil_populate_datablock(
 | 
			
		||||
 | 
			
		||||
		/* if pose mode, maybe the overlay to fade geometry is enabled */
 | 
			
		||||
		if ((draw_ctx->obact) && (draw_ctx->object_mode == OB_MODE_POSE) &&
 | 
			
		||||
			(v3d->overlay.flag & V3D_OVERLAY_BONE_SELECT))
 | 
			
		||||
		    (v3d->overlay.flag & V3D_OVERLAY_BONE_SELECT))
 | 
			
		||||
		{
 | 
			
		||||
			opacity = gpl->opacity * v3d->overlay.bone_select_alpha;
 | 
			
		||||
		}
 | 
			
		||||
@@ -1292,7 +1292,7 @@ void DRW_gpencil_populate_datablock(
 | 
			
		||||
		/* create derived array data or expand */
 | 
			
		||||
		if (cache_ob->data_idx + 1 > gpl->runtime.len_derived) {
 | 
			
		||||
			if ((gpl->runtime.len_derived == 0) ||
 | 
			
		||||
				(gpl->runtime.derived_array == NULL))
 | 
			
		||||
			    (gpl->runtime.derived_array == NULL))
 | 
			
		||||
			{
 | 
			
		||||
				p = MEM_callocN(sizeof(struct bGPDframe), "bGPDframe array");
 | 
			
		||||
				gpl->runtime.len_derived = 1;
 | 
			
		||||
@@ -1321,7 +1321,7 @@ void DRW_gpencil_populate_datablock(
 | 
			
		||||
		/* draw onion skins */
 | 
			
		||||
		if (!ID_IS_LINKED(&gpd->id)) {
 | 
			
		||||
			if ((!cache_ob->is_dup_data) &&
 | 
			
		||||
				(gpd->flag & GP_DATA_SHOW_ONIONSKINS) &&
 | 
			
		||||
			    (gpd->flag & GP_DATA_SHOW_ONIONSKINS) &&
 | 
			
		||||
			    (do_onion) && (gpl->onion_flag & GP_LAYER_ONIONSKIN) &&
 | 
			
		||||
			    ((!playing) || (gpd->onion_flag & GP_ONION_GHOST_ALWAYS)) &&
 | 
			
		||||
			    (!cache_ob->is_dup_ob) && (gpd->id.us <= 1))
 | 
			
		||||
 
 | 
			
		||||
@@ -583,7 +583,7 @@ void GPENCIL_cache_populate(void *vedata, Object *ob)
 | 
			
		||||
		* (only if region is equal to originated paint region)
 | 
			
		||||
		*/
 | 
			
		||||
		if ((draw_ctx->obact == ob) &&
 | 
			
		||||
			((gpd->runtime.ar == NULL) || (gpd->runtime.ar == draw_ctx->ar)))
 | 
			
		||||
		    ((gpd->runtime.ar == NULL) || (gpd->runtime.ar == draw_ctx->ar)))
 | 
			
		||||
		{
 | 
			
		||||
			DRW_gpencil_populate_buffer_strokes(&e_data, vedata, ts, ob);
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -302,7 +302,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
 | 
			
		||||
					immRectf(pos, 0.0f, (float)y - ACHANNEL_HEIGHT_HALF(ac), v2d->cur.xmin, (float)y + ACHANNEL_HEIGHT_HALF(ac));
 | 
			
		||||
 | 
			
		||||
					/* frames one and higher get a saturated background */
 | 
			
		||||
					immUniformColor3ubvAlpha(color, MIN2(255, color[3]*2));
 | 
			
		||||
					immUniformColor3ubvAlpha(color, MIN2(255, color[3] * 2));
 | 
			
		||||
					immRectf(pos, v2d->cur.xmin, (float)y - ACHANNEL_HEIGHT_HALF(ac), v2d->cur.xmax + EXTRA_SCROLL_PAD,  (float)y + ACHANNEL_HEIGHT_HALF(ac));
 | 
			
		||||
				}
 | 
			
		||||
				else if (ac->datatype == ANIMCONT_MASK) {
 | 
			
		||||
@@ -313,7 +313,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
 | 
			
		||||
					immRectf(pos, 0.0f, (float)y - ACHANNEL_HEIGHT_HALF(ac), v2d->cur.xmin, (float)y + ACHANNEL_HEIGHT_HALF(ac));
 | 
			
		||||
 | 
			
		||||
					/* frames one and higher get a saturated background */
 | 
			
		||||
					immUniformColor3ubvAlpha(color, MIN2(255, color[3]*2));
 | 
			
		||||
					immUniformColor3ubvAlpha(color, MIN2(255, color[3] * 2));
 | 
			
		||||
					immRectf(pos, v2d->cur.xmin, (float)y - ACHANNEL_HEIGHT_HALF(ac), v2d->cur.xmax + EXTRA_SCROLL_PAD,  (float)y + ACHANNEL_HEIGHT_HALF(ac));
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
@@ -4189,7 +4189,7 @@ static void p_add_ngon(ParamHandle *handle, ParamKey key, int nverts,
 | 
			
		||||
	float normal[3];
 | 
			
		||||
	zero_v3(normal);
 | 
			
		||||
 | 
			
		||||
	const float *co_curr, *co_prev = co[nverts-1];
 | 
			
		||||
	const float *co_curr, *co_prev = co[nverts - 1];
 | 
			
		||||
	for (int j = 0; j < nverts; j++) {
 | 
			
		||||
		co_curr = co[j];
 | 
			
		||||
		add_newell_cross_v3_v3v3(normal, co_prev, co_curr);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user