mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 04:08:55 +00:00
GCMemcard: Let GetDEntry() return std::optional<DEntry>.
This commit is contained in:
parent
860e003b0c
commit
2351a60567
3 changed files with 15 additions and 18 deletions
|
@ -199,12 +199,11 @@ 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);
|
||||
|
||||
// TODO: This is wrong, the animation speed is not static and is already correctly calculated in
|
||||
// GetIconFromSaveFile(), just not returned
|
||||
const u16 animation_speed = d.m_animation_speed;
|
||||
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});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue