Implemented -nosound command line option.
This commit is contained in:
parent
6ed3ceac6c
commit
11c639a866
@ -8494,7 +8494,7 @@ static NSString *SliderString(NSInteger amountIn20ths)
|
||||
[gui setKey:GUI_KEY_OK forRow:GUI_ROW(GAME,AUTOSAVE)];
|
||||
|
||||
// volume control
|
||||
if ([OOSound respondsToSelector:@selector(masterVolume)])
|
||||
if ([OOSound respondsToSelector:@selector(masterVolume)] && [OOSound isSoundOK])
|
||||
{
|
||||
double volume = 100.0 * [OOSound masterVolume];
|
||||
int vol = (volume / 5.0 + 0.5); // avoid rounding errors
|
||||
|
@ -96,6 +96,8 @@ static BOOL sIsSoundOK = NO;
|
||||
|
||||
- (id) initWithContentsOfFile:(NSString *)path
|
||||
{
|
||||
if (!sIsSoundOK) return nil;
|
||||
|
||||
[self release];
|
||||
if (!sIsSetUp && ![OOSound setUp]) return nil;
|
||||
|
||||
|
@ -47,6 +47,16 @@ static id sSingleton = nil;
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
NSArray *arguments = nil;
|
||||
NSEnumerator *argEnum = nil;
|
||||
NSString *arg = nil;
|
||||
|
||||
arguments = [[NSProcessInfo processInfo] arguments];
|
||||
for (argEnum = [arguments objectEnumerator]; (arg = [argEnum nextObject]); )
|
||||
{
|
||||
if ([arg isEqual:@"-nosound"] || [arg isEqual:@"--nosound"]) return nil;
|
||||
}
|
||||
|
||||
ALuint error;
|
||||
device = alcOpenDevice(NULL); // default device
|
||||
if (!device)
|
||||
|
@ -195,6 +195,7 @@ MA 02110-1301, USA.
|
||||
// end TODO
|
||||
|
||||
[OOSound setUp];
|
||||
if (![OOSound isSoundOK]) OOLog(@"sound.init", @"Sound system disabled.");
|
||||
|
||||
// Generate the window caption, containing the version number and the date the executable was compiled.
|
||||
static char windowCaption[128];
|
||||
|
Loading…
x
Reference in New Issue
Block a user