Changeset 245 for trunk/Start.pas


Ignore:
Timestamp:
May 21, 2020, 7:58:42 PM (4 years ago)
Author:
chronos
Message:
  • Added: Inactive scaling functions for future HighDPI support.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Start.pas

    r238 r245  
    355355  Bitmap.BeginUpdate;
    356356  MiniPixel := PixelPointer(Bitmap);
    357   for y := 0 to Size.Y - 1 do begin
    358     for x := 0 to Size.X - 1 do begin
     357  for y := 0 to ScaleToNative(Size.Y) - 1 do begin
     358    for x := 0 to ScaleToNative(Size.X) - 1 do begin
    359359      for i := 0 to 1 do begin
    360         xm := (x * 2 + i + y and 1) mod (Size.X * 2);
     360        xm := (x * 2 + i + y and 1) mod (ScaleToNative(Size.X) * 2);
    361361        MiniPixel.SetX(xm);
    362362        cm := Colors
    363           [Map[x * lxmax div Size.X + lxmax *
    364           ((y * (lymax - 1) + Size.Y div 2) div (Size.Y - 1))] and
     363          [Map[ScaleFromNative(x) * lxmax div Size.X + lxmax *
     364          ((ScaleFromNative(y) * (lymax - 1) + Size.Y div 2) div (Size.Y - 1))] and
    365365          fTerrain, i];
    366366        MiniPixel.Pixel^.B := ((cm shr 16) and $FF) * Brightness div 3;
     
    388388    MiniPixel := PixelPointer(Bitmap);
    389389    PrevMiniPixel := PixelPointer(Bitmap, 0, -1);
    390     for y := 0 to Size.Y - 1 do begin
    391       for x := 0 to Size.X - 1 do begin
     390    for y := 0 to ScaleToNative(Size.Y) - 1 do begin
     391      for x := 0 to ScaleToNative(Size.X) - 1 do begin
    392392        for i := 0 to 1 do begin
    393           xm := (x * 2 + i + y and 1) mod (Size.X * 2);
     393          xm := (x * 2 + i + y and 1) mod (ScaleToNative(Size.X) * 2);
    394394          MiniPixel.SetX(xm);
    395           Tile := SaveMap[x + Size.X * y];
     395          Tile := SaveMap[ScaleFromNative(x) + Size.X * ScaleFromNative(y)];
    396396          if Tile and fTerrain = fUNKNOWN then
    397397            cm := $000000
Note: See TracChangeset for help on using the changeset viewer.