diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-10-21 18:16:56 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-10-21 18:16:56 +0000 |
| commit | 8d78151d0ad759294d211156fe70281aeb4109dd (patch) | |
| tree | 96642b2309f0850c916f22f849c365b931a05fa5 | |
| parent | 2d065c3fdf73c307989edd2512e921e1bcb177d5 (diff) | |
| download | zcatch-8d78151d0ad759294d211156fe70281aeb4109dd.tar.gz zcatch-8d78151d0ad759294d211156fe70281aeb4109dd.zip | |
fixed sound loading to use engine_openfile
| -rw-r--r-- | src/engine/client/ec_snd.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/engine/client/ec_snd.c b/src/engine/client/ec_snd.c index a08b2c09..11c19d2d 100644 --- a/src/engine/client/ec_snd.c +++ b/src/engine/client/ec_snd.c @@ -2,6 +2,7 @@ #include <base/system.h> #include <engine/e_client_interface.h> #include <engine/e_config.h> +#include <engine/e_engine.h> #ifdef CONFIG_NO_SDL #include <portaudio.h> @@ -426,11 +427,11 @@ static void rate_convert(int sid) } -static FILE *file = NULL; +static IOHANDLE file = NULL; static int read_data(void *buffer, int size) { - return fread(buffer, 1, size, file); + return io_read(file, buffer, size); } int snd_load_wv(const char *filename) @@ -448,7 +449,7 @@ int snd_load_wv(const char *filename) if(!sound_enabled) return 1; - file = fopen(filename, "rb"); /* TODO: use system.h stuff for this */ + file = engine_openfile(filename, IOFLAG_READ); /* TODO: use system.h stuff for this */ if(!file) { dbg_msg("sound/wv", "failed to open %s", filename); @@ -515,7 +516,7 @@ int snd_load_wv(const char *filename) dbg_msg("sound/wv", "failed to open %s: %s", filename, error); } - fclose(file); + io_close(file); file = NULL; if(config.debug) |