Allow theme to set custom water color
authorunc0rr
Fri, 12 Sep 2008 18:00:49 +0000
changeset 1256 2754a6a8c8f1
parent 1255 7ffc2c9e7224
child 1257 40d37fefdbb4
Allow theme to set custom water color
hedgewars/uLandObjects.pas
hedgewars/uWorld.pas
share/hedgewars/Data/Themes/Bamboo/theme.cfg
share/hedgewars/Data/Themes/Bath/theme.cfg
share/hedgewars/Data/Themes/City/theme.cfg
share/hedgewars/Data/Themes/EarthRise/theme.cfg
share/hedgewars/Data/Themes/Freeway/theme.cfg
share/hedgewars/Data/Themes/Island/theme.cfg
share/hedgewars/Data/Themes/Planes/theme.cfg
share/hedgewars/Data/Themes/Sheep/theme.cfg
share/hedgewars/Data/Themes/Snow/theme.cfg
share/hedgewars/Data/Themes/cheese/theme.cfg
share/hedgewars/Data/Themes/hell/theme.cfg
share/hedgewars/Data/Themes/nature/theme.cfg
--- a/hedgewars/uLandObjects.pas	Fri Sep 12 14:57:42 2008 +0000
+++ b/hedgewars/uLandObjects.pas	Fri Sep 12 18:00:49 2008 +0000
@@ -27,7 +27,7 @@
 procedure AddOnLandObjects(Surface: PSDL_Surface);
 
 implementation
-uses uLand, uStore, uConsts, uMisc, uConsole, uRandom, uVisualGears, uFloat, GL, uSound;
+uses uLand, uStore, uConsts, uMisc, uConsole, uRandom, uVisualGears, uFloat, GL, uSound, uWorld;
 const MaxRects = 512;
       MAXOBJECTRECTS = 16;
       MAXTHEMEOBJECTS = 32;
@@ -357,6 +357,9 @@
 // read sky and explosion border colors
 Readln(f, c1.r, c1.g, c1. b);
 Readln(f, c2.r, c2.g, c2. b);
+// read water gradient colors
+Readln(f, WaterColor.r, WaterColor.g, WaterColor. b);
+Readln(f, DeepWaterColor.r, DeepWaterColor.g, DeepWaterColor. b);
 
 glClearColor(c1.r / 255, c1.g / 255, c1.b / 255, 0.99); // sky color
 cExplosionBorderColor:= c2.value or $FF000000;
--- a/hedgewars/uWorld.pas	Fri Sep 12 14:57:42 2008 +0000
+++ b/hedgewars/uWorld.pas	Fri Sep 12 18:00:49 2008 +0000
@@ -31,11 +31,12 @@
 var cntTicks: LongWord;
 {$ENDIF}
 var FollowGear: PGear = nil;
-    WindBarWidth: LongInt = 0;
-    bShowAmmoMenu: boolean = false;
-    bSelected: boolean = false;
-    bShowFinger: boolean = false;
-    Frames: Longword = 0;
+	WindBarWidth: LongInt = 0;
+	bShowAmmoMenu: boolean = false;
+	bSelected: boolean = false;
+	bShowFinger: boolean = false;
+	Frames: Longword = 0;
+	WaterColor, DeepWaterColor: TSDL_Color;
 
 implementation
 uses uStore, uMisc, uTeams, uIO, uConsole, uKeys, uLocale, uSound, GL,
@@ -51,10 +52,10 @@
                    end;
 
 var cWaterSprCount: LongInt;
-    Captions: array[TCapGroup] of TCaptionStr;
-    AMxShift, SlotsNum: LongInt;
-    tmpSurface: PSDL_Surface;
-    fpsTexture: PTexture = nil;
+	Captions: array[TCapGroup] of TCaptionStr;
+	AMxShift, SlotsNum: LongInt;
+	tmpSurface: PSDL_Surface;
+	fpsTexture: PTexture = nil;
 
 procedure InitWorld;
 begin
@@ -208,14 +209,13 @@
 
    glDisable(GL_TEXTURE_2D);
    glBegin(GL_QUADS);
-    glColor3ub($54, $5C, $9D); // water color
+    glColor3ub(WaterColor.r, WaterColor.g, WaterColor. b); // water color
     glVertex2i(0, r.y);
     glVertex2i(cScreenWidth, r.y);
-    glColor3ub($34, $3C, $7D); // deep water color
+    glColor3ub(DeepWaterColor.r, DeepWaterColor.g, DeepWaterColor. b); // deep water color
     glVertex2i(cScreenWidth, cScreenHeight);
     glVertex2i(0, cScreenHeight);
    glEnd();
-
    glColor4f(1, 1, 1, 1); // disable coloring
    glEnable(GL_TEXTURE_2D)
    end;
--- a/share/hedgewars/Data/Themes/Bamboo/theme.cfg	Fri Sep 12 14:57:42 2008 +0000
+++ b/share/hedgewars/Data/Themes/Bamboo/theme.cfg	Fri Sep 12 18:00:49 2008 +0000
@@ -1,5 +1,7 @@
 117 141 186
 86 106 33
