Improve reliability of "menu background music". Fix issue with mixed navigation mentioned in #8565

This commit is contained in:
Henrik Rydgard 2016-02-13 10:48:11 +01:00
parent 199ce4ef9e
commit e1ebc12d7f
3 changed files with 7 additions and 5 deletions

View File

@ -16,8 +16,7 @@
class AT3PlusReader {
public:
AT3PlusReader(const std::string &data)
: file_((const uint8_t *)&data[0],
(int32_t)data.size()),
: file_((const uint8_t *)&data[0], (int32_t)data.size()),
raw_data_(0),
raw_data_size_(0),
raw_offset_(0),
@ -96,7 +95,7 @@ public:
}
file_.ascend();
} else {
ELOG("Could not descend into RIFF file");
ELOG("Could not descend into RIFF file. Data size=%d", (int32_t)data.size());
return;
}
sample_rate = samplesPerSec;

View File

@ -734,6 +734,7 @@ again:
GameInfoWorkItem *item = new GameInfoWorkItem(gamePath, info);
gameInfoWQ_->Add(item);
info->pending = true;
info_[gamePath] = info;
return info;
}

View File

@ -1046,8 +1046,10 @@ UI::EventReturn MainScreen::OnGameHighlight(UI::EventParams &e) {
}
}
if ((!highlightedGamePath_.empty() || e.a == FF_LOSTFOCUS) && !lockBackgroundAudio_)
if ((!highlightedGamePath_.empty() || e.a == FF_LOSTFOCUS) && !lockBackgroundAudio_) {
SetBackgroundAudioGame(highlightedGamePath_);
}
lockBackgroundAudio_ = false;
return UI::EVENT_DONE;
}
@ -1135,7 +1137,7 @@ void MainScreen::dialogFinished(const Screen *dialog, DialogResult result) {
RecreateViews();
}
if (dialog->tag() == "game") {
if (!restoreFocusGamePath_.empty()) {
if (!restoreFocusGamePath_.empty() && UI::IsFocusMovementEnabled()) {
// Prevent the background from fading, since we just were displaying it.
highlightedGamePath_ = restoreFocusGamePath_;
highlightProgress_ = 1.0f;