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-09-13 12:17:58 +00:00
|
|
|
#include <unordered_map>
|
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"
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "DiscIO/Volume.h"
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2010-08-03 03:20:44 +00:00
|
|
|
#if defined(HAVE_WX) && HAVE_WX
|
|
|
|
#include <wx/image.h>
|
2014-10-21 06:01:38 +00:00
|
|
|
#include <wx/bitmap.h>
|
2010-08-03 03:20:44 +00:00
|
|
|
#endif
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
class PointerWrap;
|
2015-09-13 12:17:58 +00:00
|
|
|
class GameListItem
|
2008-12-08 04:46:09 +00:00
|
|
|
{
|
|
|
|
public:
|
2015-09-13 12:17:58 +00:00
|
|
|
GameListItem(const std::string& _rFileName, const std::unordered_map<std::string, std::string>& custom_titles);
|
2008-12-08 04:46:09 +00:00
|
|
|
~GameListItem();
|
|
|
|
|
|
|
|
bool IsValid() const {return m_Valid;}
|
|
|
|
const std::string& GetFileName() const {return m_FileName;}
|
2015-05-08 21:28:03 +00:00
|
|
|
std::string GetName(DiscIO::IVolume::ELanguage language) const;
|
2015-04-09 15:44:53 +00:00
|
|
|
std::string GetName() const;
|
2015-05-08 21:28:03 +00:00
|
|
|
std::string GetDescription(DiscIO::IVolume::ELanguage language) const;
|
2015-04-09 15:44:53 +00:00
|
|
|
std::string GetDescription() const;
|
2015-05-08 21:28:03 +00:00
|
|
|
std::vector<DiscIO::IVolume::ELanguage> GetLanguages() const;
|
2015-06-13 16:43:10 +00:00
|
|
|
std::string GetCompany() const { return m_company; }
|
2015-05-29 19:14:02 +00:00
|
|
|
u16 GetRevision() const { return m_Revision; }
|
2008-12-08 04:46:09 +00:00
|
|
|
const std::string& GetUniqueID() const {return m_UniqueID;}
|
2009-05-02 18:06:42 +00:00
|
|
|
const std::string GetWiiFSPath() const;
|
2008-12-08 04:46:09 +00:00
|
|
|
DiscIO::IVolume::ECountry GetCountry() const {return m_Country;}
|
2015-06-04 14:26:36 +00:00
|
|
|
DiscIO::IVolume::EPlatform GetPlatform() const { return m_Platform; }
|
2011-03-23 04:31:00 +00:00
|
|
|
const std::string& GetIssues() const { return m_issues; }
|
|
|
|
int GetEmuState() const { return m_emu_state; }
|
2008-12-08 04:46:09 +00:00
|
|
|
bool IsCompressed() const {return m_BlobCompressed;}
|
|
|
|
u64 GetFileSize() const {return m_FileSize;}
|
|
|
|
u64 GetVolumeSize() const {return m_VolumeSize;}
|
2015-05-29 19:14:02 +00:00
|
|
|
// 0 is the first disc, 1 is the second disc
|
2015-08-26 05:13:55 +00:00
|
|
|
u8 GetDiscNumber() const { return m_disc_number; }
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
#if defined(HAVE_WX) && HAVE_WX
|
2013-09-25 07:05:36 +00:00
|
|
|
const wxBitmap& GetBitmap() const {return m_Bitmap;}
|
2008-12-08 04:46:09 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
void DoState(PointerWrap &p);
|
2009-06-06 07:36:22 +00:00
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
private:
|
|
|
|
std::string m_FileName;
|
2013-03-03 01:46:55 +00:00
|
|
|
|
2015-05-08 21:28:03 +00:00
|
|
|
std::map<DiscIO::IVolume::ELanguage, std::string> m_names;
|
|
|
|
std::map<DiscIO::IVolume::ELanguage, std::string> m_descriptions;
|
2015-04-10 20:10:49 +00:00
|
|
|
std::string m_company;
|
2013-03-03 01:46:55 +00:00
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
std::string m_UniqueID;
|
2011-03-23 04:31:00 +00:00
|
|
|
|
|
|
|
std::string m_issues;
|
|
|
|
int m_emu_state;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
u64 m_FileSize;
|
|
|
|
u64 m_VolumeSize;
|
|
|
|
|
|
|
|
DiscIO::IVolume::ECountry m_Country;
|
2015-06-04 14:26:36 +00:00
|
|
|
DiscIO::IVolume::EPlatform m_Platform;
|
2015-05-29 19:14:02 +00:00
|
|
|
u16 m_Revision;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
#if defined(HAVE_WX) && HAVE_WX
|
2013-09-25 07:05:36 +00:00
|
|
|
wxBitmap m_Bitmap;
|
2008-12-08 04:46:09 +00:00
|
|
|
#endif
|
|
|
|
bool m_Valid;
|
|
|
|
bool m_BlobCompressed;
|
2011-03-22 07:27:23 +00:00
|
|
|
std::vector<u8> m_pImage;
|
2013-09-25 07:05:36 +00:00
|
|
|
int m_ImageWidth, m_ImageHeight;
|
2015-05-29 19:14:02 +00:00
|
|
|
u8 m_disc_number;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2015-09-13 10:45:06 +00:00
|
|
|
std::string m_custom_name;
|
|
|
|
bool m_has_custom_name;
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
bool LoadFromCache();
|
|
|
|
void SaveToCache();
|
|
|
|
|
2015-09-06 10:34:48 +00:00
|
|
|
bool IsElfOrDol() const;
|
|
|
|
std::string CreateCacheFilename() const;
|
2015-06-13 18:06:27 +00:00
|
|
|
|
2015-09-04 17:08:30 +00:00
|
|
|
// Outputs to m_pImage
|
|
|
|
void ReadVolumeBanner(const DiscIO::IVolume& volume);
|
|
|
|
// Outputs to m_Bitmap
|
|
|
|
bool ReadPNGBanner(const std::string& path);
|
|
|
|
|
|
|
|
static wxBitmap ScaleBanner(wxImage* image);
|
2008-12-08 04:46:09 +00:00
|
|
|
};
|