diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-10-04 10:31:17 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-10-04 10:31:17 +0300 |
commit | 52f74923e6957b4dc6e7b37514d864588b922ae6 (patch) | |
tree | 2db78fbec9d41673797e9a9fca28c0692a7b488d /source/blender/editors | |
parent | 61218546cb79dbae09a6102a5695878ea96d0045 (diff) |
Fix (coverity-reported) broken 'transform helpers' drawing.
E.g. trackball-arrows (R-R) were no more visible.
Caused by wrong cast of an array from int to float, we need an int version of those helpers (`glTranslatenxv`) too.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/BIF_gl.h | 4 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.c | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/editors/include/BIF_gl.h b/source/blender/editors/include/BIF_gl.h index e2a24b9fed7..58da0b5d695 100644 --- a/source/blender/editors/include/BIF_gl.h +++ b/source/blender/editors/include/BIF_gl.h @@ -87,11 +87,15 @@ void cpack(unsigned int x); #define GLA_PIXEL_OFS 0.375f +BLI_INLINE void glTranslate3iv(const int vec[3]) { glTranslatef(UNPACK3_EX((const float), vec, )); } +BLI_INLINE void glTranslate2iv(const int vec[2]) { glTranslatef(UNPACK2_EX((const float), vec, ), 0.0f); } BLI_INLINE void glTranslate3fv(const float vec[3]) { glTranslatef(UNPACK3(vec)); } BLI_INLINE void glTranslate2fv(const float vec[2]) { glTranslatef(UNPACK2(vec), 0.0f); } BLI_INLINE void glTranslate3dv(const double vec[3]) { glTranslated(UNPACK3(vec)); } BLI_INLINE void glTranslate2dv(const double vec[2]) { glTranslated(UNPACK2(vec), 0.0f); } +BLI_INLINE void glScale3iv(const int vec[3]) { glTranslatef(UNPACK3_EX((const float), vec, )); } +BLI_INLINE void glScale2iv(const int vec[2]) { glTranslatef(UNPACK2_EX((const float), vec, ), 0.0f); } BLI_INLINE void glScale3fv(const float vec[3]) { glScalef(UNPACK3(vec)); } BLI_INLINE void glScale2fv(const float vec[2]) { glScalef(UNPACK2(vec), 0.0); } BLI_INLINE void glScale3dv(const double vec[3]) { glScaled(UNPACK3(vec)); } diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 6931efdbd6a..9aa22ed737f 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1720,7 +1720,7 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata) glVertex2fv(cent); glEnd(); - glTranslate2fv((const float *)mval); + glTranslate2iv(mval); glRotatef(-RAD2DEGF(atan2f(cent[0] - t->mval[0], cent[1] - t->mval[1])), 0, 0, 1); setlinestyle(0); @@ -1732,7 +1732,7 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata) case HLP_HARROW: UI_ThemeColor(TH_VIEW_OVERLAY); - glTranslate2fv((const float *)mval); + glTranslate2iv(mval); glLineWidth(3.0); drawArrow(RIGHT, 5, 10, 5); @@ -1742,7 +1742,7 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata) case HLP_VARROW: UI_ThemeColor(TH_VIEW_OVERLAY); - glTranslate2fv((const float *)mval); + glTranslate2iv(mval); glLineWidth(3.0); drawArrow(UP, 5, 10, 5); @@ -1793,7 +1793,7 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata) unsigned char col[3], col2[3]; UI_GetThemeColor3ubv(TH_GRID, col); - glTranslate2fv((const float *)mval); + glTranslate2iv(mval); glLineWidth(3.0); |