We hate pointer games, don't we?

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@597 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY 2008-09-21 15:04:22 +00:00
parent 60a4630324
commit 369a6d2883
13 changed files with 21 additions and 21 deletions

View File

@ -479,7 +479,7 @@ bool CBoot::BootUp(const SCoreStartupParameter& _StartupPara)
if (pVolume == NULL) if (pVolume == NULL)
break; break;
bool isoWii = DiscIO::IsVolumeWiiDisc(*pVolume); bool isoWii = DiscIO::IsVolumeWiiDisc(pVolume);
if (isoWii != Core::GetStartupParameter().bWii) if (isoWii != Core::GetStartupParameter().bWii)
{ {
PanicAlert("Warning - starting ISO in wrong console mode!"); PanicAlert("Warning - starting ISO in wrong console mode!");

View File

@ -65,7 +65,7 @@ bool SCoreStartupParameter::AutoSetup(EBootBios _BootBios)
return false; return false;
} }
m_strUniqueID = pVolume->GetUniqueID(); m_strUniqueID = pVolume->GetUniqueID();
bWii = DiscIO::IsVolumeWiiDisc(*pVolume); bWii = DiscIO::IsVolumeWiiDisc(pVolume);
switch (pVolume->GetCountry()) switch (pVolume->GetCountry())
{ {

View File

@ -38,7 +38,7 @@ CWII_IPC_HLE_Device_di::CWII_IPC_HLE_Device_di(u32 _DeviceID, const std::string&
m_pVolume = DiscIO::CreateVolumeFromFilename(Core::GetStartupParameter().m_strFilename); m_pVolume = DiscIO::CreateVolumeFromFilename(Core::GetStartupParameter().m_strFilename);
if (m_pVolume) if (m_pVolume)
m_pFileSystem = DiscIO::CreateFileSystem(*m_pVolume); m_pFileSystem = DiscIO::CreateFileSystem(m_pVolume);
} }
// __________________________________________________________________________________________________ // __________________________________________________________________________________________________

View File

@ -69,7 +69,7 @@ bool IsValid()
bool IsWii() bool IsWii()
{ {
if (g_pVolume) if (g_pVolume)
return IsVolumeWiiDisc(*g_pVolume); return IsVolumeWiiDisc(g_pVolume);
return false; return false;
} }

View File

@ -64,7 +64,7 @@ CBannerLoaderWii::CBannerLoaderWii(DiscIO::IFileSystem& _rFileSystem)
} }
m_Name = std::string("Wii: ") + _rFileSystem.GetVolume().GetName(); m_Name = std::string("Wii: ") + _rFileSystem.GetVolume()->GetName();
} }

View File

@ -25,7 +25,7 @@
namespace DiscIO namespace DiscIO
{ {
CFileSystemGCWii::CFileSystemGCWii(const IVolume& _rVolume) CFileSystemGCWii::CFileSystemGCWii(const IVolume *_rVolume)
: IFileSystem(_rVolume), : IFileSystem(_rVolume),
m_Initialized(false), m_Initialized(false),
m_OffsetShift(0) m_OffsetShift(0)
@ -106,7 +106,7 @@ CFileSystemGCWii::ReadFile(const char* _rFullPath, u8* _pBuffer, size_t _MaxBuff
return(0); return(0);
} }
m_rVolume.Read(pFileInfo->m_Offset, pFileInfo->m_FileSize, _pBuffer); m_rVolume->Read(pFileInfo->m_Offset, pFileInfo->m_FileSize, _pBuffer);
return(pFileInfo->m_FileSize); return(pFileInfo->m_FileSize);
} }
@ -155,14 +155,14 @@ u32
CFileSystemGCWii::Read32(u64 _Offset) const CFileSystemGCWii::Read32(u64 _Offset) const
{ {
u32 Temp = 0; u32 Temp = 0;
m_rVolume.Read(_Offset, 4, (u8*)&Temp); m_rVolume->Read(_Offset, 4, (u8*)&Temp);
return(Common::swap32(Temp)); return(Common::swap32(Temp));
} }
void CFileSystemGCWii::GetStringFromOffset(u64 _Offset, char* Filename) const void CFileSystemGCWii::GetStringFromOffset(u64 _Offset, char* Filename) const
{ {
m_rVolume.Read(_Offset, 255, (u8*)Filename); m_rVolume->Read(_Offset, 255, (u8*)Filename);
} }
size_t CFileSystemGCWii::GetFileList(std::vector<SFileInfo *> &_rFilenames) size_t CFileSystemGCWii::GetFileList(std::vector<SFileInfo *> &_rFilenames)

