Skip to content

Commit

Permalink
floating away
Browse files Browse the repository at this point in the history
  • Loading branch information
ike709 committed Feb 8, 2025
1 parent 721e9e3 commit 835bd6e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion OpenDreamClient/Audio/DreamSoundEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void Initialize() {
_netManager.Disconnect += DisconnectedFromServer;
}

public void PlaySound(int channel, MsgSound.FormatType format, ResourceSound sound, float volume, int offset) {
public void PlaySound(int channel, MsgSound.FormatType format, ResourceSound sound, float volume, float offset) {
if (_audioSystem == null)
_entitySystemManager.Resolve(ref _audioSystem);

Expand Down
2 changes: 1 addition & 1 deletion OpenDreamClient/Audio/IDreamSoundEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace OpenDreamClient.Audio;

public interface IDreamSoundEngine {
void Initialize();
void PlaySound(int channel, MsgSound.FormatType format, ResourceSound sound, float volume, int offset);
void PlaySound(int channel, MsgSound.FormatType format, ResourceSound sound, float volume, float offset);
void StopChannel(int channel);
void StopAllChannels();
}
2 changes: 1 addition & 1 deletion OpenDreamRuntime/DreamConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public void OutputDreamValue(DreamValue value) {
if (value.TryGetValueAsDreamObject<DreamObjectSound>(out var outputObject)) {
ushort channel = (ushort)outputObject.GetVariable("channel").GetValueAsInteger();
ushort volume = (ushort)outputObject.GetVariable("volume").GetValueAsInteger();
int offset = (int)outputObject.GetVariable("offset").UnsafeGetValueAsFloat();
float offset = outputObject.GetVariable("offset").UnsafeGetValueAsFloat();
DreamValue file = outputObject.GetVariable("file");

var msg = new MsgSound() {
Expand Down
4 changes: 2 additions & 2 deletions OpenDreamShared/Network/Messages/MsgSound.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ public enum FormatType : byte {

public ushort Channel;
public ushort Volume;
public int Offset;
public float Offset;
public int? ResourceId;
public FormatType? Format; // TODO: This should probably be sent along with the sound resource instead somehow
//TODO: Frequency and friends

public override void ReadFromBuffer(NetIncomingMessage buffer, IRobustSerializer serializer) {
Channel = buffer.ReadUInt16();
Volume = buffer.ReadUInt16();
Offset = buffer.ReadInt32();
Offset = buffer.ReadFloat();

if (buffer.ReadBoolean()) {
ResourceId = buffer.ReadInt32();
Expand Down

0 comments on commit 835bd6e

Please sign in to comment.