Changeset 58


Ignore:
Timestamp:
Jan 12, 2017, 11:47:00 PM (8 years ago)
Author:
chronos
Message:
  • Fixed: Empire borders for other nations were drawed incorrectly as white rectangle.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/IsoEngine.pas

    r40 r58  
    406406procedure Done;
    407407begin
    408   NoMap.Free;
    409   NoMap := nil;
    410   LandPatch.Free;
    411   LandPatch := nil;
    412   OceanPatch.Free;
    413   OceanPatch := nil;
    414   Borders.Free;
    415   Borders := nil;
     408  FreeAndNil(NoMap);
     409  FreeAndNil(LandPatch);
     410  FreeAndNil(OceanPatch);
     411  FreeAndNil(Borders);
    416412end;
    417413
     
    979975  var
    980976    dx, dy: integer;
    981     Line: ^TLine;
     977    PixelPtr: TPixelPointer;
    982978  begin
    983979    if ShowBorder and (Loc >= 0) and (Loc < G.lx * G.ly) and
     
    989985        if BordersOK and (1 shl p1) = 0 then
    990986        begin
     987          // Clearing before bitblt SRCCOPY shouldn't be neccesary but for some
     988          // reason without it code works different then under Delphi
     989          Borders.Canvas.FillRect(Bounds(0, p1 * (yyt * 2), xxt * 2, yyt * 2));
     990
    991991          LCLIntf.BitBlt(Borders.Canvas.Handle, 0, p1 * (yyt * 2), xxt * 2,
    992992            yyt * 2, GrExt[HGrTerrain].Data.Canvas.Handle,
     
    995995          for dy := 0 to yyt * 2 - 1 do
    996996          begin
    997             Line := Borders.ScanLine[p1 * (yyt * 2) + dy];
    998             for dx := 0 to xxt * 2 - 1 do
    999               if Line[dx, 0] = 99 then
    1000               begin
    1001                 Line[dx, 0] := Tribe[p1].Color shr 16 and $FF;
    1002                 Line[dx, 1] := Tribe[p1].Color shr 8 and $FF;
    1003                 Line[dx, 2] := Tribe[p1].Color and $FF;
    1004               end
     997            PixelPtr.Init(Borders, 0, p1 * (yyt * 2) + dy);
     998            for dx := 0 to xxt * 2 - 1 do begin
     999              if PixelPtr.Pixel^.B = 99 then begin
     1000                PixelPtr.Pixel^.B := Tribe[p1].Color shr 16 and $FF;
     1001                PixelPtr.Pixel^.G := Tribe[p1].Color shr 8 and $FF;
     1002                PixelPtr.Pixel^.R := Tribe[p1].Color and $FF;
     1003              end;
     1004              PixelPtr.NextPixel;
     1005            end;
    10051006          end;
    10061007          Borders.EndUpdate;
Note: See TracChangeset for help on using the changeset viewer.