added rq-sky to themes so it can set sky color for low quality. also added tint of sky on sudden death. underwater theme is an example of this
authorHenek
Wed, 12 Jan 2011 20:31:55 +0100
changeset 4835 a6924450e694
parent 4834 3763a386a427
child 4836 680103541f15
added rq-sky to themes so it can set sky color for low quality. also added tint of sky on sudden death. underwater theme is an example of this
hedgewars/uGears.pas
hedgewars/uLandObjects.pas
hedgewars/uVariables.pas
hedgewars/uWorld.pas
share/hedgewars/Data/Themes/Underwater/SDClouds.png
share/hedgewars/Data/Themes/Underwater/theme.cfg
--- a/hedgewars/uGears.pas	Wed Jan 12 22:02:43 2011 +0300
+++ b/hedgewars/uGears.pas	Wed Jan 12 20:31:55 2011 +0100
@@ -802,6 +802,7 @@
                         SuddenDeathDmg:= true;
                         ChangeToSDClouds;
                         ChangeToSDFlakes;
+                        glClearColor(SDSkyColor.r / 255, SDSkyColor.g / 255, SDSkyColor.b / 255, 0.99);
                         end;
                     AddCaption(trmsg[sidSuddenDeath], cWhiteColor, capgrpGameState);
                     playSound(sndSuddenDeath);
--- a/hedgewars/uLandObjects.pas	Wed Jan 12 22:02:43 2011 +0300
+++ b/hedgewars/uLandObjects.pas	Wed Jan 12 20:31:55 2011 +0100
@@ -411,6 +411,9 @@
         Delete(s, 1, i);
         c1.b:= StrToInt(Trim(s));
         glClearColor(c1.r / 255, c1.g / 255, c1.b / 255, 0.99);
+        SDSkyColor.r:= byte(c1.r * SDTint div 255);
+        SDSkyColor.g:= byte(c1.g * SDTint div 255);
+        SDSkyColor.b:= byte(c1.b * SDTint div 255);
         end
     else if key = 'border' then
         begin
@@ -593,6 +596,23 @@
             vobSDCount:= vobSDCount * cScreenSpace div LAND_WIDTH;
             end;
         end
+    else if key = 'rq-sky' then
+        begin
+        if ((cReducedQuality and rqNoBackground) <> 0) then
+            begin
+            i:= Pos(',', s);
+            c1.r:= StrToInt(Trim(Copy(s, 1, Pred(i))));
+            Delete(s, 1, i);
+            i:= Pos(',', s);
+            c1.g:= StrToInt(Trim(Copy(s, 1, Pred(i))));
+            Delete(s, 1, i);
+            c1.b:= StrToInt(Trim(s));
+            glClearColor(c1.r / 255, c1.g / 255, c1.b / 255, 0.99);
+            SDSkyColor.r:= byte(c1.r * SDTint div 255);
+            SDSkyColor.g:= byte(c1.g * SDTint div 255);
+            SDSkyColor.b:= byte(c1.b * SDTint div 255);
+            end
+        end
     end;
 
 Close(f);
--- a/hedgewars/uVariables.pas	Wed Jan 12 22:02:43 2011 +0300
+++ b/hedgewars/uVariables.pas	Wed Jan 12 20:31:55 2011 +0100
@@ -126,6 +126,7 @@
     WaterColorArray : array[0..3] of HwColor4f;
     SDWaterColorArray : array[0..3] of HwColor4f;
     SDMusic         : shortstring;
+    SDTint          : LongInt;
 
     CursorPoint     : TPoint;
     TargetPoint     : TPoint;
@@ -2071,6 +2072,7 @@
     bShowFinger: boolean;
     Frames: Longword;
     WaterColor, DeepWaterColor: TSDL_Color;
+    SDSkyColor: TSDL_Color;
     SkyOffset: LongInt;
     HorizontOffset: LongInt;
 {$IFDEF COUNTTICKS}
@@ -2191,6 +2193,7 @@
     SDWaterColorArray[3]:= SDWaterColorArray[2];
 
     SDMusic:= 'main_theme.ogg';
+    SDTint:= $80;
 
     cDrownSpeed.QWordValue  := 257698038;       // 0.06
     cDrownSpeedf            := 0.06;
--- a/hedgewars/uWorld.pas	Wed Jan 12 22:02:43 2011 +0300
+++ b/hedgewars/uWorld.pas	Wed Jan 12 20:31:55 2011 +0100
@@ -601,8 +601,10 @@
             HorizontOffset:= HorizontOffset + ((ScreenBottom-SkyOffset) div 20);
 
         // background
+        if SuddenDeathDmg then Tint(SDTint, SDTint, SDTint, $FF);
         DrawRepeated(sprSky, sprSkyL, sprSkyR, (WorldDx + LAND_WIDTH div 2) * 3 div 8, SkyOffset);
         DrawRepeated(sprHorizont, sprHorizontL, sprHorizontR, (WorldDx + LAND_WIDTH div 2) * 3 div 5, HorizontOffset);
+        if SuddenDeathDmg then Tint($FF, $FF, $FF, $FF);
     end;
 
     DrawVisualGears(0);
Binary file share/hedgewars/Data/Themes/Underwater/SDClouds.png has changed
--- a/share/hedgewars/Data/Themes/Underwater/theme.cfg	Wed Jan 12 22:02:43 2011 +0300
+++ b/share/hedgewars/Data/Themes/Underwater/theme.cfg	Wed Jan 12 20:31:55 2011 +0100
@@ -11,3 +11,5 @@
 object = coral, 3, 10, 193, 38, 32, 2, 128, 66, 66, 94, 39, 0, 88, 167
 object = coral2, 3, 119, 146, 23, 22, 1, 5, 0, 123, 130
 flakes = 20, 20, 150, 0, 5
+sd-flakes = 20, 20, 150, 0, 5
+rq-sky = 0, 70, 210