Ignore:
Timestamp:
Jan 15, 2017, 11:47:01 AM (7 years ago)
Author:
chronos
Message:
  • Modified: Unified direct pixel access using TPixelPointer.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Term.pas

    r69 r72  
    40544054var
    40554055  uix, cix, x, y, Loc, i, hw, xm, cm, cmPolOcean, cmPolNone: integer;
    4056   PrevMiniPixel, MiniPixel: PPixel32;
     4056  PrevMiniPixel, MiniPixel: TPixelPointer;
    40574057begin
    40584058  cmPolOcean := GrExt[HGrSystem].Data.Canvas.Pixels[101, 67];
     
    40654065  end;
    40664066  Mini.BeginUpdate;
     4067  MiniPixel.Init(Mini);
     4068  PrevMiniPixel.Init(Mini);
    40674069  for y := 0 to G.ly - 1 do
    40684070  begin
     
    40744076        begin
    40754077          xm := ((x - xwMini) * 2 + i + y and 1 - hw + G.lx * 5) mod (G.lx * 2);
    4076           MiniPixel := GetBitmapPixelPtr(Mini, xm, y);
     4078          MiniPixel.SetXY(xm, y);
    40774079          cm := MiniColors[MyMap[Loc] and fTerrain, i];
    40784080          if ClientMode = cEditMap then
     
    40994101            if y > 0 then begin
    41004102              // 2x2 city dot covers two lines
    4101               PrevMiniPixel := GetBitmapPixelPtr(Mini, xm, y - 1);
    4102               PrevMiniPixel^.B := cm shr 16;
    4103               PrevMiniPixel^.G := cm shr 8 and $FF;
    4104               PrevMiniPixel^.R := cm and $FF;
     4103              PrevMiniPixel.SetXY(xm, y - 1);
     4104              PrevMiniPixel.Pixel^.B := cm shr 16;
     4105              PrevMiniPixel.Pixel^.G := cm shr 8 and $FF;
     4106              PrevMiniPixel.Pixel^.R := cm and $FF;
    41054107            end
    41064108          end
     
    41314133              cm := Tribe[MyRO.Territory[Loc]].Color;
    41324134          end;
    4133           MiniPixel^.B := cm shr 16;
    4134           MiniPixel^.G := cm shr 8 and $FF;
    4135           MiniPixel^.R := cm and $FF;
     4135          MiniPixel.Pixel^.B := cm shr 16;
     4136          MiniPixel.Pixel^.G := cm shr 8 and $FF;
     4137          MiniPixel.Pixel^.R := cm and $FF;
    41364138        end;
    41374139      end;
Note: See TracChangeset for help on using the changeset viewer.