[Scummvm-cvs-logs] CVS: scummvm/simon items.cpp,1.18,1.19 simon.cpp,1.85,1.86 simon.h,1.17,1.18
Travis Howell
kirben at users.sourceforge.net
Tue Nov 19 21:13:01 CET 2002
Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1:/tmp/cvs-serv9010/simon
Modified Files:
items.cpp simon.cpp simon.h
Log Message:
Auto enable text when no voice file is available.
Allow 't' to toggle speech on and off in simon1talkie/win
Index: items.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/items.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- items.cpp 17 Nov 2002 15:15:26 -0000 1.18
+++ items.cpp 20 Nov 2002 05:12:09 -0000 1.19
@@ -1010,11 +1010,34 @@
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 @@
{
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();
Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- simon.cpp 18 Nov 2002 10:20:56 -0000 1.85
+++ simon.cpp 20 Nov 2002 05:12:10 -0000 1.86
@@ -1772,24 +1772,11 @@
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 @@
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 @@
_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();
Index: simon.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- simon.h 17 Nov 2002 18:44:33 -0000 1.17
+++ simon.h 20 Nov 2002 05:12:10 -0000 1.18
@@ -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
More information about the Scummvm-git-logs
mailing list