Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_api/spacetypes.c
| Show First 20 Lines • Show All 259 Lines • ▼ Show 20 Lines | for (rdc = art->drawcalls.first; rdc; rdc = rdc->next) { | ||||
| if (rdc == (RegionDrawCB *)handle) { | if (rdc == (RegionDrawCB *)handle) { | ||||
| BLI_remlink(&art->drawcalls, rdc); | BLI_remlink(&art->drawcalls, rdc); | ||||
| MEM_freeN(rdc); | MEM_freeN(rdc); | ||||
| return; | return; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| int ED_region_has_draw_cb(const bContext *C, ARegion *ar, int type) | |||||
JacquesLucke: why not return `bool`?
What kind of `type`? Choose a more descriptive variable name? | |||||
| { | |||||
| RegionDrawCB *rdc; | |||||
| for (rdc = ar->type->drawcalls.first; rdc; rdc = rdc->next) { | |||||
| if (rdc->type == type) { | |||||
| return 1; | |||||
| } | |||||
| } | |||||
| return 0; | |||||
| } | |||||
| void ED_region_draw_cb_draw(const bContext *C, ARegion *ar, int type) | void ED_region_draw_cb_draw(const bContext *C, ARegion *ar, int type) | ||||
| { | { | ||||
| RegionDrawCB *rdc; | RegionDrawCB *rdc; | ||||
| for (rdc = ar->type->drawcalls.first; rdc; rdc = rdc->next) { | for (rdc = ar->type->drawcalls.first; rdc; rdc = rdc->next) { | ||||
| if (rdc->type == type) { | if (rdc->type == type) { | ||||
| rdc->draw(C, ar, rdc->customdata); | rdc->draw(C, ar, rdc->customdata); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines | |||||
why not return bool?
What kind of type? Choose a more descriptive variable name?