From: Tobias Markus Date: Sat, 7 Mar 2015 20:20:03 +0000 (+0100) Subject: Proper fix for waterfall tiles X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=9af7ca781183b7d57410e5cd3b8bc7f8128ed1b0;p=supertux.git Proper fix for waterfall tiles --- diff --git a/src/video/texture_manager.cpp b/src/video/texture_manager.cpp index ae272b323..f334275d4 100644 --- a/src/video/texture_manager.cpp +++ b/src/video/texture_manager.cpp @@ -146,17 +146,13 @@ TextureManager::create_image_texture_raw(const std::string& filename, const Rect throw std::runtime_error(msg.str()); } - SDL_PixelFormat* format = image->format; - if(format->Rmask == 0 && format->Gmask == 0 && format->Bmask == 0 && format->Amask == 0) { - log_warning << "Wrong surface format for image " << filename << ". Compensating." << std::endl; + m_surfaces[filename] = image; + } - SDL_Surface* converted_surf = SDL_ConvertSurfaceFormat(image, SDL_PIXELFORMAT_RGBA8888, 0); - m_surfaces[filename] = converted_surf; - } - else - { - m_surfaces[filename] = image; - } + SDL_PixelFormat* format = image->format; + if(format->Rmask == 0 && format->Gmask == 0 && format->Bmask == 0 && format->Amask == 0) { + log_warning << "Wrong surface format for image " << filename << ". Compensating." << std::endl; + image = SDL_ConvertSurfaceFormat(image, SDL_PIXELFORMAT_RGBA8888, 0); } SDLSurfacePtr subimage(SDL_CreateRGBSurfaceFrom(static_cast(image->pixels) +