diff options
author | Charlie Jolly <mistajolly@gmail.com> | 2018-12-05 21:48:27 +0300 |
---|---|---|
committer | Charlie Jolly <mistajolly@gmail.com> | 2018-12-07 14:45:48 +0300 |
commit | ad47b0236e32dc9a583a0d7209d8030bbb7c358e (patch) | |
tree | a68c61dc5bf051bfe14ab48276a7eba39d365c70 /source/blender/editors/gpencil/annotate_draw.c | |
parent | 942e9835a9acdc19164bf6b07796eace1548f3fd (diff) |
GP: Refactor coordinates to float
See: D4030
Differential Revision: https://developer.blender.org/D4036
Diffstat (limited to 'source/blender/editors/gpencil/annotate_draw.c')
-rw-r--r-- | source/blender/editors/gpencil/annotate_draw.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c index 1ef7e3883da..e6747856d1e 100644 --- a/source/blender/editors/gpencil/annotate_draw.c +++ b/source/blender/editors/gpencil/annotate_draw.c @@ -113,7 +113,7 @@ static void gp_draw_stroke_buffer( } GPUVertFormat *format = immVertexFormat(); - uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); + uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); const tGPspoint *pt = points; @@ -123,7 +123,7 @@ static void gp_draw_stroke_buffer( immBindBuiltinProgram(GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA); immUniformColor3fvAlpha(ink, ink[3]); immBegin(GPU_PRIM_POINTS, 1); - immVertex2iv(pos, &pt->x); + immVertex2fv(pos, &pt->x); } else { float oldpressure = points[0].pressure; @@ -143,7 +143,7 @@ static void gp_draw_stroke_buffer( if (fabsf(pt->pressure - oldpressure) > 0.2f) { /* need to have 2 points to avoid immEnd assert error */ if (draw_points < 2) { - immVertex2iv(pos, &(pt - 1)->x); + immVertex2fv(pos, &(pt - 1)->x); } immEnd(); @@ -154,7 +154,7 @@ static void gp_draw_stroke_buffer( /* need to roll-back one point to ensure that there are no gaps in the stroke */ if (i != 0) { - immVertex2iv(pos, &(pt - 1)->x); + immVertex2fv(pos, &(pt - 1)->x); draw_points++; } @@ -162,12 +162,12 @@ static void gp_draw_stroke_buffer( } /* now the point we want */ - immVertex2iv(pos, &pt->x); + immVertex2fv(pos, &pt->x); draw_points++; } /* need to have 2 points to avoid immEnd assert error */ if (draw_points < 2) { - immVertex2iv(pos, &(pt - 1)->x); + immVertex2fv(pos, &(pt - 1)->x); } } |