Changeset 21


Ignore:
Timestamp:
Jan 8, 2017, 3:12:18 PM (8 years ago)
Author:
chronos
Message:
  • Fixed: Run as 64-bit application. Can't load 32-bit StdAI library in 64-bit mode.
  • Fixed: Various Warnings and Hints.
Location:
trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/Back.pas

    r20 r21  
    55
    66uses
    7   LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Forms;
     7  LCLIntf, LCLType, SysUtils, Classes, Graphics, Forms;
    88
    99type
  • trunk/Database.pas

    r10 r21  
    891891      Dist[i, j] := Distance(RareLoc[i], RareLoc[j]);
    892892
     893  ibest := 0;
     894  jbest := 0;
    893895  MinDist := Distance(0, MapSize - lx shr 1) shr 1;
    894896  for RareType := 1 to 3 do
     
    12901292
    12911293var
    1292   p1, p2, nAlive, c, Loc, Loc1, CntGood, CntGoodGrass, MinDist, Tries, i, j, n,
    1293     nsc, TestLoc, V21, V8, BestDist, TestDist, MinGood, nIrrLoc, xLoc, yLoc, qx,
    1294     qy, FineDistSQR, nRest: integer;
     1294  p1, p2, nAlive, c, Loc, Loc1, CntGood, CntGoodGrass, MinDist, i, j, n,
     1295    nsc, V21, V8, BestDist, TestDist, MinGood, nIrrLoc,
     1296    FineDistSQR, nRest: integer;
    12951297  ccount: array [0 .. lxmax * lymax - 1] of word;
    12961298  sc, StartLoc0, sccount: array [1 .. nPl] of integer;
  • trunk/Inp.pas

    r9 r21  
    77  ScreenTools, Messg,
    88
    9   LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms,
    10   ButtonA, StdCtrls, ButtonB, ButtonBase;
     9  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms,
     10  ButtonA, StdCtrls;
    1111
    1212type
  • trunk/Integrated.lpi

    r17 r21  
    342342        <StackChecks Value="True"/>
    343343      </Checks>
     344      <VerifyObjMethodCallValidity Value="True"/>
    344345    </CodeGeneration>
    345346    <Linking>
  • trunk/LocalPlayer/BaseWin.pas

    r17 r21  
    77  ScreenTools, Messg,
    88
    9   LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms;
     9  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms;
    1010
    1111type
  • trunk/LocalPlayer/Battle.pas

    r17 r21  
    66uses
    77  ScreenTools, Protocol, Messg, ButtonBase, ButtonA, Types, LCLIntf, LCLType,
    8 
    9   Messages, SysUtils, Classes, Graphics, Controls, Forms;
     8  SysUtils, Classes, Graphics, Controls, Forms;
    109
    1110type
  • trunk/LocalPlayer/Diagram.pas

    r17 r21  
    55
    66uses
    7   BaseWin,
    8 
    9   LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms,
    10   ButtonB, ButtonBase, Menus;
     7  BaseWin, LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms,
     8  ButtonB, Menus;
    119
    1210type
     
    230228      end;
    231229
     230      y0 := 0;
    232231      if max > 0 then
    233232      begin
  • trunk/LocalPlayer/Draft.pas

    r20 r21  
    66uses
    77  Protocol, ClientTools, Term, ScreenTools, PVSB, BaseWin,
    8 
    9   LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls,
    10   ButtonA,
    11   ButtonB, ButtonBase, Area;
     8  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls,
     9  ButtonA, ButtonB, Area;
    1210
    1311type
     
    9189  Back.Height := ClientHeight;
    9290  Template := TBitmap.Create;
    93   LoadGraphicFile(Template, HomeDir + 'Graphics' + DirectorySeparator + 'MiliRes', gfNoGamma);
     91  LoadGraphicFile(Template, HomeDir + 'Graphics\MiliRes', gfNoGamma);
    9492  Template.PixelFormat := pf8bit;
    9593end;
  • trunk/LocalPlayer/Enhance.pas

    r17 r21  
    77  ScreenTools, BaseWin, Protocol, ClientTools, Term, LCLIntf, LCLType,
    88
    9   Messages, SysUtils, Classes, Graphics, Controls, Forms,
    10   ButtonBase, ButtonB, ButtonC, Menus;
     9  SysUtils, Classes, Graphics, Controls, Forms,
     10  ButtonB, ButtonC, Menus;
    1111
    1212type
  • trunk/LocalPlayer/Help.pas

    r20 r21  
    66uses
    77  Protocol, ScreenTools, BaseWin, StringTables,
    8 
    98  LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms,
    10   ExtCtrls, ButtonB, PVSB, ButtonBase, Types;
     9  ExtCtrls, ButtonB, PVSB, Types;
    1110
    1211const
     
    4140
    4241  THyperText = class(TStringList)
     42  public
    4343    procedure AddLine(s: String = ''; Format: integer = 0; Picpix: integer = 0;
    4444      LinkCategory: integer = 0; LinkIndex: integer = 0);
     
    11651165    List := TStringList.Create;
    11661166    plus := TStringList.Create;
    1167     if FindFirst(HomeDir + 'Graphics' + DirectorySeparator + '*.credits.txt', $27, sr) = 0 then
     1167    if FindFirst(HomeDir + 'Graphics\*.credits.txt', $27, sr) = 0 then
    11681168      repeat
    1169         plus.LoadFromFile(HomeDir + 'Graphics' + DirectorySeparator + sr.Name);
     1169        plus.LoadFromFile(HomeDir + 'Graphics\' + sr.Name);
    11701170        List.AddStrings(plus);
    11711171      until FindNext(sr) <> 0;
     
    11991199  begin
    12001200    List := TStringList.Create;
    1201     List.LoadFromFile(HomeDir + 'Sounds' + DirectorySeparator + 'sound.credits.txt');
     1201    List.LoadFromFile(HomeDir + 'Sounds\sound.credits.txt');
    12021202    for i := 0 to List.Count - 1 do
    12031203    begin
     
    19131913        case Link and $FF of
    19141914          1:
    1915              OpenDocument(pchar(HomeDir + 'AI Template' + DirectorySeparator + 'AI development manual.html'));{ *Převedeno z ShellExecute* }
     1915             OpenDocument(pchar(HomeDir + 'AI Template\AI development manual.html'));{ *Převedeno z ShellExecute* }
    19161916          2:
    19171917            OpenURL('http://c-evo.org');{ *Převedeno z ShellExecute* }
  • trunk/LocalPlayer/IsoEngine.pas

    r17 r21  
    77  Protocol, ClientTools, ScreenTools, Tribes,
    88{$IFNDEF SCR}Term, {$ENDIF}
    9   LCLIntf, LCLType, LMessages, SysUtils, Classes, Graphics;
     9  LCLIntf, LCLType, SysUtils, Classes, Graphics;
    1010
    1111type
     
    3333    FLeft, FTop, FRight, FBottom, RealTop, RealBottom, AttLoc, DefLoc,
    3434      DefHealth, FAdviceLoc: integer;
    35     OutDC, DataDC, MaskDC: Cardinal;
     35    OutDC, DataDC, MaskDC: HDC;
    3636    function Connection4(Loc, Mask, Value: integer): integer;
    3737    function Connection8(Loc, Mask: integer): integer;
  • trunk/LocalPlayer/MessgEx.pas

    r17 r21  
    66uses
    77  Messg, Protocol, ScreenTools, Platform, DateUtils,
    8 
    9   LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms, ButtonA,
    10   ButtonB, ButtonBase, StdCtrls;
     8  LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, ButtonA,
     9  ButtonB, StdCtrls;
    1110
    1211type
  • trunk/LocalPlayer/NatStat.pas

    r20 r21  
    66uses
    77  Protocol, ClientTools, Term, ScreenTools, BaseWin,
    8 
    9   LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms,
    10   ButtonBase, ButtonB, ButtonC, Menus, EOTButton;
     8  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms,
     9  ButtonB, ButtonC, Menus, EOTButton;
    1110
    1211type
  • trunk/LocalPlayer/Nego.pas

    r17 r21  
    55
    66uses
    7   ScreenTools, BaseWin, Protocol, Term, LCLType,
    8 
    9   Messages, SysUtils, Classes, Graphics, Controls, Forms, ButtonA,
    10   ButtonBase, ButtonB, ButtonC, ButtonN;
     7  ScreenTools, BaseWin, Protocol, Term, LCLType, SysUtils, Classes, Graphics,
     8  Controls, Forms, ButtonA, ButtonB, ButtonN;
    119
    1210const
     
    10199
    102100uses
    103   Messg, ClientTools, Diplomacy, Inp, Select, NatStat, Help, Tribes, MessgEx;
     101  Messg, ClientTools, Diplomacy, Inp, Select, NatStat, Tribes, MessgEx;
    104102
    105103{$R *.dfm}
     
    290288  preview, Dot: boolean;
    291289begin
     290  nLines := 0;
    292291  for preview := true downto false do
    293292  begin
  • trunk/LocalPlayer/Term.pas

    r20 r21  
    1010  Protocol, Tribes, PVSB, ClientTools, ScreenTools, BaseWin, Messg, ButtonBase,
    1111
    12   LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms, Menus,
     12  LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, Menus,
    1313  ExtCtrls, dateutils, Platform,
    14   ButtonA, ButtonB, ButtonC, EOTButton, Area;
     14  ButtonB, ButtonC, EOTButton, Area;
    1515
    1616const
     
    49724972    GotoOnly: boolean;
    49734973  begin
     4974    Dist := 0;
    49744975    if ClientMode >= scContact then
    49754976      exit;
  • trunk/LocalPlayer/UnitStat.pas

    r20 r21  
    66uses
    77  Protocol, ClientTools, Term, ScreenTools, BaseWin,
    8 
    9   LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms, ButtonA,
    10   ButtonB,
    11   ButtonBase, ButtonC;
     8  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms,
     9  ButtonB, ButtonC;
    1210
    1311type
     
    8381  Back.Height := hMax;
    8482  Template := TBitmap.Create;
    85   LoadGraphicFile(Template, HomeDir + 'Graphics' + DirectorySeparator + 'Unit', gfNoGamma);
     83  LoadGraphicFile(Template, HomeDir + 'Graphics\Unit', gfNoGamma);
    8684  Template.PixelFormat := pf8bit;
    8785end;
  • trunk/LocalPlayer/Wonders.pas

    r17 r21  
    66uses
    77  ScreenTools, BaseWin, Protocol,
    8 
    9   LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms,
    10   ButtonBase, ButtonB;
     8  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms, ButtonB;
    119
    1210type
  • trunk/Messg.pas

    r20 r21  
    1616type
    1717  TDrawDlg = class(TForm)
     18  public
    1819    constructor Create(AOwner: TComponent); override;
    19   public
    2020    procedure SmartInvalidate; virtual;
    2121  protected
     
    126126      TButtonBase(Components[cix]).Graphic := GrExt[HGrSystem].Data;
    127127      // if ButtonDownSound<>'*' then
    128       // DownSound:=HomeDir+'Sounds'+DirectorySeparator+ButtonDownSound+'.wav';
     128      // DownSound:=HomeDir+'Sounds\'+ButtonDownSound+'.wav';
    129129      // if ButtonUpSound<>'*' then
    130       // UpSound:=HomeDir+'Sounds'+DirectorySeparator+ButtonUpSound+'.wav';
     130      // UpSound:=HomeDir+'Sounds\'+ButtonUpSound+'.wav';
    131131      if Components[cix] is TButtonA then
    132132        TButtonA(Components[cix]).Font := UniFont[ftButton];
  • trunk/NoTerm.pas

    r17 r21  
    66uses
    77  ScreenTools, Protocol, Messg, LCLIntf, LCLType, dateutils, Platform,
    8 
    9   Messages, SysUtils, Classes, Graphics, Controls, Forms,
    10   ButtonBase, ButtonB;
     8  SysUtils, Classes, Graphics, Controls, Forms, ButtonB;
    119
    1210type
  • trunk/ScreenTools.pas

    r20 r21  
    99  {$ENDIF}
    1010  StringTables,
    11   LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls,
     11  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls,
    1212  Forms, Menus;
    1313
     
    192192
    193193uses
    194   Directories, Sound, ButtonBase, ButtonA, ButtonB,
    195 
    196   Registry;
     194  Directories, Sound, Registry;
    197195
    198196var
     
    386384procedure ApplyGamma(Start, Stop: pbyte);
    387385begin
    388   while integer(Start) < integer(Stop) do
     386  while Start < Stop do
    389387  begin
    390388    Start^ := GammaLUT[Start^];
     
    443441    FirstLine := bmp.ScanLine[0];
    444442    LastLine := bmp.ScanLine[bmp.Height - 1];
    445     if integer(FirstLine) < integer(LastLine) then
     443    if FirstLine < LastLine then
    446444      ApplyGamma(pointer(FirstLine), @LastLine[bmp.Width])
    447445    else
     
    501499    FirstLine := bmp.ScanLine[0];
    502500    LastLine := bmp.ScanLine[bmp.Height - 1];
    503     if integer(FirstLine) < integer(LastLine) then
     501    if FirstLine < LastLine then
    504502      ApplyGamma(pointer(FirstLine), @LastLine[bmp.Width])
    505503    else
     
    612610// X channel = background amp (old Dst content), 128=original brightness
    613611type
    614   TPixel = array [0 .. 2] of Byte;
     612  TPixel = array [0..2] of Byte;
     613  PPixel = ^TPixel;
    615614var
    616615  i, Brightness, test: integer;
    617616  PixelSrc: ^Byte;
    618   PixelDst: ^TPixel;
     617  PixelDst: PPixel;
    619618begin
    620619  {TODO assert(Src.PixelFormat = pf8bit);}
     
    642641  while yDst < h do
    643642  begin
    644     PixelDst := pointer(integer(dst.ScanLine[yDst]) + 3 * xDst);
    645     PixelSrc := pointer(integer(Src.ScanLine[ySrc]) + xSrc);
     643    PixelDst := dst.ScanLine[yDst] + 3 * xDst;
     644    PixelSrc := Src.ScanLine[ySrc] + xSrc;
    646645    for i := 0 to w - 1 do
    647646    begin
     
    662661      else
    663662        PixelDst[0] := test; // Blue
    664       PixelDst := pointer(integer(PixelDst) + 3);
    665       PixelSrc := pointer(integer(PixelSrc) + 1);
     663      PixelDst := Pointer(PixelDst) + 3;
     664      PixelSrc := Pointer(PixelSrc) + 1;
    666665    end;
    667666    inc(yDst);
     
    751750  while y < h do
    752751  begin
    753     Pixel := pointer(integer(bmp.ScanLine[y]) + 3 * x);
     752    Pixel := bmp.ScanLine[y] + 3 * x;
    754753    for i := 0 to w - 1 do
    755754    begin
     
    764763      Pixel[1] := Green;
    765764      Pixel[2] := Red;
    766       Pixel := pointer(integer(Pixel) + 3);
     765      Pixel := Pointer(Pixel) + 3;
    767766    end;
    768767    inc(y);
  • trunk/Sound.pas

    r18 r21  
    44
    55uses
    6   Messages, SysUtils, Classes, Graphics, Controls, Forms {$IFDEF WINDOWS}, MMSystem{$ENDIF};
     6  Messages, SysUtils, Classes, Graphics, Controls, Forms {$IFDEF WINDOWS}, MMSystem, Windows{$ENDIF};
    77
    88function PrepareSound(FileName: string): integer;
     
    7373  begin
    7474    PlayParm.dwCallback := HWND;
    75     mciSendCommand(FDeviceID, MCI_PLAY, MCI_NOTIFY, integer(@PlayParm));
     75    mciSendCommand(FDeviceID, MCI_PLAY, MCI_NOTIFY, DWORD_PTR(@PlayParm));
    7676  end
    7777  {$ENDIF}
Note: See TracChangeset for help on using the changeset viewer.