Code style cleanup in the GLES and GLES2 render backends.
This commit is contained in:
parent
58e77377c6
commit
2190985ce9
3 changed files with 140 additions and 148 deletions
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue