Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCUMM: Implement language bundle for Korean fan translation #2620

Merged

Conversation

@wonst719
Copy link
Contributor

@wonst719 wonst719 commented Nov 14, 2020

This adds support for language bundle to the SCUMM v1~v7 games.
It enables fan translation without the need for patching game resource.
While it's kind of similar to the DIG/COMI language bundle, the file format and the logic is different.

Tested with:

  • Maniac Mansion (V1 DOS)
  • Indy 3, 4 (Steam)
  • Loom (EGA)
  • Day of the Tentacle (CD)
  • Sam & Max (CD)
  • Full Throttle
@sev-
sev- approved these changes Nov 15, 2020
Copy link
Member

@sev- sev- left a comment

Besides a few minor formatting fixes and one potential improvement, looks fine to me.


// Translate resource text
byte translateBuffer[512];
if (isScummvmKorTarget())

This comment has been minimized.

@sev-

sev- Nov 15, 2020
Member

Formatting

@@ -1620,6 +1620,11 @@ static int indexCompare(const void *p1, const void *p2) {

// Create an index of the language file.
void ScummEngine_v7::loadLanguageBundle() {
if (isScummvmKorTarget()) {
// HACK to support language bundle for FT

This comment has been minimized.

@sev-

sev- Nov 15, 2020
Member

Why is it a hack?

This comment has been minimized.

@wonst719

wonst719 Nov 15, 2020
Author Contributor

I didn't feel good about making a exception path for just one game.
I can't think of a better way, though.

}

// strcmp equivalent for Scumm string
static int compareResString(const byte* a, int aLen, const byte* b, int bLen) {

This comment has been minimized.

@sev-

sev- Nov 15, 2020
Member

Formatting. Should be const byte *a, same for b, but in general, why not use

strncmp(a, b, MIN(aLe, bLen))

Which looks like the full equivalent.

This comment has been minimized.

@wonst719

wonst719 Nov 15, 2020
Author Contributor

I don't know what I was thinking. :-D
strncmp won't work, because SCUMM resource strings contain \0 middle of the string.
But memcmp(a, b, MIN(aLen, bLen)) will do.

wonst719 added 2 commits Nov 15, 2020
- replace compareResString() with memcmp()
- fix formatting
- fix comment
@wonst719 wonst719 merged commit 4f31022 into scummvm:master Nov 15, 2020
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deepcode-ci-bot Well done, no issues found!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.