Commit combined speech and subtitles patch

Add support for nosubtitles config option

svn-id: r8324
This commit is contained in:
Travis Howell 2003-06-05 12:20:05 +00:00
parent 740e7cc0ff
commit 33dceea477
3 changed files with 34 additions and 41 deletions

View file

@ -995,11 +995,10 @@ int SimonEngine::runScript() {
if (_game & GF_TALKIE) if (_game & GF_TALKIE)
d = _array_4[a]; d = _array_4[a];
if (d != 0 && !_subtitles) { if (d != 0)
talk_with_speech(d, b); talk_with_speech(d, b);
} else if (s != NULL) { if (s != NULL && (d == 0 || _subtitles))
talk_with_text(b, c, s, tv->a, tv->b, tv->c); talk_with_text(b, c, s, tv->a, tv->b, tv->c);
}
} }
break; break;
@ -1234,12 +1233,10 @@ void SimonEngine::o_inventory_descriptions() {
if (_game == GAME_SIMON1CD32 || _game == GAME_SIMON1TALKIE || _game == GAME_SIMON1WIN) { if (_game == GAME_SIMON1CD32 || _game == GAME_SIMON1TALKIE || _game == GAME_SIMON1WIN) {
if (child != NULL && child->avail_props & 0x200) { if (child != NULL && child->avail_props & 0x200) {
uint offs = getOffsetOfChild2Param(child, 0x200); uint offs = getOffsetOfChild2Param(child, 0x200);
if (!_subtitles) talk_with_speech(child->array[offs], a);
talk_with_speech(child->array[offs], a);
} else if (child != NULL && child->avail_props & 0x100) { } else if (child != NULL && child->avail_props & 0x100) {
uint offs = getOffsetOfChild2Param(child, 0x100); uint offs = getOffsetOfChild2Param(child, 0x100);
if (!_subtitles) talk_with_speech(child->array[offs] + 3550, a);
talk_with_speech(child->array[offs] + 3550, a);
} }
} else if (_game == GAME_SIMON2TALKIE || _game == GAME_SIMON2WIN) { } else if (_game == GAME_SIMON2TALKIE || _game == GAME_SIMON2WIN) {
if (child != NULL && child->avail_props & 0x200) { if (child != NULL && child->avail_props & 0x200) {
@ -1289,8 +1286,7 @@ void SimonEngine::o_inventory_descriptions() {
} }
} }
if (!_subtitles) talk_with_speech(var200, a);
talk_with_speech(var200, a);
} }
} }

View file

