OpenJO: fix Traditional Chinese rendering and runtime language switching - #1346
Open
hsz0566 wants to merge 1 commit into
Open
OpenJO: fix Traditional Chinese rendering and runtime language switching#1346hsz0566 wants to merge 1 commit into
hsz0566 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1196
OpenJO submission draft
Suggested recipient: OpenJK maintainers / JACoders
Suggested subject:
[PATCH] OpenJO: use sp_language for JK2 Asian character decodingHello OpenJK maintainers,
I would like to submit a fix for the OpenJO Traditional Chinese rendering issue
reported in:
#1196
OpenJO correctly uses the numeric
sp_languagecvar to select Jedi OutcastSTRIP entries. For example,
sp_language 5selectsTEXT_LANGUAGE6.The renderer also has a JK2-specific language enum mapping, but the JK2 branch
of
AnyLanguage_ReadCharFromString()still calls the JKALanguage_IsKorean/Taiwanese/Japanese()helpers fromstringed_ingame.h. Those helpers inspectse_language, which normallyremains
englishin OpenJO.As a result, valid Big5 text is loaded from the STRIP files but each two-byte
Chinese character is interpreted as two Western characters. This produces the
garbled menu and subtitle output shown in issue #1196.
The attached patch:
GetLanguageEnum(), which is backed bysp_language.avoiding stale Asian state after a language change.
JK2SP_CheckForLanguageUpdates()after an in-gamesp_languagechange, keeping STRIP reloads synchronized with rendererdecoding.
Validation performed:
OpenJK commit
1a6a6434.sp_language 5selectedTEXT_LANGUAGE6.fonts/tai_16_1024_0through_3, loaded with valid shader handles.invalid entries.
exposed the separate live-switching issue addressed by item 3 above.
git diff --checkand forward/reversegit apply --checkpass.Jedi Academy language path.
One limitation: final visual testing of the locally rebuilt Windows DLL was
blocked by this machine's Windows Application Control policy
(
0xc0e90002) because the generated DLL is unsigned. No security setting wasdisabled. The unpatched official build and the diagnostic build were both
tested against the same game data. The revised live-switch behavior still
needs a final runtime regression test.
The source patch is attached as:
0001-openjo-use-sp-language-for-jk2-asian-fonts.patchThank you for reviewing this fix.
Best regards,
Song / hsz0566