Merge pull request #7616 from AdmiralCurtiss/memcard-cleanup

Clean up GCMemcard a bit.
This commit is contained in:
Léo Lam 2019-01-16 21:56:40 +01:00 committed by GitHub
commit fd3ef7ebc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 499 additions and 419 deletions

View file

@ -199,10 +199,12 @@ void GCMemcardManager::UpdateSlotTable(int slot)
auto* icon = new QTableWidgetItem;
icon->setData(Qt::DecorationRole, frames[0]);
DEntry d;
memcard->GetDEntry(file_index, d);
std::optional<DEntry> entry = memcard->GetDEntry(file_index);
const auto speed = ((d.AnimSpeed[0] & 1) << 2) + (d.AnimSpeed[1] & 1);
// TODO: This is wrong, the animation speed is not static and is already correctly calculated in
// GetIconFromSaveFile(), just not returned
const u16 animation_speed = entry ? entry->m_animation_speed : 1;
const auto speed = (((animation_speed >> 8) & 1) << 2) + (animation_speed & 1);
m_slot_active_icons[slot].push_back({speed, frames});