From a806de85139ffc972b38704c2caede076cbef67f Mon Sep 17 00:00:00 2001 From: onpon4 Date: Wed, 29 Apr 2015 21:24:01 -0400 Subject: [PATCH] Fixed failure to redden ships. This long-standing bug was caused by using blending when trying to copy an image, though for some reason it was inconsistent. Thanks to everyone on the SDL mailing list for helping me solve this one! --- src/resources.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/resources.cpp b/src/resources.cpp index 1d63464..a40b1fc 100644 --- a/src/resources.cpp +++ b/src/resources.cpp @@ -81,7 +81,9 @@ void loadGameGraphics() continue; shipShape[i] = createSurface(shipShape[i - SHIP_HIT_INDEX]->w, shipShape[i - SHIP_HIT_INDEX]->h); + SDL_SetSurfaceBlendMode(shipShape[i - SHIP_HIT_INDEX], SDL_BLENDMODE_NONE); blit(shipShape[i - SHIP_HIT_INDEX], 0, 0, shipShape[i]); + SDL_SetSurfaceBlendMode(shipShape[i - SHIP_HIT_INDEX], SDL_BLENDMODE_BLEND); switch (shipShape[i]->format->BitsPerPixel) {