mirror of
https://github.com/autc04/Retro68.git
synced 2024-06-25 21:29:51 +00:00
fix data forks in MacBinary
This commit is contained in:
parent
fd5a1e57f2
commit
bcfcbb90a3
|
@ -70,7 +70,9 @@ static void writeMacBinary(std::ostream& out, std::string filename,
|
||||||
out.seekp(128);
|
out.seekp(128);
|
||||||
out << data;
|
out << data;
|
||||||
std::streampos dataend = out.tellp();
|
std::streampos dataend = out.tellp();
|
||||||
std::streampos rsrcstart = ((int)dataend + 0x7F) & ~0x7F;
|
while((int)out.tellp() % 128)
|
||||||
|
byte(out,0);
|
||||||
|
std::streampos rsrcstart = out.tellp(); //((int)dataend + 0x7F) & ~0x7F;
|
||||||
rsrc.writeFork(out);
|
rsrc.writeFork(out);
|
||||||
|
|
||||||
std::streampos rsrcend = out.tellp();
|
std::streampos rsrcend = out.tellp();
|
||||||
|
@ -351,9 +353,11 @@ 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;
|
||||||
|
in.seekg(128);
|
||||||
std::vector<char> buf(datasize);
|
std::vector<char> buf(datasize);
|
||||||
in.read(buf.data(), datasize);
|
in.read(buf.data(), datasize);
|
||||||
data = std::string(buf.begin(), buf.end());
|
data = std::string(buf.begin(), buf.end());
|
||||||
|
datasize = ((int)datasize + 0x7F) & ~0x7F;
|
||||||
in.seekg(128 + datasize);
|
in.seekg(128 + datasize);
|
||||||
resources = Resources(in);
|
resources = Resources(in);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user