diff --git a/src/game/g_sound.pas b/src/game/g_sound.pas
index 074d037c29da38b5f77c4652b71665fa08d382ed..b37cd1f896219f277f714e6e372104794a508ede 100644 (file)
--- a/src/game/g_sound.pas
+++ b/src/game/g_sound.pas
function SetByName(SN: String): Boolean;
function SetCoords(X, Y: Integer; Volume: Single): Boolean;
- property Loop: Boolean read FLoop write FLoop;
+ property Loop: Boolean read FMusic write FMusic;
property Name: String read FName;
end;
uses
e_log, SysUtils, g_console, g_options, WADEDITOR,
- g_game, g_basic, g_items, g_map, fmod, fmodtypes, Math,
+ g_game, g_basic, g_items, g_map, Math,
g_language;
type
for a := 0 to High(SoundArray) do
if SoundArray[a].Name = SoundName then
begin
- Result := e_PlaySoundVolume(SoundArray[a].ID, gSoundLevel/255.0);
+ Result := (e_PlaySoundVolume(SoundArray[a].ID, gSoundLevel/255.0) >= 0);
Exit;
end;
for a := 0 to High(SoundArray) do
if SoundArray[a].Name = SoundName then
begin
- Result := e_PlaySoundPanVolume(SoundArray[a].ID, Pan, Volume * (gSoundLevel/255.0));
+ Result := (e_PlaySoundPanVolume(SoundArray[a].ID, Pan, Volume * (gSoundLevel/255.0)) >= 0);
Exit;
end;
Pan, Vol: Single;
begin
if PlaySoundAt(X, Y, Pan, Vol) then
- Result := e_PlaySoundPanVolume(ID, Pan, Vol * (gSoundLevel/255.0))
+ Result := (e_PlaySoundPanVolume(ID, Pan, Vol * (gSoundLevel/255.0)) >= 0)
else
Result := False;
end;
if SoundArray[a].Name = SoundName then
begin
if PlaySoundAt(X, Y, Pan, Vol) then
- Result := e_PlaySoundPanVolume(SoundArray[a].ID,
- Pan, Vol * (gSoundLevel/255.0));
+ Result := (e_PlaySoundPanVolume(SoundArray[a].ID, Pan, Vol * (gSoundLevel/255.0)) >= 0);
Exit;
end;
FreeMem(SoundData);
end
else
- e_WriteLog(Format('WAD Reader error: %s', [WAD.GetLastErrorStr]), MSG_WARNING);
+ begin
+ //e_WriteLog(Format('WAD Reader error: %s', [WAD.GetLastErrorStr]), MSG_WARNING);
+ end;
WAD.Free();
-
- if not ok then
+ if (not ok) then
begin
+{$IFNDEF HEADLESS}
if isMusic then
e_WriteLog(Format('Error loading music %s', [Resource]), MSG_WARNING)
else
e_WriteLog(Format('Error loading sound %s', [Resource]), MSG_WARNING);
Exit;
+{$ENDIF}
end;
-
Result := True;
end;
FreeMem(SoundData);
end
else
- e_WriteLog(Format('WAD Reader error: %s', [WAD.GetLastErrorStr]), MSG_WARNING);
+ begin
+ //e_WriteLog(Format('WAD Reader error: %s', [WAD.GetLastErrorStr]), MSG_WARNING);
+ end;
WAD.Free();
-
- if not ok then
+ if (not ok) then
begin
+{$IFNDEF HEADLESS}
if isMusic then
e_WriteLog(Format('Error loading music %s', [Resource]), MSG_WARNING)
else
e_WriteLog(Format('Error loading sound %s', [Resource]), MSG_WARNING);
Exit;
+{$ENDIF}
end;
-
Result := True;
end;