| 117 | } |
| 118 | |
| 119 | void 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 | |
| 138 | void sound_load_volume(char *value_name, int *value) |
| 139 | { |
no test coverage detected