--- a/hedgewars/uAIAmmoTests.pas Wed Nov 17 20:58:23 2010 +0300
+++ b/hedgewars/uAIAmmoTests.pas Wed Nov 17 22:07:03 2010 +0300
@@ -108,7 +108,7 @@
const BadTurn = Low(LongInt) div 4;
implementation
-uses uMisc, uAIMisc, uLand, uVariables;
+uses uMisc, uAIMisc, uVariables;
function Metric(x1, y1, x2, y2: LongInt): LongInt;
begin
--- a/hedgewars/uAIMisc.pas Wed Nov 17 20:58:23 2010 +0300
+++ b/hedgewars/uAIMisc.pas Wed Nov 17 22:07:03 2010 +0300
@@ -68,7 +68,7 @@
end;
implementation
-uses uTeams, uMisc, uLand, uCollisions, uVariables;
+uses uTeams, uMisc, uCollisions, uVariables;
const KillScore = 200;
--- a/hedgewars/uCollisions.pas Wed Nov 17 20:58:23 2010 +0300
+++ b/hedgewars/uCollisions.pas Wed Nov 17 22:07:03 2010 +0300
@@ -52,7 +52,7 @@
function calcSlopeTangent(Gear: PGear; collisionX, collisionY: LongInt; var outDeltaX, outDeltaY: LongInt; TestWord: LongWord): Boolean;
implementation
-uses uMisc, uConsts, uLand, uLandGraphics, uVariables;
+uses uMisc, uConsts, uLandGraphics, uVariables;
type TCollisionEntry = record
X, Y, Radius: LongInt;
--- a/hedgewars/uGears.pas Wed Nov 17 20:58:23 2010 +0300
+++ b/hedgewars/uGears.pas Wed Nov 17 22:07:03 2010 +0300
@@ -60,7 +60,7 @@
function GetLaunchY(at: TAmmoType; angle: LongInt): LongInt;
implementation
-uses uWorld, uMisc, uStore, uConsole, uSound, uTeams, uRandom, uCollisions, uLand, uIO, uLandGraphics,
+uses uWorld, uMisc, uStore, uConsole, uSound, uTeams, uRandom, uCollisions, uIO, uLandGraphics,
uAIMisc, uLocale, uAI, uAmmos, uStats, uVisualGears, uScript, GLunit, uMobile, uVariables;
const MAXROPEPOINTS = 384;
--- a/hedgewars/uLand.pas Wed Nov 17 20:58:23 2010 +0300
+++ b/hedgewars/uLand.pas Wed Nov 17 22:07:03 2010 +0300
@@ -20,23 +20,7 @@
unit uLand;
interface
-uses SDLh, uLandTemplates, uFloat, uConsts, GLunit;
-
-type
- TLandArray = packed array of array of LongWord;
- TCollisionArray = packed array of array of Word;
- TPreview = packed array[0..127, 0..31] of byte;
- TDirtyTag = packed array of array of byte;
-
-var Land: TCollisionArray;
- LandPixels: TLandArray;
- LandDirty: TDirtyTag;
- hasBorder: boolean;
- hasGirders: boolean;
- isMap: boolean;
- playHeight, playWidth, leftX, rightX, topY, MaxHedgehogs: Longword; // idea is that a template can specify height/width. Or, a map, a height/width by the dimensions of the image. If the map has pixels near top of image, it triggers border.
- LandBackSurface: PSDL_Surface;
- digest: shortstring;
+uses SDLh, uLandTemplates, uFloat, uConsts, GLunit, uTypes;
type direction = record x, y: LongInt; end;
const DIR_N: direction = (x: 0; y: -1);
@@ -49,11 +33,10 @@
procedure GenMap;
function GenPreview: TPreview;
procedure CheckLandDigest(s: shortstring);
-function LandBackPixel(x, y: LongInt): LongWord;
implementation
uses uConsole, uStore, uMisc, uRandom, uTeams, uLandObjects, Adler32, uIO, uLandTexture, sysutils,
- uTypes, uVariables;
+ uVariables;
operator=(const a, b: direction) c: Boolean;
begin
@@ -320,17 +303,6 @@
end;
end;
-function LandBackPixel(x, y: LongInt): LongWord;
-var p: PLongWordArray;
-begin
- if LandBackSurface = nil then LandBackPixel:= 0
- else
- begin
- p:= LandBackSurface^.pixels;
- LandBackPixel:= p^[LandBackSurface^.w * (y mod LandBackSurface^.h) + (x mod LandBackSurface^.w)];// or $FF000000;
- end
-end;
-
procedure ColorizeLand(Surface: PSDL_Surface);
var tmpsurf: PSDL_Surface;
r, rr: TSDL_Rect;
--- a/hedgewars/uLandGraphics.pas Wed Nov 17 20:58:23 2010 +0300
+++ b/hedgewars/uLandGraphics.pas Wed Nov 17 22:07:03 2010 +0300
@@ -35,11 +35,12 @@
procedure DrawTunnel(X, Y, dX, dY: hwFloat; ticks, HalfWidth: LongInt);
procedure FillRoundInLand(X, Y, Radius: LongInt; Value: Longword);
procedure ChangeRoundInLand(X, Y, Radius: LongInt; doSet: boolean);
+function LandBackPixel(x, y: LongInt): LongWord;
function TryPlaceOnLand(cpX, cpY: LongInt; Obj: TSprite; Frame: LongInt; doPlace: boolean): boolean;
implementation
-uses SDLh, uMisc, uLand, uLandTexture, uVariables;
+uses SDLh, uMisc, uLandTexture, uVariables;
procedure FillCircleLines(x, y, dx, dy: LongInt; Value: Longword);
var i: LongInt;
@@ -772,4 +773,17 @@
begin
CheckLandValue:= ((X and LAND_WIDTH_MASK <> 0) or (Y and LAND_HEIGHT_MASK <> 0)) or ((Land[Y, X] and LandFlag) = 0)
end;
+
+function LandBackPixel(x, y: LongInt): LongWord;
+var p: PLongWordArray;
+begin
+ if LandBackSurface = nil then LandBackPixel:= 0
+ else
+ begin
+ p:= LandBackSurface^.pixels;
+ LandBackPixel:= p^[LandBackSurface^.w * (y mod LandBackSurface^.h) + (x mod LandBackSurface^.w)];// or $FF000000;
+ end
+end;
+
+
end.
--- a/hedgewars/uLandObjects.pas Wed Nov 17 20:58:23 2010 +0300
+++ b/hedgewars/uLandObjects.pas Wed Nov 17 22:07:03 2010 +0300
@@ -29,7 +29,7 @@
procedure AddOnLandObjects(Surface: PSDL_Surface);
implementation
-uses uLand, uStore, uConsts, uMisc, uConsole, uRandom, uVisualGears, uSound, GLunit,
+uses uStore, uConsts, uMisc, uConsole, uRandom, uVisualGears, uSound, GLunit,
uTypes, uVariables;
const MaxRects = 512;
--- a/hedgewars/uLandTexture.pas Wed Nov 17 20:58:23 2010 +0300
+++ b/hedgewars/uLandTexture.pas Wed Nov 17 22:07:03 2010 +0300
@@ -28,7 +28,7 @@
procedure DrawLand(dX, dY: LongInt);
implementation
-uses uMisc, uLand, uStore, uConsts, GLunit, uTypes, uVariables;
+uses uMisc, uStore, uConsts, GLunit, uTypes, uVariables;
const TEXSIZE = 256;
--- a/hedgewars/uStore.pas Wed Nov 17 20:58:23 2010 +0300
+++ b/hedgewars/uStore.pas Wed Nov 17 22:07:03 2010 +0300
@@ -20,7 +20,7 @@
unit uStore;
interface
-uses sysutils, uConsts, uTeams, SDLh, GLunit, uWorld, uTypes;
+uses sysutils, uConsts, uTeams, SDLh, GLunit, uTypes;
var PixelFormat: PSDL_PixelFormat;
--- a/hedgewars/uTypes.pas Wed Nov 17 20:58:23 2010 +0300
+++ b/hedgewars/uTypes.pas Wed Nov 17 22:07:03 2010 +0300
@@ -357,6 +357,12 @@
gidSolidLand, gidSharedAmmo, gidMineTimer, gidNoMineTimer, gidRandomMineTimer,
gidDamageModifier, gidResetHealth, gidAISurvival, gidInfAttack, gidResetWeps, gidPerHogAmmo);
+ TLandArray = packed array of array of LongWord;
+ TCollisionArray = packed array of array of Word;
+ TPreview = packed array[0..127, 0..31] of byte;
+ TDirtyTag = packed array of array of byte;
+
+
implementation
end.
\ No newline at end of file
--- a/hedgewars/uVariables.pas Wed Nov 17 20:58:23 2010 +0300
+++ b/hedgewars/uVariables.pas Wed Nov 17 22:07:03 2010 +0300
@@ -141,6 +141,8 @@
SDLwindow : PSDL_Window;
{$ENDIF}
+ WorldDx: LongInt;
+ WorldDy: LongInt;
const
cHHFileName = 'Hedgehog';
@@ -1985,6 +1987,19 @@
alpha : 255
);
+
+var
+ Land: TCollisionArray;
+ LandPixels: TLandArray;
+ LandDirty: TDirtyTag;
+ hasBorder: boolean;
+ hasGirders: boolean;
+ isMap: boolean;
+ playHeight, playWidth, leftX, rightX, topY, MaxHedgehogs: Longword; // idea is that a template can specify height/width. Or, a map, a height/width by the dimensions of the image. If the map has pixels near top of image, it triggers border.
+ LandBackSurface: PSDL_Surface;
+ digest: shortstring;
+
+
procedure initModule;
procedure freeModule;
--- a/hedgewars/uWorld.pas Wed Nov 17 20:58:23 2010 +0300
+++ b/hedgewars/uWorld.pas Wed Nov 17 22:07:03 2010 +0300
@@ -30,8 +30,6 @@
bShowFinger: boolean;
Frames: Longword;
WaterColor, DeepWaterColor: TSDL_Color;
- WorldDx: LongInt;
- WorldDy: LongInt;
SkyOffset: LongInt;
HorizontOffset: LongInt;
{$IFDEF COUNTTICKS}
@@ -63,7 +61,6 @@
uVisualGears,
uChat,
uLandTexture,
- uLand,
GLunit,
uVariables
;
--- a/tools/unitCycles.hs Wed Nov 17 20:58:23 2010 +0300
+++ b/tools/unitCycles.hs Wed Nov 17 22:07:03 2010 +0300
@@ -14,8 +14,6 @@
extractUnits (Program (Identificator name) (Implementation (Uses idents) _ _) _) = ("program " ++ name, map unident idents)
extractUnits (Unit (Identificator name) (Interface (Uses idents1) _) (Implementation (Uses idents2) _ _) _ _) = (name, map unident $ idents1 ++ idents2)
--- stronglyConnComp :: Ord key => [(node, key, [key])] -> [SCC node]
-
f :: [(String, [String])] -> String
f = unlines . map showSCC . stronglyConnComp . map (\(a, b) -> (a, a, b))
where