diff --git a/src/Etterna/Actor/Gameplay/ArrowEffects.cpp b/src/Etterna/Actor/Gameplay/ArrowEffects.cpp index 5b9e91acba..b28e743c40 100644 --- a/src/Etterna/Actor/Gameplay/ArrowEffects.cpp +++ b/src/Etterna/Actor/Gameplay/ArrowEffects.cpp @@ -142,9 +142,7 @@ ArrowEffects::Update() auto pStyle = GAMESTATE->GetCurrentStyle(PLAYER_1); auto pCols = pStyle->m_ColumnInfo; - const auto& position = GAMESTATE->m_bIsUsingStepTiming - ? GAMESTATE->m_pPlayerState->m_Position - : GAMESTATE->m_Position; + const auto& position = GAMESTATE->m_Position; const auto field_zoom = GAMESTATE->m_pPlayerState->m_NotefieldZoom; const float* effects = GAMESTATE->m_pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects; @@ -339,7 +337,7 @@ ArrowEffects::GetYOffset(const PlayerState* pPlayerState, bIsPastPeakOut = true; float fYOffset = 0; - const auto& position = pPlayerState->GetDisplayedPosition(); + const auto& position = GAMESTATE->m_Position; const auto fSongBeat = position.m_fSongBeatVisible; auto pn = pPlayerState->m_PlayerNumber; @@ -680,7 +678,7 @@ ArrowEffects::GetRotationZ(const PlayerState* pPlayerState, // As usual, enable dizzy hold heads at your own risk. -Wolfman2000 if (fEffects[PlayerOptions::EFFECT_DIZZY] != 0 && (DIZZY_HOLD_HEADS || !bIsHoldHead)) { - const auto fSongBeat = pPlayerState->m_Position.m_fSongBeatVisible; + const auto fSongBeat = GAMESTATE->m_Position.m_fSongBeatVisible; auto fDizzyRotation = fNoteBeat - fSongBeat; fDizzyRotation *= fEffects[PlayerOptions::EFFECT_DIZZY]; fDizzyRotation = fmodf(fDizzyRotation, 2 * PI); @@ -697,7 +695,7 @@ ArrowEffects::ReceptorGetRotationZ(const PlayerState* pPlayerState) float fRotation = 0; if (fEffects[PlayerOptions::EFFECT_CONFUSION] != 0) { - auto fConfRotation = pPlayerState->m_Position.m_fSongBeatVisible; + auto fConfRotation = GAMESTATE->m_Position.m_fSongBeatVisible; fConfRotation *= fEffects[PlayerOptions::EFFECT_CONFUSION]; fConfRotation = fmodf(fConfRotation, 2 * PI); fConfRotation *= -180 / PI; @@ -887,7 +885,7 @@ ArrowEffects::GetGlow(int iCol, float ArrowEffects::GetBrightness(const PlayerState* pPlayerState, float fNoteBeat) { - const auto fSongBeat = pPlayerState->m_Position.m_fSongBeatVisible; + const auto fSongBeat = GAMESTATE->m_Position.m_fSongBeatVisible; const auto fBeatsUntilStep = fNoteBeat - fSongBeat; auto fBrightness = SCALE(fBeatsUntilStep, 0, -1, 1.f, 0.f); diff --git a/src/Etterna/Actor/Gameplay/NoteDisplay.cpp b/src/Etterna/Actor/Gameplay/NoteDisplay.cpp index 4d717dcc67..5a20029b78 100644 --- a/src/Etterna/Actor/Gameplay/NoteDisplay.cpp +++ b/src/Etterna/Actor/Gameplay/NoteDisplay.cpp @@ -630,7 +630,7 @@ NoteDisplay::DrawHoldsInRange( const auto note_upcoming = NoteRowToBeat(start_row) > - m_pPlayerState->GetDisplayedPosition().m_fSongBeat; + GAMESTATE->m_Position.m_fSongBeat; any_upcoming |= note_upcoming; } return any_upcoming; @@ -656,12 +656,11 @@ NoteDisplay::DrawTapsInRange( // was in NoteField, but those aren't available here. // Well, anyone who has to investigate hitting it can use a debugger to // discover the values, hopefully. -Kyz - ASSERT_M( - NoteRowToBeat(tap_row) > -2000, - ssprintf("Invalid tap_row: %i, %f %f", - tap_row, - m_pPlayerState->GetDisplayedPosition().m_fSongBeat, - m_pPlayerState->GetDisplayedPosition().m_fMusicSeconds)); + ASSERT_M(NoteRowToBeat(tap_row) > -2000, + ssprintf("Invalid tap_row: %i, %f %f", + tap_row, + GAMESTATE->m_Position.m_fSongBeat, + GAMESTATE->m_Position.m_fMusicSeconds)); // See if there is a hold step that begins on this index. // Only do this if the noteskin cares. @@ -710,7 +709,7 @@ NoteDisplay::DrawTapsInRange( : field_args.fail_fade); any_upcoming |= NoteRowToBeat(tap_row) > - m_pPlayerState->GetDisplayedPosition().m_fSongBeat; + GAMESTATE->m_Position.m_fSongBeat; if (!PREFSMAN->m_FastNoteRendering) { DISPLAY->ClearZBuffer(); @@ -752,8 +751,8 @@ NoteDisplay::SetActiveFrame(float fNoteBeat, /* -inf ... inf */ const auto fBeatOrSecond = cache->m_bAnimationBasedOnBeats - ? m_pPlayerState->m_Position.m_fSongBeat - : m_pPlayerState->m_Position.m_fMusicSeconds; + ? GAMESTATE->m_Position.m_fSongBeat + : GAMESTATE->m_Position.m_fMusicSeconds; /* -len ... +len */ auto fPercentIntoAnimation = fmodf(fBeatOrSecond, fAnimationLength); /* -1 ... 1 */ @@ -1815,8 +1814,7 @@ void NoteColumnRenderer::UpdateReceptorGhostStuff(Actor* receptor) const { const auto* const player_state = m_field_render_args->player_state; - const auto song_beat = - player_state->GetDisplayedPosition().m_fSongBeatVisible; + const auto song_beat = GAMESTATE->m_Position.m_fSongBeatVisible; // sp_* will be filled with the settings from the splines. // ae_* will be filled with the settings from ArrowEffects. // The two together will be applied to the actor. @@ -1890,9 +1888,7 @@ NoteColumnRenderer::UpdateReceptorGhostStuff(Actor* receptor) const void NoteColumnRenderer::DrawPrimitives() { - m_column_render_args.song_beat = - m_field_render_args->player_state->GetDisplayedPosition() - .m_fSongBeatVisible; + m_column_render_args.song_beat = GAMESTATE->m_Position.m_fSongBeatVisible; m_column_render_args.pos_handler = &NCR_current.m_pos_handler; m_column_render_args.rot_handler = &NCR_current.m_rot_handler; m_column_render_args.zoom_handler = &NCR_current.m_zoom_handler; diff --git a/src/Etterna/Actor/Gameplay/NoteField.cpp b/src/Etterna/Actor/Gameplay/NoteField.cpp index 3e2f0d6784..e3a766e672 100644 --- a/src/Etterna/Actor/Gameplay/NoteField.cpp +++ b/src/Etterna/Actor/Gameplay/NoteField.cpp @@ -344,8 +344,7 @@ NoteField::Update(float fDeltaTime) // update m_fBoardOffsetPixels, m_fCurrentBeatLastUpdate, // m_fYPosCurrentBeatLastUpdate - const auto fCurrentBeat = - m_pPlayerState->GetDisplayedPosition().m_fSongBeat; + const auto fCurrentBeat = GAMESTATE->m_Position.m_fSongBeat; const auto bTweeningOn = m_sprBoard->GetCurrentDiffuseAlpha() >= 0.98 && m_sprBoard->GetCurrentDiffuseAlpha() < 1.00; // HACK @@ -634,13 +633,12 @@ FindDisplayedBeats(const PlayerState* pPlayerState, int iDrawDistanceAfterTargetsPixels, int iDrawDistanceBeforeTargetsPixels) { - auto fFirstBeatToDraw = - pPlayerState->GetDisplayedPosition().m_fSongBeatVisible; + auto fFirstBeatToDraw = GAMESTATE->m_Position.m_fSongBeatVisible; auto fLastBeatToDraw = fFirstBeatToDraw; const auto fSpeedMultiplier = pPlayerState->GetDisplayedTiming().GetDisplayedSpeedPercent( - pPlayerState->GetDisplayedPosition().m_fSongBeatVisible, - pPlayerState->GetDisplayedPosition().m_fMusicSecondsVisible); + GAMESTATE->m_Position.m_fSongBeatVisible, + GAMESTATE->m_Position.m_fMusicSecondsVisible); bool bBoomerang; { @@ -696,11 +694,9 @@ FindDisplayedBeats(const PlayerState* pPlayerState, if (fSpeedMultiplier < 0.75f) { fFirstBeatToDraw = - std::min(fFirstBeatToDraw, - pPlayerState->GetDisplayedPosition().m_fSongBeat + 16); + std::min(fFirstBeatToDraw, GAMESTATE->m_Position.m_fSongBeat + 16); fLastBeatToDraw = - std::min(fLastBeatToDraw, - pPlayerState->GetDisplayedPosition().m_fSongBeat + 16); + std::min(fLastBeatToDraw, GAMESTATE->m_Position.m_fSongBeat + 16); } firstBeat = fFirstBeatToDraw; diff --git a/src/Etterna/Actor/Gameplay/Player.cpp b/src/Etterna/Actor/Gameplay/Player.cpp index 02a740f73f..86490284e3 100644 --- a/src/Etterna/Actor/Gameplay/Player.cpp +++ b/src/Etterna/Actor/Gameplay/Player.cpp @@ -574,7 +574,7 @@ Player::Load() m_LastTapNoteScore = TNS_None; // The editor can start playing in the middle of the song. - const auto iNoteRow = BeatToNoteRow(m_pPlayerState->m_Position.m_fSongBeat); + const auto iNoteRow = BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat); m_iFirstUncrossedRow = iNoteRow - 1; m_pJudgedRows->Reset(iNoteRow); @@ -734,7 +734,7 @@ Player::Reload() m_LastTapNoteScore = TNS_None; - const auto iNoteRow = BeatToNoteRow(m_pPlayerState->m_Position.m_fSongBeat); + const auto iNoteRow = BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat); m_iFirstUncrossedRow = iNoteRow - 1; m_pJudgedRows->Reset(iNoteRow); @@ -934,7 +934,7 @@ void Player::UpdateHoldsAndRolls(float fDeltaTime, const std::chrono::steady_clock::time_point& now) { - const auto fSongBeat = m_pPlayerState->m_Position.m_fSongBeat; + const auto fSongBeat = GAMESTATE->m_Position.m_fSongBeat; const auto iSongRow = BeatToNoteRow(fSongBeat); // handle Autoplay for rolls if (m_pPlayerState->m_PlayerController != PC_HUMAN) { @@ -1036,10 +1036,10 @@ Player::UpdateHoldsAndRolls(float fDeltaTime, void Player::UpdateCrossedRows(const std::chrono::steady_clock::time_point& now) { - const auto iRowNow = BeatToNoteRow(m_pPlayerState->m_Position.m_fSongBeat); + const auto iRowNow = BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat); if (iRowNow >= 0) { if (GAMESTATE->IsPlayerEnabled(m_pPlayerState)) { - if (m_pPlayerState->m_Position.m_bDelay) { + if (GAMESTATE->m_Position.m_bDelay) { if (!m_bDelay) { m_bDelay = true; } @@ -1727,7 +1727,7 @@ Player::GetClosestNote(int col, } // Get the current time, previous time, and next time. - const auto fNoteTime = m_pPlayerState->m_Position.m_fMusicSeconds; + const auto fNoteTime = GAMESTATE->m_Position.m_fMusicSeconds; const auto fNextTime = m_Timing->WhereUAtBro(iNextIndex); const auto fPrevTime = m_Timing->WhereUAtBro(iPrevIndex); @@ -1813,7 +1813,7 @@ Player::GetClosestNonEmptyRow(int iNoteRow, } // Get the current time, previous time, and next time. - const auto fNoteTime = m_pPlayerState->m_Position.m_fMusicSeconds; + const auto fNoteTime = GAMESTATE->m_Position.m_fMusicSeconds; const auto fNextTime = m_Timing->WhereUAtBro(iNextRow); const auto fPrevTime = m_Timing->WhereUAtBro(iPrevRow); @@ -1850,7 +1850,7 @@ Player::DoTapScoreNone() } if (PENALIZE_TAP_SCORE_NONE && m_pPlayerState != nullptr) { - SetJudgment(BeatToNoteRow(m_pPlayerState->m_Position.m_fSongBeat), + SetJudgment(BeatToNoteRow(GAMESTATE->m_Position.m_fSongBeat), -1, TAP_EMPTY, TNS_Miss, @@ -1863,7 +1863,7 @@ void Player::ScoreAllActiveHoldsLetGo() { if (PENALIZE_TAP_SCORE_NONE) { - const auto fSongBeat = m_pPlayerState->m_Position.m_fSongBeat; + const auto fSongBeat = GAMESTATE->m_Position.m_fSongBeat; const auto iSongRow = BeatToNoteRow(fSongBeat); // Score all active holds to NotHeld @@ -1962,17 +1962,16 @@ Player::Step(int col, std::chrono::steady_clock::now() - tm; auto stepAgo = stepDelta.count() - padStickSeconds; - const auto fLastBeatUpdate = - m_pPlayerState->m_Position.m_LastBeatUpdate.Ago(); + const auto fLastBeatUpdate = GAMESTATE->m_Position.m_LastBeatUpdate.Ago(); const auto fPositionSeconds = - m_pPlayerState->m_Position.m_fMusicSeconds - stepAgo; + GAMESTATE->m_Position.m_fMusicSeconds - stepAgo; const auto fTimeSinceStep = stepAgo; // idk if this is the correct value for input logs but we'll use them to // test -mina ok this is 100% not the place to do this // m_pPlayerStageStats->InputData.emplace_back(fPositionSeconds); - auto fSongBeat = m_pPlayerState->m_Position.m_fSongBeat; + auto fSongBeat = GAMESTATE->m_Position.m_fSongBeat; if (GAMESTATE->m_pCurSteps != nullptr) { fSongBeat = m_Timing->GetBeatFromElapsedTime(fPositionSeconds); @@ -2077,11 +2076,11 @@ Player::Step(int col, if (iSongRow < skipstart || iSongRow > static_cast(nerv.size()) - 10) { iStepSearchRows = max(BeatToNoteRow(m_Timing->GetBeatFromElapsedTime( - m_pPlayerState->m_Position.m_fMusicSeconds + + GAMESTATE->m_Position.m_fMusicSeconds + StepSearchDistance)) - iSongRow, iSongRow - BeatToNoteRow(m_Timing->GetBeatFromElapsedTime( - m_pPlayerState->m_Position.m_fMusicSeconds - + GAMESTATE->m_Position.m_fMusicSeconds - StepSearchDistance))) + ROWS_PER_BEAT; } else { @@ -2148,7 +2147,7 @@ Player::Step(int col, * GAMESTATE->m_LastBeatUpdate. Figure out what the music time * is as of now. */ const auto fCurrentMusicSeconds = - m_pPlayerState->m_Position.m_fMusicSeconds + + GAMESTATE->m_Position.m_fMusicSeconds + (fLastBeatUpdate * GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate); @@ -2648,7 +2647,7 @@ Player::UpdateTapNotesMissedOlderThan(float fMissIfOlderThanSeconds) // fMissIfOlderThanThisBeat ); int iMissIfOlderThanThisRow; const auto fEarliestTime = - m_pPlayerState->m_Position.m_fMusicSeconds - fMissIfOlderThanSeconds; + GAMESTATE->m_Position.m_fMusicSeconds - fMissIfOlderThanSeconds; { TimingData::GetBeatArgs beat_info; beat_info.elapsed_time = fEarliestTime; @@ -2710,7 +2709,7 @@ Player::UpdateJudgedRows(float /*fDeltaTime*/) { // Look into the future only as far as we need to const auto iEndRow = BeatToNoteRow(m_Timing->GetBeatFromElapsedTime( - m_pPlayerState->m_Position.m_fMusicSeconds + + GAMESTATE->m_Position.m_fMusicSeconds + GetMaxStepDistanceSeconds())); auto bAllJudged = true; @@ -3379,7 +3378,7 @@ Player::SetCombo(unsigned int iCombo, unsigned int iMisses) auto bPastBeginning = false; bPastBeginning = - m_pPlayerState->m_Position.m_fMusicSeconds > + GAMESTATE->m_Position.m_fMusicSeconds > GAMESTATE->m_pCurSteps->GetLengthSeconds() * PERCENT_UNTIL_COLOR_COMBO; if (m_bSendJudgmentAndComboMessages) { diff --git a/src/Etterna/Actor/Gameplay/PlayerReplay.cpp b/src/Etterna/Actor/Gameplay/PlayerReplay.cpp index 79bea029e1..3270d2c91e 100644 --- a/src/Etterna/Actor/Gameplay/PlayerReplay.cpp +++ b/src/Etterna/Actor/Gameplay/PlayerReplay.cpp @@ -141,7 +141,7 @@ PlayerReplay::UpdateHoldsAndRolls( float fDeltaTime, const std::chrono::steady_clock::time_point& now) { - const auto fSongBeat = m_pPlayerState->m_Position.m_fSongBeat; + const auto fSongBeat = GAMESTATE->m_Position.m_fSongBeat; const auto iSongRow = BeatToNoteRow(fSongBeat); // Auto tap rolls @@ -229,7 +229,7 @@ PlayerReplay::Update(float fDeltaTime) ActorFrame::Update(fDeltaTime); - const auto fSongBeat = m_pPlayerState->m_Position.m_fSongBeat; + const auto fSongBeat = GAMESTATE->m_Position.m_fSongBeat; const auto iSongRow = BeatToNoteRow(fSongBeat); ArrowEffects::SetCurrentOptions( @@ -401,7 +401,7 @@ PlayerReplay::UpdateTapNotesMissedOlderThan(float fMissIfOlderThanSeconds) { int iMissIfOlderThanThisRow; const auto fEarliestTime = - m_pPlayerState->m_Position.m_fMusicSeconds - fMissIfOlderThanSeconds; + GAMESTATE->m_Position.m_fMusicSeconds - fMissIfOlderThanSeconds; { TimingData::GetBeatArgs beat_info; beat_info.elapsed_time = fEarliestTime; @@ -466,9 +466,9 @@ PlayerReplay::Step(int col, const auto stepAgo = stepDelta.count() - padStickSeconds; const auto fLastBeatUpdate = - m_pPlayerState->m_Position.m_LastBeatUpdate.Ago(); + GAMESTATE->m_Position.m_LastBeatUpdate.Ago(); const auto fPositionSeconds = - m_pPlayerState->m_Position.m_fMusicSeconds - stepAgo; + GAMESTATE->m_Position.m_fMusicSeconds - stepAgo; const auto fTimeSinceStep = stepAgo; // LOG->Trace(ssprintf("col %d\n\trow %d", col, row)); @@ -477,7 +477,7 @@ PlayerReplay::Step(int col, // test -mina ok this is 100% not the place to do this // m_pPlayerStageStats->InputData.emplace_back(fPositionSeconds); - auto fSongBeat = m_pPlayerState->m_Position.m_fSongBeat; + auto fSongBeat = GAMESTATE->m_Position.m_fSongBeat; if (GAMESTATE->m_pCurSteps) fSongBeat = m_Timing->GetBeatFromElapsedTime(fPositionSeconds); @@ -561,11 +561,11 @@ PlayerReplay::Step(int col, if (iSongRow < skipstart || iSongRow > static_cast(nerv.size()) - 10) { iStepSearchRows = std::max(BeatToNoteRow(m_Timing->GetBeatFromElapsedTime( - m_pPlayerState->m_Position.m_fMusicSeconds + + GAMESTATE->m_Position.m_fMusicSeconds + StepSearchDistance)) - iSongRow, iSongRow - BeatToNoteRow(m_Timing->GetBeatFromElapsedTime( - m_pPlayerState->m_Position.m_fMusicSeconds - + GAMESTATE->m_Position.m_fMusicSeconds - StepSearchDistance))) + ROWS_PER_BEAT; } else { @@ -625,7 +625,7 @@ PlayerReplay::Step(int col, * GAMESTATE->m_LastBeatUpdate. Figure out what the music time is as * of now. */ const auto fCurrentMusicSeconds = - m_pPlayerState->m_Position.m_fMusicSeconds + + GAMESTATE->m_Position.m_fMusicSeconds + (fLastBeatUpdate * GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate); diff --git a/src/Etterna/Models/Misc/GameplayAssist.cpp b/src/Etterna/Models/Misc/GameplayAssist.cpp index 4e3fcac15c..a322dc8d77 100644 --- a/src/Etterna/Models/Misc/GameplayAssist.cpp +++ b/src/Etterna/Models/Misc/GameplayAssist.cpp @@ -37,7 +37,7 @@ GameplayAssist::PlayTicks(const NoteData& nd, const PlayerState* ps) * fPositionSeconds ahead. This is just to make sure that we request the * sound early enough for it to come out on time; the actual precise timing * is handled by SetStartTime. */ - auto& position = GAMESTATE->m_pPlayerState->m_Position; + auto& position = GAMESTATE->m_Position; auto fPositionSeconds = position.m_fMusicSeconds; // float fPositionSeconds = GAMESTATE->m_Position.m_fMusicSeconds; diff --git a/src/Etterna/Models/Misc/PlayerState.cpp b/src/Etterna/Models/Misc/PlayerState.cpp index 9cfe57cf98..be233c9d66 100644 --- a/src/Etterna/Models/Misc/PlayerState.cpp +++ b/src/Etterna/Models/Misc/PlayerState.cpp @@ -57,14 +57,6 @@ PlayerState::ResetToDefaultPlayerOptions(ModsLevel l) m_PlayerOptions.Assign(l, po); } -const SongPosition& -PlayerState::GetDisplayedPosition() const -{ - if (GAMESTATE->m_bIsUsingStepTiming) - return m_Position; - return GAMESTATE->m_Position; -} - const TimingData& PlayerState::GetDisplayedTiming() const { @@ -90,7 +82,7 @@ class LunaPlayerState : public Luna DEFINE_METHOD(GetPlayerNumber, m_PlayerNumber); static int GetSongPosition(T* p, lua_State* L) { - p->m_Position.PushSelf(L); + GAMESTATE->m_Position.PushSelf(L); return 1; } DEFINE_METHOD(GetMultiPlayerNumber, m_mp); diff --git a/src/Etterna/Models/Misc/PlayerState.h b/src/Etterna/Models/Misc/PlayerState.h index 79a004bbe7..dd83537154 100644 --- a/src/Etterna/Models/Misc/PlayerState.h +++ b/src/Etterna/Models/Misc/PlayerState.h @@ -56,10 +56,6 @@ class PlayerState // to fit in the space available. -Kyz float m_NotefieldZoom; - // Music statistics: - SongPosition m_Position; - - auto GetDisplayedPosition() const -> const SongPosition&; auto GetDisplayedTiming() const -> const TimingData&; /** diff --git a/src/Etterna/Screen/Gameplay/ScreenGameplay.cpp b/src/Etterna/Screen/Gameplay/ScreenGameplay.cpp index b3bc880de6..7f81c2820d 100644 --- a/src/Etterna/Screen/Gameplay/ScreenGameplay.cpp +++ b/src/Etterna/Screen/Gameplay/ScreenGameplay.cpp @@ -1864,7 +1864,7 @@ class LunaScreenGameplay : public Luna { PlayerNumber pn = PLAYER_1; float rate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate; - float bps = GAMESTATE->m_pPlayerState->m_Position.m_fCurBPS; + float bps = GAMESTATE->m_Position.m_fCurBPS; float true_bps = rate * bps; lua_pushnumber(L, true_bps); return 1; diff --git a/src/Etterna/Screen/Others/ScreenSelectMusic.cpp b/src/Etterna/Screen/Others/ScreenSelectMusic.cpp index 38d6a03dae..9ca5311e4f 100644 --- a/src/Etterna/Screen/Others/ScreenSelectMusic.cpp +++ b/src/Etterna/Screen/Others/ScreenSelectMusic.cpp @@ -1940,7 +1940,7 @@ class LunaScreenSelectMusic : public Luna static int CreatePreviewNoteField(T* p, lua_State* L) { float helloiamafloat = - GAMESTATE->m_pPlayerState->GetDisplayedPosition().m_fMusicSeconds; + GAMESTATE->m_Position.m_fMusicSeconds; p->GeneratePreviewNoteField(); if (p->m_pPreviewNoteField != nullptr) { p->SetPreviewNoteFieldMusicPosition(helloiamafloat); @@ -1985,7 +1985,7 @@ class LunaScreenSelectMusic : public Luna static int GetPreviewNoteFieldMusicPosition(T* p, lua_State* L) { lua_pushnumber( - L, GAMESTATE->m_pPlayerState->GetDisplayedPosition().m_fMusicSeconds); + L, GAMESTATE->m_Position.m_fMusicSeconds); return 1; } diff --git a/src/Etterna/Singletons/GameState.cpp b/src/Etterna/Singletons/GameState.cpp index e44cd25d97..898f351244 100644 --- a/src/Etterna/Singletons/GameState.cpp +++ b/src/Etterna/Singletons/GameState.cpp @@ -755,8 +755,6 @@ GameState::ResetMusicStatistics() m_LastPositionSeconds = 0.0f; Actor::SetBGMTime(0, 0, 0, 0); - - m_pPlayerState->m_Position.Reset(); } void @@ -800,10 +798,8 @@ GameState::UpdateSongPosition(float fPositionSeconds, m_Position.UpdateSongPosition( fPositionSeconds, *m_pCurSteps->GetTimingData(), timestamp); - m_pPlayerState->m_Position.UpdateSongPosition( - fPositionSeconds, *m_pCurSteps->GetTimingData(), timestamp); - Actor::SetPlayerBGMBeat(m_pPlayerState->m_Position.m_fSongBeatVisible, - m_pPlayerState->m_Position.m_fSongBeatNoOffset); + Actor::SetPlayerBGMBeat(m_Position.m_fSongBeatVisible, + m_Position.m_fSongBeatNoOffset); } else { m_Position.UpdateSongPosition(fPositionSeconds, timing, timestamp); }