2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 03:43:35 +00:00
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2013-03-03 01:46:55 +00:00
|
|
|
#include <string>
|
2015-04-09 15:44:53 +00:00
|
|
|
#include <utility>
|
2014-02-17 10:18:15 +00:00
|
|
|
#include <vector>
|
2013-03-03 01:46:55 +00:00
|
|
|
|
2014-10-21 06:01:38 +00:00
|
|
|
#include "Common/Common.h"
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-10-21 06:01:38 +00:00
|
|
|
#include <wx/bitmap.h>
|
2016-06-24 08:43:46 +00:00
|
|
|
#include <wx/image.h>
|
2010-08-03 03:20:44 +00:00
|
|
|
|
2017-05-15 14:26:22 +00:00
|
|
|
namespace Core
|
|
|
|
{
|
|
|
|
class TitleDatabase;
|
|
|
|
}
|
|
|
|
|
2016-07-06 18:33:05 +00:00
|
|
|
namespace DiscIO
|
|
|
|
{
|
|
|
|
enum class BlobType;
|
|
|
|
enum class Country;
|
|
|
|
enum class Language;
|
2016-12-23 17:41:21 +00:00
|
|
|
enum class Region;
|
2016-07-06 18:33:05 +00:00
|
|
|
enum class Platform;
|
|
|
|
}
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
class PointerWrap;
|
2016-07-06 18:33:05 +00:00
|
|
|
|
2015-09-13 12:17:58 +00:00
|
|
|
class GameListItem
|
2008-12-08 04:46:09 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-05-15 14:26:22 +00:00
|
|
|
GameListItem(const std::string& file_name, const Core::TitleDatabase& title_database);
|
2016-06-24 08:43:46 +00:00
|
|
|
~GameListItem();
|
|
|
|
|
|
|
|
// Reload settings after INI changes
|
|
|
|
void ReloadINI();
|
|
|
|
|
2017-05-13 22:00:01 +00:00
|
|
|
bool IsValid() const;
|
2016-06-24 08:43:46 +00:00
|
|
|
const std::string& GetFileName() const { return m_FileName; }
|
2016-07-06 18:33:05 +00:00
|
|
|
std::string GetName(DiscIO::Language language) const;
|
2016-06-24 08:43:46 +00:00
|
|
|
std::string GetName() const;
|
2016-10-03 12:35:27 +00:00
|
|
|
std::string GetUniqueIdentifier() const;
|
2016-07-06 18:33:05 +00:00
|
|
|
std::string GetDescription(DiscIO::Language language) const;
|
2016-06-24 08:43:46 +00:00
|
|
|
std::string GetDescription() const;
|
2016-07-06 18:33:05 +00:00
|
|
|
std::vector<DiscIO::Language> GetLanguages() const;
|
2016-06-24 08:43:46 +00:00
|
|
|
std::string GetCompany() const { return m_company; }
|
|
|
|
u16 GetRevision() const { return m_Revision; }
|
2016-10-29 12:42:43 +00:00
|
|
|
const std::string& GetGameID() const { return m_game_id; }
|
2017-05-06 15:08:18 +00:00
|
|
|
u64 GetTitleID() const { return m_title_id; }
|
2016-06-24 08:43:46 +00:00
|
|
|
const std::string GetWiiFSPath() const;
|
2016-12-23 17:41:21 +00:00
|
|
|
DiscIO::Region GetRegion() const { return m_region; }
|
2016-07-06 18:33:05 +00:00
|
|
|
DiscIO::Country GetCountry() const { return m_Country; }
|
|
|
|
DiscIO::Platform GetPlatform() const { return m_Platform; }
|
2016-06-24 08:43:46 +00:00
|
|
|
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; }
|
|
|
|
// 0 is the first disc, 1 is the second disc
|
|
|
|
u8 GetDiscNumber() const { return m_disc_number; }
|
2016-08-03 11:14:52 +00:00
|
|
|
// NOTE: Banner image is at the original resolution, use WxUtils::ScaleImageToBitmap
|
|
|
|
// to display it
|
|
|
|
const wxImage& GetBannerImage() const { return m_image; }
|
2016-06-24 08:43:46 +00:00
|
|
|
void DoState(PointerWrap& p);
|
2009-06-06 07:36:22 +00:00
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
private:
|
2016-06-24 08:43:46 +00:00
|
|
|
std::string m_FileName;
|
2013-03-03 01:46:55 +00:00
|
|
|
|
2016-07-06 18:33:05 +00:00
|
|
|
std::map<DiscIO::Language, std::string> m_names;
|
|
|
|
std::map<DiscIO::Language, std::string> m_descriptions;
|
2016-06-24 08:43:46 +00:00
|
|
|
std::string m_company;
|
2013-03-03 01:46:55 +00:00
|
|
|
|
2016-10-29 12:42:43 +00:00
|
|
|
std::string m_game_id;
|
2017-05-06 15:08:18 +00:00
|
|
|
u64 m_title_id = 0;
|
2011-03-23 04:31:00 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
std::string m_issues;
|
|
|
|
int m_emu_state;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
u64 m_FileSize;
|
|
|
|
u64 m_VolumeSize;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2016-12-23 17:41:21 +00:00
|
|
|
DiscIO::Region m_region;
|
2016-07-06 18:33:05 +00:00
|
|
|
DiscIO::Country m_Country;
|
|
|
|
DiscIO::Platform m_Platform;
|
2016-06-24 08:43:46 +00:00
|
|
|
DiscIO::BlobType m_blob_type;
|
|
|
|
u16 m_Revision;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2016-08-03 11:14:52 +00:00
|
|
|
wxImage m_image;
|
2016-06-24 08:43:46 +00:00
|
|
|
bool m_Valid;
|
|
|
|
std::vector<u8> m_pImage;
|
|
|
|
int m_ImageWidth, m_ImageHeight;
|
|
|
|
u8 m_disc_number;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
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;
|
2015-09-13 10:45:06 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
bool LoadFromCache();
|
|
|
|
void SaveToCache();
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
bool IsElfOrDol() const;
|
|
|
|
std::string CreateCacheFilename() const;
|
2015-06-13 18:06:27 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
// Outputs to m_pImage
|
|
|
|
void ReadVolumeBanner(const std::vector<u32>& buffer, int width, int height);
|
|
|
|
// Outputs to m_Bitmap
|
|
|
|
bool ReadPNGBanner(const std::string& path);
|
2008-12-08 04:46:09 +00:00
|
|
|
};
|