Ignore:
Timestamp:
Nov 30, 2023, 10:16:14 PM (12 months ago)
Author:
chronos
Message:
  • Modified: Updated high dpi branch from trunk.
  • Modified: Use generics.collections instead of fgl.
  • Modified: Compile with Delphi syntax.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • branches/highdpi/MiniMap.pas

    r464 r465  
    11{$INCLUDE Switches.inc}
    2 unit UMiniMap;
     2unit MiniMap;
    33
    44interface
     
    3737
    3838uses
    39   ScreenTools, UPixelPointer, Global, GameServer, IsoEngine, Tribes;
     39  ScreenTools, PixelPointer, Global, GameServer, IsoEngine, Tribes;
    4040
    4141const
     
    162162procedure TMiniMap.PaintRandom(Brightness, StartLandMass: Integer; WorldSize: TPoint);
    163163var
    164   i, x, y, xm, cm: Integer;
     164  i, x, y, xm: Integer;
     165  cm: Int64;
    165166  MiniPixel: TPixelPointer;
    166167  Map: ^TTileList;
     
    172173  Bitmap.SetSize(Size.X * 2, Size.Y);
    173174  Bitmap.BeginUpdate;
    174   MiniPixel := PixelPointer(Bitmap);
     175  MiniPixel := TPixelPointer.Create(Bitmap);
    175176  for y := 0 to ScaleToNative(Size.Y) - 1 do begin
    176177    for x := 0 to ScaleToNative(Size.X) - 1 do begin
     
    193194procedure TMiniMap.PaintFile(SaveMap: TMapArray);
    194195var
    195   i, x, y, xm, cm, Tile, OwnColor, EnemyColor: integer;
     196  cm: Int64;
     197  i, x, y, xm, Tile, OwnColor, EnemyColor: integer;
    196198  MiniPixel: TPixelPointer;
    197199  PrevMiniPixel: TPixelPointer;
     
    203205  if Mode = mmPicture then begin
    204206    Bitmap.BeginUpdate;
    205     MiniPixel := PixelPointer(Bitmap);
    206     PrevMiniPixel := PixelPointer(Bitmap, 0, -1);
     207    MiniPixel := TPixelPointer.Create(Bitmap);
     208    PrevMiniPixel := TPixelPointer.Create(Bitmap, 0, -1);
    207209    for y := 0 to ScaleToNative(Size.Y) - 1 do begin
    208210      for x := 0 to ScaleToNative(Size.X) - 1 do begin
     
    211213          MiniPixel.SetX(xm);
    212214          Tile := SaveMap[ScaleFromNative(x) + Size.X * ScaleFromNative(y)];
     215          if Tile > 11 then Tile := fUnknown;
    213216          if Tile and fTerrain = fUNKNOWN then
    214217            cm := $000000
     
    264267  Bitmap.SetSize(Size.X * 2, Size.Y);
    265268  Bitmap.BeginUpdate;
    266   MiniPixel := PixelPointer(Bitmap);
    267   PrevMiniPixel := PixelPointer(Bitmap, 0, -1);
     269  MiniPixel := TPixelPointer.Create(Bitmap);
     270  PrevMiniPixel := TPixelPointer.Create(Bitmap, 0, -1);
    268271  for y := 0 to ScaleToNative(Size.Y) - 1 do begin
    269272    for x := 0 to ScaleToNative(Size.X) - 1 do begin
     
    328331end;
    329332
    330 
    331333end.
    332334
     335
     336
Note: See TracChangeset for help on using the changeset viewer.