Changeset 361


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
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/CmdList.pas

    r303 r361  
    1414
    1515  TCmdListState = record
    16     nLog, { used size of LogData in bytes }
    17     LoadPos, { position in LogData when loading a game }
    18     LastMovingUnit: integer;
    19     MoveCode, LoadMoveCode: Cardinal;
     16    nLog: Integer; { used size of LogData in bytes }
     17    LoadPos: Integer; { position in LogData when loading a game }
     18    LastMovingUnit: Integer;
     19    MoveCode: Cardinal;
     20    LoadMoveCode: Cardinal;
    2021  end;
    2122
     
    7273end;
    7374
    74 procedure TCmdList.Get(var Command, Player, Subject: integer;
    75   var Data: pointer);
     75procedure TCmdList.Get(var Command, Player, Subject: integer; var Data: pointer);
    7676var
    77   DirCode, code: Cardinal;
     77  DirCode: Cardinal;
     78  Code: Cardinal;
    7879begin
    7980  if FState.LoadMoveCode > 0 then
     
    9495    end;
    9596    case DirCode of
    96       0:
    97         Command := sMoveUnit + $090;
    98       1:
    99         Command := sMoveUnit + $0F0;
    100       2:
    101         Command := sMoveUnit + $390;
    102       3:
    103         Command := sMoveUnit + $3F0;
    104       4:
    105         Command := sMoveUnit + $020;
    106       5:
    107         Command := sMoveUnit + $060;
    108       6:
    109         Command := sMoveUnit + $100;
    110       7:
    111         Command := sMoveUnit + $300;
     97      0: Command := sMoveUnit + $090;
     98      1: Command := sMoveUnit + $0F0;
     99      2: Command := sMoveUnit + $390;
     100      3: Command := sMoveUnit + $3F0;
     101      4: Command := sMoveUnit + $020;
     102      5: Command := sMoveUnit + $060;
     103      6: Command := sMoveUnit + $100;
     104      7: Command := sMoveUnit + $300;
    112105    end;
    113106    Data := nil;
     
    135128      begin
    136129        FState.LoadMoveCode := code and $FF;
    137         inc(FState.LoadPos)
     130        inc(FState.LoadPos);
    138131      end
    139132      else
     
    143136      end;
    144137      Get(Command, Player, Subject, Data);
    145       exit;
     138      Exit;
    146139    end;
    147140
     
    152145      Data := @LogData[FState.LoadPos];
    153146      inc(FState.LoadPos, Command and $F * 4);
    154     end
    155   end
     147    end;
     148  end;
    156149end;
    157150
     
    164157  inc(FState.LoadPos, 4);
    165158  b0 := 0;
    166   while Map0 > 0 do
    167   begin
    168     if Map0 and 1 <> 0 then
    169     begin
     159  while Map0 > 0 do begin
     160    if Map0 and 1 <> 0 then begin
    170161      Map1 := Cardinal((@LogData[FState.LoadPos])^);
    171162      inc(FState.LoadPos, 4);
    172163      for b1 := 0 to 31 do
    173         if 1 shl b1 and Map1 <> 0 then
    174         begin
     164        if 1 shl b1 and Map1 <> 0 then begin
    175165          if b0 * 32 + b1 < DataSize then
    176166            PData(Data)[b0 * 32 + b1] := Cardinal((@LogData[FState.LoadPos])^);
     
    180170    inc(b0);
    181171    Map0 := Map0 shr 1;
    182   end
     172  end;
    183173end;
    184174
     
    190180  begin // move command shortcut
    191181    case Command of
    192       sMoveUnit + $090:
    193         DirCode := 0;
    194       sMoveUnit + $0F0:
    195         DirCode := 1;
    196       sMoveUnit + $390:
    197         DirCode := 2;
    198       sMoveUnit + $3F0:
    199         DirCode := 3;
    200       sMoveUnit + $020:
    201         DirCode := 4;
    202       sMoveUnit + $060:
    203         DirCode := 5;
    204       sMoveUnit + $100:
    205         DirCode := 6;
    206       sMoveUnit + $300:
    207         DirCode := 7;
     182      sMoveUnit + $090: DirCode := 0;
     183      sMoveUnit + $0F0: DirCode := 1;
     184      sMoveUnit + $390: DirCode := 2;
     185      sMoveUnit + $3F0: DirCode := 3;
     186      sMoveUnit + $020: DirCode := 4;
     187      sMoveUnit + $060: DirCode := 5;
     188      sMoveUnit + $100: DirCode := 6;
     189      sMoveUnit + $300: DirCode := 7;
    208190    end;
    209191    if Subject = FState.LastMovingUnit then
     
    231213    begin
    232214      PutData(@FState.MoveCode, 3);
    233       FState.MoveCode := code
     215      FState.MoveCode := code;
    234216    end;
    235217    FState.LastMovingUnit := Subject;
     
    306288  code := Cardinal(Command - sExecute) shl 2 + Cardinal(Player) shl 16;
    307289  Cardinal((@LogData[FState.nLog])^) := code;
    308   FState.nLog := MapPos
     290  FState.nLog := MapPos;
    309291end;
    310292
     
    329311      PutData(@FState.MoveCode, 3); // Single M
    330312    FState.MoveCode := 0;
    331   end
     313  end;
    332314end;
    333315
     
    346328  CompleteMoveCode;
    347329  f.write(FState.nLog, 4);
    348   f.write(LogData^, FState.nLog)
     330  f.write(LogData^, FState.nLog);
    349331end;
    350332
     
    355337  f.write(FState.nLog, 4);
    356338  f.Position := f.Position + OldState.nLog;
    357   f.write(LogData[OldState.nLog], FState.nLog - OldState.nLog)
     339  f.write(LogData[OldState.nLog], FState.nLog - OldState.nLog);
    358340end;
    359341
     
    370352    result := (FState.LoadPos shr 8) * 999 div (FState.nLog shr 8)
    371353  else
    372     result := FState.LoadPos * 999 div FState.nLog
     354    result := FState.LoadPos * 999 div FState.nLog;
    373355end;
    374356
  • branches/highdpi/Direct.pas

    r349 r361  
    6060  case ID of
    6161    ntInitLocalHuman: begin
    62       SetMainTextureByAge(-1);
     62      MainTexture.Age := -1;
    6363      State := -1;
    6464      Info := Phrases.Lookup('BUSY_MODLH');
    6565      Show;
    6666      {$IFDEF LINUX}
     67      // Force shown window repaint on Gtk2 widgetset
     68      Sleep(1);
    6769      DpiApplication.ProcessMessages;
    6870      {$ENDIF}
     
    151153        while BiColorTextWidth(Canvas, Info) + 64 > ClientWidth do
    152154          Delete(Info, Length(Info), 1);
    153         SetMainTextureByAge(-1);
     155        MainTexture.Age := -1;
    154156        State := -1;
    155157        Show;
    156158        {$IFDEF LINUX}
     159        // Force shown window repaint on Gtk2 widgetset
     160        Sleep(1);
    157161        DpiApplication.ProcessMessages;
    158162        {$ENDIF}
     
    276280  Frame(Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0);
    277281  Frame(Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2,
    278     MainTexture.clBevelLight, MainTexture.clBevelShade);
     282    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    279283  Frame(Canvas, 2, 2, ClientWidth - 3, ClientHeight - 3,
    280     MainTexture.clBevelLight, MainTexture.clBevelShade);
     284    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    281285  if State >= 0 then
    282286    RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, Info))
  • branches/highdpi/GameServer.pas

    r349 r361  
    148148  CCData: array [0 .. 14] of integer;
    149149  bix: TBrains; { brain of the players }
    150   DevModelTurn, { turn of last call to sResetModel }
    151   OriginalDataVersion: array [0 .. nPl - 1] of integer;
     150  DevModelTurn: array [0 .. nPl - 1] of Integer; { turn of last call to sResetModel }
     151  OriginalDataVersion: array [0 .. nPl - 1] of Integer;
    152152  SavedTiles { , SavedResourceWeights } : array [0 .. ncmax - 1] of Cardinal;
    153153  SavedData: array [0 .. nPl - 1] of pointer;
  • branches/highdpi/Inp.pas

    r253 r361  
    3737  Canvas.Brush.Style := bsClear;
    3838  TitleHeight := Height;
    39   InitButtons();
     39  InitButtons;
    4040  Center := true;
    4141end;
     
    4646  Frame(Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0);
    4747  Frame(Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2,
    48     MainTexture.clBevelLight, MainTexture.clBevelShade);
     48    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    4949  Frame(Canvas, 2, 2, ClientWidth - 3, ClientHeight - 3,
    50     MainTexture.clBevelLight, MainTexture.clBevelShade);
     50    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    5151  EditFrame(Canvas, EInput.BoundsRect, MainTexture);
    5252  BtnFrame(Canvas, OKBtn.BoundsRect, MainTexture);
     
    8484begin
    8585  OKBtn.Caption := Phrases.Lookup('BTN_OK');
    86   EInput.Font.Color := MainTexture.clMark;
     86  EInput.Font.Color := MainTexture.ColorMark;
    8787  EInput.SelStart := 0;
    8888  EInput.SelLength := Length(EInput.Text);
  • 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,
  • branches/highdpi/Messg.pas

    r210 r361  
    1212
    1313type
     14  TMessageKind = (mkOK, mkOKCancel, mkYesNo, mkYesNoCancel, mkOkCancelRemove,
     15    mkOkHelp, mkModel);
     16
    1417  TMessgDlg = class(TBaseMessgDlg)
    1518    Button1: TButtonA;
     
    2225    procedure FormKeyPress(Sender: TObject; var Key: char);
    2326  public
    24     Kind: integer;
     27    Kind: TMessageKind;
    2528    OpenSound: string;
    2629  private
    2730    procedure OnPlaySound(var Msg: TMessage); message WM_PLAYSOUND;
    2831  end;
    29 
    30 const
    31   // message kinds
    32   mkOK = 1;
    33   mkOKCancel = 2;
    34   mkYesNo = 3;
    3532
    3633var
  • branches/highdpi/NoTerm.pas

    r303 r361  
    8080  Canvas.Font.Assign(UniFont[ftSmall]);
    8181  TitleHeight := 36;
    82   InitButtons();
     82  InitButtons;
    8383  LastShowYearTime := 0;
    8484end;
     
    310310  Frame(Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, $000000, $000000);
    311311  Frame(Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2,
    312     MainTexture.clBevelLight, MainTexture.clBevelShade);
     312    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    313313  Frame(Canvas, 2, 2, ClientWidth - 3, ClientHeight - 3,
    314     MainTexture.clBevelLight, MainTexture.clBevelShade);
     314    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    315315  Corner(Canvas, 1, 1, 0, MainTexture);
    316316  Corner(Canvas, ClientWidth - 9, 1, 1, MainTexture);
     
    325325    begin
    326326      Frame(Canvas, xBrain[i] - 24, yBrain[i] - 8 - 16, xBrain[i] - 24 + 111,
    327         yBrain[i] - 8 - 16 + 111, MainTexture.clBevelShade,
    328         MainTexture.clBevelShade);
     327        yBrain[i] - 8 - 16 + 111, MainTexture.ColorBevelShade,
     328        MainTexture.ColorBevelShade);
    329329      FrameImage(Canvas, PlayersBrain[i].Picture, xBrain[i],
    330330        yBrain[i] - 16, 64, 64, 0, 0);
  • branches/highdpi/Packages/CevoComponents/BaseWin.pas

    r349 r361  
    292292  procedure CornerFrame(x0, y0, x1, y1: integer);
    293293  begin
    294     Frame(Canvas, x0 + 1, y0 + 1, x1 - 2, y1 - 2, MainTexture.clBevelLight,
    295       MainTexture.clBevelShade);
    296     Frame(Canvas, x0 + 2, y0 + 2, x1 - 3, y1 - 3, MainTexture.clBevelLight,
    297       MainTexture.clBevelShade);
     294    Frame(Canvas, x0 + 1, y0 + 1, x1 - 2, y1 - 2, MainTexture.ColorBevelLight,
     295      MainTexture.ColorBevelShade);
     296    Frame(Canvas, x0 + 2, y0 + 2, x1 - 3, y1 - 3, MainTexture.ColorBevelLight,
     297      MainTexture.ColorBevelShade);
    298298    Corner(Canvas, x0 + 1, y0 + 1, 0, MainTexture);
    299299    Corner(Canvas, x1 - 9, y0 + 1, 1, MainTexture);
     
    318318  l := BiColorTextWidth(Canvas, Caption);
    319319  Cut := (ClientWidth - l) div 2;
    320   xTexOffset := (wMaintexture - ClientWidth) div 2;
    321   yTexOffset := (hMaintexture - ClientHeight) div 2;
     320  xTexOffset := (Maintexture.Width - ClientWidth) div 2;
     321  yTexOffset := (Maintexture.Height - ClientHeight) div 2;
    322322  if WideBottom then
    323323    InnerBottom := ClientHeight - WideFrame
     
    345345  Frame(Canvas, 0, FrameTop, ClientWidth - 1, FrameBottom - 1, 0, 0);
    346346  Frame(Canvas, SideFrame - 1, TitleHeight - 1, ClientWidth - SideFrame,
    347     InnerBottom, MainTexture.clBevelShade, MainTexture.clBevelLight);
     347    InnerBottom, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    348348  // RFrame(Canvas,SideFrame-2,TitleHeight-2,ClientWidth-SideFrame+1,
    349   // InnerBottom+1,MainTexture.clBevelShade,MainTexture.clBevelLight);
     349  // InnerBottom+1,MainTexture.ColorBevelShade,MainTexture.ColorBevelLight);
    350350  if FullCaption then
    351351  begin
     
    367367          4, xTexOffset, yTexOffset);
    368368        CornerFrame(0, FrameTop, ClientWidth, FrameBottom);
    369         Pen.Color := MainTexture.clBevelShade;
     369        Pen.Color := MainTexture.ColorBevelShade;
    370370        MoveTo(3 + ModalFrameIndent, 2);
    371371        LineTo(3 + ModalFrameIndent, TitleHeight);
    372         Pen.Color := MainTexture.clBevelShade;
     372        Pen.Color := MainTexture.ColorBevelShade;
    373373        MoveTo(4 + ModalFrameIndent, TitleHeight - 1);
    374374        LineTo(ClientWidth - 4 - ModalFrameIndent, TitleHeight - 1);
    375375        LineTo(ClientWidth - 4 - ModalFrameIndent, 1);
    376         Pen.Color := MainTexture.clBevelLight;
     376        Pen.Color := MainTexture.ColorBevelLight;
    377377        MoveTo(ClientWidth - 5 - ModalFrameIndent, 2);
    378378        LineTo(4 + ModalFrameIndent, 2);
     
    380380        MoveTo(ClientWidth - 4 - ModalFrameIndent, 1);
    381381        LineTo(3 + ModalFrameIndent, 1);
    382         Pen.Color := MainTexture.clBevelLight;
     382        Pen.Color := MainTexture.ColorBevelLight;
    383383        MoveTo(ClientWidth - 3 - ModalFrameIndent, 3);
    384384        LineTo(ClientWidth - 3 - ModalFrameIndent, TitleHeight);
     
    397397
    398398    Frame(Canvas, CaptionLeft + 1, 0 + 1, ClientWidth - CaptionLeft - 2,
    399       TitleHeight - 1, MainTexture.clBevelLight, MainTexture.clBevelShade);
     399      TitleHeight - 1, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    400400    Frame(Canvas, CaptionLeft + 2, 0 + 2, ClientWidth - CaptionLeft - 3,
    401       TitleHeight - 1, MainTexture.clBevelLight, MainTexture.clBevelShade);
     401      TitleHeight - 1, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    402402    Corner(Canvas, CaptionLeft + 1, 0 + 1, 0, MainTexture);
    403403    Corner(Canvas, ClientWidth - CaptionLeft - 9, 0 + 1, 1, MainTexture);
     
    405405    with Canvas do
    406406    begin
    407       Pen.Color := MainTexture.clBevelShade;
     407      Pen.Color := MainTexture.ColorBevelShade;
    408408      MoveTo(CaptionLeft + 1, FrameTop + 2);
    409409      LineTo(CaptionLeft + 1, TitleHeight);
    410       Pen.Color := MainTexture.clBevelLight;
     410      Pen.Color := MainTexture.ColorBevelLight;
    411411      MoveTo(ClientWidth - CaptionLeft - 2, FrameTop + 2);
    412412      LineTo(ClientWidth - CaptionLeft - 2, TitleHeight);
     
    421421      Frame(Canvas, CaptionLeft + 1, ClientHeight - WideFrame - 1 + 1,
    422422        ClientWidth - CaptionLeft - 2, ClientHeight - 2,
    423         MainTexture.clBevelLight, MainTexture.clBevelShade);
     423        MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    424424      Frame(Canvas, CaptionLeft + 2, ClientHeight - WideFrame - 1 + 1,
    425425        ClientWidth - CaptionLeft - 3, ClientHeight - 3,
    426         MainTexture.clBevelLight, MainTexture.clBevelShade);
     426        MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    427427      Corner(Canvas, CaptionLeft + 1, ClientHeight - 9, 2, MainTexture);
    428428      Corner(Canvas, ClientWidth - CaptionLeft - 9, ClientHeight - 9, 3,
     
    431431      with Canvas do
    432432      begin
    433         Pen.Color := MainTexture.clBevelShade;
     433        Pen.Color := MainTexture.ColorBevelShade;
    434434        MoveTo(CaptionLeft + 1, ClientHeight - WideFrame);
    435435        LineTo(CaptionLeft + 1, FrameBottom - 2);
    436         Pen.Color := MainTexture.clBevelLight;
     436        Pen.Color := MainTexture.ColorBevelLight;
    437437        MoveTo(ClientWidth - CaptionLeft - 2, ClientHeight - WideFrame);
    438438        LineTo(ClientWidth - CaptionLeft - 2, FrameBottom - 2);
     
    486486begin
    487487  Fill(Offscreen.Canvas, Left, Top, Width, Height,
    488     SideFrame + (wMaintexture - ClientWidth) div 2,
    489     TitleHeight + (hMaintexture - ClientHeight) div 2);
     488    SideFrame + (Maintexture.Width - ClientWidth) div 2,
     489    TitleHeight + (Maintexture.Height - ClientHeight) div 2);
    490490end;
    491491
  • branches/highdpi/Packages/CevoComponents/ButtonBase.pas

    r210 r361  
    8080    end;
    8181    if (Button = mbLeft) and (@ClickProc <> nil) then
    82       ClickProc(self)
     82      ClickProc(self);
    8383  end
    8484  else
     
    116116      if @DownChangedProc <> nil then
    117117        DownChangedProc(self);
    118     end
     118    end;
    119119end;
    120120
  • branches/highdpi/Packages/CevoComponents/DrawDlg.pas

    r349 r361  
    258258      $000000, $000000);
    259259  Frame(Canvas, Border + 1, Border + 1, ClientWidth - (2 + Border),
    260     ClientHeight - (2 + Border), MainTexture.clBevelLight,
    261     MainTexture.clBevelShade);
     260    ClientHeight - (2 + Border), MainTexture.ColorBevelLight,
     261    MainTexture.ColorBevelShade);
    262262  Frame(Canvas, 2 + Border, 2 + Border, ClientWidth - (3 + Border),
    263     ClientHeight - (3 + Border), MainTexture.clBevelLight,
    264     MainTexture.clBevelShade);
     263    ClientHeight - (3 + Border), MainTexture.ColorBevelLight,
     264    MainTexture.ColorBevelShade);
    265265  SplitText(false);
    266266
  • branches/highdpi/Packages/CevoComponents/ScreenTools.pas

    r349 r361  
    1111
    1212type
    13   TTexture = record
     13
     14  { TTexture }
     15
     16  TTexture = class
     17  private
     18    FAge: Integer;
     19    function GetHeight: Integer;
     20    function GetWidth: Integer;
     21    procedure SetAge(AValue: Integer);
     22  public
    1423    Image: TDpiBitmap;
    15     clBevelLight: TColor;
    16     clBevelShade: TColor;
    17     clTextLight: TColor;
    18     clTextShade: TColor;
    19     clLitText: TColor;
    20     clMark: TColor;
    21     clPage: TColor;
    22     clCover: TColor;
    23   end;
     24    ColorBevelLight: TColor;
     25    ColorBevelShade: TColor;
     26    ColorTextLight: TColor;
     27    ColorTextShade: TColor;
     28    ColorLitText: TColor;
     29    ColorMark: TColor;
     30    ColorPage: TColor;
     31    ColorCover: TColor;
     32    constructor Create;
     33    destructor Destroy; override;
     34    procedure Assign(Source: TTexture);
     35    property Age: Integer read FAge write SetAge;
     36    property Width: Integer read GetWidth;
     37    property Height: Integer read GetHeight;
     38  end;
     39
    2440  TLoadGraphicFileOption = (gfNoError, gfNoGamma);
    2541  TLoadGraphicFileOptions = set of TLoadGraphicFileOption;
     
    3551function TurnToString(Turn: integer): string;
    3652function MovementToString(Movement: integer): string;
    37 procedure BtnFrame(ca: TDpiCanvas; p: TRect; const T: TTexture);
    38 procedure EditFrame(ca: TDpiCanvas; p: TRect; const T: TTexture);
     53procedure BtnFrame(ca: TDpiCanvas; p: TRect; T: TTexture);
     54procedure EditFrame(ca: TDpiCanvas; p: TRect; T: TTexture);
    3955function HexStringToColor(S: string): integer;
    4056function LoadGraphicFile(Bmp: TDpiBitmap; FileName: string; Options: TLoadGraphicFileOptions = []): boolean;
     
    7490procedure GlowFrame(Dst: TDpiBitmap; x0, y0, Width, Height: integer; cl: TColor);
    7591procedure InitOrnament;
    76 procedure InitCityMark(const T: TTexture);
     92procedure InitCityMark(T: TTexture);
    7793procedure Fill(ca: TDpiCanvas; Left, Top, Width, Height, xOffset, yOffset: integer); overload;
    7894procedure Fill(Canvas: TDpiCanvas; Rect: TRect; Offset: TPoint); overload;
     
    8399  const Texture: TDpiBitmap);
    84100procedure PaintBackground(Form: TDpiForm; Left, Top, Width, Height: integer);
    85 procedure Corner(ca: TDpiCanvas; x, y, Kind: integer; const T: TTexture);
     101procedure Corner(ca: TDpiCanvas; x, y, Kind: integer; T: TTexture);
    86102procedure BiColorTextOut(ca: TDpiCanvas; clMain, clBack: TColor; x, y: integer; s: string);
    87 procedure LoweredTextOut(ca: TDpiCanvas; cl: TColor; const T: TTexture;
     103procedure LoweredTextOut(ca: TDpiCanvas; cl: TColor; T: TTexture;
    88104  x, y: integer; s: string);
    89105function BiColorTextWidth(ca: TDpiCanvas; s: string): integer;
     
    95111procedure UnderlinedTitleValue(Canvas: TDpiCanvas; Title, Value: string; X, Y, Width: Integer);
    96112procedure NumberBar(dst: TDpiBitmap; x, y: integer; Cap: string; val: integer;
    97   const T: TTexture);
     113  T: TTexture);
    98114procedure CountBar(dst: TDpiBitmap; x, y, w: integer; Kind: integer;
    99   Cap: string; val: integer; const T: TTexture);
     115  Cap: string; val: integer; T: TTexture);
    100116procedure PaintProgressBar(ca: TDpiCanvas; Kind, x, y, pos, Growth, max: integer;
    101   const T: TTexture);
     117  T: TTexture);
    102118procedure PaintRelativeProgressBar(ca: TDpiCanvas;
    103119  Kind, x, y, size, pos, Growth, max: integer; IndicateComplete: boolean;
    104   const T: TTexture);
     120  T: TTexture);
    105121procedure PaintLogo(Canvas: TDpiCanvas; X, Y, LightColor, ShadeColor: integer);
    106 function SetMainTextureByAge(Age: integer): boolean;
    107122procedure LoadPhrases;
    108123procedure Texturize(Dest, Texture: TDpiBitmap; TransparentColor: Cardinal);
     
    113128  TransparentColor1 = $FF00FF;
    114129  TransparentColor2 = $7F007F;
    115 
    116   wMainTexture = 640;
    117   hMainTexture = 480;
    118130
    119131  // template positions in Templates.png
     
    165177  HGrSystem2: TGraphicSet;
    166178  ClickFrameColor: Integer;
    167   MainTextureAge: Integer;
    168179  MainTexture: TTexture;
    169180  Templates: TGraphicSet;
     
    325336end;
    326337
    327 procedure BtnFrame(ca: TDpiCanvas; p: TRect; const T: TTexture);
    328 begin
    329   RFrame(ca, p.Left - 1, p.Top - 1, p.Right, p.Bottom, T.clBevelShade,
    330     T.clBevelLight);
    331 end;
    332 
    333 procedure EditFrame(ca: TDpiCanvas; p: TRect; const T: TTexture);
     338procedure BtnFrame(ca: TDpiCanvas; p: TRect; T: TTexture);
     339begin
     340  RFrame(ca, p.Left - 1, p.Top - 1, p.Right, p.Bottom, T.ColorBevelShade,
     341    T.ColorBevelLight);
     342end;
     343
     344procedure EditFrame(ca: TDpiCanvas; p: TRect; T: TTexture);
    334345begin
    335346  Frame(ca, p.Left - 1, p.Top - 1, p.Right, p.Bottom, $000000, $000000);
    336347  Frame(ca, p.Left - 2, p.Top - 2, p.Right + 1, p.Bottom + 1, $000000, $000000);
    337348  Frame(ca, p.Left - 3, p.Top - 3, p.Right + 2, p.Bottom + 1, $000000, $000000);
    338   RFrame(ca, p.Left - 4, p.Top - 4, p.Right + 3, p.Bottom + 2, T.clBevelShade,
    339     T.clBevelLight);
     349  RFrame(ca, p.Left - 4, p.Top - 4, p.Right + 3, p.Bottom + 2, T.ColorBevelShade,
     350    T.ColorBevelLight);
    340351end;
    341352
     
    10391050begin
    10401051  if InitOrnamentDone then Exit;
    1041   Light := ColorToColor32(MainTexture.clBevelLight);
    1042   // and $FCFCFC shr 2*3+MainTexture.clBevelShade and $FCFCFC shr 2;
    1043   Shade := ColorToColor32(MainTexture.clBevelShade and $FCFCFC shr 2 * 3 +
    1044     MainTexture.clBevelLight and $FCFCFC shr 2);
     1052  Light := ColorToColor32(MainTexture.ColorBevelLight);
     1053  // and $FCFCFC shr 2*3+MainTexture.ColorBevelShade and $FCFCFC shr 2;
     1054  Shade := ColorToColor32(MainTexture.ColorBevelShade and $FCFCFC shr 2 * 3 +
     1055    MainTexture.ColorBevelLight and $FCFCFC shr 2);
    10451056  HGrSystem2.Data.BeginUpdate;
    10461057  PixelPtr := PixelPointer(HGrSystem2.Data, ScaleToNative(Ornament.Left), ScaleToNative(Ornament.Top));
     
    10701081end;
    10711082
    1072 procedure InitCityMark(const T: TTexture);
     1083procedure InitCityMark(T: TTexture);
    10731084var
    10741085  x: Integer;
     
    10831094          x, CityMark1.Top + y] and $FF;
    10841095        HGrSystem.Data.Canvas.Pixels[CityMark2.Left + x, CityMark2.Top + y] :=
    1085           T.clMark and $FF * Intensity div $FF + T.clMark shr 8 and
    1086           $FF * Intensity div $FF shl 8 + T.clMark shr 16 and
     1096          T.ColorMark and $FF * Intensity div $FF + T.ColorMark shr 8 and
     1097          $FF * Intensity div $FF shl 8 + T.ColorMark shr 16 and
    10871098          $FF * Intensity div $FF shl 16;
    10881099      end;
     
    10951106procedure Fill(ca: TDpiCanvas; Left, Top, Width, Height, xOffset, yOffset: Integer);
    10961107begin
    1097   Assert((Left + xOffset >= 0) and (Left + xOffset + Width <= wMainTexture) and
    1098     (Top + yOffset >= 0) and (Top + yOffset + Height <= hMainTexture));
     1108  Assert((Left + xOffset >= 0) and (Left + xOffset + Width <= MainTexture.Width) and
     1109    (Top + yOffset >= 0) and (Top + yOffset + Height <= MainTexture.Height));
    10991110  DpiBitCanvas(ca, Left, Top, Width, Height, MainTexture.Image.Canvas,
    11001111    Left + xOffset, Top + yOffset);
     
    11121123    n: integer;
    11131124  begin
    1114     n := ((hMainTexture div 2) div (y1 - y0)) * 2;
    1115     while hMainTexture div 2 + (I + 1) * (y1 - y0) > hMainTexture do
     1125    n := ((MainTexture.Height div 2) div (y1 - y0)) * 2;
     1126    while MainTexture.Height div 2 + (I + 1) * (y1 - y0) > MainTexture.Height do
    11161127      Dec(I, n);
    1117     while hMainTexture div 2 + I * (y1 - y0) < 0 do
     1128    while MainTexture.Height div 2 + I * (y1 - y0) < 0 do
    11181129      Inc(I, n);
    11191130    Result := I;
     
    11231134  I: Integer;
    11241135begin
    1125   for I := 0 to (x1 - xm) div wMainTexture - 1 do
    1126     DpiBitCanvas(ca, xm + I * wMainTexture, y0, wMainTexture, y1 - y0,
    1127       MainTexture.Image.Canvas, 0, hMainTexture div 2 + Band(I) *
     1136  for I := 0 to (x1 - xm) div MainTexture.Width - 1 do
     1137    DpiBitCanvas(ca, xm + I * MainTexture.Width, y0, MainTexture.Width, y1 - y0,
     1138      MainTexture.Image.Canvas, 0, MainTexture.Height div 2 + Band(I) *
    11281139      (y1 - y0));
    1129   DpiBitCanvas(ca, xm + ((x1 - xm) div wMainTexture) * wMainTexture, y0,
    1130     x1 - (xm + ((x1 - xm) div wMainTexture) * wMainTexture), y1 - y0,
    1131     MainTexture.Image.Canvas, 0, hMainTexture div 2 + Band(
    1132     (x1 - xm) div wMainTexture) * (y1 - y0));
    1133   for I := 0 to (xm - x0) div wMainTexture - 1 do
    1134     DpiBitCanvas(ca, xm - (I + 1) * wMainTexture, y0, wMainTexture, y1 - y0,
    1135       MainTexture.Image.Canvas, 0, hMainTexture div 2 +
     1140  DpiBitCanvas(ca, xm + ((x1 - xm) div MainTexture.Width) * MainTexture.Width, y0,
     1141    x1 - (xm + ((x1 - xm) div MainTexture.Width) * MainTexture.Width), y1 - y0,
     1142    MainTexture.Image.Canvas, 0, MainTexture.Height div 2 + Band(
     1143    (x1 - xm) div MainTexture.Width) * (y1 - y0));
     1144  for I := 0 to (xm - x0) div MainTexture.Width - 1 do
     1145    DpiBitCanvas(ca, xm - (I + 1) * MainTexture.Width, y0, MainTexture.Width, y1 - y0,
     1146      MainTexture.Image.Canvas, 0, MainTexture.Height div 2 +
    11361147      Band(-I - 1) * (y1 - y0));
    1137   DpiBitCanvas(ca, x0, y0, xm - ((xm - x0) div wMainTexture) *
    1138     wMainTexture - x0, y1 - y0, MainTexture.Image.Canvas,
    1139     ((xm - x0) div wMainTexture + 1) * wMainTexture - (xm - x0),
    1140     hMainTexture div 2 + Band(-(xm - x0) div wMainTexture - 1) * (y1 - y0));
     1148  DpiBitCanvas(ca, x0, y0, xm - ((xm - x0) div MainTexture.Width) *
     1149    MainTexture.Width - x0, y1 - y0, MainTexture.Image.Canvas,
     1150    ((xm - x0) div MainTexture.Width + 1) * MainTexture.Width - (xm - x0),
     1151    MainTexture.Height div 2 + Band(-(xm - x0) div MainTexture.Width - 1) * (y1 - y0));
    11411152end;
    11421153
     
    11831194procedure PaintBackground(Form: TDpiForm; Left, Top, Width, Height: Integer);
    11841195begin
    1185   Fill(Form.Canvas, Left, Top, Width, Height, (wMainTexture - Form.ClientWidth) div
    1186     2, (hMainTexture - Form.ClientHeight) div 2);
    1187 end;
    1188 
    1189 procedure Corner(ca: TDpiCanvas; x, y, Kind: Integer; const T: TTexture);
     1196  Fill(Form.Canvas, Left, Top, Width, Height, (MainTexture.Width - Form.ClientWidth) div
     1197    2, (MainTexture.Height - Form.ClientHeight) div 2);
     1198end;
     1199
     1200procedure Corner(ca: TDpiCanvas; x, y, Kind: Integer; T: TTexture);
    11901201begin
    11911202  { DpiBitCanvas(ca,x,y,8,8,T.HGr.Mask.Canvas,
     
    12821293end;
    12831294
    1284 procedure LoweredTextOut(ca: TDpiCanvas; cl: TColor; const T: TTexture;
     1295procedure LoweredTextOut(ca: TDpiCanvas; cl: TColor; T: TTexture;
    12851296  x, y: Integer; s: string);
    12861297begin
    12871298  if cl = -2 then
    1288     BiColorTextOut(ca, (T.clBevelShade and $FEFEFE) shr 1,
    1289       T.clBevelLight, x, y, s)
     1299    BiColorTextOut(ca, (T.ColorBevelShade and $FEFEFE) shr 1,
     1300      T.ColorBevelLight, x, y, s)
    12901301  else if cl < 0 then
    1291     BiColorTextOut(ca, T.clTextShade, T.clTextLight, x, y, s)
     1302    BiColorTextOut(ca, T.ColorTextShade, T.ColorTextLight, x, y, s)
    12921303  else
    1293     BiColorTextOut(ca, cl, T.clTextLight, x, y, s);
     1304    BiColorTextOut(ca, cl, T.ColorTextLight, x, y, s);
    12941305end;
    12951306
     
    13661377procedure UnderlinedTitleValue(Canvas: TDpiCanvas; Title, Value: string; X, Y, Width: Integer);
    13671378begin
    1368   DLine(Canvas, X, X + Width, Y + 19, MainTexture.clBevelLight, MainTexture.clBevelShade);
     1379  DLine(Canvas, X, X + Width, Y + 19, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    13691380  RisedTextOut(Canvas, X, Y, Title);
    13701381  RisedTextOut(Canvas, X + Width - BiColorTextWidth(Canvas, Value), Y, Value);
     
    13721383
    13731384procedure NumberBar(dst: TDpiBitmap; x, y: integer; Cap: string;
    1374   val: Integer; const T: TTexture);
     1385  val: Integer; T: TTexture);
    13751386var
    13761387  s: string;
     
    13781389  if val > 0 then
    13791390  begin
    1380     DLine(dst.Canvas, x - 2, x + 170, y + 16, T.clBevelShade,
    1381       T.clBevelLight);
     1391    DLine(dst.Canvas, x - 2, x + 170, y + 16, T.ColorBevelShade,
     1392      T.ColorBevelLight);
    13821393    LoweredTextOut(dst.Canvas, -1, T, x - 2, y, Cap);
    13831394    s := IntToStr(val);
     
    13881399
    13891400procedure CountBar(dst: TDpiBitmap; x, y, w: Integer; Kind: Integer;
    1390   Cap: string; val: Integer; const T: TTexture);
     1401  Cap: string; val: Integer; T: TTexture);
    13911402var
    13921403  i, sd, ld, cl, xIcon, yIcon: Integer;
     
    14011412    // xIcon:=x+100;
    14021413    // yIcon:=y;
    1403     // DLine(dst.Canvas,x-2,x+170+32,y+16,T.clBevelShade,T.clBevelLight);
     1414    // DLine(dst.Canvas,x-2,x+170+32,y+16,T.ColorBevelShade,T.ColorBevelLight);
    14041415
    14051416    xIcon := x - 5;
    14061417    yIcon := y + 15;
    1407     DLine(dst.Canvas, x - 2, xIcon + w + 2, yIcon + 16, T.clBevelShade,
    1408       T.clBevelLight);
     1418    DLine(dst.Canvas, x - 2, xIcon + w + 2, yIcon + 16, T.ColorBevelShade,
     1419      T.ColorBevelLight);
    14091420
    14101421    s := IntToStr(val);
     
    14841495
    14851496procedure PaintProgressBar(ca: TDpiCanvas; Kind, x, y, pos, Growth, max: Integer;
    1486   const T: TTexture);
     1497  T: TTexture);
    14871498var
    14881499  i: Integer;
     
    15021513    Growth := max - pos;
    15031514  Frame(ca, x - 1, y - 1, x + max, y + 7, $000000, $000000);
    1504   RFrame(ca, x - 2, y - 2, x + max + 1, y + 8, T.clBevelShade,
    1505     T.clBevelLight);
     1515  RFrame(ca, x - 2, y - 2, x + max + 1, y + 8, T.ColorBevelShade,
     1516    T.ColorBevelLight);
    15061517  with ca do
    15071518  begin
     
    15381549procedure PaintRelativeProgressBar(ca: TDpiCanvas;
    15391550  Kind, x, y, size, pos, Growth, max: Integer; IndicateComplete: Boolean;
    1540   const T: TTexture);
     1551  T: TTexture);
    15411552begin
    15421553  if Growth > 0 then
     
    15571568    LightColor, ShadeColor);
    15581569  DpiBitCanvas(Canvas, X, Y, Logo.Width, Logo.Height, LogoBuffer.Canvas, 0, 0);
    1559 end;
    1560 
    1561 function SetMainTextureByAge(Age: Integer): Boolean;
    1562 begin
    1563   if Age <> MainTextureAge then
    1564     with MainTexture do begin
    1565       MainTextureAge := Age;
    1566       LoadGraphicFile(Image, GetGraphicsDir + DirectorySeparator +
    1567         'Texture' + IntToStr(Age + 1) + '.jpg');
    1568       clBevelLight := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelLight];
    1569       clBevelShade := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelShade];
    1570       clTextLight := Colors.Canvas.Pixels[clkAge0 + Age, cliTextLight];
    1571       clTextShade := Colors.Canvas.Pixels[clkAge0 + Age, cliTextShade];
    1572       clLitText := Colors.Canvas.Pixels[clkAge0 + Age, cliLitText];
    1573       clMark := Colors.Canvas.Pixels[clkAge0 + Age, cliMark];
    1574       clPage := Colors.Canvas.Pixels[clkAge0 + Age, cliPage];
    1575       clCover := Colors.Canvas.Pixels[clkAge0 + Age, cliCover];
    1576       Result := True;
    1577     end
    1578   else
    1579     Result := False;
    15801570end;
    15811571
     
    17861776  BigImp := TDpiBitmap.Create;
    17871777  BigImp.PixelFormat := pf24bit;
    1788   MainTexture.Image := TDpiBitmap.Create;
    1789   MainTextureAge := -2;
     1778  MainTexture := TTexture.Create;
    17901779  ClickFrameColor := HGrSystem.Data.Canvas.Pixels[187, 175];
    17911780  InitOrnamentDone := False;
     
    18101799  FreeAndNil(Paper);
    18111800  FreeAndNil(Colors);
    1812   FreeAndNil(MainTexture.Image);
     1801  FreeAndNil(MainTexture);
     1802end;
     1803
     1804{ TTexture }
     1805
     1806procedure TTexture.SetAge(AValue: Integer);
     1807begin
     1808  if FAge = AValue then Exit;
     1809  FAge := AValue;
     1810  LoadGraphicFile(Image, GetGraphicsDir + DirectorySeparator +
     1811    'Texture' + IntToStr(Age + 1) + '.jpg');
     1812  ColorBevelLight := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelLight];
     1813  ColorBevelShade := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelShade];
     1814  ColorTextLight := Colors.Canvas.Pixels[clkAge0 + Age, cliTextLight];
     1815  ColorTextShade := Colors.Canvas.Pixels[clkAge0 + Age, cliTextShade];
     1816  ColorLitText := Colors.Canvas.Pixels[clkAge0 + Age, cliLitText];
     1817  ColorMark := Colors.Canvas.Pixels[clkAge0 + Age, cliMark];
     1818  ColorPage := Colors.Canvas.Pixels[clkAge0 + Age, cliPage];
     1819  ColorCover := Colors.Canvas.Pixels[clkAge0 + Age, cliCover];
     1820end;
     1821
     1822function TTexture.GetHeight: Integer;
     1823begin
     1824  Result := Image.Height;
     1825end;
     1826
     1827function TTexture.GetWidth: Integer;
     1828begin
     1829  Result := Image.Width;
     1830end;
     1831
     1832constructor TTexture.Create;
     1833begin
     1834  Image := TDpiBitmap.Create;
     1835  FAge := -2;
     1836end;
     1837
     1838destructor TTexture.Destroy;
     1839begin
     1840  FreeAndNil(Image);
     1841  inherited;
     1842end;
     1843
     1844procedure TTexture.Assign(Source: TTexture);
     1845begin
     1846  FAge := Source.FAge;
     1847  Image.Assign(Image);
     1848  ColorBevelLight := Source.ColorBevelLight;
     1849  ColorBevelShade := Source.ColorBevelShade;
     1850  ColorTextLight := Source.ColorTextLight;
     1851  ColorTextShade := Source.ColorTextShade;
     1852  ColorLitText := Source.ColorLitText;
     1853  ColorMark := Source.ColorMark;
     1854  ColorPage := Source.ColorPage;
     1855  ColorCover := Source.ColorCover;
    18131856end;
    18141857
  • branches/highdpi/Settings.pas

    r349 r361  
    141141  Frame(Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0);
    142142  Frame(Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2,
    143     MainTexture.clBevelLight, MainTexture.clBevelShade);
     143    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    144144  Frame(Canvas, 2, 2, ClientWidth - 3, ClientHeight - 3,
    145     MainTexture.clBevelLight, MainTexture.clBevelShade);
     145    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    146146  EditFrame(Canvas, List.BoundsRect, MainTexture);
    147147  BtnFrame(Canvas, OKBtn.BoundsRect, MainTexture);
     
    149149
    150150  RFrame(Canvas, ButtonFullscreen.Left - 1, ButtonFullscreen.Top - 1,
    151     ButtonFullscreen.Left + 12, ButtonFullscreen.Top + 12, MainTexture.clBevelShade,
    152     MainTexture.clBevelLight);
     151    ButtonFullscreen.Left + 12, ButtonFullscreen.Top + 12, MainTexture.ColorBevelShade,
     152    MainTexture.ColorBevelLight);
    153153
    154154  S := Phrases.Lookup('SETTINGS', 0);
     
    164164begin
    165165  Languages.LoadToStrings(List.Items);
    166   List.Font.Color := MainTexture.clMark;
     166  List.Font.Color := MainTexture.ColorMark;
    167167  LoadData;
    168168end;
  • branches/highdpi/Start.pas

    r349 r361  
    537537  begin
    538538    Frame(Canvas, 328, yMain + 112 - 15, ClientWidth, Up2Btn.top + 38,
    539       MainTexture.clBevelShade, MainTexture.clBevelLight);
     539      MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    540540    if AutoDiff > 0 then
    541541    begin
     
    543543        yMain + 112 - 15 { Up1Btn.Top-12 }{ y0Brain-dyBrain } ,
    544544        x0Brain + dxBrain + 64, Up2Btn.top + 38 { y0Brain+dyBrain+64 } ,
    545         MainTexture.clBevelShade, MainTexture.clBevelLight);
     545        MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    546546    end;
    547547  end
    548548  else if Page <> pgMain then
    549549    Frame(Canvas, 328, Up1Btn.top - 15, ClientWidth, Up2Btn.top + 38,
    550       MainTexture.clBevelShade, MainTexture.clBevelLight);
     550      MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    551551  Frame(Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0);
    552552
    553553  // draw tabs
    554554  Frame(Canvas, 2, 2 + 2 * integer(Tab <> tbMain), TabOffset + (0 + 1) * TabSize - 1,
    555     TabHeight, MainTexture.clBevelLight, MainTexture.clBevelShade);
     555    TabHeight, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    556556  Frame(Canvas, 1, 1 + 2 * integer(Tab <> tbMain), TabOffset + (0 + 1) * TabSize,
    557     TabHeight, MainTexture.clBevelLight, MainTexture.clBevelShade);
    558   Canvas.Pixels[1, 1 + 2 * integer(Tab <> tbMain)] := MainTexture.clBevelShade;
     557    TabHeight, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
     558  Canvas.Pixels[1, 1 + 2 * integer(Tab <> tbMain)] := MainTexture.ColorBevelShade;
    559559  for Tab2 := tbMap to tbPrevious do
    560560  begin
    561561    Frame(Canvas, TabOffset + Integer(Tab2) * TabSize + 2, 2 + 2 * integer(Tab <> Tab2),
    562       TabOffset + (Integer(Tab2) + 1) * TabSize - 1, TabHeight, MainTexture.clBevelLight,
    563       MainTexture.clBevelShade);
     562      TabOffset + (Integer(Tab2) + 1) * TabSize - 1, TabHeight, MainTexture.ColorBevelLight,
     563      MainTexture.ColorBevelShade);
    564564    Frame(Canvas, TabOffset + Integer(Tab2) * TabSize + 1, 1 + 2 * integer(Tab <> Tab2),
    565       TabOffset + (Integer(Tab2) + 1) * TabSize, TabHeight, MainTexture.clBevelLight,
    566       MainTexture.clBevelShade);
     565      TabOffset + (Integer(Tab2) + 1) * TabSize, TabHeight, MainTexture.ColorBevelLight,
     566      MainTexture.ColorBevelShade);
    567567    Canvas.Pixels[TabOffset + Integer(Tab2) * TabSize + 1, 1 + 2 * integer(Tab <> Tab2)] :=
    568       MainTexture.clBevelShade;
     568      MainTexture.ColorBevelShade;
    569569  end;
    570570  Canvas.Font.Assign(UniFont[ftNormal]);
     
    579579    $000000, $000000);
    580580  Frame(Canvas, 1, TabHeight + 1, ClientWidth - 2, ClientHeight - 2,
    581     MainTexture.clBevelLight, MainTexture.clBevelShade);
     581    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    582582  Frame(Canvas, 2, TabHeight + 2, ClientWidth - 3, ClientHeight - 3,
    583     MainTexture.clBevelLight, MainTexture.clBevelShade);
     583    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    584584  if Tab = tbMain then
    585585  begin
    586586    PaintBackground(self, 3, TabHeight - 1, TabSize - 4 - 3 + TabOffset + 3, 4);
    587     Canvas.Pixels[2, TabHeight] := MainTexture.clBevelLight;
     587    Canvas.Pixels[2, TabHeight] := MainTexture.ColorBevelLight;
    588588  end
    589589  else
     
    592592      TabSize - 4, 4);
    593593    Canvas.Pixels[TabOffset + Integer(Tab) * TabSize + 2, TabHeight] :=
    594       MainTexture.clBevelLight;
     594      MainTexture.ColorBevelLight;
    595595  end;
    596596  Canvas.Pixels[TabOffset + (Integer(Tab) + 1) * TabSize - 1, TabHeight + 1] :=
    597     MainTexture.clBevelShade;
     597    MainTexture.ColorBevelShade;
    598598  if Tab < tbPrevious then
    599599    Frame(Canvas, TabOffset + (Integer(Tab) + 1) * TabSize + 1, 3,
    600       TabOffset + (Integer(Tab) + 1) * TabSize + 2, TabHeight, MainTexture.clBevelShade,
    601       MainTexture.clBevelShade); // Tab shadow
     600      TabOffset + (Integer(Tab) + 1) * TabSize + 2, TabHeight, MainTexture.ColorBevelShade,
     601      MainTexture.ColorBevelShade); // Tab shadow
    602602
    603603  // Paint menu logo
     
    685685            HGrSystem2.Data.Canvas, Ornament.Left, Ornament.Top, SRCPAINT);
    686686        end;
    687       PaintLogo(Canvas, 69 + 11 * 27, yLogo, MainTexture.clBevelLight,
    688         MainTexture.clBevelShade);
     687      PaintLogo(Canvas, 69 + 11 * 27, yLogo, MainTexture.ColorBevelLight,
     688        MainTexture.ColorBevelShade);
    689689
    690690      for i := 0 to nPlOffered - 1 do
     
    706706            RFrame(Canvas, PlayerSlots[i].DiffUpBtn.left - 1, PlayerSlots[i].DiffUpBtn.top - 1,
    707707              PlayerSlots[i].DiffUpBtn.left + 12, PlayerSlots[i].DiffUpBtn.top + 24,
    708               MainTexture.clBevelShade, MainTexture.clBevelLight);
     708              MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    709709            with Canvas do
    710710            begin
     
    718718              RFrame(Canvas, PlayerSlots[I].MultiBtn.left - 1, PlayerSlots[I].MultiBtn.top - 1,
    719719                PlayerSlots[I].MultiBtn.left + 12, PlayerSlots[I].MultiBtn.top + 12,
    720                 MainTexture.clBevelShade, MainTexture.clBevelLight);
     720                MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    721721              DpiBitCanvas(Canvas, xBrain[i] - 31, yBrain[i], 13, 12,
    722722                HGrSystem.Data.Canvas, 88, 47);
     
    733733    else
    734734    begin
    735       DLine(Canvas, 24, 198, yMain + 140 + 19, MainTexture.clBevelLight,
    736         MainTexture.clBevelShade);
     735      DLine(Canvas, 24, 198, yMain + 140 + 19, MainTexture.ColorBevelLight,
     736        MainTexture.ColorBevelShade);
    737737      RisedTextOut(Canvas, 24 { x0Brain+32-BiColorTextWidth(Canvas,s) div 2 } ,
    738738        yMain + 140 { y0Mini-77 } , Phrases.Lookup('STARTCONTROLS', 15));
     
    746746
    747747      DLine(Canvas, 24, xDefault - 6, yMain + 164 + 19,
    748         MainTexture.clBevelLight, MainTexture.clBevelShade);
     748        MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    749749      RisedTextOut(Canvas, 24 { x0Brain+32-BiColorTextWidth(Canvas,s) div 2 } ,
    750750        yMain + 164 { y0Mini-77 } , Phrases.Lookup('STARTCONTROLS', 16));
     
    755755        FrameImage(Canvas, BrainDefault.Picture, xDefault, yDefault, 64, 64,
    756756          0, 0, true);
    757       DLine(Canvas, 56, 272, y0Mini + 61 + 19, MainTexture.clBevelLight,
    758         MainTexture.clBevelShade);
     757      DLine(Canvas, 56, 272, y0Mini + 61 + 19, MainTexture.ColorBevelLight,
     758        MainTexture.ColorBevelShade);
    759759
    760760      RisedTextOut(Canvas, 56, y0Mini + 61,
     
    771771            HGrSystem2.Data.Canvas, Ornament.Left, Ornament.Top, SRCPAINT);
    772772        end;
    773       PaintLogo(Canvas, 69, yLogo, MainTexture.clBevelLight,
    774         MainTexture.clBevelShade);
     773      PaintLogo(Canvas, 69, yLogo, MainTexture.ColorBevelLight,
     774        MainTexture.ColorBevelShade);
    775775    end;
    776776  end
     
    788788    end
    789789    else
    790       DLine(Canvas, 344, 514, y0Mini + 61 + 19, MainTexture.clBevelLight,
    791         MainTexture.clBevelShade);
     790      DLine(Canvas, 344, 514, y0Mini + 61 + 19, MainTexture.ColorBevelLight,
     791        MainTexture.ColorBevelShade);
    792792    RisedTextOut(Canvas, 344, y0Mini + 61, Phrases.Lookup('STARTCONTROLS', 8));
    793793    s := TurnToString(LoadTurn);
     
    805805  else if Page = pgEditMap then
    806806  begin
    807     // DLine(Canvas,344,514,y0Mini+61+19,MainTexture.clBevelLight,MainTexture.clBevelShade);
     807    // DLine(Canvas,344,514,y0Mini+61+19,MainTexture.ColorBevelLight,MainTexture.ColorBevelShade);
    808808    s := Format(Phrases2.Lookup('MAPPROP'),
    809809      [(nMapLandTiles * 100 + 556) div 1112,
     
    818818  if Up2Btn.Visible then
    819819    RFrame(Canvas, Up2Btn.left - 1, Up2Btn.top - 1, Up2Btn.left + 12,
    820       Up2Btn.top + 24, MainTexture.clBevelShade, MainTexture.clBevelLight);
     820      Up2Btn.top + 24, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    821821  if Up1Btn.Visible then
    822822    RFrame(Canvas, Up1Btn.left - 1, Up1Btn.top - 1, Up1Btn.left + 12,
    823       Up1Btn.top + 24, MainTexture.clBevelShade, MainTexture.clBevelLight);
     823      Up1Btn.top + 24, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    824824  if AutoDiffUpBtn.Visible then
    825825    RFrame(Canvas, AutoDiffUpBtn.left - 1, AutoDiffUpBtn.top - 1,
    826       AutoDiffUpBtn.left + 12, AutoDiffUpBtn.top + 24, MainTexture.clBevelShade,
    827       MainTexture.clBevelLight);
     826      AutoDiffUpBtn.left + 12, AutoDiffUpBtn.top + 24, MainTexture.ColorBevelShade,
     827      MainTexture.ColorBevelLight);
    828828  if AutoEnemyUpBtn.Visible then
    829829    RFrame(Canvas, AutoEnemyUpBtn.left - 1, AutoEnemyUpBtn.top - 1,
    830830      AutoEnemyUpBtn.left + 12, AutoEnemyUpBtn.top + 24,
    831       MainTexture.clBevelShade, MainTexture.clBevelLight);
     831      MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    832832  if CustomizeBtn.Visible then
    833833    RFrame(Canvas, CustomizeBtn.left - 1, CustomizeBtn.top - 1,
    834       CustomizeBtn.left + 12, CustomizeBtn.top + 12, MainTexture.clBevelShade,
    835       MainTexture.clBevelLight);
     834      CustomizeBtn.left + 12, CustomizeBtn.top + 12, MainTexture.ColorBevelShade,
     835      MainTexture.ColorBevelLight);
    836836  if List.Visible then
    837837    EditFrame(Canvas, List.BoundsRect, MainTexture);
     
    848848    yMini := y0Mini - MiniMap.Size.Y div 2;
    849849    Frame(Canvas, xMini, yMini, xMini + 3 + MiniMap.Size.X * 2,
    850       yMini + 3 + MiniMap.Size.Y, MainTexture.clBevelLight,
    851       MainTexture.clBevelShade);
     850      yMini + 3 + MiniMap.Size.Y, MainTexture.ColorBevelLight,
     851      MainTexture.ColorBevelShade);
    852852    Frame(Canvas, xMini + 1, yMini + 1, xMini + 2 + MiniMap.Size.X * 2,
    853       yMini + 2 + MiniMap.Size.Y, MainTexture.clBevelShade,
    854       MainTexture.clBevelLight);
     853      yMini + 2 + MiniMap.Size.Y, MainTexture.ColorBevelShade,
     854      MainTexture.ColorBevelLight);
    855855
    856856    s := '';
     
    878878procedure TStartDlg.FormShow(Sender: TObject);
    879879begin
    880   SetMainTextureByAge(-1);
    881   List.Font.Color := MainTexture.clMark;
     880  MainTexture.Age := -1;
     881  List.Font.Color := MainTexture.ColorMark;
    882882
    883883  Fill(EmptyPicture.Canvas, Bounds(0, 0, 64, 64),
    884     Point((wMaintexture - 64) div 2, (hMaintexture - 64) div 2));
     884    Point((Maintexture.Width - 64) div 2, (Maintexture.Height - 64) div 2));
    885885
    886886  DarkenImage(EmptyPicture, 28);
     
    11141114      begin // turn all local players off
    11151115        for I := 1 to PlayerSlots.Count - 1 do
    1116           if PlayersBrain[I].Kind = btTerm then begin
     1116          if Assigned(PlayersBrain[I]) and (PlayersBrain[I].Kind = btTerm) then begin
    11171117            PlayersBrain[I] := nil;
    11181118            PlayerSlots[I].DiffUpBtn.Visible := false;
Note: See TracChangeset for help on using the changeset viewer.