Skip to content

Commit

Permalink
Revert "+i dunno, mostly done re-adding the player-based 3d listener.…
Browse files Browse the repository at this point in the history
…. just need to snatch the vectors.. stopping work because of previous comment saying it sounds wrong."

This reverts commit d9a95b2.
  • Loading branch information
bahstrike committed Aug 3, 2022
1 parent 6916a17 commit abc975b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 29 deletions.
5 changes: 0 additions & 5 deletions PlayerPos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ public Position Position(Config.SoundMode mode)
return Position(DetermineMode(mode));
}

public static bool UsePlayerAs3DListener = false;

public static Mode DetermineMode(Config.SoundMode mode)
{
switch (mode)
Expand All @@ -44,9 +42,6 @@ public static Mode DetermineMode(Config.SoundMode mode)
return Mode.Object;

default:
if (UsePlayerAs3DListener)
return Mode.Object;

return Mode.Camera;
}
}
Expand Down
24 changes: 1 addition & 23 deletions PluginCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ protected override void Startup()
(View["MusicVolume"] as HudHSlider).Position = 35;

(View["PortalMusicEnable"] as HudCheckBox).Checked = true;
(View["UsePlayerAs3DListener"] as HudCheckBox).Checked = false;
};

View["NearestDID"].Hit += delegate (object sender, EventArgs e)
Expand Down Expand Up @@ -319,7 +318,6 @@ protected override void Startup()
(View["MusicVolume"] as HudHSlider).Position = int.Parse(ini.GetKeyString(Core.CharacterFilter.AccountName, "MusicVolume", "35"));

(View["PortalMusicEnable"] as HudCheckBox).Checked = ini.GetKeyString(Core.CharacterFilter.AccountName, "PortalMusicEnable", "1") != "0";
(View["UsePlayerAs3DListener"] as HudCheckBox).Checked = ini.GetKeyString(Core.CharacterFilter.AccountName, "UsePlayerAs3DListener", "0") != "0";
}


Expand Down Expand Up @@ -524,7 +522,6 @@ private void _CharacterFilter_Logoff(object sender, LogoffEventArgs e)
ini.WriteKey(Core.CharacterFilter.AccountName, "MusicVolume", (View["MusicVolume"] as HudHSlider).Position.ToString());

ini.WriteKey(Core.CharacterFilter.AccountName, "PortalMusicEnable", (View["PortalMusicEnable"] as HudCheckBox).Checked ? "1" : "0");
ini.WriteKey(Core.CharacterFilter.AccountName, "UsePlayerAs3DListener", (View["UsePlayerAs3DListener"] as HudCheckBox).Checked ? "1" : "0");
}
}

Expand Down Expand Up @@ -675,7 +672,6 @@ private void Process(double dt, double truedt)

PerfTrack.Reset();

PlayerPos.UsePlayerAs3DListener = (View["UsePlayerAs3DListener"] as HudCheckBox).Checked;

Audio.AllowSound = GetUserEnableAudio();

Expand Down Expand Up @@ -1238,25 +1234,7 @@ private void Process(double dt, double truedt)
PerfTrack.Start("Audio.Process");
{
// do all this based on camera (listener MUST be camera for proper 3d audio without sounding weird)

Vec3 listenPos;
Vec3 listenVel = Vec3.Zero;
Vec3 listenUp;
Vec3 listenForward;

if(PlayerPos.UsePlayerAs3DListener)
{
// object mode

} else
{
// camera mode (default)
listenPos = playerPos.CameraPos.Global;
listenUp = playerPos.CameraMat.Up;
listenForward = playerPos.CameraMat.Forward;
}

Audio.Process(dt, truedt, listenPos, Vec3.Zero, listenUp, listenForward);
Audio.Process(dt, truedt, playerPos.CameraPos.Global, Vec3.Zero, playerPos.CameraMat.Up, playerPos.CameraMat.Forward);
}


Expand Down
1 change: 0 additions & 1 deletion mainView.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<control progid="DecalControls.Slider" name="MusicVolume" left="90" top="70" width="170" height="20" minimum="0" maximum="100" position="35" />

<control progid="DecalControls.CheckBox" name="PortalMusicEnable" left="10" top="100" width="120" height="20" text="Portal Music" checked="True"/>
<control progid="DecalControls.CheckBox" name="UsePlayerAs3DListener" left="160" top="40" width="70" height="20" text="3D from Player" checked="False"/>

<control progid="DecalControls.PushButton" name="FMOD" left="10" top="228" width="50" height="14"/>
<control progid="DecalControls.StaticText" name="FMOD_Credit" left="70" top="231" width="400" height="18" text="Made with FMOD Studio by Firelight Technologies Pty Ltd."/>
Expand Down

0 comments on commit abc975b

Please sign in to comment.