@ -245,7 +245,7 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
_continous_mainscript = 0; _continous_mainscript = 0;
_continous_vgascript = 0; _continous_vgascript = 0;
_draw_images_debug = 0; _draw_images_debug = 0;
_subtitles = 0; _subtitles = true;
_mouse_cursor = 0; _mouse_cursor = 0;
_vga_var9 = 0; _vga_var9 = 0;
_script_unk_1 = 0; _script_unk_1 = 0;
@ -430,6 +430,7 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
_debugMode = detector->_debugMode; _debugMode = detector->_debugMode;
_debugLevel = detector->_debugLevel; _debugLevel = detector->_debugLevel;
_language = detector->_language; _language = detector->_language;
_noSubtitles = detector->_noSubtitles;
} }
SimonEngine::~SimonEngine() { SimonEngine::~SimonEngine() {
@ -2037,11 +2038,10 @@ void SimonEngine::o_print_str() {
case GAME_SIMON1TALKIE: case GAME_SIMON1TALKIE:
case GAME_SIMON1WIN: case GAME_SIMON1WIN:
case GAME_SIMON1CD32: case GAME_SIMON1CD32:
if (speech_id != 0 && !_subtitles) { if (speech_id != 0)
talk_with_speech(speech_id, num_1); talk_with_speech(speech_id, num_1);
} else if (string_ptr != NULL) { if (string_ptr != NULL && _subtitles)
talk_with_text(num_1, num_2, (const char *)string_ptr, tv->a, tv->b, tv->c); talk_with_text(num_1, num_2, (const char *)string_ptr, tv->a, tv->b, tv->c);
}
break; break;
case GAME_SIMON1DEMO: case GAME_SIMON1DEMO:
@ -2054,7 +2054,7 @@ void SimonEngine::o_print_str() {
case GAME_SIMON2TALKIE: case GAME_SIMON2TALKIE:
case GAME_SIMON2WIN: case GAME_SIMON2WIN:
case GAME_SIMON2MAC: case GAME_SIMON2MAC:
if (speech_id != 0 && num_1 == 1 && !_subtitles) if (speech_id != 0 && num_1 == 1)
talk_with_speech(speech_id, num_1); talk_with_speech(speech_id, num_1);
if (speech_id != 0 && !_subtitles) if (speech_id != 0 && !_subtitles)
@ -2729,12 +2729,10 @@ void SimonEngine::o_wait_for_vga(uint a) {
_exit_cutscene = false; _exit_cutscene = false;
_skip_speech = false; _skip_speech = false;
while (_vga_wait_for != 0) { while (_vga_wait_for != 0) {
if (_skip_speech) { if (_skip_speech && _game & GF_SIMON2) {
if (_game & GF_SIMON2) { if (_vga_wait_for == 200 && !vc_get_bit(14)) {
if (_vga_wait_for == 200 && !vc_get_bit(14)) { skip_speech();
skip_speech(); break;
break;
}
} }
} else if (_exit_cutscene) { } else if (_exit_cutscene) {
if (vc_get_bit(9)) { if (vc_get_bit(9)) {
@ -3742,6 +3740,8 @@ void SimonEngine::start_vga_code(uint b, uint vga_res, uint vga_struct_id, uint
void SimonEngine::talk_with_speech(uint speech_id, uint num_1) { void SimonEngine::talk_with_speech(uint speech_id, uint num_1) {
if (!(_game & GF_SIMON2)) { if (!(_game & GF_SIMON2)) {
if (speech_id == 9999) { if (speech_id == 9999) {
if (_subtitles)
return;
if (!(_bit_array[0] & 0x4000) && !(_bit_array[1] & 0x1000)) { if (!(_bit_array[0] & 0x4000) && !(_bit_array[1] & 0x1000)) {
_bit_array[0] |= 0x4000; _bit_array[0] |= 0x4000;
_variableArray[100] = 0xF; _variableArray[100] = 0xF;
@ -3749,15 +3749,14 @@ void SimonEngine::talk_with_speech(uint speech_id, uint num_1) {
o_wait_for_vga(0x82); o_wait_for_vga(0x82);
} }
_skip_vga_wait = true; _skip_vga_wait = true;
return; } else {
} if (_subtitles && _scriptvar_2) {
if (num_1 < 100) { start_vga_code(4, 2, 204, 0, 0, 0);
o_wait_for_vga(204);
o_kill_sprite_simon1(204);
}
o_kill_sprite_simon1(num_1 + 201); o_kill_sprite_simon1(num_1 + 201);
} _sound->playVoice(speech_id);
_sound->playVoice(speech_id);
if (num_1 < 100) {
start_vga_code(4, 2, num_1 + 201, 0, 0, 0); start_vga_code(4, 2, num_1 + 201, 0, 0, 0);
} }
} else { } else {
@ -3779,7 +3778,6 @@ void SimonEngine::talk_with_speech(uint speech_id, uint num_1) {
} }
o_kill_sprite_simon2(2, num_1 + 2); o_kill_sprite_simon2(2, num_1 + 2);
_sound->playVoice(speech_id); _sound->playVoice(speech_id);
start_vga_code(4, 2, num_1 + 2, 0, 0, 0); start_vga_code(4, 2, num_1 + 2, 0, 0, 0);
} }
} }
@ -4395,18 +4393,16 @@ void SimonEngine::go() {
if (_debugLevel == 4) if (_debugLevel == 4)
_start_mainscript = true; _start_mainscript = true;
if (_sound->hasVoice()) { if (_game & GF_TALKIE)
if (_noSubtitles)
_subtitles = false;
// English and German versions of Simon the Sorcerer 1 don't have full subtitles
if (!(_game & GF_SIMON2) && _language < 2)
_subtitles = false; _subtitles = false;
} else {
_subtitles = true;
}
if (_language == 4 || (_language > 5 && _language < 20)) if (_language == 4 || (_language > 5 && _language < 20))
error("Only English, French, German, Hebrew, Italian and Spanish are supported"); error("The only known versions are English, French, German, Hebrew, Italian and Spanish");
//Only English and German voice files were produced
if (_language >= 2)
_subtitles = true;
while (1) { while (1) {
hitarea_stuff(); hitarea_stuff();
@ -4482,10 +4478,10 @@ void SimonEngine::delay(uint amount) {
case OSystem::EVENT_RBUTTONDOWN: case OSystem::EVENT_RBUTTONDOWN:
if (_game & GF_SIMON2) if (_game & GF_SIMON2)
_skip_speech = true; _skip_speech = true;
else else
_exit_cutscene = true; _exit_cutscene = true;
break; break;
default: default:
break; break;

View file

@ -186,6 +186,7 @@ public:
uint16 _debugMode; uint16 _debugMode;
uint16 _debugLevel; uint16 _debugLevel;
uint16 _language; uint16 _language;
bool _noSubtitles;
bool _start_mainscript; bool _start_mainscript;
bool _continous_mainscript; bool _continous_mainscript;
bool _continous_vgascript; bool _continous_vgascript;