# HG changeset patch # User nemo # Date 1315156431 14400 # Node ID 022a18320f01dc1072c03f04bb8d7d5e06b5a6ea # Parent 09aca6e1317ab00b090793ad41e49bfb4fff9a4a load mask from user path as well diff -r 09aca6e1317a -r 022a18320f01 hedgewars/uLand.pas --- a/hedgewars/uLand.pas Sun Sep 04 21:03:06 2011 +0400 +++ b/hedgewars/uLand.pas Sun Sep 04 13:13:51 2011 -0400 @@ -1133,9 +1133,14 @@ p: PLongwordArray; x, y, cpX, cpY: Longword; begin - tmpsurf:= LoadImage(Pathz[ptMapCurrent] + '/mask', ifAlpha or ifTransparent or ifIgnoreCaps); - if (tmpsurf = nil) and (mapName <> '') then - tmpsurf:= LoadImage(Pathz[ptMissionMaps] + '/' + mapName +'/mask', ifAlpha or ifTransparent or ifIgnoreCaps); +tmpsurf:= LoadImage(UserPathz[ptMapCurrent] + '/mask', ifAlpha or ifTransparent or ifIgnoreCaps); +if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[ptMapCurrent] + '/mask', ifAlpha or ifTransparent or ifIgnoreCaps); +if tmpsurf = nil then + begin + mapName:= ExtractFileName(Pathz[ptMapCurrent]); + tmpsurf:= LoadImage(UserPathz[ptMissionMaps] + '/' + mapName + '/mask', ifAlpha or ifTransparent or ifIgnoreCaps); + if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[ptMissionMaps] + '/' + mapName + '/mask', ifAlpha or ifCritical or ifTransparent or ifIgnoreCaps); + end; if (tmpsurf <> nil) and (tmpsurf^.w <= LAND_WIDTH) and (tmpsurf^.h <= LAND_HEIGHT) and (tmpsurf^.format^.BytesPerPixel = 4) then begin @@ -1179,11 +1184,11 @@ tmpsurf:= LoadImage(UserPathz[ptMapCurrent] + '/map', ifAlpha or ifTransparent or ifIgnoreCaps); if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[ptMapCurrent] + '/map', ifAlpha or ifTransparent or ifIgnoreCaps); if tmpsurf = nil then -begin + begin mapName:= ExtractFileName(Pathz[ptMapCurrent]); tmpsurf:= LoadImage(UserPathz[ptMissionMaps] + '/' + mapName + '/map', ifAlpha or ifTransparent or ifIgnoreCaps); if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[ptMissionMaps] + '/' + mapName + '/map', ifAlpha or ifCritical or ifTransparent or ifIgnoreCaps); -end; + end; TryDo((tmpsurf^.w <= LAND_WIDTH) and (tmpsurf^.h <= LAND_HEIGHT), 'Map dimensions too big!', true); // unC0Rr - should this be passed from the GUI? I am not sure which layer does what