(46e39d26c) v0.9.0.4
This commit is contained in:
@@ -202,8 +202,6 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Screens\SubEditorScreen.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Serialization\SerializableEntityEditor.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Sounds\OggSound.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Sounds\OpenAL\Al.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Sounds\OpenAL\Alc.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Sounds\Sound.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Sounds\SoundChannel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Sounds\SoundFilters.cs" />
|
||||
|
||||
@@ -118,6 +118,9 @@
|
||||
<Content Include="MonoGame.Framework.dll.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="OpenTK.dll.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Shaders\solidcolor_opengl.fx" />
|
||||
<Content Include="SharpFont.dll.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
@@ -347,7 +350,7 @@
|
||||
<Import Project="ClientCode.projitems" Label="Shared" />
|
||||
<Import Project="..\BarotraumaShared\SharedCode.projitems" Label="Shared" />
|
||||
<Import Project="..\BarotraumaShared\SharedContent.projitems" Label="Shared" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\Libraries\NuGet\GameAnalytics.Mono.SDK.2.1.6\build\net45\GameAnalytics.Mono.SDK.targets" Condition="Exists('..\..\Libraries\NuGet\GameAnalytics.Mono.SDK.2.1.6\build\net45\GameAnalytics.Mono.SDK.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
@@ -365,9 +368,8 @@
|
||||
<Target Name="AfterBuild">
|
||||
<!-- Write version number to a "Version.txt" file in the output folder -->
|
||||
<GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
|
||||
<Output TaskParameter="Assemblies" ItemName="CurrentAssembly" />
|
||||
<Output TaskParameter="Assemblies" ItemName="CurrentAssembly" />
|
||||
</GetAssemblyIdentity>
|
||||
<Exec Command="echo v%(CurrentAssembly.Version) > $(TargetDir)Version.txt">
|
||||
</Exec>
|
||||
<Exec Command="echo v%(CurrentAssembly.Version) > $(TargetDir)Version.txt"></Exec>
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -117,6 +117,9 @@
|
||||
<Content Include="MonoGame.Framework.dll.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="OpenTK.dll.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Shaders\solidcolor_opengl.fx" />
|
||||
<Content Include="SharpFont.dll.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
|
||||
BIN
Barotrauma/BarotraumaClient/OpenAL32.dll
Normal file
BIN
Barotrauma/BarotraumaClient/OpenAL32.dll
Normal file
Binary file not shown.
25
Barotrauma/BarotraumaClient/OpenTK.dll.config
Normal file
25
Barotrauma/BarotraumaClient/OpenTK.dll.config
Normal file
@@ -0,0 +1,25 @@
|
||||
<configuration>
|
||||
<dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
|
||||
<dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
|
||||
<dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
|
||||
<dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
|
||||
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
|
||||
<dllmap os="linux" dll="libX11" target="libX11.so.6"/>
|
||||
<dllmap os="linux" dll="libXi" target="libXi.so.6"/>
|
||||
<!-- <dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/> -->
|
||||
<dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
|
||||
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
|
||||
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
|
||||
<dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
|
||||
<dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
|
||||
<dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
|
||||
<dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
|
||||
<dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
|
||||
<!-- XQuartz compatibility (X11 on Mac) -->
|
||||
<dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
|
||||
<dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
|
||||
<dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
|
||||
<dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
|
||||
<dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
|
||||
<dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
|
||||
</configuration>
|
||||
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.9.0.3")]
|
||||
[assembly: AssemblyFileVersion("0.9.0.3")]
|
||||
[assembly: AssemblyVersion("0.9.0.4")]
|
||||
[assembly: AssemblyFileVersion("0.9.0.4")]
|
||||
|
||||
@@ -92,9 +92,6 @@ namespace Barotrauma
|
||||
|
||||
public static GameSettings Config;
|
||||
|
||||
public static int DisplayWidth { get; private set; }
|
||||
public static int DisplayHeight { get; private set; }
|
||||
|
||||
private CoroutineHandle loadingCoroutine;
|
||||
private bool hasLoaded;
|
||||
|
||||
@@ -123,7 +120,7 @@ namespace Barotrauma
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
|
||||
public static int GraphicsWidth
|
||||
{
|
||||
get;
|
||||
@@ -195,35 +192,8 @@ namespace Barotrauma
|
||||
FarseerPhysics.Settings.PositionIterations = 1;
|
||||
}
|
||||
|
||||
public void RequestGraphicsSettings()
|
||||
public void ApplyGraphicsSettings()
|
||||
{
|
||||
#if WINDOWS
|
||||
if (WindowActive)
|
||||
{
|
||||
#endif
|
||||
ApplyGraphicsSettings();
|
||||
#if WINDOWS
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
private void ApplyGraphicsSettings()
|
||||
{
|
||||
#if !OSX
|
||||
if (Config.WindowMode == WindowMode.Fullscreen &&
|
||||
GraphicsDeviceManager.IsFullScreen && !GraphicsDeviceManager.HardwareModeSwitch &&
|
||||
(GraphicsDeviceManager.PreferredBackBufferWidth != Config.GraphicsWidth ||
|
||||
GraphicsDeviceManager.PreferredBackBufferHeight != Config.GraphicsHeight))
|
||||
{
|
||||
DisplayMode minMode = GraphicsAdapter.DefaultAdapter.SupportedDisplayModes.First(m => m.Format == SurfaceFormat.Color);
|
||||
GraphicsDeviceManager.PreferredBackBufferWidth = minMode.Width;
|
||||
GraphicsDeviceManager.PreferredBackBufferHeight = minMode.Height;
|
||||
GraphicsDeviceManager.IsFullScreen = false;
|
||||
GraphicsDeviceManager.ApplyChanges();
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
#endif
|
||||
|
||||
GraphicsWidth = Config.GraphicsWidth;
|
||||
GraphicsHeight = Config.GraphicsHeight;
|
||||
if (Config.WindowMode == WindowMode.BorderlessWindowed)
|
||||
@@ -238,14 +208,13 @@ namespace Barotrauma
|
||||
GraphicsDeviceManager.PreferredBackBufferWidth = GraphicsWidth;
|
||||
GraphicsDeviceManager.PreferredBackBufferHeight = GraphicsHeight;
|
||||
SetWindowMode(Config.WindowMode);
|
||||
GraphicsDeviceManager.ApplyChanges();
|
||||
|
||||
defaultViewport = GraphicsDevice.Viewport;
|
||||
|
||||
OnResolutionChanged?.Invoke();
|
||||
}
|
||||
|
||||
private void SetWindowMode(WindowMode windowMode)
|
||||
public void SetWindowMode(WindowMode windowMode)
|
||||
{
|
||||
WindowMode = windowMode;
|
||||
GraphicsDeviceManager.HardwareModeSwitch = Config.WindowMode != WindowMode.BorderlessWindowed;
|
||||
|
||||
@@ -8,7 +8,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using Barotrauma.Extensions;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using Barotrauma.Networking;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
using OpenAL;
|
||||
using OpenTK.Audio.OpenAL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@@ -242,16 +242,6 @@ namespace Barotrauma
|
||||
#endif
|
||||
displayModeDD.OnSelected = (guiComponent, obj) =>
|
||||
{
|
||||
displayModeDD.SelectItem(WindowMode.Fullscreen);
|
||||
}
|
||||
else
|
||||
{
|
||||
displayModeDD.SelectItem(GameMain.Config.WindowMode);
|
||||
}
|
||||
#endif
|
||||
displayModeDD.OnSelected = (guiComponent, obj) =>
|
||||
{
|
||||
PauseOnFocusLost = tickBox.Selected;
|
||||
UnsavedSettings = true;
|
||||
GameMain.Config.WindowMode = (WindowMode)guiComponent.UserData;
|
||||
#if !LINUX
|
||||
@@ -465,7 +455,7 @@ namespace Barotrauma
|
||||
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.05f), audioSliders.RectTransform), TextManager.Get("VoiceChat"));
|
||||
|
||||
IList<string> deviceNames = Alc.GetStringList((IntPtr)null, Alc.CaptureDeviceSpecifier);
|
||||
IList<string> deviceNames = Alc.GetString((IntPtr)null, AlcGetStringList.CaptureDeviceSpecifier);
|
||||
foreach (string name in deviceNames)
|
||||
{
|
||||
DebugConsole.NewMessage(name + " " + name.Length.ToString(), Color.Lime);
|
||||
@@ -484,10 +474,10 @@ namespace Barotrauma
|
||||
|
||||
if (string.IsNullOrWhiteSpace(VoiceCaptureDevice)) VoiceCaptureDevice = deviceNames[0];
|
||||
#if (!OSX)
|
||||
var deviceList = new GUIDropDown(new RectTransform(new Vector2(1.0f, 0.05f), audioSliders.RectTransform), VoiceCaptureDevice, deviceNames.Count);
|
||||
var deviceList = new GUIDropDown(new RectTransform(new Vector2(1.0f, 0.05f), audioSliders.RectTransform), TextManager.EnsureUTF8(VoiceCaptureDevice), deviceNames.Count);
|
||||
foreach (string name in deviceNames)
|
||||
{
|
||||
deviceList.AddItem(name, name);
|
||||
deviceList.AddItem(TextManager.EnsureUTF8(name), name);
|
||||
}
|
||||
deviceList.OnSelected = (GUIComponent selected, object obj) =>
|
||||
{
|
||||
@@ -499,7 +489,7 @@ namespace Barotrauma
|
||||
};
|
||||
#else
|
||||
var suavemente = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.05f), audioSliders.RectTransform),
|
||||
TextManager.AddPunctuation(':', TextManager.Get("CurrentDevice"), VoiceCaptureDevice))
|
||||
TextManager.AddPunctuation(':', TextManager.Get("CurrentDevice"), TextManager.EnsureUTF8(VoiceCaptureDevice)))
|
||||
{
|
||||
ToolTip = TextManager.Get("CurrentDeviceToolTip.OSX"),
|
||||
TextAlignment = Alignment.CenterX
|
||||
@@ -514,7 +504,7 @@ namespace Barotrauma
|
||||
if (VoiceCaptureDevice == deviceNames[0]) return true;
|
||||
|
||||
VoipCapture.ChangeCaptureDevice(deviceNames[0]);
|
||||
suavemente.Text = TextManager.AddPunctuation(':', TextManager.Get("CurrentDevice"), VoiceCaptureDevice);
|
||||
suavemente.Text = TextManager.AddPunctuation(':', TextManager.Get("CurrentDevice"), TextManager.EnsureUTF8(VoiceCaptureDevice));
|
||||
suavemente.Flash(Color.Blue);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Barotrauma
|
||||
{
|
||||
itemInUseWarning = new GUITextBlock(new RectTransform(new Point(10), GUI.Canvas), "",
|
||||
textColor: Color.Orange, color: Color.Black,
|
||||
textAlignment:Alignment.Center, style: "OuterGlow");
|
||||
textAlignment: Alignment.Center, style: "OuterGlow");
|
||||
}
|
||||
return itemInUseWarning;
|
||||
}
|
||||
@@ -662,7 +662,7 @@ namespace Barotrauma
|
||||
new Rectangle(
|
||||
20, 20,
|
||||
GameMain.GraphicsWidth - 40,
|
||||
HUDLayoutSettings.InventoryTopY > 0 ? HUDLayoutSettings.InventoryTopY - 20 : GameMain.GraphicsHeight - 80));
|
||||
HUDLayoutSettings.InventoryTopY > 0 ? HUDLayoutSettings.InventoryTopY - 40 : GameMain.GraphicsHeight - 80));
|
||||
|
||||
foreach (ItemComponent ic in activeHUDs)
|
||||
{
|
||||
@@ -740,9 +740,9 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
if (itemInUseWarning != null && mergedHUDRect != Rectangle.Empty)
|
||||
if (mergedHUDRect != Rectangle.Empty)
|
||||
{
|
||||
itemInUseWarning.Visible = false;
|
||||
if (itemInUseWarning != null) { itemInUseWarning.Visible = false; }
|
||||
foreach (Character otherCharacter in Character.CharacterList)
|
||||
{
|
||||
if (otherCharacter != character &&
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Lidgren.Network;
|
||||
using Microsoft.Xna.Framework;
|
||||
using OpenAL;
|
||||
using OpenTK.Audio.OpenAL;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
@@ -69,7 +69,7 @@ namespace Barotrauma.Networking
|
||||
VoipConfig.SetupEncoding();
|
||||
|
||||
//set up capture device
|
||||
captureDevice = Alc.CaptureOpenDevice(deviceName, VoipConfig.FREQUENCY, Al.FormatMono16, VoipConfig.BUFFER_SIZE * 5);
|
||||
captureDevice = Alc.CaptureOpenDevice(deviceName, VoipConfig.FREQUENCY, ALFormat.Mono16, VoipConfig.BUFFER_SIZE * 5);
|
||||
|
||||
if (captureDevice == IntPtr.Zero)
|
||||
{
|
||||
@@ -88,20 +88,20 @@ namespace Barotrauma.Networking
|
||||
return;
|
||||
}
|
||||
|
||||
int alError = Al.GetError();
|
||||
int alcError = Alc.GetError(captureDevice);
|
||||
if (alcError != Alc.NoError)
|
||||
ALError alError = AL.GetError();
|
||||
AlcError alcError = Alc.GetError(captureDevice);
|
||||
if (alcError != AlcError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to open capture device: " + alcError.ToString() + " (ALC)");
|
||||
}
|
||||
if (alError != Al.NoError)
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to open capture device: " + alError.ToString() + " (AL)");
|
||||
}
|
||||
|
||||
Alc.CaptureStart(captureDevice);
|
||||
alcError = Alc.GetError(captureDevice);
|
||||
if (alcError != Alc.NoError)
|
||||
if (alcError != AlcError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to start capturing: " + alcError.ToString());
|
||||
}
|
||||
@@ -132,11 +132,11 @@ namespace Barotrauma.Networking
|
||||
short[] uncompressedBuffer = new short[VoipConfig.BUFFER_SIZE];
|
||||
while (capturing)
|
||||
{
|
||||
int alcError;
|
||||
Alc.GetInteger(captureDevice, Alc.EnumCaptureSamples, out int sampleCount);
|
||||
AlcError alcError;
|
||||
Alc.GetInteger(captureDevice, AlcGetInteger.CaptureSamples, 1, out int sampleCount);
|
||||
|
||||
alcError = Alc.GetError(captureDevice);
|
||||
if (alcError != Alc.NoError)
|
||||
if (alcError != AlcError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to determine sample count: " + alcError.ToString());
|
||||
}
|
||||
@@ -160,7 +160,7 @@ namespace Barotrauma.Networking
|
||||
}
|
||||
|
||||
alcError = Alc.GetError(captureDevice);
|
||||
if (alcError != Alc.NoError)
|
||||
if (alcError != AlcError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to capture samples: " + alcError.ToString());
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace Barotrauma
|
||||
|
||||
DebugConsole.NewMessage("Display size set to " + GameMain.Config.GraphicsWidth + "x" + GameMain.Config.GraphicsHeight, Microsoft.Xna.Framework.Color.Red);
|
||||
|
||||
game.RequestGraphicsSettings();
|
||||
game.ApplyGraphicsSettings();
|
||||
|
||||
return true;
|
||||
default:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using System;
|
||||
using OpenAL;
|
||||
using OpenTK.Audio.OpenAL;
|
||||
using NVorbis;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Barotrauma.Sounds
|
||||
|
||||
reader = new VorbisReader(filename);
|
||||
|
||||
ALFormat = reader.Channels == 1 ? Al.FormatMono16 : Al.FormatStereo16;
|
||||
ALFormat = reader.Channels == 1 ? ALFormat.Mono16 : ALFormat.Stereo16;
|
||||
SampleRate = reader.SampleRate;
|
||||
|
||||
if (!stream)
|
||||
@@ -35,26 +35,26 @@ namespace Barotrauma.Sounds
|
||||
|
||||
CastBuffer(floatBuffer, shortBuffer, readSamples);
|
||||
|
||||
Al.BufferData(ALBuffer, ALFormat, shortBuffer,
|
||||
AL.BufferData((int)ALBuffer, ALFormat, shortBuffer,
|
||||
readSamples * sizeof(short), SampleRate);
|
||||
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to set buffer data for non-streamed audio! "+Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to set buffer data for non-streamed audio! "+AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
MuffleBuffer(floatBuffer, SampleRate, reader.Channels);
|
||||
|
||||
CastBuffer(floatBuffer, shortBuffer, readSamples);
|
||||
|
||||
Al.BufferData(ALMuffledBuffer, ALFormat, shortBuffer,
|
||||
AL.BufferData((int)ALMuffledBuffer, ALFormat, shortBuffer,
|
||||
readSamples * sizeof(short), SampleRate);
|
||||
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to set buffer data for non-streamed audio! " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to set buffer data for non-streamed audio! " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
reader.Dispose();
|
||||
@@ -98,4 +98,4 @@ namespace Barotrauma.Sounds
|
||||
base.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
using System;
|
||||
using OpenAL;
|
||||
using OpenTK.Audio.OpenAL;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.IO;
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace Barotrauma.Sounds
|
||||
get { return !Stream ? alMuffledBuffer : 0; }
|
||||
}
|
||||
|
||||
public int ALFormat
|
||||
public ALFormat ALFormat
|
||||
{
|
||||
get;
|
||||
protected set;
|
||||
@@ -91,26 +91,26 @@ namespace Barotrauma.Sounds
|
||||
|
||||
if (!stream)
|
||||
{
|
||||
Al.GenBuffer(out alBuffer);
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.GenBuffer(out alBuffer);
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to create OpenAL buffer for non-streamed sound: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to create OpenAL buffer for non-streamed sound: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
if (!Al.IsBuffer(alBuffer))
|
||||
if (!AL.IsBuffer(alBuffer))
|
||||
{
|
||||
throw new Exception("Generated OpenAL buffer is invalid!");
|
||||
}
|
||||
|
||||
Al.GenBuffer(out alMuffledBuffer);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.GenBuffer(out alMuffledBuffer);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to create OpenAL buffer for non-streamed sound: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to create OpenAL buffer for non-streamed sound: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
if (!Al.IsBuffer(alMuffledBuffer))
|
||||
if (!AL.IsBuffer(alMuffledBuffer))
|
||||
{
|
||||
throw new Exception("Generated OpenAL buffer is invalid!");
|
||||
}
|
||||
@@ -186,32 +186,32 @@ namespace Barotrauma.Sounds
|
||||
Owner.KillChannels(this);
|
||||
if (alBuffer != 0)
|
||||
{
|
||||
if (!Al.IsBuffer(alBuffer))
|
||||
if (!AL.IsBuffer(alBuffer))
|
||||
{
|
||||
throw new Exception("Buffer to delete is invalid!");
|
||||
}
|
||||
|
||||
Al.DeleteBuffer(alBuffer); alBuffer = 0;
|
||||
AL.DeleteBuffer(ref alBuffer); alBuffer = 0;
|
||||
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to delete OpenAL buffer for non-streamed sound: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to delete OpenAL buffer for non-streamed sound: " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
if (alMuffledBuffer != 0)
|
||||
{
|
||||
if (!Al.IsBuffer(alMuffledBuffer))
|
||||
if (!AL.IsBuffer(alMuffledBuffer))
|
||||
{
|
||||
throw new Exception("Buffer to delete is invalid!");
|
||||
}
|
||||
|
||||
Al.DeleteBuffer(alMuffledBuffer); alMuffledBuffer = 0;
|
||||
AL.DeleteBuffer(ref alMuffledBuffer); alMuffledBuffer = 0;
|
||||
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to delete OpenAL buffer for non-streamed sound: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to delete OpenAL buffer for non-streamed sound: " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using System;
|
||||
using OpenAL;
|
||||
using OpenTK.Audio.OpenAL;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -15,49 +15,49 @@ namespace Barotrauma.Sounds
|
||||
|
||||
public SoundSourcePool(int sourceCount = SoundManager.SOURCE_COUNT)
|
||||
{
|
||||
int alError = Al.NoError;
|
||||
ALError alError = ALError.NoError;
|
||||
|
||||
ALSources = new uint[sourceCount];
|
||||
for (int i = 0; i < sourceCount; i++)
|
||||
{
|
||||
Al.GenSource(out ALSources[i]);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.GenSource(out ALSources[i]);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Error generating alSource[" + i.ToString() + "]: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Error generating alSource[" + i.ToString() + "]: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
if (!Al.IsSource(ALSources[i]))
|
||||
if (!AL.IsSource(ALSources[i]))
|
||||
{
|
||||
throw new Exception("Generated alSource[" + i.ToString() + "] is invalid!");
|
||||
}
|
||||
|
||||
Al.SourceStop(ALSources[i]);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.SourceStop(ALSources[i]);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Error stopping newly generated alSource[" + i.ToString() + "]: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Error stopping newly generated alSource[" + i.ToString() + "]: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
Al.Sourcef(ALSources[i], Al.MinGain, 0.0f);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.Source(ALSources[i], ALSourcef.MinGain, 0.0f);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Error setting min gain: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Error setting min gain: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
Al.Sourcef(ALSources[i], Al.MaxGain, 1.0f);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.Source(ALSources[i], ALSourcef.MaxGain, 1.0f);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Error setting max gain: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Error setting max gain: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
Al.Sourcef(ALSources[i], Al.RolloffFactor, 1.0f);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.Source(ALSources[i], ALSourcef.RolloffFactor, 1.0f);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Error setting rolloff factor: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Error setting rolloff factor: " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,11 +66,11 @@ namespace Barotrauma.Sounds
|
||||
{
|
||||
for (int i = 0; i < ALSources.Length; i++)
|
||||
{
|
||||
Al.DeleteSource(ALSources[i]);
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.DeleteSource(ref ALSources[i]);
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to delete ALSources[" + i.ToString() + "]: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to delete ALSources[" + i.ToString() + "]: " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
ALSources = null;
|
||||
@@ -95,35 +95,35 @@ namespace Barotrauma.Sounds
|
||||
if (position != null)
|
||||
{
|
||||
uint alSource = Sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex);
|
||||
Al.Sourcei(alSource, Al.SourceRelative, Al.False);
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.Source(alSource, ALSourceb.SourceRelative, false);
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to enable source's relative flag: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to enable source's relative flag: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
Al.Source3f(alSource, Al.Position, position.Value.X, position.Value.Y, position.Value.Z);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.Source(alSource, ALSource3f.Position, position.Value.X, position.Value.Y, position.Value.Z);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to set source's position: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to set source's position: " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint alSource = Sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex);
|
||||
Al.Sourcei(alSource, Al.SourceRelative, Al.True);
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.Source(alSource, ALSourceb.SourceRelative, true);
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to disable source's relative flag: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to disable source's relative flag: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
Al.Source3f(alSource, Al.Position, 0.0f, 0.0f, 0.0f);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.Source(alSource, ALSource3f.Position, 0.0f, 0.0f, 0.0f);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to reset source's position: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to reset source's position: " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,12 +140,12 @@ namespace Barotrauma.Sounds
|
||||
if (ALSourceIndex < 0) return;
|
||||
|
||||
uint alSource = Sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex);
|
||||
Al.Sourcef(alSource, Al.ReferenceDistance, near);
|
||||
AL.Source(alSource, ALSourcef.ReferenceDistance, near);
|
||||
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to set source's reference distance: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to set source's reference distance: " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -161,11 +161,11 @@ namespace Barotrauma.Sounds
|
||||
if (ALSourceIndex < 0) return;
|
||||
|
||||
uint alSource = Sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex);
|
||||
Al.Sourcef(alSource, Al.MaxDistance, far);
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.Source(alSource, ALSourcef.MaxDistance, far);
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to set source's max distance: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to set source's max distance: " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -185,11 +185,11 @@ namespace Barotrauma.Sounds
|
||||
float effectiveGain = gain;
|
||||
if (category != null) effectiveGain *= Sound.Owner.GetCategoryGainMultiplier(category);
|
||||
|
||||
Al.Sourcef(alSource, Al.Gain, effectiveGain);
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.Source(alSource, ALSourcef.Gain, effectiveGain);
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to set source's gain: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to set source's gain: " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -207,11 +207,11 @@ namespace Barotrauma.Sounds
|
||||
if (!IsStream)
|
||||
{
|
||||
uint alSource = Sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex);
|
||||
Al.Sourcei(alSource, Al.Looping, looping ? Al.True : Al.False);
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.Source(alSource, ALSourceb.Looping, looping);
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to set source's looping state: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to set source's looping state: " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -242,41 +242,41 @@ namespace Barotrauma.Sounds
|
||||
if (!IsStream)
|
||||
{
|
||||
uint alSource = Sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex);
|
||||
int playbackPos; Al.GetSourcei(alSource, Al.SampleOffset, out playbackPos);
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
int playbackPos; AL.GetSource(alSource, ALGetSourcei.SampleOffset, out playbackPos);
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to get source's playback position: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to get source's playback position: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
Al.SourceStop(alSource);
|
||||
AL.SourceStop(alSource);
|
||||
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to stop source: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to stop source: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
Al.Sourcei(alSource, Al.Buffer, muffled ? (int)Sound.ALMuffledBuffer : (int)Sound.ALBuffer);
|
||||
AL.BindBufferToSource(alSource,(uint)(muffled ? Sound.ALMuffledBuffer : Sound.ALBuffer));
|
||||
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to bind buffer to source: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to bind buffer to source: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
Al.SourcePlay(alSource);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.SourcePlay(alSource);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to replay source: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to replay source: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
Al.Sourcei(alSource, Al.SampleOffset, playbackPos);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.Source(alSource, ALSourcei.SampleOffset, playbackPos);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to reset playback position: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to reset playback position: " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -324,13 +324,11 @@ namespace Barotrauma.Sounds
|
||||
{
|
||||
if (ALSourceIndex < 0) return false;
|
||||
if (IsStream && !reachedEndSample) return true;
|
||||
int state;
|
||||
Al.GetSourcei(Sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex), Al.SourceState, out state);
|
||||
bool playing = state == Al.Playing;
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
bool playing = AL.GetSourceState(Sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex)) == ALSourceState.Playing;
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to determine playing state from source: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to determine playing state from source: " + AL.GetErrorString(alError));
|
||||
}
|
||||
return playing;
|
||||
}
|
||||
@@ -359,47 +357,47 @@ namespace Barotrauma.Sounds
|
||||
{
|
||||
if (!IsStream)
|
||||
{
|
||||
Al.Sourcei(sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex), Al.Buffer, 0);
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.BindBufferToSource(sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex), 0);
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to reset source buffer: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to reset source buffer: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
if (!Al.IsBuffer(sound.ALBuffer))
|
||||
if (!AL.IsBuffer(sound.ALBuffer))
|
||||
{
|
||||
throw new Exception(sound.Filename + " has an invalid buffer!");
|
||||
}
|
||||
|
||||
uint alBuffer = sound.Owner.GetCategoryMuffle(category) || muffle ? sound.ALMuffledBuffer : sound.ALBuffer;
|
||||
Al.Sourcei(sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex), Al.Buffer, (int)alBuffer);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.BindBufferToSource(sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex), alBuffer);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to bind buffer to source (" + ALSourceIndex.ToString() + ":" + sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex) + "," + sound.ALBuffer.ToString() + "): " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to bind buffer to source (" + ALSourceIndex.ToString() + ":" + sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex) + "," + sound.ALBuffer.ToString() + "): " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
Al.SourcePlay(sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex));
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.SourcePlay(sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex));
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to play source: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to play source: " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Al.Sourcei(sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex), Al.Buffer, (int)sound.ALBuffer);
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.BindBufferToSource(sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex), (uint)sound.ALBuffer);
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to reset source buffer: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to reset source buffer: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
Al.Sourcei(sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex), Al.Looping, Al.False);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.Source(sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex), ALSourceb.Looping, false);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to set stream looping state: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to set stream looping state: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
streamShortBuffer = new short[STREAM_BUFFER_SIZE];
|
||||
@@ -408,15 +406,15 @@ namespace Barotrauma.Sounds
|
||||
emptyBuffers = new List<uint>();
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
Al.GenBuffer(out streamBuffers[i]);
|
||||
AL.GenBuffer(out streamBuffers[i]);
|
||||
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to generate stream buffers: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to generate stream buffers: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
if (!Al.IsBuffer(streamBuffers[i]))
|
||||
if (!AL.IsBuffer(streamBuffers[i]))
|
||||
{
|
||||
throw new Exception("Generated streamBuffer[" + i.ToString() + "] is invalid!");
|
||||
}
|
||||
@@ -447,57 +445,57 @@ namespace Barotrauma.Sounds
|
||||
{
|
||||
if (ALSourceIndex >= 0)
|
||||
{
|
||||
Al.SourceStop(Sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex));
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.SourceStop(Sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex));
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to stop source: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to stop source: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
if (IsStream)
|
||||
{
|
||||
uint alSource = Sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex);
|
||||
|
||||
Al.SourceStop(alSource);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.SourceStop(alSource);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to stop streamed source: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to stop streamed source: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
int buffersToUnqueue = 0;
|
||||
uint[] unqueuedBuffers = null;
|
||||
int[] unqueuedBuffers = null;
|
||||
|
||||
buffersToUnqueue = 0;
|
||||
Al.GetSourcei(alSource, Al.BuffersProcessed, out buffersToUnqueue);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.GetSource(alSource, ALGetSourcei.BuffersProcessed, out buffersToUnqueue);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to determine processed buffers from streamed source: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to determine processed buffers from streamed source: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
unqueuedBuffers = new uint[buffersToUnqueue];
|
||||
Al.SourceUnqueueBuffers(alSource, buffersToUnqueue, unqueuedBuffers);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
unqueuedBuffers = new int[buffersToUnqueue];
|
||||
AL.SourceUnqueueBuffers((int)alSource, buffersToUnqueue, unqueuedBuffers);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to unqueue buffers from streamed source: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to unqueue buffers from streamed source: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
Al.Sourcei(alSource, Al.Buffer, 0);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
|
||||
AL.BindBufferToSource(alSource, 0);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to reset buffer for streamed source: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to reset buffer for streamed source: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
Al.DeleteBuffer(streamBuffers[i]);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.DeleteBuffer(ref streamBuffers[i]);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to delete streamBuffers[" + i.ToString() + "] ("+streamBuffers[i].ToString()+"): " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to delete streamBuffers[" + i.ToString() + "] ("+streamBuffers[i].ToString()+"): " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -505,11 +503,11 @@ namespace Barotrauma.Sounds
|
||||
}
|
||||
else
|
||||
{
|
||||
Al.Sourcei(Sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex), Al.Buffer, 0);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.BindBufferToSource(Sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex), 0);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to unbind buffer to non-streamed source: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to unbind buffer to non-streamed source: " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -528,49 +526,47 @@ namespace Barotrauma.Sounds
|
||||
{
|
||||
uint alSource = Sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex);
|
||||
|
||||
int state;
|
||||
Al.GetSourcei(Sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex), Al.SourceState, out state);
|
||||
bool playing = state == Al.Playing;
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
bool playing = AL.GetSourceState(alSource) == ALSourceState.Playing;
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to determine playing state from streamed source: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to determine playing state from streamed source: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
int buffersToUnqueue = 0;
|
||||
uint[] unqueuedBuffers = null;
|
||||
int[] unqueuedBuffers = null;
|
||||
if (!startedPlaying)
|
||||
{
|
||||
buffersToUnqueue = 0;
|
||||
Al.GetSourcei(alSource, Al.BuffersProcessed, out buffersToUnqueue);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.GetSource(alSource, ALGetSourcei.BuffersProcessed, out buffersToUnqueue);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to determine processed buffers from streamed source: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to determine processed buffers from streamed source: " + AL.GetErrorString(alError));
|
||||
}
|
||||
|
||||
unqueuedBuffers = new uint[buffersToUnqueue+emptyBuffers.Count];
|
||||
Al.SourceUnqueueBuffers(alSource, buffersToUnqueue, unqueuedBuffers);
|
||||
unqueuedBuffers = new int[buffersToUnqueue+emptyBuffers.Count];
|
||||
AL.SourceUnqueueBuffers((int)alSource, buffersToUnqueue, unqueuedBuffers);
|
||||
for (int i = 0; i < emptyBuffers.Count; i++)
|
||||
{
|
||||
unqueuedBuffers[buffersToUnqueue + i] = emptyBuffers[i];
|
||||
unqueuedBuffers[buffersToUnqueue + i] = (int)emptyBuffers[i];
|
||||
}
|
||||
buffersToUnqueue += emptyBuffers.Count;
|
||||
emptyBuffers.Clear();
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to unqueue buffers from streamed source: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to unqueue buffers from streamed source: " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
startedPlaying = false;
|
||||
buffersToUnqueue = 4;
|
||||
unqueuedBuffers = new uint[4];
|
||||
unqueuedBuffers = new int[4];
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
unqueuedBuffers[i] = streamBuffers[i];
|
||||
unqueuedBuffers[i] = (int)streamBuffers[i];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -616,20 +612,20 @@ namespace Barotrauma.Sounds
|
||||
|
||||
if (readSamples > 0)
|
||||
{
|
||||
Al.BufferData<short>(unqueuedBuffers[i], Sound.ALFormat, buffer, readSamples, Sound.SampleRate);
|
||||
AL.BufferData<short>(unqueuedBuffers[i], Sound.ALFormat, buffer, readSamples, Sound.SampleRate);
|
||||
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to assign data to stream buffer: " +
|
||||
Al.GetErrorString(alError) + ": " + unqueuedBuffers[i].ToString() + "/" + unqueuedBuffers.Length + ", readSamples: " + readSamples);
|
||||
AL.GetErrorString(alError) + ": " + unqueuedBuffers[i].ToString() + "/" + unqueuedBuffers.Length + ", readSamples: " + readSamples);
|
||||
}
|
||||
|
||||
Al.SourceQueueBuffer(alSource, unqueuedBuffers[i]);
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.SourceQueueBuffer((int)alSource, unqueuedBuffers[i]);
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to queue buffer[" + i.ToString() + "] to stream: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to queue buffer[" + i.ToString() + "] to stream: " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
else if (readSamples < 0)
|
||||
@@ -641,11 +637,10 @@ namespace Barotrauma.Sounds
|
||||
emptyBuffers.Add((uint)unqueuedBuffers[i]);
|
||||
}
|
||||
}
|
||||
|
||||
Al.GetSourcei(alSource, Al.SourceState, out state);
|
||||
if (state != Al.Playing)
|
||||
|
||||
if (AL.GetSourceState(alSource) != ALSourceState.Playing)
|
||||
{
|
||||
Al.SourcePlay(alSource);
|
||||
AL.SourcePlay(alSource);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Threading;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
using OpenAL;
|
||||
using OpenTK.Audio.OpenAL;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
@@ -20,7 +20,7 @@ namespace Barotrauma.Sounds
|
||||
}
|
||||
|
||||
private IntPtr alcDevice;
|
||||
private IntPtr alcContext;
|
||||
private OpenTK.ContextHandle alcContext;
|
||||
|
||||
public enum SourcePoolIndex
|
||||
{
|
||||
@@ -42,11 +42,11 @@ namespace Barotrauma.Sounds
|
||||
{
|
||||
if (Disabled) { return; }
|
||||
listenerPosition = value;
|
||||
Al.Listener3f(Al.Position,value.X,value.Y,value.Z);
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.Listener(ALListener3f.Position,value.X,value.Y,value.Z);
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to set listener position: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to set listener position: " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59,11 +59,11 @@ namespace Barotrauma.Sounds
|
||||
{
|
||||
if (Disabled) { return; }
|
||||
listenerOrientation[0] = value.X; listenerOrientation[1] = value.Y; listenerOrientation[2] = value.Z;
|
||||
Al.Listenerfv(Al.Orientation, listenerOrientation);
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.Listener(ALListenerfv.Orientation, ref listenerOrientation);
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to set listener target vector: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to set listener target vector: " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,11 +74,11 @@ namespace Barotrauma.Sounds
|
||||
{
|
||||
if (Disabled) { return; }
|
||||
listenerOrientation[3] = value.X; listenerOrientation[4] = value.Y; listenerOrientation[5] = value.Z;
|
||||
Al.Listenerfv(Al.Orientation, listenerOrientation);
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.Listener(ALListenerfv.Orientation, ref listenerOrientation);
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to set listener up vector: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to set listener up vector: " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -92,11 +92,11 @@ namespace Barotrauma.Sounds
|
||||
if (Disabled) { return; }
|
||||
if (Math.Abs(ListenerGain - value) < 0.001f) { return; }
|
||||
listenerGain = value;
|
||||
Al.Listenerf(Al.Gain, listenerGain);
|
||||
int alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
AL.Listener(ALListenerf.Gain, listenerGain);
|
||||
ALError alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
throw new Exception("Failed to set listener gain: " + Al.GetErrorString(alError));
|
||||
throw new Exception("Failed to set listener gain: " + AL.GetErrorString(alError));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -126,8 +126,8 @@ namespace Barotrauma.Sounds
|
||||
return;
|
||||
}
|
||||
|
||||
int alcError = Alc.GetError(alcDevice);
|
||||
if (alcError != Alc.NoError)
|
||||
AlcError alcError = Alc.GetError(alcDevice);
|
||||
if (alcError != AlcError.NoError)
|
||||
{
|
||||
//The audio device probably wasn't ready, this happens quite often
|
||||
//Just wait a while and try again
|
||||
@@ -136,7 +136,7 @@ namespace Barotrauma.Sounds
|
||||
alcDevice = Alc.OpenDevice(null);
|
||||
|
||||
alcError = Alc.GetError(alcDevice);
|
||||
if (alcError != Alc.NoError)
|
||||
if (alcError != AlcError.NoError)
|
||||
{
|
||||
DebugConsole.ThrowError("Error initializing ALC device: " + alcError.ToString() + ". Disabling audio playback...");
|
||||
Disabled = true;
|
||||
@@ -161,14 +161,14 @@ namespace Barotrauma.Sounds
|
||||
}
|
||||
|
||||
alcError = Alc.GetError(alcDevice);
|
||||
if (alcError != Alc.NoError)
|
||||
if (alcError != AlcError.NoError)
|
||||
{
|
||||
DebugConsole.ThrowError("Error after assigning ALC context: " + alcError.ToString() + ". Disabling audio playback...");
|
||||
Disabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
int alError = Al.NoError;
|
||||
ALError alError = ALError.NoError;
|
||||
|
||||
sourcePools = new SoundSourcePool[2];
|
||||
sourcePools[(int)SourcePoolIndex.Default] = new SoundSourcePool(SOURCE_COUNT);
|
||||
@@ -177,12 +177,12 @@ namespace Barotrauma.Sounds
|
||||
sourcePools[(int)SourcePoolIndex.Voice] = new SoundSourcePool(8);
|
||||
playingChannels[(int)SourcePoolIndex.Voice] = new SoundChannel[8];
|
||||
|
||||
Al.DistanceModel(Al.LinearDistanceClamped);
|
||||
AL.DistanceModel(ALDistanceModel.LinearDistanceClamped);
|
||||
|
||||
alError = Al.GetError();
|
||||
if (alError != Al.NoError)
|
||||
alError = AL.GetError();
|
||||
if (alError != ALError.NoError)
|
||||
{
|
||||
DebugConsole.ThrowError("Error setting distance model: " + Al.GetErrorString(alError) + ". Disabling audio playback...");
|
||||
DebugConsole.ThrowError("Error setting distance model: " + AL.GetErrorString(alError) + ". Disabling audio playback...");
|
||||
Disabled = true;
|
||||
return;
|
||||
}
|
||||
@@ -239,7 +239,7 @@ namespace Barotrauma.Sounds
|
||||
{
|
||||
if (Disabled || srcInd < 0 || srcInd >= sourcePools[(int)poolIndex].ALSources.Length) return 0;
|
||||
|
||||
if (!Al.IsSource(sourcePools[(int)poolIndex].ALSources[srcInd]))
|
||||
if (!AL.IsSource(sourcePools[(int)poolIndex].ALSources[srcInd]))
|
||||
{
|
||||
throw new Exception("alSources[" + srcInd.ToString() + "] is invalid!");
|
||||
}
|
||||
@@ -276,8 +276,8 @@ namespace Barotrauma.Sounds
|
||||
{
|
||||
for (int i = 0; i < sourcePools[0].ALSources.Length; i++)
|
||||
{
|
||||
Al.Sourcef(sourcePools[0].ALSources[i], Al.MaxGain, i == ind ? 1.0f : 0.0f);
|
||||
Al.Sourcef(sourcePools[0].ALSources[i], Al.MinGain, 0.0f);
|
||||
AL.Source(sourcePools[0].ALSources[i], ALSourcef.MaxGain, i == ind ? 1.0f : 0.0f);
|
||||
AL.Source(sourcePools[0].ALSources[i], ALSourcef.MinGain, 0.0f);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -514,7 +514,7 @@ namespace Barotrauma.Sounds
|
||||
sourcePools[(int)SourcePoolIndex.Default]?.Dispose();
|
||||
sourcePools[(int)SourcePoolIndex.Voice]?.Dispose();
|
||||
|
||||
if (!Alc.MakeContextCurrent(IntPtr.Zero))
|
||||
if (!Alc.MakeContextCurrent(OpenTK.ContextHandle.Zero))
|
||||
{
|
||||
throw new Exception("Failed to detach the current ALC context! (error code: " + Alc.GetError(alcDevice).ToString() + ")");
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using OpenAL;
|
||||
using OpenTK.Audio.OpenAL;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
@@ -21,7 +21,7 @@ namespace Barotrauma.Sounds
|
||||
|
||||
public VideoSound(SoundManager owner, string filename, int sampleRate, Video vid) : base(owner, filename, true, false)
|
||||
{
|
||||
ALFormat = Al.FormatStereo16;
|
||||
ALFormat = ALFormat.Stereo16;
|
||||
SampleRate = sampleRate;
|
||||
|
||||
sampleQueue = new Queue<short[]>();
|
||||
@@ -110,4 +110,4 @@ namespace Barotrauma.Sounds
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using Barotrauma.Networking;
|
||||
using Microsoft.Xna.Framework;
|
||||
using OpenAL;
|
||||
using OpenTK.Audio.OpenAL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace Barotrauma.Sounds
|
||||
{
|
||||
VoipConfig.SetupEncoding();
|
||||
|
||||
ALFormat = Al.FormatMono16;
|
||||
ALFormat = ALFormat.Mono16;
|
||||
SampleRate = VoipConfig.FREQUENCY;
|
||||
|
||||
queue = q;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
<AllowedReferenceRelatedFileExtensions>.pdb</AllowedReferenceRelatedFileExtensions>
|
||||
<AllowedReferenceRelatedFileExtensions>.pdb</AllowedReferenceRelatedFileExtensions>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>..\BarotraumaShared\Icon.ico</ApplicationIcon>
|
||||
@@ -39,7 +39,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseWindows|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>..\bin\ReleaseWindows\</OutputPath>
|
||||
<DefineConstants>TRACE;WINDOWS;CLIENT;X64</DefineConstants>
|
||||
<DefineConstants>TRACE;WINDOWS;CLIENT</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
@@ -49,7 +49,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugWindows|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>..\bin\DebugWindows\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;WINDOWS;CLIENT;X64</DefineConstants>
|
||||
<DefineConstants>TRACE;WINDOWS;CLIENT;DEBUG</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
@@ -60,7 +60,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseWindows|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>..\bin\x86\ReleaseWindows\</OutputPath>
|
||||
<DefineConstants>TRACE;WINDOWS;CLIENT;X86</DefineConstants>
|
||||
<DefineConstants>TRACE;WINDOWS;CLIENT</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
@@ -70,7 +70,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugWindows|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>..\bin\x86\DebugWindows\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;WINDOWS;CLIENT;X86</DefineConstants>
|
||||
<DefineConstants>TRACE;WINDOWS;CLIENT;DEBUG</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
@@ -95,6 +95,9 @@
|
||||
<Reference Include="NVorbis, Version=0.8.6.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\Libraries\NuGet\NVorbis.0.8.6\lib\net35\NVorbis.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="OpenTK, Version=3.0.1.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\Libraries\NuGet\OpenTK.3.0.1\lib\net20\OpenTK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="RestSharp, Version=105.2.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\Libraries\NuGet\RestSharp.105.2.3\lib\net45\RestSharp.dll</HintPath>
|
||||
@@ -212,18 +215,18 @@
|
||||
<Content Include="Shaders\losshader.fx" />
|
||||
<Content Include="Shaders\postprocess.fx" />
|
||||
<Content Include="Shaders\watershader.fx" />
|
||||
<Content Include="wrap_oal.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="MonoGame.Framework.dll.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="OpenTK.dll.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="SharpFont.dll.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="soft_oal_x64.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="soft_oal_x86.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
|
||||
@@ -303,7 +306,7 @@
|
||||
<Import Project="ClientCode.projitems" Label="Shared" />
|
||||
<Import Project="..\BarotraumaShared\SharedCode.projitems" Label="Shared" />
|
||||
<Import Project="..\BarotraumaShared\SharedContent.projitems" Label="Shared" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\Libraries\NuGet\GameAnalytics.Mono.SDK.2.1.6\build\net45\GameAnalytics.Mono.SDK.targets" Condition="Exists('..\..\Libraries\NuGet\GameAnalytics.Mono.SDK.2.1.6\build\net45\GameAnalytics.Mono.SDK.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<package id="NLog" version="4.3.8" targetFramework="net45" />
|
||||
<package id="nVLC" version="3.0.0" targetFramework="net45" />
|
||||
<package id="NVorbis" version="0.8.6" targetFramework="net45" />
|
||||
<package id="OpenTK" version="3.0.1" targetFramework="net45" />
|
||||
<package id="RestSharp" version="105.2.3" targetFramework="net45" />
|
||||
<package id="SharpDX" version="4.2.0" targetFramework="net45" />
|
||||
<package id="SharpDX.Direct2D1" version="4.2.0" targetFramework="net45" />
|
||||
|
||||
BIN
Barotrauma/BarotraumaClient/wrap_oal.dll
Normal file
BIN
Barotrauma/BarotraumaClient/wrap_oal.dll
Normal file
Binary file not shown.
@@ -159,14 +159,8 @@ namespace Barotrauma
|
||||
public void StartRound(Level level, bool reloadSub = true, bool loadSecondSub = false, bool mirrorLevel = false)
|
||||
{
|
||||
#if CLIENT
|
||||
if (GameMain.Client == null)
|
||||
{
|
||||
GameMain.LightManager.LosMode = GameMain.Config.LosMode;
|
||||
}
|
||||
else
|
||||
{
|
||||
GameMain.LightManager.LosEnabled = GameMain.Client.CharacterInfo != null;
|
||||
}
|
||||
GameMain.LightManager.LosEnabled = GameMain.Client == null || GameMain.Client.CharacterInfo != null;
|
||||
if (GameMain.Client == null) GameMain.LightManager.LosMode = GameMain.Config.LosMode;
|
||||
#endif
|
||||
this.Level = level;
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,3 +1,35 @@
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v0.9.0.4
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
- Fixed "Steam authentication failed" errors when trying to reconnect to a server after cancelling the
|
||||
connection.
|
||||
- Fixed clients occasionally failing to spawn items when playing using a different language than the server,
|
||||
which caused them to get kicked.
|
||||
- Fixed extra cargo failing to spawn in multiplayer when playing using a different language than the server.
|
||||
- Fixed legacy items failing to load if a sub is saved with a language other than English and the language
|
||||
then changed to something else.
|
||||
- Fixed excessively small password input box when connecting to servers.
|
||||
- Fixed a bug that occasionally caused items to drop from the inventory when moving items between
|
||||
inventory slots in the multiplayer.
|
||||
- Prevent junction boxes from getting damaged due to overvoltage in the engineering tutorial.
|
||||
- Fixed structures getting scaled incorrectly when cloning a structure with a non-default scale in the
|
||||
submarine editor.
|
||||
- Fixed occasional crashes when leaving a multiplayer session while the "cinematic" at the end of the round
|
||||
is still playing.
|
||||
- Fixed items not being moved to the humanhusk's inventory when a huskified player dies (= clothes and
|
||||
other gear seemed to magically disappear when the character "resurrected" as an AI husk).
|
||||
- Fixed clients not seeing turrets rotating at their end when another client is operating the turret.
|
||||
- Fixed hitscan projectiles (revolver rounds) going through walls if the weapon is fired while its
|
||||
barrel is partially inside the wall.
|
||||
- Fixed welding tools being able to weld doors and burn characters through walls.
|
||||
- Fixed bots reporting leaks when there are holes in the interior walls.
|
||||
- Fixes to the colliders of some of the shuttle wall pieces.
|
||||
- Fixed Linux version crashing when attempting to browse for files in the Steam Workshop menu.
|
||||
- Fixed credits not resizing when resolution is changed.
|
||||
- Added an upper limit to impact damage done to ragdolls, preventing characters from getting instakilled if
|
||||
a Moloch or another large monster smashes against the sub hard enough.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v0.9.0.3
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user