diff --git a/sc2/ChangeLog b/sc2/ChangeLog index df7a3c461..ba616d669 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,6 @@ Changes towards version 0.7: +- Voiceovers controlled by a synthetic '3dovoice' addon - Michael +- CONVERSATION explicitly names text/voice/timestamps - Michael - Replaced stricmp() by the POSIX compatible strcasecmp() - SvdB - Split STRTAB further into STRTAB and CONVERSATION - Michael - INT32, BOOLEAN, and STRING resource types - Michael diff --git a/sc2/content/addons/3dovoice/3dovoice.rmp b/sc2/content/addons/3dovoice/3dovoice.rmp new file mode 100644 index 000000000..408efb28f --- /dev/null +++ b/sc2/content/addons/3dovoice/3dovoice.rmp @@ -0,0 +1,27 @@ +comm.arilou.dialogue = CONVERSATION:comm/arilou/arilou.txt:comm/arilou/:comm/arilou/arilou.ts +comm.chmmr.dialogue = CONVERSATION:comm/chmmr/chmmr.txt:comm/chmmr/:comm/chmmr/chmmr.ts +comm.commander.dialogue = CONVERSATION:comm/comandr/comandr.txt:comm/comandr/:comm/comandr/comandr.ts +comm.druuge.dialogue = CONVERSATION:comm/druuge/druuge.txt:comm/druuge/:comm/druuge/druuge.ts +comm.ilwrath.dialogue = CONVERSATION:comm/ilwrath/ilwrath.txt:comm/ilwrath/:comm/ilwrath/ilwrath.ts +comm.kohrah.dialogue = CONVERSATION:comm/blackur/blackur.txt:comm/blackur/:comm/blackur/blackur.ts +comm.melnorme.dialogue = CONVERSATION:comm/melnorm/melnorm.txt:comm/melnorm/:comm/melnorm/melnorm.ts +comm.mycon.dialogue = CONVERSATION:comm/mycon/mycon.txt:comm/mycon/:comm/mycon/mycon.ts +comm.orz.dialogue = CONVERSATION:comm/orz/orz.txt:comm/orz/:comm/orz/orz.ts +comm.pkunk.dialogue = CONVERSATION:comm/pkunk/pkunk.txt:comm/pkunk/:comm/pkunk/pkunk.ts +comm.shofixti.dialogue = CONVERSATION:comm/shofixt/shofixt.txt:comm/shofixt/:comm/shofixt/shofixt.ts +comm.slyhome.dialogue = CONVERSATION:comm/slyhome/slyhome.txt:comm/slyhome/:comm/slyhome/slyhome.ts +comm.slylandro.dialogue = CONVERSATION:comm/slyland/slyland.txt:comm/slyland/:comm/slyland/slyland.ts +comm.spahome.dialogue = CONVERSATION:comm/spahome/spahome.txt:comm/spahome/:comm/spahome/spahome.ts +comm.spathi.dialogue = CONVERSATION:comm/spathi/spathi.txt:comm/spathi/:comm/spathi/spathi.ts +comm.starbase.dialogue = CONVERSATION:comm/starbas/starbas.txt:comm/starbas/:comm/starbas/starbas.ts +comm.supox.dialogue = CONVERSATION:comm/supox/supox.txt:comm/supox/:comm/supox/supox.ts +comm.syreen.dialogue = CONVERSATION:comm/syreen/syreen.txt:comm/syreen/:comm/syreen/syreen.ts +comm.talkingpet.dialogue = CONVERSATION:comm/talkpet/talkpet.txt:comm/talkpet/:comm/talkpet/talkpet.ts +comm.thraddash.dialogue = CONVERSATION:comm/thradd/thradd.txt:comm/thradd/:comm/thradd/thradd.ts +comm.umgah.dialogue = CONVERSATION:comm/umgah/umgah.txt:comm/umgah/:comm/umgah/umgah.ts +comm.urquan.dialogue = CONVERSATION:comm/urquan/urquan.txt:comm/urquan/:comm/urquan/urquan.ts +comm.utwig.dialogue = CONVERSATION:comm/utwig/utwig.txt:comm/utwig/:comm/utwig/utwig.ts +comm.vux.dialogue = CONVERSATION:comm/vux/vux.txt:comm/vux/:comm/vux/vux.ts +comm.yehat.dialogue = CONVERSATION:comm/yehat/yehat.txt:comm/yehat/:comm/yehat/yehat.ts +comm.yehat.rebel.dialogue = CONVERSATION:comm/rebel/rebel.txt:comm/rebel/:comm/rebel/rebel.ts +comm.zoqfotpik.dialogue = CONVERSATION:comm/zoqfot/zoqfot.txt:comm/zoqfot/:comm/zoqfot/zoqfot.ts diff --git a/sc2/src/sc2code/libs/strings/getstr.c b/sc2/src/sc2code/libs/strings/getstr.c index 59d1602ec..a96f956d4 100644 --- a/sc2/src/sc2code/libs/strings/getstr.c +++ b/sc2/src/sc2code/libs/strings/getstr.c @@ -70,20 +70,50 @@ _GetConversationData (const char *path, RESOURCE_DATA *resdata) slen[MAX_STRINGS], StringOffs, tot_string_size, clen[MAX_STRINGS], ClipOffs, tot_clip_size, tslen[MAX_STRINGS], TSOffs, tot_ts_size; - char CurrentLine[1024], clip_path[1024], *strdata, *clipdata, - *ts_data; + char CurrentLine[1024], paths[1024], *clip_path, *ts_path, + *strdata, *clipdata, *ts_data; uio_Stream *timestamp_fp = NULL; - fp = res_OpenResFile (contentDir, path, "rb"); + /* Parse out the conversation components. */ + strncpy (paths, path, 1023); + paths[1023] = '\0'; + clip_path = strchr (paths, ':'); + if (clip_path == NULL) + { + ts_path = NULL; + } + else + { + *clip_path = '\0'; + clip_path++; + + ts_path = strchr (clip_path, ':'); + if (ts_path != NULL) + { + *ts_path = '\0'; + ts_path++; + } + } + + fp = res_OpenResFile (contentDir, paths, "rb"); if (fp == NULL) { - log_add (log_Warning, "Warning: Can't open '%s'", path); + log_add (log_Warning, "Warning: Can't open '%s'", paths); resdata->ptr = NULL; return; } dataLen = LengthResFile (fp); - log_add (log_Info, "\t'%s' -- %lu bytes in Conversation", path, dataLen); + log_add (log_Info, "\t'%s' -- conversation phrases -- %lu bytes", paths, dataLen); + if (clip_path) + log_add (log_Info, "\t'%s' -- voice clip directory", clip_path); + else + log_add (log_Info, "\tNo associated voice clips"); + if (ts_path) + log_add (log_Info, "\t'%s' -- timestamps", ts_path); + else + log_add (log_Info, "\tNo associated timestamp file"); + if (dataLen == 0) { @@ -101,39 +131,13 @@ _GetConversationData (const char *path, RESOURCE_DATA *resdata) } ts_data = NULL; - { - char *s1, *s2; - - if (((s2 = 0), (s1 = strrchr (path, '/')) == 0) - && (s2 = strrchr (path, '\\')) == 0) - n = 0; - else - { - if (s2 > s1) - s1 = s2; - n = s1 - path + 1; - strncpy (clip_path, path, n); - } - clip_path[n] = '\0'; - path_len = strlen (clip_path); - } + path_len = clip_path ? strlen (clip_path) : 0; + if (ts_path && (timestamp_fp = uio_fopen (contentDir, ts_path, + "rb"))) { - // try to open the timestamp file - char ts_file_name[1024]; - char *s; - strcpy (ts_file_name, path); - s = strrchr (ts_file_name, '.'); - s += 2; - *s++ = 's'; - *s = '\0'; - if ((timestamp_fp = uio_fopen (contentDir, ts_file_name, - "rb"))) - { - log_add (log_Info, "Found timestamp file: %s", ts_file_name); - if ((ts_data = HMalloc (tot_ts_size = POOL_SIZE)) == 0) - goto err; - } + if ((ts_data = HMalloc (tot_ts_size = POOL_SIZE)) == 0) + goto err; } opos = uio_ftell (fp); @@ -222,7 +226,8 @@ _GetConversationData (const char *path, RESOURCE_DATA *resdata) goto err; } - strcpy (&clipdata[ClipOffs], clip_path); + if (clip_path) + strcpy (&clipdata[ClipOffs], clip_path); strcpy (&clipdata[ClipOffs + path_len], s); ClipOffs += l; clen[n] = l; diff --git a/sc2/src/sc2code/setup.c b/sc2/src/sc2code/setup.c index a6c125947..70a9fa954 100644 --- a/sc2/src/sc2code/setup.c +++ b/sc2/src/sc2code/setup.c @@ -118,6 +118,8 @@ LoadKernel (int argc, char *argv[]) loadAddon ("3domusic"); } + loadAddon ("3dovoice"); /* Always try to use voice data */ + if (optPrecursorsMusic) { loadAddon ("remix");