don't use colorkey for land spray
authorsheepluva
Fri, 29 Sep 2017 22:33:15 +0200
changeset 12593 d6bd8b327a09
parent 12592 00b539e6115d
child 12595 0d4a6ea7f071
don't use colorkey for land spray this fixes issue #220
hedgewars/uConsts.pas
hedgewars/uLandObjects.pas
--- a/hedgewars/uConsts.pas	Fri Sep 29 22:09:11 2017 +0200
+++ b/hedgewars/uConsts.pas	Fri Sep 29 22:33:15 2017 +0200
@@ -90,10 +90,11 @@
     rqDesyncVBlank= $00000800;  // don't sync on vblank
 
     // image flags (for LoadImage())
+    // TODO: discuss whether ifAlpha and ifColorKey are actually needed and if and where we want to support which colorkeys
     ifNone        = $00000000;  // nothing special
     ifAlpha       = $00000001;  // use alpha channel (unused right now?)
     ifCritical    = $00000002;  // image is critical for gameplay (exit game if unable to load)
-    ifColorKey = $00000004;  // image uses transparent pixels (color keying)
+    ifColorKey    = $00000004;  // image uses transparent pixels (color keying)
     ifIgnoreCaps  = $00000008;  // ignore hardware capabilities when loading (i.e. image will not be drawn using OpenGL)
 
     // texture priority (allows OpenGL to keep frequently used textures in video memory more easily)
--- a/hedgewars/uLandObjects.pas	Fri Sep 29 22:09:11 2017 +0200
+++ b/hedgewars/uLandObjects.pas	Fri Sep 29 22:33:15 2017 +0200
@@ -762,7 +762,7 @@
         with SprayObjects.objs[Pred(SprayObjects.Count)] do
             begin
             i:= Pos(',', s);
-            Surf:= LoadDataImage(ptCurrTheme, Trim(Copy(s, 1, Pred(i))), ifColorKey or ifIgnoreCaps);
+            Surf:= LoadDataImage(ptCurrTheme, Trim(Copy(s, 1, Pred(i))), ifAlpha or ifIgnoreCaps);
             Width:= Surf^.w;
             Height:= Surf^.h;
             Delete(s, 1, i);