aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/file
diff options
context:
space:
mode:
Diffstat (limited to 'engines/wintermute/base/file')
-rw-r--r--engines/wintermute/base/file/BDiskFile.cpp131
-rw-r--r--engines/wintermute/base/file/BDiskFile.h42
-rw-r--r--engines/wintermute/base/file/BFile.cpp69
-rw-r--r--engines/wintermute/base/file/BFile.h67
-rw-r--r--engines/wintermute/base/file/BPkgFile.cpp105
-rw-r--r--engines/wintermute/base/file/BPkgFile.h46
-rw-r--r--engines/wintermute/base/file/BSaveThumbFile.cpp146
-rw-r--r--engines/wintermute/base/file/BSaveThumbFile.h52
8 files changed, 658 insertions, 0 deletions
diff --git a/engines/wintermute/base/file/BDiskFile.cpp b/engines/wintermute/base/file/BDiskFile.cpp
new file mode 100644
index 0000000000..f2938cebc9
--- /dev/null
+++ b/engines/wintermute/base/file/BDiskFile.cpp
@@ -0,0 +1,131 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This file is based on WME Lite.
+ * http://dead-code.org/redir.php?target=wmelite
+ * Copyright (c) 2011 Jan Nedoma
+ */
+
+#include "engines/wintermute/dcgf.h"
+#include "engines/wintermute/base/BGame.h"
+#include "engines/wintermute/wintypes.h"
+#include "engines/wintermute/base/file/BPkgFile.h"
+#include "engines/wintermute/base/file/BDiskFile.h"
+#include "engines/wintermute/base/BFileManager.h"
+#include "common/stream.h"
+#include "common/memstream.h"
+#include "common/file.h"
+#include "common/zlib.h"
+
+namespace WinterMute {
+
+void correctSlashes(char *fileName) {
+ for (size_t i = 0; i < strlen(fileName); i++) {
+ if (fileName[i] == '\\') fileName[i] = '/';
+ }
+}
+
+Common::SeekableReadStream *openDiskFile(const Common::String &filename, CBFileManager *fileManager) {
+ char fullPath[MAX_PATH_LENGTH];
+ uint32 prefixSize = 0;
+ Common::SeekableReadStream *file = NULL;
+
+ for (int i = 0; i < fileManager->_singlePaths.size(); i++) {
+ sprintf(fullPath, "%s%s", fileManager->_singlePaths[i], filename.c_str());
+ correctSlashes(fullPath);
+ Common::File *tempFile = new Common::File();
+ if (tempFile->open(fullPath)) {
+ file = tempFile;
+ } else {
+ delete tempFile;
+ }
+ }
+
+ // if we didn't find it in search paths, try to open directly
+ if (!file) {
+ strcpy(fullPath, filename.c_str());
+ correctSlashes(fullPath);
+
+ Common::File *tempFile = new Common::File();
+ if (tempFile->open(fullPath)) {
+ file = tempFile;
+ } else {
+ delete tempFile;
+ }
+ }
+
+ if (file) {
+ uint32 magic1, magic2;
+ magic1 = file->readUint32LE();
+ magic2 = file->readUint32LE();
+
+ bool compressed = false;
+ if (magic1 == DCGF_MAGIC && magic2 == COMPRESSED_FILE_MAGIC) compressed = true;
+
+ if (compressed) {
+ uint32 DataOffset, CompSize, UncompSize;
+ DataOffset = file->readUint32LE();
+ CompSize = file->readUint32LE();
+ UncompSize = file->readUint32LE();
+
+ byte *CompBuffer = new byte[CompSize];
+ if (!CompBuffer) {
+ error("Error allocating memory for compressed file '%s'", filename.c_str());
+ delete file;
+ return NULL;
+ }
+
+ byte *data = new byte[UncompSize];
+ if (!data) {
+ error("Error allocating buffer for file '%s'", filename.c_str());
+ delete [] CompBuffer;
+ delete file;
+ return NULL;
+ }
+ file->seek(DataOffset + prefixSize, SEEK_SET);
+ file->read(CompBuffer, CompSize);
+
+ if (Common::uncompress(data, (unsigned long *)&UncompSize, CompBuffer, CompSize) != true) {
+ error("Error uncompressing file '%s'", filename.c_str());
+ delete [] CompBuffer;
+ delete file;
+ return NULL;
+ }
+
+ delete [] CompBuffer;
+
+ return new Common::MemoryReadStream(data, UncompSize, DisposeAfterUse::YES);
+ delete file;
+ file = NULL;
+ } else {
+ file->seek(0, SEEK_SET);
+ return file;
+ }
+
+ return file;
+
+ }
+ return NULL;
+}
+
+} // end of namespace WinterMute
diff --git a/engines/wintermute/base/file/BDiskFile.h b/engines/wintermute/base/file/BDiskFile.h
new file mode 100644
index 0000000000..23e1a0a315
--- /dev/null
+++ b/engines/wintermute/base/file/BDiskFile.h
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This file is based on WME Lite.
+ * http://dead-code.org/redir.php?target=wmelite
+ * Copyright (c) 2011 Jan Nedoma
+ */
+
+#ifndef WINTERMUTE_BDISKFILE_H
+#define WINTERMUTE_BDISKFILE_H
+
+namespace Common {
+class SeekableReadStream;
+}
+
+namespace WinterMute {
+
+Common::SeekableReadStream *openDiskFile(const Common::String &filename, CBFileManager *fileManager);
+
+} // end of namespace WinterMute
+
+#endif
diff --git a/engines/wintermute/base/file/BFile.cpp b/engines/wintermute/base/file/BFile.cpp
new file mode 100644
index 0000000000..911039e36d
--- /dev/null
+++ b/engines/wintermute/base/file/BFile.cpp
@@ -0,0 +1,69 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This file is based on WME Lite.
+ * http://dead-code.org/redir.php?target=wmelite
+ * Copyright (c) 2011 Jan Nedoma
+ */
+
+#include "engines/wintermute/dcgf.h"
+#include "engines/wintermute/base/file/BFile.h"
+#include "common/memstream.h"
+
+namespace WinterMute {
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+
+//////////////////////////////////////////////////////////////////////////
+CBFile::CBFile(CBGame *inGame): CBBase(inGame) {
+ _pos = 0;
+ _size = 0;
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+CBFile::~CBFile() {
+
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+bool CBFile::isEOF() {
+ return _pos == _size;
+}
+
+Common::SeekableReadStream *CBFile::getMemStream() {
+ uint32 oldPos = getPos();
+ seek(0);
+ byte *data = new byte[getSize()];
+ read(data, getSize());
+ seek(oldPos);
+ Common::MemoryReadStream *memStream = new Common::MemoryReadStream(data, getSize(), DisposeAfterUse::YES);
+ return memStream;
+}
+
+
+} // end of namespace WinterMute
diff --git a/engines/wintermute/base/file/BFile.h b/engines/wintermute/base/file/BFile.h
new file mode 100644
index 0000000000..d1737df0ce
--- /dev/null
+++ b/engines/wintermute/base/file/BFile.h
@@ -0,0 +1,67 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This file is based on WME Lite.
+ * http://dead-code.org/redir.php?target=wmelite
+ * Copyright (c) 2011 Jan Nedoma
+ */
+
+#ifndef WINTERMUTE_BFILE_H
+#define WINTERMUTE_BFILE_H
+
+
+#include "engines/wintermute/base/BBase.h"
+#include "common/str.h"
+#include "common/stream.h"
+
+namespace Common {
+class SeekableReadStream;
+}
+
+namespace WinterMute {
+
+class CBFile : public CBBase {
+protected:
+ uint32 _pos;
+ uint32 _size;
+public:
+ virtual uint32 getSize() {
+ return _size;
+ };
+ virtual uint32 getPos() {
+ return _pos;
+ };
+ virtual bool seek(uint32 pos, int whence = SEEK_SET) = 0;
+ virtual bool read(void *buffer, uint32 size) = 0;
+ virtual bool close() = 0;
+ virtual bool open(const Common::String &filename) = 0;
+ virtual bool isEOF();
+ CBFile(CBGame *inGame);
+ virtual ~CBFile();
+ // Temporary solution to allow usage in ScummVM-code:
+ virtual Common::SeekableReadStream *getMemStream();
+};
+
+} // end of namespace WinterMute
+
+#endif
diff --git a/engines/wintermute/base/file/BPkgFile.cpp b/engines/wintermute/base/file/BPkgFile.cpp
new file mode 100644
index 0000000000..7eafe7919e
--- /dev/null
+++ b/engines/wintermute/base/file/BPkgFile.cpp
@@ -0,0 +1,105 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This file is based on WME Lite.
+ * http://dead-code.org/redir.php?target=wmelite
+ * Copyright (c) 2011 Jan Nedoma
+ */
+
+#include "engines/wintermute/dcgf.h"
+#include "engines/wintermute/base/BPackage.h"
+#include "engines/wintermute/base/file/BPkgFile.h"
+#include "engines/wintermute/base/BGame.h"
+#include "engines/wintermute/base/BFileManager.h"
+#include "common/util.h"
+#include "common/file.h"
+#include "common/stream.h"
+#include "common/substream.h"
+#include "common/zlib.h"
+
+namespace WinterMute {
+
+// HACK: wrapCompressedStream might set the size to 0, so we need a way to override it.
+class CBPkgFile : public Common::SeekableReadStream {
+ uint32 _size;
+ Common::SeekableReadStream *_stream;
+public:
+ CBPkgFile(Common::SeekableReadStream *stream, uint32 knownLength) : _size(knownLength), _stream(stream) {}
+ virtual ~CBPkgFile() {
+ delete _stream;
+ }
+ virtual uint32 read(void *dataPtr, uint32 dataSize) {
+ return _stream->read(dataPtr, dataSize);
+ }
+ virtual bool eos() const {
+ return _stream->eos();
+ }
+ virtual int32 pos() const {
+ return _stream->pos();
+ }
+ virtual int32 size() const {
+ return _size;
+ }
+ virtual bool seek(int32 offset, int whence = SEEK_SET) {
+ return _stream->seek(offset, whence);
+ }
+};
+
+Common::SeekableReadStream *openPkgFile(const Common::String &filename, CBFileManager *fileManager) {
+ CBFileEntry *fileEntry;
+ Common::SeekableReadStream *file = NULL;
+ char fileName[MAX_PATH_LENGTH];
+ strcpy(fileName, filename.c_str());
+
+ // correct slashes
+ for (uint32 i = 0; i < strlen(fileName); i++) {
+ if (fileName[i] == '/') fileName[i] = '\\';
+ }
+
+ fileEntry = fileManager->getPackageEntry(fileName);
+ if (!fileEntry) return NULL;
+
+ file = fileEntry->_package->getFilePointer();
+ if (!file) return NULL;
+
+ // TODO: Cleanup
+ bool compressed = (fileEntry->_compressedLength != 0);
+ /* _size = fileEntry->_length; */
+
+ if (compressed) {
+ // TODO: Really, most of this logic might be doable directly in the fileEntry?
+ // But for now, this should get us rolling atleast.
+ file = Common::wrapCompressedReadStream(new Common::SeekableSubReadStream(file, fileEntry->_offset, fileEntry->_offset + fileEntry->_length, DisposeAfterUse::YES));
+ } else {
+ file = new Common::SeekableSubReadStream(file, fileEntry->_offset, fileEntry->_offset + fileEntry->_length, DisposeAfterUse::YES);
+ }
+ if (file->size() == 0) {
+ file = new CBPkgFile(file, fileEntry->_length);
+ }
+
+ file->seek(0);
+
+ return file;
+}
+
+} // end of namespace WinterMute
diff --git a/engines/wintermute/base/file/BPkgFile.h b/engines/wintermute/base/file/BPkgFile.h
new file mode 100644
index 0000000000..f8a5831485
--- /dev/null
+++ b/engines/wintermute/base/file/BPkgFile.h
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This file is based on WME Lite.
+ * http://dead-code.org/redir.php?target=wmelite
+ * Copyright (c) 2011 Jan Nedoma
+ */
+
+#ifndef WINTERMUTE_BPKGFILE_H
+#define WINTERMUTE_BPKGFILE_H
+
+#include "engines/wintermute/base/BFileEntry.h"
+
+namespace Common {
+class SeekableReadStream;
+class File;
+}
+
+namespace WinterMute {
+
+class CBFileManager;
+Common::SeekableReadStream *openPkgFile(const Common::String &filename, CBFileManager *fileManager);
+
+} // end of namespace WinterMute
+
+#endif
diff --git a/engines/wintermute/base/file/BSaveThumbFile.cpp b/engines/wintermute/base/file/BSaveThumbFile.cpp
new file mode 100644
index 0000000000..b2eebb690b
--- /dev/null
+++ b/engines/wintermute/base/file/BSaveThumbFile.cpp
@@ -0,0 +1,146 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This file is based on WME Lite.
+ * http://dead-code.org/redir.php?target=wmelite
+ * Copyright (c) 2011 Jan Nedoma
+ */
+
+#include "engines/wintermute/dcgf.h"
+#include "engines/wintermute/base/BGame.h"
+#include "engines/wintermute/base/file/BSaveThumbFile.h"
+#include "engines/wintermute/PlatformSDL.h"
+
+namespace WinterMute {
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+
+//////////////////////////////////////////////////////////////////////////
+CBSaveThumbFile::CBSaveThumbFile(CBGame *inGame): CBFile(inGame) {
+ _data = NULL;
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+CBSaveThumbFile::~CBSaveThumbFile() {
+ close();
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+bool CBSaveThumbFile::open(const Common::String &filename) {
+ close();
+
+ if (scumm_strnicmp(filename.c_str(), "savegame:", 9) != 0) return STATUS_FAILED;
+
+ char *tempFilename = new char[strlen(filename.c_str()) - 8];
+ strcpy(tempFilename, filename.c_str() + 9);
+ for (uint32 i = 0; i < strlen(tempFilename); i++) {
+ if (tempFilename[i] < '0' || tempFilename[i] > '9') {
+ tempFilename[i] = '\0';
+ break;
+ }
+ }
+
+ // get slot number from name
+ int slot = atoi(tempFilename);
+ delete [] tempFilename;
+
+ char slotFilename[MAX_PATH_LENGTH + 1];
+ _gameRef->getSaveSlotFilename(slot, slotFilename);
+ CBPersistMgr *pm = new CBPersistMgr(_gameRef);
+ if (!pm) return STATUS_FAILED;
+
+ _gameRef->_debugAbsolutePathWarning = false;
+ if (DID_FAIL(pm->initLoad(slotFilename))) {
+ _gameRef->_debugAbsolutePathWarning = true;
+ delete pm;
+ return STATUS_FAILED;
+ }
+ _gameRef->_debugAbsolutePathWarning = true;
+
+ bool res;
+
+ if (pm->_thumbnailDataSize != 0) {
+ _data = new byte[pm->_thumbnailDataSize];
+ memcpy(_data, pm->_thumbnailData, pm->_thumbnailDataSize);
+ _size = pm->_thumbnailDataSize;
+ res = STATUS_OK;
+ } else res = STATUS_FAILED;
+ delete pm;
+
+ return res;
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+bool CBSaveThumbFile::close() {
+ delete[] _data;
+ _data = NULL;
+
+ _pos = 0;
+ _size = 0;
+
+ return STATUS_OK;
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+bool CBSaveThumbFile::read(void *buffer, uint32 size) {
+ if (!_data || _pos + size > _size) return STATUS_FAILED;
+
+ memcpy(buffer, (byte *)_data + _pos, size);
+ _pos += size;
+
+ return STATUS_OK;
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+bool CBSaveThumbFile::seek(uint32 pos, int whence) {
+ if (!_data) return STATUS_FAILED;
+
+ uint32 newPos = 0;
+
+ switch (whence) {
+ case SEEK_SET:
+ newPos = pos;
+ break;
+ case SEEK_END:
+ newPos = _size + pos;
+ break;
+ case SEEK_CUR:
+ newPos = _pos + pos;
+ break;
+ }
+
+ if (newPos > _size) return STATUS_FAILED;
+ else _pos = newPos;
+
+ return STATUS_OK;
+}
+
+} // end of namespace WinterMute
diff --git a/engines/wintermute/base/file/BSaveThumbFile.h b/engines/wintermute/base/file/BSaveThumbFile.h
new file mode 100644
index 0000000000..5d33ac2220
--- /dev/null
+++ b/engines/wintermute/base/file/BSaveThumbFile.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This file is based on WME Lite.
+ * http://dead-code.org/redir.php?target=wmelite
+ * Copyright (c) 2011 Jan Nedoma
+ */
+
+#ifndef WINTERMUTE_BSAVETHUMBFILE_H
+#define WINTERMUTE_BSAVETHUMBFILE_H
+
+
+#include "engines/wintermute/base/file/BFile.h"
+
+namespace WinterMute {
+
+//TODO: Get rid of this
+class CBSaveThumbFile : public CBFile {
+public:
+ CBSaveThumbFile(CBGame *Game);
+ virtual ~CBSaveThumbFile();
+ virtual bool seek(uint32 pos, int whence = SEEK_SET);
+ virtual bool read(void *buffer, uint32 size);
+ virtual bool close();
+ virtual bool open(const Common::String &filename);
+private:
+ byte *_data;
+};
+
+} // end of namespace WinterMute
+
+#endif