From: Tobias Markus Date: Mon, 12 May 2014 11:02:03 +0000 (+0200) Subject: More fixes, SetAlpha problems remaining X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=09eb99e9854fa3b1c9b5c1d12a894b4ba9650516;p=supertux.git More fixes, SetAlpha problems remaining --- diff --git a/src/video/sdl/sdl_renderer.cpp b/src/video/sdl/sdl_renderer.cpp index f4a99d23a..4124f09f4 100644 --- a/src/video/sdl/sdl_renderer.cpp +++ b/src/video/sdl/sdl_renderer.cpp @@ -140,8 +140,6 @@ SDLRenderer::SDLRenderer() : int width = 800; //FIXME: config->screenwidth; int height = 600; //FIXME: config->screenheight; - SDL_Window *window; // Declare a pointer to an SDL_Window - SDL_Init(SDL_INIT_VIDEO); // Initialize SDL2 window = SDL_CreateWindow( @@ -222,7 +220,7 @@ SDLRenderer::draw_surface(const DrawingRequest& request) { alpha = 255; } - SDL_SetAlpha(transform, SDL_SRCALPHA, (Uint8) (request.alpha * alpha)); + SDL_SetSurfaceAlphaMod(transform, (Uint8) (request.alpha * alpha)); } /*else { @@ -419,7 +417,7 @@ SDLRenderer::do_take_screenshot() { // [Christoph] TODO: Yes, this method also takes care of the actual disk I/O. Split it? - SDL_Surface *screen = SDL_GetVideoSurface(); + SDL_Surface *screen = SDL_GetWindowSurface(window); // save screenshot static const std::string writeDir = PHYSFS_getWriteDir(); diff --git a/src/video/sdl/sdl_renderer.hpp b/src/video/sdl/sdl_renderer.hpp index d572f5cc5..1276c1cf6 100644 --- a/src/video/sdl/sdl_renderer.hpp +++ b/src/video/sdl/sdl_renderer.hpp @@ -40,6 +40,7 @@ public: private: SDL_Surface *screen; + SDL_Window *window; SDL_Renderer *renderer; int numerator; int denominator;