--- a/hedgewars/CCHandlers.inc Mon Oct 26 10:39:20 2009 +0000
+++ b/hedgewars/CCHandlers.inc Thu Oct 29 17:51:54 2009 +0000
@@ -81,7 +81,7 @@
val(s, Color);
TryDo(Color <> 0, 'Error: black team color', true);
- Color:= Color or $FF000000;
+ Color:= Color or AMask;
AddTeam(Color);
CurrentTeam^.TeamName:= ts;
--- a/hedgewars/SDLh.pas Mon Oct 26 10:39:20 2009 +0000
+++ b/hedgewars/SDLh.pas Thu Oct 29 17:51:54 2009 +0000
@@ -660,6 +660,7 @@
function IMG_Load(const _file: PChar): PSDL_Surface; cdecl; external SDL_ImageLibName;
function IMG_LoadPNG_RW(rwop: PSDL_RWops): PSDL_Surface; cdecl; external SDL_ImageLibName;
+
(* SDL_net *)
const {$IFDEF WIN32}
--- a/hedgewars/uLand.pas Mon Oct 26 10:39:20 2009 +0000
+++ b/hedgewars/uLand.pas Thu Oct 29 17:51:54 2009 +0000
@@ -610,7 +610,7 @@
for y:= 0 to LAND_HEIGHT - 1 do
begin
for x:= 0 to LAND_WIDTH - 1 do
- if Land[y, x] <> 0 then LandPixels[y, x]:= p^[x] or $FF000000;
+ if Land[y, x] <> 0 then LandPixels[y, x]:= p^[x] or AMask;
p:= @(p^[Surface^.pitch div 4]);
end;
@@ -686,11 +686,11 @@
begin
for x:= 0 to Pred(tmpsurf^.w) do
begin
- if (($FF000000 and p^[x]) = 0) then // Tiy was having trouble generating transparent black
+ if ((AMask and p^[x]) = 0) then // Tiy was having trouble generating transparent black
Land[cpY + y, cpX + x]:= 0
- else if p^[x] = $FF0000FF then
+ else if p^[x] = (AMask or RMask) then
Land[cpY + y, cpX + x]:= COLOR_INDESTRUCTIBLE
- else if p^[x] = $FFFFFFFF then
+ else if p^[x] = (AMask or RMask or GMask or BMask) then
Land[cpY + y, cpX + x]:= COLOR_LAND;
end;
@@ -788,9 +788,9 @@
Land[y, leftX + w]:= COLOR_INDESTRUCTIBLE;
Land[y, rightX - w]:= COLOR_INDESTRUCTIBLE;
if (y + w) mod 32 < 16 then
- c:= $FF000000
+ c:= AMask
else
- c:= $FF00FFFF;
+ c:= AMask or RMask or GMask;
LandPixels[y, leftX + w]:= c;
LandPixels[y, rightX - w]:= c;
end;
@@ -799,9 +799,9 @@
begin
Land[topY + w, x]:= COLOR_INDESTRUCTIBLE;
if (x + w) mod 32 < 16 then
- c:= $FF000000
+ c:= AMask
else
- c:= $FF00FFFF;
+ c:= AMask or RMask or GMask;
LandPixels[topY + w, x]:= c;
end;
end;
--- a/hedgewars/uLandObjects.pas Mon Oct 26 10:39:20 2009 +0000
+++ b/hedgewars/uLandObjects.pas Thu Oct 29 17:51:54 2009 +0000
@@ -90,9 +90,9 @@
if LandPixels[cpY + y, cpX + x] = 0 then
begin
LandPixels[cpY + y, cpX + x]:= p^[x];
- if (p^[x] and $FF000000) <> 0 then Land[cpY + y, cpX + x]:= COLOR_LAND;
+ if (p^[x] and AMask) <> 0 then Land[cpY + y, cpX + x]:= COLOR_LAND;
end;
- p:= @(p^[Image^.pitch div 4]);
+ p:= @(p^[Image^.pitch shr 2]);
end;
if SDL_MustLock(Image) then
@@ -381,7 +381,7 @@
WaterColorArray[3]:= WaterColorArray[2];
glClearColor(c1.r / 255, c1.g / 255, c1.b / 255, 0.99); // sky color
-cExplosionBorderColor:= c2.value or $FF000000;
+cExplosionBorderColor:= c2.value or AMask;
ReadLn(f, s);
if MusicFN = '' then MusicFN:= s;
--- a/hedgewars/uLandTexture.pas Mon Oct 26 10:39:20 2009 +0000
+++ b/hedgewars/uLandTexture.pas Thu Oct 29 17:51:54 2009 +0000
@@ -62,7 +62,7 @@
begin
for ty:= 0 to TEXSIZE - 1 do
for tx:= 0 to TEXSIZE - 1 do
- tmpPixels[ty, tx]:= Land[y * TEXSIZE + ty, x * TEXSIZE + tx] or $FF000000;
+ tmpPixels[ty, tx]:= Land[y * TEXSIZE + ty, x * TEXSIZE + tx] or AMask;
Pixels2:= @tmpPixels
end;
--- a/hedgewars/uStore.pas Mon Oct 26 10:39:20 2009 +0000
+++ b/hedgewars/uStore.pas Thu Oct 29 17:51:54 2009 +0000
@@ -217,7 +217,7 @@
// make black pixel be alpha-transparent
for i:= 0 to texsurf^.w * texsurf^.h - 1 do
- if PLongwordArray(texsurf^.pixels)^[i] = $FF000000 then PLongwordArray(texsurf^.pixels)^[i]:= 0;
+ if PLongwordArray(texsurf^.pixels)^[i] = AMask then PLongwordArray(texsurf^.pixels)^[i]:= 0;
if SDL_MustLock(texsurf) then
SDL_UnlockSurface(texsurf);
@@ -1140,7 +1140,7 @@
i:= (destY + srcY) * (dest^.pitch div 4) + destX + srcX;
j:= srcY * (src^.pitch div 4) + srcX;
// basic skip of transparent pixels - cleverness would be to do true alpha
- if (i < maxDest) and ($FF000000 and srcPixels^[j] <> 0) then destPixels^[i]:= srcPixels^[j];
+ if (i < maxDest) and (AMask and srcPixels^[j] <> 0) then destPixels^[i]:= srcPixels^[j];
end;
end;