mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
DolphinWX: properly sync EmuState and banner changes.
This commit is contained in:
@ -36,11 +36,8 @@ public:
|
||||
GameListItem(const std::string& file_name, const Core::TitleDatabase& title_database);
|
||||
~GameListItem() = default;
|
||||
|
||||
// Reload settings after INI changes
|
||||
void ReloadINI();
|
||||
|
||||
bool IsValid() const;
|
||||
const std::string& GetFileName() const { return m_FileName; }
|
||||
const std::string& GetFileName() const { return m_file_name; }
|
||||
std::string GetName(DiscIO::Language language) const;
|
||||
std::string GetName() const;
|
||||
std::string GetUniqueIdentifier() const;
|
||||
@ -48,66 +45,92 @@ public:
|
||||
std::string GetDescription() const;
|
||||
std::vector<DiscIO::Language> GetLanguages() const;
|
||||
std::string GetCompany() const { return m_company; }
|
||||
u16 GetRevision() const { return m_Revision; }
|
||||
u16 GetRevision() const { return m_revision; }
|
||||
const std::string& GetGameID() const { return m_game_id; }
|
||||
u64 GetTitleID() const { return m_title_id; }
|
||||
const std::string GetWiiFSPath() const;
|
||||
DiscIO::Region GetRegion() const { return m_region; }
|
||||
DiscIO::Country GetCountry() const { return m_Country; }
|
||||
DiscIO::Platform GetPlatform() const { return m_Platform; }
|
||||
DiscIO::Country GetCountry() const { return m_country; }
|
||||
DiscIO::Platform GetPlatform() const { return m_platform; }
|
||||
DiscIO::BlobType GetBlobType() const { return m_blob_type; }
|
||||
const std::string& GetIssues() const { return m_issues; }
|
||||
int GetEmuState() const { return m_emu_state; }
|
||||
u64 GetFileSize() const { return m_FileSize; }
|
||||
u64 GetVolumeSize() const { return m_VolumeSize; }
|
||||
const std::string& GetIssues() const { return m_emu_state.issues; }
|
||||
int GetEmuState() const { return m_emu_state.rating; }
|
||||
u64 GetFileSize() const { return m_file_size; }
|
||||
u64 GetVolumeSize() const { return m_volume_size; }
|
||||
// 0 is the first disc, 1 is the second disc
|
||||
u8 GetDiscNumber() const { return m_disc_number; }
|
||||
// NOTE: Banner image is at the original resolution, use WxUtils::ScaleImageToBitmap
|
||||
// to display it
|
||||
const wxImage& GetBannerImage() const { return m_image; }
|
||||
const wxImage& GetBannerImage() const { return m_banner_wx; }
|
||||
void DoState(PointerWrap& p);
|
||||
bool ReloadBannerIfNeeded();
|
||||
bool BannerChanged();
|
||||
void BannerCommit();
|
||||
bool EmuStateChanged();
|
||||
void EmuStateCommit();
|
||||
|
||||
private:
|
||||
bool IsElfOrDol() const;
|
||||
// Outputs to m_pImage
|
||||
void ReadVolumeBanner(const std::vector<u32>& buffer, int width, int height);
|
||||
// Outputs to m_image
|
||||
bool SetWxBannerFromPngFile(const std::string& path);
|
||||
void SetWxBannerFromRaw();
|
||||
struct EmuState
|
||||
{
|
||||
int rating{};
|
||||
std::string issues{};
|
||||
bool operator!=(const EmuState& rhs) const
|
||||
{
|
||||
return rating != rhs.rating || issues != rhs.issues;
|
||||
}
|
||||
void DoState(PointerWrap& p);
|
||||
};
|
||||
struct Banner
|
||||
{
|
||||
std::vector<u8> buffer{};
|
||||
int width{};
|
||||
int height{};
|
||||
bool empty() const { return buffer.empty(); }
|
||||
void DoState(PointerWrap& p);
|
||||
};
|
||||
|
||||
// IMPORTANT: All data members must be save/restored in DoState.
|
||||
bool IsElfOrDol() const;
|
||||
void ReadVolumeBanner(std::vector<u8>* image, const std::vector<u32>& buffer, int width,
|
||||
int height);
|
||||
// Outputs to m_banner_wx
|
||||
bool SetWxBannerFromPngFile(const std::string& path);
|
||||
void SetWxBannerFromRaw(const Banner& banner);
|
||||
|
||||
// IMPORTANT: Nearly all data members must be save/restored in DoState.
|
||||
// If anything is changed, make sure DoState handles it properly and
|
||||
// GameListCtrl::CACHE_REVISION is incremented.
|
||||
|
||||
std::string m_FileName;
|
||||
bool m_valid{};
|
||||
std::string m_file_name{};
|
||||
|
||||
std::map<DiscIO::Language, std::string> m_names;
|
||||
std::map<DiscIO::Language, std::string> m_descriptions;
|
||||
std::string m_company;
|
||||
u64 m_file_size{};
|
||||
u64 m_volume_size{};
|
||||
|
||||
std::string m_game_id;
|
||||
u64 m_title_id = 0;
|
||||
std::map<DiscIO::Language, std::string> m_names{};
|
||||
std::map<DiscIO::Language, std::string> m_descriptions{};
|
||||
std::string m_company{};
|
||||
std::string m_game_id{};
|
||||
u64 m_title_id{};
|
||||
|
||||
std::string m_issues;
|
||||
int m_emu_state;
|
||||
DiscIO::Region m_region{};
|
||||
DiscIO::Country m_country{};
|
||||
DiscIO::Platform m_platform{};
|
||||
DiscIO::BlobType m_blob_type{};
|
||||
u16 m_revision{};
|
||||
u8 m_disc_number{};
|
||||
|
||||
u64 m_FileSize;
|
||||
u64 m_VolumeSize;
|
||||
Banner m_banner{};
|
||||
EmuState m_emu_state{};
|
||||
// Overridden name from TitleDatabase
|
||||
std::string m_custom_name{};
|
||||
|
||||
DiscIO::Region m_region;
|
||||
DiscIO::Country m_Country;
|
||||
DiscIO::Platform m_Platform;
|
||||
DiscIO::BlobType m_blob_type;
|
||||
u16 m_Revision;
|
||||
// wxImage is not handled in DoState
|
||||
wxImage m_banner_wx{};
|
||||
|
||||
wxImage m_image;
|
||||
bool m_Valid;
|
||||
std::vector<u8> m_pImage;
|
||||
int m_ImageWidth, m_ImageHeight;
|
||||
u8 m_disc_number;
|
||||
|
||||
std::string m_custom_name_titles_txt; // Custom title from titles.txt
|
||||
std::string m_custom_name; // Custom title from INI or titles.txt
|
||||
bool m_has_custom_name;
|
||||
// The following data members allow GameListCtrl to construct new GameListItems in a threadsafe
|
||||
// way. They should not be handled in DoState.
|
||||
struct
|
||||
{
|
||||
EmuState emu_state;
|
||||
Banner banner;
|
||||
} m_pending{};
|
||||
};
|
||||
|
Reference in New Issue
Block a user