553 var tmpsurf: PSDL_Surface; |
553 var tmpsurf: PSDL_Surface; |
554 begin |
554 begin |
555 WriteLnToConsole('Generating forts land...'); |
555 WriteLnToConsole('Generating forts land...'); |
556 |
556 |
557 tmpsurf:= LoadImage(Pathz[ptForts] + '/' + ClansArray[0]^.Teams[0]^.FortName + 'L', true, true, true); |
557 tmpsurf:= LoadImage(Pathz[ptForts] + '/' + ClansArray[0]^.Teams[0]^.FortName + 'L', true, true, true); |
558 BlitImageAndGenerateCollisionInfo(0, 0, LAND_HEIGHT, tmpsurf); |
558 BlitImageAndGenerateCollisionInfo(0, LAND_HEIGHT - tmpsurf^.h, tmpsurf^.w, tmpsurf); |
559 SDL_FreeSurface(tmpsurf); |
559 SDL_FreeSurface(tmpsurf); |
560 |
560 |
561 tmpsurf:= LoadImage(Pathz[ptForts] + '/' + ClansArray[1]^.Teams[0]^.FortName + 'R', true, true, true); |
561 tmpsurf:= LoadImage(Pathz[ptForts] + '/' + ClansArray[1]^.Teams[0]^.FortName + 'R', true, true, true); |
562 BlitImageAndGenerateCollisionInfo(LAND_WIDTH - 1024, 0, LAND_HEIGHT, tmpsurf); |
562 BlitImageAndGenerateCollisionInfo(LAND_WIDTH - tmpsurf^.w, LAND_HEIGHT - tmpsurf^.h, tmpsurf^.w, tmpsurf); |
563 SDL_FreeSurface(tmpsurf); |
563 SDL_FreeSurface(tmpsurf); |
564 end; |
564 end; |
565 |
565 |
566 procedure LoadMap; |
566 procedure LoadMap; |
567 var tmpsurf: PSDL_Surface; |
567 var tmpsurf: PSDL_Surface; |
571 tmpsurf:= LoadImage(Pathz[ptMapCurrent] + '/map', true, true, true); |
571 tmpsurf:= LoadImage(Pathz[ptMapCurrent] + '/map', true, true, true); |
572 TryDo((tmpsurf^.w <= LAND_WIDTH) and (tmpsurf^.h <= LAND_HEIGHT), 'Map dimensions too big!', true); |
572 TryDo((tmpsurf^.w <= LAND_WIDTH) and (tmpsurf^.h <= LAND_HEIGHT), 'Map dimensions too big!', true); |
573 |
573 |
574 TryDo(tmpsurf^.format^.BytesPerPixel = 4, 'Map should be 32bit', true); |
574 TryDo(tmpsurf^.format^.BytesPerPixel = 4, 'Map should be 32bit', true); |
575 |
575 |
576 BlitImageAndGenerateCollisionInfo(0, 0, LAND_WIDTH, tmpsurf); |
576 BlitImageAndGenerateCollisionInfo( |
|
577 (LAND_WIDTH - tmpsurf^.w) div 2, |
|
578 LAND_HEIGHT - tmpsurf^.h, |
|
579 tmpsurf^.w, |
|
580 tmpsurf); |
577 SDL_FreeSurface(tmpsurf); |
581 SDL_FreeSurface(tmpsurf); |
578 |
|
579 end; |
582 end; |
580 |
583 |
581 procedure GenMap; |
584 procedure GenMap; |
582 var x, y: LongInt; |
585 var x, y: LongInt; |
583 c: Longword; |
586 c: Longword; |