1123 // This is a function that Tiy assures me would not be good for gameplay. |
1123 // This is a function that Tiy assures me would not be good for gameplay. |
1124 // It allows the setting of arbitrary portions of landscape as indestructible, or regular, or even blank. |
1124 // It allows the setting of arbitrary portions of landscape as indestructible, or regular, or even blank. |
1125 // He said I could add it here only when I swore it would not impact gameplay. Which, as far as I can tell, is true. |
1125 // He said I could add it here only when I swore it would not impact gameplay. Which, as far as I can tell, is true. |
1126 // I would just like to play with it with my friends if you do not mind. |
1126 // I would just like to play with it with my friends if you do not mind. |
1127 // Can allow for amusing maps. |
1127 // Can allow for amusing maps. |
1128 procedure LoadMask; |
1128 procedure LoadMask(mapName: shortstring); |
1129 var tmpsurf: PSDL_Surface; |
1129 var tmpsurf: PSDL_Surface; |
1130 p: PLongwordArray; |
1130 p: PLongwordArray; |
1131 x, y, cpX, cpY: Longword; |
1131 x, y, cpX, cpY: Longword; |
1132 begin |
1132 begin |
1133 tmpsurf:= LoadImage(Pathz[ptMapCurrent] + '/mask', ifAlpha or ifTransparent or ifIgnoreCaps); |
1133 tmpsurf:= LoadImage(Pathz[ptMapCurrent] + '/mask', ifAlpha or ifTransparent or ifIgnoreCaps); |
|
1134 if (tmpsurf = nil) and (mapName <> '') then |
|
1135 tmpsurf:= LoadImage(Pathz[ptMissionMaps] + '/' + mapName +'/mask', ifAlpha or ifTransparent or ifIgnoreCaps); |
|
1136 |
1134 if (tmpsurf <> nil) and (tmpsurf^.w <= LAND_WIDTH) and (tmpsurf^.h <= LAND_HEIGHT) and (tmpsurf^.format^.BytesPerPixel = 4) then |
1137 if (tmpsurf <> nil) and (tmpsurf^.w <= LAND_WIDTH) and (tmpsurf^.h <= LAND_HEIGHT) and (tmpsurf^.format^.BytesPerPixel = 4) then |
1135 begin |
1138 begin |
1136 cpX:= (LAND_WIDTH - tmpsurf^.w) div 2; |
1139 cpX:= (LAND_WIDTH - tmpsurf^.w) div 2; |
1137 cpY:= LAND_HEIGHT - tmpsurf^.h; |
1140 cpY:= LAND_HEIGHT - tmpsurf^.h; |
1138 if SDL_MustLock(tmpsurf) then |
1141 if SDL_MustLock(tmpsurf) then |