mirror of
https://github.com/scummvm/scummvm.git
synced 2026-05-21 05:40:43 +00:00
DEVTOOLS: Add nancy2 patches to create_nancy
Added facilities for embedding game patches into nancy.dat Added two game patches for nancy2: - one of the original patches, as distributed by the original devs. Specifically, only the patch to extend the end-game timer; there exists another patch that fixes an error when double-clicking a specific cupboard, but that's caused by an engine bug that does not exist in ScummVM. - a new, custom patch that fixes a nasty softlock caused by incorrect dependencies in a certain scene.
This commit is contained in:
@@ -155,6 +155,27 @@ void writeEventFlagNames(File &output, const Common::Array<const char *> &eventF
|
||||
writeToFile(output, eventFlagNames);
|
||||
}
|
||||
|
||||
void writePatchFile(File &output, const char *filename) {
|
||||
File file;
|
||||
if (!file.open(filename, AccessMode::kFileReadMode)) {
|
||||
return;
|
||||
}
|
||||
|
||||
byte *buf = new byte[file.size()];
|
||||
file.read(buf, file.size());
|
||||
|
||||
output.writeUint32(MKTAG('P', 'A', 'T', 'C'));
|
||||
output.write(buf, file.size());
|
||||
|
||||
file.close();
|
||||
delete[] buf;
|
||||
}
|
||||
|
||||
void writePatchAssociations(File &output, const Common::Array<PatchAssociation> &patchAssociations) {
|
||||
output.writeUint32(MKTAG('P', 'A', 'S', 'S'));
|
||||
writeToFile(output, patchAssociations);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
File output;
|
||||
if (!output.open("nancy.dat", kFileWriteMode)) {
|
||||
@@ -209,6 +230,8 @@ int main(int argc, char *argv[]) {
|
||||
WRAPWITHOFFSET(writeRingingTexts(output, _nancy2TelephoneRinging))
|
||||
WRAPWITHOFFSET(writeEmptySaveTexts(output, _nancy2EmptySaveStrings))
|
||||
WRAPWITHOFFSET(writeEventFlagNames(output, _nancy2EventFlagNames))
|
||||
WRAPWITHOFFSET(writePatchFile(output, "files/nancy2_patchtree.dat"))
|
||||
WRAPWITHOFFSET(writePatchAssociations(output, nancy2PatchAssociations))
|
||||
|
||||
// Nancy Drew: Message in a Haunted Mansion data
|
||||
gameOffsets.push_back(output.pos());
|
||||
|
||||
Reference in New Issue
Block a user