SDLPP: Texture - use SDL_Color
This commit is contained in:
parent
8540573455
commit
4cd351c7a3
@ -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 );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user