comparison src/video/directfb/SDL_DirectFB_render.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 b196d2758026
children da10636e5eca
comparison
equal deleted inserted replaced
4927:d716dff4b13e 4929:aa8888658021
102 SDL_RENDERER_ACCELERATED), 102 SDL_RENDERER_ACCELERATED),
103 (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_COLOR | 103 (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_COLOR |
104 SDL_TEXTUREMODULATE_ALPHA), 104 SDL_TEXTUREMODULATE_ALPHA),
105 (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND | 105 (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND |
106 SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD), 106 SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
107 (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST | 107 (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST |
108 SDL_TEXTURESCALEMODE_SLOW | SDL_TEXTURESCALEMODE_BEST), 108 SDL_SCALEMODE_SLOW | SDL_SCALEMODE_BEST),
109 14, 109 14,
110 { 110 {
111 SDL_PIXELFORMAT_INDEX4LSB, 111 SDL_PIXELFORMAT_INDEX4LSB,
112 SDL_PIXELFORMAT_INDEX8, 112 SDL_PIXELFORMAT_INDEX8,
113 SDL_PIXELFORMAT_RGB332, 113 SDL_PIXELFORMAT_RGB332,
709 #if (DFB_VERSION_ATLEAST(1,2,0)) 709 #if (DFB_VERSION_ATLEAST(1,2,0))
710 710
711 DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata; 711 DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata;
712 712
713 switch (texture->scaleMode) { 713 switch (texture->scaleMode) {
714 case SDL_TEXTURESCALEMODE_NONE: 714 case SDL_SCALEMODE_NONE:
715 case SDL_TEXTURESCALEMODE_FAST: 715 case SDL_SCALEMODE_FAST:
716 data->render_options = DSRO_NONE; 716 data->render_options = DSRO_NONE;
717 break; 717 break;
718 case SDL_TEXTURESCALEMODE_SLOW: 718 case SDL_SCALEMODE_SLOW:
719 data->render_options = DSRO_SMOOTH_UPSCALE | DSRO_SMOOTH_DOWNSCALE; 719 data->render_options = DSRO_SMOOTH_UPSCALE | DSRO_SMOOTH_DOWNSCALE;
720 break; 720 break;
721 case SDL_TEXTURESCALEMODE_BEST: 721 case SDL_SCALEMODE_BEST:
722 data->render_options = 722 data->render_options =
723 DSRO_SMOOTH_UPSCALE | DSRO_SMOOTH_DOWNSCALE | DSRO_ANTIALIAS; 723 DSRO_SMOOTH_UPSCALE | DSRO_SMOOTH_DOWNSCALE | DSRO_ANTIALIAS;
724 break; 724 break;
725 default: 725 default:
726 SDL_Unsupported(); 726 SDL_Unsupported();
727 data->render_options = DSRO_NONE; 727 data->render_options = DSRO_NONE;
728 texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; 728 texture->scaleMode = SDL_SCALEMODE_NONE;
729 return -1; 729 return -1;
730 } 730 }
731 #endif 731 #endif
732 return 0; 732 return 0;
733 } 733 }