From aefc6b5bb57cd3aadc6964e26f2caac1d1c5f624 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 18 Oct 2022 08:40:03 -0700 Subject: [PATCH] Renamed variables, index is the singular of indices --- src/render/SDL_render.c | 48 ++++++++++++------------- src/render/SDL_sysrender.h | 2 +- src/render/opengl/SDL_render_gl.c | 12 +++---- src/render/opengles2/SDL_render_gles2.c | 12 +++---- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 7dd19858a..d2d94f249 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -551,8 +551,8 @@ QueueCmdFillRects(SDL_Renderer *renderer, const SDL_FRect * rects, const int cou const int num_vertices = 4 * count; const int num_indices = 6 * count; const int size_indices = 4; - int cur_indice = 0; - const int *rect_indice_list = renderer->rect_indice_list; + int cur_index = 0; + const int *rect_index_order = renderer->rect_index_order; for (i = 0; i < count; ++i) { float minx, miny, maxx, maxy; @@ -571,13 +571,13 @@ QueueCmdFillRects(SDL_Renderer *renderer, const SDL_FRect * rects, const int cou *ptr_xy++ = minx; *ptr_xy++ = maxy; - *ptr_indices++ = cur_indice + rect_indice_list[0]; - *ptr_indices++ = cur_indice + rect_indice_list[1]; - *ptr_indices++ = cur_indice + rect_indice_list[2]; - *ptr_indices++ = cur_indice + rect_indice_list[3]; - *ptr_indices++ = cur_indice + rect_indice_list[4]; - *ptr_indices++ = cur_indice + rect_indice_list[5]; - cur_indice += 4; + *ptr_indices++ = cur_index + rect_index_order[0]; + *ptr_indices++ = cur_index + rect_index_order[1]; + *ptr_indices++ = cur_index + rect_index_order[2]; + *ptr_indices++ = cur_index + rect_index_order[3]; + *ptr_indices++ = cur_index + rect_index_order[4]; + *ptr_indices++ = cur_index + rect_index_order[5]; + cur_index += 4; } retval = renderer->QueueGeometry(renderer, cmd, NULL, @@ -1064,13 +1064,13 @@ SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags) renderer->dpi_scale.y = 1.0f; /* Default value, if not specified by the renderer back-end */ - if (renderer->rect_indice_list[0] == 0 && renderer->rect_indice_list[1] == 0) { - renderer->rect_indice_list[0] = 0; - renderer->rect_indice_list[1] = 1; - renderer->rect_indice_list[2] = 2; - renderer->rect_indice_list[3] = 0; - renderer->rect_indice_list[4] = 2; - renderer->rect_indice_list[5] = 3; + if (renderer->rect_index_order[0] == 0 && renderer->rect_index_order[1] == 0) { + renderer->rect_index_order[0] = 0; + renderer->rect_index_order[1] = 1; + renderer->rect_index_order[2] = 2; + renderer->rect_index_order[3] = 0; + renderer->rect_index_order[4] = 2; + renderer->rect_index_order[5] = 3; } /* new textures start at zero, so we start at 1 so first render doesn't flush by accident. */ @@ -3125,7 +3125,7 @@ SDL_RenderDrawLinesF(SDL_Renderer * renderer, int num_vertices = 4 * count; int num_indices = 0; const int size_indices = 4; - int cur_indice = -4; + int cur_index = -4; const int is_looping = (points[0].x == points[count - 1].x && points[0].y == points[count - 1].y); SDL_FPoint p; /* previous point */ p.x = p.y = 0.0f; @@ -3152,9 +3152,9 @@ SDL_RenderDrawLinesF(SDL_Renderer * renderer, *ptr_xy++ = q.y + scale_y; #define ADD_TRIANGLE(i1, i2, i3) \ - *ptr_indices++ = cur_indice + i1; \ - *ptr_indices++ = cur_indice + i2; \ - *ptr_indices++ = cur_indice + i3; \ + *ptr_indices++ = cur_index + i1; \ + *ptr_indices++ = cur_index + i2; \ + *ptr_indices++ = cur_index + i3; \ num_indices += 3; \ /* closed polyline, donĀ“t draw twice the point */ @@ -3166,7 +3166,7 @@ SDL_RenderDrawLinesF(SDL_Renderer * renderer, /* first point only, no segment */ if (i == 0) { p = q; - cur_indice += 4; + cur_index += 4; continue; } @@ -3216,7 +3216,7 @@ SDL_RenderDrawLinesF(SDL_Renderer * renderer, } p = q; - cur_indice += 4; + cur_index += 4; } retval = QueueCmdGeometry(renderer, NULL, @@ -3534,7 +3534,7 @@ SDL_RenderCopyF(SDL_Renderer * renderer, SDL_Texture * texture, float uv[8]; const int uv_stride = 2 * sizeof (float); const int num_vertices = 4; - const int *indices = renderer->rect_indice_list; + const int *indices = renderer->rect_index_order; const int num_indices = 6; const int size_indices = 4; float minu, minv, maxu, maxv; @@ -3682,7 +3682,7 @@ SDL_RenderCopyExF(SDL_Renderer * renderer, SDL_Texture * texture, float uv[8]; const int uv_stride = 2 * sizeof (float); const int num_vertices = 4; - const int *indices = renderer->rect_indice_list; + const int *indices = renderer->rect_index_order; const int num_indices = 6; const int size_indices = 4; float minu, minv, maxu, maxv; diff --git a/src/render/SDL_sysrender.h b/src/render/SDL_sysrender.h index fb411f4ca..dc8be4674 100644 --- a/src/render/SDL_sysrender.h +++ b/src/render/SDL_sysrender.h @@ -249,7 +249,7 @@ struct SDL_Renderer SDL_RenderLineMethod line_method; /* List of triangle indices to draw rects */ - int rect_indice_list[6]; + int rect_index_order[6]; /* Remainder from scaled relative motion */ float xrel; diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index 96a37660f..4f6f1e5d5 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -1932,12 +1932,12 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_UYVY; #endif - renderer->rect_indice_list[0] = 0; - renderer->rect_indice_list[1] = 1; - renderer->rect_indice_list[2] = 3; - renderer->rect_indice_list[3] = 1; - renderer->rect_indice_list[4] = 3; - renderer->rect_indice_list[5] = 2; + renderer->rect_index_order[0] = 0; + renderer->rect_index_order[1] = 1; + renderer->rect_index_order[2] = 3; + renderer->rect_index_order[3] = 1; + renderer->rect_index_order[4] = 3; + renderer->rect_index_order[5] = 2; if (SDL_GL_ExtensionSupported("GL_EXT_framebuffer_object")) { data->GL_EXT_framebuffer_object_supported = SDL_TRUE; diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index 4112c1ad1..41bf300f4 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -2232,12 +2232,12 @@ GLES2_CreateRenderer(SDL_Window *window, Uint32 flags) } #endif - renderer->rect_indice_list[0] = 0; - renderer->rect_indice_list[1] = 1; - renderer->rect_indice_list[2] = 3; - renderer->rect_indice_list[3] = 1; - renderer->rect_indice_list[4] = 3; - renderer->rect_indice_list[5] = 2; + renderer->rect_index_order[0] = 0; + renderer->rect_index_order[1] = 1; + renderer->rect_index_order[2] = 3; + renderer->rect_index_order[3] = 1; + renderer->rect_index_order[4] = 3; + renderer->rect_index_order[5] = 2; /* Set up parameters for rendering */ data->glActiveTexture(GL_TEXTURE0);