mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-14 16:29:21 +01:00
improved FileHandlerARC
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2461 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
0e9a49af7f
commit
cbd5345696
@ -20,15 +20,32 @@
|
|||||||
|
|
||||||
#include "FileHandlerARC.h"
|
#include "FileHandlerARC.h"
|
||||||
#include "StringUtil.h"
|
#include "StringUtil.h"
|
||||||
|
#include "Blob.h"
|
||||||
|
|
||||||
|
|
||||||
#define ARC_ID 0x55aa382d
|
#define ARC_ID 0x55aa382d
|
||||||
|
|
||||||
namespace DiscIO
|
namespace DiscIO
|
||||||
{
|
{
|
||||||
|
CARCFile::CARCFile(const std::string& _rFilename)
|
||||||
|
: m_pBuffer(NULL)
|
||||||
|
, m_Initialized(false)
|
||||||
|
{
|
||||||
|
DiscIO::IBlobReader* pReader = DiscIO::CreateBlobReader(_rFilename.c_str());
|
||||||
|
if (pReader != NULL)
|
||||||
|
{
|
||||||
|
u64 FileSize = pReader->GetDataSize();
|
||||||
|
m_pBuffer = new u8[FileSize];
|
||||||
|
pReader->Read(0, FileSize, m_pBuffer);
|
||||||
|
delete pReader;
|
||||||
|
|
||||||
|
m_Initialized = ParseBuffer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CARCFile::CARCFile(const u8* _pBuffer, size_t _BufferSize)
|
CARCFile::CARCFile(const u8* _pBuffer, size_t _BufferSize)
|
||||||
: m_pBuffer(NULL),
|
: m_pBuffer(NULL)
|
||||||
m_Initialized(false)
|
, m_Initialized(false)
|
||||||
{
|
{
|
||||||
m_pBuffer = new u8[_BufferSize];
|
m_pBuffer = new u8[_BufferSize];
|
||||||
|
|
||||||
|
@ -30,6 +30,8 @@ class CARCFile
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
CARCFile(const std::string& _rFilename);
|
||||||
|
|
||||||
CARCFile(const u8* _pBuffer, size_t _BufferSize);
|
CARCFile(const u8* _pBuffer, size_t _BufferSize);
|
||||||
|
|
||||||
virtual ~CARCFile();
|
virtual ~CARCFile();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user