twn_lines: combine differently colored lines into same batch
This commit is contained in:
parent
e974194af0
commit
183dfa6be5
@ -68,7 +68,7 @@ void draw_line_3d(Vec3 start,
|
|||||||
struct LineVertex const v1 = { .position = finish, .color = color };
|
struct LineVertex const v1 = { .position = finish, .color = color };
|
||||||
|
|
||||||
/* 3d case, unordered depth based draw */
|
/* 3d case, unordered depth based draw */
|
||||||
struct LineBatchItemKey const key = { .color = color, .thickness = (uint8_t)(floorf(thickness)) };
|
struct LineBatchItemKey const key = { .thickness = (uint8_t)(floorf(thickness)) };
|
||||||
struct LineBatchItem *batch_p = hmgetp_null(ctx.line_batches, key);
|
struct LineBatchItem *batch_p = hmgetp_null(ctx.line_batches, key);
|
||||||
if (!batch_p) {
|
if (!batch_p) {
|
||||||
hmput(ctx.line_batches, key, ((struct LinePrimitive){.thickness = thickness, .color = color}));
|
hmput(ctx.line_batches, key, ((struct LinePrimitive){.thickness = thickness, .color = color}));
|
||||||
|
Loading…
Reference in New Issue
Block a user