Cleanup: style
This commit is contained in:
@@ -881,8 +881,8 @@ static void gpencil_draw_strokes(
|
||||
|
||||
/* edit points (only in edit mode and not play animation not render) */
|
||||
if ((draw_ctx->obact == ob) && (src_gps) &&
|
||||
(!playing) && (!is_render) && (!cache_ob->is_dup_ob)
|
||||
&& ((gpl->flag & GP_LAYER_LOCKED) == 0))
|
||||
(!playing) && (!is_render) && (!cache_ob->is_dup_ob) &&
|
||||
((gpl->flag & GP_LAYER_LOCKED) == 0))
|
||||
{
|
||||
if (!stl->g_data->shgrps_edit_line) {
|
||||
stl->g_data->shgrps_edit_line = DRW_shgroup_create(e_data->gpencil_line_sh, psl->edit_pass);
|
||||
|
||||
@@ -187,7 +187,8 @@ void DRW_globals_update(void)
|
||||
bool user_weight_ramp = (U.flag & USER_CUSTOM_RANGE) != 0;
|
||||
|
||||
if (weight_ramp_custom != user_weight_ramp ||
|
||||
(user_weight_ramp && memcmp(&weight_ramp_copy, &U.coba_weight, sizeof(ColorBand)) != 0)) {
|
||||
(user_weight_ramp && memcmp(&weight_ramp_copy, &U.coba_weight, sizeof(ColorBand)) != 0))
|
||||
{
|
||||
DRW_TEXTURE_FREE_SAFE(globals_weight_ramp);
|
||||
}
|
||||
|
||||
@@ -950,8 +951,7 @@ bool DRW_object_axis_orthogonal_to_view(Object *ob, int axis)
|
||||
|
||||
static void DRW_evaluate_weight_to_color(float *result, float weight)
|
||||
{
|
||||
if (U.flag & USER_CUSTOM_RANGE)
|
||||
{
|
||||
if (U.flag & USER_CUSTOM_RANGE) {
|
||||
BKE_colorband_evaluate(&U.coba_weight, weight, result);
|
||||
}
|
||||
else {
|
||||
@@ -975,7 +975,7 @@ static GPUTexture* DRW_create_weight_colorramp_texture(void)
|
||||
float pixels[256 * 4];
|
||||
for (int i = 0 ; i < 256 ; i ++) {
|
||||
DRW_evaluate_weight_to_color(&pixels[i*4], i / 255.0f);
|
||||
pixels[i*4 + 3] = 1.0f;
|
||||
pixels[(i * 4) + 3] = 1.0f;
|
||||
}
|
||||
|
||||
return GPU_texture_create_1D(256, GPU_RGBA8, pixels, error);
|
||||
|
||||
@@ -1866,8 +1866,7 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event
|
||||
tGPsdata *p = NULL;
|
||||
|
||||
/* GPXX Need a better solution */
|
||||
if (sa && sa->spacetype == SPACE_VIEW3D)
|
||||
{
|
||||
if (sa && sa->spacetype == SPACE_VIEW3D) {
|
||||
if ((ob != NULL) && (ob->type == OB_GPENCIL)) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Cannot draw annotation with a Grease Pencil object active");
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
@@ -1230,9 +1230,7 @@ static bool gpsculpt_brush_init(bContext *C, wmOperator *op)
|
||||
gso->cfra = INT_MAX; /* NOTE: So that first stroke will get handled in init_stroke() */
|
||||
|
||||
/* some brushes cannot use pressure for radius */
|
||||
if ((gso->brush_type == GP_EDITBRUSH_TYPE_GRAB) ||
|
||||
(gso->brush_type == GP_EDITBRUSH_TYPE_CLONE))
|
||||
{
|
||||
if (ELEM(gso->brush_type, GP_EDITBRUSH_TYPE_GRAB, GP_EDITBRUSH_TYPE_CLONE)) {
|
||||
gso->brush->flag &= ~GP_EDITBRUSH_FLAG_PRESSURE_RADIUS;
|
||||
}
|
||||
|
||||
|
||||
@@ -2163,7 +2163,8 @@ static void ui_but_paste_numeric_value(bContext *C, uiBut *but, uiHandleButtonDa
|
||||
data->value = value;
|
||||
ui_but_string_set(C, but, buf_paste);
|
||||
button_activate_state(C, but, BUTTON_STATE_EXIT);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
WM_report(RPT_ERROR, "Expected a number");
|
||||
}
|
||||
}
|
||||
@@ -2313,8 +2314,7 @@ static void ui_but_copy(bContext *C, uiBut *but, const bool copy_array)
|
||||
|
||||
bool has_required_data = !(but->poin == NULL && but->rnapoin.data == NULL);
|
||||
|
||||
switch (but->type)
|
||||
{
|
||||
switch (but->type) {
|
||||
case UI_BTYPE_NUM:
|
||||
case UI_BTYPE_NUM_SLIDER:
|
||||
if (!has_required_data) break;
|
||||
@@ -2376,8 +2376,7 @@ static void ui_but_paste(bContext *C, uiBut *but, uiHandleButtonData *data, cons
|
||||
|
||||
bool has_required_data = !(but->poin == NULL && but->rnapoin.data == NULL);
|
||||
|
||||
switch (but->type)
|
||||
{
|
||||
switch (but->type) {
|
||||
case UI_BTYPE_NUM:
|
||||
case UI_BTYPE_NUM_SLIDER:
|
||||
if (!has_required_data) break;
|
||||
|
||||
@@ -1527,7 +1527,7 @@ static void icon_draw_size(
|
||||
/* icon that matches text color, assumed to be white */
|
||||
float color[4];
|
||||
if (mono_rgba) {
|
||||
rgba_uchar_to_float(color, (const unsigned char*)mono_rgba);
|
||||
rgba_uchar_to_float(color, (const uchar *)mono_rgba);
|
||||
}
|
||||
else {
|
||||
UI_GetThemeColor4fv(TH_TEXT, color);
|
||||
|
||||
@@ -724,7 +724,7 @@ void ui_draw_aligned_panel(
|
||||
#endif
|
||||
{
|
||||
char col_title[4];
|
||||
UI_GetThemeColor4ubv(TH_TITLE, (unsigned char*)col_title);
|
||||
UI_GetThemeColor4ubv(TH_TITLE, (uchar *)col_title);
|
||||
|
||||
GPU_blend(true);
|
||||
UI_icon_draw_aspect(
|
||||
|
||||
@@ -328,7 +328,8 @@ static void meshdeformModifier_do(
|
||||
/* Write binding data to original modifier. */
|
||||
Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
|
||||
Object *ob_orig = DEG_get_original_object(ob);
|
||||
MeshDeformModifierData *mmd_orig = (MeshDeformModifierData*)modifiers_findByName(ob_orig, mmd->modifier.name);
|
||||
MeshDeformModifierData *mmd_orig = (MeshDeformModifierData *)modifiers_findByName(
|
||||
ob_orig, mmd->modifier.name);
|
||||
|
||||
recursive = 1;
|
||||
mmd->bindfunc(scene, mmd_orig, cagemesh, (float *)vertexCos, numVerts, cagemat);
|
||||
|
||||
@@ -439,7 +439,7 @@ void wm_drags_draw(bContext *C, wmWindow *win, rcti *rect)
|
||||
drag_rect_minmax(rect, x, y, x + w, y + iconsize);
|
||||
}
|
||||
else {
|
||||
UI_fontstyle_draw_simple(fstyle, x, y, wm_drag_name(drag), (unsigned char*)text_col);
|
||||
UI_fontstyle_draw_simple(fstyle, x, y, wm_drag_name(drag), (uchar *)text_col);
|
||||
}
|
||||
|
||||
/* operator name with roundbox */
|
||||
|
||||
Reference in New Issue
Block a user