From f698ddabdc4893967eded5d3e3132dbbeec2e4d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boldizs=C3=A1r=20Lipka?= Date: Sun, 15 Jun 2014 23:38:37 +0200 Subject: [PATCH] Remove set_blend_mode from ttexture. I can't think of any use case when we would use anything else than SDL_BLENDMODE_BLEND. If anyone can, they can re-add it. --- src/sdl/texture.cpp | 14 ++------------ src/sdl/texture.hpp | 12 ------------ 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/src/sdl/texture.cpp b/src/sdl/texture.cpp index 1743c9aa9a26..1bd6d4ff35a7 100644 --- a/src/sdl/texture.cpp +++ b/src/sdl/texture.cpp @@ -46,6 +46,7 @@ ttexture::ttexture(SDL_Renderer& renderer, , alpha_(0) , source_surface_(NULL) { + SDL_SetTextureBlendMode(texture_, SDL_BLENDMODE_BLEND); if(!texture_) { throw texception("Failed to create a SDL_Texture object.", true); } @@ -336,18 +337,6 @@ Uint8 ttexture::alpha() const return alpha_; } -void ttexture::set_blend_mode(SDL_BlendMode mode) -{ - SDL_SetTextureBlendMode(texture_, mode); -} - -SDL_BlendMode ttexture::blend_mode() const -{ - SDL_BlendMode res; - SDL_GetTextureBlendMode(texture_, &res); - return res; -} - void ttexture::set_color_mod(Uint8 r, Uint8 g, Uint8 b) { mod_r_ = r; @@ -431,6 +420,7 @@ void ttexture::initialise_from_surface(SDL_Renderer& renderer, const int access) } else { throw texception("Unknown texture access mode.", false); } + SDL_SetTextureBlendMode(texture_, SDL_BLENDMODE_BLEND); } } // namespace sdl diff --git a/src/sdl/texture.hpp b/src/sdl/texture.hpp index 6457784648f5..73d29fee3219 100644 --- a/src/sdl/texture.hpp +++ b/src/sdl/texture.hpp @@ -259,18 +259,6 @@ class ttexture */ Uint8 alpha() const; - /** - * Sets the blend mode of the texture. - * - * @param mode One of the values enumerated in SDL_BlendMode. - */ - void set_blend_mode(SDL_BlendMode mode); - - /** - * Returns the blend mode of the texture. - */ - SDL_BlendMode blend_mode() const; - /** * Sets the color modulation of the texture. *