diff src/video/SDL_surface.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 2cd7bb613a83
children 68da5a234bba
line wrap: on
line diff
--- a/src/video/SDL_surface.c	Thu Dec 02 11:56:23 2010 -0800
+++ b/src/video/SDL_surface.c	Sun Dec 12 15:19:05 2010 -0800
@@ -438,7 +438,7 @@
 }
 
 int
-SDL_SetSurfaceBlendMode(SDL_Surface * surface, int blendMode)
+SDL_SetSurfaceBlendMode(SDL_Surface * surface, SDL_BlendMode blendMode)
 {
     int flags, status;
 
@@ -486,7 +486,7 @@
 }
 
 int
-SDL_GetSurfaceBlendMode(SDL_Surface * surface, int *blendMode)
+SDL_GetSurfaceBlendMode(SDL_Surface * surface, SDL_BlendMode *blendMode)
 {
     if (!surface) {
         return -1;
@@ -519,7 +519,7 @@
 }
 
 int
-SDL_SetSurfaceScaleMode(SDL_Surface * surface, int scaleMode)
+SDL_SetSurfaceScaleMode(SDL_Surface * surface, SDL_ScaleMode scaleMode)
 {
     int flags, status;
 
@@ -531,13 +531,13 @@
     flags = surface->map->info.flags;
     surface->map->info.flags &= ~(SDL_COPY_NEAREST);
     switch (scaleMode) {
-    case SDL_TEXTURESCALEMODE_NONE:
+    case SDL_SCALEMODE_NONE:
         break;
-    case SDL_TEXTURESCALEMODE_FAST:
+    case SDL_SCALEMODE_FAST:
         surface->map->info.flags |= SDL_COPY_NEAREST;
         break;
-    case SDL_TEXTURESCALEMODE_SLOW:
-    case SDL_TEXTURESCALEMODE_BEST:
+    case SDL_SCALEMODE_SLOW:
+    case SDL_SCALEMODE_BEST:
         SDL_Unsupported();
         surface->map->info.flags |= SDL_COPY_NEAREST;
         status = -1;
@@ -555,7 +555,7 @@
 }
 
 int
-SDL_GetSurfaceScaleMode(SDL_Surface * surface, int *scaleMode)
+SDL_GetSurfaceScaleMode(SDL_Surface * surface, SDL_ScaleMode *scaleMode)
 {
     if (!surface) {
         return -1;
@@ -567,10 +567,10 @@
 
     switch (surface->map->info.flags & SDL_COPY_NEAREST) {
     case SDL_COPY_NEAREST:
-        *scaleMode = SDL_TEXTURESCALEMODE_FAST;
+        *scaleMode = SDL_SCALEMODE_FAST;
         break;
     default:
-        *scaleMode = SDL_TEXTURESCALEMODE_NONE;
+        *scaleMode = SDL_SCALEMODE_NONE;
         break;
     }
     return 0;