Ignore:
Timestamp:
May 9, 2020, 9:35:25 PM (4 years ago)
Author:
chronos
Message:
  • Fixed: Better High DPI scaling on highdpi branch.
File:
1 edited

Legend:

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

    r210 r212  
    532532  SmallScreen, GameOK, MapValid, skipped, idle: boolean;
    533533
    534   SaveOption: array [0 .. nSaveOption - 1] of integer;
    535   MiniColors: array [0 .. 11, 0 .. 1] of TColor;
     534  SaveOption: array [0..nSaveOption - 1] of integer;
     535  MiniColors: array [0..fTerrain, 0..1] of TColor;
    536536  MainMap: TIsoMap;
    537537  CurrentMoveInfo: record AfterMovePaintRadius, AfterAttackExpeller: integer;
     
    40774077  MiniPixel := PixelPointer(Mini);
    40784078  PrevMiniPixel := PixelPointer(Mini);
    4079   for y := 0 to G.ly - 1 do
    4080   begin
    4081     for x := 0 to G.lx - 1 do
    4082       if MyMap[x + G.lx * y] and fTerrain <> fUNKNOWN then
    4083       begin
    4084         Loc := x + G.lx * y;
     4079  for y := 0 to ScaleToVcl(G.ly) - 1 do
     4080  begin
     4081    for x := 0 to ScaleToVcl(G.lx) - 1 do
     4082      if MyMap[ScaleFromVcl(x) + G.lx * ScaleFromVcl(y)] and fTerrain <> fUNKNOWN then
     4083      begin
     4084        Loc := ScaleFromVcl(x) + G.lx * ScaleFromVcl(y);
    40854085        for i := 0 to 1 do
    40864086        begin
    4087           xm := ((x - xwMini) * 2 + i + y and 1 - hw + G.lx * 5) mod (G.lx * 2);
     4087          xm := ((x - ScaleToVcl(xwMini)) * 2 + i + y and 1 - ScaleToVcl(hw) +
     4088            ScaleToVcl(G.lx) * 5) mod (ScaleToVcl(G.lx) * 2);
    40884089          MiniPixel.SetXY(xm, y);
    40894090          cm := MiniColors[MyMap[Loc] and fTerrain, i];
     
    50795080        dx := 0;
    50805081        dy := 0;
    5081         if Mouse.CursorPos.y < DpiScreen.height - PanelHeight then
    5082           if Mouse.CursorPos.x = 0 then
     5082        if DpiMouse.CursorPos.y < DpiScreen.height - PanelHeight then
     5083          if DpiMouse.CursorPos.x = 0 then
    50835084            dx := -speed // scroll left
    5084           else if Mouse.CursorPos.x = DpiScreen.width - 1 then
     5085          else if DpiMouse.CursorPos.x = DpiScreen.width - 1 then
    50855086            dx := speed; // scroll right
    5086         if Mouse.CursorPos.y = 0 then
     5087        if DpiMouse.CursorPos.y = 0 then
    50875088          dy := -speed // scroll up
    5088         else if (Mouse.CursorPos.y = DpiScreen.height - 1) and
    5089           (Mouse.CursorPos.x >= TerrainBtn.Left + TerrainBtn.width) and
    5090           (Mouse.CursorPos.x < xRightPanel + 10 - 8) then
     5089        else if (DpiMouse.CursorPos.y = DpiScreen.height - 1) and
     5090          (DpiMouse.CursorPos.x >= TerrainBtn.Left + TerrainBtn.width) and
     5091          (DpiMouse.CursorPos.x < xRightPanel + 10 - 8) then
    50915092          dy := speed; // scroll down
    50925093        if (dx <> 0) or (dy <> 0) then
Note: See TracChangeset for help on using the changeset viewer.