Use SkyL if SkyR is not included. Saves a bit of texture memory and removes some redundant files.
authornemo
Mon, 17 Oct 2011 11:21:08 -0400
changeset 6135 2172330ad52a
parent 6134 bd7925eba0b8
child 6136 db9eafaa66d5
Use SkyL if SkyR is not included. Saves a bit of texture memory and removes some redundant files.
hedgewars/uWorld.pas
share/hedgewars/Data/Themes/Bamboo/SkyR.png
share/hedgewars/Data/Themes/CrazyMission/SkyR.png
share/hedgewars/Data/Themes/EarthRise/SkyR.png
share/hedgewars/Data/Themes/Golf/SkyR.png
share/hedgewars/Data/Themes/Halloween/SkyR.png
share/hedgewars/Data/Themes/Jungle/SkyR.png
share/hedgewars/Data/Themes/Sheep/SkyR.png
share/hedgewars/Data/Themes/Stage/SkyR.png
--- a/hedgewars/uWorld.pas	Mon Oct 17 02:07:58 2011 +0200
+++ b/hedgewars/uWorld.pas	Mon Oct 17 11:21:08 2011 -0400
@@ -536,7 +536,7 @@
 var i, w, h, lw, lh, rw, rh, sw: LongInt;
 begin
     sw:= round(cScreenWidth / cScaleFactor);
-    if ((SpritesData[sprL].Texture = nil) or (SpritesData[sprR].Texture = nil)) and (SpritesData[spr].Texture <> nil) then
+    if (SpritesData[sprL].Texture = nil) and (SpritesData[spr].Texture <> nil) then
         begin
         w:= SpritesData[spr].Width * SpritesData[spr].Texture^.Scale;
         h:= SpritesData[spr].Height * SpritesData[spr].Texture^.Scale;
@@ -554,8 +554,11 @@
         h:= SpritesData[spr].Height * SpritesData[spr].Texture^.Scale;
         lw:= SpritesData[sprL].Width * SpritesData[spr].Texture^.Scale;
         lh:= SpritesData[sprL].Height * SpritesData[spr].Texture^.Scale;
-        rw:= SpritesData[sprR].Width * SpritesData[spr].Texture^.Scale;
-        rh:= SpritesData[sprR].Height * SpritesData[spr].Texture^.Scale;
+        if SpritesData[sprR].Texture <> nil then
+            begin
+            rw:= SpritesData[sprR].Width * SpritesData[spr].Texture^.Scale;
+            rh:= SpritesData[sprR].Height * SpritesData[spr].Texture^.Scale
+            end;
         dec(Shift, w div 2);
         DrawTexture(Shift, WorldDy + LAND_HEIGHT + OffsetY - h, SpritesData[spr].Texture, SpritesData[spr].Texture^.Scale);
 
@@ -567,11 +570,18 @@
             end;
 
         i:= Shift + w;
-        while i <= sw do
-            begin
-            DrawTexture(i, WorldDy + LAND_HEIGHT + OffsetY - rh, SpritesData[sprR].Texture, SpritesData[sprR].Texture^.Scale);
-            inc(i, rw)
-            end
+        if SpritesData[sprR].Texture <> nil then
+            while i <= sw do
+                begin
+                DrawTexture(i, WorldDy + LAND_HEIGHT + OffsetY - rh, SpritesData[sprR].Texture, SpritesData[sprR].Texture^.Scale);
+                inc(i, rw)
+                end
+        else
+            while i <= sw do
+                begin
+                DrawTexture(i, WorldDy + LAND_HEIGHT + OffsetY - lh, SpritesData[sprL].Texture, SpritesData[sprL].Texture^.Scale);
+                inc(i, lw)
+                end
         end
 end;
 
Binary file share/hedgewars/Data/Themes/Bamboo/SkyR.png has changed
Binary file share/hedgewars/Data/Themes/CrazyMission/SkyR.png has changed
Binary file share/hedgewars/Data/Themes/EarthRise/SkyR.png has changed
Binary file share/hedgewars/Data/Themes/Golf/SkyR.png has changed
Binary file share/hedgewars/Data/Themes/Halloween/SkyR.png has changed
Binary file share/hedgewars/Data/Themes/Jungle/SkyR.png has changed
Binary file share/hedgewars/Data/Themes/Sheep/SkyR.png has changed
Binary file share/hedgewars/Data/Themes/Stage/SkyR.png has changed