Ignore:
Timestamp:
May 14, 2020, 10:39:45 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Optimized drawing in Wonders window.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Wonders.pas

    r206 r230  
    8787procedure TWondersDlg.PaintBackgroundShape;
    8888const
    89   darken = 24;
     89  Darken = 24;
    9090  // space=pi/120;
    9191  amax0 = 15734; // 1 shl 16*tan(pi/12-space);
     
    103103  C: Integer;
    104104  Ch: Integer;
    105   Line: array [0..1] of TPixelPointer;
     105  Line: array [0..3] of TPixelPointer;
    106106begin
    107107  Offscreen.BeginUpdate;
    108   Line[0] := PixelPointer(Offscreen);
    109   Line[1] := PixelPointer(Offscreen);
     108  Line[0] := PixelPointer(Offscreen, Center.X, Center.Y);
     109  Line[1] := PixelPointer(Offscreen, Center.X, Center.Y - 1);
     110  Line[2] := PixelPointer(Offscreen, Center.X - 1, Center.Y);
     111  Line[3] := PixelPointer(Offscreen, Center.X - 1, Center.Y - 1);
    110112  for Y := 0 to 127 do begin
    111113    for X := 0 to 179 do begin
     
    115117        ((r >= 32 * 64 * 90 * 90) and (ax < amax2 * X) and
    116118        ((ax < amax0 * X) or (ax > amin2 * X)) or (ax > amin1 * X) and
    117         ((ax < amax1 * X) or (ax > amin3 * X))) then
    118         for i := 0 to 1 do
    119           for ch := 0 to 2 do begin
    120             Line[0].SetXY(Center.X + X, Center.Y + Y);
    121             Line[1].SetXY(Center.X + X, Center.Y - 1 - Y);
    122             c := Line[i].Pixel^.Planes[ch] - darken;
    123             if c < 0 then Line[i].Pixel^.Planes[ch] := 0
    124               else Line[i].Pixel^.Planes[ch] := c;
    125             Line[0].SetXY(Center.X - 1 - X, Center.Y + Y);
    126             Line[1].SetXY(Center.X - 1 - X, Center.Y - 1 - Y);
    127             c := Line[i].Pixel^.Planes[ch] - darken;
    128             if c < 0 then Line[i].Pixel^.Planes[ch] := 0
    129               else Line[i].Pixel^.Planes[ch] := c;
    130           end;
    131     end;
     119        ((ax < amax1 * X) or (ax > amin3 * X))) then begin
     120        for ch := 0 to 2 do begin
     121          c := Line[0].Pixel^.Planes[ch] - Darken;
     122          if c < 0 then Line[0].Pixel^.Planes[ch] := 0
     123            else Line[0].Pixel^.Planes[ch] := c;
     124          c := Line[1].Pixel^.Planes[ch] - Darken;
     125          if c < 0 then Line[1].Pixel^.Planes[ch] := 0
     126            else Line[1].Pixel^.Planes[ch] := c;
     127          c := Line[2].Pixel^.Planes[ch] - Darken;
     128          if c < 0 then Line[2].Pixel^.Planes[ch] := 0
     129            else Line[2].Pixel^.Planes[ch] := c;
     130          c := Line[3].Pixel^.Planes[ch] - Darken;
     131          if c < 0 then Line[3].Pixel^.Planes[ch] := 0
     132            else Line[3].Pixel^.Planes[ch] := c;
     133        end;
     134      end;
     135      Line[0].NextPixel;
     136      Line[1].NextPixel;
     137      Line[2].PreviousPixel;
     138      Line[3].PreviousPixel;
     139    end;
     140    Line[0].NextLine;
     141    Line[1].PreviousLine;
     142    Line[2].NextLine;
     143    Line[3].PreviousLine;
    132144  end;
    133145  Offscreen.EndUpdate;
     
    217229              ySizeBig + 6, (wMaintexture - ClientWidth) div 2,
    218230              (hMaintexture - ClientHeight) div 2);
    219             DarkIcon(I);
     231            //DarkIcon(I);
    220232          end;
    221233        -2: // destroyed
Note: See TracChangeset for help on using the changeset viewer.