Changeset 95 for trunk/Engine.pas


Ignore:
Timestamp:
May 19, 2024, 6:15:22 PM (6 months ago)
Author:
chronos
Message:
  • Fixed: Hide main menu with Qt5 widgetset.
  • Fixed: Pack audio files and detect alternative Unix location.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Engine.pas

    r93 r95  
    250250    function TextOutWordWrap(Canvas: TCanvas; X, Y: Integer; Text: string; Width: Integer): Integer;
    251251    function GetMenuWidth: Integer;
     252    function GetAudioDir: string;
    252253  public
    253254    ThreadErrorMessage: string;
     
    16411642end;
    16421643
     1644function TEngine.GetAudioDir: string;
     1645{$IFDEF UNIX}
     1646const
     1647  UnixDataDir = '/usr/share/Tunneler';
     1648  UnixAudioDir = UnixDataDir + '/Audio';
     1649{$ENDIF}
     1650begin
     1651  Result := GetCurrentDir + DirectorySeparator + 'Audio';
     1652  {$IFDEF UNIX}
     1653  if not DirectoryExists(Result) and DirectoryExists(UnixAudioDir) then begin
     1654    Result := UnixAudioDir;
     1655    Exit;
     1656  end;
     1657  {$ENDIF}
     1658end;
     1659
    16431660function TEngine.Scale(Value: Integer): Integer;
    16441661begin
     
    21202137  //DefaultAudioSystem := TAudioSystemMPlayer.Create(nil);
    21212138  AudioShot := TSound.Create(nil);
    2122   AudioShot.FileName := GetCurrentDir + '/Audio/GE_KF7_Soviet.wav';
     2139  AudioShot.FileName := GetAudioDir + DirectorySeparator + 'GE_KF7_Soviet.wav';
    21232140  AudioExplode := TSound.Create(nil);
    2124   AudioExplode.FileName := GetCurrentDir + '/Audio/bomb.wav';
     2141  AudioExplode.FileName := GetAudioDir + DirectorySeparator + 'bomb.wav';
    21252142  InitPlayerPool;
    21262143  DigMasks := TObjectList<TMatrixByte>.Create;
Note: See TracChangeset for help on using the changeset viewer.