Fix declaration-after-statement and remove tabs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index 75ff941..53e694c 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -3356,7 +3356,7 @@ remap_one_indice(
SDL_Texture *texture,
const float *xy, int xy_stride,
const int *color, int color_stride,
- const float *uv, int uv_stride)
+ const float *uv, int uv_stride)
{
const float *xy0_, *xy1_, *uv0_, *uv1_;
int col0_, col1_;
@@ -3429,7 +3429,7 @@ SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer,
int texw = 0, texh = 0;
if (texture) {
- SDL_QueryTexture(texture, NULL, NULL, &texw, &texh);
+ SDL_QueryTexture(texture, NULL, NULL, &texw, &texh);
}
prev[0] = -1; prev[1] = -1; prev[2] = -1;
@@ -3468,7 +3468,7 @@ SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer,
prev[0] = k0;
prev[1] = k1;
prev[2] = k2;
- continue;
+ continue;
}
/* Two triangles forming a quadialateral,
@@ -3551,7 +3551,7 @@ SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer,
x1 = xy1_[0]; y1 = xy1_[1];
x2 = xy2_[0]; y2 = xy2_[1];
- /* Check if triangle A B C is rectangle */
+ /* Check if triangle A B C is rectangle */
if ((x0 == x2 && y1 == y2) || (y0 == y2 && x1 == x2)){
/* ok */
} else {
@@ -3562,7 +3562,7 @@ SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer,
xy2_ = (const float *)((const char*)xy + C2 * xy_stride);
x2 = xy2_[0]; y2 = xy2_[1];
- /* Check if triangle A B C2 is rectangle */
+ /* Check if triangle A B C2 is rectangle */
if ((x0 == x2 && y1 == y2) || (y0 == y2 && x1 == x2)){
/* ok */
} else {
@@ -3616,7 +3616,7 @@ SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer,
SDL_RenderCopyF(renderer, texture, &s, &d);
if (debug) {
- SDL_Log("Rect-COPY: RGB %d %d %d - Alpha:%d - texture=%p: src=(%d,%d, %d x %d) dst (%f, %f, %f x %f)", col0_.r, col0_.g, col0_.b, col0_.a,
+ SDL_Log("Rect-COPY: RGB %d %d %d - Alpha:%d - texture=%p: src=(%d,%d, %d x %d) dst (%f, %f, %f x %f)", col0_.r, col0_.g, col0_.b, col0_.a,
(void *)texture, s.x, s.y, s.w, s.h, d.x, d.y, d.w, d.h);
}
} else if (d.w != 0.0f && d.h != 0.0f) { /* Rect, no texture */
@@ -3625,12 +3625,12 @@ SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer,
SDL_RenderFillRectF(renderer, &d);
if (debug) {
- SDL_Log("Rect-FILL: RGB %d %d %d - Alpha:%d - texture=%p: src=(%d,%d, %d x %d) dst (%f, %f, %f x %f)", col0_.r, col0_.g, col0_.b, col0_.a,
+ SDL_Log("Rect-FILL: RGB %d %d %d - Alpha:%d - texture=%p: src=(%d,%d, %d x %d) dst (%f, %f, %f x %f)", col0_.r, col0_.g, col0_.b, col0_.a,
(void *)texture, s.x, s.y, s.w, s.h, d.x, d.y, d.w, d.h);
}
} else {
if (debug) {
- SDL_Log("Rect-DISMISS: RGB %d %d %d - Alpha:%d - texture=%p: src=(%d,%d, %d x %d) dst (%f, %f, %f x %f)", col0_.r, col0_.g, col0_.b, col0_.a,
+ SDL_Log("Rect-DISMISS: RGB %d %d %d - Alpha:%d - texture=%p: src=(%d,%d, %d x %d) dst (%f, %f, %f x %f)", col0_.r, col0_.g, col0_.b, col0_.a,
(void *)texture, s.x, s.y, s.w, s.h, d.x, d.y, d.w, d.h);
}
}
diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c
index a813698..46a3ec1 100644
--- a/src/render/direct3d11/SDL_render_d3d11.c
+++ b/src/render/direct3d11/SDL_render_d3d11.c
@@ -1867,9 +1867,9 @@ 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,
- float scale_x, float scale_y)
+ 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,
+ float scale_x, float scale_y)
{
int i;
int count = indices ? num_indices : num_vertices;
@@ -1882,22 +1882,21 @@ D3D11_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture
cmd->data.draw.count = count;
for (i = 0; i < count; i++) {
- int j;
- if (size_indice == 4) {
- j = ((const Uint32 *)indices)[i];
- }
- else if (size_indice == 2) {
- j = ((const Uint16 *)indices)[i];
- }
- else if (size_indice == 1) {
- j = ((const Uint8 *)indices)[i];
- }
- else {
- j = i;
- }
-
- float *xy_ = (float *)((char*)xy + j * xy_stride);
- SDL_Color col_ = *(SDL_Color *)((char*)color + j * color_stride);
+ int j;
+ float *xy_;
+ SDL_Color col_;
+ if (size_indice == 4) {
+ j = ((const Uint32 *)indices)[i];
+ } else if (size_indice == 2) {
+ j = ((const Uint16 *)indices)[i];
+ } else if (size_indice == 1) {
+ j = ((const Uint8 *)indices)[i];
+ } else {
+ j = i;
+ }
+
+ xy_ = (float *)((char*)xy + j * xy_stride);
+ col_ = *(SDL_Color *)((char*)color + j * color_stride);
verts->pos.x = xy_[0] * scale_x;
verts->pos.y = xy_[1] * scale_y;
@@ -1908,7 +1907,7 @@ D3D11_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture
verts->color.w = col_.a / 255.0f;
if (texture) {
- float *uv_ = (float *)((char*)uv + j * uv_stride);
+ float *uv_ = (float *)((char*)uv + j * uv_stride);
verts->tex.x = uv_[0];
verts->tex.y = uv_[1];
} else {
diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c
index d9caf84..ac090bb 100644
--- a/src/render/opengl/SDL_render_gl.c
+++ b/src/render/opengl/SDL_render_gl.c
@@ -21,7 +21,6 @@
#include "../../SDL_internal.h"
#if SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED
-
#include "SDL_hints.h"
#include "SDL_opengl.h"
#include "../SDL_sysrender.h"
@@ -1077,6 +1076,8 @@ GL_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *te
for (i = 0; i < count; i++) {
int j;
+ float *xy_;
+ SDL_Color col_;
if (size_indice == 4) {
j = ((const Uint32 *)indices)[i];
} else if (size_indice == 2) {
@@ -1087,8 +1088,8 @@ GL_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *te
j = i;
}
- float *xy_ = (float *)((char*)xy + j * xy_stride);
- SDL_Color col_ = *(SDL_Color *)((char*)color + j * color_stride);
+ xy_ = (float *)((char*)xy + j * xy_stride);
+ col_ = *(SDL_Color *)((char*)color + j * color_stride);
*(verts++) = xy_[0] * scale_x;
*(verts++) = xy_[1] * scale_y;
diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c
index 6b99758..ecd2ced 100644
--- a/src/render/opengles2/SDL_render_gles2.c
+++ b/src/render/opengles2/SDL_render_gles2.c
@@ -979,6 +979,8 @@ GLES2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture
for (i = 0; i < count; i++) {
int j;
+ float *xy_;
+ SDL_Color col_;
if (size_indice == 4) {
j = ((const Uint32 *)indices)[i];
} else if (size_indice == 2) {
@@ -989,8 +991,8 @@ GLES2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture
j = i;
}
- float *xy_ = (float *)((char*)xy + j * xy_stride);
- SDL_Color col_ = *(SDL_Color *)((char*)color + j * color_stride);
+ xy_ = (float *)((char*)xy + j * xy_stride);
+ col_ = *(SDL_Color *)((char*)color + j * color_stride);
*(verts++) = xy_[0] * scale_x;
*(verts++) = xy_[1] * scale_y;
diff --git a/src/render/software/SDL_render_sw.c b/src/render/software/SDL_render_sw.c
index 0dcdc2a..9bf5698 100644
--- a/src/render/software/SDL_render_sw.c
+++ b/src/render/software/SDL_render_sw.c
@@ -597,6 +597,9 @@ SW_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *te
GeometryCopyData *ptr = (GeometryCopyData *) verts;
for (i = 0; i < count; i++) {
int j;
+ float *xy_;
+ SDL_Color col_;
+ float *uv_;
if (size_indice == 4) {
j = ((const Uint32 *)indices)[i];
} else if (size_indice == 2) {
@@ -607,10 +610,10 @@ SW_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *te
j = i;
}
- float *xy_ = (float *)((char*)xy + j * xy_stride);
- SDL_Color col_ = *(SDL_Color *)((char*)color + j * color_stride);
+ xy_ = (float *)((char*)xy + j * xy_stride);
+ col_ = *(SDL_Color *)((char*)color + j * color_stride);
- float *uv_ = (float *)((char*)uv + j * uv_stride);
+ uv_ = (float *)((char*)uv + j * uv_stride);
ptr->src.x = uv_[0] * texture->w;
ptr->src.y = uv_[1] * texture->h;
@@ -628,6 +631,8 @@ SW_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *te
for (i = 0; i < count; i++) {
int j;
+ float *xy_;
+ SDL_Color col_;
if (size_indice == 4) {
j = ((const Uint32 *)indices)[i];
} else if (size_indice == 2) {
@@ -638,8 +643,8 @@ SW_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *te
j = i;
}
- float *xy_ = (float *)((char*)xy + j * xy_stride);
- SDL_Color col_ = *(SDL_Color *)((char*)color + j * color_stride);
+ xy_ = (float *)((char*)xy + j * xy_stride);
+ col_ = *(SDL_Color *)((char*)color + j * color_stride);
ptr->dst.x = xy_[0] * scale_x + renderer->viewport.x;
ptr->dst.y = xy_[1] * scale_y + renderer->viewport.y;