Skip to content

Commit

Permalink
Code style cleanup in the GLES and GLES2 render backends.
Browse files Browse the repository at this point in the history
  • Loading branch information
slime73 committed May 16, 2015
1 parent 240a3fb commit fcee3e7
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 148 deletions.
22 changes: 12 additions & 10 deletions src/render/opengles/SDL_render_gles.c
Expand Up @@ -220,12 +220,10 @@ GLES_FBOList *
GLES_GetFBO(GLES_RenderData *data, Uint32 w, Uint32 h)
{
GLES_FBOList *result = data->framebuffers;
while ((result) && ((result->w != w) || (result->h != h)) )
{
while ((result) && ((result->w != w) || (result->h != h)) ) {
result = result->next;
}
if (result == NULL)
{
if (result == NULL) {
result = SDL_malloc(sizeof(GLES_FBOList));
result->w = w;
result->h = h;
Expand Down Expand Up @@ -572,8 +570,9 @@ GLES_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
GLES_ActivateRenderer(renderer);

/* Bail out if we're supposed to update an empty rectangle */
if (rect->w <= 0 || rect->h <= 0)
if (rect->w <= 0 || rect->h <= 0) {
return 0;
}

/* Reformat the texture data into a tightly packed array */
srcPitch = rect->w * SDL_BYTESPERPIXEL(texture->format);
Expand Down Expand Up @@ -608,8 +607,7 @@ GLES_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
src);
SDL_free(blob);

if (renderdata->glGetError() != GL_NO_ERROR)
{
if (renderdata->glGetError() != GL_NO_ERROR) {
return SDL_SetError("Failed to update texture");
}
return 0;
Expand Down Expand Up @@ -650,7 +648,7 @@ GLES_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
GLenum status;

GLES_ActivateRenderer(renderer);

if (!data->GL_OES_framebuffer_object_supported) {
return SDL_SetError("Can't enable render target support in this renderer");
}
Expand Down Expand Up @@ -1206,8 +1204,12 @@ static int GLES_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, floa
data->glEnable(GL_TEXTURE_2D);
data->glBindTexture(texturedata->type, texturedata->texture);

if(texw) *texw = (float)texturedata->texw;
if(texh) *texh = (float)texturedata->texh;
if (texw) {
*texw = (float)texturedata->texw;
}
if (texh) {
*texh = (float)texturedata->texh;
}

return 0;
}
Expand Down

0 comments on commit fcee3e7

Please sign in to comment.