365 for i:= 0 to pred(pa.Count) do |
365 for i:= 0 to pred(pa.Count) do |
366 begin |
366 begin |
367 pa.ar[i].x:= BasePoints^[i].x + LongInt(GetRandom(BasePoints^[i].w)); |
367 pa.ar[i].x:= BasePoints^[i].x + LongInt(GetRandom(BasePoints^[i].w)); |
368 pa.ar[i].y:= BasePoints^[i].y + LongInt(GetRandom(BasePoints^[i].h)) |
368 pa.ar[i].y:= BasePoints^[i].y + LongInt(GetRandom(BasePoints^[i].h)) |
369 end; |
369 end; |
370 |
370 |
371 if canMirror then |
371 if canMirror then |
372 if getrandom(2) = 0 then |
372 if getrandom(2) = 0 then |
373 begin |
373 begin |
374 for i:= 0 to pred(BasePointsCount) do |
374 for i:= 0 to pred(BasePointsCount) do |
375 if pa.ar[i].x <> NTPX then |
375 if pa.ar[i].x <> NTPX then |
551 begin |
551 begin |
552 WriteLnToConsole('Generating forts land...'); |
552 WriteLnToConsole('Generating forts land...'); |
553 TryDo(ClansCount = 2, 'More or less than 2 clans on map in forts mode!', true); |
553 TryDo(ClansCount = 2, 'More or less than 2 clans on map in forts mode!', true); |
554 |
554 |
555 tmpsurf:= LoadImage(Pathz[ptForts] + '/' + ClansArray[0]^.Teams[0]^.FortName + 'L', true, true, true); |
555 tmpsurf:= LoadImage(Pathz[ptForts] + '/' + ClansArray[0]^.Teams[0]^.FortName + 'L', true, true, true); |
556 BlitImageAndGenerateCollisionInfo(0, 0, tmpsurf); |
556 BlitImageAndGenerateCollisionInfo(0, 0, 1024, tmpsurf); |
557 SDL_FreeSurface(tmpsurf); |
557 SDL_FreeSurface(tmpsurf); |
558 |
558 |
559 tmpsurf:= LoadImage(Pathz[ptForts] + '/' + ClansArray[0]^.Teams[0]^.FortName + 'R', true, true, true); |
559 tmpsurf:= LoadImage(Pathz[ptForts] + '/' + ClansArray[0]^.Teams[0]^.FortName + 'R', true, true, true); |
560 BlitImageAndGenerateCollisionInfo(1024, 0, tmpsurf); |
560 BlitImageAndGenerateCollisionInfo(1024, 0, 1024, tmpsurf); |
561 SDL_FreeSurface(tmpsurf); |
561 SDL_FreeSurface(tmpsurf); |
562 |
562 |
563 UpdateLandTexture(0, 1023) |
563 UpdateLandTexture(0, 1023) |
564 end; |
564 end; |
565 |
565 |
573 tmpsurf:= LoadImage(Pathz[ptMapCurrent] + '/map', true, true, true); |
573 tmpsurf:= LoadImage(Pathz[ptMapCurrent] + '/map', true, true, true); |
574 TryDo((tmpsurf^.w = 2048) and (tmpsurf^.h = 1024), 'Map dimensions should be 2048x1024!', true); |
574 TryDo((tmpsurf^.w = 2048) and (tmpsurf^.h = 1024), 'Map dimensions should be 2048x1024!', true); |
575 |
575 |
576 TryDo(tmpsurf^.format^.BytesPerPixel = 4, 'Map should be 32bit', true); |
576 TryDo(tmpsurf^.format^.BytesPerPixel = 4, 'Map should be 32bit', true); |
577 |
577 |
578 BlitImageAndGenerateCollisionInfo(0, 0, tmpsurf); |
578 BlitImageAndGenerateCollisionInfo(0, 0, 2048, tmpsurf); |
579 SDL_FreeSurface(tmpsurf); |
579 SDL_FreeSurface(tmpsurf); |
580 |
580 |
581 UpdateLandTexture(0, 1023) |
581 UpdateLandTexture(0, 1023) |
582 end; |
582 end; |
583 |
583 |