hedgewars/uLand.pas
changeset 35 9367f246fb5f
parent 27 c374fe590272
child 37 2b7f2a43b999
equal deleted inserted replaced
34:fbe30de53d1d 35:9367f246fb5f
   255 
   255 
   256 procedure ColorizeLand(Surface: PSDL_Surface);
   256 procedure ColorizeLand(Surface: PSDL_Surface);
   257 var tmpsurf: PSDL_Surface;
   257 var tmpsurf: PSDL_Surface;
   258     r: TSDL_Rect;
   258     r: TSDL_Rect;
   259 begin
   259 begin
   260 tmpsurf:= LoadImage(Pathz[ptThemeCurrent] + 'LandTex.png');
   260 tmpsurf:= LoadImage(Pathz[ptThemeCurrent] + 'LandTex.png', false);
   261 r.y:= 0;
   261 r.y:= 0;
   262 while r.y < 1024 do
   262 while r.y < 1024 do
   263       begin
   263       begin
   264       r.x:= 0;
   264       r.x:= 0;
   265       while r.x < 2048 do
   265       while r.x < 2048 do
   281 procedure AddBorder(Surface: PSDL_Surface);
   281 procedure AddBorder(Surface: PSDL_Surface);
   282 var tmpsurf: PSDL_Surface;
   282 var tmpsurf: PSDL_Surface;
   283     r, rr: TSDL_Rect;
   283     r, rr: TSDL_Rect;
   284     x, yd, yu: integer;
   284     x, yd, yu: integer;
   285 begin
   285 begin
   286 tmpsurf:= LoadImage(Pathz[ptThemeCurrent] + 'Border.png');
   286 tmpsurf:= LoadImage(Pathz[ptThemeCurrent] + 'Border.png', false);
   287 for x:= 0 to 2047 do
   287 for x:= 0 to 2047 do
   288     begin
   288     begin
   289     yd:= 1023;
   289     yd:= 1023;
   290     repeat
   290     repeat
   291       while (yd > 0   ) and (Land[yd, x] =  0) do dec(yd);
   291       while (yd > 0   ) and (Land[yd, x] =  0) do dec(yd);
   481 begin
   481 begin
   482 p:= TeamsList;
   482 p:= TeamsList;
   483 TryDo(p <> nil, 'No teams on map!', true);
   483 TryDo(p <> nil, 'No teams on map!', true);
   484 with PixelFormat^ do
   484 with PixelFormat^ do
   485      LandSurface:= SDL_CreateRGBSurface(SDL_HWSURFACE, 2048, 1024, BitsPerPixel, RMask, GMask, BMask, 0);
   485      LandSurface:= SDL_CreateRGBSurface(SDL_HWSURFACE, 2048, 1024, BitsPerPixel, RMask, GMask, BMask, 0);
   486 tmpsurf:= LoadImage(Pathz[ptForts] + p.FortName + 'L.png');
   486 tmpsurf:= LoadImage(Pathz[ptForts] + p.FortName + 'L.png', false);
   487 BlitImageAndGenerateCollisionInfo(0, 0, tmpsurf, LandSurface);
   487 BlitImageAndGenerateCollisionInfo(0, 0, tmpsurf, LandSurface);
   488 SDL_FreeSurface(tmpsurf);
   488 SDL_FreeSurface(tmpsurf);
   489 LoadFortPoints(p.FortName, false, TeamSize(p));
   489 LoadFortPoints(p.FortName, false, TeamSize(p));
   490 p:= p.Next;
   490 p:= p.Next;
   491 TryDo(p <> nil, 'Only one team on map!', true);
   491 TryDo(p <> nil, 'Only one team on map!', true);
   492 tmpsurf:= LoadImage(Pathz[ptForts] + p.FortName + 'R.png');
   492 tmpsurf:= LoadImage(Pathz[ptForts] + p.FortName + 'R.png', false);
   493 BlitImageAndGenerateCollisionInfo(1024, 0, tmpsurf, LandSurface);
   493 BlitImageAndGenerateCollisionInfo(1024, 0, tmpsurf, LandSurface);
   494 SDL_FreeSurface(tmpsurf);
   494 SDL_FreeSurface(tmpsurf);
   495 LoadFortPoints(p.FortName, true, TeamSize(p));
   495 LoadFortPoints(p.FortName, true, TeamSize(p));
   496 p:= p.Next;
   496 p:= p.Next;
   497 TryDo(p = nil, 'More than 2 teams on map in forts mode!', true);
   497 TryDo(p = nil, 'More than 2 teams on map in forts mode!', true);