| 159 | } |
| 160 | |
| 161 | C2D_Image TitleCatalog::icon(int i, BackupKind kind) |
| 162 | { |
| 163 | // Runs on the UI/draw thread, so this is where the icon's texture is created |
| 164 | // (lazily, by IconStore::get) — the loader worker only ever stored raw bytes. |
| 165 | std::lock_guard<std::mutex> lock(mMutex); |
| 166 | auto& vec = kind == BackupKind::Save ? mSaves : mExtdatas; |
| 167 | if (i >= 0 && i < (int)vec.size()) { |
| 168 | return mIcons.get(vec.at(i).id()); |
| 169 | } |
| 170 | return Gui::noIcon(); |
| 171 | } |
| 172 | |
| 173 | bool TitleCatalog::favorite(int i, BackupKind kind) |
| 174 | { |