Ignore:
Timestamp:
Apr 17, 2019, 12:58:41 AM (5 years ago)
Author:
chronos
Message:
  • Modified: Propagate project build mode options to used packages.
  • Added: Check memory leaks using heaptrc.
  • Modified: Update BGRABitmap package.
Location:
GraphicTest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest

    • Property svn:ignore
      •  

        old new  
        88GraphicTest.lps
        99GraphicTest.dbg
         10heaptrclog.trc
  • GraphicTest/Packages/bgrabitmap/bgraspritegl.pas

    r494 r521  
    3232    function GetLayer: Integer; virtual; abstract;
    3333    function GetLocation: TPointF; virtual;
     34    function GetVisible: Boolean; virtual;
    3435    function GetW: Single; virtual; abstract;
    3536    function GetX: Single; virtual; abstract;
     
    4647    procedure SetLocation(AValue: TPointF); virtual;
    4748    procedure SetW(AValue: Single); virtual; abstract;
     49    procedure SetVisible({%H-}AValue: boolean); virtual;
    4850    procedure SetX(AValue: Single); virtual; abstract;
    4951    procedure SetY(AValue: Single); virtual; abstract;
     
    5456    destructor Destroy; override;
    5557    procedure OnDraw; virtual;
    56     procedure OnElapse(AElapsedMs: integer); virtual;
     58    procedure OnElapse({%H-}AElapsedMs: integer); virtual;
    5759    procedure OnTimer; virtual;
    5860    procedure QueryDestroy; virtual; abstract;
     
    7173    property HorizontalAlign: TAlignment read GetHorizontalAlign write SetHorizontalAlign;
    7274    property VerticalAlign: TTextLayout read GetVerticalAlign write SetVerticalAlign;
     75    property Visible : Boolean read GetVisible write SetVisible;
    7376    property Texture : IBGLTexture read GetTexture;
    7477    property Handle  : Pointer read GetHandle;
     
    8689    FQueryDestroy: boolean;
    8790    FLayer: integer;
     91    FHidden: boolean;
    8892    function GetHorizontalAlign: TAlignment; override;
    8993    function GetVerticalAlign: TTextLayout; override;
     
    97101    function GetH: Single; override;
    98102    function GetLayer: Integer; override;
     103    function GetVisible: Boolean; override;
    99104    function GetW: Single; override;
    100105    function GetX: Single; override;
     
    107112    procedure SetH(AValue: Single); override;
    108113    procedure SetLayer(AValue: Integer); override;
     114    procedure SetVisible(AValue: boolean); override;
    109115    procedure SetW(AValue: Single); override;
    110116    procedure SetX(AValue: Single); override;
     
    342348end;
    343349
     350function TBGLDefaultSprite.GetVisible: Boolean;
     351begin
     352  Result:= not FHidden;
     353end;
     354
    344355function TBGLDefaultSprite.GetW: Single;
    345356begin
     
    390401begin
    391402  FLayer:= AValue;
     403end;
     404
     405procedure TBGLDefaultSprite.SetVisible(AValue: boolean);
     406begin
     407  FHidden := not AValue;
    392408end;
    393409
     
    487503end;
    488504
     505function TBGLCustomSprite.GetVisible: Boolean;
     506begin
     507  result := true;
     508end;
     509
    489510procedure TBGLCustomSprite.SetLocation(AValue: TPointF);
    490511begin
    491512  X := AValue.X;
    492513  Y := AValue.Y;
     514end;
     515
     516procedure TBGLCustomSprite.SetVisible(AValue: boolean);
     517begin
     518  raise ENotImplemented.Create('Not implemented in base class');
    493519end;
    494520
     
    536562var NumFrame: integer;
    537563begin
    538   if Texture <> nil then
     564  if Visible and (Texture <> nil) then
    539565    begin
    540566      NumFrame := Trunc(Frame+0.5);
Note: See TracChangeset for help on using the changeset viewer.