Oolite 1.91.0.7645-241119-222d325
Loading...
Searching...
No Matches
OOTrumble.m File Reference
import "OOTrumble.h"
import "Universe.h"
import "PlayerEntity.h"
import "OOTexture.h"
import "ResourceManager.h"
import "OOSound.h"
import "OOStringParsing.h"
import "OOMaths.h"
import "MyOpenGLView.h"
+ Include dependency graph for OOTrumble.m:

Go to the source code of this file.

Functions

static void InitTrumbleSounds (void)
 
static void PlayTrumbleIdle (void)
 
static void PlayTrumbleSqueal (void)
 

Variables

static OOSoundSourcesTrumbleSoundSource
 
static OOSoundsTrumbleIdleSound
 
static OOSoundsTrumbleSqealSound
 

Function Documentation

◆ InitTrumbleSounds()

static void InitTrumbleSounds ( void )
static

Definition at line 978 of file OOTrumble.m.

979{
981 {
982 sTrumbleSoundSource = [[OOSoundSource alloc] init];
983 sTrumbleIdleSound = [[OOSound alloc] initWithCustomSoundKey:@"[trumble-idle]"];
984 sTrumbleSqealSound = [[OOSound alloc] initWithCustomSoundKey:@"[trumble-squeal]"];
985 }
986}
return nil
static OOSound * sTrumbleIdleSound
Definition OOTrumble.m:975
static OOSoundSource * sTrumbleSoundSource
Definition OOTrumble.m:974
static OOSound * sTrumbleSqealSound
Definition OOTrumble.m:976

References nil, sTrumbleIdleSound, sTrumbleSoundSource, and sTrumbleSqealSound.

◆ PlayTrumbleIdle()

static void PlayTrumbleIdle ( void )
static

Definition at line 989 of file OOTrumble.m.

990{
991 // Only play idle sound if no trumble is making noise.
992 if (![sTrumbleSoundSource isPlaying])
993 {
994 // trumble sound from random direction - where's it gone now?
995 [sTrumbleSoundSource setPosition:OORandomUnitVector()];
996 [sTrumbleSoundSource playSound:sTrumbleIdleSound];
997 }
998}

References OOSoundSource::playSound:, OOSoundSource::setPosition:, and sTrumbleSoundSource.

+ Here is the call graph for this function:

◆ PlayTrumbleSqueal()

static void PlayTrumbleSqueal ( void )
static

Definition at line 1001 of file OOTrumble.m.

1002{
1003 // Play squeal sound if no trumble is currently squealing, but trumping idle sound.
1004 if (![sTrumbleSoundSource isPlaying] || [sTrumbleSoundSource sound] == sTrumbleIdleSound)
1005 {
1006 // trumble sound from random direction - where's it gone now?
1007 [sTrumbleSoundSource setPosition:OORandomUnitVector()];
1008 [sTrumbleSoundSource playSound:sTrumbleSqealSound];
1009 }
1010}

Variable Documentation

◆ sTrumbleIdleSound

OOSound* sTrumbleIdleSound
static

Definition at line 975 of file OOTrumble.m.

Referenced by OOTrumble::actionBlink, and InitTrumbleSounds().

◆ sTrumbleSoundSource

OOSoundSource* sTrumbleSoundSource
static

Definition at line 974 of file OOTrumble.m.

Referenced by OOTrumble::actionBlink, InitTrumbleSounds(), and PlayTrumbleIdle().

◆ sTrumbleSqealSound

OOSound* sTrumbleSqealSound
static

Definition at line 976 of file OOTrumble.m.

Referenced by InitTrumbleSounds().