mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-10 20:01:25 +00:00
GRIM: Add handling of german grim-demo language.tab
This commit is contained in:
parent
22cf61ba64
commit
0658fe82f3
@ -33,14 +33,24 @@ namespace Grim {
|
|||||||
Localizer *g_localizer = nullptr;
|
Localizer *g_localizer = nullptr;
|
||||||
|
|
||||||
Localizer::Localizer() {
|
Localizer::Localizer() {
|
||||||
if (g_grim->getGameType() == GType_GRIM && g_grim->getGameFlags() & ADGF_DEMO)
|
// To avoid too wide lines further below, we just name these here.
|
||||||
|
bool isAnyDemo = g_grim->getGameFlags() & ADGF_DEMO;
|
||||||
|
bool isGrimDemo = g_grim->getGameType() == GType_GRIM && isAnyDemo;
|
||||||
|
bool isGerman = g_grim->getGameLanguage() == Common::DE_DEU;
|
||||||
|
bool isPS2 = g_grim->getGamePlatform() == Common::kPlatformPS2;
|
||||||
|
|
||||||
|
if (isGrimDemo && !isGerman)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Common::String filename;
|
Common::String filename;
|
||||||
if (g_grim->getGameType() == GType_MONKEY4) {
|
if (g_grim->getGameType() == GType_MONKEY4) {
|
||||||
filename = "script.tab";
|
filename = "script.tab";
|
||||||
} else {
|
} else {
|
||||||
filename = "grim.tab";
|
if (isGrimDemo && isGerman) {
|
||||||
|
filename = "language.tab";
|
||||||
|
} else {
|
||||||
|
filename = "grim.tab";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::SeekableReadStream *f = g_resourceloader->openNewStreamFile(filename);
|
Common::SeekableReadStream *f = g_resourceloader->openNewStreamFile(filename);
|
||||||
@ -57,7 +67,8 @@ Localizer::Localizer() {
|
|||||||
data[filesize] = '\0';
|
data[filesize] = '\0';
|
||||||
delete f;
|
delete f;
|
||||||
|
|
||||||
if (!(g_grim->getGameFlags() & ADGF_DEMO) && g_grim->getGamePlatform() != Common::kPlatformPS2) {
|
// Explicitly white-list german demo, as it has a .tab-file
|
||||||
|
if ((isGrimDemo && isGerman) || (!isAnyDemo && !isPS2)) {
|
||||||
if (filesize < 4)
|
if (filesize < 4)
|
||||||
error("%s to short: %i", filename.c_str(), filesize);
|
error("%s to short: %i", filename.c_str(), filesize);
|
||||||
switch (READ_BE_UINT32(data)) {
|
switch (READ_BE_UINT32(data)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user