Allow loading maps and forts
authorunc0rr
Mon, 26 Jan 2009 21:46:53 +0000
changeset 1772 0fe436fb5f81
parent 1771 141f029a2e0a
child 1773 bc6ad6136675
Allow loading maps and forts
hedgewars/uLand.pas
--- a/hedgewars/uLand.pas	Mon Jan 26 21:43:00 2009 +0000
+++ b/hedgewars/uLand.pas	Mon Jan 26 21:46:53 2009 +0000
@@ -555,11 +555,11 @@
 WriteLnToConsole('Generating forts land...');
 
 tmpsurf:= LoadImage(Pathz[ptForts] + '/' + ClansArray[0]^.Teams[0]^.FortName + 'L', true, true, true);
-BlitImageAndGenerateCollisionInfo(0, 0, LAND_HEIGHT, tmpsurf);
+BlitImageAndGenerateCollisionInfo(0, LAND_HEIGHT - tmpsurf^.h, tmpsurf^.w, tmpsurf);
 SDL_FreeSurface(tmpsurf);
 
 tmpsurf:= LoadImage(Pathz[ptForts] + '/' + ClansArray[1]^.Teams[0]^.FortName + 'R', true, true, true);
-BlitImageAndGenerateCollisionInfo(LAND_WIDTH - 1024, 0, LAND_HEIGHT, tmpsurf);
+BlitImageAndGenerateCollisionInfo(LAND_WIDTH - tmpsurf^.w, LAND_HEIGHT - tmpsurf^.h, tmpsurf^.w, tmpsurf);
 SDL_FreeSurface(tmpsurf);
 end;
 
@@ -573,9 +573,12 @@
 
 TryDo(tmpsurf^.format^.BytesPerPixel = 4, 'Map should be 32bit', true);
 
-BlitImageAndGenerateCollisionInfo(0, 0, LAND_WIDTH, tmpsurf);
+BlitImageAndGenerateCollisionInfo(
+	(LAND_WIDTH - tmpsurf^.w) div 2,
+	LAND_HEIGHT - tmpsurf^.h,
+	tmpsurf^.w,
+	tmpsurf);
 SDL_FreeSurface(tmpsurf);
-
 end;
 
 procedure GenMap;