- Fix most of the warnings in hwengine
authorunc0rr
Sun, 11 Mar 2007 17:19:28 +0000
changeset 495 62c1c2b4414c
parent 494 503758a35c02
child 496 00465a8ef129
- Fix most of the warnings in hwengine - Windows static Qt linking - Fix static linking issue (missed -lQtXml)
QTfrontend/CMakeLists.txt
hedgewars/CCHandlers.inc
hedgewars/GSHandlers.inc
hedgewars/options.inc
hedgewars/uConsole.pas
hedgewars/uConsts.pas
hedgewars/uGears.pas
hedgewars/uLand.pas
hedgewars/uLandGraphics.pas
hedgewars/uMisc.pas
hedgewars/uStore.pas
--- a/QTfrontend/CMakeLists.txt	Mon Feb 26 17:09:13 2007 +0000
+++ b/QTfrontend/CMakeLists.txt	Sun Mar 11 17:19:28 2007 +0000
@@ -2,6 +2,7 @@
 
 set(QT_USE_QTNETWORK TRUE)
 set(QT_USE_QTSVG TRUE)
+set(QT_USE_QTXML TRUE)
 set(QT_USE_QTMAIN TRUE)
 
 find_package(Qt4 REQUIRED)
@@ -104,22 +105,18 @@
 	${hwfr_moc_srcs}
 	${hwfr_hdrs}
 	${hwfr_rez_src})
-
-target_link_libraries(hedgewars 
-	${QT_LIBRARIES})
-
-install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin)
-
+	
+set(HW_LINK_LIBS ${QT_LIBRARIES})
 
 if(WIN32 AND NOT UNIX)
-	string(REPLACE "\\" "/" QT_BIN_DIR $ENV{QTDIR}/bin)
+	set(HW_LINK_LIBS 
+		${HW_LINK_LIBS}
+		ole32
+		winspool
+		uuid)
+endif(WIN32 AND NOT UNIX)
 
-	install(FILES
-		"${QT_BIN_DIR}/QtNetwork4.dll"
-		"${QT_BIN_DIR}/QtGui4.dll"
-		"${QT_BIN_DIR}/QtCore4.dll"
-		"${QT_BIN_DIR}/QtSvg4.dll"
-		"${QT_BIN_DIR}/QtXml4.dll"
-		"${QT_BIN_DIR}/mingwm10.dll"
-		DESTINATION bin)
-endif(WIN32 AND NOT UNIX)
+target_link_libraries(hedgewars 
+	${HW_LINK_LIBS})
+
+install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin)
--- a/hedgewars/CCHandlers.inc	Mon Feb 26 17:09:13 2007 +0000
+++ b/hedgewars/CCHandlers.inc	Sun Mar 11 17:19:28 2007 +0000
@@ -99,27 +99,25 @@
 end;
 
 procedure chColor(var id: shortstring);
-var c: LongInt;
 begin
 if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/color"', true);
-val(id, CurrentTeam^.Color, c);
+val(id, CurrentTeam^.Color);
 CurrentTeam^.AdjColor:= CurrentTeam^.Color;
 AdjustColor(CurrentTeam^.AdjColor)
 end;
 
 procedure chAddHH(var id: shortstring);
 var s: shortstring;
-    c: LongInt;
     Gear: PGear;
 begin
 if (not isDeveloperMode) or (CurrentTeam = nil) then exit;
 with CurrentTeam^ do
      begin
      SplitBySpace(id, s);
-     val(id, Hedgehogs[HedgehogsNumber].BotLevel, c);
+     val(id, Hedgehogs[HedgehogsNumber].BotLevel);
      Gear:= AddGear(0, 0, gtHedgehog, 0, 0, 0, 0);
      Gear^.Hedgehog:= @Hedgehogs[HedgehogsNumber];
-     val(s, Gear^.Health, c);
+     val(s, Gear^.Health);
      TryDo(Gear^.Health > 0, 'Invalid hedgehog health', true);
      PHedgehog(Gear^.Hedgehog)^.Team:= CurrentTeam;
      Hedgehogs[HedgehogsNumber].AmmoStore:= TeamsCount - 1;
--- a/hedgewars/GSHandlers.inc	Mon Feb 26 17:09:13 2007 +0000
+++ b/hedgewars/GSHandlers.inc	Sun Mar 11 17:19:28 2007 +0000
@@ -1035,7 +1035,6 @@
 end;
 
 procedure doStepAirAttack(Gear: PGear);
-var t: LongInt;
 begin
 AllInactive:= false;
 if Gear^.X.QWordValue = 0 then Gear^.Tag:=  1
--- a/hedgewars/options.inc	Mon Feb 26 17:09:13 2007 +0000
+++ b/hedgewars/options.inc	Sun Mar 11 17:19:28 2007 +0000
@@ -18,7 +18,7 @@
 
 {$J+}
 
