Changeset 375 for trunk/Packages


Ignore:
Timestamp:
Apr 24, 2021, 1:51:40 PM (4 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CevoComponents/ScreenTools.pas

    r374 r375  
    5454procedure EditFrame(ca: TCanvas; p: TRect; T: TTexture);
    5555function HexStringToColor(S: string): integer;
     56function ExtractFileNameWithoutExt(const Filename: string): string;
    5657function LoadGraphicFile(Bmp: TBitmap; FileName: string; Options: TLoadGraphicFileOptions = []): boolean;
    5758function LoadGraphicSet(const Name: string): TGraphicSet;
     
    493494end;
    494495
     496function ExtractFileNameWithoutExt(const Filename: string): string;
     497var
     498  P: Integer;
     499begin
     500  Result := Filename;
     501  P := Length(Result);
     502  while P > 0 do begin
     503    case Result[P] of
     504      PathDelim: Exit;
     505      {$ifdef windows}
     506      '/': if ('/' in AllowDirectorySeparators) then Exit;
     507      {$endif}
     508      '.': Exit(Copy(Result, 1, P - 1));
     509    end;
     510    Dec(P);
     511  end;
     512end;
     513
    495514function LoadGraphicSet(const Name: string): TGraphicSet;
    496515var
Note: See TracChangeset for help on using the changeset viewer.