Oolite
Loading...
Searching...
No Matches
OOTrumble.m File Reference
import "OOTrumble.h"
import "MyOpenGLView.h"
import "OOMaths.h"
import "OOSound.h"
import "OOStringParsing.h"
import "OOTexture.h"
import "PlayerEntity.h"
import "ResourceManager.h"
import "Universe.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 OOSoundSource * sTrumbleSoundSource
static OOSound * sTrumbleIdleSound
static OOSound * sTrumbleSqealSound

Function Documentation

◆ InitTrumbleSounds()

void InitTrumbleSounds ( void )
static

Definition at line 943 of file OOTrumble.m.

944{
945 if (sTrumbleSoundSource == nil) {
946 sTrumbleSoundSource = [[OOSoundSource alloc] init];
947 sTrumbleIdleSound = [[OOSound alloc] initWithCustomSoundKey:@"[trumble-idle]"];
948 sTrumbleSqealSound = [[OOSound alloc] initWithCustomSoundKey:@"[trumble-squeal]"];
949 }
950}
return nil
static OOSound * sTrumbleIdleSound
Definition OOTrumble.m:940
static OOSoundSource * sTrumbleSoundSource
Definition OOTrumble.m:939
static OOSound * sTrumbleSqealSound
Definition OOTrumble.m:941

References nil, sTrumbleIdleSound, sTrumbleSoundSource, and sTrumbleSqealSound.

Referenced by OOTrumble::setupForPlayer:digram:.

Here is the caller graph for this function:

◆ PlayTrumbleIdle()

void PlayTrumbleIdle ( void )
static

Definition at line 952 of file OOTrumble.m.

953{
954 // Only play idle sound if no trumble is making noise.
955 if (![sTrumbleSoundSource isPlaying]) {
956 // trumble sound from random direction - where's it gone now?
957 [sTrumbleSoundSource setPosition:OORandomUnitVector()];
958 [sTrumbleSoundSource playSound:sTrumbleIdleSound];
959 }
960}
void playSound:(OOSound *inSound)
void setPosition:(Vector inPosition)

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

Referenced by OOTrumble::updateProot:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PlayTrumbleSqueal()

void PlayTrumbleSqueal ( void )
static

Definition at line 962 of file OOTrumble.m.

963{
964 // Play squeal sound if no trumble is currently squealing, but trumping idle sound.
965 if (![sTrumbleSoundSource isPlaying] || [sTrumbleSoundSource sound] == sTrumbleIdleSound) {
966 // trumble sound from random direction - where's it gone now?
967 [sTrumbleSoundSource setPosition:OORandomUnitVector()];
968 [sTrumbleSoundSource playSound:sTrumbleSqealSound];
969 }
970}

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

Referenced by OOTrumble::updatePop:, and OOTrumble::updateShudder:.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ sTrumbleIdleSound

OOSound* sTrumbleIdleSound
static

Definition at line 940 of file OOTrumble.m.

Referenced by InitTrumbleSounds(), and PlayTrumbleSqueal().

◆ sTrumbleSoundSource

OOSoundSource* sTrumbleSoundSource
static

Definition at line 939 of file OOTrumble.m.

Referenced by InitTrumbleSounds(), PlayTrumbleIdle(), and PlayTrumbleSqueal().

◆ sTrumbleSqealSound

OOSound* sTrumbleSqealSound
static

Definition at line 941 of file OOTrumble.m.

Referenced by InitTrumbleSounds().