Use an ifdef instead, add despeckling of tunnels
authornemo
Sun, 26 Jun 2011 20:29:08 -0400
changeset 5332 b29d60c7cac7
parent 5330 0f31c8ab064b
child 5334 ce404661aac6
Use an ifdef instead, add despeckling of tunnels
QTfrontend/themesmodel.cpp
hedgewars/uLandGraphics.pas
share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua
--- a/QTfrontend/themesmodel.cpp	Sun Jun 26 20:19:11 2011 -0400
+++ b/QTfrontend/themesmodel.cpp	Sun Jun 26 20:29:08 2011 -0400
@@ -4,9 +4,9 @@
 ThemesModel::ThemesModel(QStringList themes, QObject *parent) :
     QAbstractListModel(parent)
 {
-/* Not Qt 4.6 compatible - needs an IFDEF
+#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
     m_data.reserve(themes.size());
-*/
+#endif
 
     foreach(QString theme, themes)
     {
--- a/hedgewars/uLandGraphics.pas	Sun Jun 26 20:19:11 2011 -0400
+++ b/hedgewars/uLandGraphics.pas	Sun Jun 26 20:29:08 2011 -0400
@@ -480,10 +480,13 @@
 procedure DrawTunnel(X, Y, dX, dY: hwFloat; ticks, HalfWidth: LongInt);
 var nx, ny, dX8, dY8: hwFloat;
     i, t, tx, ty, stX, stY, ddy, ddx: Longint;
+    despeckle : Boolean;
 begin  // (-dY, dX) is (dX, dY) rotated by PI/2
 stY:= hwRound(Y);
 stX:= hwRound(X);
 
+despeckle:= HalfWidth > 1;
+
 nx:= X + dY * (HalfWidth + 8);
 ny:= Y - dX * (HalfWidth + 8);
 
@@ -505,10 +508,10 @@
        ((Land[ty, tx] and lfObject) <> 0)) then
         begin
         Land[ty, tx]:= Land[ty, tx] or lfDamaged;
-            if (cReducedQuality and rqBlurryLand) = 0 then
+        if despeckle then LandDirty[ty div 32, tx div 32]:= 1;
+        if (cReducedQuality and rqBlurryLand) = 0 then
             LandPixels[ty, tx]:= cExplosionBorderColor
-            else
-            LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor
+        else LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor
         end
     end;
     nx:= nx - dY;
@@ -531,11 +534,10 @@
        ((Land[ty, tx] and lfObject) <> 0)) then
         begin
         Land[ty, tx]:= Land[ty, tx] or lfDamaged;
-            if (cReducedQuality and rqBlurryLand) = 0 then
-        LandPixels[ty, tx]:= cExplosionBorderColor
-            else
-        LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor
-
+        if despeckle then LandDirty[ty div 32, tx div 32]:= 1;
+        if (cReducedQuality and rqBlurryLand) = 0 then
+            LandPixels[ty, tx]:= cExplosionBorderColor
+        else LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor
         end
     end;
     X:= nx;
@@ -575,11 +577,10 @@
        ((Land[ty, tx] and lfObject) <> 0)) then
         begin
         Land[ty, tx]:= Land[ty, tx] or lfDamaged;
+        if despeckle then LandDirty[ty div 32, tx div 32]:= 1;
         if (cReducedQuality and rqBlurryLand) = 0 then
-        LandPixels[ty, tx]:= cExplosionBorderColor
-        else
-        LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor
-
+            LandPixels[ty, tx]:= cExplosionBorderColor
+        else LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor
         end
     end;
     nx:= nx - dY;
@@ -602,10 +603,10 @@
        ((Land[ty, tx] and lfObject) <> 0)) then
         begin
         Land[ty, tx]:= Land[ty, tx] or lfDamaged;
+        if despeckle then LandDirty[ty div 32, tx div 32]:= 1;
         if (cReducedQuality and rqBlurryLand) = 0 then
-        LandPixels[ty, tx]:= cExplosionBorderColor
-        else
-        LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor
+            LandPixels[ty, tx]:= cExplosionBorderColor
+        else LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor
         end
     end;
     nx:= nx - dY;
--- a/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua	Sun Jun 26 20:19:11 2011 -0400
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua	Sun Jun 26 20:29:08 2011 -0400
@@ -707,7 +707,7 @@
 				" " .. "|" ..
 
 				loc("Round Limit") .. ": " .. roundLimit .. "|" ..
-				loc("Turn Time") .. ": " .. (TurnTime/1000) .. loc("s") .. "|" ..
+				loc("Turn Time") .. ": " .. (TurnTime/1000) .. loc("sec") .. "|" ..
 				" " .. "|" ..
 
 				loc("Movement: [Up], [Down], [Left], [Right]") .. "|" ..
@@ -1205,7 +1205,7 @@
 		if (vType[i] == "drone") then
 			PlaySound(sndHellishImpact4)
 			TimeLeft = TimeLeft + 4
-			AddCaption(loc("Time Extended!") .. "+" .. 4 .. loc("s"), 0xff0000ff,capgrpMessage )
+			AddCaption(loc("Time Extended!") .. "+" .. 4 .. loc("sec"), 0xff0000ff,capgrpMessage )
 
 			morte = AddGear(vCircX[i], vCircY[i], gtExplosives, 0, 0, 0, 1)
 			SetHealth(morte, 0)