Remove hard coded language values.

svn-id: r19636
This commit is contained in:
Travis Howell 2005-11-18 02:31:24 +00:00
parent 2f8306aeb4
commit 6d76392b7f
5 changed files with 60 additions and 29 deletions

View File

@ -1388,21 +1388,24 @@ void SimonEngine::o_confirmQuit() {
byte keyNo = 'n';
switch (_language) {
case 21: // Russian
case Common::RU_RUS:
break;
case 20: // Hebrew
case Common::PL_POL:
keyYes = 't';
break;
case Common::HB_ISR:
keyYes = 'f';
break;
case 5: // Spanish
case Common::ES_ESP:
keyYes = 's';
break;
case 3: // Italian
case Common::IT_ITA:
keyYes = 's';
break;
case 2: // French
case Common::FR_FRA:
keyYes = 'o';
break;
case 1: // German
case Common::DE_DEU:
keyYes = 'j';
break;
default:
@ -1577,7 +1580,7 @@ void SimonEngine::o_clear_character(FillOrCopyStruct *fcs, int x, byte b) {
old_text = fcs->text_color;
fcs->text_color = fcs->fill_color;
if (_language == 20) { //Hebrew
if (_language == Common::HB_ISR) { //Hebrew
x = 128;
} else {
x += 120;

View File

@ -227,7 +227,7 @@ restart:;
fcs->textRow = unk132_result;
if (_language == 20) { //Hebrew
if (_language == Common::HB_ISR) { //Hebrew
// init x offset with a 2 character savegame number + a period (18 pix)
fcs->textColumn = 3;
fcs->textColumnOffset = 6;
@ -244,7 +244,7 @@ restart:;
// now process entire savegame name to get correct x offset for cursor
name_len = 0;
while (name[name_len]) {
if (_language == 20) { //Hebrew
if (_language == Common::HB_ISR) { //Hebrew
byte width = 6;
if (name[name_len] >= 64 && name[name_len] < 91)
width = _hebrew_char_widths [name[name_len] - 64];
@ -309,7 +309,7 @@ restart:;
name_len--;
m = name[name_len];
if (_language == 20) //Hebrew
if (_language == Common::HB_ISR) //Hebrew
x = 8;
else
x = (name[name_len] == 'i' || name[name_len] == 'l') ? 1 : 8;

View File

@ -574,7 +574,7 @@ int SimonEngine::init(GameDetector &detector) {
if ((getGameType() == GType_SIMON2) && ConfMan.hasKey("speech_mute") && ConfMan.getBool("speech_mute") == 1)
_speech = 0;
if ((getGameType() == GType_SIMON1 && _language > 1) || ((getGameType() == GType_SIMON2) && _language == 20)) {
if ((getGameType() == GType_SIMON1 && _language > 1) || ((getGameType() == GType_SIMON2) && _language == Common::HB_ISR)) {
if (ConfMan.hasKey("subtitles") && ConfMan.getBool("subtitles") == 0)
_subtitles = 0;
} else
@ -2636,7 +2636,7 @@ void SimonEngine::add_vga_timer(uint num, const byte *code_ptr, uint cur_sprite,
// caused several glitches in this scene.
// We work around the problem by correcting the code_ptr for sprite
// 200 in this scene, if it is wrong.
if (getGameType() == GType_SIMON1 && _language == 2 &&
if (getGameType() == GType_SIMON1 && _language == Common::FR_FRA &&
(code_ptr - _vgaBufferPointers[cur_file].vgaFile1 == 4) && (cur_sprite == 200) && (cur_file == 2))
code_ptr += 0x66;
@ -3444,7 +3444,7 @@ void SimonEngine::talk_with_speech(uint speech_id, uint vgaSpriteId) {
}
_skipVgaWait = true;
} else {
if (_subtitles && _language != 20) {
if (_subtitles && _language != Common::HB_ISR) {
_sound->playVoice(speech_id);
return;
} else if (_subtitles && _scriptVar2) {
@ -3990,7 +3990,7 @@ int SimonEngine::go() {
if (getFeatures() & GF_TALKIE) {
// English and German versions of Simon the Sorcerer 1 don't have full subtitles
if (getGameType() == GType_SIMON1 && _language < 2)
if (getGameType() == GType_SIMON1 && (_language == Common::EN_USA || _language == Common::DE_DEU))
_subtitles = false;
} else {
_subtitles = true;

View File

@ -221,25 +221,53 @@ void SimonEngine::focusVerb(uint hitarea_id) {
if (_showPreposition) {
switch (_language) {
case 21: verb_prep_names = russian_verb_prep_names; break;
case 20: verb_prep_names = hebrew_verb_prep_names; break;
case 5: verb_prep_names = spanish_verb_prep_names; break;
case 3: verb_prep_names = italian_verb_prep_names; break;
case 2: verb_prep_names = french_verb_prep_names; break;
case 1: verb_prep_names = german_verb_prep_names; break;
default: verb_prep_names = english_verb_prep_names; break;
case Common::RU_RUS:
verb_prep_names = russian_verb_prep_names;
break;
case Common::HB_ISR:
verb_prep_names = hebrew_verb_prep_names;
break;
case Common::ES_ESP:
verb_prep_names = spanish_verb_prep_names;
break;
case Common::IT_ITA:
verb_prep_names = italian_verb_prep_names;
break;
case Common::FR_FRA:
verb_prep_names = french_verb_prep_names;
break;
case Common::DE_DEU:
verb_prep_names = german_verb_prep_names;
break;
default:
verb_prep_names = english_verb_prep_names;
break;
}
CHECK_BOUNDS(hitarea_id, english_verb_prep_names);
txt = verb_prep_names[hitarea_id];
} else {
switch (_language) {
case 21: verb_names = russian_verb_names; break;
case 20: verb_names = hebrew_verb_names; break;
case 5: verb_names = spanish_verb_names; break;
case 3: verb_names = italian_verb_names; break;
case 2: verb_names = french_verb_names; break;
case 1: verb_names = german_verb_names; break;
default: verb_names = english_verb_names; break;
case Common::RU_RUS:
verb_names = russian_verb_names;
break;
case Common::HB_ISR:
verb_names = hebrew_verb_names;
break;
case Common::ES_ESP:
verb_names = spanish_verb_names;
break;
case Common::IT_ITA:
verb_names = italian_verb_names;
break;
case Common::FR_FRA:
verb_names = french_verb_names;
break;
case Common::DE_DEU:
verb_names = german_verb_names;
break;
default:
verb_names = english_verb_names;
break;
}
CHECK_BOUNDS(hitarea_id, english_verb_names);
txt = verb_names[hitarea_id];

View File

@ -1914,7 +1914,7 @@ void SimonEngine::vc63_fastFadeIn() {
void SimonEngine::vc64_skipIfSpeechEnded() {
// Simon2
if (!_sound->isVoiceActive() || (_subtitles && _language != 20))
if (!_sound->isVoiceActive() || (_subtitles && _language != Common::HB_ISR))
vc_skip_next_instruction();
}