Skip to content

Commit

Permalink
Fix regression in song rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
GoaLitiuM committed Oct 3, 2016
1 parent 7eb01c3 commit b39720b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Pulsus/Audio/AudioEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ public void PlayScheduled(double position, SoundInstance soundInstance, int poly

SoundInstanceInternal instance = new SoundInstanceInternal(soundInstance);

if (!dataInstanceCount.ContainsKey(instance.sound))
dataInstanceCount.Add(instance.sound, 0);

double bufferPosition = (position - lastCallback) * ((double)audioSpec.freq);
uint offset = (uint)(bufferPosition * bytesPerSample);
if (offset % 4 != 0)
Expand Down
2 changes: 1 addition & 1 deletion Pulsus/Gameplay/EventPlayers/BGM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public override void OnPlayerStart()

public override void OnBGM(SoundEvent soundEvent)
{
if (seeking)
if (seeking && realtime)
return;

if (soundEvent.sound == null)
Expand Down
4 changes: 2 additions & 2 deletions Pulsus/Gameplay/EventPlayers/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void PlayerReleaseKey(int lane)

private void PressKey(int lane, SoundObject value, NoteEvent pressNote = null)
{
if (seeking)
if (seeking && realtime)
return;

if (skin != null)
Expand Down Expand Up @@ -141,7 +141,7 @@ private void PressKey(int lane, SoundObject value, NoteEvent pressNote = null)

private void ReleaseKey(int lane, SoundObject value = null)
{
if (seeking)
if (seeking && realtime)
return;

if (skin != null)
Expand Down

0 comments on commit b39720b

Please sign in to comment.