aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2011-09-07 01:02:05 +0200
committerStrangerke2011-09-07 01:02:05 +0200
commit3e574cfbf89ef7dc6126e64a1776595fea9fac7b (patch)
tree33b22561ee1d2e612b770da9ba24708b47fc8ecb /engines
parent52f669c93c9497a03e3e32467a4614263e1c6382 (diff)
downloadscummvm-rg350-3e574cfbf89ef7dc6126e64a1776595fea9fac7b.tar.gz
scummvm-rg350-3e574cfbf89ef7dc6126e64a1776595fea9fac7b.tar.bz2
scummvm-rg350-3e574cfbf89ef7dc6126e64a1776595fea9fac7b.zip
CGE: Remove wtom()
Diffstat (limited to 'engines')
-rw-r--r--engines/cge/cge_main.cpp5
-rw-r--r--engines/cge/general.cpp11
-rw-r--r--engines/cge/general.h1
-rw-r--r--engines/cge/sound.cpp16
4 files changed, 12 insertions, 21 deletions
diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp
index a915a08689..c4719fe287 100644
--- a/engines/cge/cge_main.cpp
+++ b/engines/cge/cge_main.cpp
@@ -529,10 +529,9 @@ void CGEEngine::setMapBrick(int x, int z) {
Square *s = new Square(this);
if (s) {
- static char n[] = "00:00";
+ char n[6];
s->gotoxy(x * kMapGridX, kMapTop + z * kMapGridZ);
- wtom(x, n + 0, 10, 2);
- wtom(z, n + 3, 10, 2);
+ sprintf(n, "%02d:%02d", x, z);
Cluster::_map[z][x] = 1;
s->setName(n);
_vga->_showQ->insert(s, _vga->_showQ->first());
diff --git a/engines/cge/general.cpp b/engines/cge/general.cpp
index 7cd44a81d0..13a92d38c2 100644
--- a/engines/cge/general.cpp
+++ b/engines/cge/general.cpp
@@ -63,17 +63,6 @@ char *forceExt(char *buf, const char *name, const char *ext) {
return buf;
}
-char *wtom(uint16 val, char *str, int radix, int len) {
- while (--len >= 0) {
- uint16 w = val % radix;
- if (w > 9)
- w += ('A' - ('9' + 1));
- str[len] = '0' + w;
- val /= radix;
- }
- return str;
-}
-
void sndSetVolume() {
// USeless for ScummVM
}
diff --git a/engines/cge/general.h b/engines/cge/general.h
index 33abd1e852..b9e8e27be4 100644
--- a/engines/cge/general.h
+++ b/engines/cge/general.h
@@ -47,7 +47,6 @@ struct Dac {
typedef uint16 Crypt(void *buf, uint16 siz, uint16 seed);
-char *wtom(uint16 val, char *str, int radix, int len);
int takeEnum(const char **tab, const char *text);
uint16 chkSum(void *m, uint16 n);
char *mergeExt(char *buf, const char *name, const char *ext);
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;
}