View File

@ -29,7 +29,7 @@ class CFileSystemGCWii
{ {
public: public:
CFileSystemGCWii(const IVolume& _rVolume); CFileSystemGCWii(const IVolume *_rVolume);
virtual ~CFileSystemGCWii(); virtual ~CFileSystemGCWii();

View File

@ -23,7 +23,7 @@
namespace DiscIO namespace DiscIO
{ {
IFileSystem::IFileSystem(const IVolume& _rVolume) IFileSystem::IFileSystem(const IVolume *_rVolume)
: m_rVolume(_rVolume) : m_rVolume(_rVolume)
{} {}
@ -32,7 +32,7 @@ IFileSystem::~IFileSystem()
{} {}
IFileSystem* CreateFileSystem(const IVolume& _rVolume) IFileSystem* CreateFileSystem(const IVolume* _rVolume)
{ {
IFileSystem* pFileSystem = new CFileSystemGCWii(_rVolume); IFileSystem* pFileSystem = new CFileSystemGCWii(_rVolume);

View File

@ -46,7 +46,7 @@ class IFileSystem
{ {
public: public:
IFileSystem(const IVolume& _rVolume); IFileSystem(const IVolume *_rVolume);
virtual ~IFileSystem(); virtual ~IFileSystem();
@ -66,15 +66,15 @@ class IFileSystem
virtual const char* GetFileName(u64 _Address) = 0; virtual const char* GetFileName(u64 _Address) = 0;
virtual const IVolume& GetVolume() {return(m_rVolume);} virtual const IVolume *GetVolume() {return(m_rVolume);}
protected: protected:
const IVolume& m_rVolume; const IVolume *m_rVolume;
}; };
IFileSystem* CreateFileSystem(const IVolume& _rVolume); IFileSystem* CreateFileSystem(const IVolume *_rVolume);
} // namespace } // namespace
#endif #endif

View File

@ -103,10 +103,10 @@ IVolume* CreateVolumeFromFilename(const std::string& _rFilename)
return NULL; return NULL;
} }
bool IsVolumeWiiDisc(const IVolume& _rVolume) bool IsVolumeWiiDisc(const IVolume *_rVolume)
{ {
u32 MagicWord = 0; u32 MagicWord = 0;
_rVolume.Read(0x18, 4, (u8*)&MagicWord); _rVolume->Read(0x18, 4, (u8*)&MagicWord);
return (Common::swap32(MagicWord) == 0x5D1C9EA3); return (Common::swap32(MagicWord) == 0x5D1C9EA3);
} }

View File

@ -23,7 +23,7 @@
namespace DiscIO namespace DiscIO
{ {
IVolume* CreateVolumeFromFilename(const std::string& _rFilename); IVolume* CreateVolumeFromFilename(const std::string& _rFilename);
bool IsVolumeWiiDisc(const IVolume& _rVolume); bool IsVolumeWiiDisc(const IVolume *_rVolume);
} // namespace } // namespace
#endif #endif

View File

@ -42,7 +42,7 @@ CFilesystemViewer::CFilesystemViewer(const std::string fileName, wxWindow* paren
std::vector<DiscIO::SFileInfo *> Our_Files; std::vector<DiscIO::SFileInfo *> Our_Files;
OpenIso = DiscIO::CreateVolumeFromFilename(fileName); OpenIso = DiscIO::CreateVolumeFromFilename(fileName);
pFileSystem = DiscIO::CreateFileSystem(*OpenIso); pFileSystem = DiscIO::CreateFileSystem(OpenIso);
pFileSystem->GetFileList(Our_Files); pFileSystem->GetFileList(Our_Files);
CreateGUIControls(); CreateGUIControls();

View File

@ -50,7 +50,7 @@ CISOFile::CISOFile(const std::string& _rFileName)
m_BlobCompressed = DiscIO::IsCompressedBlob(_rFileName.c_str()); m_BlobCompressed = DiscIO::IsCompressedBlob(_rFileName.c_str());
// check if we can get some infos from the banner file too // check if we can get some infos from the banner file too
DiscIO::IFileSystem* pFileSystem = DiscIO::CreateFileSystem(*pVolume); DiscIO::IFileSystem* pFileSystem = DiscIO::CreateFileSystem(pVolume);
if (pFileSystem != NULL) if (pFileSystem != NULL)
{ {