hedgewars/uVisualGears.pas
changeset 4792 68f9b331014a
parent 4782 603916ddf4b6
child 4806 48c1a395f0a7
--- a/hedgewars/uVisualGears.pas	Fri Dec 31 00:37:39 2010 +0100
+++ b/hedgewars/uVisualGears.pas	Fri Dec 31 01:05:23 2010 +0100
@@ -32,6 +32,7 @@
 procedure DeleteVisualGear(Gear: PVisualGear);
 function  VisualGearByUID(uid : Longword) : PVisualGear;
 procedure AddClouds;
+procedure ChangeToSDClouds;
 procedure AddDamageTag(X, Y, Damage, Color: LongWord);
 
 implementation
@@ -558,6 +559,24 @@
     AddVisualGear(cLeftScreenBorder + i * cScreenSpace div (cCloudsNumber + 1), LAND_HEIGHT-1184, vgtCloud)
 end;
 
+procedure ChangeToSDClouds;
+var       i: LongInt;
+    vg, tmp: PVisualGear;
+begin
+if cCloudsNumber = cSDCloudsNumber then exit;
+vg:= VisualGearsList;
+while vg <> nil do
+    if vg^.Kind = vgtCloud then
+        begin
+        tmp:= vg^.NextGear;
+        DeleteVisualGear(vg);
+        vg:= tmp
+        end
+    else vg:= vg^.NextGear;
+for i:= 0 to cSDCloudsNumber - 1 do
+    AddVisualGear(cLeftScreenBorder + i * cScreenSpace div (cSDCloudsNumber + 1), LAND_HEIGHT-1184, vgtCloud)
+end;
+
 procedure initModule;
 begin
     VisualGearsList:= nil;