-{ $DEFINE DEBUGFILE}
+{$DEFINE DEBUGFILE}
 { $DEFINE COUNTTICKS}
 { $DEFINE DUMP}
 { $DEFINE TRACEAIACTIONS}
--- a/hedgewars/uConsole.pas	Mon Feb 26 17:09:13 2007 +0000
+++ b/hedgewars/uConsole.pas	Sun Mar 11 17:19:28 2007 +0000
@@ -156,7 +156,7 @@
 
 procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean);
 type PhwFloat = ^hwFloat;
-var i, ii: LongInt;
+var ii: LongInt;
     s: shortstring;
     t: PVariable;
     c: char;
@@ -183,8 +183,8 @@
                             begin
                             str(PLongInt(t^.Handler)^, s);
                             WriteLnToConsole('$' + CmdStr + ' is "' + s + '"');
-                            end else val(s, PLongInt(t^.Handler)^, i);
-                 vthwFloat: if c='$' then
+                            end else val(s, PLongInt(t^.Handler)^);
+              vthwFloat: if c='$' then
                          if s[0]=#0 then
                             begin
                             //str(PhwFloat(t^.Handler)^:4:6, s);
@@ -197,7 +197,7 @@
                             WriteLnToConsole('$' + CmdStr + ' is "' + s + '"');
                             end else
                             begin
-                            val(s, ii, i);
+                            val(s, ii);
                             boolean(t^.Handler^):= not (ii = 0)
                             end;
               end;
--- a/hedgewars/uConsts.pas	Mon Feb 26 17:09:13 2007 +0000
+++ b/hedgewars/uConsts.pas	Sun Mar 11 17:19:28 2007 +0000
@@ -357,7 +357,8 @@
                                    TimeAfterTurn: 3000;
                                    minAngle: 0;
                                    maxAngle: 0;
