aboutsummaryrefslogtreecommitdiff
path: root/engines/cge/sound.cpp
diff options
context:
space:
mode:
authorStrangerke2011-09-07 01:02:05 +0200
committerStrangerke2011-09-07 01:02:05 +0200
commit3e574cfbf89ef7dc6126e64a1776595fea9fac7b (patch)
tree33b22561ee1d2e612b770da9ba24708b47fc8ecb /engines/cge/sound.cpp
parent52f669c93c9497a03e3e32467a4614263e1c6382 (diff)
downloadscummvm-rg350-3e574cfbf89ef7dc6126e64a1776595fea9fac7b.tar.gz
scummvm-rg350-3e574cfbf89ef7dc6126e64a1776595fea9fac7b.tar.bz2
scummvm-rg350-3e574cfbf89ef7dc6126e64a1776595fea9fac7b.zip
CGE: Remove wtom()
Diffstat (limited to 'engines/cge/sound.cpp')
-rw-r--r--engines/cge/sound.cpp16
1 files changed, 10 insertions, 6 deletions
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;
}