Skip to content

Instantly share code, notes, and snippets.

@jrsa
Created January 13, 2018 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrsa/875c4c0c3453682c039257a858aa3b7a to your computer and use it in GitHub Desktop.
Save jrsa/875c4c0c3453682c039257a858aa3b7a to your computer and use it in GitHub Desktop.
// CMapChunk::Create, macOS build 12340
do {
subchunks_ = *subchunks;
remainingDataBytes = remainingSubchunkBytes - 8;
currentChunkData_ = subchunks + 8;
if (*subchunks == 'MCNR') {
this->pMcnrData = currentChunkData_;
*(subchunks + 4) = 448;
}
else if (*subchunks > 'MCNR') {
if (subchunks_ == 'MCSE') {
if (this->header->nSoundEmitters)
this->pMcseData = currentChunkData_;
}
else if (subchunks_ > 'MCSE') {
if (subchunks_ == 'MCSH') {
this->pMcshData = currentChunkData_;
}
else if (subchunks_ == 'MCVT') {
this->pMcvtData = currentChunkData_;
}
}
else if (subchunks_ == 'MCRF') {
this->pMcrfData = currentChunkData_;
}
}
else if (subchunks_ == 'MCCV') {
this->pMccvData = currentChunkData_;
}
else if (subchunks_ > 'MCCV') {
if (subchunks_ == 'MCLQ') {
header__ = this->header;
if (header__->sizeLiquid > 8u) {
this->pMclqData = currentChunkData_;
*(subchunks + 4) = header__->sizeLiquid - 8;
}
}
else if (subchunks_ == 'MCLY') {
this->pMclyData = currentChunkData_;
}
}
else if (subchunks_ == 'MCAL') {
header = this->header;
this->pMcalData = currentChunkData_;
*(subchunks + 4) = header->sizeAlpha - 8;
}
nextChunkOffset = *(subchunks + 4);
remainingSubchunkBytes = remainingDataBytes - nextChunkOffset;
subchunks = currentChunkData_ + nextChunkOffset;
} while (remainingSubchunkBytes > 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment