Ignore:
Timestamp:
Apr 9, 2021, 5:56:50 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Merged changes from trunk r360 into highdpi branch.
Location:
branches/highdpi/LocalPlayer
Files:
18 edited

Legend:

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

    r349 r361  
    206206  OKBtn.Caption := Phrases.Lookup('BTN_YES');
    207207  CancelBtn.Caption := Phrases.Lookup('BTN_NO');
    208   InitButtons();
     208  InitButtons;
    209209end;
    210210
     
    243243  end;
    244244  Frame(Canvas, Border + 1, Border + 1, ClientWidth - (2 + Border),
    245     ClientHeight - (2 + Border), MainTexture.clBevelLight,
    246     MainTexture.clBevelShade);
     245    ClientHeight - (2 + Border), MainTexture.ColorBevelLight,
     246    MainTexture.ColorBevelShade);
    247247  Frame(Canvas, 2 + Border, 2 + Border, ClientWidth - (3 + Border),
    248     ClientHeight - (3 + Border), MainTexture.clBevelLight,
    249     MainTexture.clBevelShade);
     248    ClientHeight - (3 + Border), MainTexture.ColorBevelLight,
     249    MainTexture.ColorBevelShade);
    250250
    251251  if IsSuicideQuery then
  • branches/highdpi/LocalPlayer/CityScreen.pas

    r349 r361  
    1515type
    1616  TCityCloseAction = (None, RestoreFocus, StepFocus);
     17  TSmallMapMode = (smSupportedUnits, smImprovements);
    1718
    1819  TCityDlg = class(TBufferedDrawDlg)
     
    5960    cix: Integer;
    6061    cLoc: Integer;
    61     Mode: Integer;
     62    SmallMapMode: TSmallMapMode;
    6263    ZoomArea: Integer;
    6364    Page: Integer;
     
    7374    CityAreaInfo: TCityAreaInfo;
    7475    AreaMap: TIsoMap;
     76    NoMap: TIsoMap;
    7577    CityMapTemplate: TDpiBitmap;
    7678    SmallCityMapTemplate: TDpiBitmap;
     
    8284    ProdHint: Boolean;
    8385    AllowChange: Boolean;
     86    RedTex: TTexture;
     87    BarTex: TTexture;
    8488    procedure InitSmallCityMap;
    8589    procedure InitZoomCityMap;
     
    109113
    110114const
    111   { modes }
    112   mSupp = 1;
    113   mImp = 2;
    114 
    115115  wBar = 106;
    116116  xDiv = 400;
     
    197197begin
    198198  inherited;
     199  RedTex := TTexture.Create;
     200  BarTex := TTexture.Create;
     201  NoMap := TIsoMap.Create;
    199202  AreaMap := TIsoMap.Create;
    200203  AreaMap.SetOutput(offscreen);
    201204  AreaMap.SetPaintBounds(xmArea - 192, ymArea - 96 - 32, xmArea + 192,
    202205    ymArea + 96);
    203   Mode := mImp;
     206  SmallMapMode := smImprovements;
    204207  ZoomArea := 1;
    205208  ProdHint := false;
     
    208211  AgePrepared := -2;
    209212  Optimize_cixTileChange := -1;
    210   InitButtons();
     213  InitButtons;
    211214  // InitWindowRegion;
    212215  CloseBtn.Caption := Phrases.Lookup('BTN_OK');
     
    252255procedure TCityDlg.FormDestroy(Sender: TObject);
    253256begin
     257  FreeAndNil(NoMap);
    254258  FreeAndNil(AreaMap);
    255259  FreeAndNil(SmallCityMap);
     
    259263  FreeAndNil(Template);
    260264  FreeAndNil(Back);
     265  FreeAndNil(RedTex);
     266  FreeAndNil(BarTex);
    261267end;
    262268
    263269procedure TCityDlg.Reset;
    264270begin
    265   Mode := mImp;
     271  SmallMapMode := smImprovements;
    266272  ZoomArea := 1;
    267273end;
     
    269275procedure TCityDlg.CheckAge;
    270276begin
    271   if MainTextureAge <> AgePrepared then
    272   begin
    273     AgePrepared := MainTextureAge;
     277  if MainTexture.Age <> AgePrepared then begin
     278    AgePrepared := MainTexture.Age;
    274279
    275280    UnshareBitmap(Back);
     
    370375  DpiBitCanvas(ZoomCityMap.Canvas, 0, 0, wZoomMap, hZoomMap,
    371376    Back.Canvas, xZoomMap, yZoomMap);
    372   if Mode = mImp then begin
     377  if SmallMapMode = smImprovements then begin
    373378    if ZoomArea < 3 then begin
    374379      ImageOp_B(ZoomCityMap, CityMapTemplate, 0, 0, 376 * SizeClass,
     
    388393  procedure FillBar(x, y, pos, Growth, max, Kind: integer;
    389394    IndicateComplete: boolean);
    390   var
    391     Tex: TTexture;
    392   begin
    393     Tex := MainTexture;
    394     if Kind = 3 then
    395     begin
    396       Tex.clBevelLight := HGrSystem.Data.Canvas.Pixels[104, 36];
    397       Tex.clBevelShade := Tex.clBevelLight;
     395  begin
     396    BarTex.Assign(MainTexture);
     397    if Kind = 3 then begin
     398      BarTex.ColorBevelLight := HGrSystem.Data.Canvas.Pixels[104, 36];
     399      BarTex.ColorBevelShade := BarTex.ColorBevelLight;
    398400    end;
    399401    PaintRelativeProgressBar(offscreen.Canvas, Kind, x - 3, y, wBar - 4, pos,
    400       Growth, max, IndicateComplete, Tex);
     402      Growth, max, IndicateComplete, BarTex);
    401403  end;
    402404
     
    492494  UnitInfo: TUnitInfo;
    493495  UnitReport: TUnitReport;
    494   RedTex: TTexture;
    495496  IsCityAlive, CanGrow: boolean;
    496497begin
     
    524525    Report.Working := c.Size;
    525526
    526   RedTex := MainTexture;
    527   RedTex.clBevelLight := $0000FF;
    528   RedTex.clBevelShade := $000000;
    529   RedTex.clTextLight := $000000;
    530   RedTex.clTextShade := $0000FF;
     527  RedTex.Assign(MainTexture);
     528  RedTex.ColorBevelLight := $0000FF;
     529  RedTex.ColorBevelShade := $000000;
     530  RedTex.ColorTextLight := $000000;
     531  RedTex.ColorTextShade := $0000FF;
    531532
    532533  DpiBitCanvas(offscreen.Canvas, 0, 0, 640, 480, Back.Canvas, 0, 0);
     
    596597
    597598  with AreaMap do begin
    598   rx := (192 + xxt * 2 - 1) div (xxt * 2);
    599   ry := (96 + yyt * 2 - 1) div (yyt * 2);
    600   AreaMap.Paint(xmArea - xxt * 2 * rx, ymArea - yyt * 2 * ry - 3 * yyt,
    601     dLoc(cLoc, -2 * rx + 1, -2 * ry - 1), 4 * rx - 1, 4 * ry + 1, cLoc, cOwner,
    602     false, AllowChange and IsCityAlive and
    603     (c.Status and csResourceWeightsMask = 0));
    604   DpiBitCanvas(offscreen.Canvas, xmArea + 102, 42, 90, 33, Back.Canvas,
    605     xmArea + 102, 42);
    606 
    607   if IsCityAlive then
    608     for dy := -3 to 3 do
    609       for dx := -3 to 3 do
    610         if ((dx + dy) and 1 = 0) and (dx * dx * dy * dy < 81) then
    611         begin
    612           Loc1 := dLoc(cLoc, dx, dy);
    613           av := CityAreaInfo.Available[(dy + 3) shl 2 + (dx + 3) shr 1];
    614           if ((av = faNotAvailable) or (av = faTreaty) or (av = faInvalid)) and
    615             ((Loc1 < 0) or (Loc1 >= G.lx * G.ly) or (MyMap[Loc1] and fCity = 0))
    616           then
    617             Sprite(offscreen, HGrTerrain, xmArea - xxt + xxt * dx,
    618               ymArea - yyt + yyt * dy, xxt * 2, yyt * 2, 1 + 5 * (xxt * 2 + 1),
    619               1 + yyt + 15 * (yyt * 3 + 1));
    620           if (1 shl ((dy + 3) shl 2 + (dx + 3) shr 1) and c.Tiles <> 0) then
    621             PaintResources(xmArea - xxt + xxt * dx, ymArea - yyt + yyt * dy,
    622               Loc1, (dx = 0) and (dy = 0));
    623         end;
     599    rx := (192 + xxt * 2 - 1) div (xxt * 2);
     600    ry := (96 + yyt * 2 - 1) div (yyt * 2);
     601    AreaMap.Paint(xmArea - xxt * 2 * rx, ymArea - yyt * 2 * ry - 3 * yyt,
     602      dLoc(cLoc, -2 * rx + 1, -2 * ry - 1), 4 * rx - 1, 4 * ry + 1, cLoc, cOwner,
     603      false, AllowChange and IsCityAlive and
     604      (c.Status and csResourceWeightsMask = 0));
     605    DpiBitCanvas(offscreen.Canvas, xmArea + 102, 42, 90, 33, Back.Canvas,
     606      xmArea + 102, 42);
     607
     608    if IsCityAlive then
     609      for dy := -3 to 3 do
     610        for dx := -3 to 3 do
     611          if ((dx + dy) and 1 = 0) and (dx * dx * dy * dy < 81) then begin
     612            Loc1 := dLoc(cLoc, dx, dy);
     613            av := CityAreaInfo.Available[(dy + 3) shl 2 + (dx + 3) shr 1];
     614            if ((av = faNotAvailable) or (av = faTreaty) or (av = faInvalid)) and
     615              ((Loc1 < 0) or (Loc1 >= G.lx * G.ly) or (MyMap[Loc1] and fCity = 0))
     616            then
     617              Sprite(offscreen, HGrTerrain, xmArea - xxt + xxt * dx,
     618                ymArea - yyt + yyt * dy, xxt * 2, yyt * 2, 1 + 5 * (xxt * 2 + 1),
     619                1 + yyt + 15 * (yyt * 3 + 1));
     620            if (1 shl ((dy + 3) shl 2 + (dx + 3) shr 1) and c.Tiles <> 0) then
     621              PaintResources(xmArea - xxt + xxt * dx, ymArea - yyt + yyt * dy,
     622                Loc1, (dx = 0) and (dy = 0));
     623          end;
    624624  end;
    625625
     
    794794  DpiBitCanvas(offscreen.Canvas, xSmallMap, ySmallMap, wSmallMap, hSmallMap,
    795795    SmallCityMap.Canvas, 0, 0);
    796   if Mode = mImp then
     796  if SmallMapMode = smImprovements then
    797797    Frame(offscreen.Canvas, xSmallMap + 48 * (ZoomArea div 3),
    798798      ySmallMap + 24 * (ZoomArea mod 3), xSmallMap + 48 * (ZoomArea div 3) + 49,
    799       ySmallMap + 24 * (ZoomArea mod 3) + 25, MainTexture.clMark,
    800       MainTexture.clMark);
     799      ySmallMap + 24 * (ZoomArea mod 3) + 25, MainTexture.ColorMark,
     800      MainTexture.ColorMark);
    801801  Frame(offscreen.Canvas, xSmallMap - 1, ySmallMap - 1, xSmallMap + wSmallMap,
    802802    ySmallMap + hSmallMap, $B0B0B0, $FFFFFF);
     
    810810  x := xSupport + wSupport div 2;
    811811  y := ySupport + hSupport div 2;
    812   if Mode = mSupp then
    813   begin
    814     offscreen.Canvas.brush.Color := MainTexture.clMark;
     812  if SmallMapMode = smSupportedUnits then
     813  begin
     814    offscreen.Canvas.brush.Color := MainTexture.ColorMark;
    815815    offscreen.Canvas.FillRect(Rect(x - 27, y - 6, x + 27, y + 6));
    816816    offscreen.Canvas.brush.style := bsClear;
     
    825825  for i := 0 to 5 do
    826826    imix[i] := -1;
    827   if Mode = mImp then
     827  if SmallMapMode = smImprovements then
    828828  begin
    829829    if ZoomArea = 5 then
     
    917917      Imp5Area.Hint := '';
    918918  end
    919   else { if mode=mSupp then }
     919  else { if SmallMapMode = smSupportedUnits then }
    920920  begin
    921921    LoweredTextout(offscreen.Canvas, -1, MainTexture, xZoomMap + 6,
     
    934934            y := ((Cnt - 6 * Page) div 3) * 52 + yZoomMap + 20;
    935935            MakeUnitInfo(me, MyUn[i], UnitInfo);
    936             AreaMap.SetOutput(offscreen);
    937             AreaMap.PaintUnit(x, y, UnitInfo, MyUn[i].Status);
     936            NoMap.SetOutput(offscreen);
     937            NoMap.PaintUnit(x, y, UnitInfo, MyUn[i].Status);
    938938
    939939            for j := 0 to UnitReport.FoodSupport - 1 do
     
    10481048  else { enemy city }
    10491049  begin
    1050     Mode := mImp;
     1050    SmallMapMode := smImprovements;
    10511051    Server(sGetCity, me, cLoc, GetCityData);
    10521052    c := GetCityData.c;
     
    11461146    (y >= ySmallMap) and (y < ySmallMap + hSmallMap) then
    11471147  begin
    1148     Mode := mImp;
     1148    SmallMapMode := smImprovements;
    11491149    ZoomArea := (y - ySmallMap) * 3 div hSmallMap + 3 *
    11501150      ((x - xSmallMap) * 2 div wSmallMap);
     
    11571157    (y >= ySupport) and (y < ySupport + hSupport) then
    11581158  begin
    1159     Mode := mSupp;
     1159    SmallMapMode := smSupportedUnits;
    11601160    Page := 0;
    11611161    InitZoomCityMap;
     
    11891189        ChooseProject;
    11901190      end
    1191     else if (Mode = mImp) and (x >= xZoomMap) and (x < xZoomMap + wZoomMap) and
     1191    else if (SmallMapMode = smImprovements) and (x >= xZoomMap) and (x < xZoomMap + wZoomMap) and
    11921192      (y >= yZoomMap) and (y < yZoomMap + hZoomMap) then
    11931193    begin
     
    12031203        if iix >= 0 then
    12041204          if ssShift in Shift then
    1205             HelpDlg.ShowNewContent(Mode or wmPersistent, hkImp, iix)
     1205            HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkImp, iix)
    12061206          else if (ClientMode < scContact) then
    12071207            with MessgExDlg do
     
    13001300      end;
    13011301    end
    1302     else if (Mode = mSupp) and (x >= xZoomMap) and (x < xZoomMap + wZoomMap) and
     1302    else if (SmallMapMode = smSupportedUnits) and (x >= xZoomMap) and (x < xZoomMap + wZoomMap) and
    13031303      (y >= yZoomMap) and (y < yZoomMap + hZoomMap) then
    13041304    begin
     
    13211321    else if (x >= xmArea - 192) and (x < xmArea + 192) and (y >= ymArea - 96)
    13221322      and (y < ymArea + 96) then
    1323     with AreaMap do
    1324     begin
     1323    with AreaMap do begin
    13251324      qx := ((4000 * xxt * yyt) + (x - xmArea) * (yyt * 2) + (y - ymArea + yyt)
    13261325        * (xxt * 2)) div (xxt * yyt * 4) - 1000;
     
    13351334          Loc1 := dLoc(cLoc, dx, dy);
    13361335          if (Loc1 >= 0) and (Loc1 < G.lx * G.ly) then
    1337             HelpOnTerrain(Loc1, Mode or wmPersistent)
     1336            HelpOnTerrain(Loc1, FWindowMode or wmPersistent)
    13381337        end
    13391338        else if (ClientMode < scContact) and (cGov <> gAnarchy) and
  • branches/highdpi/LocalPlayer/CityType.pas

    r349 r361  
    6363  inherited;
    6464  CaptionRight := CloseBtn.Left;
    65   InitButtons();
     65  InitButtons;
    6666  HelpContext := 'MACRO';
    6767  Caption := Phrases.Lookup('TITLE_CITYTYPES');
     
    7171procedure TCityTypeDlg.CloseBtnClick(Sender: TObject);
    7272begin
    73   Close
     73  Close;
    7474end;
    7575
     
    9393
    9494  Frame(offscreen.Canvas, 0, yList + 32 * nListRow, InnerWidth - 255,
    95     yPool - 23, MainTexture.clBevelLight, MainTexture.clBevelShade);
     95    yPool - 23, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    9696  Frame(offscreen.Canvas, InnerWidth - 254, yList + 32 * nListRow,
    97     InnerWidth - 89, yPool - 23, MainTexture.clBevelLight,
    98     MainTexture.clBevelShade);
     97    InnerWidth - 89, yPool - 23, MainTexture.ColorBevelLight,
     98    MainTexture.ColorBevelShade);
    9999  Frame(offscreen.Canvas, InnerWidth - 88, yList + 32 * nListRow,
    100     InnerWidth - 1, yPool - 23, MainTexture.clBevelLight,
    101     MainTexture.clBevelShade);
     100    InnerWidth - 1, yPool - 23, MainTexture.ColorBevelLight,
     101    MainTexture.ColorBevelShade);
    102102  Frame(offscreen.Canvas, 0, yPool - 22, InnerWidth - 1, yPool - 1,
    103     MainTexture.clBevelLight, MainTexture.clBevelShade);
     103    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    104104  for i := 0 to nCityType - 1 do
    105105  begin
    106106    RFrame(offscreen.Canvas, xSwitch + i * 42, ySwitch, xSwitch + 39 + i * 42,
    107       ySwitch + 23, MainTexture.clBevelShade, MainTexture.clBevelLight);
     107      ySwitch + 23, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    108108    if i = ctype then
    109109      Frame(offscreen.Canvas, xSwitch + 1 + i * 42, ySwitch + 1,
    110         xSwitch + 38 + i * 42, ySwitch + 22, MainTexture.clBevelShade,
    111         MainTexture.clBevelLight)
     110        xSwitch + 38 + i * 42, ySwitch + 22, MainTexture.ColorBevelShade,
     111        MainTexture.ColorBevelLight)
    112112    else
    113113      Frame(offscreen.Canvas, xSwitch + 1 + i * 42, ySwitch + 1,
    114         xSwitch + 38 + i * 42, ySwitch + 22, MainTexture.clBevelLight,
    115         MainTexture.clBevelShade);
     114        xSwitch + 38 + i * 42, ySwitch + 22, MainTexture.ColorBevelLight,
     115        MainTexture.ColorBevelShade);
    116116    DpiBitCanvas(offscreen.Canvas, xSwitch + 2 + i * 42, ySwitch + 2,
    117117      xSizeSmall, ySizeSmall, SmallImp.Canvas, (i + 3) * xSizeSmall, 0);
     
    130130    for i := 1 to nListRow - 1 do
    131131      DLine(offscreen.Canvas, xList - 5, xList + 4 + 42 * nListCol,
    132         yList - 1 + 32 * i, MainTexture.clBevelLight, MainTexture.clBevelShade);
     132        yList - 1 + 32 * i, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    133133    for i := 0 to nListCol * nListRow - 1 do
    134134    begin
    135135      s := IntToStr(i + 1);
    136       Font.Color := MainTexture.clTextLight;
     136      Font.Color := MainTexture.ColorTextLight;
    137137      Textout(xList + 20 + i mod nListCol * 42 - TextWidth(s) div 2,
    138138        yList + 15 + i div nListCol * 32 - TextHeight(s) div 2, s);
    139     end
     139    end;
    140140  end;
    141141
     
    147147      xList + 21 + xSizeSmall div 2 + i mod nListCol * 42,
    148148      yList + 16 + ySizeSmall div 2 + i div nListCol * 32,
    149       MainTexture.clBevelLight, MainTexture.clBevelShade);
     149      MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    150150    DpiBitCanvas(offscreen.Canvas, xList + 21 - xSizeSmall div 2 +
    151151      i mod nListCol * 42, yList + 16 - ySizeSmall div 2 + i div nListCol * 32,
     
    169169        nPool div nPoolCol * 32, xPool + 21 + xSizeSmall div 2 +
    170170        nPool mod nPoolCol * 42, yPool + 16 + ySizeSmall div 2 +
    171         nPool div nPoolCol * 32, MainTexture.clBevelLight,
    172         MainTexture.clBevelShade);
     171        nPool div nPoolCol * 32, MainTexture.ColorBevelLight,
     172        MainTexture.ColorBevelShade);
    173173      DpiBitCanvas(offscreen.Canvas, xPool + 21 - xSizeSmall div 2 +
    174174        nPool mod nPoolCol * 42, yPool + 16 - ySizeSmall div 2 +
     
    201201  begin
    202202    include(listed, MyData.ImpOrder[ctype, i]);
    203     inc(i)
    204   end;
    205   Changed := false
     203    inc(i);
     204  end;
     205  Changed := false;
    206206end;
    207207
     
    215215      if (MyCity[cix].Loc >= 0) and (MyCity[cix].Status and 7 = ctype + 1) then
    216216        AutoBuild(cix, MyData.ImpOrder[ctype]);
    217     Changed := false
     217    Changed := false;
    218218  end;
    219219end;
     
    252252      dragiix := MyData.ImpOrder[ctype, i];
    253253      DpiScreen.Cursor := crImpDrag;
    254       SmartUpdateContent
     254      SmartUpdateContent;
    255255    end;
    256256    exit;
     
    268268      dragiix := Pooliix[i];
    269269      DpiScreen.Cursor := crImpDrag;
    270       SmartUpdateContent
     270      SmartUpdateContent;
    271271    end;
    272272    exit;
     
    279279    SaveType;
    280280    LoadType(i);
    281     SmartUpdateContent
    282   end
     281    SmartUpdateContent;
     282  end;
    283283end;
    284284
     
    318318      MyData.ImpOrder[ctype, i] := dragiix;
    319319      include(listed, dragiix);
    320       Changed := true
     320      Changed := true;
    321321    end
    322322    else if (dragiix in listed) and (x >= xPool) and (x < xPool + nPoolCol * 42)
     
    324324    begin
    325325      UnList(dragiix);
    326       Changed := true
     326      Changed := true;
    327327    end;
    328328    dragiix := -1;
    329     SmartUpdateContent
    330   end;
    331   DpiScreen.Cursor := crDefault
     329    SmartUpdateContent;
     330  end;
     331  DpiScreen.Cursor := crDefault;
    332332end;
    333333
  • branches/highdpi/LocalPlayer/ClientTools.pas

    r349 r361  
    201201  i: integer;
    202202begin
    203   if p = me then
    204   begin
     203  if p = me then begin
    205204    Result := 0;
    206205    for i := 1 to 3 do
    207206      if MyRO.Tech[AgePreq[i]] >= tsApplicable then
    208207        Result := i;
    209   end
    210   else
    211   begin
     208  end else begin
    212209    Result := 0;
    213210    for i := 1 to 3 do
  • branches/highdpi/LocalPlayer/Diagram.pas

    r349 r361  
    6363  Canvas.Brush.Style := bsClear;
    6464    ScreenTools.Frame(canvas, Left - 1, Top - 1, Left + Width, Top + 200,
    65       MainTexture.clBevelShade, MainTexture.clBevelLight);
     65      MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    6666    RFrame(canvas, Left - 2, Top - 2, Left + Width + 1, Top + 200 + 1,
    67       MainTexture.clBevelShade, MainTexture.clBevelLight);
     67      MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    6868
    6969    // stars
     
    132132  CaptionRight := CloseBtn.Left;
    133133  CaptionLeft := ToggleBtn.Left + ToggleBtn.Width;
    134   InitButtons();
     134  InitButtons;
    135135end;
    136136
     
    163163  begin
    164164    LoweredTextOut(offscreen.canvas, -1, MainTexture, x - 2, y, Cap);
    165     DLine(offscreen.canvas, x - 2, x + 169, y + 16, MainTexture.clTextShade,
    166       MainTexture.clTextLight);
     165    DLine(offscreen.canvas, x - 2, x + 169, y + 16, MainTexture.ColorTextShade,
     166      MainTexture.ColorTextLight);
    167167    if val0 > 0 then
    168168      s := Format(Phrases.Lookup('SHARE'), [val0, val1])
  • branches/highdpi/LocalPlayer/Draft.pas

    r349 r361  
    6868begin
    6969  inherited;
    70   InitButtons();
     70  InitButtons;
    7171  HelpContext := 'CLASSES';
    7272  Caption := Phrases.Lookup('TITLE_DRAFT');
     
    183183        Phrases.Lookup('UNITSPEED'));
    184184      DLine(offscreen.Canvas, xTotal - 2, xTotal + 174, y + 16,
    185         MainTexture.clBevelShade, MainTexture.clBevelLight);
     185        MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    186186      DLine(offscreen.Canvas, xTotal2 + 176, xTotal2 + 263, y + 16,
    187         MainTexture.clBevelShade, MainTexture.clBevelLight);
     187        MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    188188      s := MovementToString(MyRO.DevModel.Speed);
    189189      RisedTextOut(offscreen.Canvas, xTotal2 + 170 + 64 + 30 -
     
    199199        xTotal2 + 148 + 30, y, '=');
    200200      DLine(offscreen.Canvas, xTotal - 2, xTotal + 174, y + 16,
    201         MainTexture.clBevelShade, MainTexture.clBevelLight);
     201        MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    202202      DLine(offscreen.Canvas, xTotal2 + 176, xTotal2 + 263, y + 16,
    203         MainTexture.clBevelShade, MainTexture.clBevelLight);
     203        MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    204204      s := IntToStr(MyRO.DevModel.Cost);
    205205      RisedTextOut(offscreen.Canvas, xTotal2 + 170 + 64 + 30 - 12 -
     
    216216          xTotal2 + 148 + 30, y, '=');
    217217        DLine(offscreen.Canvas, xTotal - 2, xTotal + 174, y + 16,
    218           MainTexture.clBevelShade, MainTexture.clBevelLight);
     218          MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    219219        DLine(offscreen.Canvas, xTotal2 + 176, xTotal2 + 263, y + 16,
    220           MainTexture.clBevelShade, MainTexture.clBevelLight);
     220          MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    221221        s := IntToStr(MyRO.DevModel.Cost * BuildCostMod
    222222          [G.Difficulty[me]] div 12);
     
    236236
    237237  ClientHeight := Template.Height - Cut;
    238   if ClientHeight > hMainTexture then
     238  if ClientHeight > MainTexture.Height then
    239239  // assemble background from 2 texture tiles
    240240  begin
    241241    DpiBitCanvas(Back.Canvas, 0, 0, ClientWidth, 64,
    242       MainTexture.Image.Canvas, (wMainTexture - ClientWidth) div 2,
    243       hMainTexture - 64);
     242      MainTexture.Image.Canvas, (MainTexture.Width - ClientWidth) div 2,
     243      MainTexture.Height - 64);
    244244    DpiBitCanvas(Back.Canvas, 0, 64, ClientWidth, ClientHeight - 64,
    245       MainTexture.Image.Canvas, (wMainTexture - ClientWidth) div 2,
     245      MainTexture.Image.Canvas, (MainTexture.Width - ClientWidth) div 2,
    246246      0);
    247247  end
    248248  else
    249249    DpiBitCanvas(Back.Canvas, 0, 0, ClientWidth, ClientHeight,
    250       MainTexture.Image.Canvas, (wMainTexture - ClientWidth) div 2,
    251       (hMainTexture - ClientHeight) div 2);
     250      MainTexture.Image.Canvas, (MainTexture.Width - ClientWidth) div 2,
     251      (MainTexture.Height - ClientHeight) div 2);
    252252  ImageOp_B(Back, Template, 0, 0, 0, 0, Template.Width, 64);
    253253  ImageOp_B(Back, Template, 0, 64, 0, 64 + Cut, Template.Width,
     
    320320            RFrame(offscreen.Canvas, xFeature - (21 + 1),
    321321              yFeature + 2 + LinePitch * i - 1, xFeature - (21 - 24),
    322               yFeature + 2 + LinePitch * i + 12, MainTexture.clBevelShade,
    323               MainTexture.clBevelLight);
     322              yFeature + 2 + LinePitch * i + 12, MainTexture.ColorBevelShade,
     323              MainTexture.ColorBevelLight);
    324324          end
    325325          else
     
    329329            RFrame(offscreen.Canvas, xFeature - (9 + 1),
    330330              yFeature + 2 + LinePitch * i - 1, xFeature - (21 - 24),
    331               yFeature + 2 + LinePitch * i + 12, MainTexture.clBevelShade,
    332               MainTexture.clBevelLight);
     331              yFeature + 2 + LinePitch * i + 12, MainTexture.ColorBevelShade,
     332              MainTexture.ColorBevelLight);
    333333          end;
    334334
     
    362362
    363363        if MyRO.DevModel.Cap[code[i]] > 0 then
    364           TextColor := MainTexture.clLitText
     364          TextColor := MainTexture.ColorLitText
    365365        else
    366366          TextColor := -1;
  • branches/highdpi/LocalPlayer/Enhance.pas

    r349 r361  
    6565  CaptionRight := CloseBtn.Left;
    6666  CaptionLeft := ToggleBtn.Left + ToggleBtn.Width;
    67   InitButtons();
     67  InitButtons;
    6868  HelpContext := 'MACRO';
    6969  Caption := Phrases.Lookup('TITLE_ENHANCE');
  • branches/highdpi/LocalPlayer/Help.pas

    r349 r361  
    301301  CaptionFont.Assign(UniFont[ftNormal]);
    302302  CaptionFont.Style := CaptionFont.Style + [fsItalic, fsBold];
    303   InitButtons();
     303  InitButtons;
    304304
    305305  TopBtn.Hint := Phrases.Lookup('BTN_CONTENTS');
     
    12481248          MainText[Count - 1] := Format(HelpText.Lookup('REQUIRED'),
    12491249            [MainText[Count - 1]]);
    1250         end
     1250        end;
    12511251      end;
    1252     end
     1252    end;
    12531253  end;
    12541254
     
    14221422                    LineFeed;
    14231423                    LineFeed;
    1424                   end
    1425                 end
     1424                  end;
     1425                end;
    14261426              end;
    14271427            miscSearchResult:
     
    16421642                NextSection('REPLACE');
    16431643                AddItem('REPLACETEXT');
    1644                 j := 1
     1644                j := 1;
    16451645              end;
    16461646              AddImprovement(ImpReplacement[i].OldImp);
     
    16761676            AddLine(HelpText.Lookup('HELPTITLE_JOBLIST'), pkNormal, 0,
    16771677              hkMisc + hkCrossLink, miscJobList);
    1678           CheckSeeAlso := true
     1678          CheckSeeAlso := true;
    16791679        end;
    16801680
     
    16961696          begin
    16971697            TerrType := fDesert;
    1698             TerrSubType := 0
     1698            TerrSubType := 0;
    16991699          end;
    17001700          with Terrain[TerrType] do
     
    17661766                  [Phrases.Lookup('TERRAIN', fGrass + 12)]), pkTer, fGrass + 12,
    17671767                  hkTer + hkCrossLink, fGrass + 12);
    1768               end
     1768              end;
    17691769            end;
    17701770            NextSection('SPECIAL');
     
    17781778                AddLine(Phrases.Lookup('TERRAIN', 3 * 12 + Special), pkTer,
    17791779                  3 * 12 + Special);
    1780               end
     1780              end;
    17811781            end
    17821782            else if (no < 12) and (no <> fGrass) and (no <> fOcean) then
     
    18141814              AddImprovement(woGardens);
    18151815              CheckSeeAlso := true
    1816             end
    1817           end
     1816            end;
     1817          end;
    18181818        end;
    18191819
     
    18821882                AddLine(Format(HelpText.Lookup('WEIGHT'), ['+2']),
    18831883                  pkDomain, dGround);
    1884             end
     1884            end;
    18851885          end;
    18861886          if Feature[no].Preq <> preNone then
     
    19691969      Line(Canvas, Sel0, False);
    19701970    if Sel <> -1 then
    1971       Line(Canvas, Sel, True)
    1972   end
     1971      Line(Canvas, Sel, True);
     1972  end;
    19731973end;
    19741974
     
    19921992        else
    19931993          ShowNewContent(FWindowMode, Link shr 8 and $3F, Link and $FF);
    1994       end
     1994      end;
    19951995end;
    19961996
     
    20362036function THelpDlg.TextIndex(Item: string): Integer;
    20372037begin
    2038   Result := HelpText.Gethandle(Item)
     2038  Result := HelpText.Gethandle(Item);
    20392039end;
    20402040
  • branches/highdpi/LocalPlayer/LocalPlayer.pas

    r210 r361  
    55
    66procedure Client(Command, Player: integer; var Data); stdcall;
    7 
    87procedure SetAIName(p: integer; Name: string);
    98
     
    1211uses
    1312  UDpiControls, Term, CityScreen, Draft, MessgEx, Select, CityType, Help, UnitStat, Diagram,
    14   NatStat, Wonders, Nego, Enhance, BaseWin, Battle, Rates, TechTree,
    15 
    16   Forms;
     13  NatStat, Wonders, Nego, Enhance, BaseWin, Battle, Rates, TechTree, Forms;
    1714
    1815var
  • branches/highdpi/LocalPlayer/MessgEx.pas

    r349 r361  
    1010
    1111type
     12  TMessageIconKind = (mikNone, mikImp, mikModel, mikTribe, mikBook, mikAge,
     13    mikPureIcon, mikMyArmy, mikEnemyArmy, mikFullControl, mikShip, mikBigIcon,
     14    mikEnemyShipComplete);
     15
    1216  TMessgExDlg = class(TBaseMessgDlg)
    1317    Button1: TButtonA;
     
    2630    procedure RemoveBtnClick(Sender: TObject);
    2731  public
    28     Kind, IconKind, IconIndex, HelpKind, HelpNo, CenterTo: integer;
     32    Kind: TMessageKind;
     33    IconIndex: Integer;
     34    HelpKind: Integer;
     35    HelpNo: Integer;
     36    CenterTo: Integer;
     37    IconKind: TMessageIconKind;
    2938    OpenSound: string;
    3039    function ShowModal: integer; override;
     
    3847  end;
    3948
    40 const
    41   // extra message kinds
    42   mkYesNoCancel = 4;
    43   mkOkCancelRemove = 5;
    44   mkOkHelp = 6;
    45   mkModel = 7;
    46 
    47   // message icon kinds
    48   mikNone = -1;
    49   mikImp = 0;
    50   mikModel = 1;
    51   mikTribe = 2;
    52   mikBook = 3;
    53   mikAge = 4;
    54   mikPureIcon = 5;
    55   mikMyArmy = 6;
    56   mikEnemyArmy = 7;
    57   mikFullControl = 8;
    58   mikShip = 9;
    59   mikBigIcon = 10;
    60   mikEnemyShipComplete = 11;
    61 
    6249var
    6350  MessgExDlg: TMessgExDlg;
     
    6552procedure SoundMessageEx(SimpleText, SoundItem: string);
    6653procedure TribeMessage(p: integer; SimpleText, SoundItem: string);
    67 function SimpleQuery(QueryKind: integer; SimpleText, SoundItem: string)
     54function SimpleQuery(QueryKind: TMessageKind; SimpleText, SoundItem: string)
    6855  : integer;
    6956procedure ContextMessage(SimpleText, SoundItem: string;
     
    199186function TMessgExDlg.ShowModal: integer;
    200187var
    201   Ticks0, Ticks: TDateTime;
     188  Ticks0: TDateTime;
     189  Ticks: TDateTime;
    202190begin
    203191  if GameMode = cMovie then
     
    357345  if (IconKind = mikImp) and (IconIndex = 27) then
    358346  begin // "YOU WIN" message
    359     clSaveTextLight := MainTexture.clTextLight;
    360     clSaveTextShade := MainTexture.clTextShade;
    361     MainTexture.clTextLight := $000000; // gold
    362     MainTexture.clTextShade := $0FDBFF;
     347    clSaveTextLight := MainTexture.ColorTextLight;
     348    clSaveTextShade := MainTexture.ColorTextShade;
     349    MainTexture.ColorTextLight := $000000; // gold
     350    MainTexture.ColorTextShade := $0FDBFF;
    363351    inherited;
    364     MainTexture.clTextLight := clSaveTextLight;
    365     MainTexture.clTextShade := clSaveTextShade;
     352    MainTexture.ColorTextLight := clSaveTextLight;
     353    MainTexture.ColorTextShade := clSaveTextShade;
    366354  end
    367355  else
     
    411399      end;
    412400    mikBook:
    413       PaintBook(Canvas, ClientWidth div 2, 24, MainTexture.clPage,
    414         MainTexture.clCover);
     401      PaintBook(Canvas, ClientWidth div 2, 24, MainTexture.ColorPage,
     402        MainTexture.ColorCover);
    415403    mikTribe:
    416404      if Assigned(Tribe[IconIndex].faceHGr) then
     
    516504end;
    517505
    518 function SimpleQuery(QueryKind: integer; SimpleText, SoundItem: string)
     506function SimpleQuery(QueryKind: TMessageKind; SimpleText, SoundItem: string)
    519507  : integer;
    520508begin
     
    524512    OpenSound := SoundItem;
    525513    Kind := QueryKind;
    526     DpiApplication.ProcessMessages; // TODO: Needed for Gtk2, Lazarus gtk2 bug?
    527514    ShowModal;
    528515    result := ModalResult;
  • branches/highdpi/LocalPlayer/NatStat.pas

    r349 r361  
    8181  GetMem(SelfReport, SizeOf(TEnemyReport) - 2 * (INFIN + 1));
    8282  ReportText := TStringList.Create;
    83   InitButtons();
     83  InitButtons;
    8484  ContactBtn.Template := Templates.Data;
    8585  HelpContext := 'DIPLOMACY';
     
    107107procedure TNatStatDlg.CheckAge;
    108108begin
    109   if MainTextureAge <> AgePrepared then
    110   begin
    111     AgePrepared := MainTextureAge;
     109  if MainTexture.Age <> AgePrepared then begin
     110    AgePrepared := MainTexture.Age;
    112111    DpiBitCanvas(Back.Canvas, 0, 0, ClientWidth, ClientHeight,
    113       MainTexture.Image.Canvas, (wMainTexture - ClientWidth) div 2,
    114       (hMainTexture - ClientHeight) div 2);
     112      MainTexture.Image.Canvas, (MainTexture.Width - ClientWidth) div 2,
     113      (MainTexture.Height - ClientHeight) div 2);
    115114    ImageOp_B(Back, Template, 0, 0, 0, 0, ClientWidth, ClientHeight);
    116115  end;
     
    358357      with Canvas do
    359358      begin
    360         Brush.Color := MainTexture.clBevelShade;
     359        Brush.Color := MainTexture.ColorBevelShade;
    361360        FillRect(Rect(xReport + wReport, yReport + PaperShade,
    362361          xReport + wReport + PaperShade, yReport + hReport + PaperShade));
  • branches/highdpi/LocalPlayer/Nego.pas

    r349 r361  
    144144  cix: integer;
    145145begin
    146   InitButtons();
     146  InitButtons;
    147147  for cix := 0 to ComponentCount - 1 do
    148148    if Components[cix] is TButtonN then
     
    510510
    511511  Fill(Offscreen.Canvas, 3, 3, ClientWidth - 6, ClientHeight - 6,
    512     (wMaintexture - ClientWidth) div 2, (hMaintexture - ClientHeight) div 2);
     512    (Maintexture.Width - ClientWidth) div 2, (Maintexture.Height - ClientHeight) div 2);
    513513  Frame(Offscreen.Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0);
    514514  Frame(Offscreen.Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2,
    515     MainTexture.clBevelLight, MainTexture.clBevelShade);
     515    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    516516  Frame(Offscreen.Canvas, 2, 2, ClientWidth - 3, ClientHeight - 3,
    517     MainTexture.clBevelLight, MainTexture.clBevelShade);
     517    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    518518  Corner(Offscreen.Canvas, 1, 1, 0, MainTexture);
    519519  Corner(Offscreen.Canvas, ClientWidth - 9, 1, 1, MainTexture);
     
    565565  with Offscreen.Canvas do
    566566  begin
    567     Brush.Color := MainTexture.clBevelShade;
     567    Brush.Color := MainTexture.ColorBevelShade;
    568568    if History[me].Text[Page - 1] <> '' then
    569569    begin
  • branches/highdpi/LocalPlayer/Rates.pas

    r349 r361  
    4242begin
    4343  TitleHeight := DpiScreen.Height;
    44   InitButtons();
     44  InitButtons;
    4545end;
    4646
     
    5656
    5757  Fill(Offscreen.Canvas, 0, 0, ClientWidth, ClientHeight,
    58     (wMaintexture - ClientWidth) div 2, (hMaintexture - ClientHeight) div 2);
     58    (Maintexture.Width - ClientWidth) div 2, (Maintexture.Height - ClientHeight) div 2);
    5959  Frame(Offscreen.Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0);
    6060  Frame(Offscreen.Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2,
    61     MainTexture.clBevelLight, MainTexture.clBevelShade);
     61    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    6262  Frame(Offscreen.Canvas, 2, 2, ClientWidth - 3, ClientHeight - 3,
    63     MainTexture.clBevelLight, MainTexture.clBevelShade);
     63    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    6464
    6565  BtnFrame(Offscreen.Canvas, CloseBtn.BoundsRect, MainTexture);
     
    118118    Frame(Offscreen.Canvas, x - 1, y - 1, x + max, y + 7, $000000, $000000);
    119119    RFrame(Offscreen.Canvas, x - 2, y - 2, x + max + 1, y + 8,
    120       MainTexture.clBevelShade, MainTexture.clBevelLight);
     120      MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    121121    with Offscreen.Canvas do
    122122    begin
     
    138138      MyRO.LuxRate * 120 div 100, 0, 120, MainTexture);
    139139    RFrame(Offscreen.Canvas, ScienceBtn.Left - 1, LuxBtn.Top - 1,
    140       LuxBtn.Left + 12, LuxBtn.Top + 12, MainTexture.clBevelShade,
    141       MainTexture.clBevelLight);
    142   end;
    143 
    144   DLine(Offscreen.Canvas, 1, ClientWidth - 2, 154, MainTexture.clBevelShade,
    145     MainTexture.clBevelLight);
     140      LuxBtn.Left + 12, LuxBtn.Top + 12, MainTexture.ColorBevelShade,
     141      MainTexture.ColorBevelLight);
     142  end;
     143
     144  DLine(Offscreen.Canvas, 1, ClientWidth - 2, 154, MainTexture.ColorBevelShade,
     145    MainTexture.ColorBevelLight);
    146146  RisedTextOut(Offscreen.Canvas, 16 + 80, 164, Phrases.Lookup('TAXRATE'));
    147147  s := Format('%d%%', [MyRO.TaxRate]);
     
    151151    MyRO.TaxRate * 120 div 100, 0, 120, MainTexture);
    152152  RFrame(Offscreen.Canvas, TaxUpBtn.Left - 1, TaxUpBtn.Top - 1,
    153     TaxUpBtn.Left + 12, TaxDownBtn.Top + 12, MainTexture.clBevelShade,
    154     MainTexture.clBevelLight);
     153    TaxUpBtn.Left + 12, TaxDownBtn.Top + 12, MainTexture.ColorBevelShade,
     154    MainTexture.ColorBevelLight);
    155155
    156156  MarkUsedOffscreen(ClientWidth, ClientHeight);
     
    206206    SmartUpdateContent;
    207207    MainScreen.UpdateViews(true);
    208   end
     208  end;
    209209end;
    210210
  • branches/highdpi/LocalPlayer/Select.pas

    r349 r361  
    112112  Canvas.Font.Assign(UniFont[ftNormal]);
    113113  sb := TPVScrollbar.Create(Self);
     114  sb.SetBorderSpacing(36, 10, 36);
    114115  sb.OnUpdate := ScrollBarUpdate;
    115   InitButtons();
     116  InitButtons;
    116117  Kind := kMission;
    117118  Layer0Btn.Hint := Phrases.Lookup('BTN_IMPRS');
     
    201202    begin
    202203      Frame(offscreen.Canvas, x + (16 - 1), y + (16 - 2), x + (16 + xSizeSmall),
    203         y + (16 - 1 + ySizeSmall), MainTexture.clBevelLight,
    204         MainTexture.clBevelShade);
     204        y + (16 - 1 + ySizeSmall), MainTexture.ColorBevelLight,
     205        MainTexture.ColorBevelShade);
    205206      if pix and cpType = 0 then
    206207        if (pix and cpIndex = imPalace) and (MyRO.Government <> gAnarchy) then
     
    230231      if y + TextSize.cy >= TitleHeight + InnerHeight then
    231232        TextSize.cy := TitleHeight + InnerHeight - y;
    232       Fill(ca, x, y, TextSize.cx, TextSize.cy, (wMaintexture - ClientWidth)
    233         div 2, (hMaintexture - ClientHeight) div 2);
     233      Fill(ca, x, y, TextSize.cx, TextSize.cy, (Maintexture.Width - ClientWidth)
     234        div 2, (Maintexture.Height - ClientHeight) div 2);
    234235    end;
    235236    LoweredTextOut(ca, Color, MainTexture, x, y, s);
     
    259260      begin
    260261        x := x + SideFrame;
    261         y := y + TitleHeight
     262        y := y + TitleHeight;
    262263      end;
    263264      if lit then
    264         TextColor := MainTexture.clLitText
     265        TextColor := MainTexture.ColorLitText
    265266      else
    266267        TextColor := -1;
     
    433434    end;
    434435    if lit then
    435       TextColor := MainTexture.clLitText
     436      TextColor := MainTexture.ColorLitText
    436437    else
    437438      TextColor := -1;
     
    555556              begin
    556557                Frame(offscreen.Canvas, (8 + 16 - 1), y0 - 1, (8 + 16 + 36),
    557                   y0 + 20, MainTexture.clBevelLight, MainTexture.clBevelShade);
     558                  y0 + 20, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    558559                Dump(offscreen, HGrSystem, (8 + 16), y0, 36, 20, 223, 295)
    559560              end
     
    561562              begin
    562563                Frame(offscreen.Canvas, (8 + 16 - 1), y0 - 1, (8 + 16 + 36),
    563                   y0 + 20, MainTexture.clBevelLight, MainTexture.clBevelShade);
     564                  y0 + 20, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    564565                Dump(offscreen, HGrSystem, (8 + 16), y0, 36, 20, 260, 295)
    565566              end
     
    567568              begin
    568569                Frame(offscreen.Canvas, (8 + 16 - 1), y0 - 1, (8 + 16 + 36),
    569                   y0 + 20, MainTexture.clBevelLight, MainTexture.clBevelShade);
     570                  y0 + 20, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    570571                Dump(offscreen, HGrSystem, (8 + 16), y0, 36, 20, 38, 295)
    571572              end
     
    574575                Frame(offscreen.Canvas, (8 + 16 - 1), y0 - 1,
    575576                  (8 + 16 + xSizeSmall), y0 + ySizeSmall,
    576                   MainTexture.clBevelLight, MainTexture.clBevelShade);
     577                  MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    577578                if AdvIcon[lix] < 84 then
    578579                  DpiBitCanvas(offscreen.Canvas, (8 + 16), y0, xSizeSmall,
     
    680681            Frame(offscreen.Canvas, 8 + 16 - 1, y0 - 15 + (16 - 2),
    681682              8 + 16 + xSizeSmall, y0 - 15 + (16 - 1 + ySizeSmall),
    682               MainTexture.clBevelLight, MainTexture.clBevelShade);
     683              MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    683684            DpiBitCanvas(offscreen.Canvas, 8 + 16, y0 - 15 + (16 - 1),
    684685              xSizeSmall, ySizeSmall, SmallImp.Canvas,
     
    711712    end;
    712713    if lit then
    713       TextColor := MainTexture.clLitText
     714      TextColor := MainTexture.ColorLitText
    714715    else
    715716      TextColor := -1;
     
    811812    begin
    812813      Fill(Canvas, 9, ClientHeight - 29, ClientWidth - 18, 24,
    813         (wMaintexture - ClientWidth) div 2,
    814         (hMaintexture - ClientHeight) div 2);
     814        (Maintexture.Width - ClientWidth) div 2,
     815        (Maintexture.Height - ClientHeight) div 2);
    815816      if ScienceNation >= 0 then
    816817      begin
     
    828829          ScienceNationDot.Height, Canvas, xScreen - 10, ClientHeight - 27);
    829830        ImageOp_BCC(ScienceNationDotBuffer, Templates.Data, Point(0, 0),
    830           ScienceNationDot.BoundsRect, MainTexture.clBevelShade, Tribe[ScienceNation].Color);
     831          ScienceNationDot.BoundsRect, MainTexture.ColorBevelShade, Tribe[ScienceNation].Color);
    831832        DpiBitCanvas(Canvas, xScreen - 10, ClientHeight - 27, ScienceNationDot.Width,
    832833          ScienceNationDot.Height, ScienceNationDotBuffer.Canvas, 0, 0);
     
    15311532  begin
    15321533    LineDistance := 21; // looks ugly with scrollbar
    1533     MaxLines := (hMaintexture - (24 + TitleHeight + NarrowFrame))
     1534    MaxLines := (Maintexture.Height - (24 + TitleHeight + NarrowFrame))
    15341535      div LineDistance - 1;
    15351536  end
     
    15371538  begin
    15381539    LineDistance := 24;
    1539     MaxLines := (hMaintexture - (24 + TitleHeight + WideFrame))
     1540    MaxLines := (Maintexture.Height - (24 + TitleHeight + WideFrame))
    15401541      div LineDistance - 1;
    15411542  end;
     
    15511552  if (Kind = kAdvance) and (MyData.FarTech <> adNone) or (Kind = kModels) or
    15521553    (Kind = kEModels) then begin
     1554    sb.SetBorderSpacing(56, 10, 10);
    15531555    TitleHeight := WideFrame + 20;
    1554     sb.SetBorderSpacing(56, 10, 10);
    15551556  end else begin
     1557    sb.SetBorderSpacing(36, 10, 34);
    15561558    TitleHeight := WideFrame;
    1557     sb.SetBorderSpacing(36, 10, 34);
    15581559  end;
    15591560
     
    15761577    ClientHeight := InnerHeight + TitleHeight + NarrowFrame;
    15771578  end;
    1578   assert(ClientHeight <= hMaintexture);
     1579  assert(ClientHeight <= Maintexture.Height);
    15791580
    15801581  TechNameSpace := 224;
  • branches/highdpi/LocalPlayer/Term.pas

    r351 r361  
    16971697        Controls[i].Visible := false;
    16981698    me := -1;
    1699     SetMainTextureByAge(-1);
     1699    MainTexture.Age := -1;
    17001700    with Panel.Canvas do
    17011701    begin
     
    17341734    { if MyRO.Happened and phGameEnd<>0 then
    17351735      begin
    1736       Age:=3;
    1737       SetMainTextureByAge(-1);
     1736      Age := 3;
     1737      MainTexture.Age := -1;
    17381738      end
    17391739      else }
    17401740    begin
    17411741      Age := GetAge(me);
    1742       if SetMainTextureByAge(Age) then
     1742      if MainTexture.Age <> Age then begin
     1743        MainTexture.Age := Age;
    17431744        EOT.Invalidate; // has visible background parts in its bounds
     1745      end;
    17441746    end;
    17451747    // age:=MyRO.Turn mod 4; //!!!
     
    17541756  begin
    17551757    Age := 0;
    1756     SetMainTextureByAge(-1);
     1758    MainTexture.Age := -1;
    17571759    if ClientMode = cMovieTurn then
    17581760      EOT.ButtonIndex := eotCancel
     
    25442546        Age := 0;
    25452547        if Command = cHelpOnly then
    2546           SetMainTextureByAge(-1);
     2548          MainTexture.Age := -1;
    25472549        Tribes.Init;
    25482550        HelpDlg.UserLeft := (DpiScreen.width - HelpDlg.width) div 2;
     
    42714273        xMini + 2 + G.lx - MapWidth div (xxt * 2), yMini + 2,
    42724274        xMini + 1 + G.lx + MapWidth div (xxt * 2), yMini + 2 + G.ly - 1,
    4273         MainTexture.clMark, MainTexture.clMark)
     4275        MainTexture.ColorMark, MainTexture.ColorMark)
    42744276    else
    42754277      Frame(Panel.Canvas,
    42764278        xMini + 2 + G.lx - MapWidth div (xxt * 2), yMini + 2 + yw,
    42774279        xMini + 1 + G.lx + MapWidth div (xxt * 2), yMini + yw + MapHeight div yyt,
    4278         MainTexture.clMark, MainTexture.clMark);
     4280        MainTexture.ColorMark, MainTexture.ColorMark);
    42794281  end;
    42804282end;
     
    43074309  begin
    43084310    Fill(Panel.Canvas, 0, 3, xMidPanel + 7 - 10, PanelHeight - 3,
    4309       wMainTexture - (xMidPanel + 7 - 10), hMainTexture - PanelHeight);
     4311      MainTexture.Width - (xMidPanel + 7 - 10), MainTexture.Height - PanelHeight);
    43104312    Fill(Panel.Canvas, xRightPanel + 10 - 7, 3, Panel.width - xRightPanel - 10 +
    4311       7, PanelHeight - 3, -(xRightPanel + 10 - 7), hMainTexture - PanelHeight);
     4313      7, PanelHeight - 3, -(xRightPanel + 10 - 7), MainTexture.Height - PanelHeight);
    43124314    FillLarge(Panel.Canvas, xMidPanel - 2, PanelHeight - MidPanelHeight,
    43134315      xRightPanel + 2, PanelHeight, ClientWidth div 2);
     
    43214323    LineTo(xRightPanel, 0);
    43224324    LineTo(ClientWidth, 0);
    4323     Pen.Color := MainTexture.clBevelLight;
     4325    Pen.Color := MainTexture.ColorBevelLight;
    43244326    MoveTo(xMidPanel + 7 - 9, PanelHeight - MidPanelHeight + 2);
    43254327    LineTo(xRightPanel + 10 - 8, PanelHeight - MidPanelHeight + 2);
    4326     Pen.Color := MainTexture.clBevelLight;
     4328    Pen.Color := MainTexture.ColorBevelLight;
    43274329    MoveTo(0, 1);
    43284330    LineTo(xMidPanel + 7 - 9, 1);
    4329     Pen.Color := MainTexture.clBevelShade;
     4331    Pen.Color := MainTexture.ColorBevelShade;
    43304332    LineTo(xMidPanel + 7 - 9, PanelHeight - MidPanelHeight + 1);
    4331     Pen.Color := MainTexture.clBevelLight;
     4333    Pen.Color := MainTexture.ColorBevelLight;
    43324334    LineTo(xRightPanel + 10 - 9, PanelHeight - MidPanelHeight + 1);
    4333     Pen.Color := MainTexture.clBevelLight;
     4335    Pen.Color := MainTexture.ColorBevelLight;
    43344336    LineTo(xRightPanel + 10 - 9, 1);
    43354337    LineTo(ClientWidth, 1);
     
    43394341    MoveTo(0, 2);
    43404342    LineTo(xMidPanel + 7 - 10, 2);
    4341     Pen.Color := MainTexture.clBevelShade;
     4343    Pen.Color := MainTexture.ColorBevelShade;
    43424344    LineTo(xMidPanel + 7 - 10, PanelHeight);
    43434345    Corner(Panel.Canvas, xMidPanel + 7 - 16, 1, 1, MainTexture);
     
    44784480              ScreenTools.Frame(Panel.Canvas, xTroop + 1 + x,
    44794481                yTroop + 6 - yyt div 2, xTroop + 2 * xxt - 1 + x,
    4480                 yTroop + 2 * yyt + 10, MainTexture.clMark, MainTexture.clMark);
     4482                yTroop + 2 * yyt + 10, MainTexture.ColorMark, MainTexture.ColorMark);
    44814483            end;
    44824484          end;
     
    45964598        else
    45974599          x := xTroop - 152;
    4598         Pen.Color := MainTexture.clBevelShade;
     4600        Pen.Color := MainTexture.ColorBevelShade;
    45994601        MoveTo(x - 1, PanelHeight - MidPanelHeight + 2);
    46004602        LineTo(x - 1, PanelHeight);
    4601         Pen.Color := MainTexture.clBevelLight;
     4603        Pen.Color := MainTexture.ColorBevelLight;
    46024604        MoveTo(x, PanelHeight - MidPanelHeight + 2);
    46034605        LineTo(x, PanelHeight);
     
    46374639                        ScreenTools.Frame(Panel.Canvas, xTroop + 3 + x,
    46384640                          yTroop + 2, xTroop + 63 + x, yTroop + 46,
    4639                           MainTexture.clMark, MainTexture.clMark);
     4641                          MainTexture.ColorMark, MainTexture.ColorMark);
    46404642                      end
    46414643                      else if (unx.Master >= 0) and (unx.Master = UnFocus) then
     
    46444646                          xTroop + 64 + x, yTroop + 47, 8, $000000);
    46454647                        CFrame(Panel.Canvas, xTroop + 3 + x, yTroop + 2,
    4646                           xTroop + 63 + x, yTroop + 46, 8, MainTexture.clMark);
     4648                          xTroop + 63 + x, yTroop + 46, 8, MainTexture.ColorMark);
    46474649                      end;
    46484650                      NoMapPanel.SetOutput(Panel);
     
    47394741          RFrame(Panel.Canvas, Left - 1, Top - self.ClientHeight +
    47404742            (PanelHeight - 1), Left + width, Top + height - self.ClientHeight +
    4741             PanelHeight, MainTexture.clBevelShade, MainTexture.clBevelLight)
     4743            PanelHeight, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight)
    47424744    end; { if TroopLoc>=0 }
    47434745  end;
     
    47554757          RFrame(Panel.Canvas, Left - 1, Top - self.ClientHeight +
    47564758            (PanelHeight - 1), Left + width, Top + height - self.ClientHeight +
    4757             PanelHeight, MainTexture.clBevelShade, MainTexture.clBevelLight);
     4759            PanelHeight, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    47584760        end;
    47594761      end;
     
    47694771          RFrame(Panel.Canvas, Left - 1, Top - self.ClientHeight +
    47704772            (PanelHeight - 1), Left + width, Top + height - self.ClientHeight +
    4771             PanelHeight, MainTexture.clBevelShade, MainTexture.clBevelLight);
     4773            PanelHeight, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    47724774        end;
    47734775  end;
     
    47864788    MoveTo(0, TopBarHeight - 1);
    47874789    LineTo(ClientWidth, TopBarHeight - 1);
    4788     Pen.Color := MainTexture.clBevelShade;
     4790    Pen.Color := MainTexture.ColorBevelShade;
    47894791    MoveTo(0, TopBarHeight - 2);
    47904792    LineTo(ClientWidth, TopBarHeight - 2);
    47914793    MoveTo(0, TopBarHeight - 3);
    47924794    LineTo(ClientWidth, TopBarHeight - 3);
    4793     Pen.Color := MainTexture.clBevelLight;
     4795    Pen.Color := MainTexture.ColorBevelLight;
    47944796    ScreenTools.Frame(TopBar.Canvas, 40, -1, xTreasurySection - 1,
    4795       TopBarHeight - 7, MainTexture.clBevelShade, MainTexture.clBevelLight);
     4797      TopBarHeight - 7, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    47964798    ScreenTools.Frame(TopBar.Canvas, xResearchSection + 332, -1, ClientWidth,
    4797       TopBarHeight - 7, MainTexture.clBevelShade, MainTexture.clBevelLight);
     4799      TopBarHeight - 7, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    47984800  end;
    47994801  if GameMode <> cMovie then
     
    52305232          Frame(Panel.Canvas, xMini + 2 + G.lx - MapWidth div (2 * xxt),
    52315233            yMini + 2, xMini + 1 + G.lx + MapWidth div (2 * xxt),
    5232             yMini + 2 + G.ly - 1, MainTexture.clMark, MainTexture.clMark)
     5234            yMini + 2 + G.ly - 1, MainTexture.ColorMark, MainTexture.ColorMark)
    52335235        else
    52345236          Frame(Panel.Canvas, xMini + 2 + G.lx - MapWidth div (2 * xxt),
    52355237            yMini + 2 + yw, xMini + 2 + G.lx + MapWidth div (2 * xxt) - 1,
    5236             yMini + 2 + yw + MapHeight div yyt - 2, MainTexture.clMark,
    5237             MainTexture.clMark);
     5238            yMini + 2 + yw + MapHeight div yyt - 2, MainTexture.ColorMark,
     5239            MainTexture.ColorMark);
    52385240      end;
    52395241      RectInvalidate(xMini + 2, TopBarHeight + MapHeight - overlap + yMini + 2,
     
    74987500        Frame(Buffer.Canvas, x - xMini - 2 - MapWidth div (xxt * 2), 0,
    74997501          x - xMini - 2 + MapWidth div (xxt * 2) - 1, G.ly - 1,
    7500           MainTexture.clMark, MainTexture.clMark)
     7502          MainTexture.ColorMark, MainTexture.ColorMark)
    75017503      else
    75027504        Frame(Buffer.Canvas, x - xMini - 2 - MapWidth div (xxt * 2), yw,
    75037505          x - xMini - 2 + MapWidth div (xxt * 2) - 1, yw + MapHeight div yyt -
    7504           2, MainTexture.clMark, MainTexture.clMark);
     7506          2, MainTexture.ColorMark, MainTexture.ColorMark);
    75057507      DpiBitCanvas(Panel.Canvas, xMini + 2, yMini + 2, G.lx * 2, G.ly,
    75067508        Buffer.Canvas, 0, 0);
     
    80368038
    80378039end.
     8040
  • branches/highdpi/LocalPlayer/UnitStat.lfm

    r210 r361  
    11object UnitStatDlg: TUnitStatDlg
    22  Left = 344
    3   Height = 326
     3  Height = 489
    44  Top = 213
    5   Width = 208
     5  Width = 312
    66  BorderStyle = bsNone
    7   ClientHeight = 326
    8   ClientWidth = 208
     7  ClientHeight = 489
     8  ClientWidth = 312
    99  Color = clBtnFace
     10  DesignTimePPI = 144
    1011  Font.Color = clWindowText
    11   Font.Height = -13
     12  Font.Height = -20
    1213  Font.Name = 'MS Sans Serif'
    1314  FormStyle = fsStayOnTop
     
    1617  OnDestroy = FormDestroy
    1718  OnShow = FormShow
    18   LCLVersion = '1.6.2.0'
     19  LCLVersion = '2.0.12.0'
    1920  object SwitchBtn: TButtonB
    20     Left = 12
    21     Height = 25
    22     Top = 29
    23     Width = 25
     21    Left = 18
     22    Height = 38
     23    Top = 44
     24    Width = 38
    2425    Down = False
    2526    Permanent = False
     
    2829  end
    2930  object CloseBtn: TButtonB
    30     Left = 177
    31     Height = 25
    32     Top = 6
    33     Width = 25
     31    Left = 266
     32    Height = 38
     33    Top = 9
     34    Width = 38
    3435    Down = False
    3536    Permanent = False
     
    3839  end
    3940  object ConscriptsBtn: TButtonB
    40     Left = 43
    41     Height = 25
    42     Top = 29
    43     Width = 25
     41    Left = 64
     42    Height = 38
     43    Top = 44
     44    Width = 38
    4445    Down = False
    4546    Permanent = False
     
    4849  end
    4950  object HelpBtn: TButtonC
    50     Left = 178
    51     Height = 12
    52     Top = 145
    53     Width = 12
     51    Left = 267
     52    Height = 18
     53    Top = 218
     54    Width = 18
    5455    Down = False
    5556    Permanent = False
  • branches/highdpi/LocalPlayer/UnitStat.pas

    r349 r361  
    7777  AgePrepared := -2;
    7878  TitleHeight := DpiScreen.Height;
    79   InitButtons();
     79  InitButtons;
    8080
    8181  Back := TDpiBitmap.Create;
     
    9898procedure TUnitStatDlg.CheckAge;
    9999begin
    100   if MainTextureAge <> AgePrepared then
    101   begin
    102     AgePrepared := MainTextureAge;
     100  if MainTexture.Age <> AgePrepared then begin
     101    AgePrepared := MainTexture.Age;
    103102    DpiBitCanvas(Back.Canvas, 0, 0, wCommon, hOwnModel,
    104       MainTexture.Image.Canvas, (wMainTexture - wCommon) div 2,
    105       (hMainTexture - hOwnModel) div 2);
     103      MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2,
     104      (MainTexture.Height - hOwnModel) div 2);
    106105    DpiBitCanvas(Back.Canvas, wCommon, 0, wCommon, hEnemyModel,
    107       MainTexture.Image.Canvas, (wMainTexture - wCommon) div 2,
    108       (hMainTexture - hEnemyModel) div 2);
     106      MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2,
     107      (MainTexture.Height - hEnemyModel) div 2);
    109108    DpiBitCanvas(Back.Canvas, 2 * wCommon, 0, wCommon, hEnemyUnit,
    110       MainTexture.Image.Canvas, (wMainTexture - wCommon) div 2,
    111       (hMainTexture - hEnemyUnit) div 2);
     109      MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2,
     110      (MainTexture.Height - hEnemyUnit) div 2);
    112111    DpiBitCanvas(Back.Canvas, 3 * wCommon, 0, wCommon, hEnemyCityDefense,
    113       MainTexture.Image.Canvas, (wMainTexture - wCommon) div 2,
    114       (hMainTexture - hEnemyCityDefense) div 2);
     112      MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2,
     113      (MainTexture.Height - hEnemyCityDefense) div 2);
    115114    DpiBitCanvas(Back.Canvas, 4 * wCommon, 0, wCommon, hEnemyCity,
    116       MainTexture.Image.Canvas, (wMainTexture - wCommon) div 2,
    117       (hMainTexture - hEnemyCity) div 2);
     115      MainTexture.Image.Canvas, (MainTexture.Width - wCommon) div 2,
     116      (MainTexture.Height - hEnemyCity) div 2);
    118117    ImageOp_B(Back, Template, 0, 0, 0, 0, 5 * wCommon, hMax);
    119   end
     118  end;
    120119end;
    121120
     
    151150        dec(ecixShow);
    152151      assert(ecixShow >= 0);
    153     end
     152    end;
    154153  end;
    155154  case Kind of
     
    297296      result := (PPicture.HGr = PTestPicture.HGr) and
    298297        (PPicture.pix = PTestPicture.pix) and
    299         (ModelHash(mox^) = ModelHash(MyRO.EnemyModel[emix]))
     298        (ModelHash(mox^) = ModelHash(MyRO.EnemyModel[emix]));
    300299    end
    301300    else
    302301      result := (MyRO.EnemyModel[emix].owner = mox.owner) and
    303         (MyRO.EnemyModel[emix].mix = mox.mix)
     302        (MyRO.EnemyModel[emix].mix = mox.mix);
    304303  end;
    305304
    306305  procedure FeatureBar(dst: TDpiBitmap; x, y: integer; const mi: TModelInfo;
    307     const T: TTexture);
     306    T: TTexture);
    308307  var
    309308    i, w, dx, num: integer;
     
    371370  end; { featurebar }
    372371
    373   procedure NumberBarS(dst: TDpiBitmap; x, y: integer; Cap, s: string;
    374     const T: TTexture);
    375   begin
    376     DLine(dst.Canvas, x - 2, x + 170, y + 16, T.clBevelShade, T.clBevelLight);
     372  procedure NumberBarS(dst: TDpiBitmap; x, y: integer; Cap, s: string; T: TTexture);
     373  begin
     374    DLine(dst.Canvas, x - 2, x + 170, y + 16, T.ColorBevelShade, T.ColorBevelLight);
    377375    LoweredTextOut(dst.Canvas, -1, T, x - 2, y, Cap);
    378376    RisedTextout(dst.Canvas, x + 170 - BiColorTextWidth(dst.Canvas, s), y, s);
     
    437435      begin
    438436        case i of
    439           0:
    440             j := imWalls;
    441           1:
    442             j := imCoastalFort;
    443           2:
    444             j := imMissileBat;
    445           3:
    446             j := imBunker
     437          0: j := imWalls;
     438          1: j := imCoastalFort;
     439          2: j := imMissileBat;
     440          3: j := imBunker
    447441        end;
    448442        Frame(offscreen.Canvas, x - 1, yImp - 1, x + xSizeSmall,
    449           yImp + ySizeSmall, MainTexture.clBevelLight,
    450           MainTexture.clBevelShade);
     443          yImp + ySizeSmall, MainTexture.ColorBevelLight,
     444          MainTexture.ColorBevelShade);
    451445        DpiBitCanvas(offscreen.Canvas, x, yImp, xSizeSmall, ySizeSmall,
    452446          SmallImp.Canvas, j mod 7 * xSizeSmall,
    453447          (j + SystemIconLines * 7) div 7 * ySizeSmall);
    454         inc(x, xSizeSmall + 4)
     448        inc(x, xSizeSmall + 4);
    455449      end;
    456450  end;
     
    469463            if IsToCount(MyRO.EnemyUn[MyRO.nEnemyUn + uix].emix) then
    470464              inc(Available);
    471         end
     465        end;
    472466      end
    473467    else // no supervisor -- can only count stack top units
     
    512506    begin
    513507      MakeUnitInfo(me, MyUn[uixShow], ui);
    514       MakeModelInfo(me, MyUn[uixShow].mix, MyModel[MyUn[uixShow].mix], mi)
     508      MakeModelInfo(me, MyUn[uixShow].mix, MyModel[MyUn[uixShow].mix], mi);
    515509    end
    516510    else
     
    518512      mi := mox^;
    519513      if Kind in [dkEnemyUnit, dkEnemyCityDefense] then
    520         ui := MyRO.EnemyUn[euixShow]
     514        ui := MyRO.EnemyUn[euixShow];
    521515    end;
    522516
     
    527521        begin
    528522          { Frame(offscreen.canvas,xView-1,yView-1,xView+64,yView+48,
    529             MainTexture.clBevelShade,MainTexture.clBevelLight);
     523            MainTexture.ColorBevelShade,MainTexture.ColorBevelLight);
    530524            RFrame(offscreen.canvas,xView-2,yView-2,xView+65,yView+49,
    531             MainTexture.clBevelShade,MainTexture.clBevelLight); }
     525            MainTexture.ColorBevelShade,MainTexture.ColorBevelLight); }
    532526          with offscreen.Canvas do
    533527          begin
     
    541535          begin
    542536            x := 1 + 2 * (xxt * 2 + 1);
    543             y := 1 + yyt + 2 * (yyt * 3 + 1)
     537            y := 1 + yyt + 2 * (yyt * 3 + 1);
    544538          end
    545539          else
    546540          begin
    547541            x := integer(MyMap[Loc] and fTerrain) * (xxt * 2 + 1) + 1;
    548             y := 1 + yyt
     542            y := 1 + yyt;
    549543          end;
    550544          for j := -1 to 1 do
     
    594588              (ClientWidth - BiColorTextWidth(offscreen.Canvas, s)) div 2,
    595589              yView + 80, s);
    596           end
     590          end;
    597591        end
    598592      else
     
    615609        Phrases.Lookup('UNITCOST'));
    616610      DLine(offscreen.Canvas, xTotal - 2, xTotal + 170, yTotal + 57 + 16,
    617         MainTexture.clBevelShade, MainTexture.clBevelLight);
     611        MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    618612      if G.Difficulty[me] = 0 then
    619613        s := IntToStr(mi.cost)
     
    636630              (yTotal + StatDown - 19), Phrases.Lookup('UNITINTRO'));
    637631          DLine(offscreen.Canvas, xTotal - 2, xTotal + 170,
    638             (yTotal + StatDown - 19) + 16, MainTexture.clTextShade,
    639             MainTexture.clTextLight);
     632            (yTotal + StatDown - 19) + 16, MainTexture.ColorTextShade,
     633            MainTexture.ColorTextLight);
    640634          s := TurnToString(MyModel[mixShow].IntroTurn);
    641635          RisedTextout(offscreen.Canvas,
     
    675669          ConscriptsBtn.ButtonIndex := 29;
    676670          ConscriptsBtn.Hint := Phrases.Lookup('BTN_ALLOWCONSCRIPTS');
    677         end
     671        end;
    678672      end
    679673      else if Kind = dkEnemyModel then
     
    685679          NumberBar(offscreen, xTotal, yTotal + StatDown,
    686680            Phrases.Lookup('UNITKNOWN'), Available, MainTexture);
    687       end
     681      end;
    688682    end;
    689683  end;
     
    705699procedure TUnitStatDlg.ModelBoxChange(Sender: TObject);
    706700begin
    707   SmartUpdateContent
     701  SmartUpdateContent;
    708702end;
    709703
     
    720714    SwitchBtn.ButtonIndex := 11;
    721715    SwitchBtn.Hint := Phrases.Lookup('BTN_NONOBSOLETE');
    722   end
     716  end;
    723717end;
    724718
     
    735729    ConscriptsBtn.ButtonIndex := 29;
    736730    ConscriptsBtn.Hint := Phrases.Lookup('BTN_ALLOWCONSCRIPTS');
    737   end
     731  end;
    738732end;
    739733
    740734procedure TUnitStatDlg.HelpBtnClick(Sender: TObject);
    741735begin
    742   HelpDlg.ShowNewContent(wmPersistent, hkModel, 0)
     736  HelpDlg.ShowNewContent(wmPersistent, hkModel, 0);
    743737end;
    744738
  • branches/highdpi/LocalPlayer/Wonders.pas

    r349 r361  
    199199
    200200  Fill(Offscreen.Canvas, 3, 3, ClientWidth - 6, ClientHeight - 6,
    201     (wMaintexture - ClientWidth) div 2, (hMaintexture - ClientHeight) div 2);
     201    (Maintexture.Width - ClientWidth) div 2, (Maintexture.Height - ClientHeight) div 2);
    202202  Frame(Offscreen.Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0);
    203203  Frame(Offscreen.Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2,
    204     MainTexture.clBevelLight, MainTexture.clBevelShade);
     204    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    205205  Frame(Offscreen.Canvas, 2, 2, ClientWidth - 3, ClientHeight - 3,
    206     MainTexture.clBevelLight, MainTexture.clBevelShade);
     206    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    207207  Corner(Offscreen.Canvas, 1, 1, 0, MainTexture);
    208208  Corner(Offscreen.Canvas, ClientWidth - 9, 1, 1, MainTexture);
     
    230230          Fill(Offscreen.Canvas, Center.X - xSizeBig div 2 + RingPosition[I].X - 3,
    231231            Center.Y - ySizeBig div 2 + RingPosition[I].Y - 3, xSizeBig + 6,
    232             ySizeBig + 6, (wMaintexture - ClientWidth) div 2,
    233             (hMaintexture - ClientHeight) div 2);
     232            ySizeBig + 6, (Maintexture.Width - ClientWidth) div 2,
     233            (Maintexture.Height - ClientHeight) div 2);
    234234        end;
    235235        WonderDestroyed: begin
     
    308308  begin
    309309    Fill(Canvas, 9, ClientHeight - 3 - 46, ClientWidth - 18, 44,
    310       (wMaintexture - ClientWidth) div 2, (hMaintexture - ClientHeight) div 2);
     310      (Maintexture.Width - ClientWidth) div 2, (Maintexture.Height - ClientHeight) div 2);
    311311    if Selection >= 0 then
    312312    begin
     
    318318          (ClientWidth-BiColorTextWidth(Canvas,S)) div 2+1,
    319319          ClientHeight-3-36+1, S);
    320           Canvas.Font.Color:=MainTexture.clBevelLight;
     320          Canvas.Font.Color:=MainTexture.ColorBevelLight;
    321321          Canvas.TextOut(
    322322          (ClientWidth-BiColorTextWidth(Canvas,S)) div 2,
Note: See TracChangeset for help on using the changeset viewer.