Use the enumerated type for blend and scale mode instead of int

Renamed SDL_TextureScaleMode to SDL_ScaleMode
This commit is contained in:
Sam Lantinga 2010-12-12 15:19:05 -08:00
parent 0893ec9ce4
commit 35cc558917
28 changed files with 355 additions and 282 deletions

View file

@ -112,8 +112,7 @@ SDL_RenderDriver GL_ES_RenderDriver = {
SDL_TEXTUREMODULATE_ALPHA),
(SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
(SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST |
SDL_TEXTURESCALEMODE_SLOW), 5,
(SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST | SDL_SCALEMODE_SLOW), 5,
{
/* OpenGL ES 1.x supported formats list */
SDL_PIXELFORMAT_ABGR4444,
@ -533,17 +532,17 @@ static int
GLES_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
{
switch (texture->scaleMode) {
case SDL_TEXTURESCALEMODE_NONE:
case SDL_TEXTURESCALEMODE_FAST:
case SDL_TEXTURESCALEMODE_SLOW:
case SDL_SCALEMODE_NONE:
case SDL_SCALEMODE_FAST:
case SDL_SCALEMODE_SLOW:
return 0;
case SDL_TEXTURESCALEMODE_BEST:
case SDL_SCALEMODE_BEST:
SDL_Unsupported();
texture->scaleMode = SDL_TEXTURESCALEMODE_SLOW;
texture->scaleMode = SDL_SCALEMODE_SLOW;
return -1;
default:
SDL_Unsupported();
texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
texture->scaleMode = SDL_SCALEMODE_NONE;
return -1;
}
}
@ -859,15 +858,15 @@ GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
GLES_SetBlendMode(data, texture->blendMode, 0);
switch (texture->scaleMode) {
case SDL_TEXTURESCALEMODE_NONE:
case SDL_TEXTURESCALEMODE_FAST:
case SDL_SCALEMODE_NONE:
case SDL_SCALEMODE_FAST:
data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
GL_NEAREST);
data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
GL_NEAREST);
break;
case SDL_TEXTURESCALEMODE_SLOW:
case SDL_TEXTURESCALEMODE_BEST:
case SDL_SCALEMODE_SLOW:
case SDL_SCALEMODE_BEST:
data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
GL_LINEAR);
data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,