MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / SetBankSource

Function SetBankSource

src/sound.cpp:69–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69static bool SetBankSource(MixerChannel *mc, SoundEntry *sound, SoundID sound_id)
70{
71 assert(sound != nullptr);
72
73 if (sound->file != nullptr) {
74 if (!LoadSound(*sound, sound_id)) {
75 /* Mark as invalid. */
76 sound->file = nullptr;
77 return false;
78 }
79 sound->file = nullptr;
80 }
81
82 /* Check for valid sound. */
83 if (sound->data->empty()) return false;
84
85 MxSetChannelRawSrc(mc, sound->data, sound->rate, sound->bits_per_sample == 16);
86
87 return true;
88}
89
90void InitializeSound()
91{

Callers 1

StartSoundFunction · 0.85

Calls 3

LoadSoundFunction · 0.85
MxSetChannelRawSrcFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected