Ignore:
Timestamp:
Jan 8, 2017, 7:14:56 PM (7 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/IsoEngine.pas

    r21 r28  
    343343  Mask24.Assign(GrExt[HGrTerrain].Mask);
    344344  Mask24.PixelFormat := pf24bit;
     345  Mask24.BeginUpdate;
    345346  for ySrc := 0 to TerrainIconLines - 1 do
    346347  begin
     
    358359            Border := false;
    359360        if Border then
    360           inc(TSpriteSize[i].Left) until not Border or
    361             (TSpriteSize[i].Left = xxt * 2 - 1);
    362         TSpriteSize[i].Top := 0;
    363         repeat
    364           Border := true;
    365           for x := 0 to xxt * 2 - 1 do
    366             if MaskLine[TSpriteSize[i].Top]^[1 + xSrc * (xxt * 2 + 1) + x, 0] = 0
    367             then
     361          inc(TSpriteSize[i].Left);
     362      until not Border or
     363        (TSpriteSize[i].Left = xxt * 2 - 1);
     364      TSpriteSize[i].Top := 0;
     365      repeat
     366        Border := true;
     367        for x := 0 to xxt * 2 - 1 do
     368          if MaskLine[TSpriteSize[i].Top]^[1 + xSrc * (xxt * 2 + 1) + x, 0] = 0
     369          then
     370            Border := false;
     371        if Border then
     372          inc(TSpriteSize[i].Top);
     373      until not Border or
     374        (TSpriteSize[i].Top = yyt * 3 - 1);
     375      TSpriteSize[i].Right := xxt * 2;
     376      repeat
     377        Border := true;
     378        for y := 0 to yyt * 3 - 1 do
     379          if MaskLine[y]^[xSrc * (xxt * 2 + 1) + TSpriteSize[i].Right, 0] = 0
     380          then
     381            Border := false;
     382        if Border then
     383          dec(TSpriteSize[i].Right);
     384      until not Border or
     385        (TSpriteSize[i].Right = TSpriteSize[i].Left);
     386      TSpriteSize[i].Bottom := yyt * 3;
     387      repeat
     388        Border := true;
     389        for x := 0 to xxt * 2 - 1 do
     390          if MaskLine[TSpriteSize[i].Bottom - 1]^
     391            [1 + xSrc * (xxt * 2 + 1) + x, 0] = 0 then
    368392              Border := false;
    369           if Border then
    370             inc(TSpriteSize[i].Top) until not Border or
    371               (TSpriteSize[i].Top = yyt * 3 - 1);
    372           TSpriteSize[i].Right := xxt * 2;
    373           repeat
    374             Border := true;
    375             for y := 0 to yyt * 3 - 1 do
    376               if MaskLine[y]^[xSrc * (xxt * 2 + 1) + TSpriteSize[i].Right, 0] = 0
    377               then
    378                 Border := false;
    379             if Border then
    380               dec(TSpriteSize[i].Right) until not Border or
    381                 (TSpriteSize[i].Right = TSpriteSize[i].Left);
    382             TSpriteSize[i].Bottom := yyt * 3;
    383             repeat
    384               Border := true;
    385               for x := 0 to xxt * 2 - 1 do
    386                 if MaskLine[TSpriteSize[i].Bottom - 1]^
    387                   [1 + xSrc * (xxt * 2 + 1) + x, 0] = 0 then
    388                   Border := false;
    389               if Border then
    390                 dec(TSpriteSize[i].Bottom) until not Border or
    391                   (TSpriteSize[i].Bottom = TSpriteSize[i].Top);
    392             end
    393           end;
    394           Mask24.Free;
    395 
    396           if Borders <> nil then
    397             Borders.Free;
    398           Borders := TBitmap.Create;
    399           Borders.PixelFormat := pf24bit;
    400           Borders.Width := xxt * 2;
    401           Borders.Height := (yyt * 2) * nPl;
    402           BordersOK := 0;
    403         end;
     393        if Border then
     394          dec(TSpriteSize[i].Bottom);
     395      until not Border or
     396        (TSpriteSize[i].Bottom = TSpriteSize[i].Top);
     397    end
     398  end;
     399  Mask24.EndUpdate;
     400  Mask24.Free;
     401
     402  if Borders <> nil then
     403    Borders.Free;
     404  Borders := TBitmap.Create;
     405  Borders.PixelFormat := pf24bit;
     406  Borders.Width := xxt * 2;
     407  Borders.Height := (yyt * 2) * nPl;
     408  BordersOK := 0;
     409end;
    404410
    405411        procedure Done;
     
    10081014                    1 + 8 * (xxt * 2 + 1),
    10091015                    1 + yyt + 16 * (yyt * 3 + 1), SRCCOPY);
     1016                  Borders.BeginUpdate;
    10101017                  for dy := 0 to yyt * 2 - 1 do
    10111018                  begin
     
    10191026                      end
    10201027                  end;
     1028                  Borders.EndUpdate;
    10211029                  BordersOK := BordersOK or 1 shl p1;
    10221030                end;
     
    13401348            Line: ^TLine;
    13411349          begin
     1350            FOutput.BeginUpdate;
    13421351            for y := y0 to y1 - 1 do
    13431352            begin
     
    13531362              else
    13541363                MakeDark(@Line[x0], x1 - x0);
    1355             end
     1364            end;
     1365            FOutput.EndUpdate;
    13561366          end;
    13571367
Note: See TracChangeset for help on using the changeset viewer.