Changeset 719 for trunk/LocalPlayer/IsoEngine.pas
- Timestamp:
- Jan 12, 2026, 11:29:21 AM (12 hours ago)
- File:
-
- 1 edited
-
trunk/LocalPlayer/IsoEngine.pas (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/IsoEngine.pas
r715 r719 77 77 procedure PaintTileExtraTerrain(X, Y, Loc: Integer); 78 78 procedure PaintTileObjects(nx, ny, X, Y, Loc, CityLoc, CityOwner: Integer; 79 UseBlink: Boolean); 80 procedure PaintTileObjectsRadius(nx, ny, X, Y, Loc, CityLoc, CityOwner: Integer; 81 UseBlink: Boolean; Radius: Integer; Inside: Boolean); 79 UseBlink: Boolean; Radius: Integer = -1; Inside: Boolean = False); 82 80 procedure PaintTileObjects1(X, Y, Loc, CityLoc, CityOwner: Integer; 83 81 UseBlink: Boolean); … … 1182 1180 end; 1183 1181 1184 procedure TIsoMap.PaintTileObjects(nx, ny, X, Y, Loc, CityLoc, CityOwner: Integer;1185 UseBlink: Boolean);1182 procedure TIsoMap.PaintTileObjects(nx, ny, X, Y, Loc, CityLoc, 1183 CityOwner: Integer; UseBlink: Boolean; Radius: Integer = -1; Inside: Boolean = False); 1186 1184 var 1187 1185 dx, dy: Integer; 1186 ALoc: Integer; 1188 1187 begin 1189 1188 for dy := -2 to ny + 1 do 1190 1189 for dx := -2 to nx + 1 do 1191 if (dx + dy) and 1 = 0 then 1192 PaintTileObjects1(X + xxt * dx, Y + yyt + yyt * dy, dLoc(Loc, dx, dy), 1193 CityLoc, CityOwner, UseBlink); 1194 1195 for dy := -2 to ny + 1 do 1196 for dx := -2 to nx + 1 do 1197 if (dx + dy) and 1 = 0 then 1198 PaintTileObjects2(X + xxt * dx, Y + yyt + yyt * dy, dLoc(Loc, dx, dy), 1199 CityLoc, CityOwner, UseBlink); 1200 1201 for dy := -2 to ny + 1 do 1202 for dx := -2 to nx + 1 do 1203 if (dx + dy) and 1 = 0 then 1204 PaintTileObjects3(X + xxt * dx, Y + yyt + yyt * dy, dLoc(Loc, dx, dy), 1205 CityLoc, CityOwner, UseBlink); 1206 end; 1207 1208 procedure TIsoMap.PaintTileObjectsRadius(nx, ny, X, Y, Loc, CityLoc, 1209 CityOwner: Integer; UseBlink: Boolean; Radius: Integer; Inside: Boolean); 1210 var 1211 dx, dy: Integer; 1212 ALoc: Integer; 1213 begin 1214 for dy := -2 to ny + 1 do 1215 for dx := -2 to nx + 1 do 1216 if (dx + dy) and 1 = 0 then 1217 begin 1190 if (dx + dy) and 1 = 0 then begin 1218 1191 ALoc := dLoc(Loc, dx, dy); 1219 if (Inside and (Distance(ALoc, CityLoc) <= 5)) or 1220 (not Inside and (Distance(ALoc, CityLoc) > 5)) then 1192 if (Radius < 0) or 1193 (Inside and (Distance(ALoc, CityLoc) <= Radius)) or 1194 (not Inside and (Distance(ALoc, CityLoc) > Radius)) then 1221 1195 PaintTileObjects1(X + xxt * dx, Y + yyt + yyt * dy, ALoc, CityLoc, 1222 1196 CityOwner, UseBlink); … … 1225 1199 for dy := -2 to ny + 1 do 1226 1200 for dx := -2 to nx + 1 do 1227 if (dx + dy) and 1 = 0 then 1228 begin 1201 if (dx + dy) and 1 = 0 then begin 1229 1202 ALoc := dLoc(Loc, dx, dy); 1230 if (Inside and (Distance(ALoc, CityLoc) <= 5)) or 1231 (not Inside and (Distance(ALoc, CityLoc) > 5)) then 1203 if (Radius < 0) or 1204 (Inside and (Distance(ALoc, CityLoc) <= Radius)) or 1205 (not Inside and (Distance(ALoc, CityLoc) > Radius)) then 1232 1206 PaintTileObjects2(X + xxt * dx, Y + yyt + yyt * dy, ALoc, CityLoc, 1233 1207 CityOwner, UseBlink); 1234 1208 end; 1235 1209 1210 if Radius >= 0 then UnshareBitmap(FOutput); 1211 1236 1212 for dy := -2 to ny + 1 do 1237 1213 for dx := -2 to nx + 1 do 1238 if (dx + dy) and 1 = 0 then 1239 begin 1214 if (dx + dy) and 1 = 0 then begin 1240 1215 ALoc := dLoc(Loc, dx, dy); 1241 if (Inside and (Distance(ALoc, CityLoc) <= 5)) or 1242 (not Inside and (Distance(ALoc, CityLoc) > 5)) then 1216 if (Radius < 0) or 1217 (Inside and (Distance(ALoc, CityLoc) <= Radius)) or 1218 (not Inside and (Distance(ALoc, CityLoc) > Radius)) then 1243 1219 PaintTileObjects3(X + xxt * dx, Y + yyt + yyt * dy, ALoc, CityLoc, 1244 1220 CityOwner, UseBlink); … … 1403 1379 1404 1380 if moEditMode in MapOptions then 1405 Fog := (Loc < 0) or (Loc >= G.lx * G.ly) 1406 // else if CityLoc >= 0 then 1407 // Fog:= (Loc < 0) or (Loc >= G.lx * G.ly) or (Distance(Loc, CityLoc) > 5) 1408 else if ShowGrWall then 1409 Fog := Tile and fGrWall = 0 1410 else 1411 Fog := FogOfWar and (Tile and fObserved = 0); 1412 if Fog and ShowObjects then 1413 if Loc < -G.lx then 1414 Sprite(HGrTerrain, X, Y + yyt, xxt * 2, yyt, 1 + 6 * (xxt * 2 + 1), 1415 1 + yyt * 2 + 15 * (yyt * 3 + 1)) 1416 else if Loc >= G.lx * (G.ly + 1) then 1417 Sprite(HGrTerrain, X, Y, xxt * 2, yyt, 1 + 6 * (xxt * 2 + 1), 1418 1 + yyt + 15 * (yyt * 3 + 1)) 1419 else begin 1420 TerrainSprite(X, Y, spGrid, xxt <> 33, True); 1421 end; 1381 Fog := (Loc < 0) or (Loc >= G.lx * G.ly) 1382 // else if CityLoc >= 0 then 1383 // Fog := (Loc < 0) or (Loc >= G.lx * G.ly) or (Distance(Loc, CityLoc) > 5) 1384 else if ShowGrWall then 1385 Fog := Tile and fGrWall = 0 1386 else 1387 Fog := FogOfWar and (Tile and fObserved = 0); 1388 1389 if Fog and ShowObjects then begin 1390 if Loc < -G.lx then 1391 Sprite(HGrTerrain, X, Y + yyt, xxt * 2, yyt, 1 + 6 * (xxt * 2 + 1), 1392 1 + yyt * 2 + 15 * (yyt * 3 + 1)) 1393 else if Loc >= G.lx * (G.ly + 1) then 1394 Sprite(HGrTerrain, X, Y, xxt * 2, yyt, 1 + 6 * (xxt * 2 + 1), 1395 1 + yyt + 15 * (yyt * 3 + 1)) 1396 else begin 1397 TerrainSprite(X, Y, spGrid, xxt <> 33, True); 1398 end; 1399 end; 1422 1400 end; 1423 1401 … … 1512 1490 else if Tile and fStealthUnit <> 0 then 1513 1491 Sprite(HGrStdUnits, X + (xxt - xxu), Y + (yyt - yyu_anchor), xxu * 2, 1514 yyu * 2, 1 + 5 * (xxu * 2 + 1), 1 + 1 * (yyu * 2 + 1)) 1492 yyu * 2, 1 + 5 * (xxu * 2 + 1), 1 + 1 * (yyu * 2 + 1)); 1515 1493 end; 1516 1494 … … 1524 1502 (Loc < G.lx * G.ly) and (DebugMap[Loc] <> 0) then 1525 1503 TextOut(X + xxt - 16, Y + yyt - 9, $00E0FF, 1526 IntToStr(Integer(DebugMap[Loc]))) 1504 IntToStr(Integer(DebugMap[Loc]))); 1527 1505 end; 1528 1506 … … 1751 1729 if CityOwner >= 0 then begin 1752 1730 // Paint objects outside radius 1753 PaintTileObjects Radius(nx, ny, X, Y, Loc, CityLoc, CityOwner, UseBlink, 5, False);1731 PaintTileObjects(nx, ny, X, Y, Loc, CityLoc, CityOwner, UseBlink, 5, False); 1754 1732 1755 1733 dx := ((CityLoc mod G.lx * 2 + CityLoc div G.lx and 1) - … … 1763 1741 1764 1742 // Paint objects inside radius 1765 PaintTileObjects Radius(nx, ny, X, Y, Loc, CityLoc, CityOwner, UseBlink, 5, True);1743 PaintTileObjects(nx, ny, X, Y, Loc, CityLoc, CityOwner, UseBlink, 5, True); 1766 1744 end else begin 1767 1745 if ShowLoc or (moEditMode in MapOptions) or (moGrid in MapOptions) then
Note:
See TracChangeset
for help on using the changeset viewer.
