[Scummvm-git-logs] scummvm master -> 9d5155c4753c7c2db8f20a052bd875ec539ba12f
athrxx
noreply at scummvm.org
Sun Aug 14 14:09:55 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
9d5155c475 KYRA: (LOK/Mac) - revert 4a287834 and make a different fix
Commit: 9d5155c4753c7c2db8f20a052bd875ec539ba12f
https://github.com/scummvm/scummvm/commit/9d5155c4753c7c2db8f20a052bd875ec539ba12f
Author: athrxx (athrxx at scummvm.org)
Date: 2022-08-14T16:09:31+02:00
Commit Message:
KYRA: (LOK/Mac) - revert 4a287834 and make a different fix
The Mac version is supposed to always use the ENG main screen (with the text-free jewel button).
Changed paths:
engines/kyra/engine/kyra_lok.cpp
engines/kyra/engine/kyra_lok.h
engines/kyra/resource/staticres.cpp
engines/kyra/sequence/sequences_lok.cpp
diff --git a/engines/kyra/engine/kyra_lok.cpp b/engines/kyra/engine/kyra_lok.cpp
index a4c33de10e1..fba84545859 100644
--- a/engines/kyra/engine/kyra_lok.cpp
+++ b/engines/kyra/engine/kyra_lok.cpp
@@ -96,25 +96,8 @@ KyraEngine_LoK::KyraEngine_LoK(OSystem *system, const GameFlags &flags)
_malcolmFrame = 0;
_malcolmTimer1 = _malcolmTimer2 = 0;
- // Determine search order for resource files with language specific file endings. Some versions have multiple
- // versions in the folder, so we make sure that the one that matches the selected language gets tried first.
- static const Common::Language langOrder[] = {
- Common::EN_ANY, Common::FR_FRA, Common::DE_DEU, Common::ES_ESP, Common::IT_ITA, Common::HE_ISR, Common::KO_KOR
- };
- static const char *pattern[] = { "15", "_ENG", "_FRE", "_GER", "_SPA", "_ITA", "_HEB", "_HAN", "" };
- uint8 _langFileExtIndex[ARRAYSIZE(pattern)];
- memset(_langFileExtIndex, 0, sizeof(_langFileExtIndex));
- for (int i = 0; i < ARRAYSIZE(langOrder); ++i) {
- if (_flags.lang == langOrder[i])
- _langFileExtIndex[0] = i + 1;
- }
- for (int i = 1; i < ARRAYSIZE(_langFileExtIndex); ++i)
- _langFileExtIndex[i] = (i <= _langFileExtIndex[0]) ? i - 1 : i;
- for (int i = 0; i < ARRAYSIZE(_langFileExtIndex); ++i)
- _langFileExt.push_back(pattern[_langFileExtIndex[i]]);
-
_defaultFont = Screen::FID_8_FNT;
- _noteFont = (_flags.isTalkie || flags.platform == Common::kPlatformAmiga) ? _defaultFont : Screen::FID_6_FNT;
+ _noteFont = (_flags.isTalkie || _flags.platform == Common::kPlatformAmiga) ? _defaultFont : Screen::FID_6_FNT;
_defaultLineSpacing = 0;
switch (_flags.lang) {
diff --git a/engines/kyra/engine/kyra_lok.h b/engines/kyra/engine/kyra_lok.h
index 006b114c75b..a34f9522089 100644
--- a/engines/kyra/engine/kyra_lok.h
+++ b/engines/kyra/engine/kyra_lok.h
@@ -528,8 +528,6 @@ protected:
static const int8 _macLQTrackMap[];
static const int _macLQTrackMapSize;
- Common::Array<Common::String> _langFileExt;
-
// TODO: get rid of all variables having pointers to the static resources if possible
// i.e. let them directly use the _staticres functions
void initStaticResource();
diff --git a/engines/kyra/resource/staticres.cpp b/engines/kyra/resource/staticres.cpp
index 214590610e2..fceb05f19eb 100644
--- a/engines/kyra/resource/staticres.cpp
+++ b/engines/kyra/resource/staticres.cpp
@@ -998,9 +998,9 @@ void KyraEngine_LoK::loadMainScreen(int page) {
_screen->clearPage(page);
bool success = false;
-
- for (uint i = 0; i < _langFileExt.size() && !success; ++i) {
- Common::String tryFile = Common::String::format("MAIN%s.CPS", _langFileExt[i].c_str());
+ static const char *pattern[] = { "15", "_ENG", "_FRE", "_GER", "_SPA", "_ITA", "_HEB", "_HAN", "" };
+ for (int i = 0; i < ARRAYSIZE(pattern) && !success; ++i) {
+ Common::String tryFile = Common::String::format("MAIN%s.CPS", pattern[i]);
if ((success = _res->exists(tryFile.c_str())))
_screen->loadBitmap(tryFile.c_str(), page, page, i == 0 ? &_screen->getPalette(0) : 0);
}
diff --git a/engines/kyra/sequence/sequences_lok.cpp b/engines/kyra/sequence/sequences_lok.cpp
index affadd011d9..048522b9113 100644
--- a/engines/kyra/sequence/sequences_lok.cpp
+++ b/engines/kyra/sequence/sequences_lok.cpp
@@ -251,9 +251,13 @@ bool KyraEngine_LoK::seq_introStory() {
if (!textEnabled() && speechEnabled() && _flags.lang != Common::IT_ITA)
return false;
+ // Mac Talkie has multiple versions of the file. Make sure the correct one gets picked.
+ int searchStart = (_flags.isTalkie && _flags.platform == Common::kPlatformMacintosh && _flags.lang != Common::EN_ANY) ? (_flags.lang == Common::FR_FRA ? 2 : 3) : 0;
+
bool success = false;
- for (uint i = 0; i < _langFileExt.size() && !success; ++i) {
- Common::String tryFile = Common::String::format("TEXT%s.CPS", _langFileExt[i].c_str());
+ static const char *pattern[] = { "", "_ENG", "_FRE", "_GER", "_SPA", "_ITA", "_HEB", "_HAN" };
+ for (int i = searchStart; i < ARRAYSIZE(pattern) && !success; ++i) {
+ Common::String tryFile = Common::String::format("TEXT%s.CPS", pattern[i]);
if ((success = _res->exists(tryFile.c_str())))
_screen->loadBitmap(tryFile.c_str(), 3, 3, &_screen->getPalette(0));
}
More information about the Scummvm-git-logs
mailing list