mirror of
https://github.com/ondra-novak/gates_of_skeldal.git
synced 2025-07-06 06:30:33 -04:00
add some cheks and error reporting, enable catch SEH in windows
This commit is contained in:
parent
8faba63219
commit
c9d0e86344
8 changed files with 88 additions and 34 deletions
|
@ -50,10 +50,20 @@ void game_sound_init_device(const INI_CONFIG_SECTION *audio_section) {
|
|||
}
|
||||
|
||||
static void SDLCALL mixing_callback(void *userdata, Uint8 * stream, int len) {
|
||||
float *s = reinterpret_cast<float *>(stream);
|
||||
int samples = len/8;
|
||||
std::fill(s, s+2*samples, 0.0f);
|
||||
sound_mixer.mix_to_buffer(s, samples);
|
||||
static char crashed = 0;
|
||||
float *s = reinterpret_cast<float *>(stream);
|
||||
int samples = len/8;
|
||||
std::fill(s, s+2*samples, 0.0f);
|
||||
if (crashed) return;
|
||||
try {
|
||||
sound_mixer.mix_to_buffer(s, samples);
|
||||
} catch (std::exception &e) {
|
||||
crashed = 1;
|
||||
display_error("Unhandled exception in sound mixer: %s", e.what());
|
||||
} catch (...) {
|
||||
crashed = 1;
|
||||
display_error("Crash in sound mixer: %s");
|
||||
}
|
||||
}
|
||||
|
||||
char start_mixing() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue