Changeset 29 for trunk/LocalPlayer


Ignore:
Timestamp:
Jan 8, 2017, 10:20:03 PM (8 years ago)
Author:
chronos
Message:
  • Fixed: Use DirectorySeparator in directory path for platform independence.
  • Fixed: Some warining about incorrect pointer arithmetic.
  • Added: Support for multi-platform AI library name and location.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1111lib
        1212heaptrclog.trc
         13c-evo
  • trunk/LocalPlayer/CityScreen.pas

    r28 r29  
    216216  Back.Height := ClientHeight;
    217217  Template := TBitmap.Create;
    218   LoadGraphicFile(Template, HomeDir + 'Graphics\City', gfNoGamma);
     218  LoadGraphicFile(Template, HomeDir + 'Graphics' + DirectorySeparator + 'City', gfNoGamma);
    219219  Template.PixelFormat := pf8bit;
    220220  CityMapTemplate := TBitmap.Create;
    221   LoadGraphicFile(CityMapTemplate, HomeDir + 'Graphics\BigCityMap', gfNoGamma);
     221  LoadGraphicFile(CityMapTemplate, HomeDir + 'Graphics' + DirectorySeparator + 'BigCityMap', gfNoGamma);
    222222  CityMapTemplate.PixelFormat := pf8bit;
    223223  SmallCityMapTemplate := TBitmap.Create;
    224   LoadGraphicFile(SmallCityMapTemplate, HomeDir + 'Graphics\SmallCityMap',
     224  LoadGraphicFile(SmallCityMapTemplate, HomeDir + 'Graphics' + DirectorySeparator + 'SmallCityMap',
    225225    gfNoGamma);
    226226  SmallCityMapTemplate.PixelFormat := pf24bit;
  • trunk/LocalPlayer/Draft.pas

    r21 r29  
    66uses
    77  Protocol, ClientTools, Term, ScreenTools, PVSB, BaseWin,
    8   LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls,
    9   ButtonA, ButtonB, Area;
     8
     9  LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls,
     10  ButtonA,
     11  ButtonB, ButtonBase, Area;
    1012
    1113type
     
    8991  Back.Height := ClientHeight;
    9092  Template := TBitmap.Create;
    91   LoadGraphicFile(Template, HomeDir + 'Graphics\MiliRes', gfNoGamma);
     93  LoadGraphicFile(Template, HomeDir + 'Graphics' + DirectorySeparator + 'MiliRes', gfNoGamma);
    9294  Template.PixelFormat := pf8bit;
    9395end;
  • trunk/LocalPlayer/Help.pas

    r28 r29  
    66uses
    77  Protocol, ScreenTools, BaseWin, StringTables,
     8
    89  LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms,
    9   ExtCtrls, ButtonB, PVSB, Types;
     10  ExtCtrls, ButtonB, PVSB, ButtonBase, Types;
    1011
    1112const
     
    4041
    4142  THyperText = class(TStringList)
    42   public
    4343    procedure AddLine(s: String = ''; Format: integer = 0; Picpix: integer = 0;
    4444      LinkCategory: integer = 0; LinkIndex: integer = 0);
     
    11691169    List := TStringList.Create;
    11701170    plus := TStringList.Create;
    1171     if FindFirst(HomeDir + 'Graphics\*.credits.txt', $27, sr) = 0 then
     1171    if FindFirst(HomeDir + 'Graphics' + DirectorySeparator + '*.credits.txt', $27, sr) = 0 then
    11721172      repeat
    1173         plus.LoadFromFile(HomeDir + 'Graphics\' + sr.Name);
     1173        plus.LoadFromFile(HomeDir + 'Graphics' + DirectorySeparator + sr.Name);
    11741174        List.AddStrings(plus);
    11751175      until FindNext(sr) <> 0;
     
    12031203  begin
    12041204    List := TStringList.Create;
    1205     List.LoadFromFile(HomeDir + 'Sounds\sound.credits.txt');
     1205    List.LoadFromFile(HomeDir + 'Sounds' + DirectorySeparator + 'sound.credits.txt');
    12061206    for i := 0 to List.Count - 1 do
    12071207    begin
     
    19171917        case Link and $FF of
    19181918          1:
    1919              OpenDocument(pchar(HomeDir + 'AI Template\AI development manual.html'));{ *Převedeno z ShellExecute* }
     1919             OpenDocument(pchar(HomeDir + 'AI Template' + DirectorySeparator + 'AI development manual.html'));{ *Převedeno z ShellExecute* }
    19201920          2:
    19211921            OpenURL('http://c-evo.org');{ *Převedeno z ShellExecute* }
  • trunk/LocalPlayer/NatStat.pas

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

    r28 r29  
    1010  Protocol, Tribes, PVSB, ClientTools, ScreenTools, BaseWin, Messg, ButtonBase,
    1111
    12   LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, Menus,
     12  LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms, Menus,
    1313  ExtCtrls, dateutils, Platform,
    14   ButtonB, ButtonC, EOTButton, Area;
     14  ButtonA, ButtonB, ButtonC, EOTButton, Area;
    1515
    1616const
     
    34173417      doinit := false;
    34183418      OpenKey('SOFTWARE\cevo\RegVer9', false);
    3419       try
    3420         if ValueExists('TileWidth') then xxt := ReadInteger('TileWidth') div 2;
    3421         if ValueExists('TileHeight') then yyt := ReadInteger('TileHeight') div 2;
    3422         if ValueExists('OptionChecked') then OptionChecked := ReadInteger('OptionChecked');
    3423         if ValueExists('MapOptionChecked') then MapOptionChecked := ReadInteger('MapOptionChecked');
    3424         if ValueExists('CityMapMask') then CityRepMask := Cardinal(ReadInteger('CityReport'));
    3425       except
    3426         doinit := true;
    3427       end;
     3419      if ValueExists('TileWidth') then xxt := ReadInteger('TileWidth') div 2
     3420        else xxt := 48;
     3421      if ValueExists('TileHeight') then yyt := ReadInteger('TileHeight') div 2
     3422        else yyt := 24;
     3423      if ValueExists('OptionChecked') then OptionChecked := ReadInteger('OptionChecked')
     3424        else OptionChecked := DefaultOptionChecked;
     3425      if ValueExists('MapOptionChecked') then MapOptionChecked := ReadInteger('MapOptionChecked')
     3426        else MapOptionChecked := 1 shl moCityNames;
     3427      if ValueExists('CityMapMask') then CityRepMask := Cardinal(ReadInteger('CityReport'))
     3428        else CityRepMask := Cardinal(not chPopIncrease and not chNoGrowthWarning and
     3429        not chCaptured);
    34283430      CloseKey;
    34293431      if OptionChecked and (7 shl 16) = 0 then
     
    34313433      // old regver with no scrolling
    34323434    end;
    3433     Reg.free;
    3434     if doinit then
    3435     begin
    3436       xxt := 48;
    3437       yyt := 24;
    3438       OptionChecked := DefaultOptionChecked;
    3439       MapOptionChecked := 1 shl moCityNames;
    3440       CityRepMask := Cardinal(not chPopIncrease and not chNoGrowthWarning and
    3441         not chCaptured);
    3442     end;
    3443 
    3444     if FullScreen then
    3445     begin
     3435    Reg.Free;
     3436
     3437    if FullScreen then begin
    34463438      p.Style := $87000000;
    34473439      BorderStyle := bsNone;
     
    34543446      SoundMode := smOnAlt
    34553447    else
    3456       SoundMode := smOn
     3448      SoundMode := smOn;
    34573449  end;
    34583450
     
    49784970    GotoOnly: boolean;
    49794971  begin
    4980     Dist := 0;
    49814972    if ClientMode >= scContact then
    49824973      exit;
  • trunk/LocalPlayer/UnitStat.pas

    r21 r29  
    66uses
    77  Protocol, ClientTools, Term, ScreenTools, BaseWin,
    8   LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms,
    9   ButtonB, ButtonC;
     8
     9  LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms, ButtonA,
     10  ButtonB,
     11  ButtonBase, ButtonC;
    1012
    1113type
     
    8183  Back.Height := hMax;
    8284  Template := TBitmap.Create;
    83   LoadGraphicFile(Template, HomeDir + 'Graphics\Unit', gfNoGamma);
     85  LoadGraphicFile(Template, HomeDir + 'Graphics' + DirectorySeparator + 'Unit', gfNoGamma);
    8486  Template.PixelFormat := pf8bit;
    8587end;
Note: See TracChangeset for help on using the changeset viewer.