From ba869f210b52f6414612a9d478b9cc7d68141a9f Mon Sep 17 00:00:00 2001 From: gewlitys Date: Sun, 22 Sep 2002 21:41:23 +0000 Subject: [PATCH] Another fade bugfix git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@69 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/graphics/sdl/pure.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sc2/src/sc2code/libs/graphics/sdl/pure.c b/sc2/src/sc2code/libs/graphics/sdl/pure.c index 302bf8aeb..335f43fb1 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/pure.c +++ b/sc2/src/sc2code/libs/graphics/sdl/pure.c @@ -116,6 +116,8 @@ TFB_Pure_InitGraphics (int driver, int flags, int width, int height, int bpp) SDL_FreeSurface (test_extra); + + if (SDL_Video->format->BytesPerPixel != SDL_Screen->format->BytesPerPixel) { fprintf (stderr, "Fatal error: SDL_Video and SDL_Screen bpp doesn't match (%d vs. %d)\n", @@ -144,7 +146,7 @@ TFB_Pure_SwapBuffers () } else { - SDL_SetAlpha (fade_white, SDL_SRCALPHA, 255 - (255 - fade_amount)); + SDL_SetAlpha (fade_white, SDL_SRCALPHA, fade_amount - 255); SDL_BlitSurface (fade_white, NULL, backbuffer, NULL); } } @@ -267,6 +269,7 @@ TFB_Pure_SwapBuffers () } src_p = src_p2; for (x = 0; x < 320; ++x) + { pixval_32 = *(Uint32*)src_p; src_p += 4;