From 4cd351c7a37c089aa310d10e6aeefb5542c4aab6 Mon Sep 17 00:00:00 2001 From: zvon Date: Mon, 15 Mar 2021 14:48:48 +0100 Subject: [PATCH] SDLPP: Texture - use SDL_Color --- sdlpp/sdlpp_texture.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sdlpp/sdlpp_texture.cpp b/sdlpp/sdlpp_texture.cpp index b9431ee..08459c6 100644 --- a/sdlpp/sdlpp_texture.cpp +++ b/sdlpp/sdlpp_texture.cpp @@ -10,11 +10,10 @@ Texture::Texture( std::shared_ptr< Renderer > &renderer, throw "IMG_Load error"; } if ( !color_key.empty() ) { - auto colors = getColorsHEX( color_key ); - SDL_SetColorKey( surface, SDL_TRUE, - SDL_MapRGB( surface->format, std::get< 0 >( colors ), - std::get< 1 >( colors ), - std::get< 2 >( colors ) ) ); + auto color = getSDLColorHEX( color_key ); + SDL_SetColorKey( + surface, SDL_TRUE, + SDL_MapRGB( surface->format, color.r, color.g, color.b ) ); } setTextureFromSurface( renderer, surface ); }