MCPcopy Create free account
hub / github.com/diasurgical/devilution / snd_init

Function snd_init

SourceX/sound.cpp:119–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void snd_init(HWND hWnd)
120{
121 sound_load_volume("Sound Volume", &sglSoundVolume);
122 gbSoundOn = sglSoundVolume > VOLUME_MIN;
123 sgbSaveSoundOn = gbSoundOn;
124
125 sound_load_volume("Music Volume", &sglMusicVolume);
126 gbMusicOn = sglMusicVolume > VOLUME_MIN;
127
128 int result = Mix_OpenAudio(22050, AUDIO_S16LSB, 2, 1024);
129 if (result < 0) {
130 SDL_Log(Mix_GetError());
131 }
132 Mix_AllocateChannels(25);
133 Mix_ReserveChannels(1); // reserve one channel for naration (SFileDda*)
134
135 gbSndInited = true;
136}
137
138void sound_load_volume(char *value_name, int *value)
139{

Callers 1

diablo_initFunction · 0.85

Calls 2

sound_load_volumeFunction · 0.85
SDL_LogFunction · 0.85

Tested by

no test coverage detected