| 10318 | nk_draw_list_setup(&ctx->draw_list, config, cmds, vertices, elements, |
| 10319 | config->line_AA, config->shape_AA); |
| 10320 | nk_foreach(cmd, ctx) |
| 10321 | { |
| 10322 | #ifdef NK_INCLUDE_COMMAND_USERDATA |
| 10323 | ctx->draw_list.userdata = cmd->userdata; |
| 10324 | #endif |
| 10325 | switch (cmd->type) { |
| 10326 | case NK_COMMAND_NOP: break; |
| 10327 | case NK_COMMAND_SCISSOR: { |
| 10328 | const struct nk_command_scissor *s = (const struct nk_command_scissor*)cmd; |
| 10329 | nk_draw_list_add_clip(&ctx->draw_list, nk_rect(s->x, s->y, s->w, s->h)); |
| 10330 | } break; |
| 10331 | case NK_COMMAND_LINE: { |
| 10332 | const struct nk_command_line *l = (const struct nk_command_line*)cmd; |
| 10333 | nk_draw_list_stroke_line(&ctx->draw_list, nk_vec2(l->begin.x, l->begin.y), |
| 10334 | nk_vec2(l->end.x, l->end.y), l->color, l->line_thickness); |
| 10335 | } break; |
| 10336 | case NK_COMMAND_CURVE: { |
| 10337 | const struct nk_command_curve *q = (const struct nk_command_curve*)cmd; |
| 10338 | nk_draw_list_stroke_curve(&ctx->draw_list, nk_vec2(q->begin.x, q->begin.y), |
| 10339 | nk_vec2(q->ctrl[0].x, q->ctrl[0].y), nk_vec2(q->ctrl[1].x, |
| 10340 | q->ctrl[1].y), nk_vec2(q->end.x, q->end.y), q->color, |
| 10341 | config->curve_segment_count, q->line_thickness); |
| 10342 | } break; |
| 10343 | case NK_COMMAND_RECT: { |
| 10344 | const struct nk_command_rect *r = (const struct nk_command_rect*)cmd; |
| 10345 | nk_draw_list_stroke_rect(&ctx->draw_list, nk_rect(r->x, r->y, r->w, r->h), |
| 10346 | r->color, (float)r->rounding, r->line_thickness); |
| 10347 | } break; |
| 10348 | case NK_COMMAND_RECT_FILLED: { |
| 10349 | const struct nk_command_rect_filled *r = (const struct nk_command_rect_filled*)cmd; |
| 10350 | nk_draw_list_fill_rect(&ctx->draw_list, nk_rect(r->x, r->y, r->w, r->h), |
| 10351 | r->color, (float)r->rounding); |
| 10352 | } break; |
| 10353 | case NK_COMMAND_RECT_MULTI_COLOR: { |
| 10354 | const struct nk_command_rect_multi_color *r = (const struct nk_command_rect_multi_color*)cmd; |
| 10355 | nk_draw_list_fill_rect_multi_color(&ctx->draw_list, nk_rect(r->x, r->y, r->w, r->h), |
| 10356 | r->left, r->top, r->right, r->bottom); |
| 10357 | } break; |
| 10358 | case NK_COMMAND_CIRCLE: { |
| 10359 | const struct nk_command_circle *c = (const struct nk_command_circle*)cmd; |
| 10360 | nk_draw_list_stroke_circle(&ctx->draw_list, nk_vec2((float)c->x + (float)c->w/2, |
| 10361 | (float)c->y + (float)c->h/2), (float)c->w/2, c->color, |
| 10362 | config->circle_segment_count, c->line_thickness); |
| 10363 | } break; |
| 10364 | case NK_COMMAND_CIRCLE_FILLED: { |
| 10365 | const struct nk_command_circle_filled *c = (const struct nk_command_circle_filled *)cmd; |
| 10366 | nk_draw_list_fill_circle(&ctx->draw_list, nk_vec2((float)c->x + (float)c->w/2, |
| 10367 | (float)c->y + (float)c->h/2), (float)c->w/2, c->color, |
| 10368 | config->circle_segment_count); |
| 10369 | } break; |
| 10370 | case NK_COMMAND_ARC: { |
| 10371 | const struct nk_command_arc *c = (const struct nk_command_arc*)cmd; |
| 10372 | nk_draw_list_path_line_to(&ctx->draw_list, nk_vec2(c->cx, c->cy)); |
| 10373 | nk_draw_list_path_arc_to(&ctx->draw_list, nk_vec2(c->cx, c->cy), c->r, |
| 10374 | c->a[0], c->a[1], config->arc_segment_count); |
| 10375 | nk_draw_list_path_stroke(&ctx->draw_list, c->color, NK_STROKE_CLOSED, c->line_thickness); |
| 10376 | } break; |
| 10377 | case NK_COMMAND_ARC_FILLED: { |
nothing calls this directly
no test coverage detected