unbreak AI. remove inits from uLand
--- a/hedgewars/hwengine.pas Sat Aug 04 21:08:46 2012 -0400
+++ b/hedgewars/hwengine.pas Sat Aug 04 21:36:31 2012 -0400
@@ -57,6 +57,9 @@
gsLandGen:
begin
GenMap;
+ uLandTexture.initModule;
+ UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT, false);
+ uAILandMarks.initModule;
ParseCommand('sendlanddigest', true);
GameState:= gsStart;
end;
@@ -401,7 +404,6 @@
uAI.initModule;
//uAIActions does not need initialization
//uAIAmmoTests does not need initialization
- uAILandMarks.initModule;
uAIMisc.initModule;
uAmmos.initModule;
uChat.initModule;
@@ -413,7 +415,6 @@
//uLandGraphics does not need initialization
//uLandObjects does not need initialization
//uLandTemplates does not need initialization
- uLandTexture.initModule;
//uLocale does not need initialization
uRandom.initModule;
uScript.initModule;
--- a/hedgewars/uAILandMarks.pas Sat Aug 04 21:08:46 2012 -0400
+++ b/hedgewars/uAILandMarks.pas Sat Aug 04 21:36:31 2012 -0400
@@ -1,71 +1,71 @@
-unit uAILandMarks;
-
-interface
-const markWasHere = $01;
-
-procedure addMark(X, Y: LongInt; mark: byte);
-function checkMark(X, Y: LongInt; mark: byte) : boolean;
-procedure clearAllMarks;
-procedure clearMarks(mark: byte);
-
-procedure initModule;
-procedure freeModule;
-
-implementation
-uses uVariables;
-
-const gr = 2;
-
-var marks: array of array of byte;
- WIDTH, HEIGHT: Longword;
-
-procedure addMark(X, Y: LongInt; mark: byte);
-begin
- if((X and LAND_WIDTH_MASK) = 0) and ((Y and LAND_HEIGHT_MASK) = 0) then
- begin
- X:= X shr gr;
- Y:= Y shr gr;
- marks[Y, X]:= marks[Y, X] or mark
- end
-end;
-
-function checkMark(X, Y: LongInt; mark: byte) : boolean;
-begin
- checkMark:= ((X and LAND_WIDTH_MASK) = 0)
- and ((Y and LAND_HEIGHT_MASK) = 0)
- and ((marks[Y shr gr, X shr gr] and mark) <> 0)
-end;
-
-procedure clearAllMarks;
-var
- Y, X: Longword;
-begin
- for Y:= 0 to Pred(HEIGHT) do
- for X:= 0 to Pred(WIDTH) do
- marks[Y, X]:= 0
-end;
-
-procedure clearMarks(mark: byte);
-var
- Y, X: Longword;
-begin
- for Y:= 0 to Pred(HEIGHT) do
- for X:= 0 to Pred(WIDTH) do
- marks[Y, X]:= marks[Y, X] and (not mark)
-end;
-
-
-procedure initModule;
-begin
- WIDTH:= LAND_WIDTH shr gr;
- HEIGHT:= LAND_HEIGHT shr gr;
-
- SetLength(marks, HEIGHT, WIDTH);
-end;
-
-procedure freeModule;
-begin
- SetLength(marks, 0, 0);
-end;
-
-end.
+unit uAILandMarks;
+
+interface
+const markWasHere = $01;
+
+procedure addMark(X, Y: LongInt; mark: byte);
+function checkMark(X, Y: LongInt; mark: byte) : boolean;
+procedure clearAllMarks;
+procedure clearMarks(mark: byte);
+
+procedure initModule;
+procedure freeModule;
+
+implementation
+uses uVariables;
+
+const gr = 2;
+
+var marks: array of array of byte;
+ WIDTH, HEIGHT: Longword;
+
+procedure addMark(X, Y: LongInt; mark: byte);
+begin
+ if((X and LAND_WIDTH_MASK) = 0) and ((Y and LAND_HEIGHT_MASK) = 0) then
+ begin
+ X:= X shr gr;
+ Y:= Y shr gr;
+ marks[Y, X]:= marks[Y, X] or mark
+ end
+end;
+
+function checkMark(X, Y: LongInt; mark: byte) : boolean;
+begin
+ checkMark:= ((X and LAND_WIDTH_MASK) = 0)
+ and ((Y and LAND_HEIGHT_MASK) = 0)
+ and ((marks[Y shr gr, X shr gr] and mark) <> 0)
+end;
+
+procedure clearAllMarks;
+var
+ Y, X: Longword;
+begin
+ for Y:= 0 to Pred(HEIGHT) do
+ for X:= 0 to Pred(WIDTH) do
+ marks[Y, X]:= 0
+end;
+
+procedure clearMarks(mark: byte);
+var
+ Y, X: Longword;
+begin
+ for Y:= 0 to Pred(HEIGHT) do
+ for X:= 0 to Pred(WIDTH) do
+ marks[Y, X]:= marks[Y, X] and (not mark)
+end;
+
+
+procedure initModule;
+begin
+ WIDTH:= LAND_WIDTH shr gr;
+ HEIGHT:= LAND_HEIGHT shr gr;
+
+ SetLength(marks, HEIGHT, WIDTH);
+end;
+
+procedure freeModule;
+begin
+ SetLength(marks, 0, 0);
+end;
+
+end.
--- a/hedgewars/uLand.pas Sat Aug 04 21:08:46 2012 -0400
+++ b/hedgewars/uLand.pas Sat Aug 04 21:36:31 2012 -0400
@@ -20,7 +20,7 @@
unit uLand;
interface
-uses SDLh, uLandTemplates, uFloat, uConsts, GLunit, uTypes;
+uses SDLh, uLandTemplates, uFloat, uConsts, GLunit, uTypes, uAILandMarks;
procedure initModule;
procedure freeModule;
@@ -54,7 +54,6 @@
SetLength(Land, LAND_HEIGHT, LAND_WIDTH);
SetLength(LandDirty, (LAND_HEIGHT div 32), (LAND_WIDTH div 32));
- uLandTexture.initModule;
end;
end;
@@ -704,8 +703,6 @@
LandPixels[y,x]:= w or (LandPixels[y div 2, x div 2] and AMask)
end
end;
-
-UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT, false);
end;
procedure GenPreview(out Preview: TPreview);