#include "math/pi.h"
#include "sound_samples.h"
-#include "system/error.h"
#include "system/log.h"
#include "system/lt.h"
#include "system/nth_alloc.h"
Sound_samples *sound_samples = PUSH_LT(lt, nth_alloc(sizeof(Sound_samples)), free);
if (sound_samples == NULL) {
- throw_error(ERROR_TYPE_LIBC);
RETURN_LT(lt, NULL);
}
nth_alloc(sizeof(Mix_Chunk*) * sample_files_count),
free);
if (sound_samples->samples == NULL) {
- throw_error(ERROR_TYPE_LIBC);
RETURN_LT(lt, NULL);
}
Mix_LoadWAV(sample_files[i]),
Mix_FreeChunk);
if (sound_samples->samples[i] == NULL) {
- throw_error(ERROR_TYPE_SDL2_MIXER);
+ log_fail("Could not load '%s': %s\n", sample_files[i], Mix_GetError());
RETURN_LT(lt, NULL);
}
}