diff --git a/src/InputWindowElement.h b/src/InputWindowElement.h index a960bc8..5469501 100644 --- a/src/InputWindowElement.h +++ b/src/InputWindowElement.h @@ -35,7 +35,7 @@ class InputWindowElement : public iElement { InputWindowElement(Param&& p) : iElement(p.period), matcher_(std::move(p.matcher)), drv_(std::move(p.driver)), sb_(p.scoreboard), - text_(p.text), guide_(matcher_->expects()), width_(CountWstrBytes(p.text)) { + text_(p.text), expects_(matcher_->expects()) { param_["posX"] = 0.; param_["posY"] = 0.; param_["baseX"] = .5; @@ -45,10 +45,8 @@ class InputWindowElement : public iElement { for (auto c : frame.input) { if (matcher_->done()) break; if (matcher_->Input(c)) { - guide_ = Text(matcher_->expects()); + expects_ = Text(matcher_->expects()); ++sb_->correct; - } else { - ++sb_->miss; } ++sb_->input; } @@ -60,12 +58,14 @@ class InputWindowElement : public iElement { const uint32_t posXi = static_cast(posX * frame.w); const uint32_t posYi = static_cast(posY * frame.h); - const uint32_t baseXi = static_cast(baseX * width_); - text_.SetPosition(posXi-baseXi, posYi); - guide_.SetPosition(posXi-baseXi, posYi+1); + const uint32_t tbaseXi = static_cast(baseX * text_.width()); + const uint32_t ebaseXi = static_cast(baseX * expects_.width()); + + text_.SetPosition(posXi-tbaseXi, posYi); + expects_.SetPosition(posXi-ebaseXi, posYi+1); frame.Add(&text_); - frame.Add(&guide_); + frame.Add(&expects_); } void Finalize() override { @@ -82,9 +82,7 @@ class InputWindowElement : public iElement { Scoreboard* sb_; Text text_; - Text guide_; - - size_t width_; + Text expects_; iElementDriver::Param param_; }; diff --git a/src/Scoreboard.h b/src/Scoreboard.h index d8fce75..0b6d1e0 100644 --- a/src/Scoreboard.h +++ b/src/Scoreboard.h @@ -12,7 +12,6 @@ struct Scoreboard { size_t input = 0; size_t correct = 0; - size_t miss = 0; size_t lines = 0; size_t completeLines = 0; diff --git a/src/TitleScene.cc b/src/TitleScene.cc index 9d1b91c..67741bb 100644 --- a/src/TitleScene.cc +++ b/src/TitleScene.cc @@ -39,7 +39,7 @@ gj::TitleScene::TitleScene(const Param& p) : s.displayName = obj["displayName"].get(); s.music = obj["music"].get(); s.score = obj["score"].get(); - s.playOffset = static_cast(obj["playOffset"].get()); + s.playOffset = obj["playOffset"].get(); list_.push_back(s); } @@ -123,7 +123,7 @@ void gj::TitleScene::SelectScore_(size_t index) { score_ = Text(ConvertStrToWstr(s.displayName)); select_index_ = index; - param_.audio->SetVolume(.2); - param_.audio->SetLpfIntensity(.99); + param_.audio->SetVolume(.5); + param_.audio->SetLpfIntensity(.999); param_.audio->PlayMusic(s.music, s.playOffset); } \ No newline at end of file