hedgewars/uLand.pas
changeset 547 b81a055f2d06
parent 498 9c8b385dc9a1
child 561 19d2d422ff84
equal deleted inserted replaced
546:0e7cc3fb05cd 547:b81a055f2d06
   486 
   486 
   487 AddProgress
   487 AddProgress
   488 end;
   488 end;
   489 
   489 
   490 procedure MakeFortsMap;
   490 procedure MakeFortsMap;
   491 var p: PTeam;
   491 var tmpsurf: PSDL_Surface;
   492     tmpsurf: PSDL_Surface;
       
   493 begin
   492 begin
   494 WriteLnToConsole('Generating forts land...');
   493 WriteLnToConsole('Generating forts land...');
   495 p:= TeamsList;
   494 TryDo(TeamsCount = 2, 'More or less than 2 teams on map in forts mode!', true);
   496 TryDo(p <> nil, 'No teams on map!', true);
   495 
   497 with PixelFormat^ do
   496 with PixelFormat^ do
   498      LandSurface:= SDL_CreateRGBSurface(SDL_HWSURFACE, 2048, 1024, BitsPerPixel, RMask, GMask, BMask, AMask);
   497      LandSurface:= SDL_CreateRGBSurface(SDL_HWSURFACE, 2048, 1024, BitsPerPixel, RMask, GMask, BMask, AMask);
   499 SDL_FillRect(LandSurface, nil, 0);
   498 SDL_FillRect(LandSurface, nil, 0);
   500 tmpsurf:= LoadImage(Pathz[ptForts] + '/' + p^.FortName + 'L', false, true, true);
   499 
       
   500 tmpsurf:= LoadImage(Pathz[ptForts] + '/' + TeamsArray[0]^.FortName + 'L', false, true, true);
   501 BlitImageAndGenerateCollisionInfo(0, 0, tmpsurf, LandSurface);
   501 BlitImageAndGenerateCollisionInfo(0, 0, tmpsurf, LandSurface);
   502 SDL_FreeSurface(tmpsurf);
   502 SDL_FreeSurface(tmpsurf);
   503 p:= p^.Next;
   503 
   504 TryDo(p <> nil, 'Only one team on map!', true);
   504 tmpsurf:= LoadImage(Pathz[ptForts] + '/' + TeamsArray[1]^.FortName + 'R', false, true, true);
   505 tmpsurf:= LoadImage(Pathz[ptForts] + '/' + p^.FortName + 'R', false, true, true);
       
   506 BlitImageAndGenerateCollisionInfo(1024, 0, tmpsurf, LandSurface);
   505 BlitImageAndGenerateCollisionInfo(1024, 0, tmpsurf, LandSurface);
   507 SDL_FreeSurface(tmpsurf);
   506 SDL_FreeSurface(tmpsurf);
   508 p:= p^.Next;
       
   509 TryDo(p = nil, 'More than 2 teams on map in forts mode!', true);
       
   510 end;
   507 end;
   511 
   508 
   512 procedure LoadMap;
   509 procedure LoadMap;
   513 var x, y: Longword;
   510 var x, y: Longword;
   514     p: PByteArray;
   511     p: PByteArray;