KEMBAR78
DIRECTOR: Fix abort with director 6 by phcoder · Pull Request #4988 · scummvm/scummvm · GitHub
Skip to content

Conversation

@phcoder
Copy link
Contributor

@phcoder phcoder commented May 7, 2023

Note: this doesn't add support for D6, only improves error message

bool Cast::loadConfig() {
Common::SeekableReadStreamEndian *stream = nullptr;
stream = _castArchive->getMovieResourceIfPresent(MKTAG('V', 'W', 'C', 'F'));
if (!stream)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is better to be checked against the Director version. E.g. something like if (Director < 6) load VWCF, load DRCF otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original director checks for both judging from the reversing documentation.

fileOffset = _resources[fileId]->offset;
endianStream.seek(fileOffset + 8);
uint32 tag = endianStream.readUint32();
if (tag != MKTAG('X', 't', 'r', 'a') && tag != MKTAG('a', 'r', 't', 'X'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the stream is endian, why checking for different endianness?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly for safety. They are containers inside of containers so I didn't want to assume that both levelsuse the same endianness

@moralrecordings
Copy link
Contributor

Looks good, thank you!

@sev-
Copy link
Member

sev- commented May 10, 2023

Thanks!

@sev- sev- merged commit 36f3797 into scummvm:master May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants