Cleanup: style, duplicate include

This commit is contained in:
Campbell Barton
2019-03-18 14:13:06 +11:00
parent 6c0240e84a
commit 317cb1dd65
9 changed files with 50 additions and 46 deletions

View File

@@ -628,8 +628,8 @@ void GPENCIL_cache_populate(void *vedata, Object *ob)
((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) &&
(v3d->gp_flag & V3D_GP_SHOW_GRID) &&
(ob->type == OB_GPENCIL) && (ob == draw_ctx->obact) &&
((ts->gpencil_v3d_align & GP_PROJECT_DEPTH_VIEW) == 0) &&
((ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) == 0))
((ts->gpencil_v3d_align & GP_PROJECT_DEPTH_VIEW) == 0) &&
((ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) == 0))
{
GPU_BATCH_DISCARD_SAFE(e_data.batch_grid);
MEM_SAFE_FREE(e_data.batch_grid);
@@ -649,10 +649,11 @@ void GPENCIL_cache_populate(void *vedata, Object *ob)
case GP_LOCKAXIS_CURSOR:
{
float scale[3] = { 1.0f, 1.0f, 1.0f };
loc_eul_size_to_mat4(stl->storage->grid_matrix,
cursor->location,
cursor->rotation_euler,
scale);
loc_eul_size_to_mat4(
stl->storage->grid_matrix,
cursor->location,
cursor->rotation_euler,
scale);
break;
}
default:

View File

@@ -3337,7 +3337,7 @@ static int gp_strokes_reproject_exec(bContext *C, wmOperator *op)
/* Project stroke in one axis */
if (ELEM(mode, GP_REPROJECT_FRONT, GP_REPROJECT_SIDE,
GP_REPROJECT_TOP, GP_REPROJECT_CURSOR))
GP_REPROJECT_TOP, GP_REPROJECT_CURSOR))
{
if (mode != GP_REPROJECT_CURSOR) {
ED_gp_get_drawing_reference(
@@ -3378,8 +3378,8 @@ static int gp_strokes_reproject_exec(bContext *C, wmOperator *op)
}
ED_gp_project_point_to_plane(
scene, ob, rv3d, origin,
axis, &pt2);
scene, ob, rv3d, origin,
axis, &pt2);
copy_v3_v3(&pt->x, &pt2.x);

View File

@@ -291,8 +291,8 @@ static void gp_draw_datablock(tGPDfill *tgpf, const float ink[4])
/* normal strokes */
if (((tgpf->fill_draw_mode == GP_FILL_DMODE_STROKE) ||
(tgpf->fill_draw_mode == GP_FILL_DMODE_BOTH)) &&
!textured_stroke)
(tgpf->fill_draw_mode == GP_FILL_DMODE_BOTH)) &&
!textured_stroke)
{
ED_gp_draw_fill(&tgpw);
}
@@ -300,7 +300,7 @@ static void gp_draw_datablock(tGPDfill *tgpf, const float ink[4])
/* 3D Lines with basic shapes and invisible lines */
if ((tgpf->fill_draw_mode == GP_FILL_DMODE_CONTROL) ||
(tgpf->fill_draw_mode == GP_FILL_DMODE_BOTH) ||
textured_stroke)
textured_stroke)
{
gp_draw_basic_stroke(
tgpf, gps, tgpw.diff_mat, gps->flag & GP_STROKE_CYCLIC, ink,
@@ -321,7 +321,7 @@ static bool gp_render_offscreen(tGPDfill *tgpf)
if (!tgpf->gpd) {
return false;
}
/* set temporary new size */
tgpf->bwinx = tgpf->ar->winx;
tgpf->bwiny = tgpf->ar->winy;
@@ -348,7 +348,7 @@ static bool gp_render_offscreen(tGPDfill *tgpf)
char err_out[256] = "unknown";
GPUOffScreen *offscreen = GPU_offscreen_create(tgpf->sizex, tgpf->sizey, 0, true, false, err_out);
if (offscreen == NULL) {
printf("GPencil - Fill - Unable to create fill buffer\n");
printf("GPencil - Fill - Unable to create fill buffer\n");
return false;
}
@@ -589,7 +589,7 @@ static void gpencil_boundaryfill_area(tGPDfill *tgpf)
*/
while (!BLI_stack_is_empty(stack)) {
int v;
BLI_stack_pop(stack, &v);
get_pixel(ibuf, v, rgba);
@@ -1213,8 +1213,8 @@ static tGPDfill *gp_session_init_fill(bContext *C, wmOperator *UNUSED(op))
tgpf->fill_threshold = brush->gpencil_settings->fill_threshold;
tgpf->fill_simplylvl = brush->gpencil_settings->fill_simplylvl;
tgpf->fill_draw_mode = brush->gpencil_settings->fill_draw_mode;
tgpf->fill_factor = (short)max_ii(1, min_ii((int)brush->gpencil_settings->fill_factor,8));
tgpf->fill_factor = (short)max_ii(1, min_ii((int)brush->gpencil_settings->fill_factor, 8));
/* get color info */
Material *ma = BKE_gpencil_get_material_from_brush(brush);
/* if no brush defaults, get material and color info */

View File

@@ -399,8 +399,8 @@ static void gp_reproject_toplane(tGPsdata *p, bGPDstroke *gps)
/* get drawing origin */
gp_get_3d_reference(p, origin);
ED_gp_project_stroke_to_plane(
p->scene, obact, rv3d, gps,
origin, p->lock_axis - 1);
p->scene, obact, rv3d, gps,
origin, p->lock_axis - 1);
}
/* convert screen-coordinates to buffer-coordinates */

View File

@@ -930,13 +930,15 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi)
ts->gpencil_v3d_align, origin);
/* reproject current */
ED_gpencil_tpoint_to_point(tgpi->ar, origin, tpt, &spt);
ED_gp_project_point_to_plane(tgpi->scene, tgpi->ob, tgpi->rv3d,
origin, tgpi->lock_axis - 1, &spt);
ED_gp_project_point_to_plane(
tgpi->scene, tgpi->ob, tgpi->rv3d,
origin, tgpi->lock_axis - 1, &spt);
/* reproject previous */
ED_gpencil_tpoint_to_point(tgpi->ar, origin, tptb, &spt2);
ED_gp_project_point_to_plane(tgpi->scene, tgpi->ob, tgpi->rv3d,
origin, tgpi->lock_axis - 1, &spt2);
ED_gp_project_point_to_plane(
tgpi->scene, tgpi->ob, tgpi->rv3d,
origin, tgpi->lock_axis - 1, &spt2);
tgpi->totpixlen += len_v3v3(&spt.x, &spt2.x) / pixsize;
tpt->uv_fac = tgpi->totpixlen;
if ((gp_style) && (gp_style->sima)) {
@@ -995,8 +997,8 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi)
tgpi->scene, tgpi->ob, tgpi->gpl,
ts->gpencil_v3d_align, origin);
ED_gp_project_stroke_to_plane(
tgpi->scene, tgpi->ob, tgpi->rv3d, gps,
origin, ts->gp_sculpt.lock_axis - 1);
tgpi->scene, tgpi->ob, tgpi->rv3d, gps,
origin, ts->gp_sculpt.lock_axis - 1);
}
/* if parented change position relative to parent object */

