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:
authorMike Erwin <significant.bit@gmail.com>2017-02-08 09:43:53 +0300
committerJulian Eisel <eiseljulian@gmail.com>2017-02-11 02:42:55 +0300
commitae3646cd9f28ed034960c15c4f5b887505c9a330 (patch)
tree5d5b453f755f94247365ff3696b7d4873e3f4b41 /source/blender/editors/animation/anim_channels_defines.c
parentef600e8ccfe7f596dd1365c411bb06bbb13de804 (diff)
cleanup from recent commits
coding style, float literals Converted some (expr / literal) to (expr * literal) where it does not impact readability. Simplified a few function calls.
Diffstat (limited to 'source/blender/editors/animation/anim_channels_defines.c')
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 44bed4999be..f41c4741eff 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -143,15 +143,14 @@ static void acf_generic_dataexpand_backdrop(bAnimContext *ac, bAnimListElem *ale
short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
float color[3];
- VertexFormat *format = immVertexFormat();
- unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
-
+ unsigned pos = add_attrib(immVertexFormat(), "pos", GL_FLOAT, 2, KEEP_FLOAT);
+
/* set backdrop drawing color */
acf->get_backdrop_color(ac, ale, color);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformColor3fv(color);
-
+
/* no rounded corner - just rectangular box */
immRectf(pos, offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc);
@@ -233,8 +232,7 @@ static void acf_generic_channel_backdrop(bAnimContext *ac, bAnimListElem *ale, f
short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
float color[3];
- VertexFormat *format = immVertexFormat();
- unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
+ unsigned pos = add_attrib(immVertexFormat(), "pos", GL_FLOAT, 2, KEEP_FLOAT);
/* set backdrop drawing color */
acf->get_backdrop_color(ac, ale, color);
@@ -3864,8 +3862,7 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float
/* for F-Curves, draw color-preview of curve behind checkbox */
if (ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE)) {
FCurve *fcu = (FCurve *)ale->data;
- VertexFormat *format = immVertexFormat();
- unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
+ unsigned pos = add_attrib(immVertexFormat(), "pos", GL_FLOAT, 2, KEEP_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
@@ -3921,15 +3918,14 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float
/* draw red underline if channel is disabled */
if (ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE) && (ale->flag & FCURVE_DISABLED)) {
- VertexFormat *format = immVertexFormat();
- unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
+ unsigned pos = add_attrib(immVertexFormat(), "pos", GL_FLOAT, 2, KEEP_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
/* FIXME: replace hardcoded color here, and check on extents! */
immUniformColor3f(1.0f, 0.0f, 0.0f);
- glLineWidth(2.0);
+ glLineWidth(2.0f);
immBegin(GL_LINES, 2);
immVertex2f(pos, (float)offset, yminc);
@@ -3950,8 +3946,7 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float
short draw_sliders = 0;
float ymin_ofs = 0.0f;
float color[3];
- VertexFormat *format = immVertexFormat();
- unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
+ unsigned pos = add_attrib(immVertexFormat(), "pos", GL_FLOAT, 2, KEEP_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);