Changeset 531


Ignore:
Timestamp:
Mar 27, 2024, 12:31:14 PM (4 weeks ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
Location:
trunk
Files:
32 edited

Legend:

Unmodified
Added
Removed
  • trunk/AI/StdAI/AI.pas

    r522 r531  
    9393  TPersistentData = record
    9494    LastResearchTech, BehaviorFlags, TheologyPartner: Integer;
    95     RejectTurn: array[Suggestion, 0..15] of smallint;
     95    RejectTurn: array[Suggestion, 0..15] of SmallInt;
    9696    RequestedTechs: array[0..nRequestedTechs - 1] of Integer;
    9797    // ad + p shl 8 + Turn shl 16
     
    196196    else
    197197      BehaviorFlags := bMale;
    198     DebugMessage(1, 'Gender:=' + char(48 + BehaviorFlags and bGender));
     198    DebugMessage(1, 'Gender:=' + Char(48 + BehaviorFlags and bGender));
    199199    TheologyPartner := -1;
    200200    FillChar(RejectTurn, SizeOf(RejectTurn), $FF);
    201     Fillchar(RequestedTechs, SizeOf(RequestedTechs), $FF);
     201    FillChar(RequestedTechs, SizeOf(RequestedTechs), $FF);
    202202  end;
    203203end;
     
    324324  mi: TModelInfo;
    325325  Entry: array[0..nAdv - 1] of Boolean;
    326   ok: Boolean;
     326  Ok: Boolean;
    327327
    328328  function MarkEntry(ad: Integer): Boolean;
     
    540540      ((EarliestNeeded < 0) or (Advancedness[ad] < Advancedness[EarliestNeeded])) then
    541541    begin
    542       ok := False;
     542      Ok := False;
    543543      for iad := 0 to nResearchOrder - 1 do
    544544        if ResearchOrder[Data.BehaviorFlags and bGender, iad] = ad then
    545545        begin
    546           ok := True;
     546          Ok := True;
    547547          Break;
    548548        end;
    549       if not ok then
     549      if not Ok then
    550550      begin
    551551        EarliestNeeded := ad;
     
    14061406  begin
    14071407    Data.BehaviorFlags := Data.BehaviorFlags and not bGender or NewGender;
    1408     DebugMessage(1, 'Gender:=' + char(48 + NewGender));
     1408    DebugMessage(1, 'Gender:=' + Char(48 + NewGender));
    14091409  end;
    14101410end;
     
    24272427            Total := Total + CityResult[cix];
    24282428      if Total = 0 then
    2429         continue; // district does not exist
     2429        Continue; // district does not exist
    24302430
    24312431      Share := 0;
  • trunk/AI/StdAI/Barbarina.pas

    r522 r531  
    3434  TBarbarina = class(TToolAI)
    3535    constructor Create(Nation: Integer); override;
    36 
    3736  protected
    3837    ColonyShipPlan: TColonyShipPlan;
     
    4746    procedure Barbarina_DoNegotiation;
    4847    procedure MakeColonyShipPlan;
    49 
    5048  private
    5149    TurnOfMapAnalysis, Neighbours: Integer;
     
    173171  Moved: array[0..numax - 1] of Boolean;
    174172  UnitPresence: array[0..lxmax * lymax - 1] of Byte;
    175   euixMap: array[0..lxmax * lymax - 1] of smallint;
    176   uixAttack: array[0..neumax - 1] of smallint;
     173  euixMap: array[0..lxmax * lymax - 1] of SmallInt;
     174  uixAttack: array[0..neumax - 1] of SmallInt;
    177175  AttackScore: array[0..neumax - 1] of Integer;
    178176
     
    15991597          end;
    16001598          if (City_CurrentImprovementProject(cix) = imCourt) and
    1601             (Built[imTownHall] > 0) and (prod >= imp[imCourt].cost *
     1599            (Built[imTownHall] > 0) and (Prod >= imp[imCourt].Cost *
    16021600            BuildCostMod[G.Difficulty[Me]] div 12 -
    1603             (imp[imTownHall].cost * BuildCostMod[G.Difficulty[Me]] div 12) *
     1601            (Imp[imTownHall].Cost * BuildCostMod[G.Difficulty[Me]] div 12) *
    16041602            2 div 3) then
    16051603            City_RebuildImprovement(cix, imTownHall)
     
    16221620var
    16231621  nPreq, rmix, rmixChosen, I, MaxWeight, MaxDefense, ChosenPreq: Integer;
    1624   NeedSeaUnits, ready: Boolean;
     1622  NeedSeaUnits, Ready: Boolean;
    16251623  ModelExists: set of 0..nModelCategory - 1;
    1626   known: array[0..nAdv - 1] of Integer;
     1624  Known: array[0..nAdv - 1] of Integer;
    16271625
    16281626  procedure ChoosePreq(ad: Integer);
     
    16321630  begin
    16331631    Assert(RO.Tech[ad] < tsApplicable);
    1634     if known[ad] = 0 then
     1632    if Known[ad] = 0 then
    16351633    begin
    1636       known[ad] := 1;
     1634      Known[ad] := 1;
    16371635      PreqOk := True;
    16381636      if not (ad in [adScience, adMassProduction]) and (RO.Tech[ad] < tsSeen) then
     
    16951693        if IsResearched(adSteel) then
    16961694          Inc(MaxDefense);
    1697         ready := (MaxWeight >= Weight) and (MaxDefense >= Cap[mcDefense]);
    1698         if ready then
     1695        Ready := (MaxWeight >= Weight) and (MaxDefense >= Cap[mcDefense]);
     1696        if Ready then
    16991697          for I := 0 to nFeature - 1 do
    17001698            if (Cap[I] > 0) and (Feature[I].Preq <> preNone) and
    17011699              ((Feature[I].Preq < 0) or not IsResearched(Feature[I].Preq)) then
    1702               ready := False;
    1703         if ready then
     1700              Ready := False;
     1701        if Ready then
    17041702        begin
    17051703          for I := 0 to nUpgrade - 1 do
    17061704            if (Upgrades and (1 shl I) <> 0) and not
    17071705              IsResearched(Upgrade[Domain, I].Preq) then
    1708               ready := False;
    1709         end;
    1710         if ready then
     1706              Ready := False;
     1707        end;
     1708        if Ready then
    17111709        begin
    17121710          Include(ModelExists, Category);
     
    17361734  I := 0;
    17371735  while (I < nResearchOrder) and (not NeedSeaUnits and (ResearchOrder[I] < 0) or
    1738       IsResearched(Abs(ResearchOrder[I]))) do
    1739     Inc(I);
     1736    IsResearched(Abs(ResearchOrder[I]))) do
     1737      Inc(I);
    17401738  if I >= nResearchOrder then // list done, continue with future tech
    17411739  begin
     
    17471745  else
    17481746  begin
    1749     FillChar(known, SizeOf(known), 0);
     1747    FillChar(Known, SizeOf(Known), 0);
    17501748    nPreq := 0;
    17511749    ChosenPreq := -1;
     
    18351833                    (MyModel[mix].Domain <> dSea)) then
    18361834                  begin
    1837                     DebugMessage(1, 'Declare war on P' + char(48 + Nation));
     1835                    DebugMessage(1, 'Declare war on P' + Char(48 + Nation));
    18381836                    NegoCause := CancelTreaty;
    18391837                    Result := True;
     
    18581856procedure TBarbarina.MakeColonyShipPlan;
    18591857var
    1860   I, V21, V21C, CityLoc, Loc1, part, cix, BestValue, TestValue, FoodCount,
     1858  I, V21, V21C, CityLoc, Loc1, Part, cix, BestValue, TestValue, FoodCount,
    18611859  ProdCount, ProdExtra, Score, BestScore: Integer;
    18621860  Tile: Cardinal;
    1863   ok, check: Boolean;
     1861  Ok, Check: Boolean;
    18641862  Radius, RadiusC: TVicinity21Loc;
    18651863begin
    1866   for part := 0 to nShipPart - 1 do
     1864  for Part := 0 to nShipPart - 1 do
    18671865  begin
    1868     ColonyShipPlan[part].cixProducing := -1;
    1869     ColonyShipPlan[part].nLocResource := 0;
    1870     ColonyShipPlan[part].nLocFoundCity := 0;
     1866    ColonyShipPlan[Part].cixProducing := -1;
     1867    ColonyShipPlan[Part].nLocResource := 0;
     1868    ColonyShipPlan[Part].nLocFoundCity := 0;
    18711869  end;
    18721870  if RO.Tech[adMassProduction] >= tsApplicable then // able to recognize ressources yet
    18731871  begin
    1874     // check already existing cities
     1872    // Check already existing cities
    18751873    for cix := 0 to RO.nCity - 1 do
    18761874      with MyCity[cix] do
     
    18861884              if Tile and fModern <> 0 then
    18871885              begin
    1888                 part := (Tile and fModern) shr 25 - 1;
    1889                 if RO.Ship[Me].Parts[part] < ShipNeed[part] then
     1886                Part := (Tile and fModern) shr 25 - 1;
     1887                if RO.Ship[Me].Parts[Part] < ShipNeed[Part] then
    18901888                  // not enough of this kind already
    18911889                begin
    1892                   ok := True;
    1893                   if ColonyShipPlan[part].cixProducing >= 0 then
     1890                  Ok := True;
     1891                  if ColonyShipPlan[Part].cixProducing >= 0 then
    18941892                  begin // another city is already assigned to this ship part, choose one of the two
    18951893                    TestValue := (ID and $FFF) shl 4 + ((ID shr 12) + 15 - Me) and $F;
    18961894                    BestValue :=
    1897                       (MyCity[ColonyShipPlan[part].cixProducing].ID and $FFF) shl
    1898                       4 + ((MyCity[ColonyShipPlan[part].cixProducing].ID shr 12) +
     1895                      (MyCity[ColonyShipPlan[Part].cixProducing].ID and $FFF) shl
     1896                      4 + ((MyCity[ColonyShipPlan[Part].cixProducing].ID shr 12) +
    18991897                      15 - Me) and $F;
    19001898                    if TestValue <= BestValue then
    1901                       ok := False;
     1899                      Ok := False;
    19021900                  end;
    1903                   if ok then
     1901                  if Ok then
    19041902                    ColonyShipPlan[part].cixProducing := cix;
    19051903                end;
     
    19101908
    19111909    // for parts without existing city, look for location of city to found
    1912     check := False;
    1913     for part := 0 to nShipPart - 1 do
    1914       if (RO.Ship[Me].Parts[part] < ShipNeed[part]) // not enough of this kind already
    1915         and (ColonyShipPlan[part].cixProducing < 0) then // no city to produce
    1916         check := True;
    1917     if check then
     1910    Check := False;
     1911    for Part := 0 to nShipPart - 1 do
     1912      if (RO.Ship[Me].Parts[Part] < ShipNeed[Part]) // not enough of this kind already
     1913        and (ColonyShipPlan[Part].cixProducing < 0) then // no city to produce
     1914        Check := True;
     1915    if Check then
    19181916    begin
    19191917      for Loc1 := 0 to MapSize - 1 do
     
    19221920        if Tile and fModern <> 0 then
    19231921        begin
    1924           part := (Tile and fModern) shr 25 - 1;
    1925           if ColonyShipPlan[part].nLocResource < maxModern then
    1926           begin
    1927             ColonyShipPlan[part].LocResource[ColonyShipPlan[part].nLocResource] := Loc1;
    1928             Inc(ColonyShipPlan[part].nLocResource);
    1929           end;
    1930         end;
    1931       end;
    1932       for part := 0 to nShipPart - 1 do
    1933         if (RO.Ship[Me].Parts[part] < ShipNeed[part]) // not enough of this kind already
    1934           and (ColonyShipPlan[part].cixProducing < 0) // no city to produce
    1935           and (ColonyShipPlan[part].nLocResource > 0) then // resource is known
    1936         begin
    1937           for I := 0 to ColonyShipPlan[part].nLocResource - 1 do
     1922          Part := (Tile and fModern) shr 25 - 1;
     1923          if ColonyShipPlan[Part].nLocResource < maxModern then
     1924          begin
     1925            ColonyShipPlan[Part].LocResource[ColonyShipPlan[Part].nLocResource] := Loc1;
     1926            Inc(ColonyShipPlan[Part].nLocResource);
     1927          end;
     1928        end;
     1929      end;
     1930      for Part := 0 to nShipPart - 1 do
     1931        if (RO.Ship[Me].Parts[Part] < ShipNeed[Part]) // not enough of this kind already
     1932          and (ColonyShipPlan[Part].cixProducing < 0) // no city to produce
     1933          and (ColonyShipPlan[Part].nLocResource > 0) then // resource is known
     1934        begin
     1935          for I := 0 to ColonyShipPlan[Part].nLocResource - 1 do
    19381936          begin
    19391937            BestScore := 0;
    1940             V21_to_Loc(ColonyShipPlan[part].LocResource[I], Radius);
     1938            V21_to_Loc(ColonyShipPlan[Part].LocResource[I], Radius);
    19411939            for V21 := 1 to 26 do
    1942             begin // check all potential cities in range
     1940            begin // Check all potential cities in range
    19431941              CityLoc := Radius[V21];
    19441942              if CityLoc >= 0 then
     
    19901988                  begin
    19911989                    BestScore := Score;
    1992                     ColonyShipPlan[part].LocFoundCity[
    1993                       ColonyShipPlan[part].nLocFoundCity] :=
     1990                    ColonyShipPlan[Part].LocFoundCity[
     1991                      ColonyShipPlan[Part].nLocFoundCity] :=
    19941992                      CityLoc;
    19951993                  end;
     
    19981996            end;
    19991997            if BestScore > 0 then
    2000               Inc(ColonyShipPlan[part].nLocFoundCity);
     1998              Inc(ColonyShipPlan[Part].nLocFoundCity);
    20011999          end;
    20022000        end;
  • trunk/AI/StdAI/CustomAI.pas

    r522 r531  
    682682function TCustomAI.DebugMessage(Level: Integer; Text: string): Boolean;
    683683begin
    684   Text := Copy('P' + char(48 + Me) + ' ' + Text, 1, 254);
     684  Text := Copy('P' + Char(48 + Me) + ' ' + Text, 1, 254);
    685685  Server(sMessage, Me, Level, PChar(Text)^);
    686686
  • trunk/AI/StdAI/CustomAI_Reload.pas

    r522 r531  
    639639function TCustomAI.DebugMessage(Level: Integer; Text: string): Boolean;
    640640begin
    641   Text := Copy('P' + char(48 + Me) + ' ' + Text, 1, 254);
     641  Text := Copy('P' + Char(48 + Me) + ' ' + Text, 1, 254);
    642642  Server(sMessage, Me, Level, PChar(Text)^);
    643643
  • trunk/AI/StdAI/ToolAI.pas

    r522 r531  
    355355  UnitsToAssign: Boolean;
    356356  Adjacent: TVicinity8Loc;
    357   SettlerOfJobLoc, DistToLoc: array[0..lxmax * lymax - 1] of smallint;
     357  SettlerOfJobLoc, DistToLoc: array[0..lxmax * lymax - 1] of SmallInt;
    358358  // DistToLoc is only defined where SettlerOfJobLoc>=0
    359359  TileChecked: array[0..lxmax * lymax - 1] of Boolean;
     
    471471  I, J, Loc, Loc1, V8, Count, Kind, MostIndex: Integer;
    472472  Adjacent: TVicinity8Loc;
    473   IndexOfID: array[0..lxmax * lymax - 1] of smallint;
    474   IDOfIndex: array[0..lxmax * lymax div 2 - 1] of smallint;
     473  IndexOfID: array[0..lxmax * lymax - 1] of SmallInt;
     474  IDOfIndex: array[0..lxmax * lymax div 2 - 1] of SmallInt;
    475475begin
    476476  FillChar(District, MapSize * 4, $FF);
     
    11071107  nSelectedLoad, F, OriginContinent, A, B: Integer;
    11081108  CompleteFlag, NotReachedFlag, ContinueUnit: Cardinal;
    1109   IsComplete, ok, IsFirstLoc: Boolean;
     1109  IsComplete, Ok, IsFirstLoc: Boolean;
    11101110  StartLocPtr, ArrivedEnd: pinteger;
    11111111  Adjacent: TVicinity8Loc;
     
    11131113  tuixSelectedLoad: array[0..15] of Integer;
    11141114  Arrived: array[0..lxmax * lymax] of Cardinal;
    1115   ResponsibleTransport: array[0..lxmax * lymax - 1] of smallint;
     1115  ResponsibleTransport: array[0..lxmax * lymax - 1] of SmallInt;
    11161116  TurnsBeforeLoad: array[0..lxmax * lymax - 1] of ShortInt;
    11171117  GroupComplete: array[0..lxmax * lymax - 1] of Boolean;
     
    11911191    FillChar(ResponsibleTransport, MapSize * 2, $FF); // -1
    11921192    FillChar(TurnsBeforeLoad, MapSize, $FF); // -1
    1193     ok := False;
     1193    Ok := False;
    11941194    for uix := 0 to RO.nUn - 1 do
    11951195      if TransportAvailable[uix] > 0 then
    11961196      begin
    1197         ok := True;
     1197        Ok := True;
    11981198        Pile.Put(MyUnit[uix].Loc, ($800 - MyUnit[uix].Movement) shl 12 + uix);
    11991199      end;
    1200     if not ok then // no transports
     1200    if not Ok then // no transports
    12011201    begin
    12021202      TransportPlan.LoadLoc := -1;
     
    13921392            begin
    13931393              Arrived[Loc0] := (Arrived[Loc0] or CompleteFlag) and not NotReachedFlag;
    1394               continue;
     1394              Continue;
    13951395            end;
    13961396            IsComplete := True;
     
    14001400              if Loc1 >= 0 then
    14011401              begin
    1402                 ok := False;
     1402                Ok := False;
    14031403                case CheckStep(MoveStyle, Time0, V8 and 1, ArriveTime,
    14041404                    RecoverTurns, Map[Loc0], Map[Loc1], False) of
    1405                   csOk: ok := True;
     1405                  csOk: Ok := True;
    14061406                  csForbiddenTile:
    14071407                    ;// !!! don't check moving there again
    14081408                  csCheckTerritory:
    1409                     ok := RO.Territory[Loc1] = RO.Territory[Loc0];
     1409                    Ok := RO.Territory[Loc1] = RO.Territory[Loc0];
    14101410                end;
    1411                 if ok and Pile.TestPut(Loc1, ArriveTime) then
     1411                if Ok and Pile.TestPut(Loc1, ArriveTime) then
    14121412                  if ArriveTime < $2000 then
    14131413                    Pile.Put(Loc1, ArriveTime)
  • trunk/Database.pas

    r522 r531  
    559559procedure V21_to_Loc(Loc0: Integer; var VicinityLoc: TVicinity21Loc);
    560560var
    561   dx, dy, bit, y0, xComp, yComp, xComp0, xCompSwitch: Integer;
    562   dst: ^Integer;
     561  dx, dy, Bit, y0, xComp, yComp, xComp0, xCompSwitch: Integer;
     562  Dst: ^Integer;
    563563begin
    564564  y0 := Loc0 div lx;
     
    571571  xCompSwitch := xCompSwitch xor xComp0;
    572572  yComp := lx * (y0 - 3);
    573   dst := @VicinityLoc;
    574   bit := 1;
     573  Dst := @VicinityLoc;
     574  Bit := 1;
    575575  for dy := 0 to 6 do
    576576  begin
     
    579579    for dx := 0 to 3 do
    580580    begin
    581       if bit and $67F7F76 <> 0 then
    582         dst^ := xComp + yComp
     581      if Bit and $67F7F76 <> 0 then
     582        Dst^ := xComp + yComp
    583583      else
    584         dst^ := -1;
     584        Dst^ := -1;
    585585      Inc(xComp);
    586586      if xComp >= lx then
    587587        Dec(xComp, lx);
    588       Inc(dst);
    589       bit := bit shl 1;
     588      Inc(Dst);
     589      Bit := Bit shl 1;
    590590    end;
    591591    Inc(yComp, lx);
     
    13171317  Radius: TVicinity21Loc;
    13181318  Adjacent: TVicinity8Loc;
    1319   ok: Boolean;
     1319  Ok: Boolean;
    13201320
    13211321begin
     
    14141414    end;
    14151415
    1416     ok := True;
     1416    Ok := True;
    14171417    for C := 1 to nsc do
    14181418      if nCityLoc[C] < sccount[C] * (8 - MinGood) div (7 - MinGood) then
    1419         ok := False;
    1420   until ok;
     1419        Ok := False;
     1420  until Ok;
    14211421
    14221422  FineDistSQR := MapSize * LandMass * 9 div (nAlive * 100);
     
    14781478      end;
    14791479    end;
    1480     p1 := p1 + sccount[C]
     1480    p1 := p1 + sccount[C];
    14811481  end;
    14821482
     
    16031603  I, p1, Loc1, nAlive, nStartLoc0, nPrefStartLoc0, imax: Integer;
    16041604  StartLoc0: array [0 .. lxmax * lymax - 1] of Integer;
    1605   ishuman: Boolean;
     1605  IsHuman: Boolean;
    16061606begin
    16071607  nAlive := 0;
     
    16361636
    16371637  StartLoc[0] := 0;
    1638   for ishuman := True downto False do
     1638  for IsHuman := True downto False do
    16391639    for p1 := 0 to nPl - 1 do
    1640       if (1 shl p1 and GAlive <> 0) and ((1 shl p1 and Human <> 0) = ishuman)
     1640      if (1 shl p1 and GAlive <> 0) and ((1 shl p1 and Human <> 0) = IsHuman)
    16411641      then
    16421642      begin
     
    17901790
    17911791  TerritoryCount[nPl] := MapSize;
    1792   // fillchar(NewContact, sizeof(NewContact), false);
     1792  // FillChar(NewContact, SizeOf(NewContact), False);
    17931793end;
    17941794
     
    34873487  I: Integer;
    34883488  miSender, miTarget: TModelInfo;
    3489   ok: Boolean;
     3489  Ok: Boolean;
    34903490begin
    34913491  // only if target doesn't already have a model like this
    3492   ok := RW[pTarget].nModel < nmmax;
     3492  Ok := RW[pTarget].nModel < nmmax;
    34933493  MakeModelInfo(pSender, mix, RW[pSender].Model[mix], miSender);
    34943494  for I := 0 to RW[pTarget].nModel - 1 do
     
    34963496    MakeModelInfo(pTarget, I, RW[pTarget].Model[I], miTarget);
    34973497    if IsSameModel(miSender, miTarget) then
    3498       ok := False;
    3499   end;
    3500   if ok then
     3498      Ok := False;
     3499  end;
     3500  if Ok then
    35013501  begin
    35023502    RW[pTarget].Model[RW[pTarget].nModel] := RW[pSender].Model[mix];
  • trunk/GameServer.pas

    r496 r531  
    26972697  ShowShipChange: TShowShipChange;
    26982698  ShowNegoData: TShowNegoData;
    2699   logged, ok, HasShipChanged, AllHumansDead, OfferFullySupported: Boolean;
     2699  Logged, Ok, HasShipChanged, AllHumansDead, OfferFullySupported: Boolean;
    27002700begin
    27012701  if Command = sTurn then
     
    27792779    FormerCLState := CL.State;
    27802780    CL.Put(Command, Player, Subject, @Data);
    2781     logged := True;
     2781    Logged := True;
    27822782  end
    27832783  else
    2784     logged := False;
     2784    Logged := False;
    27852785
    27862786  case Command of
     
    32223222        if Command = sReload then
    32233223        begin
    3224           ok := (Difficulty[0] = 0) and (bix[0].Kind <> btNoTerm) and
     3224          Ok := (Difficulty[0] = 0) and (bix[0].Kind <> btNoTerm) and
    32253225            (Integer(Data) >= 0) and (Integer(Data) < GTurn);
    32263226          for p1 := 1 to nPl - 1 do
    32273227            if bix[p1].Kind = btTerm then
    3228               ok := False;
     3228              Ok := False;
    32293229          // allow reload in AI-only games only
    32303230        end
    32313231        else
    3232           ok := Player = 0;
    3233         if ok then
     3232          Ok := Player = 0;
     3233        if Ok then
    32343234        begin
    32353235          if (Command = sBreak) or (Command = sResign) then
     
    33513351          p1 := pTurn;
    33523352        if (Command and not sExecute = scDipBreak and not sExecute) and
    3353           (LastEndClientCommand <> scDipBreak) then // ok
     3353          (LastEndClientCommand <> scDipBreak) then // Ok
    33543354        else if (Command and not sExecute = scDipNotice and not sExecute) and
    33553355          ((LastEndClientCommand = scDipCancelTreaty) or
    3356           (LastEndClientCommand = scDipBreak)) then // ok
     3356          (LastEndClientCommand = scDipBreak)) then // Ok
    33573357        else if (Command and not sExecute = scDipAccept and not sExecute) and
    33583358          (LastEndClientCommand = scDipOffer) then
     
    36913691            if (Mode = moPlaying) and (Subject = adMilitary) then
    36923692              IntServer(sIntSetDevModel, Player, 0, DevModel.Kind);
    3693             // save DevModel, because sctModel commands are not logged
     3693            // save DevModel, because sctModel commands are not Logged
    36943694            ResearchTech := Subject;
    36953695          end;
     
    44784478    else
    44794479    begin
    4480       if logged then
     4480      if Logged then
    44814481        CL.State := FormerCLState;
    44824482      if (Result < rExecuted) and (Command >= sExecute) then
  • trunk/LocalPlayer/CityType.pas

    r530 r531  
    2323    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    2424    procedure DeleteBtnClick(Sender: TObject);
    25   public
    26     procedure ShowNewContent(NewMode: TWindowMode);
    2725  protected
    2826    procedure OffscreenPaint; override;
     
    3028    nPool, dragiix, ctype: Integer;
    3129    Pooliix: array [0 .. nImp - 1] of Integer;
    32     listed: Set of 0 .. nImp;
     30    Listed: set of 0 .. nImp;
    3331    Changed: Boolean;
    3432    procedure LoadType(NewType: Integer);
    3533    procedure SaveType;
     34  public
     35    procedure ShowNewContent(NewMode: TWindowMode);
    3636  end;
    3737
     
    158158  nPool := 0;
    159159  for iix := nWonder to nImp - 1 do
    160     if not(iix in listed) and (Imp[iix].Kind = ikCommon) and (iix <> imTrGoods)
     160    if not(iix in Listed) and (Imp[iix].Kind = ikCommon) and (iix <> imTrGoods)
    161161      and (Imp[iix].Preq <> preNA) and
    162162      ((Imp[iix].Preq = preNone) or (MyRO.Tech[Imp[iix].Preq] >= tsApplicable))
     
    195195begin
    196196  ctype := NewType;
    197   listed := [];
     197  Listed := [];
    198198  I := 0;
    199199  while MyData.ImpOrder[ctype, I] >= 0 do
    200200  begin
    201     Include(listed, MyData.ImpOrder[ctype, I]);
     201    Include(Listed, MyData.ImpOrder[ctype, I]);
    202202    Inc(I);
    203203  end;
     
    295295    Assert(MyData.ImpOrder[ctype, I] = iix);
    296296    Move(MyData.ImpOrder[ctype, I + 1], MyData.ImpOrder[ctype, I], nImp - I);
    297     Exclude(listed, iix);
     297    Exclude(Listed, iix);
    298298  end;
    299299
     
    308308      (Y < yList + nListRow * 32) then
    309309    begin
    310       if dragiix in listed then
     310      if dragiix in Listed then
    311311        UnList(dragiix);
    312312      I := (X - xList) div 42 + (Y - yList) div 32 * nListCol;
     
    316316        nImp - I - 1);
    317317      MyData.ImpOrder[ctype, I] := dragiix;
    318       Include(listed, dragiix);
     318      Include(Listed, dragiix);
    319319      Changed := True;
    320320    end
    321     else if (dragiix in listed) and (X >= xPool) and (X < xPool + nPoolCol * 42)
     321    else if (dragiix in Listed) and (X >= xPool) and (X < xPool + nPoolCol * 42)
    322322      and (Y >= yPool) and (Y < yPool + nPoolRow * 32) then
    323323    begin
     
    340340begin
    341341  FillChar(MyData.ImpOrder[ctype], SizeOf(MyData.ImpOrder[ctype]), Byte(-1));
    342   listed := [];
     342  Listed := [];
    343343  Changed := True;
    344344  SmartUpdateContent;
  • trunk/LocalPlayer/ClientTools.pas

    r522 r531  
    446446    eDied - job done and died (thurst) }
    447447var
    448   stage, NextJob, Tile: Integer;
    449   Done: set of jNone .. jPoll;
     448  Stage, NextJob, Tile: Integer;
     449  Done: set of jNone..jPoll;
    450450begin
    451451  Done := [];
     
    470470  while (Result <> eOK) and (Result <> eDied) do
    471471  begin
    472     stage := -1;
     472    Stage := -1;
    473473    repeat
    474       if stage = -1 then
     474      if Stage = -1 then
    475475        NextJob := jPoll
    476476      else
    477         NextJob := Jobs[Tile and fTerrain, stage];
     477        NextJob := Jobs[Tile and fTerrain, Stage];
    478478      if (NextJob = jNone) or not (NextJob in Done) then
    479479        Break;
    480       Inc(stage);
    481     until stage = 5;
    482     if (stage = 5) or (NextJob = jNone) then
     480      Inc(Stage);
     481    until Stage = 5;
     482    if (Stage = 5) or (NextJob = jNone) then
    483483    begin
    484484      Result := eJobDone;
  • trunk/LocalPlayer/Draft.pas

    r530 r531  
    2727    procedure PaintBox1MouseUp(Sender: TObject; Button: TMouseButton;
    2828      Shift: TShiftState; X, Y: Integer);
    29   public
    30     procedure ShowNewContent(NewMode: TWindowMode);
    31   protected
    32     procedure OffscreenPaint; override;
    3329  private
    3430    Domain, MaxLines, Lines, Cut, yDomain, yFeature, yWeight, yTotal, yView,
     
    3834    function IsFeatureInList(D, I: Integer): Boolean;
    3935    procedure SetDomain(D: Integer);
     36  protected
     37    procedure OffscreenPaint; override;
     38  public
     39    procedure ShowNewContent(NewMode: TWindowMode);
    4040  end;
    4141
     
    211211        Y := yTotal + 76;
    212212        LoweredTextOut(Offscreen.Canvas, -1, MainTexture, xTotal - 2, Y,
    213           Phrases.Lookup('COSTDIFF' + char(48 + G.Difficulty[Me])));
     213          Phrases.Lookup('COSTDIFF' + Char(48 + G.Difficulty[Me])));
    214214        LoweredTextOut(Offscreen.Canvas, -1, MainTexture,
    215215          xTotal2 + 148 + 30, Y, '=');
  • trunk/LocalPlayer/Enhance.pas

    r496 r531  
    3939  private
    4040    NoMap: TIsoMap;
    41   public
    42     procedure ShowNewContent(NewMode: TWindowMode; TerrType: Integer = -1);
    4341  protected
    4442    Page: Integer;
    4543    procedure OffscreenPaint; override;
     44  public
     45    procedure ShowNewContent(NewMode: TWindowMode; TerrType: Integer = -1);
    4646  end;
    4747
  • trunk/LocalPlayer/Help.pas

    r530 r531  
    113113    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    114114    procedure SearchBtnClick(Sender: TObject);
    115   protected
    116     procedure OffscreenPaint; override;
    117115  private
    118116    Kind: TLinkCategory;
     
    141139    procedure OnScroll(var Msg: TMessage); message WM_VSCROLL;
    142140    procedure OnMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE;
     141  protected
     142    procedure OffscreenPaint; override;
    143143  public
    144144    HistItems: THistItems;
  • trunk/LocalPlayer/NatStat.pas

    r530 r531  
    3232    procedure ScrollDownBtnClick(Sender: TObject);
    3333    procedure TellAIBtnClick(Sender: TObject);
    34   public
    35     procedure CheckAge;
    36     procedure ShowNewContent(NewMode: TWindowMode; P: Integer = -1);
    37     procedure EcoChange;
    3834  protected
    3935    procedure OffscreenPaint; override;
     
    5046    ReportText: TStringList;
    5147    procedure GenerateReportText;
     48  public
     49    procedure CheckAge;
     50    procedure ShowNewContent(NewMode: TWindowMode; P: Integer = -1);
     51    procedure EcoChange;
    5252  end;
    5353
     
    244244            if ExtinctPart then
    245245              S := '(' + S + ')';
    246             ReportText.Add(char(48 + Treaty) + S);
     246            ReportText.Add(Char(48 + Treaty) + S);
    247247          end;
    248248  end;
  • trunk/LocalPlayer/Nego.pas

    r522 r531  
    481481procedure TNegoDlg.OffscreenPaint;
    482482var
    483   I, cred: Integer;
     483  I, Cred: Integer;
    484484  S: string;
    485485  OkEnabled: Boolean;
     
    600600  // show credibility
    601601  Offscreen.Canvas.Font.Assign(UniFont[ftTiny]);
    602   cred := MyRO.EnemyReport[DipMem[Me].pContact].Credibility;
    603   case cred of
     602  Cred := MyRO.EnemyReport[DipMem[Me].pContact].Credibility;
     603  case Cred of
    604604    0 .. 49:
    605605      I := 3;
     
    609609      I := 1;
    610610  end;
    611   PaintProgressBar(Offscreen.Canvas, I, xCred0, yCred0 + 17, (cred + 2) div 5,
     611  PaintProgressBar(Offscreen.Canvas, I, xCred0, yCred0 + 17, (Cred + 2) div 5,
    612612    0, 20, MainTexture);
    613   S := IntToStr(cred);
     613  S := IntToStr(Cred);
    614614  RisedTextOut(Offscreen.Canvas, xCred0 + 10 -
    615615    (BiColorTextWidth(Offscreen.Canvas, S) + 1) div 2, yCred0, S);
  • trunk/LocalPlayer/Rates.pas

    r530 r531  
    4545procedure TRatesDlg.OffscreenPaint;
    4646var
    47   P, X, Y, current, Max, I: Integer;
     47  P, X, Y, Current, Max, I: Integer;
    4848  S, s1: string;
    4949begin
     
    112112    X := 16;
    113113    Y := 81;
    114     current := (100 - MyRO.LuxRate - MyRO.TaxRate) * 120 div 100;
     114    Current := (100 - MyRO.LuxRate - MyRO.TaxRate) * 120 div 100;
    115115    Max := 120;
    116116    Frame(Offscreen.Canvas, X - 1, Y - 1, X + Max, Y + 7, $000000, $000000);
     
    119119    with Offscreen.Canvas do
    120120    begin
    121       for I := 0 to current div 8 - 1 do
     121      for I := 0 to Current div 8 - 1 do
    122122        BitBltBitmap(Offscreen, X + Max - 8 - I * 8, Y, 8, 7,
    123123          HGrSystem.Data, 104, 9 + 8 * 2);
    124       BitBltBitmap(Offscreen, X + Max - current, Y, current - 8 * (current div 8), 7,
     124      BitBltBitmap(Offscreen, X + Max - Current, Y, Current - 8 * (Current div 8), 7,
    125125        HGrSystem.Data, 104, 9 + 8 * 2);
    126126      Brush.Color := $000000;
    127       FillRect(Rect(X, Y, X + Max - current, Y + 7));
     127      FillRect(Rect(X, Y, X + Max - Current, Y + 7));
    128128      Brush.Style := TBrushStyle.bsClear;
    129129    end;
  • trunk/LocalPlayer/Select.pas

    r530 r531  
    10731073  PPicture, PTestPicture: ^TModelPicture;
    10741074  ModelOk: array [0 .. 4095] of Boolean;
    1075   ok: Boolean;
     1075  Ok: Boolean;
    10761076begin
    10771077  for I := 0 to MaxLayer - 1 do
     
    11081108        begin
    11091109          { if MyModel[i].Kind=mkSlaves then
    1110             ok:= MyRO.Wonder[woPyramids].EffectiveOwner=Me
     1110            Ok:= MyRO.Wonder[woPyramids].EffectiveOwner=Me
    11111111            else } if MyModel[I].Domain = dSea then
    11121112          begin
    1113             ok := False;
     1113            Ok := False;
    11141114            for dx := -2 to 2 do
    11151115              for dy := -2 to 2 do
     
    11201120                    ((MyMap[Loc1] and fTerrain = fShore) or
    11211121                    (MyMap[Loc1] and fCanal > 0)) then
    1122                     ok := True;
     1122                    Ok := True;
    11231123                end;
    11241124          end
    11251125          else
    1126             ok := True;
    1127           if ok then
     1126            Ok := True;
     1127          if Ok then
    11281128          begin
    11291129            if MyModel[I].Status and msObsolete = 0 then
     
    11631163          Inc(Lines[0]);
    11641164        end;
    1165         ok := False;
     1165        Ok := False;
    11661166        for I := 0 to nDomains - 1 do
    11671167          if (upgrade[I, 0].Preq = preNone) or
    11681168            (MyRO.Tech[upgrade[I, 0].Preq] >= tsApplicable) then
    1169             ok := True;
    1170         if ok then { new unit class }
     1169            Ok := True;
     1170        if Ok then { new unit class }
    11711171        begin
    11721172          Code[0, Lines[0]] := adMilitary;
     
    12551255        for I := 0 to nAdv - 1 do
    12561256        begin
    1257           ok := (MyRO.Tech[I] <> tsNA) or (MyRO.ResearchTech = I);
     1257          Ok := (MyRO.Tech[I] <> tsNA) or (MyRO.ResearchTech = I);
    12581258          for J := 1 to nColumn - 1 do
    12591259            with MyRO.EnemyReport[Column[J]]^ do
    12601260              if (Tech[I] <> tsNA) or (TurnOfCivilReport >= 0) and
    12611261                (ResearchTech = I) then
    1262                 ok := True;
    1263           if ok then
     1262                Ok := True;
     1263          if Ok then
    12641264          begin
    12651265            Code[0, Lines[0]] := I;
     
    12691269        SortTechs;
    12701270
    1271         ok := MyRO.ResearchTech = adMilitary;
     1271        Ok := MyRO.ResearchTech = adMilitary;
    12721272        for J := 1 to nColumn - 1 do
    12731273          with MyRO.EnemyReport[Column[J]]^ do
    12741274            if (MyRO.Alive and (1 shl Column[J]) <> 0) and
    12751275              (TurnOfCivilReport >= 0) and (ResearchTech = adMilitary) then
    1276               ok := True;
    1277         if ok then
     1276              Ok := True;
     1277        if Ok then
    12781278        begin
    12791279          Code[0, Lines[0]] := adMilitary;
     
    13301330        begin // check if opponent already has this model
    13311331          MakeModelInfo(Me, mix, MyModel[mix], mi);
    1332           ok := True;
     1332          Ok := True;
    13331333          for emix := 0 to MyRO.nEnemyModel - 1 do
    13341334            if (MyRO.EnemyModel[emix].Owner = DipMem[Me].pContact) and
    13351335              IsSameModel(MyRO.EnemyModel[emix], mi) then
    1336               ok := False;
    1337           if ok then
     1336              Ok := False;
     1337          if Ok then
    13381338          begin
    13391339            Code[0, Lines[0]] := mix;
     
    14141414            if not Assigned(PPicture.HGr) then
    14151415              InitEnemyModel(emix);
    1416             ok := True;
     1416            Ok := True;
    14171417            if MainScreen.mNames.Checked then
    14181418              for J := 0 to Lines[0] - 1 do
     
    14261426                begin
    14271427                  Code[1, J] := 1;
    1428                   ok := False;
     1428                  Ok := False;
    14291429                  Break;
    14301430                end;
    14311431              end;
    1432             if ok then
     1432            if Ok then
    14331433            begin
    14341434              Code[0, Lines[0]] := emix;
  • trunk/LocalPlayer/Term.pas

    r530 r531  
    421421    procedure UpdateKeyShortcuts;
    422422    procedure SetFullScreen(Active: Boolean);
    423     procedure PaintZoomedTile(dst: TBitmap; X, Y, Loc: Integer);
     423    procedure PaintZoomedTile(Dst: TBitmap; X, Y, Loc: Integer);
    424424  public
    425425    UsedOffscreenWidth: Integer;
     
    850850function AttackSound(Code: Integer): string;
    851851begin
    852   Result := 'ATTACK_' + char(48 + Code div 100 mod 10) +
    853     char(48 + Code div 10 mod 10) + char(48 + Code mod 10);
     852  Result := 'ATTACK_' + Char(48 + Code div 100 mod 10) +
     853    Char(48 + Code div 10 mod 10) + Char(48 + Code mod 10);
    854854end;
    855855
     
    931931          else OpenSound:=AttackSound(ModelCode(mi)); }
    932932        if MyModel[MyData.ToldModels].Kind = mkSelfDeveloped then
    933           OpenSound := 'NEWMODEL_' + char(48 + Age);
     933          OpenSound := 'NEWMODEL_' + Char(48 + Age);
    934934        MessgText := Phrases.Lookup('MODELAVAILABLE');
    935935        if GameMode = cMovie then
     
    989989end;
    990990
    991 procedure TMainScreen.PaintZoomedTile(dst: TBitmap; X, Y, Loc: Integer);
     991procedure TMainScreen.PaintZoomedTile(Dst: TBitmap; X, Y, Loc: Integer);
    992992
    993993  procedure TSprite(xDst, yDst, xSrc, ySrc: Integer);
    994994  begin
    995995    with NoMapPanel do
    996       Sprite(dst, HGrTerrain, X + xDst, Y + yDst, xxt * 2, yyt * 3,
     996      Sprite(Dst, HGrTerrain, X + xDst, Y + yDst, xxt * 2, yyt * 3,
    997997        1 + xSrc * (xxt * 2 + 1), 1 + ySrc * (yyt * 3 + 1));
    998998  end;
     
    10011001  begin
    10021002    with NoMapPanel do begin
    1003       Sprite(dst, HGrTerrain, X + xxt, Y + yyt + 2, xxt * 2, yyt * 2 - 2,
     1003      Sprite(Dst, HGrTerrain, X + xxt, Y + yyt + 2, xxt * 2, yyt * 2 - 2,
    10041004        1 + xSrc * (xxt * 2 + 1), 3 + yyt + ySrc * (yyt * 3 + 1));
    1005       Sprite(dst, HGrTerrain, X + 4, Y + 2 * yyt, xxt * 2 - 4, yyt * 2,
     1005      Sprite(Dst, HGrTerrain, X + 4, Y + 2 * yyt, xxt * 2 - 4, yyt * 2,
    10061006        5 + xSrc * (xxt * 2 + 1), 1 + yyt + ySrc * (yyt * 3 + 1));
    1007       Sprite(dst, HGrTerrain, X + xxt * 2, Y + 2 * yyt, xxt * 2 - 4, yyt * 2,
     1007      Sprite(Dst, HGrTerrain, X + xxt * 2, Y + 2 * yyt, xxt * 2 - 4, yyt * 2,
    10081008        1 + xSrc * (xxt * 2 + 1), 1 + yyt + ySrc * (yyt * 3 + 1));
    1009       Sprite(dst, HGrTerrain, X + xxt, Y + yyt * 3, xxt * 2, yyt * 2 - 2,
     1009      Sprite(Dst, HGrTerrain, X + xxt, Y + yyt * 3, xxt * 2, yyt * 2 - 2,
    10101010        1 + xSrc * (xxt * 2 + 1), 1 + yyt + ySrc * (yyt * 3 + 1));
    10111011    end;
     
    15191519  Color: TColor;
    15201520  Name: string;
    1521   ok: Boolean;
     1521  Ok: Boolean;
    15221522begin
    15231523  UnusedTribeFiles.Clear;
    1524   ok := FindFirst(LocalizedFilePath('Tribes') + DirectorySeparator + '*' + CevoTribeExt,
     1524  Ok := FindFirst(LocalizedFilePath('Tribes') + DirectorySeparator + '*' + CevoTribeExt,
    15251525    faArchive + faReadOnly, SearchRec) = 0;
    1526   if not ok then
     1526  if not Ok then
    15271527  begin
    15281528    FindClose(SearchRec);
    1529     ok := FindFirst(LocalizedFilePath('Tribes' + DirectorySeparator + '*' + CevoTribeExt),
     1529    Ok := FindFirst(LocalizedFilePath('Tribes' + DirectorySeparator + '*' + CevoTribeExt),
    15301530      faArchive + faReadOnly, SearchRec) = 0;
    15311531  end;
    1532   if ok then
     1532  if Ok then
    15331533    repeat
    15341534      SearchRec.Name := Copy(SearchRec.Name, 1, Length(SearchRec.Name) - Length(CevoTribeExt));
     
    20782078        else
    20792079        begin
    2080           S := Tribe[Me].TPhrase('AGE' + char(48 + Age));
     2080          S := Tribe[Me].TPhrase('AGE' + Char(48 + Age));
    20812081          MessgText := Format(S, [TurnToString(MyRO.Turn)]);
    20822082        end;
     
    20862086        { else begin Kind:=mkOkHelp; HelpKind:=hkAdv; HelpNo:=AgePreq[age]; end };
    20872087        CenterTo := NewAgeCenterTo;
    2088         OpenSound := 'AGE_' + char(48 + Age);
     2088        OpenSound := 'AGE_' + Char(48 + Age);
    20892089        Application.ProcessMessages;
    20902090        ShowModal;
     
    22502250          Item := 'RESEARCH_GENERAL';
    22512251          if GameMode <> cMovie then
    2252             OpenSound := 'NEWADVANCE_' + char(48 + Age);
     2252            OpenSound := 'NEWADVANCE_' + Char(48 + Age);
    22532253          Item2 := Phrases.Lookup('ADVANCES', ad);
    22542254          if ad in FutureTech then
     
    24442444              begin // !!! Shinkansen
    24452445                MoveResult := eOK;
    2446                 ok := True;
     2446                Ok := True;
    24472447                for I := 0 to MoveAdviceData.nStep - 1 do
    24482448                begin
     
    24542454                  // don't attack during auto move
    24552455                  begin
    2456                     ok := False;
    2457                     Break
     2456                    Ok := False;
     2457                    Break;
    24582458                  end
    24592459                  else
     
    24712471                    then
    24722472                    begin
    2473                       ok := False;
     2473                      Ok := False;
    24742474                      Break;
    24752475                    end;
     
    24782478                Stop := not ok or (Loc = MoveAdviceData.ToLoc) or
    24792479                  (MoveAdviceData.ToLoc = maNextCity) and
    2480                   (MyMap[Loc] and fCity <> 0)
     2480                  (MyMap[Loc] and fCity <> 0);
    24812481              end
    24822482              else
     
    29772977          with MessgExDlg do
    29782978          begin
    2979             OpenSound := 'CONTACT_' + char(48 + MyRO.EnemyReport[Integer(Data)
     2979            OpenSound := 'CONTACT_' + Char(48 + MyRO.EnemyReport[Integer(Data)
    29802980              ].Attitude);
    29812981            MessgText := Tribe[Integer(Data)].TPhrase('FRCONTACT');
     
    30053005        InitTurn(NewPlayer);
    30063006        if Command = scDipStart then
    3007           Play('CONTACT_' + char(48 + MyRO.Attitude[DipMem[NewPlayer]
     3007          Play('CONTACT_' + Char(48 + MyRO.Attitude[DipMem[NewPlayer]
    30083008            .pContact]))
    30093009        else if Command = scDipCancelTreaty then
     
    47184718var
    47194719  ProcessOptions: Integer;
    4720   rec: TRect;
     4720  Rec: TRect;
    47214721  DoInvalidate: Boolean;
    47224722begin
     
    47594759        Exit; { map window not moved }
    47604760      Offscreen.Canvas.Font.Assign(UniFont[ftSmall]);
    4761       rec := Rect(0, 0, MapWidth, MapHeight);
     4761      Rec := Rect(0, 0, MapWidth, MapHeight);
    47624762{$IFDEF WINDOWS}
    47634763      ScrollDC(Offscreen.Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,
     
    47664766{$IFDEF UNIX}
    47674767      ScrollDC(Offscreen.Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,
    4768         rec, rec, 0, nil);
     4768        Rec, Rec, 0, nil);
    47694769{$ENDIF}
    47704770      for DoInvalidate := False to FastScrolling do begin
    47714771        if DoInvalidate then begin
    4772           rec.Bottom := MapHeight - Overlap;
     4772          Rec.Bottom := MapHeight - Overlap;
    47734773{$IFDEF WINDOWS}
    47744774          ScrollDC(Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, rec,
     
    47774777{$IFDEF UNIX}
    47784778          ScrollDC(Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,
    4779             rec, rec, 0, nil);
     4779            Rec, Rec, 0, nil);
    47804780{$ENDIF}
    47814781          ProcessOptions := prInvalidate;
     
    71537153    else if BHelp.Test(ShortCut) then mHelp.Click;
    71547154    (*if Shift = [ssCtrl] then
    7155       case char(Key) of
     7155      case Char(Key) of
    71567156         'A':
    71577157          begin // auto symmetry
  • trunk/LocalPlayer/Tribes.pas

    r468 r531  
    430430    I := 0;
    431431    while (I < Count) and (Copy(Strings[I], 1, 6) <>
    432         '#AGE' + char(48 + Age) + ' ') do
     432        '#AGE' + Char(48 + Age) + ' ') do
    433433      Inc(I);
    434434    if I < Count then
     
    489489var
    490490  I: Integer;
    491   ok: Boolean;
     491  Ok: Boolean;
    492492begin
    493493  with Info do
     
    516516
    517517      // read model name from tribe script
    518       ok := False;
     518      Ok := False;
    519519      for I := 0 to Script.Count - 1 do
    520520      begin
    521521        Input := Script[I];
    522522        if Input = '#UNITS ' + ExtractFileNameOnly(GrName) then
    523           ok := True
     523          Ok := True
    524524        else if (Input <> '') and (Input[1] = '#') then
    525           ok := False
    526         else if ok and (GetNum = pix) then
     525          Ok := False
     526        else if Ok and (GetNum = pix) then
    527527        begin
    528528          Get;
  • trunk/LocalPlayer/UnitStat.pas

    r530 r531  
    293293  end;
    294294
    295   procedure FeatureBar(dst: TBitmap; X, Y: Integer; const mi: TModelInfo;
     295  procedure FeatureBar(Dst: TBitmap; X, Y: Integer; const mi: TModelInfo;
    296296    T: TTexture);
    297297  var
    298     I, W, dx, num: Integer;
     298    I, W, dx, Num: Integer;
    299299    S: string;
    300300  begin
    301     DarkGradient(dst.Canvas, X - 6, Y + 1, 180, 1);
    302     with dst.Canvas do
     301    DarkGradient(Dst.Canvas, X - 6, Y + 1, 180, 1);
     302    with Dst.Canvas do
    303303      if mi.Kind >= $10 then
    304304      begin
     
    315315        for I := 3 to nFeature - 1 do
    316316        begin
    317           num := 0;
     317          Num := 0;
    318318          case I of
    319319            mcSeaTrans:
    320320              if mi.Domain = dSea then
    321                 num := mi.TTrans;
     321                Num := mi.TTrans;
    322322            mcCarrier:
    323323              if mi.Domain = dSea then
    324                 num := mi.ATrans_Fuel;
     324                Num := mi.ATrans_Fuel;
    325325            mcBombs:
    326               num := mi.Bombs;
     326              Num := mi.Bombs;
    327327            mcFuel:
    328328              if mi.Domain = dAir then
    329                 num := mi.ATrans_Fuel;
     329                Num := mi.ATrans_Fuel;
    330330            mcAirTrans:
    331331              if mi.Domain = dAir then
    332                 num := mi.TTrans;
     332                Num := mi.TTrans;
    333333            mcFirstNonCap .. nFeature - 1:
    334334              if mi.Cap and (1 shl (I - mcFirstNonCap)) <> 0 then
    335                 num := 1;
     335                Num := 1;
    336336          end;
    337           if (num > 0) and
     337          if (Num > 0) and
    338338            ((I <> mcSE) or (mi.Cap and (1 shl (mcNP - mcFirstNonCap)) = 0))
    339339          then
    340340          begin
    341             if num > 1 then
     341            if Num > 1 then
    342342            begin
    343               S := IntToStr(num);
     343              S := IntToStr(Num);
    344344              W := TextWidth(S);
    345345              Brush.Color := $FFFFFF;
     
    352352            FrameRect(Rect(X - 3 + dx, Y + 2, X + 11 + dx, Y + 16));
    353353            Brush.Style := TBrushStyle.bsClear;
    354             Sprite(dst, HGrSystem, X - 1 + dx, Y + 4, 10, 10,
     354            Sprite(Dst, HGrSystem, X - 1 + dx, Y + 4, 10, 10,
    355355              66 + I mod 11 * 11, 137 + I div 11 * 11);
    356356            Inc(dx, 15);
     
    360360  end;
    361361
    362   procedure NumberBarS(dst: TBitmap; X, Y: Integer; Cap, S: string; T: TTexture);
    363   begin
    364     DLine(dst.Canvas, X - 2, X + 170, Y + 16, T.ColorBevelShade, T.ColorBevelLight);
    365     LoweredTextOut(dst.Canvas, -1, T, X - 2, Y, Cap);
    366     RisedTextout(dst.Canvas, X + 170 - BiColorTextWidth(dst.Canvas, S), Y, S);
     362  procedure NumberBarS(Dst: TBitmap; X, Y: Integer; Cap, S: string; T: TTexture);
     363  begin
     364    DLine(Dst.Canvas, X - 2, X + 170, Y + 16, T.ColorBevelShade, T.ColorBevelLight);
     365    LoweredTextOut(Dst.Canvas, -1, T, X - 2, Y, Cap);
     366    RisedTextout(Dst.Canvas, X + 170 - BiColorTextWidth(Dst.Canvas, S), Y, S);
    367367  end;
    368368
  • trunk/Log.pas

    r468 r531  
    7373    if List.Lines.Count = MaxLines then
    7474      List.Lines.Delete(0);
    75     List.Lines.Add(char(48 + Turn div 100 mod 10) +
    76       char(48 + Turn div 10 mod 10) + char(48 + Turn mod 10) + ' ' + Text);
     75    List.Lines.Add(Char(48 + Turn div 100 mod 10) +
     76      Char(48 + Turn div 10 mod 10) + Char(48 + Turn mod 10) + ' ' + Text);
    7777    PostMessage(List.Handle, WM_VSCROLL, SB_BOTTOM, 0);
    7878    Update;
  • trunk/NoTerm.pas

    r471 r531  
    386386  Shift: TShiftState);
    387387begin
    388   if (char(Key) = 'M') and (ssCtrl in Shift) then
     388  if (Char(Key) = 'M') and (ssCtrl in Shift) then
    389389    if LogDlg.Visible then
    390390      LogDlg.Close
  • trunk/Packages/CevoComponents/ButtonA.pas

    r471 r531  
    1414    procedure SetCaption(Text: string);
    1515    procedure SetFont(const Font: TFont);
     16  protected
     17    procedure Paint; override;
     18  public
     19    property Font: TFont write SetFont;
    1620  published
    1721    property Visible;
    1822    property Caption: string read FCaption write SetCaption;
    1923    property OnClick;
    20   public
    21     property Font: TFont write SetFont;
    22   protected
    23     procedure Paint; override;
    2424  end;
    2525
  • trunk/Packages/CevoComponents/ButtonB.pas

    r471 r531  
    1414    FIndex: Integer;
    1515    procedure SetIndex(Text: Integer);
     16  protected
     17    procedure Paint; override;
    1618  public
    1719    property Mask: TBitmap read FMask write FMask;
     
    2022    property ButtonIndex: Integer read FIndex write SetIndex;
    2123    property OnClick;
    22   protected
    23     procedure Paint; override;
    2424  end;
    2525
  • trunk/Packages/CevoComponents/ButtonBase.pas

    r496 r531  
    140140// procedure TButtonBase.PlayDownSound;
    141141// begin
    142 // if DownSound<>'' then SndPlaySound(pchar(DownSound),SND_ASYNC)
     142// if DownSound<>'' then SndPlaySound(PChar(DownSound),SND_ASYNC)
    143143// end;
    144144
    145145// procedure TButtonBase.PlayUpSound;
    146146// begin
    147 // if UpSound<>'' then SndPlaySound(pchar(UpSound),SND_ASYNC)
     147// if UpSound<>'' then SndPlaySound(PChar(UpSound),SND_ASYNC)
    148148// end;
    149149
  • trunk/Packages/CevoComponents/ButtonC.pas

    r447 r531  
    1212    FIndex: Integer;
    1313    procedure SetIndex(Text: Integer);
     14  protected
     15    procedure Paint; override;
    1416  published
    1517    property Visible;
    1618    property ButtonIndex: Integer read FIndex write SetIndex;
    1719    property OnClick;
    18   protected
    19     procedure Paint; override;
    2020  end;
    2121
  • trunk/Packages/CevoComponents/ButtonN.pas

    r505 r531  
    2020    procedure SetIndex(X: Integer);
    2121    procedure SetSmartHint(X: string);
     22  protected
     23    procedure Paint; override;
     24    procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
     25      X, Y: Integer); override;
    2226  published
    2327    property Possible: Boolean read FPossible write SetPossible;
     
    2933    property ButtonIndex: Integer read FIndex write SetIndex;
    3034    property OnClick: TNotifyEvent read ChangeProc write ChangeProc;
    31   protected
    32     procedure Paint; override;
    33     procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
    34       X, Y: Integer); override;
    3535  end;
    3636
  • trunk/Packages/CevoComponents/DrawDlg.pas

    r527 r531  
    4343    procedure FormCreate(Sender: TObject);
    4444    procedure FormPaint(Sender: TObject);
    45   public
    46     MessgText: string;
    4745  protected
    4846    Lines: Integer;
     
    5048    procedure SplitText(Preview: Boolean);
    5149    procedure CorrectHeight;
     50  public
     51    MessgText: string;
    5252  end;
    5353
  • trunk/Packages/CevoComponents/EOTButton.pas

    r530 r531  
    1717  // EndOfTurn button
    1818  TEOTButton = class(TButtonBase)
     19  private
     20    FTemplate: TBitmap;
     21    FIndex: Integer;
     22    procedure SetIndex(X: Integer);
     23  protected
     24    Buffer, Back: TBitmap;
     25    procedure Paint; override;
    1926  public
    2027    constructor Create(aOwner: TComponent); override;
     
    2229    procedure SetButtonIndexFast(X: Integer);
    2330    procedure SetBack(Canvas: TCanvas; X, Y: Integer);
    24   private
    25     FTemplate: TBitmap;
    26     FIndex: Integer;
    27     procedure SetIndex(X: Integer);
    28   public
    2931    property Template: TBitmap read FTemplate write FTemplate;
    3032  published
     
    3234    property ButtonIndex: Integer read FIndex write SetIndex;
    3335    property OnClick;
    34   protected
    35     Buffer, Back: TBitmap;
    36     procedure Paint; override;
    3736  end;
    3837
  • trunk/Packages/CevoComponents/ScreenTools.pas

    r530 r531  
    10401040      else begin
    10411041        DstPtr.NextPixel;
    1042         continue;
     1042        Continue;
    10431043      end;
    10441044      if R = 0 then
  • trunk/Packages/CevoComponents/Sound.pas

    r447 r531  
    315315  Result := (WavFileName <> '') and (WavFileName[1] <> '[') and (WavFileName <> '*');
    316316  if Result then
    317     // SndPlaySound(pchar(GetSoundsDir + DirectorySeparator + WavFileName + '.wav'), SND_ASYNC)
     317    // SndPlaySound(PChar(GetSoundsDir + DirectorySeparator + WavFileName + '.wav'), SND_ASYNC)
    318318    PlaySound(GetSoundsDir + DirectorySeparator + WavFileName);
    319319end;
  • trunk/Packages/Common/Common.pas

    r456 r531  
    184184(*function DelTree(DirName : string): Boolean;
    185185var
    186   SHFileOpStruct : TSHFileOpStruct;
    187   DirBuf : array [0..255] of char;
     186  SHFileOpStruct: TSHFileOpStruct;
     187  DirBuf: array [0..255] of char;
    188188begin
    189189  DirName := UTF8Decode(DirName);
    190190  try
    191     Fillchar(SHFileOpStruct,Sizeof(SHFileOpStruct),0) ;
    192     FillChar(DirBuf, Sizeof(DirBuf), 0 ) ;
    193     StrPCopy(DirBuf, DirName) ;
     191    FillChar(SHFileOpStruct, Sizeof(SHFileOpStruct), 0);
     192    FillChar(DirBuf, Sizeof(DirBuf), 0 );
     193    StrPCopy(DirBuf, DirName);
    194194    with SHFileOpStruct do begin
    195195      Wnd := 0;
     
    200200      fFlags := fFlags or FOF_SILENT;
    201201    end;
    202     Result := (SHFileOperation(SHFileOpStruct) = 0) ;
     202    Result := (SHFileOperation(SHFileOpStruct) = 0);
    203203  except
    204      Result := False;
     204    Result := False;
    205205  end;
    206206end;*)
  • trunk/Start.pas

    r520 r531  
    16231623  NewName: string;
    16241624  F: file;
    1625   ok: Boolean;
     1625  Ok: Boolean;
    16261626  MapPictureFileName: string;
    16271627begin
     
    16521652        AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] +
    16531653          CevoMapExt);
    1654       ok := True;
     1654      Ok := True;
    16551655      try
    16561656        if Page = pgLoad then
     
    16601660      except
    16611661        // Play('INVALID');
    1662         ok := False;
     1662        Ok := False;
    16631663      end;
    16641664      if Page <> pgLoad then begin
     
    16741674        end;
    16751675      end;
    1676       if ok then begin
     1676      if Ok then begin
    16771677        if Page = pgLoad then
    16781678          FormerGames[List.ItemIndex] := NewName
Note: See TracChangeset for help on using the changeset viewer.