Changeset 59 for trunk


Ignore:
Timestamp:
Jan 13, 2017, 6:14:46 PM (8 years ago)
Author:
chronos
Message:
  • Fixed: End-Of-Turn button from CevoComponents package was not visible.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Components/EOTButton.pas

    r14 r59  
    44
    55uses
    6   ButtonBase,
    7   Classes, Graphics, LCLIntf, LCLType;
     6  ButtonBase, Classes, SysUtils, Graphics, LCLIntf, LCLType;
    87
    98const
     
    1615type
    1716  TEOTButton = class(TButtonBase)
     17  public
    1818    constructor Create(aOwner: TComponent); override;
    1919    destructor Destroy; override;
     
    5151// R channel = Color2 amp
    5252type
    53   TLine = array [0 .. 9999, 0 .. 2] of Byte;
     53  TPixel = array [0 .. 2] of Byte;
    5454var
    5555  ix, iy, amp0, amp1, trans, Value: integer;
    56   SrcLine, DstLine: ^TLine;
     56  SrcLine, DstLine: ^TPixel;
    5757begin
     58  Src.BeginUpdate;
     59  Dst.BeginUpdate;
    5860  for iy := 0 to h - 1 do
    5961  begin
    60     SrcLine := Src.ScanLine[ySrc + iy];
    61     DstLine := Dst.ScanLine[yDst + iy];
     62    SrcLine := Src.ScanLine[ySrc + iy] + xSrc * (Src.RawImage.Description.BitsPerPixel shr 3);
     63    DstLine := Dst.ScanLine[yDst + iy] + xDst * (Dst.RawImage.Description.BitsPerPixel shr 3);
    6264    for ix := 0 to w - 1 do
    6365    begin
    64       trans := SrcLine[xSrc + ix, 0] * 2; // green channel = transparency
    65       amp0 := SrcLine[xSrc + ix, 1] * 2;
    66       amp1 := SrcLine[xSrc + ix, 2] * 2;
     66      trans := SrcLine[0] * 2; // green channel = transparency
     67      amp0 := SrcLine[1] * 2;
     68      amp1 := SrcLine[2] * 2;
    6769      if trans <> $FF then
    6870      begin
    69         Value := (DstLine[xDst + ix][0] * trans + (Color2 shr 16 and $FF) * amp1
     71        Value := (DstLine[0] * trans + (Color2 shr 16 and $FF) * amp1
    7072          + (Color0 shr 16 and $FF) * amp0) div $FF;
    7173        if Value < 256 then
    72           DstLine[xDst + ix][0] := Value
     74          DstLine[0] := Value
    7375        else
    74           DstLine[xDst + ix][0] := 255;
    75         Value := (DstLine[xDst + ix][1] * trans + (Color2 shr 8 and $FF) * amp1
     76          DstLine[0] := 255;
     77        Value := (DstLine[1] * trans + (Color2 shr 8 and $FF) * amp1
    7678          + (Color0 shr 8 and $FF) * amp0) div $FF;
    7779        if Value < 256 then
    78           DstLine[xDst + ix][1] := Value
     80          DstLine[1] := Value
    7981        else
    80           DstLine[xDst + ix][1] := 255;
    81         Value := (DstLine[xDst + ix][2] * trans + (Color2 and $FF) * amp1 +
     82          DstLine[1] := 255;
     83        Value := (DstLine[2] * trans + (Color2 and $FF) * amp1 +
    8284          (Color0 and $FF) * amp0) div $FF;
    8385        if Value < 256 then
    84           DstLine[xDst + ix][2] := Value
     86          DstLine[2] := Value
    8587        else
    86           DstLine[xDst + ix][2] := 255;
    87       end
    88     end
     88          DstLine[2] := 255;
     89      end;
     90      SrcLine := Pointer(SrcLine) + (Src.RawImage.Description.BitsPerPixel shr 3);
     91      DstLine := Pointer(DstLine) + (Dst.RawImage.Description.BitsPerPixel shr 3);
     92    end;
    8993  end;
     94  Src.EndUpdate;
     95  Dst.EndUpdate;
    9096end;
    9197
    9298constructor TEOTButton.Create;
    9399begin
    94   inherited Create(aOwner);
     100  inherited;
    95101  Buffer := TBitmap.Create;
    96102  Buffer.PixelFormat := pf24bit;
    97   Buffer.Width := 48;
    98   Buffer.Height := 48;
     103  Buffer.SetSize(48, 48);
     104  Buffer.Canvas.FillRect(0, 0, Buffer.Width, Buffer.Height);
    99105  Back := TBitmap.Create;
    100106  Back.PixelFormat := pf24bit;
    101   Back.Width := 48;
    102   Back.Height := 48;
     107  Back.SetSize(48, 48);
     108  Back.Canvas.FillRect(0, 0, Back.Width, Back.Height);
    103109  ShowHint := true;
    104110  SetBounds(0, 0, 48, 48);
     
    107113destructor TEOTButton.Destroy;
    108114begin
    109   Buffer.Free;
    110   Back.Free;
    111   inherited Destroy;
     115  FreeAndNil(Buffer);
     116  FreeAndNil(Back);
     117  inherited;
    112118end;
    113119
  • trunk/LocalPlayer/Term.pas

    r53 r59  
    41084108            cm := $808080 or cm shr 1; { increase brightness }
    41094109            if y > 0 then begin
    4110               // 2x2 city dot covers two scanlines
     4110              // 2x2 city dot covers two lines
    41114111              PrevMiniPixel := GetBitmapPixelPtr(Mini, xm, y - 1);
    41124112              PrevMiniPixel^.B := cm shr 16;
  • trunk/Protocol.pas

    r39 r59  
    14401440  end;
    14411441
    1442   TJobProgressData = array [0 .. nJob - 1] of record Required, Done,
     1442  TJobProgressData = array [0 .. nJob - 1] of record
     1443    Required, Done,
    14431444    NextTurnPlus: integer;
    14441445  end;
Note: See TracChangeset for help on using the changeset viewer.