aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sword2/driver/sprite.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/sword2/driver/sprite.cpp b/sword2/driver/sprite.cpp
index 601e003f5b..a886899c55 100644
--- a/sword2/driver/sprite.cpp
+++ b/sword2/driver/sprite.cpp
@@ -505,6 +505,10 @@ int32 Graphics::drawSprite(SpriteInfo *s) {
if ((_renderCaps & RDBLTFX_SHADOWBLEND) && _lightMask && (scale != 256 || (s->type & RDSPR_SHADOW))) {
byte *lightMap;
+ // Make sure that we never apply the shadow to the original
+ // resource data. This could only ever happen in the
+ // RDSPR_NOCOMPRESSION case.
+
if (!freeSprite) {
newSprite = (byte *) malloc(s->w * s->h);
memcpy(newSprite, sprite, s->w * s->h);