Mercurial > sdl-ios-xcode
diff src/video/photon/SDL_photon_render.c @ 5141:da10636e5eca
Making the API simpler, scaling is always defined as linear interpolation and should be supported as much as possible on all renderers.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 31 Jan 2011 22:44:43 -0800 |
parents | aa8888658021 |
children | e743b9c3f6d6 |
line wrap: on
line diff
--- a/src/video/photon/SDL_photon_render.c Mon Jan 31 22:21:29 2011 -0800 +++ b/src/video/photon/SDL_photon_render.c Mon Jan 31 22:44:43 2011 -0800 @@ -104,7 +104,6 @@ (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_ALPHA), (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD), - (SDL_SCALEMODE_NONE | SDL_SCALEMODE_SLOW | SDL_SCALEMODE_FAST), 10, {SDL_PIXELFORMAT_INDEX8, SDL_PIXELFORMAT_RGB555, @@ -153,7 +152,6 @@ renderer->SetTextureAlphaMod = photon_settexturealphamod; renderer->SetTextureColorMod = photon_settexturecolormod; renderer->SetTextureBlendMode = photon_settextureblendmode; - renderer->SetTextureScaleMode = photon_settexturescalemode; renderer->UpdateTexture = photon_updatetexture; renderer->LockTexture = photon_locktexture; renderer->UnlockTexture = photon_unlocktexture; @@ -250,22 +248,6 @@ /* Initialize surfaces */ _photon_recreate_surfaces(renderer); - /* Set current scale blitting capabilities */ - if (rdata->surfaces_type==SDL_PHOTON_SURFTYPE_OFFSCREEN) - { - renderer->info.scale_modes=SDL_SCALEMODE_NONE | SDL_SCALEMODE_SLOW; - if ((didata->mode_2dcaps & SDL_VIDEO_PHOTON_CAP_SCALED_BLIT)==SDL_VIDEO_PHOTON_CAP_SCALED_BLIT) - { - /* This video mode supports hardware scaling */ - renderer->info.scale_modes|=SDL_SCALEMODE_FAST; - } - } - else - { - /* PhImage blit functions do not support scaling */ - renderer->info.scale_modes=SDL_SCALEMODE_NONE; - } - return renderer; } @@ -977,53 +959,6 @@ } static int -photon_settexturescalemode(SDL_Renderer * renderer, SDL_Texture * texture) -{ - SDL_RenderData *rdata = (SDL_RenderData *) renderer->driverdata; - - switch (texture->scaleMode) - { - case SDL_SCALEMODE_NONE: - return 0; - case SDL_SCALEMODE_FAST: - if ((renderer->info.scale_modes & SDL_SCALEMODE_FAST)==SDL_SCALEMODE_FAST) - { - return 0; - } - else - { - SDL_Unsupported(); - texture->scaleMode = SDL_SCALEMODE_FAST; - return -1; - } - break; - case SDL_SCALEMODE_SLOW: - if ((renderer->info.scale_modes & SDL_SCALEMODE_SLOW)==SDL_SCALEMODE_SLOW) - { - return 0; - } - else - { - SDL_Unsupported(); - texture->scaleMode = SDL_SCALEMODE_SLOW; - return -1; - } - break; - case SDL_SCALEMODE_BEST: - SDL_Unsupported(); - texture->scaleMode = SDL_SCALEMODE_SLOW; - return -1; - default: - SDL_Unsupported(); - texture->scaleMode = SDL_SCALEMODE_NONE; - return -1; - } - - SDL_Unsupported(); - return -1; -} - -static int photon_updatetexture(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, const void *pixels, int pitch) {