View File

@@ -937,9 +937,9 @@ void ED_gpencil_project_stroke_to_view(bContext *C, bGPDlayer *gpl, bGPDstroke *
* Reproject all points of the stroke to a plane locked to axis to avoid stroke offset
*/
void ED_gp_project_stroke_to_plane(
const Scene *scene, const Object *ob,
const RegionView3D *rv3d, bGPDstroke *gps,
const float origin[3], const int axis)
const Scene *scene, const Object *ob,
const RegionView3D *rv3d, bGPDstroke *gps,
const float origin[3], const int axis)
{
const ToolSettings *ts = scene->toolsettings;
const View3DCursor *cursor = &scene->cursor;
@@ -1012,9 +1012,9 @@ void ED_gp_project_stroke_to_plane(
* \param[in, out] pt : Point to affect
*/
void ED_gp_project_point_to_plane(
const Scene *scene, const Object *ob,
const RegionView3D *rv3d, const float origin[3],
const int axis, bGPDspoint *pt)
const Scene *scene, const Object *ob,
const RegionView3D *rv3d, const float origin[3],
const int axis, bGPDspoint *pt)
{
const ToolSettings *ts = scene->toolsettings;
const View3DCursor *cursor = &scene->cursor;

View File

@@ -225,11 +225,11 @@ void ED_gpencil_add_defaults(struct bContext *C, struct Object *ob);
void ED_gpencil_setup_modes(struct bContext *C, struct bGPdata *gpd, int newmode);
void ED_gp_project_stroke_to_plane(
const struct Scene *scene,
const struct Scene *scene,
const struct Object *ob, const struct RegionView3D *rv3d,
struct bGPDstroke *gps, const float origin[3], const int axis);
void ED_gp_project_point_to_plane(
const struct Scene *scene,
const struct Scene *scene,
const struct Object *ob, const struct RegionView3D *rv3d,
const float origin[3], const int axis, struct bGPDspoint *pt);
void ED_gp_get_drawing_reference(

View File

@@ -182,8 +182,10 @@ LogImageFile *cineonOpen(const unsigned char *byteStuff, int fromMemory, size_t
if (verbose) printf("Cineon: File is LSB.\n");
}
else {
if (verbose) printf("Cineon: Bad magic number %lu in \"%s\".\n",
(unsigned long)header.fileHeader.magic_num, byteStuff);
if (verbose) {
printf("Cineon: Bad magic number %lu in \"%s\".\n",
(unsigned long)header.fileHeader.magic_num, byteStuff);
}
logImageClose(cineon);
return NULL;
}

View File

@@ -56,8 +56,6 @@
#include "RE_render_ext.h"
#include "NOD_composite.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
@@ -2470,9 +2468,9 @@ static StructRNA *rna_NodeCustomGroup_register(
}
static StructRNA *rna_ShaderNodeCustomGroup_register(
Main * bmain, ReportList *reports,
void *data, const char *identifier,
StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
Main *bmain, ReportList *reports,
void *data, const char *identifier,
StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
bNodeType * nt = rna_Node_register_base(bmain, reports, &RNA_ShaderNodeCustomGroup, data, identifier, validate, call, free);
@@ -2492,9 +2490,9 @@ static StructRNA *rna_ShaderNodeCustomGroup_register(
}
static StructRNA *rna_CompositorNodeCustomGroup_register(
Main *bmain, ReportList *reports,
void *data, const char *identifier,
StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
Main *bmain, ReportList *reports,
void *data, const char *identifier,
StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
bNodeType *nt = rna_Node_register_base(bmain, reports, &RNA_CompositorNodeCustomGroup, data, identifier, validate, call, free);
if (!nt)
@@ -3463,8 +3461,9 @@ static void def_group(StructRNA *srna)
RNA_def_property_ui_text(prop, "Interface", "Interface socket data");
}
static void def_custom_group(BlenderRNA *brna, const char *struct_name, const char *base_name,
const char *ui_name, const char *ui_desc, const char *reg_func)
static void def_custom_group(
BlenderRNA *brna, const char *struct_name, const char *base_name,
const char *ui_name, const char *ui_desc, const char *reg_func)
{
StructRNA *srna;
@@ -8672,7 +8671,7 @@ void RNA_def_nodetree(BlenderRNA *brna)
define_specific_node(brna, "TextureNodeGroup", "TextureNode", "Group", "", def_group);
def_custom_group(brna, "ShaderNodeCustomGroup", "ShaderNode", "Shader Custom Group", "Custom Shader Group Node for Python nodes", "rna_ShaderNodeCustomGroup_register");
def_custom_group(brna, "CompositorNodeCustomGroup", "CompositorNode", "Compositor Custom Group", "Custom Compositor Group Node for Python nodes", "rna_CompositorNodeCustomGroup_register");
def_custom_group(brna, "NodeCustomGroup", "Node", "Custom Group", "Base node type for custom registered node group types", "rna_NodeCustomGroup_register");
def_custom_group(brna, "NodeCustomGroup", "Node", "Custom Group", "Base node type for custom registered node group types", "rna_NodeCustomGroup_register");
/* special socket types */
rna_def_cmp_output_file_slot_file(brna);