diff options
author | Marek Olšák <[email protected]> | 2016-12-24 22:07:00 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-01-05 18:30:00 +0100 |
commit | a57e071e9ec341d094df0cdc36d18326b61ffd21 (patch) | |
tree | 7e7d0b823997c8b34752e5a73471e552fbeef3a1 | |
parent | e8bb97ce30051b999a4a69c9b27884daeb8d71e6 (diff) |
gallium/hud: allow more data sources per pane
Reviewed-by: Nicolai Hähnle <[email protected]>
-rw-r--r-- | src/gallium/auxiliary/hud/hud_context.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c index 9b00591bd84..3299b90bb31 100644 --- a/src/gallium/auxiliary/hud/hud_context.c +++ b/src/gallium/auxiliary/hud/hud_context.c @@ -813,23 +813,25 @@ hud_pane_add_graph(struct hud_pane *pane, struct hud_graph *gr) {0, 1, 1}, {1, 0, 1}, {1, 1, 0}, - {0.5, 0.5, 1}, - {0.5, 0.5, 0.5}, + {0.5, 1, 0.5}, + {1, 0.5, 0.5}, + {0.5, 1, 1}, + {1, 0.5, 1}, + {1, 1, 0.5}, + {0, 0.5, 0}, + {0.5, 0, 0}, + {0, 0.5, 0.5}, + {0.5, 0, 0.5}, + {0.5, 0.5, 0}, }; - char *name = gr->name; + unsigned color = pane->num_graphs % ARRAY_SIZE(colors); - /* replace '-' with a space */ - while (*name) { - if (*name == '-') - *name = ' '; - name++; - } + strip_hyphens(gr->name); - assert(pane->num_graphs < ARRAY_SIZE(colors)); gr->vertices = MALLOC(pane->max_num_vertices * sizeof(float) * 2); - gr->color[0] = colors[pane->num_graphs][0]; - gr->color[1] = colors[pane->num_graphs][1]; - gr->color[2] = colors[pane->num_graphs][2]; + gr->color[0] = colors[color][0]; + gr->color[1] = colors[color][1]; + gr->color[2] = colors[color][2]; gr->pane = pane; LIST_ADDTAIL(&gr->head, &pane->graph_list); pane->num_graphs++; |