aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2011-09-09 20:03:23 +0200
committerStrangerke2011-09-09 20:03:23 +0200
commit0784b7e0b4f0f19b4c5a34f7081fdbf8ce9f75d9 (patch)
tree59c56238c7325ba0b114977eb75f9dd278afe6f5
parent4848683e56b1466a7dabbbecb7bb1bf7e4c857a7 (diff)
downloadscummvm-rg350-0784b7e0b4f0f19b4c5a34f7081fdbf8ce9f75d9.tar.gz
scummvm-rg350-0784b7e0b4f0f19b4c5a34f7081fdbf8ce9f75d9.tar.bz2
scummvm-rg350-0784b7e0b4f0f19b4c5a34f7081fdbf8ce9f75d9.zip
CGE: Remove Dat class
-rw-r--r--engines/cge/cge.cpp2
-rw-r--r--engines/cge/cge_main.cpp2
-rw-r--r--engines/cge/fileio.cpp16
-rw-r--r--engines/cge/fileio.h10
4 files changed, 8 insertions, 22 deletions
diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp
index d5d21726b1..1b9fcf64ed 100644
--- a/engines/cge/cge.cpp
+++ b/engines/cge/cge.cpp
@@ -79,7 +79,7 @@ void CGEEngine::init() {
_miniShp = NULL;
_miniShpList = NULL;
_sprite = NULL;
- _dat = new Dat();
+ _dat = new CFile(kDatName, XCrypt);
_cat = new BtFile(kCatName, XCrypt);
// Create debugger console
diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp
index f837788edf..b9033a81ee 100644
--- a/engines/cge/cge_main.cpp
+++ b/engines/cge/cge_main.cpp
@@ -72,7 +72,7 @@ Snail *_snail_;
Fx *_fx;
Sound *_sound;
-Dat *_dat;
+CFile *_dat;
BtFile *_cat;
// 0.75 - 17II95 - full sound support
diff --git a/engines/cge/fileio.cpp b/engines/cge/fileio.cpp
index 30d291d16b..7624eac936 100644
--- a/engines/cge/fileio.cpp
+++ b/engines/cge/fileio.cpp
@@ -330,21 +330,13 @@ bool BtFile::exist(const char *name) {
return scumm_stricmp(find(name)->_key, name) == 0;
}
-
-/*-----------------------------------------------------------------------
- * Dat
- *-----------------------------------------------------------------------*/
-Dat::Dat(): _file(kDatName, XCrypt) {
- debugC(1, kCGEDebugFile, "Dat::Dat()");
-}
-
/*-----------------------------------------------------------------------
* VFile
*-----------------------------------------------------------------------*/
VFile::VFile(const char *name) : IoBuf(NULL) {
debugC(3, kCGEDebugFile, "VFile::VFile(%s)", name);
- if (_dat->_file._error || _cat->_error)
+ if (_dat->_error || _cat->_error)
error("Bad volume data");
BtKeypack *kp = _cat->find(name);
if (scumm_stricmp(kp->_key, name) != 0)
@@ -358,12 +350,12 @@ VFile::~VFile() {
void VFile::readBuf() {
debugC(3, kCGEDebugFile, "VFile::readBuf()");
- _dat->_file.seek(_bufMark + _lim);
- _bufMark = _dat->_file.mark();
+ _dat->seek(_bufMark + _lim);
+ _bufMark = _dat->mark();
long n = _endMark - _bufMark;
if (n > kBufferSize)
n = kBufferSize;
- _lim = _dat->_file.read(_buff, (uint16) n);
+ _lim = _dat->read(_buff, (uint16) n);
_ptr = 0;
}
diff --git a/engines/cge/fileio.h b/engines/cge/fileio.h
index 6465c8e8f8..65f0b953e7 100644
--- a/engines/cge/fileio.h
+++ b/engines/cge/fileio.h
@@ -63,10 +63,10 @@ struct Header {
class IoHand {
protected:
- Common::File *_file;
uint16 _seed;
Crypt *_crypt;
public:
+ Common::File *_file;
uint16 _error;
IoHand(const char *name, Crypt crypt);
@@ -132,12 +132,6 @@ public:
bool exist(const char *name);
};
-class Dat {
-public:
- Dat();
- CFile _file;
-};
-
class VFile : public IoBuf {
private:
long _begMark;
@@ -153,7 +147,7 @@ public:
long seek(long pos);
};
-extern Dat *_dat;
+extern CFile *_dat;
extern BtFile *_cat;
} // End of namespace CGE