aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2002-11-20 05:12:10 +0000
committerTravis Howell2002-11-20 05:12:10 +0000
commit47c4b25bfda86ac868c5acf08ceb2e49d05fa5c5 (patch)
tree86575270a94578f19a4261e795d2a754b8955911
parentcaa5159a52c52cd22fa49dddf9c5714ed2025b45 (diff)
downloadscummvm-rg350-47c4b25bfda86ac868c5acf08ceb2e49d05fa5c5.tar.gz
scummvm-rg350-47c4b25bfda86ac868c5acf08ceb2e49d05fa5c5.tar.bz2
scummvm-rg350-47c4b25bfda86ac868c5acf08ceb2e49d05fa5c5.zip
Auto enable text when no voice file is available.
Allow 't' to toggle speech on and off in simon1talkie/win svn-id: r5629
-rw-r--r--simon/items.cpp77
-rw-r--r--simon/simon.cpp26
-rw-r--r--simon/simon.h1
3 files changed, 74 insertions, 30 deletions
diff --git a/simon/items.cpp b/simon/items.cpp
index 36c064aec4..29371f31e5 100644
--- a/simon/items.cpp
+++ b/simon/items.cpp
@@ -1010,11 +1010,34 @@ int SimonState::runScript()
case 179:{
if (_game == GAME_SIMON1TALKIE || _game == GAME_SIMON1WIN) {
uint b = getVarOrByte();
- /*uint c = */ getVarOrByte();
+ uint c = getVarOrByte();
uint a = getVarOrByte();
uint d = _array_4[a];
- if (d != 0)
- talk_with_speech(d, b);
+ const char *s = (const char *)getStringPtrByID(_stringid_array_3[a]);
+ ThreeValues *tv;
+
+ switch (b) {
+ case 1:
+ tv = &_threevalues_1;
+ break;
+ case 2:
+ tv = &_threevalues_2;
+ break;
+ case 101:
+ tv = &_threevalues_3;
+ break;
+ case 102:
+ tv = &_threevalues_4;
+ break;
+ default:
+ error("setup text, invalid value %d", b);
+ }
+
+ if (_vk_t_toggle) {
+ talk_with_text(b, c, s, tv->a, tv->b, tv->c);
+ } else if (d != 0) {
+ talk_with_speech(d, b);
+ }
} else if (_game == GAME_SIMON1DEMO || _game == GAME_SIMON1DOS) {
uint b = getVarOrByte();
uint c = getVarOrByte();
@@ -1305,15 +1328,49 @@ void SimonState::o_177()
{
if (_game == GAME_SIMON1TALKIE || _game == GAME_SIMON1WIN) {
uint a = getVarOrByte();
- /*uint b = */ getVarOrByte();
+ uint b = getVarOrByte();
uint offs;
Child2 *child = (Child2 *)findChildOfType(getNextItemPtr(), 2);
- if (child != NULL && child->avail_props & 0x200) {
- offs = getOffsetOfChild2Param(child, 0x200);
- talk_with_speech(child->array[offs], a);
- } else if (child != NULL && child->avail_props & 0x100) {
- offs = getOffsetOfChild2Param(child, 0x100);
- talk_with_speech(child->array[offs] + 3550, a);
+ const char *s = NULL;
+ ThreeValues *tv = NULL;
+ char buf[256];
+
+ if (child != NULL && child->avail_props & 1) {
+ s = (const char *)getStringPtrByID(child->array[0]);
+ switch (a) {
+ case 1:
+ tv = &_threevalues_1;
+ break;
+ case 2:
+ tv = &_threevalues_2;
+ break;
+ case 101:
+ tv = &_threevalues_3;
+ break;
+ case 102:
+ tv = &_threevalues_4;
+ break;
+ default:
+ error("setup text, invalid value %d", a);
+ }
+ }
+
+ if (_vk_t_toggle) {
+ if (child->avail_props & 0x100) {
+ uint x = getOffsetOfChild2Param(child, 0x100);
+ sprintf(buf, "%d%s", child->array[x], s);
+ s = buf;
+ }
+
+ talk_with_text(a, b, s, tv->a, tv->b, tv->c);
+ } else {
+ if (child != NULL && child->avail_props & 0x200) {
+ offs = getOffsetOfChild2Param(child, 0x200);
+ talk_with_speech(child->array[offs], a);
+ } else if (child != NULL && child->avail_props & 0x100) {
+ offs = getOffsetOfChild2Param(child, 0x100);
+ talk_with_speech(child->array[offs] + 3550, a);
+ }
}
} else if ((_game == GAME_SIMON1DEMO) || (_game == GAME_SIMON1DOS)) {
uint a = getVarOrByte();
diff --git a/simon/simon.cpp b/simon/simon.cpp
index 5fe3a375e5..f2be434997 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -1772,24 +1772,11 @@ void SimonState::o_print_str()
switch (_game) {
case GAME_SIMON1TALKIE:
case GAME_SIMON1WIN:
-#ifdef USE_TEXT_HACK
- if (speech_id != 0) {
- if (string_ptr == NULL)
- talk_with_speech(speech_id, num_1);
- else if (speech_id != 9999)
- playVoice(speech_id);
- }
-
- if (string_ptr != NULL) {
- talk_with_text(num_1, num_2, (char *)string_ptr, tv->a, tv->b, tv->c);
- }
-#else
- if (speech_id != 0) {
+ if (speech_id != 0 && !_vk_t_toggle) {
talk_with_speech(speech_id, num_1);
} else if (string_ptr != NULL) {
talk_with_text(num_1, num_2, (char *)string_ptr, tv->a, tv->b, tv->c);
}
-#endif
break;
case GAME_SIMON1DEMO:
@@ -3435,13 +3422,9 @@ void SimonState::video_toggle_colors(HitArea * ha, byte a, byte b, byte c, byte
bool SimonState::vc_59_helper()
{
-#ifdef USE_TEXT_HACK
- return true;
-#else
- if (_voice_file == NULL)
+ if (_vk_t_toggle)
return true;
return _voice_sound == 0;
-#endif
}
void SimonState::video_copy_if_flag_0x8_c(FillOrCopyStruct *fcs)
@@ -4569,7 +4552,12 @@ void SimonState::go()
_last_music_played = (uint) - 1;
_vga_base_delay = 1;
+
+ if (_voice_type != FORMAT_NONE) {
_vk_t_toggle = false;
+ } else {
+ _vk_t_toggle = true;
+ }
while (1) {
hitarea_stuff();
diff --git a/simon/simon.h b/simon/simon.h
index 30c8cc9337..01592094f3 100644
--- a/simon/simon.h
+++ b/simon/simon.h
@@ -31,7 +31,6 @@
//#define DUMP_CONTINOUS_MAINSCRIPT
//#define DUMP_START_MAINSCRIPT
//#define DUMP_CONTINOUS_VGASCRIPT
-//#define USE_TEXT_HACK
//#define DRAW_IMAGES_DEBUG
//#define DRAW_THREE_STARS
//#define DUMP_START_VGASCRIPT