CGE: Remove wtom()

This commit is contained in:
Strangerke 2011-09-07 01:02:05 +02:00
parent 52f669c93c
commit 3e574cfbf8
4 changed files with 12 additions and 21 deletions

View File

@ -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());

View File

@ -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
}

View File

@ -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);

View File

@ -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;
}