Added --nosubtitles commandline option

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@231 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
gewlitys
2002-11-22 03:26:27 +00:00
parent 6431b2e85b
commit f508649ed1
5 changed files with 18 additions and 2 deletions
+4
View File
@@ -86,6 +86,10 @@ Use the .MOD based PC soundtrack everywhere.
Can be "high", "medium", or "low". Specifies how nice the audio Can be "high", "medium", or "low". Specifies how nice the audio
sounds. Slower machines should lower the audio quality. sounds. Slower machines should lower the audio quality.
-u (or --nosubtitles)
Disables subtitles.
THE STORY SO FAR THE STORY SO FAR
For the past decade, Earth and the rest of the Alliance of Free Stars For the past decade, Earth and the rest of the Alliance of Free Stars
+1 -1
View File
@@ -25,7 +25,7 @@
#include "options.h" #include "options.h"
int optWhichMusic = MUSIC_3DO; int optWhichMusic = MUSIC_3DO;
BOOLEAN optSubtitles = TRUE;
BOOLEAN FileExists (char *filename) BOOLEAN FileExists (char *filename)
{ {
+2
View File
@@ -33,6 +33,8 @@ enum
}; };
extern int optWhichMusic; extern int optWhichMusic;
extern BOOLEAN optSubtitles;
BOOLEAN FileExists (char *filename); BOOLEAN FileExists (char *filename);
#endif #endif
+5
View File
@@ -21,6 +21,7 @@
#include "libs/sound/trackplayer.h" #include "libs/sound/trackplayer.h"
#include "starcon.h" #include "starcon.h"
#include "commglue.h" #include "commglue.h"
#include "options.h"
void InitOscilloscope (int x, int y, int width, int height, void InitOscilloscope (int x, int y, int width, int height,
void *f); void *f);
@@ -1854,6 +1855,10 @@ do_subtitles (UNICODE *pStr)
{ {
static DWORD TimeOut; static DWORD TimeOut;
// TODO: proper disabling of subtitles, this one prolly isn't 'safe'
if (optSubtitles == FALSE)
return 0;
if (pStr == 0) if (pStr == 0)
return (subtitle_state = NEXT_SUBTITLE); return (subtitle_state = NEXT_SUBTITLE);
else if (pStr == (void *)~0) else if (pStr == (void *)~0)
+6 -1
View File
@@ -77,6 +77,7 @@ main (int argc, char *argv[])
{"3domusic", 0, NULL, 'e'}, {"3domusic", 0, NULL, 'e'},
{"pcmusic", 0, NULL, 'm'}, {"pcmusic", 0, NULL, 'm'},
{"audioquality", 1, NULL, 'q'}, {"audioquality", 1, NULL, 'q'},
{"nosubtitles", 0, NULL, 'u'},
{0, 0, 0, 0} {0, 0, 0, 0}
}; };
@@ -90,7 +91,7 @@ main (int argc, char *argv[])
strcpy (contentdir, "content"); strcpy (contentdir, "content");
#endif #endif
while ((c = getopt_long(argc, argv, "r:d:foc:spn:?hM:S:T:emq:", long_options, &option_index)) != -1) while ((c = getopt_long(argc, argv, "r:d:foc:spn:?hM:S:T:emq:u", long_options, &option_index)) != -1)
{ {
switch (c) { switch (c) {
case 'r': case 'r':
@@ -177,6 +178,9 @@ main (int argc, char *argv[])
soundflags |= TFB_SOUNDFLAGS_LQAUDIO; soundflags |= TFB_SOUNDFLAGS_LQAUDIO;
} }
break; break;
case 'u':
optSubtitles = FALSE;
break;
default: default:
printf ("\nOption %s not found!\n", long_options[option_index].name); printf ("\nOption %s not found!\n", long_options[option_index].name);
case '?': case '?':
@@ -196,6 +200,7 @@ main (int argc, char *argv[])
printf(" -e, --3domusic (default)\n"); printf(" -e, --3domusic (default)\n");
printf(" -m, --pcmusic\n"); printf(" -m, --pcmusic\n");
printf(" -q, --audioquality=QUALITY (high, medium or low, default medium)\n"); printf(" -q, --audioquality=QUALITY (high, medium or low, default medium)\n");
printf(" -u, --nosubtitles\n");
return 0; return 0;
break; break;
} }