5131 iceSurface: PSDL_Surface; |
5131 iceSurface: PSDL_Surface; |
5132 icePixels: PLongwordArray; |
5132 icePixels: PLongwordArray; |
5133 pictureX, pictureY: LongInt; |
5133 pictureX, pictureY: LongInt; |
5134 w, c: LongWord; |
5134 w, c: LongWord; |
5135 begin |
5135 begin |
|
5136 if Land[y, x] and lfIce <> 0 then exit; |
5136 // So. 3 parameters here. Ice colour, Ice opacity, and a bias on the greyscaled pixel towards lightness |
5137 // So. 3 parameters here. Ice colour, Ice opacity, and a bias on the greyscaled pixel towards lightness |
5137 c:= $7dc1ccff; |
|
5138 // FIXME should be a global value, not set every single pixel. Just for test purposes |
|
5139 c:= ($44 shl RShift) or ($97 shl GShift) or ($A9 shl BShift) or ($A0 shl AShift); |
|
5140 iceSurface:= SpritesData[sprIceTexture].Surface; |
5138 iceSurface:= SpritesData[sprIceTexture].Surface; |
5141 pictureX := x mod iceSurface^.w; |
5139 pictureX := x mod iceSurface^.w; |
5142 pictureY := y mod iceSurface^.h; |
5140 pictureY := y mod iceSurface^.h; |
5143 icePixels := iceSurface^.pixels; |
5141 icePixels := iceSurface^.pixels; |
5144 w:= LandPixels[y, x]; |
5142 w:= LandPixels[y, x]; |
5147 (w shr GShift and $FF) * RGB_LUMINANCE_BLUE)); |
5145 (w shr GShift and $FF) * RGB_LUMINANCE_BLUE)); |
5148 if w < 128 then w:= w+128; |
5146 if w < 128 then w:= w+128; |
5149 if w > 255 then w:= 255; |
5147 if w > 255 then w:= 255; |
5150 w:= (w shl RShift) or (w shl BShift) or (w shl GShift) or (LandPixels[y,x] and AMask); |
5148 w:= (w shl RShift) or (w shl BShift) or (w shl GShift) or (LandPixels[y,x] and AMask); |
5151 //LandPixels[y, x]:= w; |
5149 //LandPixels[y, x]:= w; |
5152 LandPixels[y, x]:= addBgColor(w, c); |
5150 LandPixels[y, x]:= addBgColor(w, IceColor); |
5153 LandPixels[y, x]:= addBgColor(LandPixels[y, x], icePixels^[iceSurface^.w * (y mod iceSurface^.h) + (x mod iceSurface^.w)]); |
5151 LandPixels[y, x]:= addBgColor(LandPixels[y, x], icePixels^[iceSurface^.w * (y mod iceSurface^.h) + (x mod iceSurface^.w)]); |
5154 |
5152 |
5155 Land[y, x] := land[y, x] or lfIce; |
5153 Land[y, x] := Land[y, x] or lfIce; |
5156 end; |
5154 end; |
5157 |
5155 |
5158 procedure DrawIce(x, y: Longint); |
5156 procedure DrawIce(x, y: Longint); |
5159 const iceRadius :Longint = 32; |
5157 const iceRadius :Longint = 32; |
5160 var |
5158 var |