Unify ISOFile (wx) with GameFile (Qt) and put it in UICommon

The original reason I wanted to do this was so that we can replace
the Android-specific code with this in the future, but of course,
just deduplicating between DolphinWX and DolphinQt2 is nice too.

Fixes:

- DolphinQt2 showing the wrong size for split WBFS disc images.

- DolphinQt2 being case sensitive when checking if a file is a DOL/ELF.

- DolphinQt2 not detecting when a Wii banner has become available
after the game list cache was created.

Removes:

- DolphinWX's ability to load PNGs as custom banners. But it was
already rather broken (see https://bugs.dolphin-emu.org/issues/10365
and https://bugs.dolphin-emu.org/issues/10366). The reason I removed
this was because PNG decoding relied on wx code and we don't have any
good non-wx/Qt code for loading PNG files right now (let's not use
SOIL), but we should be able to use libpng directly to implement PNG
loading in the future.

- DolphinQt2's ability to ignore a cached game if the last modified
time differs. We currently don't have a non-wx/Qt way to get the time.
This commit is contained in:
JosJuice
2018-03-09 13:08:38 +01:00
parent 1add238a28
commit 1f1dae367d
67 changed files with 1373 additions and 1736 deletions
+13 -10
View File
@@ -16,7 +16,12 @@
#include "Common/ChunkFile.h"
#include "Common/Event.h"
#include "Common/Flag.h"
#include "DolphinWX/ISOFile.h"
#include "UICommon/GameFileCache.h"
namespace UICommon
{
class GameFile;
}
class wxEmuStateTip : public wxTipWindow
{
@@ -46,8 +51,8 @@ public:
~GameListCtrl();
void BrowseForDirectory();
const GameListItem* GetISO(size_t index) const;
const GameListItem* GetSelectedISO() const;
const UICommon::GameFile* GetISO(size_t index) const;
const UICommon::GameFile* GetSelectedISO() const;
static bool IsHidingItems();
@@ -80,9 +85,7 @@ private:
void SetColors();
void RefreshList();
void RescanList();
void DoState(PointerWrap* p, u32 size = 0);
bool SyncCacheFile(bool write);
std::vector<const GameListItem*> GetAllSelectedISOs() const;
std::vector<const UICommon::GameFile*> GetAllSelectedISOs() const;
// events
void OnRefreshGameList(wxCommandEvent& event);
@@ -124,9 +127,9 @@ private:
std::vector<int> emu_state;
} m_image_indexes;
// Actual backing GameListItems are maintained in a background thread and cached to file
std::vector<std::shared_ptr<GameListItem>> m_cached_files;
// Locks the list, not the contents
// Actual backing GameFiles are maintained in a background thread and cached to file
UICommon::GameFileCache m_cache;
// Locks the cache object, not the shared_ptr<GameFile>s obtained from it
std::mutex m_cache_mutex;
Core::TitleDatabase m_title_database;
std::mutex m_title_database_mutex;
@@ -134,7 +137,7 @@ private:
Common::Event m_scan_trigger;
Common::Flag m_scan_exiting;
// UI thread's view into the cache
std::vector<std::shared_ptr<GameListItem>> m_shown_files;
std::vector<std::shared_ptr<const UICommon::GameFile>> m_shown_files;
int m_last_column;
int m_last_sort;