[Bf-blender-cvs] [1b65ec0a9b9] master: GPencil: Cleanup - Rename annotation drawing function names
Antonioya
noreply at git.blender.org
Sun Apr 28 20:14:30 CEST 2019
Commit: 1b65ec0a9b9be2aef7db88be3c6deaaa135ab382
Author: Antonioya
Date: Sun Apr 28 20:14:20 2019 +0200
Branches: master
https://developer.blender.org/rB1b65ec0a9b9be2aef7db88be3c6deaaa135ab382
GPencil: Cleanup - Rename annotation drawing function names
Actually, the static functions had the same name used for grease pencil.
Now, the annotation functions have a different prefix.
===================================================================
M source/blender/editors/gpencil/annotate_draw.c
===================================================================
diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c
index 84dc29afab3..9cd1cf91476 100644
--- a/source/blender/editors/gpencil/annotate_draw.c
+++ b/source/blender/editors/gpencil/annotate_draw.c
@@ -91,12 +91,12 @@ typedef enum eDrawStrokeFlags {
/* ----- Tool Buffer Drawing ------ */
/* draw stroke defined in buffer (simple ogl lines/points for now, as dotted lines) */
-static void gp_draw_stroke_buffer(const tGPspoint *points,
- int totpoints,
- short thickness,
- short dflag,
- short sflag,
- float ink[4])
+static void annotation_draw_stroke_buffer(const tGPspoint *points,
+ int totpoints,
+ short thickness,
+ short dflag,
+ short sflag,
+ float ink[4])
{
int draw_points = 0;
@@ -181,7 +181,7 @@ static void gp_draw_stroke_buffer(const tGPspoint *points,
/* --------- 2D Stroke Drawing Helpers --------- */
/* change in parameter list */
-static void gp_calc_2d_stroke_fxy(
+static void annotation_calc_2d_stroke_fxy(
const float pt[3], short sflag, int offsx, int offsy, int winx, int winy, float r_co[2])
{
if (sflag & GP_STROKE_2DSPACE) {
@@ -207,15 +207,15 @@ static void gp_calc_2d_stroke_fxy(
/* ----- Existing Strokes Drawing (3D and Point) ------ */
/* draw a given stroke - just a single dot (only one point) */
-static void gp_draw_stroke_point(const bGPDspoint *points,
- short thickness,
- short UNUSED(dflag),
- short sflag,
- int offsx,
- int offsy,
- int winx,
- int winy,
- const float ink[4])
+static void annotation_draw_stroke_point(const bGPDspoint *points,
+ short thickness,
+ short UNUSED(dflag),
+ short sflag,
+ int offsx,
+ int offsy,
+ int winx,
+ int winy,
+ const float ink[4])
{
const bGPDspoint *pt = points;
@@ -234,7 +234,7 @@ static void gp_draw_stroke_point(const bGPDspoint *points,
/* get 2D coordinates of point */
float co[3] = {0.0f};
- gp_calc_2d_stroke_fxy(fpt, sflag, offsx, offsy, winx, winy, co);
+ annotation_calc_2d_stroke_fxy(fpt, sflag, offsx, offsy, winx, winy, co);
copy_v3_v3(fpt, co);
}
@@ -252,12 +252,12 @@ static void gp_draw_stroke_point(const bGPDspoint *points,
}
/* draw a given stroke in 3d (i.e. in 3d-space), using simple ogl lines */
-static void gp_draw_stroke_3d(const bGPDspoint *points,
- int totpoints,
- short thickness,
- short UNUSED(sflag),
- const float ink[4],
- bool cyclic)
+static void annotation_draw_stroke_3d(const bGPDspoint *points,
+ int totpoints,
+ short thickness,
+ short UNUSED(sflag),
+ const float ink[4],
+ bool cyclic)
{
float curpressure = points[0].pressure;
float cyclic_fpt[3];
@@ -336,16 +336,16 @@ static void gp_draw_stroke_3d(const bGPDspoint *points,
/* ----- Fancy 2D-Stroke Drawing ------ */
/* draw a given stroke in 2d */
-static void gp_draw_stroke_2d(const bGPDspoint *points,
- int totpoints,
- short thickness_s,
- short dflag,
- short sflag,
- int offsx,
- int offsy,
- int winx,
- int winy,
- const float ink[4])
+static void annotation_draw_stroke_2d(const bGPDspoint *points,
+ int totpoints,
+ short thickness_s,
+ short dflag,
+ short sflag,
+ int offsx,
+ int offsy,
+ int winx,
+ int winy,
+ const float ink[4])
{
/* otherwise thickness is twice that of the 3D view */
float thickness = (float)thickness_s * 0.5f;
@@ -374,7 +374,7 @@ static void gp_draw_stroke_2d(const bGPDspoint *points,
immBegin(GPU_PRIM_TRI_STRIP, totpoints * 2 + 4);
/* get x and y coordinates from first point */
- gp_calc_2d_stroke_fxy(&points->x, sflag, offsx, offsy, winx, winy, s0);
+ annotation_calc_2d_stroke_fxy(&points->x, sflag, offsx, offsy, winx, winy, s0);
for (i = 0, pt1 = points, pt2 = points + 1; i < (totpoints - 1); i++, pt1++, pt2++) {
float t0[2], t1[2]; /* tessellated coordinates */
@@ -384,7 +384,7 @@ static void gp_draw_stroke_2d(const bGPDspoint *points,
/* Get x and y coordinates from point2
* (point1 has already been computed in previous iteration). */
- gp_calc_2d_stroke_fxy(&pt2->x, sflag, offsx, offsy, winx, winy, s1);
+ annotation_calc_2d_stroke_fxy(&pt2->x, sflag, offsx, offsy, winx, winy, s1);
/* calculate gradient and normal - 'angle'=(ny/nx) */
m1[1] = s1[1] - s0[1];
@@ -513,7 +513,7 @@ static void gp_draw_stroke_2d(const bGPDspoint *points,
/* ----- Strokes Drawing ------ */
/* Helper for doing all the checks on whether a stroke can be drawn */
-static bool gp_can_draw_stroke(const bGPDstroke *gps, const int dflag)
+static bool annotation_can_draw_stroke(const bGPDstroke *gps, const int dflag)
{
/* skip stroke if it isn't in the right display space for this drawing context */
/* 1) 3D Strokes */
@@ -550,22 +550,22 @@ static bool gp_can_draw_stroke(const bGPDstroke *gps, const int dflag)
}
/* draw a set of strokes */
-static void gp_draw_strokes(bGPdata *UNUSED(gpd),
- bGPDlayer *UNUSED(gpl),
- const bGPDframe *gpf,
- int offsx,
- int offsy,
- int winx,
- int winy,
- int dflag,
- short lthick,
- const float color[4])
+static void annotation_draw_strokes(bGPdata *UNUSED(gpd),
+ bGPDlayer *UNUSED(gpl),
+ const bGPDframe *gpf,
+ int offsx,
+ int offsy,
+ int winx,
+ int winy,
+ int dflag,
+ short lthick,
+ const float color[4])
{
GPU_enable_program_point_size();
for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
/* check if stroke can be drawn */
- if (gp_can_draw_stroke(gps, dflag) == false) {
+ if (annotation_can_draw_stroke(gps, dflag) == false) {
continue;
}
@@ -586,11 +586,11 @@ static void gp_draw_strokes(bGPdata *UNUSED(gpd),
/* 3D Lines - OpenGL primitives-based */
if (gps->totpoints == 1) {
- gp_draw_stroke_point(
+ annotation_draw_stroke_point(
gps->points, lthick, dflag, gps->flag, offsx, offsy, winx, winy, color);
}
else {
- gp_draw_stroke_3d(
+ annotation_draw_stroke_3d(
gps->points, gps->totpoints, lthick, gps->flag, color, gps->flag & GP_STROKE_CYCLIC);
}
@@ -604,20 +604,20 @@ static void gp_draw_strokes(bGPdata *UNUSED(gpd),
else {
/* 2D Strokes... */
if (gps->totpoints == 1) {
- gp_draw_stroke_point(
+ annotation_draw_stroke_point(
gps->points, lthick, dflag, gps->flag, offsx, offsy, winx, winy, color);
}
else {
- gp_draw_stroke_2d(gps->points,
- gps->totpoints,
- lthick,
- dflag,
- gps->flag,
- offsx,
- offsy,
- winx,
- winy,
- color);
+ annotation_draw_stroke_2d(gps->points,
+ gps->totpoints,
+ lthick,
+ dflag,
+ gps->flag,
+ offsx,
+ offsy,
+ winx,
+ winy,
+ color);
}
}
}
@@ -626,16 +626,16 @@ static void gp_draw_strokes(bGPdata *UNUSED(gpd),
}
/* Draw selected verts for strokes being edited */
-static void gp_draw_strokes_edit(bGPdata *gpd,
- bGPDlayer *gpl,
- const bGPDframe *gpf,
- int offsx,
- int offsy,
- int winx,
- int winy,
- short dflag,
- short UNUSED(lflag),
- float alpha)
+static void annotation_draw_strokes_edi
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list