style cleanup: changes from recent commits
This commit is contained in:
@@ -1480,7 +1480,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
|
||||
|
||||
/* blender internal needs this to be set to dupligroup to render
|
||||
* groups correctly, but we don't want this hack for cycles */
|
||||
if(dupli_type_hack && GS(id->name) == ID_GR)
|
||||
if (dupli_type_hack && GS(id->name) == ID_GR)
|
||||
dupli_type = OB_DUPLIGROUP;
|
||||
|
||||
/* to give ipos in object correct offset */
|
||||
|
||||
@@ -895,7 +895,7 @@ int BKE_copybuffer_save(char *filename, ReportList *reports)
|
||||
ID *id, *nextid;
|
||||
ListBase *lb1 = lbarray[a], *lb2 = fromarray[a];
|
||||
|
||||
for (id = lb2->first; id; id= nextid) {
|
||||
for (id = lb2->first; id; id = nextid) {
|
||||
nextid = id->next;
|
||||
if (id->flag & LIB_DOIT) {
|
||||
BLI_remlink(lb2, id);
|
||||
|
||||
@@ -1495,7 +1495,7 @@ static void ui_item_menu(uiLayout *layout, const char *name, int icon, uiMenuCre
|
||||
h = UI_UNIT_Y;
|
||||
|
||||
if (layout->root->type == UI_LAYOUT_HEADER) /* ugly .. */
|
||||
w -= UI_UNIT_Y/2;
|
||||
w -= UI_UNIT_Y / 2;
|
||||
|
||||
if (name[0] && icon)
|
||||
but = uiDefIconTextMenuBut(block, func, arg, icon, name, 0, 0, w, h, tip);
|
||||
|
||||
@@ -186,7 +186,7 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem)
|
||||
uiDefBut(block, LABEL, 0, "", 10, 15, w, h, NULL, 0, 0, 0, 0, NULL);
|
||||
|
||||
but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, w, UI_UNIT_Y,
|
||||
template.prv_rows, template.prv_cols, "");
|
||||
template.prv_rows, template.prv_cols, "");
|
||||
uiButSetSearchFunc(but, id_search_cb, &template, id_search_call_cb, idptr.data);
|
||||
}
|
||||
/* list view */
|
||||
@@ -1590,7 +1590,7 @@ void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, const char *propname
|
||||
hist->height = (hist->height <= UI_UNIT_Y) ? UI_UNIT_Y : hist->height;
|
||||
|
||||
bt = uiDefBut(block, HISTOGRAM, 0, "", rect.xmin, rect.ymin, BLI_rctf_size_x(&rect), UI_DPI_FAC * hist->height,
|
||||
hist, 0, 0, 0, 0, "");
|
||||
hist, 0, 0, 0, 0, "");
|
||||
|
||||
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
|
||||
|
||||
@@ -1629,7 +1629,7 @@ void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, const char *propname)
|
||||
scopes->wavefrm_height = (scopes->wavefrm_height <= UI_UNIT_Y) ? UI_UNIT_Y : scopes->wavefrm_height;
|
||||
|
||||
bt = uiDefBut(block, WAVEFORM, 0, "", rect.xmin, rect.ymin, BLI_rctf_size_x(&rect), UI_DPI_FAC * scopes->wavefrm_height,
|
||||
scopes, 0, 0, 0, 0, "");
|
||||
scopes, 0, 0, 0, 0, "");
|
||||
(void)bt; /* UNUSED */
|
||||
|
||||
MEM_freeN(cb);
|
||||
@@ -1667,7 +1667,7 @@ void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, const char *propna
|
||||
scopes->vecscope_height = (scopes->vecscope_height <= UI_UNIT_Y) ? UI_UNIT_Y : scopes->vecscope_height;
|
||||
|
||||
bt = uiDefBut(block, VECTORSCOPE, 0, "", rect.xmin, rect.ymin, BLI_rctf_size_x(&rect),
|
||||
UI_DPI_FAC * scopes->vecscope_height, scopes, 0, 0, 0, 0, "");
|
||||
UI_DPI_FAC * scopes->vecscope_height, scopes, 0, 0, 0, 0, "");
|
||||
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
|
||||
|
||||
MEM_freeN(cb);
|
||||
|
||||
@@ -1649,7 +1649,7 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
|
||||
/* clean rect behind slider, but not with transparent background */
|
||||
UI_GetThemeColor4ubv(TH_BACK, col);
|
||||
if (col[3] == 255) {
|
||||
glColor3ub(col[0], col[1],col[2]);
|
||||
glColor3ub(col[0], col[1], col[2]);
|
||||
glRecti(v2d->hor.xmin, v2d->hor.ymin, v2d->hor.xmax, v2d->hor.ymax);
|
||||
}
|
||||
|
||||
@@ -1765,7 +1765,7 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
|
||||
/* clean rect behind slider, but not with transparent background */
|
||||
UI_GetThemeColor4ubv(TH_BACK, col);
|
||||
if (col[3] == 255) {
|
||||
glColor3ub(col[0], col[1],col[2]);
|
||||
glColor3ub(col[0], col[1], col[2]);
|
||||
glRecti(v2d->vert.xmin, v2d->vert.ymin, v2d->vert.xmax, v2d->vert.ymax);
|
||||
}
|
||||
|
||||
|
||||
@@ -263,7 +263,7 @@ int scredge_is_horizontal(ScrEdge *se)
|
||||
ScrEdge *screen_find_active_scredge(bScreen *sc, int mx, int my)
|
||||
{
|
||||
ScrEdge *se;
|
||||
int safety = U.widget_unit/10;
|
||||
int safety = U.widget_unit / 10;
|
||||
|
||||
if (safety < 2) safety = 2;
|
||||
|
||||
|
||||
@@ -3600,13 +3600,14 @@ typedef struct RegionAlphaInfo {
|
||||
float ED_region_blend_factor(ARegion *ar)
|
||||
{
|
||||
/* check parent too */
|
||||
if(ar->regiontimer == NULL && (ar->alignment & RGN_SPLIT_PREV) && ar->prev)
|
||||
if (ar->regiontimer == NULL && (ar->alignment & RGN_SPLIT_PREV) && ar->prev) {
|
||||
ar = ar->prev;
|
||||
|
||||
}
|
||||
|
||||
if (ar->regiontimer) {
|
||||
RegionAlphaInfo *rgi = ar->regiontimer->customdata;
|
||||
float alpha;
|
||||
|
||||
|
||||
alpha = (float)ar->regiontimer->duration / TIMEOUT;
|
||||
/* makes sure the blend out works 100% - without area redraws */
|
||||
if (rgi->hidden) alpha = 0.9f - TIMESTEP - alpha;
|
||||
@@ -3669,10 +3670,12 @@ void region_blend_start(bContext *C, ScrArea *sa, ARegion *ar)
|
||||
else
|
||||
WM_event_remove_handlers(C, &ar->handlers);
|
||||
|
||||
if(ar->next)
|
||||
if (ar->next->alignment & RGN_SPLIT_PREV)
|
||||
if (ar->next) {
|
||||
if (ar->next->alignment & RGN_SPLIT_PREV) {
|
||||
rgi->child_ar = ar->next;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* new timer */
|
||||
ar->regiontimer = WM_event_add_timer(wm, win, TIMERREGION, TIMESTEP);
|
||||
ar->regiontimer->customdata = rgi;
|
||||
|
||||
@@ -573,7 +573,7 @@ static int draw_name_offset(ARegion *ar)
|
||||
arn = arn->prev;
|
||||
|
||||
/* check if a region overlaps with the current one */
|
||||
for (; arn; arn= arn->next) {
|
||||
for (; arn; arn = arn->next) {
|
||||
if (ar != arn)
|
||||
if (ar->winrct.xmin == arn->winrct.xmin)
|
||||
if (ar->winrct.ymin == arn->winrct.ymin)
|
||||
|
||||
@@ -145,7 +145,7 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in,
|
||||
/* make alpha output give results even if transparency is only enabled on
|
||||
* the material linked in this not and not on the parent material */
|
||||
mode = shi->mode;
|
||||
if(shi->mat->mode & MA_TRANSP)
|
||||
if (shi->mat->mode & MA_TRANSP)
|
||||
shi->mode |= MA_TRANSP;
|
||||
|
||||
shi->nodes= 1; /* temp hack to prevent trashadow recursion */
|
||||
|
||||
@@ -147,7 +147,7 @@ struct wmEventHandler *WM_event_add_ui_handler(const struct bContext *C, ListBas
|
||||
int (*func)(struct bContext *C, struct wmEvent *event, void *userdata),
|
||||
void (*remove)(struct bContext *C, void *userdata), void *userdata);
|
||||
void WM_event_remove_ui_handler(ListBase *handlers,
|
||||
int (*func)(struct bContext *C, struct wmEvent *event, void *userdata),
|
||||
int (*func)(struct bContext *C, struct wmEvent *event, void *userdata),
|
||||
void (*remove)(struct bContext *C, void *userdata), void *userdata, int postpone);
|
||||
void WM_event_remove_area_handler(struct ListBase *handlers, void *area);
|
||||
|
||||
@@ -301,7 +301,7 @@ struct wmDrag *WM_event_start_drag(struct bContext *C, int icon, int type, void
|
||||
void WM_event_drag_image(struct wmDrag *, struct ImBuf *, float scale, int sx, int sy);
|
||||
|
||||
struct wmDropBox *WM_dropbox_add(ListBase *lb, const char *idname, int (*poll)(struct bContext *, struct wmDrag *, struct wmEvent *event),
|
||||
void (*copy)(struct wmDrag *, struct wmDropBox *));
|
||||
void (*copy)(struct wmDrag *, struct wmDropBox *));
|
||||
ListBase *WM_dropboxmap_find(const char *idname, int spaceid, int regionid);
|
||||
|
||||
/* Set a subwindow active in pixelspace view, with optional scissor subset */
|
||||
|
||||
@@ -1640,9 +1640,9 @@ static int wm_action_not_handled(int action)
|
||||
static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
const int do_debug_handler = (G.debug & G_DEBUG_HANDLERS)
|
||||
const int do_debug_handler = (G.debug & G_DEBUG_HANDLERS) &&
|
||||
/* comment this out to flood the console! (if you really want to test) */
|
||||
&& !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)
|
||||
!ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)
|
||||
;
|
||||
#endif
|
||||
wmWindowManager *wm = CTX_wm_manager(C);
|
||||
|
||||
@@ -311,7 +311,7 @@ void wm_window_title(wmWindowManager *wm, wmWindow *win)
|
||||
if (G.save_over && G.main->name[0]) {
|
||||
char str[sizeof(G.main->name) + 12];
|
||||
BLI_snprintf(str, sizeof(str), "Blender%s [%s%s]", wm->file_saved ? "" : "*", G.main->name,
|
||||
G.main->recovered ? " (Recovered)" : "");
|
||||
G.main->recovered ? " (Recovered)" : "");
|
||||
GHOST_SetTitle(win->ghostwin, str);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user