Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <eiseljulian@gmail.com>2018-04-15 22:32:04 +0300
committerJulian Eisel <eiseljulian@gmail.com>2018-04-15 22:36:21 +0300
commit4b080ff18f4cdfc8f10734b928f4389737b6d487 (patch)
tree603a0f6faa04d77745037e8469622e8415a3de7a /source/blender/editors
parent7c02008e74a5dc4b663fcf8eb18b6baac6ed3bb2 (diff)
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.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/interface_widgets.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index e2fd903243a..d72e59beb91 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -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];