Changeset 39 for trunk


Ignore:
Timestamp:
Jan 9, 2017, 7:58:25 PM (8 years ago)
Author:
chronos
Message:
  • Fixed: Retyping from pointer to integer doesn't work on 64-bit architecture.
  • Fixed: Do not use CreateWindowEx for scrollbar under Linux.
  • Fixed: Warning about unintialized record fields.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Integrated.lpi

    r38 r39  
    438438        <StackChecks Value="True"/>
    439439      </Checks>
    440       <VerifyObjMethodCallValidity Value="True"/>
    441       <TargetCPU Value="i386"/>
    442       <TargetOS Value="win32"/>
    443440    </CodeGeneration>
    444441    <Linking>
  • trunk/LocalPlayer/Help.pas

    r38 r39  
    4141
    4242  THyperText = class(TStringList)
     43  public
    4344    procedure AddLine(s: String = ''; Format: integer = 0; Picpix: integer = 0;
    4445      LinkCategory: integer = 0; LinkIndex: integer = 0);
  • trunk/LocalPlayer/PVSB.pas

    r38 r39  
    88  Windows,
    99  {$ENDIF}
    10   LCLIntf, LCLType, LMessages, Messages, SysUtils;
     10  Forms, LCLIntf, LCLType, LMessages, Messages, SysUtils;
    1111
    1212type
    1313  TPVScrollbar = record
    1414    h: integer;
    15     si: TScrollInfo end;
     15    si: TScrollInfo;
     16    Form: TForm;
     17  end;
    1618
    17     procedure CreatePVSB(var sb: TPVScrollbar; Handle, y0, x1, y1: integer);
    18     procedure InitPVSB(var sb: TPVScrollbar; max, Page: integer);
    19     function ProcessPVSB(var sb: TPVScrollbar; const m: TMessage): boolean;
    20     function ProcessMouseWheel(var sb: TPVScrollbar; const m: TMessage)
    21       : boolean;
    22     procedure ShowPVSB(var sb: TPVScrollbar; Visible: boolean);
    23     procedure EndPVSB(var sb: TPVScrollbar);
     19  procedure CreatePVSB(var sb: TPVScrollbar; Handle, y0, x1, y1: integer);
     20  procedure InitPVSB(var sb: TPVScrollbar; max, Page: integer);
     21  function ProcessPVSB(var sb: TPVScrollbar; const m: TMessage): boolean;
     22  function ProcessMouseWheel(var sb: TPVScrollbar; const m: TMessage)
     23    : boolean;
     24  procedure ShowPVSB(var sb: TPVScrollbar; Visible: boolean);
     25  procedure EndPVSB(var sb: TPVScrollbar);
    2426
    2527implementation
     
    2830  Count: integer = 0;
    2931
    30 procedure CreatePVSB;
     32procedure CreatePVSB(var sb: TPVScrollbar; Handle, y0, x1, y1: integer);
    3133begin
    3234  inc(Count);
     35  {$IFDEF LINUX}
     36  sb.Form := TForm.Create(nil);
     37  sb.h := sb.Form.Handle;
     38  {$ENDIF}
    3339  {$IFDEF WINDOWS}
    3440  sb.h := CreateWindowEx(0, 'SCROLLBAR', pchar('PVSB' + IntToStr(Count)),
     
    3945end;
    4046
    41 procedure InitPVSB;
     47procedure InitPVSB(var sb: TPVScrollbar; max, Page: integer);
    4248begin
    4349  {$IFDEF WINDOWS}
     
    5864end;
    5965
    60 function ProcessPVSB;
     66function ProcessPVSB(var sb: TPVScrollbar; const m: TMessage): Boolean;
    6167var
    6268  NewPos: integer;
     
    101107end;
    102108
    103 function ProcessMouseWheel;
     109function ProcessMouseWheel(var sb: TPVScrollbar; const m: TMessage): Boolean;
    104110var
    105111  NewPos: integer;
  • trunk/Protocol.pas

    r38 r39  
    909909    (adSmartWeapons, preNone, preNone)); // futMissileTechnology
    910910
    911 Imp:
    912 array [0 .. nImp - 1] of // city improvements
    913   record Kind, Preq, Cost, Maint, Expiration: integer;
     911Imp: array [0 .. nImp - 1] of // city improvements
     912record
     913  Kind: Integer;
     914  Preq: Integer;
     915  Cost: Integer;
     916  Maint: Integer;
     917  Expiration: integer;
    914918end
    915919= ((Kind: ikWonder; Preq: adMathematics; Cost: 400; Maint: 0;
     
    935939  (Kind: ikWonder; Preq: adMonotheism; Cost: 400; Maint: 0; Expiration: - 1),
    936940  // woMich
    937   (Kind: ikNA; Preq: preNA), // {11}
    938   (Kind: ikWonder; Preq: adTheoryOfGravity; Cost: 400; Maint: 0;
    939   Expiration: - 1), // woNewton
     941  (Kind: ikNA; Preq: preNA; Cost: 0; Maint: 0; Expiration: 0), // {11}
     942  (Kind: ikWonder; Preq: adTheoryOfGravity; Cost: 400; Maint: 0; Expiration: - 1), // woNewton
    940943  (Kind: ikWonder; Preq: adTheology; Cost: 400; Maint: 0; Expiration: - 1),
    941944  // woBach
    942   (Kind: ikNA; Preq: preNA), // {14}
     945  (Kind: ikNA; Preq: preNA; Cost: 0; Maint: 0; Expiration: 0), // {14}
    943946  (Kind: ikWonder; Preq: adDemocracy; Cost: 500; Maint: 0; Expiration: - 1),
    944947  // woLiberty
     
    953956  (Kind: ikWonder; Preq: adSpaceFlight; Cost: 800; Maint: 0; Expiration: - 1),
    954957  // woMir
    955   (Kind: ikNA; Preq: preNA), // {21}
    956   (Kind: ikNA; Preq: preNA), // {22}
    957   (Kind: ikNA; Preq: preNA), // {23}
    958   (Kind: ikNA; Preq: preNA), // {24}
    959   (Kind: ikNA; Preq: preNA), // {25}
    960   (Kind: ikNA; Preq: preNA), // {26}
    961   (Kind: ikNA; Preq: preNA), // {27}
    962   (Kind: ikTrGoods; Preq: preNone; Cost: 0; Maint: 0), // imTrGoods
    963   (Kind: ikCommon; Preq: adWarriorCode; Cost: 40; Maint: 1), // imBarracks
    964   (Kind: ikCommon; Preq: adPottery; Cost: 60; Maint: 1), // imGranary
    965   (Kind: ikCommon; Preq: adCeremonialBurial; Cost: 40; Maint: 1), // imTemple
    966   (Kind: ikCommon; Preq: adCurrency; Cost: 60; Maint: 1), // imMarket
    967   (Kind: ikCommon; Preq: adWriting; Cost: 80; Maint: 3), // imLibrary
    968   (Kind: ikCommon; Preq: adCodeOfLaws; Cost: 80; Maint: 2), // imCourt
    969   (Kind: ikCommon; Preq: adMasonry; Cost: 80; Maint: 1), // imWalls
    970   (Kind: ikCommon; Preq: adConstruction; Cost: 80; Maint: 1), // imAqueduct
    971   (Kind: ikCommon; Preq: adBanking; Cost: 120; Maint: 2), // imBank
    972   (Kind: ikCommon; Preq: adMonotheism; Cost: 100; Maint: 1), // imCathedral
    973   (Kind: ikCommon; Preq: adUniversity; Cost: 160; Maint: 5), // imUniversity
    974   (Kind: ikCommon; Preq: adSeafaring; Cost: 60; Maint: 1), // imHarbor
    975   (Kind: ikCommon; Preq: adPoetry; Cost: 60; Maint: 2), // imTheater
    976   (Kind: ikCommon; Preq: adIndustrialization; Cost: 200; Maint: 3), // imFactory
    977   (Kind: ikCommon; Preq: adRobotics; Cost: 320; Maint: 5), // imMfgPlant
    978   (Kind: ikCommon; Preq: adRecycling; Cost: 320; Maint: 4), // imRecycling
    979   (Kind: ikCommon; Preq: adElectricity; Cost: 120; Maint: 2), // imPower
    980   (Kind: ikCommon; Preq: adEnvironmentalism; Cost: 120; Maint: 1), // imHydro
    981   (Kind: ikCommon; Preq: adNuclearPower; Cost: 240; Maint: 2), // imNuclear
    982   (Kind: ikCommon; Preq: adRefining; Cost: 160; Maint: 2), // imPlatform
    983   (Kind: ikCommon; Preq: preNone; Cost: 40; Maint: 1), // imTownHall
    984   (Kind: ikCommon; Preq: adSanitation; Cost: 120; Maint: 2), // imSewer
    985   (Kind: ikCommon; Preq: adRefrigeration; Cost: 80; Maint: 2), // imSupermarket
    986   (Kind: ikCommon; Preq: adAutomobile; Cost: 160; Maint: 4), // imHighways
    987   (Kind: ikCommon; Preq: adComputers; Cost: 240; Maint: 7), // imResLab
    988   (Kind: ikCommon; Preq: adAdvancedRocketry; Cost: 100; Maint: 1),
     958  (Kind: ikNA; Preq: preNA; Cost: 0; Maint: 0; Expiration: 0), // {21}
     959  (Kind: ikNA; Preq: preNA; Cost: 0; Maint: 0; Expiration: 0), // {22}
     960  (Kind: ikNA; Preq: preNA; Cost: 0; Maint: 0; Expiration: 0), // {23}
     961  (Kind: ikNA; Preq: preNA; Cost: 0; Maint: 0; Expiration: 0), // {24}
     962  (Kind: ikNA; Preq: preNA; Cost: 0; Maint: 0; Expiration: 0), // {25}
     963  (Kind: ikNA; Preq: preNA; Cost: 0; Maint: 0; Expiration: 0), // {26}
     964  (Kind: ikNA; Preq: preNA; Cost: 0; Maint: 0; Expiration: 0), // {27}
     965  (Kind: ikTrGoods; Preq: preNone; Cost: 0; Maint: 0; Expiration: 0), // imTrGoods
     966  (Kind: ikCommon; Preq: adWarriorCode; Cost: 40; Maint: 1; Expiration: 0), // imBarracks
     967  (Kind: ikCommon; Preq: adPottery; Cost: 60; Maint: 1; Expiration: 0), // imGranary
     968  (Kind: ikCommon; Preq: adCeremonialBurial; Cost: 40; Maint: 1; Expiration: 0), // imTemple
     969  (Kind: ikCommon; Preq: adCurrency; Cost: 60; Maint: 1; Expiration: 0), // imMarket
     970  (Kind: ikCommon; Preq: adWriting; Cost: 80; Maint: 3; Expiration: 0), // imLibrary
     971  (Kind: ikCommon; Preq: adCodeOfLaws; Cost: 80; Maint: 2; Expiration: 0), // imCourt
     972  (Kind: ikCommon; Preq: adMasonry; Cost: 80; Maint: 1; Expiration: 0), // imWalls
     973  (Kind: ikCommon; Preq: adConstruction; Cost: 80; Maint: 1; Expiration: 0), // imAqueduct
     974  (Kind: ikCommon; Preq: adBanking; Cost: 120; Maint: 2; Expiration: 0), // imBank
     975  (Kind: ikCommon; Preq: adMonotheism; Cost: 100; Maint: 1; Expiration: 0), // imCathedral
     976  (Kind: ikCommon; Preq: adUniversity; Cost: 160; Maint: 5; Expiration: 0), // imUniversity
     977  (Kind: ikCommon; Preq: adSeafaring; Cost: 60; Maint: 1; Expiration: 0), // imHarbor
     978  (Kind: ikCommon; Preq: adPoetry; Cost: 60; Maint: 2; Expiration: 0), // imTheater
     979  (Kind: ikCommon; Preq: adIndustrialization; Cost: 200; Maint: 3; Expiration: 0), // imFactory
     980  (Kind: ikCommon; Preq: adRobotics; Cost: 320; Maint: 5; Expiration: 0), // imMfgPlant
     981  (Kind: ikCommon; Preq: adRecycling; Cost: 320; Maint: 4; Expiration: 0), // imRecycling
     982  (Kind: ikCommon; Preq: adElectricity; Cost: 120; Maint: 2; Expiration: 0), // imPower
     983  (Kind: ikCommon; Preq: adEnvironmentalism; Cost: 120; Maint: 1; Expiration: 0), // imHydro
     984  (Kind: ikCommon; Preq: adNuclearPower; Cost: 240; Maint: 2; Expiration: 0), // imNuclear
     985  (Kind: ikCommon; Preq: adRefining; Cost: 160; Maint: 2; Expiration: 0), // imPlatform
     986  (Kind: ikCommon; Preq: preNone; Cost: 40; Maint: 1; Expiration: 0), // imTownHall
     987  (Kind: ikCommon; Preq: adSanitation; Cost: 120; Maint: 2; Expiration: 0), // imSewer
     988  (Kind: ikCommon; Preq: adRefrigeration; Cost: 80; Maint: 2; Expiration: 0), // imSupermarket
     989  (Kind: ikCommon; Preq: adAutomobile; Cost: 160; Maint: 4; Expiration: 0), // imHighways
     990  (Kind: ikCommon; Preq: adComputers; Cost: 240; Maint: 7; Expiration: 0), // imResLab
     991  (Kind: ikCommon; Preq: adAdvancedRocketry; Cost: 100; Maint: 1; Expiration: 0),
    989992  // imMissileBat
    990   (Kind: ikCommon; Preq: adMetallurgy; Cost: 80; Maint: 1), // imCoastalFort
    991   (Kind: ikCommon; Preq: adAdvancedFlight; Cost: 160; Maint: 1), // imAirport
    992   (Kind: ikCommon; Preq: adAmphibiousWarfare; Cost: 80; Maint: 1), // imDockyard
    993   (Kind: ikNatLocal; Preq: preNone; Cost: 100; Maint: 0), // imPalace
    994   (Kind: ikNatLocal; Preq: adEngineering; Cost: 400; Maint: 4), // imGrWall
    995   (Kind: ikNatLocal; Preq: adConstruction; Cost: 200; Maint: 4), // imColosseum
    996   (Kind: ikNatLocal; Preq: adAstronomy; Cost: 300; Maint: 4), // imObservatory
    997   (Kind: ikNatLocal; Preq: adTactics; Cost: 100; Maint: 4), // imMilAcademy
    998   (Kind: ikNatLocal; Preq: adSteel; Cost: 200; Maint: 2), // imBunker
    999   (Kind: ikNatLocal; Preq: adSyntheticFood; Cost: 120; Maint: 2), // imAlgae
    1000   (Kind: ikNatGlobal; Preq: adTheCorporation; Cost: 320; Maint: 4), // imStockEx
    1001   (Kind: ikNatLocal; Preq: adSpaceFlight; Cost: 400; Maint: 0), // imSpacePort
    1002   (Kind: ikShipPart; Preq: adTransstellarColonization; Cost: 240; Maint: 0),
     993  (Kind: ikCommon; Preq: adMetallurgy; Cost: 80; Maint: 1; Expiration: 0), // imCoastalFort
     994  (Kind: ikCommon; Preq: adAdvancedFlight; Cost: 160; Maint: 1; Expiration: 0), // imAirport
     995  (Kind: ikCommon; Preq: adAmphibiousWarfare; Cost: 80; Maint: 1; Expiration: 0), // imDockyard
     996  (Kind: ikNatLocal; Preq: preNone; Cost: 100; Maint: 0; Expiration: 0), // imPalace
     997  (Kind: ikNatLocal; Preq: adEngineering; Cost: 400; Maint: 4; Expiration: 0), // imGrWall
     998  (Kind: ikNatLocal; Preq: adConstruction; Cost: 200; Maint: 4; Expiration: 0), // imColosseum
     999  (Kind: ikNatLocal; Preq: adAstronomy; Cost: 300; Maint: 4; Expiration: 0), // imObservatory
     1000  (Kind: ikNatLocal; Preq: adTactics; Cost: 100; Maint: 4; Expiration: 0), // imMilAcademy
     1001  (Kind: ikNatLocal; Preq: adSteel; Cost: 200; Maint: 2; Expiration: 0), // imBunker
     1002  (Kind: ikNatLocal; Preq: adSyntheticFood; Cost: 120; Maint: 2; Expiration: 0), // imAlgae
     1003  (Kind: ikNatGlobal; Preq: adTheCorporation; Cost: 320; Maint: 4; Expiration: 0), // imStockEx
     1004  (Kind: ikNatLocal; Preq: adSpaceFlight; Cost: 400; Maint: 0; Expiration: 0), // imSpacePort
     1005  (Kind: ikShipPart; Preq: adTransstellarColonization; Cost: 240; Maint: 0; Expiration: 0),
    10031006  // imShipComp
    1004   (Kind: ikShipPart; Preq: adImpulseDrive; Cost: 600; Maint: 0), // imShipPow
    1005   (Kind: ikShipPart; Preq: adSelfContainedEnvironment; Cost: 800; Maint: 0));
     1007  (Kind: ikShipPart; Preq: adImpulseDrive; Cost: 600; Maint: 0; Expiration: 0), // imShipPow
     1008  (Kind: ikShipPart; Preq: adSelfContainedEnvironment; Cost: 800; Maint: 0; Expiration: 0));
    10061009// imShipHab
    10071010
    10081011nImpReplacement = 5;
    1009 ImpReplacement:
    1010 array [0 .. nImpReplacement - 1] of record NewImp, OldImp: integer;
     1012ImpReplacement: array [0 .. nImpReplacement - 1] of record
     1013  NewImp: Integer;
     1014  OldImp: Integer;
    10111015end
    10121016= ((NewImp: imSewer; OldImp: imAqueduct), (NewImp: imCourt; OldImp: imTownHall),
     
    10191023spPow = 1;
    10201024spHab = 2;
    1021 ShipNeed:
    1022 array [0 .. nShipPart - 1] of integer = (6, 4, 2);
    1023 ShipImpIndex:
    1024 array [0 .. nShipPart - 1] of integer = (imShipComp, imShipPow, imShipHab);
    1025 
    1026 GovPreq:
    1027 array [1 .. nGov - 1] of integer = { government prerequisites }
     1025ShipNeed: array [0 .. nShipPart - 1] of integer = (6, 4, 2);
     1026ShipImpIndex: array [0 .. nShipPart - 1] of integer = (imShipComp, imShipPow, imShipHab);
     1027
     1028GovPreq: array [1 .. nGov - 1] of integer = { government prerequisites }
    10281029  (preNone, adMonarchy, adTheRepublic, adTheology, adCommunism, adDemocracy,
    10291030  adInternet);
    10301031
    1031 AgePreq:
    1032 array [1 .. 3] of integer = (adScience, adMassProduction,
     1032AgePreq: array [1 .. 3] of integer = (adScience, adMassProduction,
    10331033  adTransstellarColonization);
    10341034
    1035 Terrain:
    1036 array [0 .. 11] of record MoveCost, Defense, ClearTerrain, IrrEff, IrrClearWork,
    1037   AfforestTerrain, MineEff, MineAfforestWork, TransTerrain, TransWork: integer;
    1038 FoodRes, ProdRes, TradeRes: array [0 .. 2] of integer;
    1039 Filler:
    1040 array [0 .. 12] of integer;
     1035Terrain: array [0 .. 11] of record
     1036  MoveCost: Integer;
     1037  Defense: Integer;
     1038  ClearTerrain: Integer;
     1039  IrrEff: Integer;
     1040  IrrClearWork: Integer;
     1041  AfforestTerrain: Integer;
     1042  MineEff: Integer;
     1043  MineAfforestWork: Integer;
     1044  TransTerrain: Integer;
     1045  TransWork: Integer;
     1046  FoodRes, ProdRes, TradeRes: array [0 .. 2] of Integer;
     1047  Filler: array [0 .. 12] of Integer;
    10411048end
    10421049= ((MoveCost: 1; Defense: 4; ClearTerrain: - 1; IrrEff: 0; IrrClearWork: 0;
    10431050  AfforestTerrain: - 1; MineEff: 0; MineAfforestWork: 0; TransTerrain: - 1;
    10441051  TransWork: 0; FoodRes: (0, 0, 0); ProdRes: (0, 0, 0);
    1045   TradeRes: (0, 0, 0)), { Ocn }
     1052  TradeRes: (0, 0, 0); Filler: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), { Ocn }
    10461053  (MoveCost: 1; Defense: 4; ClearTerrain: - 1; IrrEff: 0; IrrClearWork: 0;
    10471054  AfforestTerrain: - 1; MineEff: 0; MineAfforestWork: 0; TransTerrain: - 1;
    10481055  TransWork: 0; FoodRes: (1, 5, 1); ProdRes: (0, 0, 5);
    1049   TradeRes: (3, 3, 3)), { Sho }
     1056  TradeRes: (3, 3, 3); Filler: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), { Sho }
    10501057  (MoveCost: 1; Defense: 4; ClearTerrain: - 1; IrrEff: 1; IrrClearWork: 600;
    10511058  AfforestTerrain: fForest; MineEff: 0; MineAfforestWork: 1800;
    10521059  TransTerrain: fHills; TransWork: 3000; FoodRes: (3, 2, 2); ProdRes: (0, 1, 0);
    1053   TradeRes: (1, 1, 1)), { Gra }
     1060  TradeRes: (1, 1, 1); Filler: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), { Gra }
    10541061  (MoveCost: 1; Defense: 4; ClearTerrain: fGrass; IrrEff: 0; IrrClearWork: 1800;
    10551062  AfforestTerrain: - 1; MineEff: 1; MineAfforestWork: 600;
    10561063  TransTerrain: fPrairie; TransWork: 3000; FoodRes: (0, 3, 0);
    1057   ProdRes: (1, 1, 4); TradeRes: (1, 1, 1)), { Dst }
     1064  ProdRes: (1, 1, 4); TradeRes: (1, 1, 1); Filler: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), { Dst }
    10581065  (MoveCost: 1; Defense: 4; ClearTerrain: - 1; IrrEff: 1; IrrClearWork: 600;
    10591066  AfforestTerrain: fForest; MineEff: 0; MineAfforestWork: 2400;
    10601067  TransTerrain: - 1; TransWork: 0; FoodRes: (1, 3, 1); ProdRes: (1, 1, 3);
    1061   TradeRes: (1, 1, 1)), { Pra }
     1068  TradeRes: (1, 1, 1); Filler: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), { Pra }
    10621069  (MoveCost: 1; Defense: 4; ClearTerrain: - 1; IrrEff: 1; IrrClearWork: 600;
    10631070  AfforestTerrain: - 1; MineEff: 0; MineAfforestWork: 0; TransTerrain: fGrass;
    10641071  TransWork: 3000; FoodRes: (1, 1, 1); ProdRes: (0, 0, 4);
    1065   TradeRes: (1, 6, 1)), { Tun }
     1072  TradeRes: (1, 6, 1); Filler: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), { Tun }
    10661073  (MoveCost: 2; Defense: 4; ClearTerrain: - 1; IrrEff: 0; IrrClearWork: 0;
    10671074  AfforestTerrain: - 1; MineEff: 3; MineAfforestWork: 1800; TransTerrain: - 1;
    10681075  TransWork: 0; FoodRes: (0, 3, 0); ProdRes: (1, 1, 0);
    1069   TradeRes: (0, 4, 0)), { Arc }
     1076  TradeRes: (0, 4, 0); Filler: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), { Arc }
    10701077  (MoveCost: 2; Defense: 6; ClearTerrain: fGrass; IrrEff: 0; IrrClearWork: 2400;
    10711078  AfforestTerrain: fForest; MineEff: 0; MineAfforestWork: 2400;
    10721079  TransTerrain: fHills; TransWork: 3000; FoodRes: (1, 1, 1); ProdRes: (0, 4, 1);
    1073   TradeRes: (1, 1, 5)), { Swa }
    1074   (), { - }
     1080  TradeRes: (1, 1, 5); Filler: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), { Swa }
     1081  (MoveCost: 0; Defense: 0; ClearTerrain: 0; IrrEff: 0;
     1082  IrrClearWork: 0; AfforestTerrain: 0; MineEff: 0; MineAfforestWork: 0;
     1083  TransTerrain: 0; TransWork: 0; FoodRes: (0, 0, 0); ProdRes: (0, 0, 0);
     1084  TradeRes: (0, 0, 0); Filler: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), { - }
    10751085  (MoveCost: 2; Defense: 6; ClearTerrain: fPrairie; IrrEff: 0;
    10761086  IrrClearWork: 600; AfforestTerrain: - 1; MineEff: 0; MineAfforestWork: 0;
    10771087  TransTerrain: - 1; TransWork: 0; FoodRes: (1, 3, 1); ProdRes: (2, 2, 2);
    1078   TradeRes: (1, 1, 4)), { For }
     1088  TradeRes: (1, 1, 4); Filler: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), { For }
    10791089  (MoveCost: 2; Defense: 8; ClearTerrain: - 1; IrrEff: 1; IrrClearWork: 600;
    10801090  AfforestTerrain: - 1; MineEff: 3; MineAfforestWork: 1200;
    10811091  TransTerrain: fGrass; TransWork: 6000; FoodRes: (1, 1, 1); ProdRes: (0, 0, 2);
    1082   TradeRes: (0, 4, 0)), { Hil }
     1092  TradeRes: (0, 4, 0); Filler: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), { Hil }
    10831093  (MoveCost: 3; Defense: 12; ClearTerrain: - 1; IrrEff: 0; IrrClearWork: 0;
    10841094  AfforestTerrain: - 1; MineEff: 2; MineAfforestWork: 1200; TransTerrain: - 1;
    10851095  TransWork: 0; FoodRes: (0, 0, 0); ProdRes: (1, 4, 1);
    1086   TradeRes: (0, 0, 7))); { Mou }
     1096  TradeRes: (0, 0, 7); Filler: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))); { Mou }
    10871097
    10881098// settler work required MP
     
    11041114nUpgrade = 15;
    11051115upgrade:
    1106 array [0 .. nDomains - 1, 0 .. nUpgrade - 1] of record Preq, Strength, Trans,
    1107   Cost: integer
     1116array [0 .. nDomains - 1, 0 .. nUpgrade - 1] of record
     1117  Preq: Integer;
     1118  Strength: Integer;
     1119  Trans: Integer;
     1120  Cost: integer;
    11081121end
    1109 = (((Preq: adWarriorCode; Strength: 4; Trans: 0;
    1110   Cost: 3), (Preq: adBronzeWorking; Strength: 2; Trans: 0;
    1111   Cost: 4), (Preq: adIronWorking; Strength: 2; Trans: 0;
    1112   Cost: 5), (Preq: adChivalry; Strength: 2; Trans: 0;
    1113   Cost: 5), (Preq: adMonotheism; Strength: 3; Trans: 0;
    1114   Cost: 7), (Preq: adGunpowder; Strength: 3; Trans: 0;
    1115   Cost: 8), (Preq: adExplosives; Strength: 4; Trans: 0;
    1116   Cost: 9), (Preq: adTactics; Strength: 5; Trans: 0; Cost: 10), (Preq: adRadio;
    1117   Strength: 6; Trans: 0; Cost: 11), (Preq: adDemocracy; Strength: 6; Trans: 0;
    1118   Cost: 5), (Preq: adMobileWarfare; Strength: 7; Trans: 0;
    1119   Cost: 12), (Preq: adRobotics; Strength: 8; Trans: 0;
    1120   Cost: 15), (Preq: adComposites; Strength: 8; Trans: 0;
    1121   Cost: 15), (Preq: adTheLaser; Strength: 8; Trans: 0;
    1122   Cost: 14), (Preq: futMaterialTechnology; Strength: 10; Trans: 0; Cost: 2)),
    1123   ((Preq: adMapMaking; Strength: 4; Trans: 1; Cost: 8), (Preq: adNavigation;
    1124   Strength: 4; Trans: 0; Cost: 10), (Preq: adEngineering; Strength: 0; Trans: 1;
    1125   Cost: 8), (Preq: adGunpowder; Strength: 8; Trans: 0;
    1126   Cost: 12), (Preq: adMagnetism; Strength: 12; Trans: 1;
    1127   Cost: 20), (Preq: adExplosives; Strength: 16; Trans: 0;
    1128   Cost: 24), (Preq: adSteamEngine; Strength: 24; Trans: 0;
    1129   Cost: 28), (Preq: adAmphibiousWarfare; Strength: 24; Trans: 1;
    1130   Cost: 18), (Preq: adAdvancedRocketry; Strength: 32; Trans: 0;
    1131   Cost: 38), (Preq: futMaterialTechnology; Strength: 14; Trans: 0;
    1132   Cost: 4), (Preq: futArtificialIntelligence; Strength: 14; Trans: 0;
    1133   Cost: 4), (Preq: preNA), (Preq: preNA), (Preq: preNA), (Preq: preNA)),
    1134   ((Preq: adFlight; Strength: 12; Trans: 1; Cost: 14), (Preq: adTactics;
    1135   Strength: 6; Trans: 0; Cost: 17), (Preq: adElectronics; Strength: 6; Trans: 0;
    1136   Cost: 20), (Preq: adMin; Strength: 8; Trans: 0; Cost: 24),
    1137   (Preq: adComposites; Strength: 8; Trans: 0; Cost: 26), (Preq: adSmartWeapons;
    1138   Strength: 11; Trans: 0; Cost: 32), (Preq: futArtificialIntelligence;
    1139   Strength: 7; Trans: 0; Cost: 4), (Preq: preNA), (Preq: preNA), (Preq: preNA),
    1140   (Preq: preNA), (Preq: preNA), (Preq: preNA), (Preq: preNA), (Preq: preNA)));
     1122= (((Preq: adWarriorCode; Strength: 4; Trans: 0; Cost: 3),
     1123  (Preq: adBronzeWorking; Strength: 2; Trans: 0; Cost: 4),
     1124  (Preq: adIronWorking; Strength: 2; Trans: 0; Cost: 5),
     1125  (Preq: adChivalry; Strength: 2; Trans: 0; Cost: 5),
     1126  (Preq: adMonotheism; Strength: 3; Trans: 0; Cost: 7),
     1127  (Preq: adGunpowder; Strength: 3; Trans: 0; Cost: 8),
     1128  (Preq: adExplosives; Strength: 4; Trans: 0; Cost: 9),
     1129  (Preq: adTactics; Strength: 5; Trans: 0; Cost: 10),
     1130  (Preq: adRadio; Strength: 6; Trans: 0; Cost: 11),
     1131  (Preq: adDemocracy; Strength: 6; Trans: 0; Cost: 5),
     1132  (Preq: adMobileWarfare; Strength: 7; Trans: 0; Cost: 12),
     1133  (Preq: adRobotics; Strength: 8; Trans: 0; Cost: 15),
     1134  (Preq: adComposites; Strength: 8; Trans: 0; Cost: 15),
     1135  (Preq: adTheLaser; Strength: 8; Trans: 0; Cost: 14),
     1136  (Preq: futMaterialTechnology; Strength: 10; Trans: 0; Cost: 2)),
     1137  ((Preq: adMapMaking; Strength: 4; Trans: 1; Cost: 8),
     1138  (Preq: adNavigation; Strength: 4; Trans: 0; Cost: 10),
     1139  (Preq: adEngineering; Strength: 0; Trans: 1; Cost: 8),
     1140  (Preq: adGunpowder; Strength: 8; Trans: 0; Cost: 12),
     1141  (Preq: adMagnetism; Strength: 12; Trans: 1; Cost: 20),
     1142  (Preq: adExplosives; Strength: 16; Trans: 0; Cost: 24),
     1143  (Preq: adSteamEngine; Strength: 24; Trans: 0; Cost: 28),
     1144  (Preq: adAmphibiousWarfare; Strength: 24; Trans: 1; Cost: 18),
     1145  (Preq: adAdvancedRocketry; Strength: 32; Trans: 0; Cost: 38),
     1146  (Preq: futMaterialTechnology; Strength: 14; Trans: 0; Cost: 4),
     1147  (Preq: futArtificialIntelligence; Strength: 14; Trans: 0; Cost: 4),
     1148  (Preq: preNA; Strength: 0; Trans: 0; Cost: 0),
     1149  (Preq: preNA; Strength: 0; Trans: 0; Cost: 0),
     1150  (Preq: preNA; Strength: 0; Trans: 0; Cost: 0),
     1151  (Preq: preNA; Strength: 0; Trans: 0; Cost: 0)),
     1152  ((Preq: adFlight; Strength: 12; Trans: 1; Cost: 14),
     1153  (Preq: adTactics; Strength: 6; Trans: 0; Cost: 17),
     1154  (Preq: adElectronics; Strength: 6; Trans: 0; Cost: 20),
     1155  (Preq: adMin; Strength: 8; Trans: 0; Cost: 24),
     1156  (Preq: adComposites; Strength: 8; Trans: 0; Cost: 26),
     1157  (Preq: adSmartWeapons; Strength: 11; Trans: 0; Cost: 32),
     1158  (Preq: futArtificialIntelligence; Strength: 7; Trans: 0; Cost: 4),
     1159  (Preq: preNA; Strength: 0; Trans: 0; Cost: 0),
     1160  (Preq: preNA; Strength: 0; Trans: 0; Cost: 0),
     1161  (Preq: preNA; Strength: 0; Trans: 0; Cost: 0),
     1162  (Preq: preNA; Strength: 0; Trans: 0; Cost: 0),
     1163  (Preq: preNA; Strength: 0; Trans: 0; Cost: 0),
     1164  (Preq: preNA; Strength: 0; Trans: 0; Cost: 0),
     1165  (Preq: preNA; Strength: 0; Trans: 0; Cost: 0),
     1166  (Preq: preNA; Strength: 0; Trans: 0; Cost: 0)));
    11411167
    11421168{ model features }
  • trunk/ScreenTools.pas

    r38 r39  
    238238{$ENDIF}
    239239begin
     240  Result := False;
    240241{$IFNDEF DEBUG}
    241242  if (Sounds = nil) or (SoundMode = smOff) or (Item = '') then
     
    386387procedure ApplyGamma(Start, Stop: pbyte);
    387388begin
    388   while integer(Start) < integer(Stop) do
     389  while Start < Stop do
    389390  begin
    390391    Start^ := GammaLUT[Start^];
     
    444445    FirstLine := bmp.ScanLine[0];
    445446    LastLine := bmp.ScanLine[bmp.Height - 1];
    446     if integer(FirstLine) < integer(LastLine) then
     447    if FirstLine < LastLine then
    447448      ApplyGamma(pointer(FirstLine), @LastLine[bmp.Width])
    448449    else
     
    504505    FirstLine := bmp.ScanLine[0];
    505506    LastLine := bmp.ScanLine[bmp.Height - 1];
    506     if integer(FirstLine) < integer(LastLine) then
    507       ApplyGamma(pointer(FirstLine), @LastLine[bmp.Width])
     507    if FirstLine < LastLine then
     508      ApplyGamma(Pointer(FirstLine), @LastLine[bmp.Width])
    508509    else
    509       ApplyGamma(pointer(LastLine), @FirstLine[bmp.Width]);
     510      ApplyGamma(Pointer(LastLine), @FirstLine[bmp.Width]);
    510511    bmp.EndUpdate;
    511512  end
     
    649650
    650651  dst.BeginUpdate;
     652  Src.BeginUpdate;
    651653  h := yDst + h;
    652654  while yDst < h do
    653655  begin
    654     PixelDst := pointer(integer(dst.ScanLine[yDst]) + 3 * xDst);
    655     PixelSrc := pointer(integer(Src.ScanLine[ySrc]) + xSrc);
     656    PixelDst := dst.ScanLine[yDst] + 3 * xDst;
     657    PixelSrc := Src.ScanLine[ySrc] + xSrc;
    656658    for i := 0 to w - 1 do
    657659    begin
     
    672674      else
    673675        PixelDst[0] := test; // Blue
    674       PixelDst := pointer(integer(PixelDst) + 3);
    675       PixelSrc := pointer(integer(PixelSrc) + 1);
     676      PixelDst := Pointer(PixelDst) + 3;
     677      PixelSrc := Pointer(PixelSrc) + 1;
    676678    end;
    677679    inc(yDst);
    678680    inc(ySrc);
    679681  end;
     682  src.EndUpdate;
    680683  dst.EndUpdate;
    681684end;
     
    763766  while y < h do
    764767  begin
    765     Pixel := pointer(integer(bmp.ScanLine[y]) + 3 * x);
     768    Pixel := pointer(bmp.ScanLine[y]) + 3 * x;
    766769    for i := 0 to w - 1 do
    767770    begin
     
    776779      Pixel[1] := Green;
    777780      Pixel[2] := Red;
    778       Pixel := pointer(integer(Pixel) + 3);
     781      Pixel := pointer(Pixel) + 3;
    779782    end;
    780783    inc(y);
  • trunk/Switches.inc

    r38 r39  
    1010{$TYPEINFO OFF}
    1111{$DEBUGINFO ON}
    12 {$LOCALSYMBOLS ON}
     12//{$LOCALSYMBOLS ON}
    1313
    14 {$E-,S-,Z1}
     14//{$E-}
     15{$S-}
     16{$Z1}
    1517
    1618{$IFDEF FPC} // freepascal
Note: See TracChangeset for help on using the changeset viewer.