# HG changeset patch
# User unc0rr
# Date 1233006413 0
# Node ID 0fe436fb5f817d66a9777c1ee44ae8d9c126aa0b
# Parent  141f029a2e0a8a737036f7423eb979793d6b0c11
Allow loading maps and forts

diff -r 141f029a2e0a -r 0fe436fb5f81 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;