mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Merge pull request #1895 from JosJuice/isvolumewiidisc
Don't read from disk when checking volume type
This commit is contained in:
@ -128,9 +128,8 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
|
||||
{
|
||||
// Load ISO data
|
||||
OpenISO = DiscIO::CreateVolumeFromFilename(fileName);
|
||||
bool IsWad = DiscIO::IsVolumeWadFile(OpenISO);
|
||||
bool IsWiiDisc = DiscIO::IsVolumeWiiDisc(OpenISO);
|
||||
if (IsWiiDisc)
|
||||
bool IsWad = OpenISO->IsWadFile();
|
||||
if (OpenISO->IsWiiDisc())
|
||||
{
|
||||
for (int group = 0; group < 4; group++)
|
||||
{
|
||||
@ -264,7 +263,7 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
|
||||
break;
|
||||
}
|
||||
|
||||
if (IsWiiDisc) // Only one language with Wii banners
|
||||
if (OpenISO->IsWiiDisc()) // Only one language with Wii banners
|
||||
{
|
||||
m_Lang->SetSelection(0);
|
||||
m_Lang->Disable();
|
||||
@ -291,9 +290,9 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
|
||||
|
||||
// Filesystem browser/dumper
|
||||
// TODO : Should we add a way to browse the wad file ?
|
||||
if (!DiscIO::IsVolumeWadFile(OpenISO))
|
||||
if (!OpenISO->IsWadFile())
|
||||
{
|
||||
if (DiscIO::IsVolumeWiiDisc(OpenISO))
|
||||
if (OpenISO->IsWiiDisc())
|
||||
{
|
||||
for (u32 i = 0; i < WiiDisc.size(); i++)
|
||||
{
|
||||
@ -316,7 +315,7 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
|
||||
|
||||
CISOProperties::~CISOProperties()
|
||||
{
|
||||
if (!IsVolumeWiiDisc(OpenISO) && !IsVolumeWadFile(OpenISO) && pFileSystem)
|
||||
if (!OpenISO->IsWiiDisc() && !OpenISO->IsWadFile() && pFileSystem)
|
||||
delete pFileSystem;
|
||||
// two vector's items are no longer valid after deleting filesystem
|
||||
WiiDisc.clear();
|
||||
@ -480,7 +479,7 @@ void CISOProperties::CreateGUIControls(bool IsWad)
|
||||
sbCoreOverrides->Add(sGPUDeterminism, 0, wxEXPAND|wxALL, 5);
|
||||
|
||||
wxStaticBoxSizer * const sbWiiOverrides = new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Wii Console"));
|
||||
if (!DiscIO::IsVolumeWiiDisc(OpenISO) && !DiscIO::IsVolumeWadFile(OpenISO))
|
||||
if (!OpenISO->IsWiiDisc() && !OpenISO->IsWadFile())
|
||||
{
|
||||
sbWiiOverrides->ShowItems(false);
|
||||
EnableWideScreen->Hide();
|
||||
@ -741,7 +740,7 @@ void CISOProperties::OnRightClickOnTree(wxTreeEvent& event)
|
||||
|
||||
popupMenu.Append(IDM_EXTRACTALL, _("Extract All Files..."));
|
||||
|
||||
if (!DiscIO::IsVolumeWiiDisc(OpenISO) ||
|
||||
if (!OpenISO->IsWiiDisc() ||
|
||||
(m_Treectrl->GetItemImage(m_Treectrl->GetSelection()) == 0 &&
|
||||
m_Treectrl->GetFirstVisibleItem() != m_Treectrl->GetSelection()))
|
||||
{
|
||||
@ -784,7 +783,7 @@ void CISOProperties::OnExtractFile(wxCommandEvent& WXUNUSED (event))
|
||||
m_Treectrl->SelectItem(m_Treectrl->GetItemParent(m_Treectrl->GetSelection()));
|
||||
}
|
||||
|
||||
if (DiscIO::IsVolumeWiiDisc(OpenISO))
|
||||
if (OpenISO->IsWiiDisc())
|
||||
{
|
||||
int partitionNum = wxAtoi(File.Mid(File.find_first_of("/") - 1, 1));
|
||||
File.erase(0, File.find_first_of("/") + 1); // Remove "Partition x/"
|
||||
@ -798,7 +797,7 @@ void CISOProperties::OnExtractFile(wxCommandEvent& WXUNUSED (event))
|
||||
|
||||
void CISOProperties::ExportDir(const std::string& _rFullPath, const std::string& _rExportFolder, const int partitionNum)
|
||||
{
|
||||
DiscIO::IFileSystem* const fs = DiscIO::IsVolumeWiiDisc(OpenISO) ? WiiDisc[partitionNum].FileSystem : pFileSystem;
|
||||
DiscIO::IFileSystem* const fs = OpenISO->IsWiiDisc() ? WiiDisc[partitionNum].FileSystem : pFileSystem;
|
||||
|
||||
std::vector<const DiscIO::SFileInfo*> fst;
|
||||
fs->GetFileList(fst);
|
||||
@ -813,7 +812,7 @@ void CISOProperties::ExportDir(const std::string& _rFullPath, const std::string&
|
||||
size = (u32)fst.size();
|
||||
|
||||
fs->ExportApploader(_rExportFolder);
|
||||
if (!DiscIO::IsVolumeWiiDisc(OpenISO))
|
||||
if (!OpenISO->IsWiiDisc())
|
||||
fs->ExportDOL(_rExportFolder);
|
||||
}
|
||||
else
|
||||
@ -898,7 +897,7 @@ void CISOProperties::OnExtractDir(wxCommandEvent& event)
|
||||
|
||||
if (event.GetId() == IDM_EXTRACTALL)
|
||||
{
|
||||
if (DiscIO::IsVolumeWiiDisc(OpenISO))
|
||||
if (OpenISO->IsWiiDisc())
|
||||
for (u32 i = 0; i < WiiDisc.size(); i++)
|
||||
ExportDir("", WxStrToStr(Path), i);
|
||||
else
|
||||
@ -917,7 +916,7 @@ void CISOProperties::OnExtractDir(wxCommandEvent& event)
|
||||
|
||||
Directory += DIR_SEP_CHR;
|
||||
|
||||
if (DiscIO::IsVolumeWiiDisc(OpenISO))
|
||||
if (OpenISO->IsWiiDisc())
|
||||
{
|
||||
int partitionNum = wxAtoi(Directory.Mid(Directory.find_first_of("/") - 1, 1));
|
||||
Directory.erase(0, Directory.find_first_of("/") + 1); // Remove "Partition x/"
|
||||
@ -937,7 +936,7 @@ void CISOProperties::OnExtractDataFromHeader(wxCommandEvent& event)
|
||||
if (Path.empty())
|
||||
return;
|
||||
|
||||
if (DiscIO::IsVolumeWiiDisc(OpenISO))
|
||||
if (OpenISO->IsWiiDisc())
|
||||
{
|
||||
wxString Directory = m_Treectrl->GetItemText(m_Treectrl->GetSelection());
|
||||
unsigned int partitionNum = wxAtoi(Directory.Mid(Directory.find_first_of("0123456789"), 2));
|
||||
@ -994,7 +993,7 @@ void CISOProperties::CheckPartitionIntegrity(wxCommandEvent& event)
|
||||
{
|
||||
// Normally we can't enter this function if we aren't analyzing a Wii disc
|
||||
// anyway, but let's still check to be sure.
|
||||
if (!DiscIO::IsVolumeWiiDisc(OpenISO))
|
||||
if (!OpenISO->IsWiiDisc())
|
||||
return;
|
||||
|
||||
wxString PartitionName = m_Treectrl->GetItemText(m_Treectrl->GetSelection());
|
||||
|
Reference in New Issue
Block a user