Changeset 469 for trunk/LocalPlayer/IsoEngine.pas
- Timestamp:
- Dec 3, 2023, 8:33:43 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/IsoEngine.pas
r468 r469 97 97 Status: Integer); 98 98 procedure PaintCity(X, Y: Integer; const CityInfo: TCityInfo; 99 accessory: Boolean = True);99 Accessory: Boolean = True); 100 100 procedure BitBltBitmap(Src: TBitmap; X, Y, Width, Height, xSrc, ySrc, 101 101 Rop: Integer); … … 715 715 if Flags and unFortified <> 0 then 716 716 begin 717 { DataCanvas :=HGrTerrain.Data.Canvas;718 MaskCanvas :=HGrTerrain.Mask.Canvas;719 TSprite(X, Y+16,12*9+7);}717 { DataCanvas := HGrTerrain.Data.Canvas; 718 MaskCanvas := HGrTerrain.Mask.Canvas; 719 TSprite(X, Y + 16, 12 * 9 + 7); } 720 720 Sprite(HGrStdUnits, X, Y, xxu * 2, yyu * 2, 1 + 6 * (xxu * 2 + 1), 1); 721 721 end; … … 724 724 725 725 procedure TIsoMap.PaintCity(X, Y: Integer; const CityInfo: TCityInfo; 726 accessory: Boolean);727 var 728 age: Integer;726 Accessory: Boolean); 727 var 728 Age: Integer; 729 729 cHGr: TGraphicSet; 730 730 cpix: Integer; … … 737 737 S: string; 738 738 begin 739 age := GetAge(CityInfo.Owner);739 Age := GetAge(CityInfo.Owner); 740 740 if CityInfo.size < 5 then 741 741 xGr := 0 … … 746 746 else 747 747 xGr := 3; 748 Tribe[CityInfo.Owner].InitAge( age);749 if age < 2 then748 Tribe[CityInfo.Owner].InitAge(Age); 749 if Age < 2 then 750 750 begin 751 751 cHGr := Tribe[CityInfo.Owner].cHGr; … … 764 764 if ciWalled and CityInfo.Flags <> 0 then 765 765 Sprite(HGrCities, X - xxt, Y - 2 * yyt, 2 * xxt, 3 * yyt, 766 (xGr + 4) * (2 * xxt + 1) + 1, 1 + ( age - 2) * (3 * yyt + 1))766 (xGr + 4) * (2 * xxt + 1) + 1, 1 + (Age - 2) * (3 * yyt + 1)) 767 767 else 768 768 Sprite(HGrCities, X - xxt, Y - 2 * yyt, 2 * xxt, 3 * yyt, 769 xGr * (2 * xxt + 1) + 1, 1 + ( age - 2) * (3 * yyt + 1));770 end; 771 772 if not accessory then769 xGr * (2 * xxt + 1) + 1, 1 + (Age - 2) * (3 * yyt + 1)); 770 end; 771 772 if not Accessory then 773 773 Exit; 774 774 775 { if ciCapital and CityInfo.Flags<>0 then 776 Sprite(Tribe[CityInfo.Owner].symHGr,X+cpic.xf,Y-13+cpic.yf,13,14, 777 1+Tribe[CityInfo.Owner].sympix mod 10 *65, 778 1+Tribe[CityInfo.Owner].sympix div 10 *49); {capital -- paint flag } 775 { if ciCapital and CityInfo.Flags <> 0 then 776 Sprite(Tribe[CityInfo.Owner].symHGr, X + cpic.xf, Y - 13 + cpic.yf, 13, 14, 777 1 + Tribe[CityInfo.Owner].sympix mod 10 * 65, 778 1 + Tribe[CityInfo.Owner].sympix div 10 * 49); (*capital -- paint flag *) 779 } 779 780 780 781 if MyMap[CityInfo.Loc] and fObserved <> 0 then 781 782 begin 782 if age < 2 then783 if Age < 2 then 783 784 begin 784 785 cpic := Tribe[CityInfo.Owner].CityPicture[xGr]; … … 788 789 else 789 790 begin 790 cpic := CitiesPictures.Pictures[ age, xGr];791 cpic := CitiesPictures.Pictures[Age, xGr]; 791 792 xShield := X - xxt + cpic.xShield; 792 793 yShield := Y - 2 * yyt + cpic.yShield; … … 1240 1241 else if ShowObjects then 1241 1242 begin 1242 { if (CityLoc <0) and (UnFocus>=0) and (Loc=MyUn[UnFocus].Loc) then1243 if BlinkOn then TSprite(X, Y,8+9*0)1244 else TSprite(X, Y,8+9*1); }1243 { if (CityLoc < 0) and (UnFocus >= 0) and (Loc = MyUn[UnFocus].Loc) then 1244 if BlinkOn then TSprite(X, Y, 8 + 9 * 0) 1245 else TSprite(X, Y, 8 + 9 * 1); } 1245 1246 1246 1247 NameCity; … … 1279 1280 PaintUnit(X + (xxt - xxu), Y + (yyt - yyu_anchor), UnitInfo, 1280 1281 MyUn[uix].Status); 1281 // if Showuix then Textout(x +16,y+5,$80FF00,IntToStr(uix));1282 // if Showuix then Textout(x + 16, y + 5, $80FF00, IntToStr(uix)); 1282 1283 end 1283 1284 else {$ENDIF} PaintUnit(X + (xxt - xxu), Y + (yyt - yyu_anchor), UnitInfo, 0); … … 1306 1307 procedure TIsoMap.PaintGrid(X, Y, nx, ny: Integer); 1307 1308 1308 procedure ClippedLine(dx0, dy0: Integer; mirror: Boolean);1309 procedure ClippedLine(dx0, dy0: Integer; Mirror: Boolean); 1309 1310 var 1310 1311 x0, x1, dxmin, dymin, dxmax, dymax, N: Integer; … … 1317 1318 dymax := (RealBottom - Y - 1) div yyt + 1; 1318 1319 N := dymax - dy0; 1319 if mirror then1320 if Mirror then 1320 1321 begin 1321 1322 if dx0 - dxmin < N then … … 1325 1326 N := N - (dx0 - dxmax); 1326 1327 dy0 := dy0 + (dx0 - dxmax); 1327 dx0 := dxmax 1328 dx0 := dxmax; 1328 1329 end; 1329 1330 if dy0 < dymin then … … 1331 1332 N := N - (dymin - dy0); 1332 1333 dx0 := dx0 - (dymin - dy0); 1333 dy0 := dymin 1334 dy0 := dymin; 1334 1335 end; 1335 1336 end … … 1342 1343 N := N - (dxmin - dx0); 1343 1344 dy0 := dy0 + (dxmin - dx0); 1344 dx0 := dxmin 1345 dx0 := dxmin; 1345 1346 end; 1346 1347 if dy0 < dymin then … … 1348 1349 N := N - (dymin - dy0); 1349 1350 dx0 := dx0 + (dymin - dy0); 1350 dy0 := dymin 1351 dy0 := dymin; 1351 1352 end; 1352 1353 end; 1353 1354 if N <= 0 then 1354 1355 Exit; 1355 if mirror then1356 if Mirror then 1356 1357 begin 1357 1358 x0 := X + dx0 * xxt - 1; … … 1363 1364 x1 := X + (dx0 + N) * xxt; 1364 1365 end; 1365 moveto(x0, Y + dy0 * yyt);1366 lineto(x1, Y + (dy0 + N) * yyt);1366 MoveTo(x0, Y + dy0 * yyt); 1367 LineTo(x1, Y + (dy0 + N) * yyt); 1367 1368 end; 1368 1369 end; … … 1454 1455 begin 1455 1456 if CityAllowClick then 1456 pen.Color := $FFFFFF1457 Pen.Color := $FFFFFF 1457 1458 else 1458 pen.Color := $000000;1459 pen.Width := 1;1459 Pen.Color := $000000; 1460 Pen.Width := 1; 1460 1461 for I := 0 to 3 do 1461 1462 begin 1462 moveto(xm - xxt * (4 - I), ym + yyt * (1 + I));1463 lineto(xm + xxt * (1 + I), ym - yyt * (4 - I));1464 moveto(xm - xxt * (4 - I), ym - yyt * (1 + I));1465 lineto(xm + xxt * (1 + I), ym + yyt * (4 - I));1463 MoveTo(xm - xxt * (4 - I), ym + yyt * (1 + I)); 1464 LineTo(xm + xxt * (1 + I), ym - yyt * (4 - I)); 1465 MoveTo(xm - xxt * (4 - I), ym - yyt * (1 + I)); 1466 LineTo(xm + xxt * (1 + I), ym + yyt * (4 - I)); 1466 1467 end; 1467 moveto(xm - xxt * 4, ym + yyt * 1);1468 lineto(xm - xxt * 1, ym + yyt * 4);1469 moveto(xm + xxt * 1, ym + yyt * 4);1470 lineto(xm + xxt * 4, ym + yyt * 1);1471 moveto(xm - xxt * 4, ym - yyt * 1);1472 lineto(xm - xxt * 1, ym - yyt * 4);1473 moveto(xm + xxt * 1, ym - yyt * 4);1474 lineto(xm + xxt * 4, ym - yyt * 1);1475 pen.Width := 1;1468 MoveTo(xm - xxt * 4, ym + yyt * 1); 1469 LineTo(xm - xxt * 1, ym + yyt * 4); 1470 MoveTo(xm + xxt * 1, ym + yyt * 4); 1471 LineTo(xm + xxt * 4, ym + yyt * 1); 1472 MoveTo(xm - xxt * 4, ym - yyt * 1); 1473 LineTo(xm - xxt * 1, ym - yyt * 4); 1474 MoveTo(xm + xxt * 1, ym - yyt * 4); 1475 LineTo(xm + xxt * 4, ym - yyt * 1); 1476 Pen.Width := 1; 1476 1477 end; 1477 1478 end;
Note:
See TracChangeset
for help on using the changeset viewer.