mirror of
https://github.com/autc04/Retro68.git
synced 2024-11-26 06:49:33 +00:00
ResourceFiles: read data forks from MacBinary and AppleSingle
This commit is contained in:
parent
eb9dd5aaff
commit
5f998b85be
@ -265,13 +265,14 @@ bool ResourceFile::read()
|
|||||||
in.seekg(26 + i * 12);
|
in.seekg(26 + i * 12);
|
||||||
int what = longword(in);
|
int what = longword(in);
|
||||||
int off = longword(in);
|
int off = longword(in);
|
||||||
//int len = longword(in);
|
int len = longword(in);
|
||||||
in.seekg(off);
|
in.seekg(off);
|
||||||
switch(what)
|
switch(what)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
// ###
|
std::vector<char> buf(len);
|
||||||
// FIXME: read data fork
|
in.read(buf, len);
|
||||||
|
data = std::string(buf.begin(), buf.end());
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
resources = Resources(in);
|
resources = Resources(in);
|
||||||
@ -342,7 +343,9 @@ bool ResourceFile::read()
|
|||||||
unsigned short crc = CalculateCRC(0,header,124);
|
unsigned short crc = CalculateCRC(0,header,124);
|
||||||
if(word(in) != crc)
|
if(word(in) != crc)
|
||||||
return false;
|
return false;
|
||||||
// FIXME: read data fork
|
std::vector<char> buf(datasize);
|
||||||
|
in.read(buf, datasize);
|
||||||
|
data = std::string(buf.begin(), buf.end());
|
||||||
in.seekg(128 + datasize);
|
in.seekg(128 + datasize);
|
||||||
resources = Resources(in);
|
resources = Resources(in);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user