diff options
author | Ludovic Pouzenc <lpouzenc@gmail.com> | 2013-07-24 13:04:49 +0200 |
---|---|---|
committer | Ludovic Pouzenc <lpouzenc@gmail.com> | 2013-07-24 13:04:49 +0200 |
commit | c6794f9492fad46042473b8c6e0c19c16d1c8dd8 (patch) | |
tree | 9a4290657ddd27848e5d87ccf39031b44c994fd5 | |
parent | 7192271eb025088ff286bb0a8b04491c9ad87d73 (diff) | |
download | mplemmings-c6794f9492fad46042473b8c6e0c19c16d1c8dd8.tar.gz mplemmings-c6794f9492fad46042473b8c6e0c19c16d1c8dd8.tar.bz2 mplemmings-c6794f9492fad46042473b8c6e0c19c16d1c8dd8.zip |
Correction des problèmes avec la couleur de fond qui n'apparaissait pas (evil alpha)
-rw-r--r-- | src/graphic.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/graphic.c b/src/graphic.c index c0b1d24..89f418a 100644 --- a/src/graphic.c +++ b/src/graphic.c @@ -91,12 +91,9 @@ int paintTerrain(gameIni_t *gIni, gameRess_t *gRess, gameState_t *gState) { int i, modifier; int x,y,xmin,xmax,ymin,ymax,y2,xdst,ydst; Uint32 srcPixel, dstPixel, dstStencil; - Uint32 cc_nothing, cc_terrain, rmask, gmask, bmask, amask; + Uint32 cc_nothing, cc_terrain, cc_background, rmask, gmask, bmask, amask; SDL_Surface *tile; - cc_nothing=0xFF000000; /* Make it portable (big endian) */ - cc_terrain=0xFFFFAAAA; /* Make it portable (big endian) */ - res=SDL_PixelFormatEnumToMasks(SDL_PIXELFORMAT_ARGB8888, &bpp, &rmask, &gmask, &bmask, &amask); MPL_CHECK( res==SDL_TRUE, @@ -114,9 +111,12 @@ int paintTerrain(gameIni_t *gIni, gameRess_t *gRess, gameState_t *gState) { "paintTerrain(), SDL_CreateRGBSurface() failed" ); + cc_nothing=0xFF000000; /* Make it portable (big endian) */ + cc_terrain=0xFFFFAAAA; /* Make it portable (big endian) */ + cc_background = gIni->style.bgColor | amask; /* Fill the entire surfaces with default color */ - res =SDL_FillRect(gState->terrain, NULL, gIni->style.bgColor); + res =SDL_FillRect(gState->terrain, NULL, cc_background); res2=SDL_FillRect(gState->stencil, NULL, cc_nothing); MPL_CHECK( res==0 && res2==0, @@ -186,9 +186,9 @@ int paintTerrain(gameIni_t *gIni, gameRess_t *gRess, gameState_t *gState) { // If we are in NO_OVERRIDE mode and there is already a terrain on the current (source) pixel if ( !( (modifier & 8) == 8 && PIXEL32(gState->stencil, xdst, ydst) == cc_terrain ) ) { - // If we have REMOVE modifier, dstPixel will be rolled back to bgColor, else, it will be identical to the source pixel. We have to update stencil consistenly. + // If we have REMOVE modifier, dstPixel will be rolled back to cc_background, else, it will be identical to the source pixel. We have to update stencil consistenly. if ( (modifier & 2) == 2 ) { - dstPixel=gIni->style.bgColor; + dstPixel=cc_background; dstStencil=cc_nothing; } else { dstPixel=srcPixel; |