Changeset 522 for trunk/LocalPlayer
- Timestamp:
- Jan 7, 2024, 10:24:51 PM (11 months ago)
- Location:
- trunk/LocalPlayer
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/ClientTools.pas
r486 r522 100 100 Inc(Loc0, G.lx * 1024); 101 101 Inc(Loc1, G.lx * 1024); 102 dx := abs(((Loc1 mod G.lx * 2 + Loc1 div G.lx and 1) -102 dx := Abs(((Loc1 mod G.lx * 2 + Loc1 div G.lx and 1) - 103 103 (Loc0 mod G.lx * 2 + Loc0 div G.lx and 1) + 3 * G.lx) mod (2 * G.lx) - G.lx); 104 dy := abs(Loc1 div G.lx - Loc0 div G.lx);105 Result := dx + dy + abs(dx - dy) shr 1;104 dy := Abs(Loc1 div G.lx - Loc0 div G.lx); 105 Result := dx + dy + Abs(dx - dy) shr 1; 106 106 end; 107 107 … … 371 371 for dx := -2 to 2 do 372 372 for dy := -2 to 2 do 373 if abs(dx) + abs(dy) = 2 then373 if Abs(dx) + Abs(dy) = 2 then 374 374 if Server(sMoveUnit - sExecute + dx and 7 shl 4 + dy and 375 375 7 shl 7, Me, uix, nil^) >= rExecuted then -
trunk/LocalPlayer/Diagram.pas
r468 r522 219 219 MoveTo(X, Border); 220 220 LineTo(X, InnerHeight - Border); 221 S := IntToStr( abs(TurnToYear(T * LineStep)));221 S := IntToStr(Abs(TurnToYear(T * LineStep))); 222 222 Textout(X - TextWidth(S) div 2, Border - 16, S); 223 223 end; -
trunk/LocalPlayer/IsoEngine.pas
r506 r522 1372 1372 I: Integer; 1373 1373 begin 1374 FOutput.Canvas.pen.Color := $000000; // $FF shl (8 *random(3));1374 FOutput.Canvas.pen.Color := $000000; // $FF shl (8 * Random(3)); 1375 1375 for I := 0 to nx div 2 do 1376 1376 ClippedLine(I * 2, 0, False); … … 1430 1430 for Y := 0 to ScaleToNative(Height) - 1 do begin 1431 1431 y_n := (ScaleFromNative(Y) + y0 - ym) / yyt; 1432 if abs(y_n) < rShade then begin1432 if Abs(y_n) < rShade then begin 1433 1433 // Darken left and right parts of elipsis 1434 1434 w_n := sqrt(sqr(rShade) - sqr(y_n)); -
trunk/LocalPlayer/Nego.pas
r496 r522 746 746 if InputDlg.ModalResult <> mrOK then 747 747 Exit; 748 val(InputDlg.EditInput.Text, A, I);748 Val(InputDlg.EditInput.Text, A, I); 749 749 if (I <> 0) or (A <= 0) or (A >= MaxMoneyPrice) then 750 750 Exit; … … 776 776 if InputDlg.ModalResult <> mrOK then 777 777 Exit; 778 val(InputDlg.EditInput.Text, A, I);778 Val(InputDlg.EditInput.Text, A, I); 779 779 if (I <> 0) or (A <= 0) then 780 780 Exit; … … 858 858 if InputDlg.ModalResult <> mrOK then 859 859 Exit; 860 val(InputDlg.EditInput.Text, A, I);860 Val(InputDlg.EditInput.Text, A, I); 861 861 if (I <> 0) or (A <= 0) or (A >= MaxMoneyPrice) then 862 862 Exit; … … 878 878 if InputDlg.ModalResult <> mrOK then 879 879 Exit; 880 val(InputDlg.EditInput.Text, A, I);880 Val(InputDlg.EditInput.Text, A, I); 881 881 if (I <> 0) or (A <= 0) then 882 882 Exit; -
trunk/LocalPlayer/Select.pas
r518 r522 8 8 SysUtils, Classes, ButtonB, ButtonBase, Types, 9 9 {$IFDEF DPI}Dpi.Graphics, Dpi.Controls, Dpi.Forms, Dpi.ExtCtrls, Dpi.Menus, 10 System.UITypes{$ELSE}10 Dpi.Common, System.UITypes{$ELSE} 11 11 Graphics, Controls, Forms, ExtCtrls, Menus{$ENDIF}; 12 12 … … 1115 1115 for dx := -2 to 2 do 1116 1116 for dy := -2 to 2 do 1117 if abs(dx) + abs(dy) = 2 then1117 if Abs(dx) + Abs(dy) = 2 then 1118 1118 begin 1119 1119 Loc1 := dLoc(MyCity[cixProject].Loc, dx, dy); -
trunk/LocalPlayer/Term.pas
r517 r522 1573 1573 if Tribe[I] <> nil then 1574 1574 begin 1575 TestColorDistance := abs(Integer(UnusedTribeFiles.Objects[J])1575 TestColorDistance := Abs(Integer(UnusedTribeFiles.Objects[J]) 1576 1576 shr 16 and $FF - Tribe[I].Color shr 16 and $FF) + 1577 1577 Abs(Integer(UnusedTribeFiles.Objects[J]) shr 8 and … … 1658 1658 for I := 0 to nShipPart - 1 do 1659 1659 begin 1660 TestCost := abs(Ship1Change[I]) * Imp[imShipComp + I].Cost;1660 TestCost := Abs(Ship1Change[I]) * Imp[imShipComp + I].Cost; 1661 1661 if TestCost > MostCost then 1662 1662 begin … … 3534 3534 (TButtonC(Components[I]).ButtonIndex <> 1) then 3535 3535 TButtonC(Components[I]).ButtonIndex := 3536 Integer(MapOptionChecked) shr (Components[I].Tag shr 8) and 1 + 2 3536 Integer(MapOptionChecked) shr (Components[I].Tag shr 8) and 1 + 2; 3537 3537 end; 3538 3538 … … 4585 4585 xs := (x0 - xw) * (xxt * 2) + y0 and 1 * xxt - G.lx * (xxt * 2); 4586 4586 // |xs+xl/2-MapWidth/2| -> min 4587 while abs(2 * (xs + G.lx * (xxt * 2)) + xl - MapWidth) <4588 abs(2 * xs + xl - MapWidth) do4587 while Abs(2 * (xs + G.lx * (xxt * 2)) + xl - MapWidth) < 4588 Abs(2 * xs + xl - MapWidth) do 4589 4589 Inc(xs, G.lx * (xxt * 2)); 4590 4590 ys := (y0 - yw) * yyt - yyt; … … 4632 4632 xMap := (x0 - xw) * (xxt * 2) + y0 and 1 * xxt - G.lx * (xxt * 2); 4633 4633 // |xMap+xxt-MapWidth/2| -> min 4634 while abs(2 * (xMap + G.lx * (xxt * 2)) + 2 * xxt - MapWidth) <4635 abs(2 * xMap + 2 * xxt - MapWidth) do4634 while Abs(2 * (xMap + G.lx * (xxt * 2)) + 2 * xxt - MapWidth) < 4635 Abs(2 * xMap + 2 * xxt - MapWidth) do 4636 4636 Inc(xMap, G.lx * (xxt * 2)); 4637 4637 yMap := (y0 - yw) * yyt - yyt; … … 5954 5954 mod (2 * G.lx) - G.lx; 5955 5955 dy := MouseLoc div G.lx - Loc div G.lx; 5956 if abs(dx) + abs(dy) < 3 then5956 if Abs(dx) + Abs(dy) < 3 then 5957 5957 begin 5958 5958 DestinationMarkON := False; … … 6621 6621 // ((xFromLoc-xw1)*2+yFromLoc and 1+1)*xxt+dx*xxt/2-MapWidth/2 -> min 6622 6622 with MainMap do begin 6623 while abs(((xFromLoc - xw1 + G.lx) * 2 + yFromLoc and 1 + 1) * xxt * 2 + dx6624 * xxt - MapWidth) < abs(((xFromLoc - xw1) * 2 + yFromLoc and 1 + 1) * xxt6623 while Abs(((xFromLoc - xw1 + G.lx) * 2 + yFromLoc and 1 + 1) * xxt * 2 + dx 6624 * xxt - MapWidth) < Abs(((xFromLoc - xw1) * 2 + yFromLoc and 1 + 1) * xxt 6625 6625 * 2 + dx * xxt - MapWidth) do 6626 6626 Dec(xw1, G.lx); … … 6651 6651 NoMap.SetOutput(Buffer); 6652 6652 NoMap.SetPaintBounds(0, 0, xRange, yRange); 6653 for Step := 0 to abs(Step1 - Step0) do6653 for Step := 0 to Abs(Step1 - Step0) do 6654 6654 begin 6655 6655 BitBltCanvas(Buffer.Canvas, 0, 0, xRange, yRange, … … 6658 6658 begin 6659 6659 xMoving := xFrom + 6660 Round((Step0 + Step * (Step1 - Step0) div abs(Step1 - Step0)) *6660 Round((Step0 + Step * (Step1 - Step0) div Abs(Step1 - Step0)) * 6661 6661 (xTo - xFrom) / nStep); 6662 6662 yMoving := yFrom + 6663 Round((Step0 + Step * (Step1 - Step0) div abs(Step1 - Step0)) *6663 Round((Step0 + Step * (Step1 - Step0) div Abs(Step1 - Step0)) * 6664 6664 (yTo - yFrom) / nStep); 6665 6665 end … … 6981 6981 x0:=(Loc+(y0 and 1+G.lx*1024) div 2) mod G.lx; 6982 6982 xs:=(x0-xw)*66+y0 and 1*33-G.lx*66; 6983 while abs(2*(xs+G.lx*66)-MapWidth)<abs(2*xs-MapWidth) do6983 while Abs(2*(xs+G.lx*66)-MapWidth)<Abs(2*xs-MapWidth) do 6984 6984 Inc(xs,G.lx*66); 6985 6985 ys:=(y0-yw)*16;
Note:
See TracChangeset
for help on using the changeset viewer.