628 |
628 |
629 // is this not needed any more? lets hope setlength sets also 0s |
629 // is this not needed any more? lets hope setlength sets also 0s |
630 //if ((GameFlags and gfForts) <> 0) or (Pathz[ptMapCurrent] <> '') then |
630 //if ((GameFlags and gfForts) <> 0) or (Pathz[ptMapCurrent] <> '') then |
631 // FillChar(Land,SizeOf(TCollisionArray),0);*) |
631 // FillChar(Land,SizeOf(TCollisionArray),0);*) |
632 |
632 |
633 if (GameFlags and gfForts) = 0 then |
633 if cPathz[ptMapCurrent] <> '' then |
634 if cPathz[ptMapCurrent] <> '' then |
634 begin |
635 begin |
635 map:= cPathz[ptMapCurrent] + '/map.png'; |
636 map:= cPathz[ptMapCurrent] + '/map.png'; |
636 mask:= cPathz[ptMapCurrent] + '/mask.png'; |
637 mask:= cPathz[ptMapCurrent] + '/mask.png'; |
637 if (not(pfsExists(map)) and pfsExists(mask)) then |
638 if (not(pfsExists(map)) and pfsExists(mask)) then |
638 begin |
639 begin |
639 maskOnly:= true; |
640 maskOnly:= true; |
640 LoadMask; |
641 LoadMask; |
641 GenLandSurface |
642 GenLandSurface |
|
643 end |
|
644 else LoadMap; |
|
645 end |
642 end |
|
643 else LoadMap; |
|
644 end |
|
645 else |
|
646 begin |
|
647 WriteLnToConsole('Generating land...'); |
|
648 case cMapGen of |
|
649 mgRandom: GenTemplated(EdgeTemplates[SelectTemplate]); |
|
650 mgMaze : begin ResizeLand(4096,2048); GenMaze; end; |
|
651 mgPerlin: begin ResizeLand(4096,2048); GenPerlin; end; |
|
652 mgDrawn : GenDrawnMap; |
|
653 mgForts : begin GameFlags:= (GameFlags or gfForts or gfDivideTeams); MakeFortsMap(); end; |
646 else |
654 else |
647 begin |
655 OutError('Unknown mapgen', true); |
648 WriteLnToConsole('Generating land...'); |
656 end; |
649 case cMapGen of |
657 if cMapGen <> mgForts then |
650 mgRandom: GenTemplated(EdgeTemplates[SelectTemplate]); |
658 GenLandSurface |
651 mgMaze : begin ResizeLand(4096,2048); GenMaze; end; |
659 end; |
652 mgPerlin: begin ResizeLand(4096,2048); GenPerlin; end; |
|
653 mgDrawn : GenDrawnMap; |
|
654 mgForts : begin GameFlags:= (GameFlags or gfForts or gfDivideTeams); MakeFortsMap(); end; |
|
655 else |
|
656 OutError('Unknown mapgen', true); |
|
657 end; |
|
658 if cMapGen <> mgForts then |
|
659 GenLandSurface |
|
660 end |
|
661 else |
|
662 MakeFortsMap; |
|
663 |
660 |
664 AddProgress; |
661 AddProgress; |
665 |
662 |
666 // check for land near top |
663 // check for land near top |
667 c:= 0; |
664 c:= 0; |