aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2011-08-13 10:09:45 +0200
committerStrangerke2011-08-13 10:17:41 +0200
commit1d3f1830c890f2f4f2fbb8fcf4db90dfe1bacdde (patch)
treeec670165be84b9d06bf4dec8fc8be4987809245e
parent177da650dde785abbee7ed446e71115839082517 (diff)
downloadscummvm-rg350-1d3f1830c890f2f4f2fbb8fcf4db90dfe1bacdde.tar.gz
scummvm-rg350-1d3f1830c890f2f4f2fbb8fcf4db90dfe1bacdde.tar.bz2
scummvm-rg350-1d3f1830c890f2f4f2fbb8fcf4db90dfe1bacdde.zip
CGE: Remove useless functions related to data file creation (unused)
-rw-r--r--engines/cge/btfile.cpp26
-rw-r--r--engines/cge/btfile.h1
-rw-r--r--engines/cge/general.cpp16
-rw-r--r--engines/cge/general.h8
-rw-r--r--engines/cge/vol.cpp17
-rw-r--r--engines/cge/vol.h11
6 files changed, 2 insertions, 77 deletions
diff --git a/engines/cge/btfile.cpp b/engines/cge/btfile.cpp
index 7ecfa94e9b..053f264b35 100644
--- a/engines/cge/btfile.cpp
+++ b/engines/cge/btfile.cpp
@@ -135,32 +135,6 @@ int keycomp(const void *k1, const void *k2) {
return scumm_strnicmp((const char *) k1, (const char*) k2, kBtKeySize);
}
-
-void BtFile::make(BtKeypack *keypack, uint16 count) {
- debugC(1, kCGEDebugFile, "BtFile::make(keypack, %d)", count);
-
-#if kBtLevel != 2
-#error This tiny BTREE implementation works with exactly 2 levels!
-#endif
- _fqsort(keypack, count, sizeof(*keypack), keycomp);
- uint16 n = 0;
- BtPage *Root = getPage(0, n++);
- BtPage *Leaf = getPage(1, n);
- Root->_hea._down = n;
- putPage(0, true);
- while (count--) {
- if (Leaf->_hea._count >= ArrayCount(Leaf->_lea)) {
- putPage(1, true); // save filled page
- Leaf = getPage(1, ++n); // take empty page
- memcpy(Root->_inn[Root->_hea._count]._key, keypack->_key, kBtKeySize);
- Root->_inn[Root->_hea._count++]._down = n;
- _buff[0]._updt = true;
- }
- Leaf->_lea[Leaf->_hea._count++] = *(keypack++);
- _buff[1]._updt = true;
- }
-}
-
void BtPage::read(Common::ReadStream &s) {
_hea._count = s.readUint16LE();
_hea._down = s.readUint16LE();
diff --git a/engines/cge/btfile.h b/engines/cge/btfile.h
index 26b008bea6..7cfdc263e7 100644
--- a/engines/cge/btfile.h
+++ b/engines/cge/btfile.h
@@ -87,7 +87,6 @@ public:
virtual ~BtFile();
BtKeypack *find(const char *key);
BtKeypack *next();
- void make(BtKeypack *keypack, uint16 count);
};
} // End of namespace CGE
diff --git a/engines/cge/general.cpp b/engines/cge/general.cpp
index ddfb982d58..6d7b1daf88 100644
--- a/engines/cge/general.cpp
+++ b/engines/cge/general.cpp
@@ -92,10 +92,6 @@ Dac _stdPal[] = {// R G B
{ 255, 255, 255}, // 255
};
-void _fqsort(void *base, uint16 nelem, uint16 width, int (*fcmp)(const void *, const void *)) {
- warning("STUB: _fqsort");
-}
-
const char *progName(const char *ext) {
static char buf[kMaxFile];
strcpy(buf, "CGE");
@@ -292,18 +288,6 @@ int takeEnum(const char **tab, const char *text) {
return -1;
}
-long timer() {
-/*
- asm mov ax,0x40
- asm mov es,ax
- asm mov cx,es:[0x6C]
- asm mov dx,es:[0x6E]
- return ((long) _DX << 16) | _CX;
-*/
- warning("STUB: timer");
- return 0;
-}
-
int newRandom(int range) {
return ((CGEEngine *)g_engine)->_randomSource.getRandomNumber(range - 1);
}
diff --git a/engines/cge/general.h b/engines/cge/general.h
index fe34606108..90cba269cd 100644
--- a/engines/cge/general.h
+++ b/engines/cge/general.h
@@ -113,22 +113,14 @@ char *wtom(uint16 val, char *str, int radix, int len);
char *dwtom(uint32 val, char *str, int radix, int len);
int takeEnum(const char **tab, const char *text);
uint16 chkSum(void *m, uint16 n);
-long timer();
char *mergeExt(char *buf, const char *name, const char *ext);
char *forceExt(char *buf, const char *name, const char *ext);
// MISSING FUNCTIONS
-void _fqsort(void *base, uint16 nelem, uint16 width, int (*fcmp)(const void *, const void *));
const char *progName(const char *ext = NULL);
unsigned fastRand();
unsigned fastRand(unsigned s);
uint16 rCrypt(void *buf, uint16 siz, uint16 seed);
-uint16 atow(const char *a);
-uint16 xtow(const char *x);
-char *wtom(uint16 val, char *str, int radix, int len);
-char *dwtom(uint32 val, char * str, int radix, int len);
-int takeEnum(const char **tab, const char *text);
-long timer();
int newRandom(int range);
} // End of namespace CGE
diff --git a/engines/cge/vol.cpp b/engines/cge/vol.cpp
index b3cc49495a..44cad5e832 100644
--- a/engines/cge/vol.cpp
+++ b/engines/cge/vol.cpp
@@ -40,13 +40,7 @@ VFile *VFile::_recent = NULL;
/*-----------------------------------------------------------------------*/
-Dat::Dat():
-#ifdef VOL_UPD
- _file(DAT_NAME, UPD, CRP)
-#else
- _file(DAT_NAME, kModeRead, CRP)
-#endif
-{
+Dat::Dat(): _file(DAT_NAME, kModeRead, CRP) {
debugC(1, kCGEDebugFile, "Dat::Dat()");
}
@@ -56,12 +50,7 @@ void VFile::init() {
debugC(1, kCGEDebugFile, "VFile::init()");
_dat = new Dat();
-#ifdef VOL_UPD
- _cat = new BtFile(CAT_NAME, UPD, CRP);
-#else
_cat = new BtFile(CAT_NAME, kModeRead, CRP);
-#endif
-
_recent = NULL;
}
@@ -82,10 +71,6 @@ VFile::VFile(const char *name, IOMode mode)
_error = 1;
_endMark = (_bufMark = _begMark = kp->_mark) + kp->_size;
}
-#ifdef VOL_UPD
- else
- Make(name);
-#endif
}
diff --git a/engines/cge/vol.h b/engines/cge/vol.h
index f64e7eec54..f9d9382eac 100644
--- a/engines/cge/vol.h
+++ b/engines/cge/vol.h
@@ -36,16 +36,9 @@ namespace CGE {
#define CAT_NAME "VOL.CAT"
#define DAT_NAME "VOL.DAT"
-#define CRP XCrypt
-
+#define CRP XCrypt
#define XMASK 0xA5
-
-#ifdef VOL_UPD
-#define VOLBASE IOHAND
-#else
#define VOLBASE CFile
-#endif
-
class Dat {
friend class VFile;
@@ -58,7 +51,6 @@ public:
bool read(long org, uint16 len, uint8 *buf);
};
-
class VFile : public IoBuf {
private:
static Dat *_dat;
@@ -70,7 +62,6 @@ private:
void readBuf();
void writeBuf() { }
- void make(const char *fspec);
public:
VFile(const char *name, IOMode mode = kModeRead);
~VFile();