Changeset 70 for trunk/UEngine.pas


Ignore:
Timestamp:
Jan 11, 2023, 1:15:24 AM (17 months ago)
Author:
chronos
Message:
  • Modified: Play sounds directly with play commands on Linux.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UEngine.pas

    r69 r70  
    77  IntfGraphics, FPImage, LCLType, SpecializedBitmap, GraphType, Math, URectangle,
    88  Syncobjs, UThreading, Forms, DateUtils, UAudioSystem, Generics.Collections,
    9   UWorld, UMatter;
     9  UWorld, UMatter, USound;
    1010
    1111const
     
    243243    CurrentRound: Integer;
    244244    MaxRound: Integer;
    245     AudioShot: TMediaPlayer;
    246     AudioExplode: TMediaPlayer;
     245    AudioShot: TSound;
     246    AudioExplode: TSound;
    247247    DrawDuration: TDatetime;
    248248    constructor Create(AOwner: TComponent); override;
     
    645645    Engine.Redraw;
    646646  end;
    647   if Shield <= 0 then begin
     647  if (Shield <= 0) and not Exploded then begin
    648648    Shield := 0;
    649649    Explosion(Position, ExplosionRange);
     
    18171817  World := TWorld.Create;
    18181818  //DefaultAudioSystem := TAudioSystemMPlayer.Create(nil);
    1819   AudioShot := TMediaPlayer.Create(nil);
    1820   AudioShot.FileName := 'Audio/GE_KF7_Soviet.wav';
    1821   AudioShot.Open;
    1822   AudioExplode := TMediaPlayer.Create(nil);
    1823   AudioExplode.FileName := 'Audio/bomb.wav';
    1824   AudioExplode.Open;
     1819  AudioShot := TSound.Create(nil);
     1820  AudioShot.FileName := GetCurrentDir + '/Audio/GE_KF7_Soviet.wav';
     1821  AudioExplode := TSound.Create(nil);
     1822  AudioExplode.FileName := GetCurrentDir + '/Audio/bomb.wav';
    18251823  InitPlayerPool;
    18261824  DigMasks := TObjectList<TMatrixByte>.Create;
Note: See TracChangeset for help on using the changeset viewer.