Changeset 522 for trunk/Database.pas


Ignore:
Timestamp:
Jan 7, 2024, 10:24:51 PM (4 months ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
  • Added: High DPI aware SetWindowPos function.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Database.pas

    r451 r522  
    510510begin
    511511  dxdy(Loc0, Loc1, dx, dy);
    512   dx := abs(dx);
    513   dy := abs(dy);
    514   Result := dx + dy + abs(dx - dy) shr 1;
     512  dx := Abs(dx);
     513  dy := Abs(dy);
     514  Result := dx + dy + Abs(dx - dy) shr 1;
    515515end;
    516516
     
    978978  ShSwamp = 25; { of grassland }
    979979  MinRivLen = 3;
    980   unification = 70;
    981   hotunification = 50; // min. 25
     980  Unification = 70;
     981  HotUnification = 50; // min. 25
    982982
    983983  Zone: array [0 .. 3, 2 .. 9] of Single = { terrain distribution }
     
    11651165    CopyFrom[Loc0] := Loc0;
    11661166
    1167   for N := 0 to unification * MapSize div 100 do
     1167  for N := 0 to Unification * MapSize div 100 do
    11681168  begin
    11691169    Y := DelphiRandom(ly);
    1170     if abs(Y - (ly shr 1)) > ly div 4 + DelphiRandom(ly * hotunification div 100) then
     1170    if Abs(Y - (ly shr 1)) > ly div 4 + DelphiRandom(ly * HotUnification div 100) then
    11711171      if Y < ly shr 1 then
    11721172        Y := ly shr 1 - Y
     
    27922792  begin
    27932793    dxMax := dy and 1;
    2794     while abs(dy) + (dxMax + 2) + abs(abs(dy) - (dxMax + 2)) shr 1 <=
     2794    while Abs(dy) + (dxMax + 2) + Abs(Abs(dy) - (dxMax + 2)) shr 1 <=
    27952795      CountryRadius do
    27962796      Inc(dxMax, 2);
     
    29042904    begin
    29052905      dxMax := dy and 1;
    2906       while abs(dy) + (dxMax + 2) + abs(abs(dy) - (dxMax + 2)) shr 1 <=
     2906      while Abs(dy) + (dxMax + 2) + Abs(Abs(dy) - (dxMax + 2)) shr 1 <=
    29072907        CountryRadius do
    29082908        Inc(dxMax, 2);
Note: See TracChangeset for help on using the changeset viewer.