Cleanup: Make access to widget triangle defines explicit

E.g. the vertices created for each of the defines would require a
certain offset. If you don't know what to look for, finding out about
this is pretty difficult. Make them easily searchable instead.
This commit is contained in:
Julian Eisel
2018-04-15 21:32:04 +02:00
parent 7c02008e74
commit 4b080ff18f
2 changed files with 21 additions and 7 deletions

View File

@@ -221,8 +221,22 @@ static const uint g_shape_preset_hold_action_face[2][3] = {{2, 0, 1}, {3, 5, 4}}
**/
/* offset in triavec[] in shader per type */
static const int tria_ofs[ROUNDBOX_TRIA_MAX] = {0, 0, 6, 22, 28, 34};
static const int tria_vcount[ROUNDBOX_TRIA_MAX] = {0, 3, 16, 3, 6, 3};
static const int tria_ofs[ROUNDBOX_TRIA_MAX] = {
[ROUNDBOX_TRIA_NONE] = 0,
[ROUNDBOX_TRIA_ARROWS] = 0,
[ROUNDBOX_TRIA_SCROLL] = 6,
[ROUNDBOX_TRIA_MENU] = 22,
[ROUNDBOX_TRIA_CHECK] = 28,
[ROUNDBOX_TRIA_HOLD_ACTION_ARROW] = 34,
};
static const int tria_vcount[ROUNDBOX_TRIA_MAX] = {
[ROUNDBOX_TRIA_NONE] = 0,
[ROUNDBOX_TRIA_ARROWS] = 3,
[ROUNDBOX_TRIA_SCROLL] = 16,
[ROUNDBOX_TRIA_MENU] = 3,
[ROUNDBOX_TRIA_CHECK] = 6,
[ROUNDBOX_TRIA_HOLD_ACTION_ARROW] = 3,
};
static struct {
Gwn_Batch *roundbox_widget[ROUNDBOX_TRIA_MAX];