mirror of https://github.com/encounter/SDL.git
Change 'size_indice' to 'size_indices'
This commit is contained in:
parent
bc2173baf9
commit
a8f89a01aa
|
@ -1484,7 +1484,7 @@ extern DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer,
|
|||
* \param num_vertices Number of vertices.
|
||||
* \param indices (optional) An array of indices into the 'vertices' arrays, if NULL all vertices will be rendered in sequential order.
|
||||
* \param num_indices Number of indices.
|
||||
* \param size_indice Indice size: 1 (byte), 2 (short), 4 (int)
|
||||
* \param size_indices Index size: 1 (byte), 2 (short), 4 (int)
|
||||
*
|
||||
* \return 0 on success, or -1 if the operation is not supported
|
||||
*/
|
||||
|
@ -1494,7 +1494,7 @@ extern DECLSPEC int SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer,
|
|||
const int *color, int color_stride,
|
||||
const float *uv, int uv_stride,
|
||||
int num_vertices,
|
||||
const void *indices, int num_indices, int size_indice);
|
||||
const void *indices, int num_indices, int size_indices);
|
||||
|
||||
/**
|
||||
* Read pixels from the current rendering target to an array of pixels.
|
||||
|
|
|
@ -579,7 +579,7 @@ QueueCmdGeometry(SDL_Renderer *renderer, SDL_Texture *texture,
|
|||
const int *color, int color_stride,
|
||||
const float *uv, int uv_stride,
|
||||
int num_vertices,
|
||||
const void *indices, int num_indices, int size_indice,
|
||||
const void *indices, int num_indices, int size_indices,
|
||||
float scale_x, float scale_y)
|
||||
{
|
||||
SDL_RenderCommand *cmd;
|
||||
|
@ -592,7 +592,7 @@ QueueCmdGeometry(SDL_Renderer *renderer, SDL_Texture *texture,
|
|||
if (cmd != NULL) {
|
||||
retval = renderer->QueueGeometry(renderer, cmd, texture,
|
||||
xy, xy_stride, color, color_stride, uv, uv_stride,
|
||||
num_vertices, indices, num_indices, size_indice,
|
||||
num_vertices, indices, num_indices, size_indices,
|
||||
scale_x, scale_y);
|
||||
if (retval < 0) {
|
||||
cmd->command = SDL_RENDERCMD_NO_OP;
|
||||
|
@ -3356,9 +3356,9 @@ SDL_RenderGeometry(SDL_Renderer *renderer,
|
|||
int color_stride = sizeof (SDL_Vertex);
|
||||
const float *uv = (const float *)((const Uint8 *)vertices + SDL_OFFSETOF(SDL_Vertex, tex_coord));
|
||||
int uv_stride = sizeof (SDL_Vertex);
|
||||
int size_indice = 4;
|
||||
int size_indices = 4;
|
||||
|
||||
return SDL_RenderGeometryRaw(renderer, texture, xy, xy_stride, color, color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indice);
|
||||
return SDL_RenderGeometryRaw(renderer, texture, xy, xy_stride, color, color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices);
|
||||
}
|
||||
|
||||
#if SDL_HAVE_RENDER_GEOMETRY
|
||||
|
@ -3432,7 +3432,7 @@ SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer,
|
|||
const int *color, int color_stride,
|
||||
const float *uv, int uv_stride,
|
||||
int num_vertices,
|
||||
const void *indices, int num_indices, int size_indice)
|
||||
const void *indices, int num_indices, int size_indices)
|
||||
{
|
||||
int i;
|
||||
int retval = 0;
|
||||
|
@ -3463,15 +3463,15 @@ SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer,
|
|||
int C = -1; /* Third vertex of current triangle */
|
||||
int C2 = -1; /* Last, vertex of previous triangle */
|
||||
|
||||
if (size_indice == 4) {
|
||||
if (size_indices == 4) {
|
||||
k0 = ((const Uint32 *)indices)[i];
|
||||
k1 = ((const Uint32 *)indices)[i + 1];
|
||||
k2 = ((const Uint32 *)indices)[i + 2];
|
||||
} else if (size_indice == 2) {
|
||||
} else if (size_indices == 2) {
|
||||
k0 = ((const Uint16 *)indices)[i];
|
||||
k1 = ((const Uint16 *)indices)[i + 1];
|
||||
k2 = ((const Uint16 *)indices)[i + 2];
|
||||
} else if (size_indice == 1) {
|
||||
} else if (size_indices == 1) {
|
||||
k0 = ((const Uint8 *)indices)[i];
|
||||
k1 = ((const Uint8 *)indices)[i + 1];
|
||||
k2 = ((const Uint8 *)indices)[i + 2];
|
||||
|
@ -3708,7 +3708,7 @@ SDL_RenderGeometryRaw(SDL_Renderer *renderer,
|
|||
const int *color, int color_stride,
|
||||
const float *uv, int uv_stride,
|
||||
int num_vertices,
|
||||
const void *indices, int num_indices, int size_indice)
|
||||
const void *indices, int num_indices, int size_indices)
|
||||
{
|
||||
#if SDL_HAVE_RENDER_GEOMETRY
|
||||
int i;
|
||||
|
@ -3746,11 +3746,11 @@ SDL_RenderGeometryRaw(SDL_Renderer *renderer,
|
|||
}
|
||||
|
||||
if (indices) {
|
||||
if (size_indice != 1 && size_indice != 2 && size_indice != 4) {
|
||||
return SDL_InvalidParamError("size_indice");
|
||||
if (size_indices != 1 && size_indice != 2 && size_indice != 4) {
|
||||
return SDL_InvalidParamError("size_indices");
|
||||
}
|
||||
} else {
|
||||
size_indice = 0;
|
||||
size_indices = 0;
|
||||
}
|
||||
|
||||
/* Don't draw while we're hidden */
|
||||
|
@ -3780,9 +3780,9 @@ SDL_RenderGeometryRaw(SDL_Renderer *renderer,
|
|||
if (indices) {
|
||||
for (i = 0; i < num_indices; ++i) {
|
||||
int j;
|
||||
if (size_indice == 4) {
|
||||
if (size_indices == 4) {
|
||||
j = ((const Uint32 *)indices)[i];
|
||||
} else if (size_indice == 2) {
|
||||
} else if (size_indices == 2) {
|
||||
j = ((const Uint16 *)indices)[i];
|
||||
} else {
|
||||
j = ((const Uint8 *)indices)[i];
|
||||
|
@ -3801,13 +3801,13 @@ SDL_RenderGeometryRaw(SDL_Renderer *renderer,
|
|||
if (renderer->info.flags & SDL_RENDERER_SOFTWARE) {
|
||||
return SDL_SW_RenderGeometryRaw(renderer, texture,
|
||||
xy, xy_stride, color, color_stride, uv, uv_stride, num_vertices,
|
||||
indices, num_indices, size_indice);
|
||||
indices, num_indices, size_indices);
|
||||
}
|
||||
|
||||
retval = QueueCmdGeometry(renderer, texture,
|
||||
xy, xy_stride, color, color_stride, uv, uv_stride,
|
||||
num_vertices,
|
||||
indices, num_indices, size_indice,
|
||||
indices, num_indices, size_indices,
|
||||
renderer->scale.x, renderer->scale.y);
|
||||
|
||||
return retval < 0 ? retval : FlushRenderCommandsIfNotBatching(renderer);
|
||||
|
|
|
@ -132,7 +132,7 @@ struct SDL_Renderer
|
|||
#if SDL_HAVE_RENDER_GEOMETRY
|
||||
int (*QueueGeometry) (SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture,
|
||||
const float *xy, int xy_stride, const int *color, int color_stride, const float *uv, int uv_stride,
|
||||
int num_vertices, const void *indices, int num_indices, int size_indice,
|
||||
int num_vertices, const void *indices, int num_indices, int size_indices,
|
||||
float scale_x, float scale_y);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1024,7 +1024,7 @@ D3D_QueueCopyEx(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * t
|
|||
static int
|
||||
D3D_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture,
|
||||
const float *xy, int xy_stride, const int *color, int color_stride, const float *uv, int uv_stride,
|
||||
int num_vertices, const void *indices, int num_indices, int size_indice,
|
||||
int num_vertices, const void *indices, int num_indices, int size_indices,
|
||||
float scale_x, float scale_y)
|
||||
{
|
||||
int i;
|
||||
|
@ -1041,11 +1041,11 @@ D3D_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *t
|
|||
int j;
|
||||
float *xy_;
|
||||
SDL_Color col_;
|
||||
if (size_indice == 4) {
|
||||
if (size_indices == 4) {
|
||||
j = ((const Uint32 *)indices)[i];
|
||||
} else if (size_indice == 2) {
|
||||
} else if (size_indices == 2) {
|
||||
j = ((const Uint16 *)indices)[i];
|
||||
} else if (size_indice == 1) {
|
||||
} else if (size_indices == 1) {
|
||||
j = ((const Uint8 *)indices)[i];
|
||||
} else {
|
||||
j = i;
|
||||
|
|
|
@ -1869,7 +1869,7 @@ D3D11_QueueCopyEx(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture *
|
|||
static int
|
||||
D3D11_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture,
|
||||
const float *xy, int xy_stride, const int *color, int color_stride, const float *uv, int uv_stride,
|
||||
int num_vertices, const void *indices, int num_indices, int size_indice,
|
||||
int num_vertices, const void *indices, int num_indices, int size_indices,
|
||||
float scale_x, float scale_y)
|
||||
{
|
||||
int i;
|
||||
|
@ -1886,11 +1886,11 @@ D3D11_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture
|
|||
int j;
|
||||
float *xy_;
|
||||
SDL_Color col_;
|
||||
if (size_indice == 4) {
|
||||
if (size_indices == 4) {
|
||||
j = ((const Uint32 *)indices)[i];
|
||||
} else if (size_indice == 2) {
|
||||
} else if (size_indices == 2) {
|
||||
j = ((const Uint16 *)indices)[i];
|
||||
} else if (size_indice == 1) {
|
||||
} else if (size_indices == 1) {
|
||||
j = ((const Uint8 *)indices)[i];
|
||||
} else {
|
||||
j = i;
|
||||
|
|
|
@ -1322,7 +1322,7 @@ METAL_QueueCopyEx(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture *
|
|||
static int
|
||||
METAL_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture,
|
||||
const float *xy, int xy_stride, const int *color, int color_stride, const float *uv, int uv_stride,
|
||||
int num_vertices, const void *indices, int num_indices, int size_indice,
|
||||
int num_vertices, const void *indices, int num_indices, int size_indices,
|
||||
float scale_x, float scale_y)
|
||||
{
|
||||
int count = indices ? num_indices : num_vertices;
|
||||
|
@ -1336,11 +1336,11 @@ METAL_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture
|
|||
|
||||
for (int i = 0; i < count; i++) {
|
||||
int j;
|
||||
if (size_indice == 4) {
|
||||
if (size_indices == 4) {
|
||||
j = ((const Uint32 *)indices)[i];
|
||||
} else if (size_indice == 2) {
|
||||
} else if (size_indices == 2) {
|
||||
j = ((const Uint16 *)indices)[i];
|
||||
} else if (size_indice == 1) {
|
||||
} else if (size_indices == 1) {
|
||||
j = ((const Uint8 *)indices)[i];
|
||||
} else {
|
||||
j = i;
|
||||
|
|
|
@ -1055,7 +1055,7 @@ GL_QueueCopyEx(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * te
|
|||
static int
|
||||
GL_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture,
|
||||
const float *xy, int xy_stride, const int *color, int color_stride, const float *uv, int uv_stride,
|
||||
int num_vertices, const void *indices, int num_indices, int size_indice,
|
||||
int num_vertices, const void *indices, int num_indices, int size_indices,
|
||||
float scale_x, float scale_y)
|
||||
{
|
||||
GL_TextureData *texturedata = NULL;
|
||||
|
@ -1079,11 +1079,11 @@ GL_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *te
|
|||
int j;
|
||||
float *xy_;
|
||||
SDL_Color col_;
|
||||
if (size_indice == 4) {
|
||||
if (size_indices == 4) {
|
||||
j = ((const Uint32 *)indices)[i];
|
||||
} else if (size_indice == 2) {
|
||||
} else if (size_indices == 2) {
|
||||
j = ((const Uint16 *)indices)[i];
|
||||
} else if (size_indice == 1) {
|
||||
} else if (size_indices == 1) {
|
||||
j = ((const Uint8 *)indices)[i];
|
||||
} else {
|
||||
j = i;
|
||||
|
|
|
@ -759,7 +759,7 @@ GLES_QueueCopyEx(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture *
|
|||
static int
|
||||
GLES_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture,
|
||||
const float *xy, int xy_stride, const int *color, int color_stride, const float *uv, int uv_stride,
|
||||
int num_vertices, const void *indices, int num_indices, int size_indice,
|
||||
int num_vertices, const void *indices, int num_indices, int size_indices,
|
||||
float scale_x, float scale_y)
|
||||
{
|
||||
GLES_TextureData *texturedata = NULL;
|
||||
|
@ -783,11 +783,11 @@ GLES_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *
|
|||
int j;
|
||||
float *xy_;
|
||||
SDL_Color col_;
|
||||
if (size_indice == 4) {
|
||||
if (size_indices == 4) {
|
||||
j = ((const Uint32 *)indices)[i];
|
||||
} else if (size_indice == 2) {
|
||||
} else if (size_indices == 2) {
|
||||
j = ((const Uint16 *)indices)[i];
|
||||
} else if (size_indice == 1) {
|
||||
} else if (size_indices == 1) {
|
||||
j = ((const Uint8 *)indices)[i];
|
||||
} else {
|
||||
j = i;
|
||||
|
|
|
@ -941,7 +941,7 @@ GLES2_QueueCopyEx(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture *
|
|||
static int
|
||||
GLES2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture,
|
||||
const float *xy, int xy_stride, const int *color, int color_stride, const float *uv, int uv_stride,
|
||||
int num_vertices, const void *indices, int num_indices, int size_indice,
|
||||
int num_vertices, const void *indices, int num_indices, int size_indices,
|
||||
float scale_x, float scale_y)
|
||||
{
|
||||
int i;
|
||||
|
@ -960,11 +960,11 @@ GLES2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture
|
|||
int j;
|
||||
float *xy_;
|
||||
int col_;
|
||||
if (size_indice == 4) {
|
||||
if (size_indices == 4) {
|
||||
j = ((const Uint32 *)indices)[i];
|
||||
} else if (size_indice == 2) {
|
||||
} else if (size_indices == 2) {
|
||||
j = ((const Uint16 *)indices)[i];
|
||||
} else if (size_indice == 1) {
|
||||
} else if (size_indices == 1) {
|
||||
j = ((const Uint8 *)indices)[i];
|
||||
} else {
|
||||
j = i;
|
||||
|
|
|
@ -579,7 +579,7 @@ typedef struct GeometryCopyData
|
|||
static int
|
||||
SW_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture,
|
||||
const float *xy, int xy_stride, const int *color, int color_stride, const float *uv, int uv_stride,
|
||||
int num_vertices, const void *indices, int num_indices, int size_indice,
|
||||
int num_vertices, const void *indices, int num_indices, int size_indices,
|
||||
float scale_x, float scale_y)
|
||||
{
|
||||
int i;
|
||||
|
@ -601,11 +601,11 @@ SW_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *te
|
|||
float *xy_;
|
||||
SDL_Color col_;
|
||||
float *uv_;
|
||||
if (size_indice == 4) {
|
||||
if (size_indices == 4) {
|
||||
j = ((const Uint32 *)indices)[i];
|
||||
} else if (size_indice == 2) {
|
||||
} else if (size_indices == 2) {
|
||||
j = ((const Uint16 *)indices)[i];
|
||||
} else if (size_indice == 1) {
|
||||
} else if (size_indices == 1) {
|
||||
j = ((const Uint8 *)indices)[i];
|
||||
} else {
|
||||
j = i;
|
||||
|
@ -634,11 +634,11 @@ SW_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *te
|
|||
int j;
|
||||
float *xy_;
|
||||
SDL_Color col_;
|
||||
if (size_indice == 4) {
|
||||
if (size_indices == 4) {
|
||||
j = ((const Uint32 *)indices)[i];
|
||||
} else if (size_indice == 2) {
|
||||
} else if (size_indices == 2) {
|
||||
j = ((const Uint16 *)indices)[i];
|
||||
} else if (size_indice == 1) {
|
||||
} else if (size_indices == 1) {
|
||||
j = ((const Uint8 *)indices)[i];
|
||||
} else {
|
||||
j = i;
|
||||
|
|
Loading…
Reference in New Issue