From cf7fb490029c18252a2afc0c743f5988e9ee7dd3 Mon Sep 17 00:00:00 2001 From: meep-eep Date: Sun, 15 May 2005 15:33:58 +0000 Subject: [PATCH] Some speech dependant on whether sound is on or not. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1768 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/comm/starbas/starbas.c | 39 +++++++++++++++++++++----- sc2/src/sc2code/comm/starbas/strings.h | 5 ++++ sc2/src/sc2code/comm/syreen/syreenc.c | 12 +++++--- sc2/src/starcon2.c | 7 +++-- 4 files changed, 50 insertions(+), 13 deletions(-) diff --git a/sc2/src/sc2code/comm/starbas/starbas.c b/sc2/src/sc2code/comm/starbas/starbas.c index 88778d762..296a84c3e 100644 --- a/sc2/src/sc2code/comm/starbas/starbas.c +++ b/sc2/src/sc2code/comm/starbas/starbas.c @@ -26,6 +26,7 @@ #include "libs/inplib.h" #include "libs/mathlib.h" #include "libs/inplib.h" +#include "libs/sound/sound.h" //Added by Chris @@ -226,7 +227,11 @@ ByeBye (RESPONSE_REF R) } NPCPhrase (pStr0); - NPCPhrase (GLOBAL_PLAYER_NAME); + if (speechVolumeScale == 0.0f) + { + NPCPhrase (SPACE); + NPCPhrase (GLOBAL_PLAYER_NAME); + } NPCPhrase (pStr1); } } @@ -900,7 +905,12 @@ TellStarBase (RESPONSE_REF R) else if (PLAYER_SAID (R, tell_me_about_crew)) { NPCPhrase (ABOUT_CREW0); - NPCPhrase (GLOBAL_SHIP_NAME); + if (speechVolumeScale > 0.0f) + NPCPhrase (YOUR_FLAGSHIP_3DO2); + else { + NPCPhrase (YOUR_FLAGSHIP_PC); + NPCPhrase (GLOBAL_SHIP_NAME); + } NPCPhrase (ABOUT_CREW1); stack2 = 2; @@ -1660,11 +1670,18 @@ NormalStarbase (RESPONSE_REF R) if (GET_GAME_STATE (MOONBASE_ON_SHIP)) { NPCPhrase (STARBASE_IS_READY_A); - NPCPhrase (GLOBAL_SHIP_NAME); + if (speechVolumeScale > 0.0f) + NPCPhrase (YOUR_FLAGSHIP_3DO1); + else { + NPCPhrase (YOUR_FLAGSHIP_PC); + NPCPhrase (GLOBAL_SHIP_NAME); + } NPCPhrase (STARBASE_IS_READY_B); - NPCPhrase (GLOBAL_SHIP_NAME); + if (speechVolumeScale > 0.0f) + NPCPhrase (YOUR_FLAGSHIP_3DO0); + else + NPCPhrase (GLOBAL_SHIP_NAME); NPCPhrase (STARBASE_IS_READY_C); - LockMutex (GraphicsLock); DeltaSISGauges (0, 0, 2500); UnlockMutex (GraphicsLock); @@ -1717,7 +1734,11 @@ NormalStarbase (RESPONSE_REF R) break; } NPCPhrase (pStr0); - NPCPhrase (GLOBAL_PLAYER_NAME); + if (speechVolumeScale == 0.0f) + { + NPCPhrase (SPACE); + NPCPhrase (GLOBAL_PLAYER_NAME); + } NPCPhrase (pStr1); CheckBulletins (FALSE); } @@ -1914,7 +1935,11 @@ SellMinerals (RESPONSE_REF R) } NPCPhrase (pStr1); - NPCPhrase (GLOBAL_PLAYER_NAME); + if (speechVolumeScale == 0.0f) + { + NPCPhrase (SPACE); + NPCPhrase (GLOBAL_PLAYER_NAME); + } NPCPhrase (pStr2); NormalStarbase (R); diff --git a/sc2/src/sc2code/comm/starbas/strings.h b/sc2/src/sc2code/comm/starbas/strings.h index 0e0f67102..5de7d9758 100644 --- a/sc2/src/sc2code/comm/starbas/strings.h +++ b/sc2/src/sc2code/comm/starbas/strings.h @@ -317,6 +317,11 @@ enum new_devices, how_get_strong, what_do_now, + YOUR_FLAGSHIP_PC, + YOUR_FLAGSHIP_3DO0, + YOUR_FLAGSHIP_3DO1, + YOUR_FLAGSHIP_3DO2, + SPACE, }; #endif /* _STRINGS_H */ diff --git a/sc2/src/sc2code/comm/syreen/syreenc.c b/sc2/src/sc2code/comm/syreen/syreenc.c index f7965ae05..45ce89fd1 100644 --- a/sc2/src/sc2code/comm/syreen/syreenc.c +++ b/sc2/src/sc2code/comm/syreen/syreenc.c @@ -19,6 +19,7 @@ #include "comm/commall.h" #include "comm/syreen/resinst.h" #include "comm/syreen/strings.h" +#include "libs/sound/sound.h" #include "build.h" @@ -648,10 +649,13 @@ InitialSyreen (RESPONSE_REF R) else if (PLAYER_SAID (R, we_are_vindicator0)) { NPCPhrase (WELCOME_VINDICATOR0); - NPCPhrase (GLOBAL_PLAYER_NAME); - NPCPhrase (WELCOME_VINDICATOR1); - NPCPhrase (GLOBAL_SHIP_NAME); - NPCPhrase (WELCOME_VINDICATOR2); + if (speechVolumeScale == 0.0f) + { + NPCPhrase (GLOBAL_PLAYER_NAME); + NPCPhrase (WELCOME_VINDICATOR1); + NPCPhrase (GLOBAL_SHIP_NAME); + NPCPhrase (WELCOME_VINDICATOR2); + } NPCPhrase (HOW_CAN_YOU_BE_HERE); } else if (PLAYER_SAID (R, we_are_impressed)) diff --git a/sc2/src/starcon2.c b/sc2/src/starcon2.c index 2155a723b..b90f80ab4 100644 --- a/sc2/src/starcon2.c +++ b/sc2/src/starcon2.c @@ -537,10 +537,13 @@ parseOptions(int argc, char *argv[], struct options_struct *options) case SOUND_OPT: if (!strcmp (optarg, "openal")) options->soundDriver = audio_DRIVER_OPENAL; - else if (!strcmp (optarg, "none")) - options->soundDriver = audio_DRIVER_NOSOUND; else if (!strcmp (optarg, "mixsdl")) options->soundDriver = audio_DRIVER_MIXSDL; + else if (!strcmp (optarg, "none")) + { + options->soundDriver = audio_DRIVER_NOSOUND; + options->speechVolumeScale = 0.0f; + } else { fprintf (stderr, "Error: Invalid sound driver "