-                                   PosCount: 1),
+                                   PosCount: 1;
+                                   PosSprite: sprWater),
                                   (NameId: sidClusterBomb;
                                    Probability: 100;
                                    NumberInCase: 3;
@@ -372,7 +373,8 @@
                                    TimeAfterTurn: 3000;
                                    minAngle: 0;
                                    maxAngle: 0;
-                                   PosCount: 1),
+                                   PosCount: 1;
+                                   PosSprite: sprWater),
                                   (NameId: sidBazooka;
                                    Probability: 0;
                                    NumberInCase: 1;
@@ -386,7 +388,8 @@
                                    TimeAfterTurn: 3000;
                                    minAngle: 0;
                                    maxAngle: 0;
-                                   PosCount: 1),
+                                   PosCount: 1;
+                                   PosSprite: sprWater),
                                   (NameId: sidUFO;
                                    Probability: 100;
                                    NumberInCase: 1;
@@ -401,7 +404,8 @@
                                    TimeAfterTurn: 3000;
                                    minAngle: 0;
                                    maxAngle: 0;
-                                   PosCount: 1),
+                                   PosCount: 1;
+                                   PosSprite: sprWater),
                                   (NameId: sidShotgun;
                                    Probability: 0;
                                    NumberInCase: 1;
@@ -415,7 +419,8 @@
                                    TimeAfterTurn: 3000;
                                    minAngle: 0;
                                    maxAngle: 0;
-                                   PosCount: 1),
+                                   PosCount: 1;
+                                   PosSprite: sprWater),
                                   (NameId: sidPickHammer;
                                    Probability: 0;
                                    NumberInCase: 1;
@@ -432,7 +437,8 @@
                                    TimeAfterTurn: 0;
                                    minAngle: 0;
                                    maxAngle: 0;
-                                   PosCount: 1),
+                                   PosCount: 1;
+                                   PosSprite: sprWater),
                                   (NameId: sidSkip;
                                    Probability: 0;
                                    NumberInCase: 1;
@@ -446,7 +452,8 @@
                                    TimeAfterTurn: 0;
                                    minAngle: 0;
                                    maxAngle: 0;
-                                   PosCount: 1),
+                                   PosCount: 1;
+                                   PosSprite: sprWater),
                                   (NameId: sidRope;
                                    Probability: 100;
                                    NumberInCase: 3;
@@ -462,7 +469,8 @@
                                    TimeAfterTurn: 0;
                                    minAngle: 0;
                                    maxAngle: cMaxAngle div 2;
-                                   PosCount: 1),
+                                   PosCount: 1;
+                                   PosSprite: sprWater),
                                   (NameId: sidMine;
                                    Probability: 100;
                                    NumberInCase: 1;
@@ -476,7 +484,8 @@
                                    TimeAfterTurn: 5000;
                                    minAngle: 0;
                                    maxAngle: 0;
-                                   PosCount: 1),
+                                   PosCount: 1;
+                                   PosSprite: sprWater),
                                   (NameId: sidDEagle;
                                    Probability: 100;
                                    NumberInCase: 2;
@@ -490,7 +499,8 @@
                                    TimeAfterTurn: 3000;
                                    minAngle: 0;
                                    maxAngle: 0;
-                                   PosCount: 1),
+                                   PosCount: 1;
+                                   PosSprite: sprWater),
                                   (NameId: sidDynamite;
                                    Probability: 100;
                                    NumberInCase: 1;
@@ -506,7 +516,8 @@
                                    TimeAfterTurn: 5000;
                                    minAngle: 0;
                                    maxAngle: 0;
-                                   PosCount: 1),
+                                   PosCount: 1;
+                                   PosSprite: sprWater),
                                   (NameId: sidFirePunch;
                                    Probability: 0;
                                    NumberInCase: 1;
@@ -523,7 +534,8 @@
                                    TimeAfterTurn: 3000;
                                    MinAngle: 0;
                                    maxAngle: 0;
-                                   PosCount: 1),
+                                   PosCount: 1;
+                                   PosSprite: sprWater),
                                   (NameId: sidBaseballBat;
                                    Probability: 100;
                                    NumberInCase: 1;
@@ -537,7 +549,8 @@
                                    TimeAfterTurn: 5000;
                                    minAngle: 0;
                                    maxAngle: cMaxAngle div 2;
-                                   PosCount: 1),
+                                   PosCount: 1;
+                                   PosSprite: sprWater),
                                   (NameId: sidParachute;
                                    Probability: 100;
                                    NumberInCase: 1;
@@ -554,7 +567,8 @@
                                    TimeAfterTurn: 0;
                                    minAngle: 0;
                                    maxAngle: 0;
-                                   PosCount: 1),
+                                   PosCount: 1;
+                                   PosSprite: sprWater),
                                   (NameId: sidAirAttack;
                                    Probability: 100;
                                    NumberInCase: 1;
@@ -602,7 +616,8 @@
                                    TimeAfterTurn: 3000;
                                    minAngle: 768;
                                    maxAngle: 1280;
-                                   PosCount: 1),
+                                   PosCount: 1;
+                                   PosSprite: sprWater),
                                   (NameId: sidGirder;
                                    Probability: 400;
                                    NumberInCase: 3;
--- a/hedgewars/uGears.pas	Mon Feb 26 17:09:13 2007 +0000
+++ b/hedgewars/uGears.pas	Sun Mar 11 17:19:28 2007 +0000
@@ -842,7 +842,7 @@
     CountNonZeroz:= Result
     end;
 
-var fx, x: LongInt;
+var x: LongInt;
     y, sy: LongInt;
     ar: array[0..511] of TPoint;
     ar2: array[0..1023] of TPoint;
--- a/hedgewars/uLand.pas	Mon Feb 26 17:09:13 2007 +0000
+++ b/hedgewars/uLand.pas	Sun Mar 11 17:19:28 2007 +0000
@@ -212,7 +212,7 @@
 end;
 
 procedure BezierizeEdge(var pa: TPixAr; Delta: hwFloat);
-var x, y, i, StartLoop: LongInt;
+var i, StartLoop: LongInt;
     opa: TPixAr;
 begin
 opa:= pa;
--- a/hedgewars/uLandGraphics.pas	Mon Feb 26 17:09:13 2007 +0000
+++ b/hedgewars/uLandGraphics.pas	Sun Mar 11 17:19:28 2007 +0000
@@ -269,13 +269,11 @@
 end;
 
 function TryPlaceOnLand(cpX, cpY: LongInt; Obj: TSprite; Frame: LongInt): boolean;
-var Result: boolean;
-    X, Y, sY, bpp, h, w: LongInt;
+var X, Y, bpp, h, w: LongInt;
     p: PByteArray;
     r, rr: TSDL_Rect;
     Image: PSDL_Surface;
 begin
-Result:= true;
 Image:= SpritesData[Obj].Surface;
 w:= SpritesData[Obj].Width;
 h:= SpritesData[Obj].Height; 
--- a/hedgewars/uMisc.pas	Mon Feb 26 17:09:13 2007 +0000
+++ b/hedgewars/uMisc.pas	Sun Mar 11 17:19:28 2007 +0000
@@ -167,16 +167,6 @@
 FloatToStr:= cstr(n)
 end;
 
-{$IFNDEF FPC}
-function arctan2(const Y, X: hwFloat): hwFloat;
-asm
-        fld     Y
-        fld     X
-        fpatan
-        fwait
-end;
-{$ENDIF}
-
 function DxDy2Angle32(const _dY, _dX: hwFloat): LongInt;
 const _16divPI: Extended = 16/pi;
 var dY, dX: Extended;
--- a/hedgewars/uStore.pas	Mon Feb 26 17:09:13 2007 +0000
+++ b/hedgewars/uStore.pas	Sun Mar 11 17:19:28 2007 +0000
@@ -248,6 +248,7 @@
     TryDo(IOResult = 0, msgFailed, true);
     WriteLnToConsole(msgOK);
     val(s, cExplosionBorderColor, c);
+    TryDo(c = 0, 'Theme data corrupted', true);
     AdjustColor(cExplosionBorderColor);
     end;