Skip to content

Commit

Permalink
IsPartialPlay condition made less strict.
Browse files Browse the repository at this point in the history
Also some tweaks on debug display
  • Loading branch information
123jimin committed Jul 16, 2020
1 parent 1e69e15 commit bf080ca
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Beatmap/include/Beatmap/Beatmap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class Beatmap : public Unique
// Retrieves audio effect settings for a given filter effect id
AudioEffect GetFilter(EffectType type) const;

// Get the timing of the last object
// Get the timing of the last (non-event) object
MapTime GetLastObjectTime() const;

// Measure -> Time
Expand Down
1 change: 1 addition & 0 deletions Main/include/BasicDefinitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ inline uint32 ToMinScore(GradeMark grade)
}

assert(false);
return 0;
}

inline GradeMark ToGradeMark(uint32 score)
Expand Down
29 changes: 15 additions & 14 deletions Main/src/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Game_Impl : public Game
bool m_introCompleted = false;
bool m_outroCompleted = false;
bool m_paused = false;
bool m_triggerPause = false; // Whether to cause on next first gameplaytick on play
bool m_triggerPause = false; // Whether to trigger a pause on next first gameplay tick
bool m_ended = false;
bool m_transitioning = false;
bool m_saveSpeed = false;
Expand All @@ -87,7 +87,7 @@ class Game_Impl : public Game
bool m_isPracticeSetup = false;
bool m_isPracticeMode = false;
std::unique_ptr<PracticeModeSettingsDialog> m_practiceSetupDialog = nullptr;
bool m_playOnDialogClose = false;
bool m_playOnDialogClose = false; // Whether to unpause on dialog closing

// Map object approach speed, scaled by BPM
float m_hispeed = 1.0f;
Expand Down Expand Up @@ -1451,7 +1451,7 @@ class Game_Impl : public Game
{
// Render debug overlay elements
//RenderQueue& debugRq = g_guiRenderer->Begin();
auto RenderText = [&](const String& text, const Vector2& pos, const Color& color = Color::White)
auto RenderText = [&](const String& text, const Vector2& pos, const Color& color = {1.0f, 1.0f, 0.5f, 1.0f})
{
g_application->FastText(text, pos.x, pos.y, 12, 0, color);
return Vector2(0, 12);
Expand All @@ -1469,18 +1469,19 @@ class Game_Impl : public Game
textPos.y += RenderText(bms.title, textPos).y;
textPos.y += RenderText(bms.artist, textPos).y;
textPos.y += RenderText(Utility::Sprintf("%.2f FPS", g_application->GetRenderFPS()), textPos).y;
textPos.y += RenderText(Utility::Sprintf("Audio Offset: %d ms", g_audio->audioLatency), textPos).y;
textPos.y += RenderText(Utility::Sprintf("Offset (ms): Global %d, Song %d, Audio %d (%d)",
m_globalOffset, m_songOffset, GetAudioOffset(), g_audio->audioLatency), textPos).y;

float currentBPM = (float)(60000.0 / tp.beatDuration);
textPos.y += RenderText(Utility::Sprintf("BPM: %.1f", currentBPM), textPos).y;
textPos.y += RenderText(Utility::Sprintf("BPM: %.1f | Time Sig: %d/%d", currentBPM, tp.numerator, tp.denominator), textPos).y;
textPos.y += RenderText(Utility::Sprintf("Time Signature: %d/%d", tp.numerator, tp.denominator), textPos).y;
textPos.y += RenderText(Utility::Sprintf("Laser Effect Mix: %f", m_audioPlayback.GetLaserEffectMix()), textPos).y;
textPos.y += RenderText(Utility::Sprintf("Paused: %s, LastMapTime: %d", m_paused ? "Yes" : "No", m_lastMapTime), textPos).y;
if (IsPartialPlay())
textPos.y += RenderText(Utility::Sprintf("Partial play: from %d ms to %d ms", m_playOptions.range.begin, m_playOptions.range.end), textPos).y;
textPos.y += RenderText(Utility::Sprintf("Laser Filter Input: %f", m_scoring.GetLaserOutput()), textPos).y;

textPos.y += RenderText(Utility::Sprintf("Score: %d/%d (Max: %d)", m_scoring.currentHitScore, m_scoring.currentMaxScore, m_scoring.mapTotals.maxScore), textPos).y;

textPos.y += RenderText(Utility::Sprintf("Actual Score: %d", m_scoring.CalculateCurrentScore()), textPos).y;

textPos.y += RenderText(Utility::Sprintf("Health Gauge: %f", m_scoring.currentGauge), textPos).y;

textPos.y += RenderText(Utility::Sprintf("Roll: %f(x%f) %s",
Expand All @@ -1496,7 +1497,7 @@ class Game_Impl : public Game
{
if (m_isPracticeSetup)
{
textPos.y += RenderText("Practice Setup", textPos, Color::Blue).y;
textPos.y += RenderText("Practice setup", textPos, Color::Blue).y;
}
else
{
Expand Down Expand Up @@ -1830,7 +1831,9 @@ class Game_Impl : public Game
return;

if (m_practiceSetupDialog && m_practiceSetupDialog->IsActive())
return;
{
if (code != SDL_SCANCODE_F8) return;
}

if (m_isPracticeSetup)
{
Expand Down Expand Up @@ -2144,10 +2147,8 @@ class Game_Impl : public Game

constexpr bool IsPartialPlay() const noexcept
{
if (m_playOptions.range.begin != 0) return true;
if (!m_playOptions.range.HasEnd()) return false;

return m_playOptions.range.end < m_endTime;
if (m_playOptions.range.begin > 0) return true;
return m_playOptions.range.HasEnd();
}

virtual bool IsPlaying() const override
Expand Down

0 comments on commit bf080ca

Please sign in to comment.