Mercurial > sdl-ios-xcode
diff src/video/x11/SDL_x11render.c @ 4929:aa8888658021
Use the enumerated type for blend and scale mode instead of int
Renamed SDL_TextureScaleMode to SDL_ScaleMode
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 12 Dec 2010 15:19:05 -0800 |
parents | 164bee619400 |
children | 619884e8a714 |
line wrap: on
line diff
--- a/src/video/x11/SDL_x11render.c Thu Dec 02 11:56:23 2010 -0800 +++ b/src/video/x11/SDL_x11render.c Sun Dec 12 15:19:05 2010 -0800 @@ -83,7 +83,7 @@ SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED), SDL_TEXTUREMODULATE_NONE, SDL_BLENDMODE_NONE, - SDL_TEXTURESCALEMODE_NONE, + SDL_SCALEMODE_NONE, 0, {0}, 0, @@ -331,8 +331,8 @@ /* Update the capabilities of the renderer. */ info->blend_modes |= (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD | SDL_BLENDMODE_MASK); - info->scale_modes |= (SDL_TEXTURESCALEMODE_FAST | SDL_TEXTURESCALEMODE_SLOW | - SDL_TEXTURESCALEMODE_BEST); + info->scale_modes |= (SDL_SCALEMODE_FAST | SDL_SCALEMODE_SLOW | + SDL_SCALEMODE_BEST); info->mod_modes |= (SDL_TEXTUREMODULATE_COLOR | SDL_TEXTUREMODULATE_ALPHA); } #endif @@ -1078,7 +1078,7 @@ // FIXME: Is the following required? /* Set the default blending and scaling modes. */ texture->blendMode = SDL_BLENDMODE_NONE; - texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; + texture->scaleMode = SDL_SCALEMODE_NONE; data->blend_op = PictOpSrc; data->filter = NULL; } @@ -1216,14 +1216,14 @@ X11_RenderData *renderdata = (X11_RenderData *) renderer->driverdata; switch (texture->scaleMode) { - case SDL_TEXTURESCALEMODE_NONE: + case SDL_SCALEMODE_NONE: #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (renderdata->use_xrender) { data->filter = NULL; } #endif return 0; - case SDL_TEXTURESCALEMODE_FAST: + case SDL_SCALEMODE_FAST: /* We can sort of fake it for streaming textures */ if (data->yuv || texture->access == SDL_TEXTUREACCESS_STREAMING) { return 0; @@ -1233,12 +1233,12 @@ data->filter = FilterFast; return 0; } - case SDL_TEXTURESCALEMODE_SLOW: + case SDL_SCALEMODE_SLOW: if (renderdata->use_xrender) { data->filter = FilterGood; return 0; } - case SDL_TEXTURESCALEMODE_BEST: + case SDL_SCALEMODE_BEST: if (renderdata->use_xrender) { data->filter = FilterBest; return 0; @@ -1249,12 +1249,12 @@ SDL_Unsupported(); #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (renderdata->use_xrender) { - texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; + texture->scaleMode = SDL_SCALEMODE_NONE; data->filter = NULL; } else #endif - texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; + texture->scaleMode = SDL_SCALEMODE_NONE; return -1; } return 0; @@ -2012,7 +2012,7 @@ } /* Set the picture filter only if a scaling mode is set. */ - if (texture->scaleMode != SDL_TEXTURESCALEMODE_NONE) { + if (texture->scaleMode != SDL_SCALEMODE_NONE) { XRenderSetPictureFilter(data->display, src, texturedata->filter, 0, 0); }