Ignore:
Timestamp:
Jun 23, 2019, 3:15:29 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Use DpiControls package for High DPI support.
Location:
branches/highdpi/LocalPlayer
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/LocalPlayer/Battle.pas

    r111 r178  
    66uses
    77  ScreenTools, Protocol, Messg, ButtonBase, ButtonA, Types, LCLIntf, LCLType,
    8   SysUtils, Classes, Graphics, Controls, Forms, DrawDlg;
     8  SysUtils, Classes, Graphics, Controls, Forms, DrawDlg, UDpiControls;
    99
    1010type
     
    3030  BattleDlg: TBattleDlg;
    3131
    32 procedure PaintBattleOutcome(ca: TCanvas; xm, ym, uix, ToLoc: Integer;
     32procedure PaintBattleOutcome(ca: TDpiCanvas; xm, ym, uix, ToLoc: Integer;
    3333  Forecast: TBattleForecastEx);
    3434
     
    4848  FirstStrikeColor = $A0A0A0;
    4949
    50 procedure PaintBattleOutcome(ca: TCanvas; xm, ym, uix, ToLoc: Integer;
     50procedure PaintBattleOutcome(ca: TDpiCanvas; xm, ym, uix, ToLoc: Integer;
    5151  Forecast: TBattleForecastEx);
    5252var
  • branches/highdpi/LocalPlayer/CityScreen.pas

    r173 r178  
    88  LMessages,
    99  {$ENDIF}
    10   Protocol, ClientTools, Term, ScreenTools, IsoEngine, BaseWin,
     10  Protocol, ClientTools, Term, ScreenTools, IsoEngine, BaseWin, UDpiControls,
    1111  LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls,
    1212  ButtonA, ButtonC, Area, GraphType;
     
    7474    AreaMap: TIsoMap;
    7575    CityMapTemplate, SmallCityMapTemplate, Back, SmallCityMap, ZoomCityMap,
    76       Template: TBitmap;
     76      Template: TDpiBitmap;
    7777    IsPort, ProdHint, AllowChange: boolean;
    7878    procedure InitSmallCityMap;
     
    9090
    9191uses
    92   Select, Messg, MessgEx, Help, Tribes, Directories, Math, PixelPointer, Sound;
     92  Select, Messg, MessgEx, Help, Tribes, Directories, Math;
    9393
    9494{$R *.lfm}
     
    210210  end;
    211211
    212   Back := TBitmap.Create;
     212  Back := TDpiBitmap.Create;
    213213  Back.PixelFormat := pf24bit;
    214214  Back.SetSize(Width, Height);
    215215  Back.Canvas.FillRect(0, 0, Back.Width, Back.Height);
    216   Template := TBitmap.Create;
     216  Template := TDpiBitmap.Create;
    217217  Template.PixelFormat := pf24bit;
    218218  LoadGraphicFile(Template, HomeDir + 'Graphics' + DirectorySeparator + 'City.png', gfNoGamma);
    219   CityMapTemplate := TBitmap.Create;
     219  CityMapTemplate := TDpiBitmap.Create;
    220220  CityMapTemplate.PixelFormat := pf24bit;
    221221  LoadGraphicFile(CityMapTemplate, HomeDir + 'Graphics' + DirectorySeparator + 'BigCityMap.png', gfNoGamma);
    222   SmallCityMapTemplate := TBitmap.Create;
     222  SmallCityMapTemplate := TDpiBitmap.Create;
    223223  SmallCityMapTemplate.PixelFormat := pf24bit;
    224224  LoadGraphicFile(SmallCityMapTemplate, HomeDir + 'Graphics' + DirectorySeparator + 'SmallCityMap.png',
    225225    gfNoGamma);
    226   SmallCityMap := TBitmap.Create;
     226  SmallCityMap := TDpiBitmap.Create;
    227227  SmallCityMap.PixelFormat := pf24bit;
    228228  SmallCityMap.SetSize(98, 74);
    229229  SmallCityMap.Canvas.FillRect(0, 0, SmallCityMap.Width, SmallCityMap.Height);
    230   ZoomCityMap := TBitmap.Create;
     230  ZoomCityMap := TDpiBitmap.Create;
    231231  ZoomCityMap.PixelFormat := pf24bit;
    232232  ZoomCityMap.SetSize(228, 124);
  • branches/highdpi/LocalPlayer/Diagram.pas

    r135 r178  
    66uses
    77  BaseWin, LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms,
    8   ButtonB, Menus;
     8  ButtonB, Menus, UDpiControls;
    99
    1010type
     
    3434  DiaDlg: TDiaDlg;
    3535
    36 procedure PaintColonyShip(canvas: TCanvas; Player, Left, Width, Top: integer);
     36procedure PaintColonyShip(canvas: TDpiCanvas; Player, Left, Width, Top: integer);
    3737
    3838implementation
     
    5555  yHab: array [0 .. 1] of integer = (-81, 1);
    5656
    57 procedure PaintColonyShip(canvas: TCanvas; Player, Left, Width, Top: integer);
     57procedure PaintColonyShip(canvas: TDpiCanvas; Player, Left, Width, Top: integer);
    5858var
    5959  i, x, r, nComp, nPow, nHab: integer;
  • branches/highdpi/LocalPlayer/Draft.pas

    r104 r178  
    55
    66uses
    7   Protocol, ClientTools, Term, ScreenTools, BaseWin,
    8 
     7  Protocol, ClientTools, Term, ScreenTools, BaseWin, UDpiControls,
    98  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls,
    109  ButtonA,
     
    3534      IncCap, DecCap: integer;
    3635    code: array [0 .. nFeature - 1] of integer;
    37     Template, Back: TBitmap;
     36    Template, Back: TDpiBitmap;
    3837    function IsFeatureInList(d, i: integer): boolean;
    3938    procedure SetDomain(d: integer);
     
    8685  end;
    8786
    88   Back := TBitmap.Create;
     87  Back := TDpiBitmap.Create;
    8988  Back.PixelFormat := pf24bit;
    9089  Back.SetSize(Width, Height);
    9190  Back.Canvas.FillRect(0, 0, Back.Width, Back.Height);
    92   Template := TBitmap.Create;
     91  Template := TDpiBitmap.Create;
    9392  Template.PixelFormat := pf24bit;
    9493  LoadGraphicFile(Template, HomeDir + 'Graphics' + DirectorySeparator + 'MiliRes.png', gfNoGamma);
  • branches/highdpi/LocalPlayer/Help.pas

    r172 r178  
    55
    66uses
    7   Protocol, ScreenTools, BaseWin, StringTables, Math,
     7  Protocol, ScreenTools, BaseWin, StringTables, Math, UDpiControls,
    88  LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms,
    9   ExtCtrls, ButtonB, PVSB, Types, fgl;
     9  ExtCtrls, ButtonB, PVSB, Types;
    1010
    1111const
     
    4141  THyperText = class(TStringList)
    4242  public
    43     procedure AddLine(s: String = ''; Format: integer = 0; Picpix: Integer = 0;
     43    procedure AddLine(s: String = ''; Format: integer = 0; Picpix: integer = 0;
    4444      LinkCategory: integer = 0; LinkIndex: integer = 0);
    45     procedure LineFeed;
    46     procedure AppendList(Source: THyperText);
     45    procedure LF;
    4746    destructor Destroy; override;
    48   end;
    49 
    50   { THistItem }
    51 
    52   THistItem = class
    53     Kind: Integer;
    54     No: Integer;
    55     Pos: Integer;
    56     SearchContent: string;
    57     procedure Assign(Source: THistItem);
    58   end;
    59 
    60   { THistItems }
    61 
    62   THistItems = class(TFPGObjectList<THistItem>)
    63     function AddNew(Kind, No, Pos: Integer; SearchContent: string): THistItem;
    6447  end;
    6548
     
    8972    procedure OffscreenPaint; override;
    9073  private
    91     Kind: Integer;
    92     no: Integer;
    93     Sel: Integer;
    94     CaptionColor: Integer;
    95     hADVHELP, hIMPHELP, hFEATUREHELP, hGOVHELP, hSPECIALMODEL, hJOBHELP: Integer;
    96     SearchContent: string;
    97     NewSearchContent: string;
    98     CaptionFont: TFont;
    99     MainText: THyperText;
    100     SearchResult: THyperText;
     74    Kind, no, Sel, nHist, CaptionColor: integer;
     75    hADVHELP, hIMPHELP, hFEATUREHELP, hGOVHELP, hSPECIALMODEL,
     76      hJOBHELP: integer;
     77    SearchContent, NewSearchContent: string;
     78    CaptionFont: TDpiFont;
     79    MainText, SearchResult: THyperText;
    10180    HelpText: TStringTable;
    102     ExtPic, TerrIcon: TBitmap;
    103     ScrollBar: TPVScrollbar;
    104     x0: array [-2..180] of Integer;
    105     procedure PaintTerrIcon(x, y, xSrc, ySrc: Integer);
     81    ExtPic, TerrIcon: TDpiBitmap;
     82    sb: TPVScrollbar;
     83    x0: array [-2 .. 180] of integer;
     84    HistKind: array [0 .. MaxHist - 1] of integer;
     85    HistNo: array [0 .. MaxHist - 1] of integer;
     86    HistPos: array [0 .. MaxHist - 1] of integer;
     87    HistSearchContent: array [0 .. MaxHist - 1] of shortstring;
    10688    procedure ScrollBarUpdate(Sender: TObject);
    107     procedure Line(ca: TCanvas; i: Integer; lit: Boolean);
    108     procedure Prepare(sbPos: Integer = 0);
    109     procedure ShowNewContentProcExecute(NewMode: Integer; HelpContext: string);
    110     procedure WaterSign(x0, y0, iix: Integer);
     89    procedure line(ca: TDpiCanvas; i: integer; lit: boolean);
     90    procedure Prepare(sbPos: integer = 0);
     91    procedure WaterSign(x0, y0, iix: integer);
    11192    procedure Search(SearchString: string);
    11293    procedure OnScroll(var m: TMessage); message WM_VSCROLL;
    11394    procedure OnMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE;
    11495  public
    115     HistItems: THistItems;
    116     Difficulty: Integer;
     96    Difficulty: integer;
     97    procedure ShowNewContent(NewMode, Category, Index: integer);
    11798    procedure ClearHistory;
    118     procedure ShowNewContent(NewMode, Category, Index: Integer);
    119     function TextIndex(Item: string): Integer;
     99    function TextIndex(Item: string): integer;
    120100  end;
    121101
     
    126106
    127107uses
    128   Directories, ClientTools, Term, Tribes, Inp, Messg, PixelPointer;
     108  Directories, ClientTools, Term, Tribes, Inp, Messg;
    129109
    130110{$R *.lfm}
    131111
    132112type
    133 
    134   { THelpLineInfo }
    135 
    136113  THelpLineInfo = class
    137     Format: Byte;
    138     Picpix: Byte;
     114    Format, Picpix: Byte;
    139115    Link: Word;
    140     procedure Assign(Source: THelpLineInfo);
    141   end;
    142 
    143 { THelpLineInfo }
    144 
    145 procedure THelpLineInfo.Assign(Source: THelpLineInfo);
    146 begin
    147   Format := Source.Format;
    148   PicPix := Source.PicPix;
    149   Link := Source.Link;
    150 end;
    151 
    152 { THistItem }
    153 
    154 procedure THistItem.Assign(Source: THistItem);
    155 begin
    156   Kind := Source.Kind;
    157   No := Source.No;
    158   Pos := Source.Pos;
    159   SearchContent := Source.SearchContent;
    160 end;
    161 
    162 { THistItems }
    163 
    164 function THistItems.AddNew(Kind, No, Pos: Integer; SearchContent: string
    165   ): THistItem;
    166 begin
    167   Result := THistItem.Create;
    168   Result.Kind := Kind;
    169   Result.No := No;
    170   Result.Pos := Pos;
    171   Result.SearchContent := SearchContent;
    172   Add(Result);
    173 end;
     116  end;
    174117
    175118procedure THyperText.AddLine(s: String; Format: integer; Picpix: integer;
     
    187130end;
    188131
    189 procedure THyperText.LineFeed;
     132procedure THyperText.LF;
    190133begin
    191134  AddLine;
    192 end;
    193 
    194 procedure THyperText.AppendList(Source: THyperText);
    195 var
    196   I: Integer;
    197   HelpLineInfo: THelpLineInfo;
    198 begin
    199   for I := 0 to Source.Count - 1 do begin
    200     HelpLineInfo := THelpLineInfo.Create;
    201     HelpLineInfo.Assign(THelpLineInfo(Source.Objects[I]));
    202     AddObject(Source.Strings[I], HelpLineInfo);
    203   end;
    204135end;
    205136
     
    267198begin
    268199  inherited;
    269   HistItems := THistItems.Create;
    270 
    271200  CaptionLeft := BackBtn.Left + BackBtn.Width;
    272201  CaptionRight := SearchBtn.Left;
     
    276205  SearchResult := THyperText.Create;
    277206  SearchResult.OwnsObjects := True;
    278   ScrollBar := TPVScrollbar.Create(Self);
    279   ScrollBar.SetBorderSpacing(36, 9, 11);
    280   ScrollBar.OnUpdate := ScrollBarUpdate;
     207  sb := TPVScrollbar.Create(Self);
     208  sb.SetBorderSpacing(36, 9, 11);
     209  sb.OnUpdate := ScrollBarUpdate;
    281210
    282211  HelpText := TStringTable.Create;
     
    289218  hJOBHELP := HelpText.Gethandle('JOBHELP');
    290219
    291   CaptionFont := Font.Create;
     220  CaptionFont := TDpiFont.Create;
    292221  CaptionFont.Assign(UniFont[ftNormal]);
    293222  CaptionFont.Style := CaptionFont.Style + [fsItalic, fsBold];
     
    298227  SearchBtn.Hint := Phrases.Lookup('BTN_SEARCH');
    299228
    300   ExtPic := TBitmap.Create;
    301   TerrIcon := TBitmap.Create;
     229  ExtPic := TDpiBitmap.Create;
     230  TerrIcon := TDpiBitmap.Create;
    302231  TerrIcon.PixelFormat := pf24bit;
    303232  TerrIcon.SetSize(xSizeBig, ySizeBig);
    304233  TerrIcon.Canvas.FillRect(0, 0, TerrIcon.Width, TerrIcon.Height);
    305234  SearchContent := '';
    306   ShowNewContentProc := ShowNewContentProcExecute;
     235  nHist := -1;
    307236end;
    308237
    309 procedure THelpDlg.ShowNewContentProcExecute(NewMode: Integer;
    310   HelpContext: string);
    311 begin
    312   HelpDlg.ShowNewContent(NewMode, hkText,
    313     HelpDlg.TextIndex(HelpContext))
     238procedure THelpDlg.ClearHistory;
     239begin
     240  nHist := -1;
    314241end;
    315242
    316243procedure THelpDlg.FormDestroy(Sender: TObject);
    317244begin
    318   ShowNewContentProc := nil;
    319   FreeAndNil(ScrollBar);
     245  FreeAndNil(sb);
    320246  FreeAndNil(MainText);
    321247  FreeAndNil(SearchResult);
     
    324250  FreeAndNil(HelpText);
    325251  // FreeAndNil(CaptionFont);
    326   FreeAndNil(HistItems);
    327252end;
    328253
     
    330255  WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
    331256begin
    332   if ScrollBar.ProcessMouseWheel(WheelDelta) then begin
     257  if sb.ProcessMouseWheel(WheelDelta) then begin
    333258    PaintBox1MouseMove(nil, [], MousePos.X - Left,
    334259      MousePos.Y - Top);
     
    344269begin
    345270  { TODO: Handled by MouseWheel event
    346   if ScrollBar.Process(m) then begin
     271  if sb.Process(m) then begin
    347272    Sel := -1;
    348273    SmartUpdateContent(true)
     
    354279begin
    355280  if Sel <> -1 then begin
    356     Line(Canvas, Sel, false);
     281    line(Canvas, Sel, false);
    357282    Sel := -1
    358283  end
    359284end;
    360285
    361 procedure THelpDlg.ClearHistory;
    362 begin
    363   HistItems.Clear;
    364 end;
    365 
    366286procedure THelpDlg.FormPaint(Sender: TObject);
    367287begin
     
    370290end;
    371291
    372 procedure THelpDlg.Line(ca: TCanvas; i: Integer; lit: Boolean);
     292procedure THelpDlg.line(ca: TDpiCanvas; i: integer; lit: boolean);
    373293var
    374   TextColor, x, y: Integer;
     294  TextColor, x, y: integer;
    375295  TextSize: TSize;
    376296  s: string;
    377297begin
    378   s := MainText[ScrollBar.Position + i];
     298  s := MainText[sb.Position + i];
    379299  if s = '' then
    380     Exit;
     300    exit;
    381301  x := x0[i];
    382302  y := 2 + i * 24;
     
    386306    y := y + WideFrame
    387307  end;
    388   if THelpLineInfo(MainText.Objects[ScrollBar.Position + i]).Format
     308  if THelpLineInfo(MainText.Objects[sb.Position + i]).Format
    389309    in [pkCaption, pkBigTer, pkRightIcon, pkBigFeature] then
    390310  begin
     
    402322    ca.Font.Assign(UniFont[ftNormal]);
    403323  end
    404   else if THelpLineInfo(MainText.Objects[ScrollBar.Position + i]).Format = pkSection
     324  else if THelpLineInfo(MainText.Objects[sb.Position + i]).Format = pkSection
    405325  then
    406326  begin
     
    421341        TextSize.cy := WideFrame + InnerHeight - y;
    422342      FillSeamless(ca, x, y, TextSize.cx, TextSize.cy, -SideFrame,
    423         ScrollBar.Position * 24 - WideFrame, Paper);
     343        sb.Position * 24 - WideFrame, Paper);
    424344    end;
    425345    BiColorTextOut(ca, TextColor, $7F007F, x, y, s);
     
    427347      with ca do
    428348      begin
    429         Assert(ca = Canvas);
    430         Pen.Color := TextColor;
    431         MoveTo(x + 1, y + TextSize.cy - 2);
    432         LineTo(x + TextSize.cx, y + TextSize.cy - 2);
     349        assert(ca = Canvas);
     350        pen.color := TextColor;
     351        moveto(x + 1, y + TextSize.cy - 2);
     352        lineto(x + TextSize.cx, y + TextSize.cy - 2);
    433353      end;
    434354    if (Kind = hkMisc) and (no = miscMain) then
     
    443363var
    444364  x, y, dx, dy, xSrc, ySrc, sum, xx: integer;
    445   Heaven: array [0..nHeaven] of integer;
     365  Heaven: array [0 .. nHeaven] of integer;
    446366  PaintPtr, CoalPtr: TPixelPointer;
    447   ImpPtr: array [-1..1] of TPixelPointer;
     367  ImpPtr: array [-1 .. 1] of TPixelPointer;
    448368begin
    449369  // assume eiffel tower has free common heaven
     
    494414end;
    495415
    496 procedure THelpDlg.PaintTerrIcon(x, y, xSrc, ySrc: integer);
    497 begin
    498   Frame(OffScreen.Canvas, x - 1, y - 1, x + xSizeBig, y + ySizeBig,
    499     $000000, $000000);
    500   if 2 * yyt < 40 then begin
    501     Sprite(OffScreen, HGrTerrain, x, y, 56, 2 * yyt, xSrc, ySrc);
    502     Sprite(OffScreen, HGrTerrain, x, y + 2 * yyt, 56, 40 - 2 * yyt,
     416procedure THelpDlg.OffscreenPaint;
     417
     418  procedure PaintTerrIcon(x, y, xSrc, ySrc: integer);
     419  begin
     420    Frame(OffScreen.Canvas, x - 1, y - 1, x + xSizeBig, y + ySizeBig,
     421      $000000, $000000);
     422    if 2 * yyt < 40 then
     423    begin
     424      Sprite(OffScreen, HGrTerrain, x, y, 56, 2 * yyt, xSrc, ySrc);
     425      Sprite(OffScreen, HGrTerrain, x, y + 2 * yyt, 56, 40 - 2 * yyt,
     426        xSrc, ySrc);
     427    end
     428    else
     429      Sprite(OffScreen, HGrTerrain, x, y, 56, 40, xSrc, ySrc);
     430    Sprite(OffScreen, HGrTerrain, x, y, xxt, yyt, xSrc + xxt, ySrc + yyt);
     431    Sprite(OffScreen, HGrTerrain, x, y + yyt, xxt, 40 - yyt, xSrc + xxt, ySrc);
     432    Sprite(OffScreen, HGrTerrain, x + xxt, y, 56 - xxt, yyt, xSrc, ySrc + yyt);
     433    Sprite(OffScreen, HGrTerrain, x + xxt, y + yyt, 56 - xxt, 40 - yyt,
    503434      xSrc, ySrc);
    504   end else
    505     Sprite(OffScreen, HGrTerrain, x, y, 56, 40, xSrc, ySrc);
    506   Sprite(OffScreen, HGrTerrain, x, y, xxt, yyt, xSrc + xxt, ySrc + yyt);
    507   Sprite(OffScreen, HGrTerrain, x, y + yyt, xxt, 40 - yyt, xSrc + xxt, ySrc);
    508   Sprite(OffScreen, HGrTerrain, x + xxt, y, 56 - xxt, yyt, xSrc, ySrc + yyt);
    509   Sprite(OffScreen, HGrTerrain, x + xxt, y + yyt, 56 - xxt, 40 - yyt,
    510     xSrc, ySrc);
    511 end;
    512 
    513 procedure THelpDlg.OffscreenPaint;
     435  end;
     436
    514437var
    515   i, j, yl, srcno, ofs, cnt, y: Integer;
     438  i, j, yl, srcno, ofs, cnt, y: integer;
    516439  s: string;
    517440  HelpLineInfo: THelpLineInfo;
     
    520443  CaptionColor := Colors.Canvas.Pixels[clkMisc, cliPaperCaption];
    521444  FillSeamless(OffScreen.Canvas, 0, 0, InnerWidth, InnerHeight, 0,
    522     ScrollBar.Position * 24, Paper);
     445    sb.Position * 24, Paper);
    523446  with OffScreen.Canvas do
    524447  begin
    525448    Font.Assign(UniFont[ftNormal]);
    526     for i := -ScrollBar.Position to InnerHeight div 24 do
    527       if ScrollBar.Position + i < MainText.Count then
     449    for i := -sb.Position to InnerHeight div 24 do
     450      if sb.Position + i < MainText.Count then
    528451      begin
    529         HelpLineInfo := THelpLineInfo(MainText.Objects[ScrollBar.Position + i]);
     452        HelpLineInfo := THelpLineInfo(MainText.Objects[sb.Position + i]);
    530453        if HelpLineInfo.Format = pkExternal then
    531454        begin
     
    538461      end;
    539462    for i := -2 to InnerHeight div 24 do
    540       if (ScrollBar.Position + i >= 0) and (ScrollBar.Position + i < MainText.Count) then
     463      if (sb.Position + i >= 0) and (sb.Position + i < MainText.Count) then
    541464      begin
    542         HelpLineInfo := THelpLineInfo(MainText.Objects[ScrollBar.Position + i]);
     465        HelpLineInfo := THelpLineInfo(MainText.Objects[sb.Position + i]);
    543466        if HelpLineInfo.Link <> 0 then
    544467        begin
     
    844767            x0[i] := 64 + 8 + 8;
    845768        else
    846           x0[i] := x0[i] + 8;
     769          x0[i] := x0[i] + 8
    847770        end;
    848         Self.Line(OffScreen.Canvas, i, False)
     771        Self.line(OffScreen.Canvas, i, false)
    849772      end;
    850773  end;
    851774  MarkUsedOffscreen(InnerWidth, InnerHeight + 13 + 48);
    852 end;
     775end; { OffscreenPaint }
    853776
    854777procedure THelpDlg.ScrollBarUpdate(Sender: TObject);
     
    860783procedure THelpDlg.Prepare(sbPos: integer = 0);
    861784var
    862   i, j, Special, Domain, Headline, TerrType, TerrSubType: integer;
     785  i, j, special, Domain, Headline, TerrType, TerrSubType: integer;
    863786  s: string;
    864787  ps: pchar;
    865788  List: THyperText;
    866   CheckSeeAlso: Boolean;
    867 
    868   procedure AddAdvance(i: integer);
     789  CheckSeeAlso: boolean;
     790
     791  procedure AddAdv(i: integer);
    869792  begin
    870793    MainText.AddLine(Phrases.Lookup('ADVANCES', i), pkAdvIcon, i,
     
    878801  end;
    879802
    880   procedure AddImprovement(i: integer);
     803  procedure AddImp(i: integer);
    881804  begin
    882805    MainText.AddLine(Phrases.Lookup('IMPROVEMENTS', i), pkSmallIcon, i,
     
    890813  end;
    891814
    892   procedure AddTerrain(i: integer);
     815  procedure AddTer(i: integer);
    893816  begin
    894817    if MainText.Count > 1 then
    895818    begin
    896       MainText.LineFeed;
     819      MainText.LF;
    897820    end;
    898821    MainText.AddLine(Phrases.Lookup('TERRAIN', i), pkTer, i, hkTer, i);
     
    911834  begin
    912835    if MainText.Count > 1 then
    913       MainText.LineFeed;
     836      MainText.LF;
    914837    FindStdModelPicture(SpecialModelPictureCode[i], pix, Name);
    915838    MainText.AddLine(Name, pkModel, pix, hkModel + hkCrossLink, i)
     
    925848      begin
    926849        AddLine('', pkLogo);
    927         LineFeed;
     850        LF;
    928851      end
    929852      else if Item = 'TECHFORMULA' then
     
    941864        for i := 1 to 3 do
    942865        begin
    943           LineFeed;
     866          LF;
    944867          AddLine(Phrases.Lookup('TERRAIN', 3 * 12 + i), pkTer, 3 * 12 + i);
    945868        end
     
    952875  end;
    953876
    954   procedure DecodeItem(s: string; var Category, Index: Integer);
     877  procedure DecodeItem(s: string; var Category, Index: integer);
    955878  var
    956     i: Integer;
    957   begin
    958     if (Length(s) > 0) and (s[1] = ':') then begin
     879    i: integer;
     880  begin
     881    if (length(s) > 0) and (s[1] = ':') then
     882    begin
    959883      Category := hkMisc;
    960884      Index := 0;
    961885      for i := 3 to length(s) do
    962         Index := Index * 10 + Ord(s[i]) - 48;
     886        Index := Index * 10 + ord(s[i]) - 48;
    963887      case s[2] of
    964         'A': Category := hkAdv;
    965         'B': Category := hkImp;
    966         'T': Category := hkTer;
    967         'F': Category := hkFeature;
    968         'E': Category := hkInternet;
    969         'S': Category := hkModel;
    970         'C': Index := miscCredits;
    971         'J': Index := miscJobList;
    972         'G': Index := miscGovList;
     888        'A':
     889          Category := hkAdv;
     890        'B':
     891          Category := hkImp;
     892        'T':
     893          Category := hkTer;
     894        'F':
     895          Category := hkFeature;
     896        'E':
     897          Category := hkInternet;
     898        'S':
     899          Category := hkModel;
     900        'C':
     901          Index := miscCredits;
     902        'J':
     903          Index := miscJobList;
     904        'G':
     905          Index := miscGovList;
    973906      end;
    974907      if (Category <> hkMisc) and (Index = 0) then
    975908        Index := 200;
    976     end else begin
     909    end
     910    else
     911    begin
    977912      Category := hkText;
    978       Index := HelpText.Gethandle(Copy(s, 1, 255));
     913      Index := HelpText.Gethandle(copy(s, 1, 255));
    979914    end;
    980915  end;
     
    998933        repeat
    999934          inc(p)
    1000         until (p > Length(s)) or (s[p] = '\');
    1001         Caption := Copy(s, 2, p - 2);
     935        until (p > length(s)) or (s[p] = '\');
     936        Caption := copy(s, 2, p - 2);
    1002937        Delete(s, 1, p);
    1003938      end
     
    1007942        repeat
    1008943          inc(p)
    1009         until (p > Length(s)) or (s[p] = '\');
    1010         AddStandardBlock(Copy(s, 2, p - 2));
     944        until (p > length(s)) or (s[p] = '\');
     945        AddStandardBlock(copy(s, 2, p - 2));
    1011946        Delete(s, 1, p);
    1012947      end
    1013948      else if s[1] = '@' then
    1014949      begin // image
    1015         if (Length(s) >= 2) and (s[2] = '@') then
     950        if (length(s) >= 2) and (s[2] = '@') then
    1016951        begin // generate from icon
    1017952          Picpix := 0;
    1018953          p := 3;
    1019           while (p <= Length(s)) and (s[p] <> '\') do
     954          while (p <= length(s)) and (s[p] <> '\') do
    1020955          begin
    1021             Picpix := Picpix * 10 + Ord(s[p]) - 48;
     956            Picpix := Picpix * 10 + ord(s[p]) - 48;
    1022957            inc(p)
    1023958          end;
     
    1025960            Picpix := 0;
    1026961          MainText.AddLine('', pkIllu, Picpix);
    1027           MainText.LineFeed;
    1028           MainText.LineFeed;
     962          MainText.LF;
     963          MainText.LF;
    1029964        end
    1030965        else
     
    1032967          p := 1;
    1033968          repeat
    1034             Inc(p)
    1035           until (p > Length(s)) or (s[p] = '\');
     969            inc(p)
     970          until (p > length(s)) or (s[p] = '\');
    1036971          if LoadGraphicFile(ExtPic, LocalizedFilePath('Help' +
    1037             DirectorySeparator + Copy(s, 2, p - 2)) + '.png') then
     972            DirectorySeparator + copy(s, 2, p - 2)) + '.png') then
    1038973          begin
    1039974            MainText.AddLine('', pkExternal);
    1040975            for i := 0 to (ExtPic.Height - 12) div 24 do
    1041               MainText.LineFeed;
     976              MainText.LF;
    1042977          end;
    1043978        end;
     
    1052987              repeat
    1053988                inc(p)
    1054               until (p > Length(s)) or (s[p] = '\') or (s[p] = ' ');
    1055               DecodeItem(Copy(s, 2, p - 2), LinkCategory, LinkIndex);
     989              until (p > length(s)) or (s[p] = '\') or (s[p] = ' ');
     990              DecodeItem(copy(s, 2, p - 2), LinkCategory, LinkIndex);
    1056991              CurrentFormat := 0;
    1057992              if (LinkCategory <> hkText) and (LinkIndex < 200) then
     
    10711006                    begin
    10721007                      CurrentFormat := pkTer;
    1073                       Picpix := LinkIndex;
     1008                      Picpix := LinkIndex
    10741009                    end;
    10751010                  hkFeature:
     
    10871022              if s[1] = ':' then
    10881023                LinkCategory := LinkCategory + hkCrossLink;
    1089               if (p > Length(s)) or (s[p] = ' ') then
     1024              if (p > length(s)) or (s[p] = ' ') then
    10901025                Delete(s, 1, p)
    10911026              else
     
    10931028            end;
    10941029          '!': // highlited
    1095             if (Length(s) >= 2) and (s[2] = '!') then
     1030            if (length(s) >= 2) and (s[2] = '!') then
    10961031            begin
    10971032              if MainText.Count > 1 then
    1098                 MainText.LineFeed;
     1033                MainText.LF;
    10991034              FollowFormat := pkCaption;
    11001035              CurrentFormat := pkCaption;
     
    11231058        repeat
    11241059          repeat
    1125             Inc(p)
    1126           until (p > Length(s)) or (s[p] = ' ') or (s[p] = '\');
    1127           if (BiColorTextWidth(OffScreen.Canvas, Copy(s, 1, p - 1)) <=
     1060            inc(p)
     1061          until (p > length(s)) or (s[p] = ' ') or (s[p] = '\');
     1062          if (BiColorTextWidth(OffScreen.Canvas, copy(s, 1, p - 1)) <=
    11281063            RightMargin - ofs) then
    11291064            l := p - 1
    11301065          else
    11311066            Break;
    1132         until (p >= Length(s)) or (s[l + 1] = '\');
    1133         MainText.AddLine(Copy(s, 1, l), CurrentFormat, Picpix, LinkCategory,
     1067        until (p >= length(s)) or (s[l + 1] = '\');
     1068        MainText.AddLine(copy(s, 1, l), CurrentFormat, Picpix, LinkCategory,
    11341069          LinkIndex);
    1135         if (l < Length(s)) and (s[l + 1] = '\') then
     1070        if (l < length(s)) and (s[l + 1] = '\') then
    11361071          FollowFormat := pkNormal;
    11371072        Delete(s, 1, l + 1);
     
    11451080  end;
    11461081
    1147   procedure AddModelText(i: Integer);
     1082  procedure AddModelText(i: integer);
    11481083  var
    1149     pix: Integer;
     1084    pix: integer;
    11501085    s: string;
    11511086  begin
    1152     with MainText do begin
    1153       if Count > 1 then begin
    1154         LineFeed;
    1155         LineFeed;
     1087    with MainText do
     1088    begin
     1089      if Count > 1 then
     1090      begin
     1091        LF;
     1092        LF;
    11561093      end;
    11571094      FindStdModelPicture(SpecialModelPictureCode[i], pix, s);
     
    11871124  procedure AddJobList;
    11881125  var
    1189     i, JobCost: Integer;
    1190   begin
    1191     with MainText do begin
    1192       for i := 0 to nJobHelp - 1 do begin
    1193         if i > 0 then begin
    1194           LineFeed;
    1195           LineFeed;
     1126    i, JobCost: integer;
     1127  begin
     1128    with MainText do
     1129    begin
     1130      for i := 0 to nJobHelp - 1 do
     1131      begin
     1132        if i > 0 then
     1133        begin
     1134          LF;
     1135          LF
    11961136        end;
    11971137        AddLine(Phrases.Lookup('JOBRESULT', JobHelp[i]), pkSection);
     
    12021142        JobCost := -1;
    12031143        case JobHelp[i] of
    1204           jCanal: JobCost := CanalWork;
    1205           jFort: JobCost := FortWork;
    1206           jBase: JobCost := BaseWork;
     1144          jCanal:
     1145            JobCost := CanalWork;
     1146          jFort:
     1147            JobCost := FortWork;
     1148          jBase:
     1149            JobCost := BaseWork;
    12071150        end;
    12081151        if JobCost >= 0 then
     
    12111154        else
    12121155          AddTextual(HelpText.Lookup('JOBCOSTVAR'));
    1213         if JobPreq[JobHelp[i]] <> preNone then begin
     1156        if JobPreq[JobHelp[i]] <> preNone then
     1157        begin
    12141158          AddPreqAdv(JobPreq[JobHelp[i]]);
    12151159          MainText[Count - 1] := Format(HelpText.Lookup('REQUIRED'),
     
    12221166  procedure AddGraphicCredits;
    12231167  var
    1224     i: Integer;
     1168    i: integer;
    12251169    s: string;
    12261170    sr: TSearchRec;
    1227     List, Plus: TStringList;
     1171    List, plus: TStringList;
    12281172  begin
    12291173    List := TStringList.Create;
    1230     Plus := TStringList.Create;
     1174    plus := TStringList.Create;
    12311175    if FindFirst(HomeDir + 'Graphics' + DirectorySeparator + '*.credits.txt', $27, sr) = 0 then
    12321176      repeat
    1233         Plus.LoadFromFile(HomeDir + 'Graphics' + DirectorySeparator + sr.Name);
    1234         List.AddStrings(Plus);
     1177        plus.LoadFromFile(HomeDir + 'Graphics' + DirectorySeparator + sr.Name);
     1178        List.AddStrings(plus);
    12351179      until FindNext(sr) <> 0;
    12361180    FindClose(sr);
    1237     Plus.Free;
     1181    plus.Free;
    12381182
    12391183    List.Sort;
     
    12431187        List.Delete(i)
    12441188      else
    1245         Inc(i);
    1246 
    1247     for i := 0 to List.Count - 1 do begin
     1189        inc(i);
     1190
     1191    for i := 0 to List.Count - 1 do
     1192    begin
    12481193      s := List[i];
    12491194      while BiColorTextWidth(OffScreen.Canvas, s) > InnerWidth - 16 -
     
    12571202  procedure AddSoundCredits;
    12581203  var
    1259     i: Integer;
     1204    i: integer;
    12601205    s: string;
    12611206    List: TStringList;
     
    12631208    List := TStringList.Create;
    12641209    List.LoadFromFile(HomeDir + 'Sounds' + DirectorySeparator + 'sound.credits.txt');
    1265     for i := 0 to List.Count - 1 do begin
     1210    for i := 0 to List.Count - 1 do
     1211    begin
    12661212      s := List[i];
    12671213      while BiColorTextWidth(OffScreen.Canvas, s) > InnerWidth - 16 -
     
    12791225        MainText.Delete(Headline)
    12801226      else
    1281         MainText.LineFeed;
     1227        MainText.LF;
    12821228    MainText.AddLine(HelpText.Lookup(Item), pkSection);
    12831229    Headline := MainText.Count - 1;
     
    12851231
    12861232begin { Prepare }
    1287   with MainText do begin
     1233  with MainText do
     1234  begin
    12881235    OffScreen.Canvas.Font.Assign(UniFont[ftNormal]);
    1289     CheckSeeAlso := False;
     1236    CheckSeeAlso := false;
    12901237    Clear;
    12911238    Headline := -1;
    12921239    if (no >= 200) or not(Kind in [hkAdv, hkImp, hkTer, hkFeature]) then
    1293       LineFeed;
     1240      LF;
    12941241    case Kind of
    12951242      hkText:
     
    13031250                AddLine(HelpText.Lookup('HELPTITLE_QUICKSTART'), pkSpecialIcon,
    13041251                  0, { pkBigIcon,22, } hkText, HelpText.Gethandle('QUICK'));
    1305                 LineFeed;
     1252                LF;
    13061253                AddLine(HelpText.Lookup('HELPTITLE_CONCEPTS'), pkBigIcon, 6,
    13071254                  hkText, HelpText.Gethandle('CONCEPTS'));
    1308                 LineFeed;
     1255                LF;
    13091256                AddLine(HelpText.Lookup('HELPTITLE_TERLIST'), pkSpecialIcon, 1,
    13101257                  hkTer, 200);
    1311                 LineFeed;
     1258                LF;
    13121259                AddLine(HelpText.Lookup('HELPTITLE_JOBLIST'), pkSpecialIcon, 2,
    13131260                  hkMisc, miscJobList);
    1314                 LineFeed;
     1261                LF;
    13151262                AddLine(HelpText.Lookup('HELPTITLE_TECHLIST'), pkBigIcon, 39,
    13161263                  hkAdv, 200);
    1317                 LineFeed;
     1264                LF;
    13181265                FindStdModelPicture(SpecialModelPictureCode[6], i, s);
    13191266                AddLine(HelpText.Lookup('HELPTITLE_MODELLIST'), pkModel, i,
    13201267                  hkModel, 0);
    1321                 LineFeed;
     1268                LF;
    13221269                AddLine(HelpText.Lookup('HELPTITLE_FEATURELIST'), pkBigIcon, 28,
    13231270                  hkFeature, 200);
    1324                 LineFeed;
     1271                LF;
    13251272                AddLine(HelpText.Lookup('HELPTITLE_IMPLIST'), pkBigIcon,
    13261273                  7 * SystemIconLines + imCourt, hkImp, 200);
    1327                 LineFeed;
     1274                LF;
    13281275                AddLine(HelpText.Lookup('HELPTITLE_UNIQUELIST'), pkBigIcon,
    13291276                  7 * SystemIconLines + imStockEx, hkImp, 201);
    1330                 LineFeed;
     1277                LF;
    13311278                AddLine(HelpText.Lookup('HELPTITLE_WONDERLIST'), pkBigIcon,
    13321279                  7 * SystemIconLines, hkImp, 202);
    1333                 LineFeed;
     1280                LF;
    13341281                AddLine(HelpText.Lookup('HELPTITLE_GOVLIST'), pkBigIcon,
    13351282                  gDemocracy + 6, hkMisc, miscGovList);
    1336                 LineFeed;
     1283                LF;
    13371284                AddLine(HelpText.Lookup('HELPTITLE_KEYS'), pkBigIcon, 2, hkText,
    13381285                  HelpText.Gethandle('HOTKEYS'));
    1339                 LineFeed;
     1286                LF;
    13401287                AddLine(HelpText.Lookup('HELPTITLE_ABOUT'), pkBigIcon, 1,
    13411288                  hkText, HelpText.Gethandle('ABOUT'));
    1342                 LineFeed;
     1289                LF;
    13431290                AddLine(HelpText.Lookup('HELPTITLE_CREDITS'), pkBigIcon, 22,
    13441291                  hkMisc, miscCredits);
     
    13471294              begin
    13481295                AddItem('CREDITS');
    1349                 LineFeed;
     1296                LF;
    13501297                AddGraphicCredits;
    13511298                NextSection('CRED_CAPSOUND');
     
    13611308                Caption := HelpText.Lookup('HELPTITLE_JOBLIST');
    13621309                AddJobList;
    1363                 LineFeed;
     1310                LF;
    13641311                AddItem('TERIMPEXCLUDE');
    1365                 LineFeed;
     1312                LF;
    13661313                AddItem('TERIMPCITY');
    13671314              end;
     
    13721319                begin
    13731320                  AddLine(Phrases.Lookup('GOVERNMENT', i mod nGov), pkSection);
    1374                   LineFeed;
     1321                  LF;
    13751322                  if i = nGov then
    13761323                    AddLine('', pkBigIcon, 7 * SystemIconLines + imPalace)
    13771324                  else
    13781325                    AddLine('', pkBigIcon, i + 6);
    1379                   LineFeed;
     1326                  LF;
    13801327                  AddTextual(HelpText.LookupByHandle(hGOVHELP, i mod nGov));
    13811328                  if i mod nGov >= 2 then
     
    13871334                  if i < nGov then
    13881335                  begin
    1389                     LineFeed;
    1390                     LineFeed;
     1336                    LF;
     1337                    LF;
    13911338                  end
    13921339                end
     
    13961343                Caption := HelpText.Lookup('HELPTITLE_SEARCHRESULTS');
    13971344                AddTextual(Format(HelpText.Lookup('MATCHES'), [SearchContent]));
    1398                 MainText.AppendList(SearchResult);
    1399               end;
     1345                MainText.AddStrings(SearchResult);
     1346              end
    14001347          end; // case no
    14011348        end;
     
    14061353          Caption := HelpText.Lookup('HELPTITLE_TECHLIST');
    14071354          List := THyperText.Create;
    1408           List.OwnsObjects := True;
    14091355          for j := 0 to 3 do
    14101356          begin
    14111357            if j > 0 then
    14121358            begin
    1413               LineFeed;
    1414               LineFeed;
     1359              LF;
     1360              LF;
    14151361            end;
    14161362            AddLine(HelpText.Lookup('TECHAGE', j), pkSection);
     
    14301376                  hkAdv, i);
    14311377            List.Sort;
    1432             AppendList(List);
     1378            AddStrings(List);
    14331379          end;
    1434           List.Free;
     1380          List.Free
    14351381        end
    14361382        else // single advance
    14371383        begin
    14381384          Caption := Phrases.Lookup('ADVANCES', no);
    1439           LineFeed;
     1385          LF;
    14401386          AddLine(Phrases.Lookup('ADVANCES', no), pkCaption);
    14411387          if no in FutureTech then
    14421388          begin
    14431389            AddLine(HelpText.Lookup('HELPSPEC_FUTURE'));
    1444             LineFeed;
     1390            LF;
    14451391            if no = futResearchTechnology then
    14461392              AddItem('FUTURETECHHELP100')
     
    14651411          for i := 0 to 27 do
    14661412            if Imp[i].Preq = no then
    1467               AddImprovement(i);
     1413              AddImp(i);
    14681414          for i := 28 to nImp - 1 do
    14691415            if (Imp[i].Preq = no) and (Imp[i].Kind <> ikCommon) then
    1470               AddImprovement(i);
     1416              AddImp(i);
    14711417          for i := 28 to nImp - 1 do
    14721418            if (Imp[i].Preq = no) and (Imp[i].Kind = ikCommon) then
    1473               AddImprovement(i);
     1419              AddImp(i);
    14741420          NextSection('MODELALLOW');
    14751421          for i := 0 to nSpecialModel - 1 do
     
    14841430            if (AdvPreq[i, 0] = no) or (AdvPreq[i, 1] = no) or
    14851431              (AdvPreq[i, 2] = no) then
    1486               AddAdvance(i);
     1432              AddAdv(i);
    14871433          NextSection('UPGRADEALLOW');
    14881434          for Domain := 0 to nDomains - 1 do
     
    15081454          for i := 0 to 27 do
    15091455            if (Imp[i].Preq <> preNA) and (Imp[i].Expiration = no) then
    1510               AddImprovement(i);
     1456              AddImp(i);
    15111457          NextSection('ADVEFFECT');
    15121458          s := HelpText.LookupByHandle(hADVHELP, no);
     
    15231469          // AddLine(HelpText.Lookup('HELPTITLE_IMPLIST'),pkSection);
    15241470          List := THyperText.Create;
    1525           List.OwnsObjects := True;
    15261471          for i := 28 to nImp - 1 do
    15271472            if (i <> imTrGoods) and (Imp[i].Preq <> preNA) and
     
    15301475                i, hkImp, i);
    15311476          List.Sort;
    1532           AppendList(List);
    1533           List.Free;
     1477          AddStrings(List);
     1478          List.Free
    15341479        end
    15351480        else if no = 201 then
     
    15421487              AddLine(Phrases.Lookup('IMPROVEMENTS', i), pkSmallIcon, i,
    15431488                hkImp, i);
    1544           { LineFeed;
    1545             LineFeed;
     1489          { LF;
     1490            LF;
    15461491            AddLine(HelpText.Lookup('HELPTITLE_SHIPPARTLIST'),pkSection);
    15471492            for i:=28 to nImp-1 do
     
    15611506        begin // single building
    15621507          Caption := Phrases.Lookup('IMPROVEMENTS', no);
    1563           LineFeed;
     1508          LF;
    15641509          AddLine(Phrases.Lookup('IMPROVEMENTS', no), pkRightIcon, no);
    15651510          case Imp[no].Kind of
    1566             ikWonder: AddLine(HelpText.Lookup('HELPSPEC_WONDER'));
    1567             ikCommon: AddLine(HelpText.Lookup('HELPSPEC_IMP'));
    1568             ikShipPart: AddLine(HelpText.Lookup('HELPSPEC_SHIPPART'));
     1511            ikWonder:
     1512              AddLine(HelpText.Lookup('HELPSPEC_WONDER'));
     1513            ikCommon:
     1514              AddLine(HelpText.Lookup('HELPSPEC_IMP'));
     1515            ikShipPart:
     1516              AddLine(HelpText.Lookup('HELPSPEC_SHIPPART'));
    15691517          else
    15701518            AddLine(HelpText.Lookup('HELPSPEC_NAT'))
    15711519          end;
    1572           if Imp[no].Kind <> ikShipPart then begin
     1520          if Imp[no].Kind <> ikShipPart then
     1521          begin
    15731522            NextSection('EFFECT');
    15741523            AddTextual(HelpText.LookupByHandle(hIMPHELP, no));
    15751524          end;
    1576           if no = woSun then begin
     1525          if no = woSun then
     1526          begin
    15771527            AddFeature(mcFirst);
    15781528            AddFeature(mcWill);
     
    15811531          if (no < 28) and not Phrases2FallenBackToEnglish then
    15821532          begin
    1583             LineFeed;
     1533            LF;
    15841534            if Imp[no].Expiration >= 0 then
    15851535              AddTextual(Phrases2.Lookup('HELP_WONDERMORALE1'))
     
    16111561                j := 1
    16121562              end;
    1613               AddImprovement(ImpReplacement[i].OldImp);
     1563              AddImp(ImpReplacement[i].OldImp);
    16141564            end;
    16151565          if Imp[no].Kind = ikShipPart then
    16161566          begin
    1617             LineFeed;
     1567            LF;
    16181568            if no = imShipComp then
    16191569              i := 1
     
    16361586          NextSection('SEEALSO');
    16371587          if (no < 28) and (Imp[no].Expiration >= 0) then
    1638             AddImprovement(woEiffel);
     1588            AddImp(woEiffel);
    16391589          for i := 0 to nImpReplacement - 1 do
    16401590            if ImpReplacement[i].OldImp = no then
    1641               AddImprovement(ImpReplacement[i].NewImp);
     1591              AddImp(ImpReplacement[i].NewImp);
    16421592          if no = imSupermarket then
    16431593            AddLine(HelpText.Lookup('HELPTITLE_JOBLIST'), pkNormal, 0,
     
    16521602          // AddLine(HelpText.Lookup('HELPTITLE_TERLIST'),pkSection);
    16531603          for i := 0 to nTerrainHelp - 1 do
    1654             AddTerrain(TerrainHelp[i]);
     1604            AddTer(TerrainHelp[i]);
    16551605        end
    16561606        else
     
    16681618          begin
    16691619            Caption := Phrases.Lookup('TERRAIN', no);
    1670             LineFeed;
     1620            LF;
    16711621            AddLine(Phrases.Lookup('TERRAIN', no), pkBigTer, no);
    16721622            AddLine(HelpText.Lookup('HELPSPEC_TER'));
    1673             LineFeed;
     1623            LF;
    16741624            if (ProdRes[TerrSubType] > 0) or (MineEff > 0) then
    16751625              AddLine(Format(HelpText.Lookup('RESPROD'),
     
    16971647            if no = 3 * 12 then
    16981648            begin
    1699               LineFeed;
     1649              LF;
    17001650              AddTextual(HelpText.Lookup('DEADLANDS'));
    17011651            end;
    17021652            if (TerrType = fDesert) and (no <> fDesert + 12) then
    17031653            begin
    1704               LineFeed;
     1654              LF;
    17051655              AddTextual(Format(HelpText.Lookup('HOSTILE'), [DesertThurst]));
    17061656            end;
    17071657            if TerrType = fArctic then
    17081658            begin
    1709               LineFeed;
     1659              LF;
    17101660              AddTextual(Format(HelpText.Lookup('HOSTILE'), [ArcticThurst]));
    17111661            end;
    17121662            if (no < 3 * 12) and (TransTerrain >= 0) then
    17131663            begin
    1714               LineFeed;
     1664              LF;
    17151665              i := TransTerrain;
    17161666              if (TerrType <> fGrass) and (i <> fGrass) then
    17171667                i := i + TerrSubType * 12;
    1718               // trafo to same Special resource group
     1668              // trafo to same special resource group
    17191669              AddLine(Format(HelpText.Lookup('TRAFO'),
    17201670                [Phrases.Lookup('TERRAIN', i)]), pkTer, i,
     
    17221672              if no = fSwamp + 12 then
    17231673              begin
    1724                 LineFeed;
     1674                LF;
    17251675                AddLine(Format(HelpText.Lookup('TRAFO'),
    17261676                  [Phrases.Lookup('TERRAIN', TransTerrain + 24)]), pkTer,
     
    17291679              else if i = fGrass then
    17301680              begin
    1731                 LineFeed;
     1681                LF;
    17321682                AddLine(Format(HelpText.Lookup('TRAFO'),
    17331683                  [Phrases.Lookup('TERRAIN', fGrass + 12)]), pkTer, fGrass + 12,
     
    17381688            if no = 3 * 12 then
    17391689            begin
    1740               LineFeed;
    1741               for Special := 1 to 3 do
     1690              LF;
     1691              for special := 1 to 3 do
    17421692              begin
    1743                 if Special > 1 then
    1744                   LineFeed;
    1745                 AddLine(Phrases.Lookup('TERRAIN', 3 * 12 + Special), pkTer,
    1746                   3 * 12 + Special);
     1693                if special > 1 then
     1694                  LF;
     1695                AddLine(Phrases.Lookup('TERRAIN', 3 * 12 + special), pkTer,
     1696                  3 * 12 + special);
    17471697              end
    17481698            end
    17491699            else if (no < 12) and (no <> fGrass) and (no <> fOcean) then
    17501700            begin
    1751               LineFeed;
    1752               for Special := 1 to 2 do
    1753                 if (no <> fArctic) and (no <> fSwamp) or (Special < 2) then
     1701              LF;
     1702              for special := 1 to 2 do
     1703                if (no <> fArctic) and (no <> fSwamp) or (special < 2) then
    17541704                begin
    1755                   if Special > 1 then
    1756                     LineFeed;
    1757                   AddLine(Phrases.Lookup('TERRAIN', no + Special * 12), pkTer,
    1758                     no + Special * 12);
    1759                   i := FoodRes[Special] - FoodRes[0];
     1705                  if special > 1 then
     1706                    LF;
     1707                  AddLine(Phrases.Lookup('TERRAIN', no + special * 12), pkTer,
     1708                    no + special * 12);
     1709                  i := FoodRes[special] - FoodRes[0];
    17601710                  if i <> 0 then
    17611711                    MainText[Count - 1] := MainText[Count - 1] +
    17621712                      Format(HelpText.Lookup('SPECIALFOOD'), [i]);
    1763                   i := ProdRes[Special] - ProdRes[0];
     1713                  i := ProdRes[special] - ProdRes[0];
    17641714                  if i <> 0 then
    17651715                    MainText[Count - 1] := MainText[Count - 1] +
    17661716                      Format(HelpText.Lookup('SPECIALPROD'), [i]);
    1767                   i := TradeRes[Special] - TradeRes[0];
     1717                  i := TradeRes[special] - TradeRes[0];
    17681718                  if i <> 0 then
    17691719                    MainText[Count - 1] := MainText[Count - 1] +
     
    17731723            if no = 3 * 12 then
    17741724            begin
    1775               LineFeed;
     1725              LF;
    17761726              AddTextual(HelpText.Lookup('RARE'));
    17771727            end;
     
    17791729            begin
    17801730              NextSection('SEEALSO');
    1781               AddImprovement(woGardens);
     1731              AddImp(woGardens);
    17821732              CheckSeeAlso := true
    17831733            end
     
    17901740          Caption := HelpText.Lookup('HELPTITLE_FEATURELIST');
    17911741          List := THyperText.Create;
    1792           List.OwnsObjects := True;
    1793           for Special := 0 to 2 do
     1742          for special := 0 to 2 do
    17941743          begin
    1795             if Special > 0 then
    1796             begin
    1797               LineFeed;
    1798               LineFeed;
    1799             end;
    1800             case Special of
    1801               0: AddLine(HelpText.Lookup('HELPTITLE_FEATURE1LIST'), pkSection);
    1802               1: AddLine(HelpText.Lookup('HELPTITLE_FEATURE2LIST'), pkSection);
    1803               2: AddLine(HelpText.Lookup('HELPTITLE_FEATURE3LIST'), pkSection);
     1744            if special > 0 then
     1745            begin
     1746              LF;
     1747              LF
     1748            end;
     1749            case special of
     1750              0:
     1751                AddLine(HelpText.Lookup('HELPTITLE_FEATURE1LIST'), pkSection);
     1752              1:
     1753                AddLine(HelpText.Lookup('HELPTITLE_FEATURE2LIST'), pkSection);
     1754              2:
     1755                AddLine(HelpText.Lookup('HELPTITLE_FEATURE3LIST'), pkSection);
    18041756            end;
    18051757            List.Clear;
     
    18131765                else
    18141766                  j := 1;
    1815                 if j = Special then
     1767                if j = special then
    18161768                  List.AddLine(Phrases.Lookup('FEATURES', i), pkFeature, i,
    18171769                    hkFeature, i);
    18181770              end;
    18191771            List.Sort;
    1820             AppendList(List);
     1772            AddStrings(List);
    18211773          end;
    1822           List.Free;
     1774          List.Free
    18231775        end
    18241776        else
    18251777        begin // single feature
    18261778          Caption := Phrases.Lookup('FEATURES', no);
    1827           LineFeed;
     1779          LF;
    18281780          AddLine(Phrases.Lookup('FEATURES', no), pkBigFeature, no);
    18291781          if no < mcFirstNonCap then
     
    18531805          if Feature[no].Preq <> preNone then
    18541806          begin
    1855             LineFeed;
     1807            LF;
    18561808            if Feature[no].Preq = preSun then
    18571809              AddPreqImp(woSun) // sun tsu feature
     
    18621814          end;
    18631815          NextSection('SEEALSO');
    1864           CheckSeeAlso := True;
     1816          CheckSeeAlso := true
    18651817        end;
    18661818
     
    18711823            if i <> 2 then
    18721824              AddModelText(i);
    1873           LineFeed;
     1825          LF;
    18741826          AddItem('MODELNOTE');
    18751827        end;
     
    18801832        if (SeeAlso[i].Kind = Kind) and (SeeAlso[i].no = no) then
    18811833          case SeeAlso[i].SeeKind of
    1882             hkImp: AddImprovement(SeeAlso[i].SeeNo);
    1883             hkAdv: AddAdvance(SeeAlso[i].SeeNo);
    1884             hkFeature: AddFeature(SeeAlso[i].SeeNo);
     1834            hkImp:
     1835              AddImp(SeeAlso[i].SeeNo);
     1836            hkAdv:
     1837              AddAdv(SeeAlso[i].SeeNo);
     1838            hkFeature:
     1839              AddFeature(SeeAlso[i].SeeNo);
    18851840          end;
    18861841    if (Headline >= 0) and (Count = Headline + 1) then
    18871842      Delete(Headline)
    18881843    else
    1889       LineFeed;
     1844      LF;
    18901845
    18911846    //Self.Show;
    1892     ScrollBar.Init(Count - 1, InnerHeight div 24);
    1893     ScrollBar.SetPos(sbPos);
    1894     BackBtn.Visible := HistItems.Count > 1;
    1895     TopBtn.Visible := (HistItems.Count > 1) or (Kind <> hkMisc) or (no <> miscMain);
     1847    sb.Init(Count - 1, InnerHeight div 24);
     1848    sb.SetPos(sbPos);
     1849    BackBtn.Visible := nHist > 0;
     1850    TopBtn.Visible := (nHist > 0) or (Kind <> hkMisc) or (no <> miscMain);
    18961851    Sel := -1;
    18971852  end; // with MainText
    1898 end;
    1899 
    1900 procedure THelpDlg.ShowNewContent(NewMode, Category, Index: Integer);
     1853end; { Prepare }
     1854
     1855procedure THelpDlg.ShowNewContent(NewMode, Category, Index: integer);
    19011856begin
    19021857  if (Category <> Kind) or (Index <> no) or (Category = hkMisc) and
    1903     (Index = miscSearchResult) then begin
    1904     if HistItems.Count = MaxHist then HistItems.Delete(0);
    1905     if HistItems.Count = 0 then
    1906       HistItems.AddNew(Category, Index, ScrollBar.Position, NewSearchContent)
    1907       else HistItems.AddNew(Kind, No, ScrollBar.Position, SearchContent);
     1858    (Index = miscSearchResult) then
     1859  begin
     1860    if nHist = MaxHist then
     1861    begin
     1862      move(HistKind[2], HistKind[1], 4 * (nHist - 2));
     1863      move(HistNo[2], HistNo[1], 4 * (nHist - 2));
     1864      move(HistPos[2], HistPos[1], 4 * (nHist - 2));
     1865      move(HistSearchContent[2], HistSearchContent[1],
     1866        sizeof(shortstring) * (nHist - 2));
     1867    end
     1868    else
     1869      inc(nHist);
     1870    if nHist > 0 then
     1871    begin
     1872      HistKind[nHist - 1] := Kind;
     1873      HistNo[nHist - 1] := no;
     1874      HistPos[nHist - 1] := sb.Position;
     1875      HistSearchContent[nHist - 1] := SearchContent
     1876    end
    19081877  end;
    19091878  Kind := Category;
     
    19181887  x, y: integer);
    19191888var
    1920   i0, Sel0: Integer;
     1889  i0, Sel0: integer;
    19211890begin
    19221891  y := y - WideFrame;
    1923   i0 := ScrollBar.Position;
     1892  i0 := sb.Position;
    19241893  Sel0 := Sel;
    19251894  if (x >= SideFrame) and (x < SideFrame + InnerWidth) and (y >= 0) and
     
    19341903  begin
    19351904    if Sel0 <> -1 then
    1936       Line(Canvas, Sel0, False);
     1905      line(Canvas, Sel0, false);
    19371906    if Sel <> -1 then
    1938       Line(Canvas, Sel, True)
     1907      line(Canvas, Sel, true)
    19391908  end
    19401909end;
     
    19441913begin
    19451914  if Sel >= 0 then
    1946     with THelpLineInfo(MainText.Objects[Sel + ScrollBar.Position]) do
     1915    with THelpLineInfo(MainText.Objects[Sel + sb.Position]) do
    19471916      if Link shr 8 and $3F = hkInternet then
    19481917        case Link and $FF of
     
    19631932
    19641933procedure THelpDlg.BackBtnClick(Sender: TObject);
    1965 var
    1966   HistItem: THistItem;
    1967 begin
    1968   if HistItems.Count > 1 then begin
    1969     HistItem := THistItem.Create;
    1970     HistItem.Assign(HistItems.Last);
    1971     HistItems.Delete(HistItems.Count - 1);
    1972     if (HistItem.Kind = hkMisc) and (HistItem.No = miscSearchResult) and
    1973       (HistItem.SearchContent <> SearchContent) then
    1974     begin
    1975       SearchContent := HistItem.SearchContent;
     1934begin
     1935  if nHist > 0 then
     1936  begin
     1937    dec(nHist);
     1938    if (HistKind[nHist] = hkMisc) and (HistNo[nHist] = miscSearchResult) and
     1939      (HistSearchContent[nHist] <> SearchContent) then
     1940    begin
     1941      SearchContent := HistSearchContent[nHist];
    19761942      Search(SearchContent);
    19771943    end;
    1978     Kind := HistItem.Kind;
    1979     no := HistItem.No;
    1980     Prepare(HistItem.Pos);
     1944    Kind := HistKind[nHist];
     1945    no := HistNo[nHist];
     1946    Prepare(HistPos[nHist]);
    19811947    OffscreenPaint;
    19821948    Invalidate;
    1983     HistItem.Free;
    1984   end;
     1949  end
    19851950end;
    19861951
    19871952procedure THelpDlg.TopBtnClick(Sender: TObject);
    19881953begin
    1989   while HistItems.Count > 1 do HistItems.Delete(HistItems.Count - 1);
     1954  nHist := 0;
    19901955  Kind := hkMisc;
    19911956  no := miscMain;
     
    20011966end;
    20021967
    2003 function THelpDlg.TextIndex(Item: string): Integer;
    2004 begin
    2005   Result := HelpText.Gethandle(Item)
     1968function THelpDlg.TextIndex(Item: string): integer;
     1969begin
     1970  result := HelpText.Gethandle(Item)
    20061971end;
    20071972
     
    20201985  InputDlg.CenterToRect(BoundsRect);
    20211986  InputDlg.ShowModal;
    2022   if (InputDlg.ModalResult = mrOK) and (Length(InputDlg.EInput.Text) >= 2) then
     1987  if (InputDlg.ModalResult = mrOK) and (length(InputDlg.EInput.Text) >= 2) then
    20231988  begin
    20241989    Search(InputDlg.EInput.Text);
     
    20372002        NewSearchContent := InputDlg.EInput.Text;
    20382003        ShowNewContent(FWindowMode, hkMisc, miscSearchResult);
    2039       end;
    2040     end;
    2041   end;
     2004      end
     2005    end
     2006  end
    20422007end;
    20432008
    20442009procedure THelpDlg.Search(SearchString: string);
    20452010var
    2046   h, i, PrevHandle, PrevIndex, p, RightMargin: Integer;
     2011  h, i, PrevHandle, PrevIndex, p, RightMargin: integer;
    20472012  s: string;
    20482013  mADVHELP, mIMPHELP, mFEATUREHELP: set of 0 .. 255;
    2049   bGOVHELP, bSPECIALMODEL, bJOBHELP: Boolean;
     2014  bGOVHELP, bSPECIALMODEL, bJOBHELP: boolean;
    20502015begin
    20512016  SearchResult.Clear;
     
    20532018  mIMPHELP := [];
    20542019  mFEATUREHELP := [];
    2055   bGOVHELP := False;
    2056   bSPECIALMODEL := False;
    2057   bJOBHELP := False;
     2020  bGOVHELP := false;
     2021  bSPECIALMODEL := false;
     2022  bJOBHELP := false;
    20582023
    20592024  // search in generic reference
    20602025  SearchString := UpperCase(SearchString);
    2061   for i := 0 to 35 + 4 do begin
     2026  for i := 0 to 35 + 4 do
     2027  begin
    20622028    s := Phrases.Lookup('TERRAIN', i);
    20632029    if pos(SearchString, UpperCase(s)) > 0 then
     
    20742040            imShipComp + i - 37) + ' ' + HelpText.Lookup('HELPSPEC_SHIPPART'),
    20752041            pkNormal, 0, hkImp + hkCrossLink, imShipComp + i - 37);
    2076         Break;
    2077       end;
     2042        Break
     2043      end
    20782044  end;
    20792045  for i := 0 to nJobHelp - 1 do
     
    20832049      SearchResult.AddLine(HelpText.Lookup('HELPTITLE_JOBLIST'), pkNormal, 0,
    20842050        hkMisc + hkCrossLink, miscJobList);
    2085       bJOBHELP := True;
    2086       Break;
     2051      bJOBHELP := true;
     2052      Break
    20872053    end;
    20882054  for i := 0 to nAdv - 1 do
     
    20972063      SearchResult.AddLine(s, pkNormal, 0, hkAdv + hkCrossLink, i);
    20982064      include(mADVHELP, i);
    2099     end;
     2065    end
    21002066  end;
    21012067  for i := 0 to nSpecialModel - 1 do
     
    21062072      SearchResult.AddLine(HelpText.Lookup('HELPTITLE_MODELLIST'), pkNormal, 0,
    21072073        hkModel + hkCrossLink, 0);
    2108       bSPECIALMODEL := True;
    2109       Break;
     2074      bSPECIALMODEL := true;
     2075      Break
    21102076    end;
    21112077  end;
     
    21132079  begin
    21142080    s := Phrases.Lookup('FEATURES', i);
    2115     if Pos(SearchString, UpperCase(s)) > 0 then
     2081    if pos(SearchString, UpperCase(s)) > 0 then
    21162082    begin
    21172083      if i < mcFirstNonCap then
     
    21222088        s := s + ' ' + HelpText.Lookup('HELPSPEC_FEATURE');
    21232089      SearchResult.AddLine(s, pkNormal, 0, hkFeature + hkCrossLink, i);
    2124       Include(mFEATUREHELP, i);
    2125     end;
     2090      include(mFEATUREHELP, i);
     2091    end
    21262092  end;
    21272093  for i := 0 to nImp - 1 do
    21282094  begin
    21292095    s := Phrases.Lookup('IMPROVEMENTS', i);
    2130     if Pos(SearchString, UpperCase(s)) > 0 then
     2096    if pos(SearchString, UpperCase(s)) > 0 then
    21312097    begin
    21322098      case Imp[i].Kind of
     
    21412107      end;
    21422108      SearchResult.AddLine(s, pkNormal, 0, hkImp + hkCrossLink, i);
    2143       Include(mIMPHELP, i);
     2109      include(mIMPHELP, i);
    21442110    end
    21452111  end;
    21462112  for i := 0 to nGov - 1 do
    2147     if Pos(SearchString, UpperCase(Phrases.Lookup('GOVERNMENT', i))) > 0 then
     2113    if pos(SearchString, UpperCase(Phrases.Lookup('GOVERNMENT', i))) > 0 then
    21482114    begin
    21492115      SearchResult.AddLine(HelpText.Lookup('HELPTITLE_GOVLIST'), pkNormal, 0,
    21502116        hkMisc + hkCrossLink, miscGovList);
    2151       bGOVHELP := True;
    2152       Break;
     2117      bGOVHELP := true;
     2118      Break
    21532119    end;
    21542120
     
    21712137          s := s + ' ' + HelpText.Lookup('HELPSPEC_ADV');
    21722138        SearchResult.AddLine(s, pkNormal, 0, hkAdv + hkCrossLink, i)
    2173       end;
     2139      end
    21742140    end
    21752141    else if h = hIMPHELP then
     
    21902156        end;
    21912157        SearchResult.AddLine(s, pkNormal, 0, hkImp + hkCrossLink, i)
    2192       end;
     2158      end
    21932159    end
    21942160    else if h = hFEATUREHELP then
     
    22052171          s := s + ' ' + HelpText.Lookup('HELPSPEC_FEATURE');
    22062172        SearchResult.AddLine(s, pkNormal, 0, hkFeature + hkCrossLink, i);
    2207       end;
     2173      end
    22082174    end
    22092175    else if h = hGOVHELP then
     
    22282194    begin
    22292195      s := HelpText.LookupByHandle(h);
    2230       p := Pos('$', s);
     2196      p := pos('$', s);
    22312197      if p > 0 then
    22322198      begin
    2233         s := Copy(s, p + 1, maxint);
    2234         p := Pos('\', s);
     2199        s := copy(s, p + 1, maxint);
     2200        p := pos('\', s);
    22352201        if p > 0 then
    2236           s := Copy(s, 1, p - 1);
     2202          s := copy(s, 1, p - 1);
    22372203        SearchResult.AddLine(s, pkNormal, 0, hkText + hkCrossLink, h);
    2238       end;
    2239     end;
    2240     until False;
     2204      end
     2205    end
     2206    until false;
    22412207
    22422208    // cut lines to fit to window
  • branches/highdpi/LocalPlayer/IsoEngine.pas

    r170 r178  
    55
    66uses
    7   Protocol, ClientTools, ScreenTools, Tribes,
     7  Protocol, ClientTools, ScreenTools, Tribes, UDpiControls,
    88{$IFNDEF SCR}Term, {$ENDIF}
    9   LCLIntf, LCLType, SysUtils, Classes, Graphics, PixelPointer;
     9  LCLIntf, LCLType, SysUtils, Classes, Graphics;
    1010
    1111type
     
    1616  TIsoMap = class
    1717    constructor Create;
    18     procedure SetOutput(Output: TBitmap);
     18    procedure SetOutput(Output: TDpiBitmap);
    1919    procedure SetPaintBounds(Left, Top, Right, Bottom: integer);
    2020    procedure Paint(x, y, Loc, nx, ny, CityLoc, CityOwner: integer;
     
    2424    procedure PaintCity(x, y: integer; const CityInfo: TCityInfo;
    2525      accessory: boolean = true);
    26     procedure BitBlt(Src: TBitmap; x, y, Width, Height, xSrc, ySrc,
     26    procedure BitBlt(Src: TDpiBitmap; x, y, Width, Height, xSrc, ySrc,
    2727      Rop: integer);
    2828
     
    3737    procedure ShadeOutside(x0, y0, x1, y1, xm, ym: integer);
    3838  protected
    39     FOutput: TBitmap;
     39    FOutput: TDpiBitmap;
    4040    FLeft, FTop, FRight, FBottom, RealTop, RealBottom, AttLoc, DefLoc,
    4141      DefHealth, FAdviceLoc: integer;
     
    113113  BordersOK: integer;
    114114  OnInitEnemyModel: TInitEnemyModelEvent;
    115   LandPatch, OceanPatch, Borders: TBitmap;
     115  LandPatch, OceanPatch, Borders: TDpiBitmap;
    116116  TSpriteSize: array [0 .. TerrainIconLines * 9 - 1] of TRect;
    117117  DebugMap: ^TTileList;
     
    136136var
    137137  i, x, y, xSrc, ySrc, HGrTerrainNew, HGrCitiesNew, age, size: integer;
    138   LandMore, OceanMore, DitherMask, Mask24: TBitmap;
     138  LandMore, OceanMore, DitherMask, Mask24: TDpiBitmap;
    139139  MaskLine: array [0 .. 32 * 3 - 1] of TPixelPointer; // 32 = assumed maximum for yyt
    140140  Border: boolean;
     
    165165  if LandPatch <> nil then
    166166    LandPatch.Free;
    167   LandPatch := TBitmap.Create;
     167  LandPatch := TDpiBitmap.Create;
    168168  LandPatch.PixelFormat := pf24bit;
    169169  LandPatch.Canvas.Brush.Color := 0;
     
    172172  if OceanPatch <> nil then
    173173    OceanPatch.Free;
    174   OceanPatch := TBitmap.Create;
     174  OceanPatch := TDpiBitmap.Create;
    175175  OceanPatch.PixelFormat := pf24bit;
    176176  OceanPatch.Canvas.Brush.Color := 0;
    177177  OceanPatch.SetSize(xxt * 8, yyt * 4);
    178178  OceanPatch.Canvas.FillRect(0, 0, OceanPatch.Width, OceanPatch.Height);
    179   LandMore := TBitmap.Create;
     179  LandMore := TDpiBitmap.Create;
    180180  LandMore.PixelFormat := pf24bit;
    181181  LandMore.Canvas.Brush.Color := 0;
    182182  LandMore.SetSize(xxt * 18, yyt * 9);
    183183  LandMore.Canvas.FillRect(0, 0, LandMore.Width, LandMore.Height);
    184   OceanMore := TBitmap.Create;
     184  OceanMore := TDpiBitmap.Create;
    185185  OceanMore.PixelFormat := pf24bit;
    186186  OceanMore.Canvas.Brush.Color := 0;
    187187  OceanMore.SetSize(xxt * 8, yyt * 4);
    188188  OceanMore.Canvas.FillRect(0, 0, OceanMore.Width, OceanMore.Height);
    189   DitherMask := TBitmap.Create;
     189  DitherMask := TDpiBitmap.Create;
    190190  DitherMask.PixelFormat := pf24bit;
    191191  DitherMask.SetSize(xxt * 2, yyt * 2);
     
    366366
    367367  // reduce size of terrain icons
    368   Mask24 := TBitmap.Create;
     368  Mask24 := TDpiBitmap.Create;
    369369  Mask24.Assign(GrExt[HGrTerrain].Mask);
    370370  Mask24.PixelFormat := pf24bit;
     
    420420  if Borders <> nil then
    421421    Borders.Free;
    422   Borders := TBitmap.Create;
     422  Borders := TDpiBitmap.Create;
    423423  Borders.PixelFormat := pf24bit;
    424424  Borders.SetSize(xxt * 2,(yyt * 2) * nPl);
     
    452452end;
    453453
    454 procedure TIsoMap.SetOutput(Output: TBitmap);
     454procedure TIsoMap.SetOutput(Output: TDpiBitmap);
    455455begin
    456456  FOutput := Output;
     
    499499end;
    500500
    501 procedure TIsoMap.BitBlt(Src: TBitmap; x, y, Width, Height, xSrc, ySrc,
     501procedure TIsoMap.BitBlt(Src: TDpiBitmap; x, y, Width, Height, xSrc, ySrc,
    502502  Rop: integer);
    503503begin
  • branches/highdpi/LocalPlayer/MessgEx.pas

    r173 r178  
    55
    66uses
    7   Messg, Protocol, ScreenTools, Platform, DateUtils,
     7  Messg, Protocol, ScreenTools, Platform, DateUtils, UDpiControls,
    88  LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, ButtonA,
    99  ButtonB, StdCtrls, DrawDlg;
     
    3232  private
    3333    MovieCancelled: boolean;
    34     procedure PaintBook(ca: TCanvas; x, y, clPage, clCover: integer);
     34    procedure PaintBook(ca: TDpiCanvas; x, y, clPage, clCover: integer);
    3535    procedure PaintMyArmy;
    3636    procedure PaintEnemyArmy;
     
    7373
    7474uses
    75   ClientTools, BaseWin, Term, Help, UnitStat, Tribes, PixelPointer,
    76   IsoEngine, Diagram, Sound;
     75  ClientTools, BaseWin, Term, Help, UnitStat, Tribes,
     76  IsoEngine, Diagram;
    7777
    7878{$R *.lfm}
     
    226226end;
    227227
    228 procedure TMessgExDlg.PaintBook(ca: TCanvas; x, y, clPage, clCover: integer);
     228procedure TMessgExDlg.PaintBook(ca: TDpiCanvas; x, y, clPage, clCover: integer);
    229229const
    230230  xScrewed = 77;
  • branches/highdpi/LocalPlayer/NatStat.pas

    r104 r178  
    55
    66uses
    7   Protocol, ClientTools, Term, ScreenTools, BaseWin,
    8 
     7  Protocol, ClientTools, Term, ScreenTools, BaseWin, UDpiControls,
    98  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms,
    109  ButtonB, ButtonC, Menus, EOTButton;
     
    4544    SelfReport, CurrentReport: PEnemyReport;
    4645    ShowContact, ContactEnabled: boolean;
    47     Back, Template: TBitmap;
     46    Back, Template: TDpiBitmap;
    4847    ReportText: TStringList;
    4948    procedure GenerateReportText;
     
    8786  ContactBtn.Hint := Phrases.Lookup('BTN_DIALOG');
    8887
    89   Back := TBitmap.Create;
     88  Back := TDpiBitmap.Create;
    9089  Back.PixelFormat := pf24bit;
    9190  Back.SetSize(Width, Height);
    9291  Back.Canvas.FillRect(0, 0, Back.Width, Back.Height);
    93   Template := TBitmap.Create;
     92  Template := TDpiBitmap.Create;
    9493  Template.PixelFormat := pf24bit;
    9594  LoadGraphicFile(Template, HomeDir + 'Graphics' + DirectorySeparator + 'Nation.png', gfNoGamma);
  • branches/highdpi/LocalPlayer/Nego.pas

    r174 r178  
    66uses
    77  ScreenTools, BaseWin, Protocol, Term, LCLType, SysUtils, Classes, Graphics,
    8   Controls, Forms, ButtonA, ButtonB, ButtonN;
     8  Controls, Forms, ButtonA, ButtonB, ButtonN, UDpiControls;
    99
    1010const
     
    1515type
    1616  THistory = record
    17     n: Integer;
    18     Text: array[0 .. MaxHistory - 1] of ansistring;
    19   end;
    20 
    21   TCommandAllowedEnum = scDipNoticeStart..scDipBreakStart;
     17    n: integer;
     18    Text: array [0 .. MaxHistory - 1] of ansistring;
     19  end;
     20
     21  TCommandAllowedEnum = scDipNoticeStart .. scDipBreakStart;
    2222
    2323  { TNegoDlg }
     
    8383    CommandAllowed: set of TCommandAllowedEnum;
    8484    History: array [0 .. nPl - 1] of THistory;
    85     RomanFont: TFont;
     85    RomanFont: TDpiFont;
    8686    Costs, Delivers: array [0 .. 11] of cardinal;
    8787    procedure ResetCurrentOffer;
     
    161161
    162162  fillchar(History, sizeof(History), 0);
    163   RomanFont := TFont.Create;
     163  RomanFont := TDpiFont.Create;
    164164  RomanFont.Name := 'Times New Roman';
    165165  RomanFont.Size := Round(144 * 72 / RomanFont.PixelsPerInch);
  • branches/highdpi/LocalPlayer/PVSB.pas

    r172 r178  
    99  {$ENDIF}
    1010  Classes, Controls, Forms, LCLIntf, LCLType, LMessages, Messages, SysUtils,
    11   StdCtrls, Math;
     11  StdCtrls, Math, UDpiControls;
    1212
    1313type
     
    1818  private
    1919    FOnUpdate: TNotifyEvent;
    20     ScrollBar: TScrollBar;
     20    ScrollBar: TDpiScrollBar;
    2121    FMax: Integer;
    2222    function GetMax: Integer;
     
    2828    procedure SetPosition(AValue: Integer);
    2929  public
    30     constructor Create(Parent: TWinControl);
     30    constructor Create(Parent: TDpiWinControl);
    3131    destructor Destroy; override;
    3232    procedure Init(Max, PageSize: Integer);
     
    109109    if Max < ScrollBar.PageSize then Result := False
    110110    else begin
    111       NewPos := ScrollBar.Position - Delta div 30;
     111      NewPos := ScrollBar.Position - Delta div 300;
    112112      if NewPos < 0 then NewPos := 0;
    113113      if NewPos > Max - ScrollBar.PageSize + 1 then
     
    153153begin
    154154  FMax := AValue;
    155   ScrollBar.Max := Math.Max(0, FMax);
     155  ScrollBar.Max := Math.Max(0, Max{$IFDEF LINUX} - PageSize + 1{$ENDIF});
    156156end;
    157157
     
    181181end;
    182182
    183 constructor TPVScrollBar.Create(Parent: TWinControl);
     183constructor TPVScrollBar.Create(Parent: TDpiWinControl);
    184184begin
    185185  Inc(Count);
    186   ScrollBar := TScrollBar.Create(Parent);
     186  ScrollBar := TDpiScrollBar.Create(Parent);
    187187  ScrollBar.Kind := sbVertical;
    188188  ScrollBar.Name := 'PVSB' + IntToStr(Count);
  • branches/highdpi/LocalPlayer/Select.pas

    r89 r178  
    55
    66uses
    7   Protocol, ClientTools, Term, ScreenTools, IsoEngine, PVSB, BaseWin,
    8 
     7  Protocol, ClientTools, Term, ScreenTools, IsoEngine, PVSB, BaseWin, UDpiControls,
    98  LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms,
    109  ExtCtrls, ButtonB, ButtonBase, Menus, Types;
     
    5352    Column: array [0 .. nPl - 1] of integer;
    5453    Closable, MultiPage: boolean;
    55     ScienceNationDot: TBitmap;
     54    ScienceNationDot: TDpiBitmap;
    5655    procedure ScrollBarUpdate(Sender: TObject);
    5756    procedure InitLines;
    58     procedure line(ca: TCanvas; l: integer; NonText, lit: boolean);
     57    procedure line(ca: TDpiCanvas; l: integer; NonText, lit: boolean);
    5958    function RenameCity(cix: integer): boolean;
    6059    function RenameModel(mix: integer): boolean;
     
    110109  Layer1Btn.Hint := Phrases.Lookup('BTN_WONDERS');
    111110  Layer2Btn.Hint := Phrases.Lookup('BTN_CLASSES');
    112   ScienceNationDot := TBitmap.Create;
     111  ScienceNationDot := TDpiBitmap.Create;
    113112  ScienceNationDot.PixelFormat := pf24bit;
    114113  ScienceNationDot.SetSize(17, 17);
     
    181180end;
    182181
    183 procedure TListDlg.line(ca: TCanvas; l: integer; NonText, lit: boolean);
     182procedure TListDlg.line(ca: TDpiCanvas; l: integer; NonText, lit: boolean);
    184183// paint a line
    185184
  • branches/highdpi/LocalPlayer/TechTree.pas

    r170 r178  
    66uses
    77  ScreenTools, Messg, LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics,
    8   Controls, Forms, ButtonBase, ButtonB, DrawDlg;
     8  Controls, Forms, ButtonBase, ButtonB, DrawDlg, UDpiControls;
    99
    1010type
     
    2323  private
    2424    xOffset, yOffset, xDown, yDown: Integer;
    25     Image: TBitmap;
     25    Image: TDpiBitmap;
    2626    dragging: boolean;
    2727  end;
     
    3030  TechTreeDlg: TTechTreeDlg;
    3131
    32 
    3332implementation
    3433
    3534uses
    36   Directories, PixelPointer;
     35  Directories;
    3736
    3837{$R *.lfm}
     
    126125  if Image = nil then
    127126  begin
    128     Image := TBitmap.Create;
     127    Image := TDpiBitmap.Create;
    129128    Image.PixelFormat := pf24bit;
    130129    LoadGraphicFile(Image, HomeDir + 'Help' + DirectorySeparator + 'AdvTree.png', gfNoGamma);
  • branches/highdpi/LocalPlayer/Term.pas

    r173 r178  
    1313  Protocol, Tribes, PVSB, ClientTools, ScreenTools, BaseWin, Messg, ButtonBase,
    1414  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, DrawDlg, Types,
    15   Forms, Menus, ExtCtrls, dateutils, Platform, ButtonB, ButtonC, EOTButton, Area;
     15  Forms, Menus, ExtCtrls, dateutils, Platform, ButtonB, ButtonC, EOTButton, Area,
     16  UDpiControls;
    1617
    1718const
     
    228229    BrushType: Cardinal;
    229230    trix: array [0 .. 63] of integer;
    230     AILogo: array [0 .. nPl - 1] of TBitmap;
    231     Mini, Panel, TopBar: TBitmap;
     231    AILogo: array [0 .. nPl - 1] of TDpiBitmap;
     232    Mini, Panel, TopBar: TDpiBitmap;
    232233    sb: TPVScrollbar;
    233234    Closable, RepaintOnResize, Tracking, TurnComplete, Edited, GoOnPhase,
     
    276277  public
    277278    UsedOffscreenWidth, UsedOffscreenHeight: integer;
    278     Offscreen: TBitmap;
    279     OffscreenUser: TForm;
     279    Offscreen: TDpiBitmap;
     280    OffscreenUser: TDpiForm;
    280281    procedure CreateParams(var p: TCreateParams); override;
    281282    procedure Client(Command, NewPlayer: integer; var Data);
     
    428429  CityRepMask: Cardinal;
    429430  ReceivedOffer: TOffer;
    430   Buffer: TBitmap;
    431   SmallImp: TBitmap;
     431  Buffer: TDpiBitmap;
     432  SmallImp: TDpiBitmap;
    432433  BlinkON: Boolean;
    433434  DestinationMarkON: Boolean;
     
    455456procedure InitMyModel(mix: integer; final: boolean);
    456457
    457 procedure ImpImage(ca: TCanvas; x, y, iix: integer; Government: integer = -1;
     458procedure ImpImage(ca: TDpiCanvas; x, y, iix: integer; Government: integer = -1;
    458459  IsControl: boolean = false);
    459460procedure HelpOnTerrain(Loc, NewMode: integer);
    460461
    461 
    462462implementation
    463463
    464464uses
    465465  Directories, IsoEngine, CityScreen, Draft, MessgEx, Select, CityType, Help,
    466   UnitStat, Log, Diagram, NatStat, Wonders, Enhance, Nego, PixelPointer, Sound,
     466  UnitStat, Log, Diagram, NatStat, Wonders, Enhance, Nego,
    467467  Battle, Rates, TechTree, Registry;
    468468
     
    620620end;
    621621
    622 procedure ImpImage(ca: TCanvas; x, y, iix: integer; Government: integer;
     622procedure ImpImage(ca: TDpiCanvas; x, y, iix: integer; Government: integer;
    623623  IsControl: boolean);
    624624begin
     
    859859end;
    860860
    861 procedure PaintZoomedTile(dst: TBitmap; x, y, Loc: integer);
     861procedure PaintZoomedTile(dst: TDpiBitmap; x, y, Loc: integer);
    862862
    863863  procedure TSprite(xDst, yDst, xSrc, ySrc: integer);
     
    10881088    if G.RO[DipMem[me].pContact] <> nil then
    10891089    begin // close windows for next player
    1090       for i := 0 to Screen.FormCount - 1 do
    1091         if Screen.Forms[i].Visible and (Screen.Forms[i] is TBufferedDrawDlg)
     1090      for i := 0 to DpiScreen.FormCount - 1 do
     1091        if DpiScreen.Forms[i].Visible and (DpiScreen.Forms[i] is TBufferedDrawDlg)
    10921092        then
    1093           Screen.Forms[i].Close;
     1093          DpiScreen.Forms[i].Close;
    10941094    end
    10951095    else
     
    11161116    if G.RO[DipMem[me].pContact] <> nil then
    11171117    begin // close windows for next player
    1118       for i := 0 to Screen.FormCount - 1 do
    1119         if Screen.Forms[i].Visible and (Screen.Forms[i] is TBufferedDrawDlg)
     1118      for i := 0 to DpiScreen.FormCount - 1 do
     1119        if DpiScreen.Forms[i].Visible and (DpiScreen.Forms[i] is TBufferedDrawDlg)
    11201120        then
    1121           Screen.Forms[i].Close;
     1121          DpiScreen.Forms[i].Close;
    11221122    end
    11231123    else
     
    12311231  begin
    12321232    if AILogo[p] = nil then
    1233       AILogo[p] := TBitmap.Create;
     1233      AILogo[p] := TDpiBitmap.Create;
    12341234    if not LoadGraphicFile(AILogo[p], HomeDir + Name + '.png', gfNoError) then
    12351235    begin
     
    14971497
    14981498    HGrStdUnits := LoadGraphicSet('StdUnits.png');
    1499     SmallImp := TBitmap.Create;
     1499    SmallImp := TDpiBitmap.Create;
    15001500    SmallImp.PixelFormat := pf24bit;
    15011501    InitSmallImp;
     
    18111811    end;
    18121812
    1813     for i := 0 to Screen.FormCount - 1 do
    1814       if Screen.Forms[i] is TBufferedDrawDlg then
    1815         Screen.Forms[i].Enabled := true;
     1813    for i := 0 to DpiScreen.FormCount - 1 do
     1814      if DpiScreen.Forms[i] is TBufferedDrawDlg then
     1815        DpiScreen.Forms[i].Enabled := true;
    18161816
    18171817    if ClientMode <> cResume then
     
    18241824      // first turn after anarchy -- don't show despotism palace!
    18251825      Update;
    1826       for i := 0 to Screen.FormCount - 1 do
    1827         if (Screen.Forms[i].Visible) and (Screen.Forms[i] is TBufferedDrawDlg)
     1826      for i := 0 to DpiScreen.FormCount - 1 do
     1827        if (DpiScreen.Forms[i].Visible) and (DpiScreen.Forms[i] is TBufferedDrawDlg)
    18281828        then
    18291829        begin
    1830           if @Screen.Forms[i].OnShow <> nil then
    1831             Screen.Forms[i].OnShow(nil);
    1832           Screen.Forms[i].Invalidate;
    1833           Screen.Forms[i].Update;
     1830          if @DpiScreen.Forms[i].OnShow <> nil then
     1831            DpiScreen.Forms[i].OnShow(nil);
     1832          DpiScreen.Forms[i].Invalidate;
     1833          DpiScreen.Forms[i].Update;
    18341834        end;
    18351835
     
    26652665        SaveSettings;
    26662666        CityDlg.CloseAction := None;
    2667         for i := 0 to Screen.FormCount - 1 do
    2668           if Screen.Forms[i].Visible and (Screen.Forms[i] is TBufferedDrawDlg)
     2667        for i := 0 to DpiScreen.FormCount - 1 do
     2668          if DpiScreen.Forms[i].Visible and (DpiScreen.Forms[i] is TBufferedDrawDlg)
    26692669          then
    2670             Screen.Forms[i].Close;
     2670            DpiScreen.Forms[i].Close;
    26712671        if LogDlg.Visible then
    26722672          LogDlg.Close;
     
    34093409  i, j: integer;
    34103410begin
    3411   MainFormKeyDown := FormKeyDown;
    34123411  BaseWin.CreateOffscreen(Offscreen);
    34133412
     
    35083507  end;
    35093508
    3510   Mini := TBitmap.Create;
     3509  Mini := TDpiBitmap.Create;
    35113510  Mini.PixelFormat := pf24bit;
    3512   Panel := TBitmap.Create;
     3511  Panel := TDpiBitmap.Create;
    35133512  Panel.PixelFormat := pf24bit;
    35143513  Panel.Canvas.Font.Assign(UniFont[ftSmall]);
    35153514  Panel.Canvas.Brush.Style := bsClear;
    3516   TopBar := TBitmap.Create;
     3515  TopBar := TDpiBitmap.Create;
    35173516  TopBar.PixelFormat := pf24bit;
    35183517  TopBar.Canvas.Font.Assign(UniFont[ftNormal]);
    35193518  TopBar.Canvas.Brush.Style := bsClear;
    3520   Buffer := TBitmap.Create;
     3519  Buffer := TDpiBitmap.Create;
    35213520  Buffer.PixelFormat := pf24bit;
    35223521  if 2 * lxmax > 3 * xSizeBig then
     
    35383537procedure TMainScreen.FormDestroy(Sender: TObject);
    35393538var
    3540   I: Integer;
    3541 begin
    3542   MainFormKeyDown := nil;
     3539  i: integer;
     3540begin
    35433541  FreeAndNil(sb);
    35443542  FreeAndNil(TopBar);
     
    35463544  FreeAndNil(Buffer);
    35473545  FreeAndNil(Panel);
    3548   for I := 0 to nPl - 1 do
     3546  for i := 0 to nPl - 1 do
    35493547    if AILogo[i] <> nil then
    3550       FreeAndNil(AILogo[I]);
     3548      FreeAndNil(AILogo[i]);
    35513549  FreeAndNil(Offscreen);
    35523550end;
     
    37533751  if supervising and (me <> 0) then
    37543752  begin
    3755     for i := 0 to Screen.FormCount - 1 do
    3756       if Screen.Forms[i].Visible and (Screen.Forms[i] is TBufferedDrawDlg) then
    3757         Screen.Forms[i].Close; // close windows
     3753    for i := 0 to DpiScreen.FormCount - 1 do
     3754      if DpiScreen.Forms[i].Visible and (DpiScreen.Forms[i] is TBufferedDrawDlg) then
     3755        DpiScreen.Forms[i].Close; // close windows
    37583756    ItsMeAgain(0);
    37593757  end;
     
    38993897  if IsMultiPlayerGame then
    39003898  begin // close windows for next player
    3901     for i := 0 to Screen.FormCount - 1 do
    3902       if Screen.Forms[i].Visible and (Screen.Forms[i] is TBufferedDrawDlg) then
    3903         Screen.Forms[i].Close;
     3899    for i := 0 to DpiScreen.FormCount - 1 do
     3900      if DpiScreen.Forms[i].Visible and (DpiScreen.Forms[i] is TBufferedDrawDlg) then
     3901        DpiScreen.Forms[i].Close;
    39043902  end
    39053903  else
     
    39113909  end;
    39123910  for i := 0 to Screen.FormCount - 1 do
    3913     if Screen.Forms[i].Visible and (Screen.Forms[i] is TBufferedDrawDlg) then
    3914       Screen.Forms[i].Enabled := false;
     3911    if DpiScreen.Forms[i].Visible and (DpiScreen.Forms[i] is TBufferedDrawDlg) then
     3912      DpiScreen.Forms[i].Enabled := false;
    39153913
    39163914  if Server(sTurn, pTurn, 0, nil^) >= rExecuted then
     
    41794177{$IFDEF LINUX}
    41804178// Can't do scrolling of DC under Linux, then fallback into BitBlt.
    4181 function ScrollDC(Canvas: TCanvas; dx: longint; dy: longint; const lprcScroll:TRect; const lprcClip:TRect; hrgnUpdate:HRGN; lprcUpdate: PRect):Boolean;
     4179function ScrollDC(Canvas: TDpiCanvas; dx: longint; dy: longint; const lprcScroll:TRect; const lprcClip:TRect; hrgnUpdate:HRGN; lprcUpdate: PRect):Boolean;
    41824180begin
    41834181  BitBltCanvas(Canvas, lprcScroll.Left + dx, lprcScroll.Top + dy, lprcScroll.Right - lprcScroll.Left, lprcScroll.Bottom - lprcScroll.Top,
     
    50805078begin
    50815079  if idle and (me >= 0) and (GameMode <> cMovie) then
    5082     if (fsModal in Screen.ActiveForm.FormState) or
    5083       (Screen.ActiveForm is TBufferedDrawDlg) and
    5084       (TBufferedDrawDlg(Screen.ActiveForm).WindowMode <> wmPersistent) then
     5080    if (fsModal in DpiScreen.ActiveForm.FormState) or
     5081      (DpiScreen.ActiveForm is TBufferedDrawDlg) and
     5082      (TBufferedDrawDlg(DpiScreen.ActiveForm).WindowMode <> wmPersistent) then
    50855083    begin
    50865084      BlinkTime := BlinkOnTime + BlinkOffTime - 1;
     
    51175115        if (dx <> 0) or (dy <> 0) then
    51185116        begin
    5119           if (Screen.ActiveForm <> MainScreen) and
    5120             (@Screen.ActiveForm.OnDeactivate <> nil) then
    5121             Screen.ActiveForm.OnDeactivate(nil);
     5117          if (DpiScreen.ActiveForm <> MainScreen) and
     5118            (@DpiScreen.ActiveForm.OnDeactivate <> nil) then
     5119            DpiScreen.ActiveForm.OnDeactivate(nil);
    51225120          Scroll(dx, dy);
    51235121        end
     
    64586456    ((p = 0) or (1 shl p and G.RO[0].Alive <> 0)) then
    64596457  begin
    6460     for i := 0 to Screen.FormCount - 1 do
    6461       if Screen.Forms[i].Visible and (Screen.Forms[i] is TBufferedDrawDlg) then
    6462         Screen.Forms[i].Close; // close windows
     6458    for i := 0 to DpiScreen.FormCount - 1 do
     6459      if DpiScreen.Forms[i].Visible and (DpiScreen.Forms[i] is TBufferedDrawDlg) then
     6460        DpiScreen.Forms[i].Close; // close windows
    64636461    ItsMeAgain(p);
    64646462    SumCities(TaxSum, ScienceSum);
     
    80038001  Centre(CenterLoc);
    80048002  PaintAllMaps;
    8005   for i := 0 to Screen.FormCount - 1 do
    8006     if Screen.Forms[i].Visible and (Screen.Forms[i] is TBufferedDrawDlg) then
    8007       TBufferedDrawDlg(Screen.Forms[i]).SmartUpdateContent(false);
     8003  for i := 0 to DpiScreen.FormCount - 1 do
     8004    if DpiScreen.Forms[i].Visible and (DpiScreen.Forms[i] is TBufferedDrawDlg) then
     8005      TBufferedDrawDlg(DpiScreen.Forms[i]).SmartUpdateContent(false);
    80088006end;
    80098007
  • branches/highdpi/LocalPlayer/UnitStat.pas

    r73 r178  
    55
    66uses
    7   Protocol, ClientTools, Term, ScreenTools, BaseWin,
     7  Protocol, ClientTools, Term, ScreenTools, BaseWin, UDpiControls,
    88  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms,
    99  ButtonB, ButtonC;
     
    4141    Kind: (dkOwnModel, dkOwnUnit, dkEnemyModel, dkEnemyUnit, dkEnemyCityDefense,
    4242      dkEnemyCity);
    43     Back, Template: TBitmap;
     43    Back, Template: TDpiBitmap;
    4444    procedure OffscreenPaint; override;
    4545  end;
     
    7777  InitButtons();
    7878
    79   Back := TBitmap.Create;
     79  Back := TDpiBitmap.Create;
    8080  Back.PixelFormat := pf24bit;
    8181  Back.SetSize(5 * wCommon, hMax);
    8282  Back.Canvas.FillRect(0, 0, Back.Width,Back.Height);
    83   Template := TBitmap.Create;
     83  Template := TDpiBitmap.Create;
    8484  Template.PixelFormat := pf24bit;
    8585  LoadGraphicFile(Template, HomeDir + 'Graphics' + DirectorySeparator + 'Unit.png', gfNoGamma);
     
    300300  end;
    301301
    302   procedure FeatureBar(dst: TBitmap; x, y: integer; const mi: TModelInfo;
     302  procedure FeatureBar(dst: TDpiBitmap; x, y: integer; const mi: TModelInfo;
    303303    const T: TTexture);
    304304  var
     
    367367  end; { featurebar }
    368368
    369   procedure NumberBarS(dst: TBitmap; x, y: integer; Cap, s: string;
     369  procedure NumberBarS(dst: TDpiBitmap; x, y: integer; Cap, s: string;
    370370    const T: TTexture);
    371371  begin
  • branches/highdpi/LocalPlayer/Wonders.pas

    r170 r178  
    3838
    3939uses
    40   Term, ClientTools, Help, Tribes, PixelPointer;
     40  Term, ClientTools, Help, Tribes;
    4141
    4242{$R *.lfm}
Note: See TracChangeset for help on using the changeset viewer.