aboutsummaryrefslogtreecommitdiff
path: root/engines/cge/general.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2011-06-28 21:58:26 +1000
committerPaul Gilbert2011-06-28 21:58:26 +1000
commitd4b11df58b9b94b2e5c85cb2f9a4e712a8aaf72c (patch)
tree7eecb14da9bd2f9692e4e7efa0df910e0103963d /engines/cge/general.cpp
parent2fe6061d919a84e1f2849415902b3e91403bf69d (diff)
parent315bbd348d490d3edf6f5dcfb58ffcc9ecde83b3 (diff)
downloadscummvm-rg350-d4b11df58b9b94b2e5c85cb2f9a4e712a8aaf72c.tar.gz
scummvm-rg350-d4b11df58b9b94b2e5c85cb2f9a4e712a8aaf72c.tar.bz2
scummvm-rg350-d4b11df58b9b94b2e5c85cb2f9a4e712a8aaf72c.zip
Merge branch 'soltys_wip2' of github.com:Strangerke/scummvm into cge
Diffstat (limited to 'engines/cge/general.cpp')
-rw-r--r--engines/cge/general.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/engines/cge/general.cpp b/engines/cge/general.cpp
index b07ddbc362..1bf4bcd982 100644
--- a/engines/cge/general.cpp
+++ b/engines/cge/general.cpp
@@ -215,6 +215,7 @@ char *dwtom(uint32 val, char *str, int radix, int len) {
IOHAND::IOHAND(IOMODE mode, CRYPT *crpt)
: XFILE(mode), Crypt(crpt), Seed(SEED) {
+ _file = new Common::File();
}
IOHAND::IOHAND(const char *name, IOMODE mode, CRYPT *crpt)
@@ -222,18 +223,20 @@ IOHAND::IOHAND(const char *name, IOMODE mode, CRYPT *crpt)
// TODO: Check if WRI and/or UPD modes are needed, and map to a save file
assert(mode == REA);
- _file.open(name);
+ _file = new Common::File();
+ _file->open(name);
}
IOHAND::~IOHAND(void) {
- _file.close();
+ _file->close();
+ delete _file;
}
uint16 IOHAND::Read(void *buf, uint16 len) {
- if (Mode == WRI || !_file.isOpen())
+ if (Mode == WRI || !_file->isOpen())
return 0;
- uint16 bytesRead = _file.read(buf, len);
+ uint16 bytesRead = _file->read(buf, len);
if (Crypt) Seed = Crypt(buf, len, Seed);
return bytesRead;
}
@@ -255,16 +258,16 @@ uint16 IOHAND::Write(void *buf, uint16 len) {
}
long IOHAND::Mark(void) {
- return _file.pos();
+ return _file->pos();
}
long IOHAND::Seek(long pos) {
- _file.seek(pos, SEEK_SET);
- return _file.pos();
+ _file->seek(pos, SEEK_SET);
+ return _file->pos();
}
long IOHAND::Size(void) {
- return _file.size();
+ return _file->size();
}
bool IOHAND::Exist(const char *name) {