+$54 $5C $9D
+$34 $3C $7D
 oriental.ogg
 9
 4
--- a/share/hedgewars/Data/Themes/Bath/theme.cfg	Fri Sep 12 14:57:42 2008 +0000
+++ b/share/hedgewars/Data/Themes/Bath/theme.cfg	Fri Sep 12 18:00:49 2008 +0000
@@ -1,5 +1,7 @@
 255 255 237
 28 52 9
+$54 $5C $9D
+$34 $3C $7D
 Nature.ogg
 9
 0
--- a/share/hedgewars/Data/Themes/City/theme.cfg	Fri Sep 12 14:57:42 2008 +0000
+++ b/share/hedgewars/Data/Themes/City/theme.cfg	Fri Sep 12 18:00:49 2008 +0000
@@ -1,5 +1,7 @@
 21 20 38
 128 0 0
+$54 $5C $9D
+$34 $3C $7D
 city.ogg
 45
 4
--- a/share/hedgewars/Data/Themes/EarthRise/theme.cfg	Fri Sep 12 14:57:42 2008 +0000
+++ b/share/hedgewars/Data/Themes/EarthRise/theme.cfg	Fri Sep 12 18:00:49 2008 +0000
@@ -1,5 +1,7 @@
 0 0 0
 106 106 106
+$54 $5C $9D
+$34 $3C $7D
 city.ogg
 0
 2
--- a/share/hedgewars/Data/Themes/Freeway/theme.cfg	Fri Sep 12 14:57:42 2008 +0000
+++ b/share/hedgewars/Data/Themes/Freeway/theme.cfg	Fri Sep 12 18:00:49 2008 +0000
@@ -1,5 +1,7 @@
 99 51 43
 22 10 7
+$54 $5C $9D
+$34 $3C $7D
 
 9
 2
--- a/share/hedgewars/Data/Themes/Island/theme.cfg	Fri Sep 12 14:57:42 2008 +0000
+++ b/share/hedgewars/Data/Themes/Island/theme.cfg	Fri Sep 12 18:00:49 2008 +0000
@@ -1,5 +1,7 @@
 21 20 38
 128 0 0
+$54 $5C $9D
+$34 $3C $7D
 pirate.ogg
 9
 4
--- a/share/hedgewars/Data/Themes/Planes/theme.cfg	Fri Sep 12 14:57:42 2008 +0000
+++ b/share/hedgewars/Data/Themes/Planes/theme.cfg	Fri Sep 12 18:00:49 2008 +0000
@@ -1,5 +1,7 @@
 21 20 38
 177 175 49
+$54 $5C $9D
+$34 $3C $7D
 city.ogg
 9
 0
--- a/share/hedgewars/Data/Themes/Sheep/theme.cfg	Fri Sep 12 14:57:42 2008 +0000
+++ b/share/hedgewars/Data/Themes/Sheep/theme.cfg	Fri Sep 12 18:00:49 2008 +0000
@@ -1,5 +1,7 @@
 66 71 141
 51 51 51
+$54 $5C $9D
+$34 $3C $7D
 Nature.ogg
 4
 7
--- a/share/hedgewars/Data/Themes/Snow/theme.cfg	Fri Sep 12 14:57:42 2008 +0000
+++ b/share/hedgewars/Data/Themes/Snow/theme.cfg	Fri Sep 12 18:00:49 2008 +0000
@@ -1,5 +1,7 @@
 21 20 38
 128 0 0
+$54 $5C $9D
+$34 $3C $7D
 snow.ogg
 9
 4
--- a/share/hedgewars/Data/Themes/cheese/theme.cfg	Fri Sep 12 14:57:42 2008 +0000
+++ b/share/hedgewars/Data/Themes/cheese/theme.cfg	Fri Sep 12 18:00:49 2008 +0000
@@ -1,5 +1,7 @@
 222 223 132
 177 175 49
+$54 $5C $9D
+$34 $3C $7D
 city.ogg
 9
 0
--- a/share/hedgewars/Data/Themes/hell/theme.cfg	Fri Sep 12 14:57:42 2008 +0000
+++ b/share/hedgewars/Data/Themes/hell/theme.cfg	Fri Sep 12 18:00:49 2008 +0000
@@ -1,5 +1,7 @@
 10 10 10
 100 0 0
+$CA $18 $0D
+$AA $08 $00
 hell.ogg
 9
 4
--- a/share/hedgewars/Data/Themes/nature/theme.cfg	Fri Sep 12 14:57:42 2008 +0000
+++ b/share/hedgewars/Data/Themes/nature/theme.cfg	Fri Sep 12 18:00:49 2008 +0000
@@ -1,5 +1,7 @@
 26 12 101
 128 0 0
+$54 $5C $9D
+$34 $3C $7D
 Nature.ogg
 9
 4