From a207c1cdaf11864a413c5de3ade93f85a592b3cb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 14 Dec 2021 18:35:23 +1100 Subject: Cleanup: resolve parameter mis-matches in doc-strings Renamed or removed parameters which no longer exist. --- source/blender/gpu/GPU_immediate_util.h | 10 ++--- source/blender/gpu/intern/gpu_immediate_util.c | 56 +++++++++++++------------- 2 files changed, 33 insertions(+), 33 deletions(-) (limited to 'source/blender/gpu') diff --git a/source/blender/gpu/GPU_immediate_util.h b/source/blender/gpu/GPU_immediate_util.h index 25672489612..102bd6c284c 100644 --- a/source/blender/gpu/GPU_immediate_util.h +++ b/source/blender/gpu/GPU_immediate_util.h @@ -61,7 +61,7 @@ void imm_cpack(uint x); * \param shdr_pos: The vertex attribute number for position. * \param x: Horizontal center. * \param y: Vertical center. - * \param rad: The circle's radius. + * \param radius: The circle's radius. * \param nsegments: The number of segments to use in drawing (more = smoother). */ void imm_draw_circle_wire_2d(uint shdr_pos, float x, float y, float radius, int nsegments); @@ -72,15 +72,15 @@ void imm_draw_circle_wire_2d(uint shdr_pos, float x, float y, float radius, int * \param shdr_pos: The vertex attribute number for position. * \param x: Horizontal center. * \param y: Vertical center. - * \param rad: The circle's radius. + * \param radius: The circle's radius. * \param nsegments: The number of segments to use in drawing (more = smoother). */ void imm_draw_circle_fill_2d(uint shdr_pos, float x, float y, float radius, int nsegments); void imm_draw_circle_wire_aspect_2d( - uint shdr_pos, float x, float y, float rad_x, float rad_y, int nsegments); + uint shdr_pos, float x, float y, float radius_x, float radius_y, int nsegments); void imm_draw_circle_fill_aspect_2d( - uint shdr_pos, float x, float y, float rad_x, float rad_y, int nsegments); + uint shdr_pos, float x, float y, float radius_x, float radius_y, int nsegments); /** * Use this version when #GPUVertFormat has a vec3 position. @@ -169,7 +169,7 @@ void imm_draw_cylinder_wire_3d( void imm_draw_cylinder_fill_3d( uint pos, float base, float top, float height, int slices, int stacks); -void imm_drawcircball(const float cent[3], float rad, const float tmat[4][4], uint pos); +void imm_drawcircball(const float cent[3], float radius, const float tmat[4][4], uint pos); #ifdef __cplusplus } #endif diff --git a/source/blender/gpu/intern/gpu_immediate_util.c b/source/blender/gpu/intern/gpu_immediate_util.c index 4ef7492428e..37a423d41a0 100644 --- a/source/blender/gpu/intern/gpu_immediate_util.c +++ b/source/blender/gpu/intern/gpu_immediate_util.c @@ -152,44 +152,44 @@ static void imm_draw_circle(GPUPrimType prim_type, const uint shdr_pos, float x, float y, - float rad_x, - float rad_y, + float radius_x, + float radius_y, int nsegments) { immBegin(prim_type, nsegments); for (int i = 0; i < nsegments; i++) { const float angle = (float)(2 * M_PI) * ((float)i / (float)nsegments); - immVertex2f(shdr_pos, x + (rad_x * cosf(angle)), y + (rad_y * sinf(angle))); + immVertex2f(shdr_pos, x + (radius_x * cosf(angle)), y + (radius_y * sinf(angle))); } immEnd(); } -void imm_draw_circle_wire_2d(uint shdr_pos, float x, float y, float rad, int nsegments) +void imm_draw_circle_wire_2d(uint shdr_pos, float x, float y, float radius, int nsegments) { - imm_draw_circle(GPU_PRIM_LINE_LOOP, shdr_pos, x, y, rad, rad, nsegments); + imm_draw_circle(GPU_PRIM_LINE_LOOP, shdr_pos, x, y, radius, radius, nsegments); } -void imm_draw_circle_fill_2d(uint shdr_pos, float x, float y, float rad, int nsegments) +void imm_draw_circle_fill_2d(uint shdr_pos, float x, float y, float radius, int nsegments) { - imm_draw_circle(GPU_PRIM_TRI_FAN, shdr_pos, x, y, rad, rad, nsegments); + imm_draw_circle(GPU_PRIM_TRI_FAN, shdr_pos, x, y, radius, radius, nsegments); } void imm_draw_circle_wire_aspect_2d( - uint shdr_pos, float x, float y, float rad_x, float rad_y, int nsegments) + uint shdr_pos, float x, float y, float radius_x, float radius_y, int nsegments) { - imm_draw_circle(GPU_PRIM_LINE_LOOP, shdr_pos, x, y, rad_x, rad_y, nsegments); + imm_draw_circle(GPU_PRIM_LINE_LOOP, shdr_pos, x, y, radius_x, radius_y, nsegments); } void imm_draw_circle_fill_aspect_2d( - uint shdr_pos, float x, float y, float rad_x, float rad_y, int nsegments) + uint shdr_pos, float x, float y, float radius_x, float radius_y, int nsegments) { - imm_draw_circle(GPU_PRIM_TRI_FAN, shdr_pos, x, y, rad_x, rad_y, nsegments); + imm_draw_circle(GPU_PRIM_TRI_FAN, shdr_pos, x, y, radius_x, radius_y, nsegments); } static void imm_draw_circle_partial(GPUPrimType prim_type, uint pos, float x, float y, - float rad, + float radius, int nsegments, float start, float sweep) @@ -203,15 +203,15 @@ static void imm_draw_circle_partial(GPUPrimType prim_type, const float angle = interpf(angle_start, angle_end, ((float)i / (float)(nsegments - 1))); const float angle_sin = sinf(angle); const float angle_cos = cosf(angle); - immVertex2f(pos, x + rad * angle_cos, y + rad * angle_sin); + immVertex2f(pos, x + radius * angle_cos, y + radius * angle_sin); } immEnd(); } void imm_draw_circle_partial_wire_2d( - uint pos, float x, float y, float rad, int nsegments, float start, float sweep) + uint pos, float x, float y, float radius, int nsegments, float start, float sweep) { - imm_draw_circle_partial(GPU_PRIM_LINE_STRIP, pos, x, y, rad, nsegments, start, sweep); + imm_draw_circle_partial(GPU_PRIM_LINE_STRIP, pos, x, y, radius, nsegments, start, sweep); } static void imm_draw_disk_partial(GPUPrimType prim_type, @@ -257,29 +257,29 @@ void imm_draw_disk_partial_fill_2d(uint pos, } static void imm_draw_circle_3D( - GPUPrimType prim_type, uint pos, float x, float y, float rad, int nsegments) + GPUPrimType prim_type, uint pos, float x, float y, float radius, int nsegments) { immBegin(prim_type, nsegments); for (int i = 0; i < nsegments; i++) { float angle = (float)(2 * M_PI) * ((float)i / (float)nsegments); - immVertex3f(pos, x + rad * cosf(angle), y + rad * sinf(angle), 0.0f); + immVertex3f(pos, x + radius * cosf(angle), y + radius * sinf(angle), 0.0f); } immEnd(); } -void imm_draw_circle_wire_3d(uint pos, float x, float y, float rad, int nsegments) +void imm_draw_circle_wire_3d(uint pos, float x, float y, float radius, int nsegments) { - imm_draw_circle_3D(GPU_PRIM_LINE_LOOP, pos, x, y, rad, nsegments); + imm_draw_circle_3D(GPU_PRIM_LINE_LOOP, pos, x, y, radius, nsegments); } -void imm_draw_circle_dashed_3d(uint pos, float x, float y, float rad, int nsegments) +void imm_draw_circle_dashed_3d(uint pos, float x, float y, float radius, int nsegments) { - imm_draw_circle_3D(GPU_PRIM_LINES, pos, x, y, rad, nsegments / 2); + imm_draw_circle_3D(GPU_PRIM_LINES, pos, x, y, radius, nsegments / 2); } -void imm_draw_circle_fill_3d(uint pos, float x, float y, float rad, int nsegments) +void imm_draw_circle_fill_3d(uint pos, float x, float y, float radius, int nsegments) { - imm_draw_circle_3D(GPU_PRIM_TRI_FAN, pos, x, y, rad, nsegments); + imm_draw_circle_3D(GPU_PRIM_TRI_FAN, pos, x, y, radius, nsegments); } void imm_draw_box_wire_2d(uint pos, float x1, float y1, float x2, float y2) @@ -538,7 +538,7 @@ void imm_draw_cylinder_fill_3d( static void circball_array_fill(const float verts[CIRCLE_RESOL][3], const float cent[3], - float rad, + const float radius, const float tmat[4][4]) { /* 32 values of sin function (still same result!) */ @@ -562,8 +562,8 @@ static void circball_array_fill(const float verts[CIRCLE_RESOL][3], float vx[3], vy[3]; float *viter = (float *)verts; - mul_v3_v3fl(vx, tmat[0], rad); - mul_v3_v3fl(vy, tmat[1], rad); + mul_v3_v3fl(vx, tmat[0], radius); + mul_v3_v3fl(vy, tmat[1], radius); for (uint a = 0; a < CIRCLE_RESOL; a++, viter += 3) { viter[0] = cent[0] + sinval[a] * vx[0] + cosval[a] * vy[0]; @@ -572,11 +572,11 @@ static void circball_array_fill(const float verts[CIRCLE_RESOL][3], } } -void imm_drawcircball(const float cent[3], float rad, const float tmat[4][4], uint pos) +void imm_drawcircball(const float cent[3], float radius, const float tmat[4][4], uint pos) { float verts[CIRCLE_RESOL][3]; - circball_array_fill(verts, cent, rad, tmat); + circball_array_fill(verts, cent, radius, tmat); immBegin(GPU_PRIM_LINE_LOOP, CIRCLE_RESOL); for (int i = 0; i < CIRCLE_RESOL; i++) { -- cgit v1.2.3