Experiment in eliminating transparent white from LandPixels - I think it messes up on some graphics cards. Noticed a curious white border on a girder in a theme Randy is working on. At the very least it is slightly more efficient in the blit.
authornemo
Tue, 27 Dec 2011 14:14:26 -0500
changeset 6534 e6cb8a41b5f4
parent 6533 2cede73aa627
child 6535 51a7e71ad317
Experiment in eliminating transparent white from LandPixels - I think it messes up on some graphics cards. Noticed a curious white border on a girder in a theme Randy is working on. At the very least it is slightly more efficient in the blit.
hedgewars/uLandObjects.pas
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/FrontendDataUtils.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/GameMode.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Grave.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Map.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Scheme.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Team.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Weapon.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/UserInput/TouchInterface.java
share/hedgewars/Data/Scripts/plist/Racer.plist
--- a/hedgewars/uLandObjects.pas	Tue Dec 20 16:13:17 2011 -0500
+++ b/hedgewars/uLandObjects.pas	Tue Dec 27 14:14:26 2011 -0500
@@ -85,24 +85,24 @@
 for y:= 0 to Pred(Image^.h) do
     begin
     for x:= 0 to Pred(Width) do
-        begin
+        if (p^[x] and AMask) <> 0 then
+            begin
             if (cReducedQuality and rqBlurryLand) = 0 then
-            begin
+                begin
                 if (LandPixels[cpY + y, cpX + x] = 0) or 
 		   (((p^[x] and AMask) <> 0) and (((LandPixels[cpY + y, cpX + x] and AMask) shr AShift) < 255)) then
                     LandPixels[cpY + y, cpX + x]:= p^[x];
-            end
+                end
             else
                 if LandPixels[(cpY + y) div 2, (cpX + x) div 2] = 0 then 
                     LandPixels[(cpY + y) div 2, (cpX + x) div 2]:= p^[x];
 
-
-        if ((Land[cpY + y, cpX + x] and $FF00) = 0) and ((p^[x] and AMask) <> 0) then
-            begin
-            Land[cpY + y, cpX + x]:= lfObject;
-            Land[cpY + y, cpX + x]:= Land[cpY + y, cpX + x] or extraFlags
+            if ((Land[cpY + y, cpX + x] and $FF00) = 0) and ((p^[x] and AMask) <> 0) then
+                begin
+                Land[cpY + y, cpX + x]:= lfObject;
+                Land[cpY + y, cpX + x]:= Land[cpY + y, cpX + x] or extraFlags
+                end;
             end;
-        end;
     p:= @(p^[Image^.pitch shr 2])
     end;