summaryrefslogtreecommitdiff
path: root/drivers/gles2
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles2')
-rw-r--r--drivers/gles2/rasterizer_canvas_gles2.cpp42
-rw-r--r--drivers/gles2/rasterizer_scene_gles2.cpp10
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp2
3 files changed, 27 insertions, 27 deletions
diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp
index a7345978e1..bf210ef2b2 100644
--- a/drivers/gles2/rasterizer_canvas_gles2.cpp
+++ b/drivers/gles2/rasterizer_canvas_gles2.cpp
@@ -851,11 +851,11 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
int indices[num_points * 3];
- for (int i = 0; i < num_points; i++) {
- points[i] = circle->pos + Vector2(Math::sin(i * Math_PI * 2.0 / num_points), Math::cos(i * Math_PI * 2.0 / num_points)) * circle->radius;
- indices[i * 3 + 0] = i;
- indices[i * 3 + 1] = (i + 1) % num_points;
- indices[i * 3 + 2] = num_points;
+ for (int j = 0; j < num_points; j++) {
+ points[j] = circle->pos + Vector2(Math::sin(j * Math_PI * 2.0 / num_points), Math::cos(j * Math_PI * 2.0 / num_points)) * circle->radius;
+ indices[j * 3 + 0] = j;
+ indices[j * 3 + 1] = (j + 1) % num_points;
+ indices[j * 3 + 2] = num_points;
}
_bind_canvas_texture(RID(), RID());
@@ -913,13 +913,13 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, s->index_id);
}
- for (int i = 0; i < VS::ARRAY_MAX - 1; i++) {
- if (s->attribs[i].enabled) {
- glEnableVertexAttribArray(i);
- glVertexAttribPointer(s->attribs[i].index, s->attribs[i].size, s->attribs[i].type, s->attribs[i].normalized, s->attribs[i].stride, (uint8_t *)0 + s->attribs[i].offset);
+ for (int k = 0; k < VS::ARRAY_MAX - 1; k++) {
+ if (s->attribs[k].enabled) {
+ glEnableVertexAttribArray(k);
+ glVertexAttribPointer(s->attribs[k].index, s->attribs[k].size, s->attribs[k].type, s->attribs[k].normalized, s->attribs[k].stride, (uint8_t *)0 + s->attribs[k].offset);
} else {
- glDisableVertexAttribArray(i);
- switch (i) {
+ glDisableVertexAttribArray(k);
+ switch (k) {
case VS::ARRAY_NORMAL: {
glVertexAttrib4f(VS::ARRAY_NORMAL, 0.0, 0.0, 1, 1);
} break;
@@ -939,8 +939,8 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
}
}
- for (int i = 1; i < VS::ARRAY_MAX - 1; i++) {
- glDisableVertexAttribArray(i);
+ for (int j = 1; j < VS::ARRAY_MAX - 1; j++) {
+ glDisableVertexAttribArray(j);
}
}
@@ -1002,13 +1002,13 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, s->index_id);
}
- for (int i = 0; i < VS::ARRAY_MAX - 1; i++) {
- if (s->attribs[i].enabled) {
- glEnableVertexAttribArray(i);
- glVertexAttribPointer(s->attribs[i].index, s->attribs[i].size, s->attribs[i].type, s->attribs[i].normalized, s->attribs[i].stride, (uint8_t *)0 + s->attribs[i].offset);
+ for (int k = 0; k < VS::ARRAY_MAX - 1; k++) {
+ if (s->attribs[k].enabled) {
+ glEnableVertexAttribArray(k);
+ glVertexAttribPointer(s->attribs[k].index, s->attribs[k].size, s->attribs[k].type, s->attribs[k].normalized, s->attribs[k].stride, (uint8_t *)0 + s->attribs[k].offset);
} else {
- glDisableVertexAttribArray(i);
- switch (i) {
+ glDisableVertexAttribArray(k);
+ switch (k) {
case VS::ARRAY_NORMAL: {
glVertexAttrib4f(VS::ARRAY_NORMAL, 0.0, 0.0, 1, 1);
} break;
@@ -1021,8 +1021,8 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
}
}
- for (int i = 0; i < amount; i++) {
- const float *buffer = base_buffer + i * stride;
+ for (int k = 0; k < amount; k++) {
+ const float *buffer = base_buffer + k * stride;
{
diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp
index 03e6c185ee..3920a5f96a 100644
--- a/drivers/gles2/rasterizer_scene_gles2.cpp
+++ b/drivers/gles2/rasterizer_scene_gles2.cpp
@@ -1120,10 +1120,10 @@ void RasterizerSceneGLES2::_fill_render_list(InstanceBase **p_cull_result, int p
int num_surfaces = mesh->surfaces.size();
- for (int i = 0; i < num_surfaces; i++) {
- int material_index = instance->materials[i].is_valid() ? i : -1;
+ for (int j = 0; j < num_surfaces; j++) {
+ int material_index = instance->materials[j].is_valid() ? j : -1;
- RasterizerStorageGLES2::Surface *surface = mesh->surfaces[i];
+ RasterizerStorageGLES2::Surface *surface = mesh->surfaces[j];
_add_geometry(surface, instance, NULL, material_index, p_depth_pass, p_shadow_pass);
}
@@ -1143,8 +1143,8 @@ void RasterizerSceneGLES2::_fill_render_list(InstanceBase **p_cull_result, int p
int ssize = mesh->surfaces.size();
- for (int i = 0; i < ssize; i++) {
- RasterizerStorageGLES2::Surface *s = mesh->surfaces[i];
+ for (int j = 0; j < ssize; j++) {
+ RasterizerStorageGLES2::Surface *s = mesh->surfaces[j];
_add_geometry(s, instance, multi_mesh, -1, p_depth_pass, p_shadow_pass);
}
} break;
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index d00d572ccf..0227cd2b34 100644
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
@@ -4283,7 +4283,7 @@ void RasterizerStorageGLES2::_render_target_allocate(RenderTarget *rt) {
glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT);
- GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
+ status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE) {
_render_target_clear(rt);
ERR_FAIL_COND(status != GL_FRAMEBUFFER_COMPLETE);