From 3e574cfbf89ef7dc6126e64a1776595fea9fac7b Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 7 Sep 2011 01:02:05 +0200 Subject: CGE: Remove wtom() --- engines/cge/sound.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'engines/cge/sound.cpp') diff --git a/engines/cge/sound.cpp b/engines/cge/sound.cpp index fb0549ac22..547469aef8 100644 --- a/engines/cge/sound.cpp +++ b/engines/cge/sound.cpp @@ -132,11 +132,11 @@ int Fx::find(int ref) { void Fx::preload(int ref0) { Han *cacheLim = _cache + _size; + char filename[12]; for (int ref = ref0; ref < ref0 + 10; ref++) { - static char fname[] = "FX00000.WAV"; - wtom(ref, fname + 2, 10, 5); - VFile file = VFile(fname); + sprintf(filename, "FX%05d.WAV", ref); + VFile file = VFile(filename); DataCk *wav = loadWave(&file); if (wav) { Han *p = &_cache[find(0)]; @@ -144,20 +144,24 @@ void Fx::preload(int ref0) { break; p->_wav = wav; p->_ref = ref; + } else { + warning("Unable to load %s", filename); } } } DataCk *Fx::load(int idx, int ref) { - static char fname[] = "FX00000.WAV"; - wtom(ref, fname + 2, 10, 5); + char filename[12]; + sprintf(filename, "FX%05d.WAV", ref); - VFile file = VFile(fname); + VFile file = VFile(filename); DataCk *wav = loadWave(&file); if (wav) { Han *p = &_cache[idx]; p->_wav = wav; p->_ref = ref; + } else { + warning("Unable to load %s", filename); } return wav; } -- cgit v1.2.3