21 unit uLand; |
21 unit uLand; |
22 interface |
22 interface |
23 uses SDLh, uLandTemplates, uFloat, uConsts, GLunit; |
23 uses SDLh, uLandTemplates, uFloat, uConsts, GLunit; |
24 |
24 |
25 type |
25 type |
26 TLandArray = packed array of array of LongWord; |
26 TLandArray = packed array of array of LongWord; |
27 TCollisionArray = packed array of array of Word; |
27 TCollisionArray = packed array of array of Word; |
28 TPreview = packed array[0..127, 0..31] of byte; |
28 TPreview = packed array[0..127, 0..31] of byte; |
29 TDirtyTag = packed array of array of byte; |
29 TDirtyTag = packed array of array of byte; |
30 |
30 |
31 var Land: TCollisionArray; |
31 var Land: TCollisionArray; |
32 LandPixels: TLandArray; |
32 LandPixels: TLandArray; |
33 LandDirty: TDirtyTag; |
33 LandDirty: TDirtyTag; |
34 hasBorder: boolean; |
34 hasBorder: boolean; |
35 hasGirders: boolean; |
35 hasGirders: boolean; |
36 isMap: boolean; |
36 isMap: boolean; |
37 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. |
37 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. |
38 LandBackSurface: PSDL_Surface; |
38 LandBackSurface: PSDL_Surface; |
39 digest: shortstring; |
39 digest: shortstring; |
40 |
40 |
41 type direction = record x, y: LongInt; end; |
41 type direction = record x, y: LongInt; end; |
1206 begin |
1206 begin |
1207 hasBorder:= false; |
1207 hasBorder:= false; |
1208 |
1208 |
1209 LoadThemeConfig; |
1209 LoadThemeConfig; |
1210 isMap:= false; |
1210 isMap:= false; |
1211 |
1211 |
1212 // is this not needed any more? let's hope setlength sets also 0s |
1212 // is this not needed any more? let's hope setlength sets also 0s |
1213 //if ((GameFlags and gfForts) <> 0) or (Pathz[ptMapCurrent] <> '') then |
1213 //if ((GameFlags and gfForts) <> 0) or (Pathz[ptMapCurrent] <> '') then |
1214 // FillChar(Land,SizeOf(TCollisionArray),0);*) |
1214 // FillChar(Land,SizeOf(TCollisionArray),0);*) |
1215 |
1215 |
1216 if (GameFlags and gfForts) = 0 then |
1216 if (GameFlags and gfForts) = 0 then |
1217 if Pathz[ptMapCurrent] <> '' then |
1217 if Pathz[ptMapCurrent] <> '' then |
1218 LoadMap |
1218 LoadMap |
1219 else |
1219 else |
1220 GenLandSurface |
1220 GenLandSurface |