Renamed variables, index is the singular of indices

This commit is contained in:
Sam Lantinga 2022-10-18 08:40:03 -07:00
parent 965ba1e097
commit aefc6b5bb5
4 changed files with 37 additions and 37 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);