mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-22 19:30:36 +00:00
implement reading of macbinary files
This commit is contained in:
parent
d3dc7a1d25
commit
b8a4af80ca
@ -239,7 +239,30 @@ bool ResourceFile::read()
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Format::macbin:
|
||||
{
|
||||
fs::ifstream in(path);
|
||||
if(byte(in) != 0)
|
||||
return false;
|
||||
if(byte(in) > 63)
|
||||
return false;
|
||||
in.seekg(65);
|
||||
type = ostype(in);
|
||||
creator = ostype(in);
|
||||
in.seekg(83);
|
||||
int datasize = longword(in);
|
||||
//int rsrcsize = longword(in);
|
||||
|
||||
in.seekg(0);
|
||||
char header[124];
|
||||
in.read(header, 124);
|
||||
unsigned short crc = CalculateCRC(0,header,124);
|
||||
if(word(in) != crc)
|
||||
return false;
|
||||
in.seekg(128 + datasize);
|
||||
resources = Resources(in);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user