From 84601ca89ef05807a86b10f6c0412a60c6b079e6 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Sat, 2 Jun 2012 02:41:18 +0200 Subject: WINTERMUTE: Move the file-related classes into Base/file --- engines/wintermute/Base/BDiskFile.cpp | 230 ------------------------ engines/wintermute/Base/BDiskFile.h | 59 ------ engines/wintermute/Base/BFile.cpp | 69 ------- engines/wintermute/Base/BFile.h | 65 ------- engines/wintermute/Base/BFileManager.cpp | 8 +- engines/wintermute/Base/BFontTT.cpp | 2 +- engines/wintermute/Base/BGame.cpp | 2 +- engines/wintermute/Base/BPkgFile.cpp | 161 ----------------- engines/wintermute/Base/BPkgFile.h | 64 ------- engines/wintermute/Base/BResourceFile.cpp | 103 ----------- engines/wintermute/Base/BResourceFile.h | 50 ------ engines/wintermute/Base/BSaveThumbFile.cpp | 146 --------------- engines/wintermute/Base/BSaveThumbFile.h | 51 ------ engines/wintermute/Base/BSoundBuffer.cpp | 2 +- engines/wintermute/Base/BSurfaceSDL.cpp | 2 +- engines/wintermute/Base/file/BDiskFile.cpp | 230 ++++++++++++++++++++++++ engines/wintermute/Base/file/BDiskFile.h | 59 ++++++ engines/wintermute/Base/file/BFile.cpp | 69 +++++++ engines/wintermute/Base/file/BFile.h | 65 +++++++ engines/wintermute/Base/file/BPkgFile.cpp | 161 +++++++++++++++++ engines/wintermute/Base/file/BPkgFile.h | 64 +++++++ engines/wintermute/Base/file/BResourceFile.cpp | 103 +++++++++++ engines/wintermute/Base/file/BResourceFile.h | 50 ++++++ engines/wintermute/Base/file/BSaveThumbFile.cpp | 146 +++++++++++++++ engines/wintermute/Base/file/BSaveThumbFile.h | 51 ++++++ engines/wintermute/Base/scriptables/SXFile.cpp | 2 +- engines/wintermute/module.mk | 10 +- engines/wintermute/video/VidTheoraPlayer.h | 2 +- 28 files changed, 1013 insertions(+), 1013 deletions(-) delete mode 100644 engines/wintermute/Base/BDiskFile.cpp delete mode 100644 engines/wintermute/Base/BDiskFile.h delete mode 100644 engines/wintermute/Base/BFile.cpp delete mode 100644 engines/wintermute/Base/BFile.h delete mode 100644 engines/wintermute/Base/BPkgFile.cpp delete mode 100644 engines/wintermute/Base/BPkgFile.h delete mode 100644 engines/wintermute/Base/BResourceFile.cpp delete mode 100644 engines/wintermute/Base/BResourceFile.h delete mode 100644 engines/wintermute/Base/BSaveThumbFile.cpp delete mode 100644 engines/wintermute/Base/BSaveThumbFile.h create mode 100644 engines/wintermute/Base/file/BDiskFile.cpp create mode 100644 engines/wintermute/Base/file/BDiskFile.h create mode 100644 engines/wintermute/Base/file/BFile.cpp create mode 100644 engines/wintermute/Base/file/BFile.h create mode 100644 engines/wintermute/Base/file/BPkgFile.cpp create mode 100644 engines/wintermute/Base/file/BPkgFile.h create mode 100644 engines/wintermute/Base/file/BResourceFile.cpp create mode 100644 engines/wintermute/Base/file/BResourceFile.h create mode 100644 engines/wintermute/Base/file/BSaveThumbFile.cpp create mode 100644 engines/wintermute/Base/file/BSaveThumbFile.h (limited to 'engines/wintermute') diff --git a/engines/wintermute/Base/BDiskFile.cpp b/engines/wintermute/Base/BDiskFile.cpp deleted file mode 100644 index 0d2b41f870..0000000000 --- a/engines/wintermute/Base/BDiskFile.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/* 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/BPkgFile.h" -#include "engines/wintermute/Base/BDiskFile.h" -#include "engines/wintermute/Base/BFileManager.h" -#include "common/stream.h" -#include "common/file.h" - -namespace WinterMute { - -////////////////////////////////////////////////////////////////////////// -CBDiskFile::CBDiskFile(CBGame *inGame): CBFile(inGame) { - _file = NULL; - _data = NULL; - _compressed = false; - _prefixSize = 0; -} - - -////////////////////////////////////////////////////////////////////////// -CBDiskFile::~CBDiskFile() { - Close(); -} - - -////////////////////////////////////////////////////////////////////////// -HRESULT CBDiskFile::Open(const Common::String &Filename) { - Close(); - - char FullPath[MAX_PATH]; - - for (int i = 0; i < Game->_fileManager->_singlePaths.GetSize(); i++) { - sprintf(FullPath, "%s%s", Game->_fileManager->_singlePaths[i], Filename.c_str()); - CorrectSlashes(FullPath); - //_file = Common::createFileStream(FullPath); - Common::File *tempFile = new Common::File(); - if (tempFile->open(FullPath)) { - _file = tempFile; - } else { - delete tempFile; - } - /* if (_file != NULL) { - error("Tried to open %s, but failed", Filename.c_str()); - break; - }*/ - } - - // if we didn't find it in search paths, try to open directly - if (!_file) { - strcpy(FullPath, Filename.c_str()); - CorrectSlashes(FullPath); - //error("Tried to open %s, TODO: add SearchMan-support", Filename.c_str()); - //_file = Common::createFileStream(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(); - - 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) { - Game->LOG(0, "Error allocating memory for compressed file '%s'", Filename.c_str()); - Close(); - return E_FAIL; - } - - _data = new byte[UncompSize]; - if (!_data) { - Game->LOG(0, "Error allocating buffer for file '%s'", Filename.c_str()); - delete [] CompBuffer; - Close(); - return E_FAIL; - } - _file->seek(DataOffset + _prefixSize, SEEK_SET); - _file->read(CompBuffer, CompSize); - - if (uncompress(_data, (uLongf *)&UncompSize, CompBuffer, CompSize) != Z_OK) { - Game->LOG(0, "Error uncompressing file '%s'", Filename.c_str()); - delete [] CompBuffer; - Close(); - return E_FAIL; - } - - delete [] CompBuffer; - _size = UncompSize; - _pos = 0; - delete _file; - _file = NULL; - } else { - _pos = 0; - _file->seek(0, SEEK_END); - _size = _file->pos() - _prefixSize; - _file->seek(_prefixSize, SEEK_SET); - } - - return S_OK; - } else return E_FAIL; -} - - -////////////////////////////////////////////////////////////////////////// -HRESULT CBDiskFile::Close() { - if (_file) { - delete _file; - } - _file = NULL; - _pos = 0; - _size = 0; - - delete[] _data; - _data = NULL; - - _compressed = false; - - return S_OK; -} - - -////////////////////////////////////////////////////////////////////////// -HRESULT CBDiskFile::Read(void *Buffer, uint32 Size) { - if (_compressed) { - memcpy(Buffer, _data + _pos, Size); - _pos += Size; - return S_OK; - } else { - - if (_file) { - size_t count = _file->read(Buffer, Size); - _pos += count; - return S_OK; - } else return E_FAIL; - } -} - - -////////////////////////////////////////////////////////////////////////// -HRESULT CBDiskFile::Seek(uint32 Pos, TSeek Origin) { - // TODO: Should this really need to use uint32? - if (_compressed) { - uint32 NewPos = 0; - - switch (Origin) { - case SEEK_TO_BEGIN: - NewPos = Pos; - break; - case SEEK_TO_END: - NewPos = _size + Pos; - break; - case SEEK_TO_CURRENT: - NewPos = _pos + Pos; - break; - } - - if (NewPos < 0 || NewPos > _size) return E_FAIL; - else _pos = NewPos; - return S_OK; - } else { - if (!_file) return E_FAIL; - int ret = 1; - - switch (Origin) { - case SEEK_TO_BEGIN: - ret = _file->seek(_prefixSize + Pos, SEEK_SET); - break; - case SEEK_TO_END: - ret = _file->seek(Pos, SEEK_END); - break; - case SEEK_TO_CURRENT: - ret = _file->seek(Pos, SEEK_CUR); - break; - } - if (ret == 0) { - _pos = _file->pos() - _prefixSize; - return S_OK; - } else return E_FAIL; - } -} - -////////////////////////////////////////////////////////////////////////// -void CBDiskFile::CorrectSlashes(char *fileName) { - for (size_t i = 0; i < strlen(fileName); i++) { - if (fileName[i] == '\\') fileName[i] = '/'; - } -} - -} // end of namespace WinterMute diff --git a/engines/wintermute/Base/BDiskFile.h b/engines/wintermute/Base/BDiskFile.h deleted file mode 100644 index 967e902dff..0000000000 --- a/engines/wintermute/Base/BDiskFile.h +++ /dev/null @@ -1,59 +0,0 @@ -/* 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 - - -#include "engines/wintermute/Base/BFile.h" - -namespace Common { -class SeekableReadStream; -} - -namespace WinterMute { - -class CBDiskFile : public CBFile { -public: - CBDiskFile(CBGame *inGame); - virtual ~CBDiskFile(); - virtual HRESULT Seek(uint32 Pos, TSeek Origin = SEEK_TO_BEGIN); - virtual HRESULT Read(void *Buffer, uint32 Size); - virtual HRESULT Close(); - virtual HRESULT Open(const Common::String &Filename); -private: - void CorrectSlashes(char *fileName); - Common::SeekableReadStream *_file; - byte *_data; - bool _compressed; - uint32 _prefixSize; -}; - -} // end of namespace WinterMute - -#endif diff --git a/engines/wintermute/Base/BFile.cpp b/engines/wintermute/Base/BFile.cpp deleted file mode 100644 index ba75023c7f..0000000000 --- a/engines/wintermute/Base/BFile.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* 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/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/BFile.h b/engines/wintermute/Base/BFile.h deleted file mode 100644 index ba20975b46..0000000000 --- a/engines/wintermute/Base/BFile.h +++ /dev/null @@ -1,65 +0,0 @@ -/* 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" - -namespace Common { -class SeekableReadStream; -} - -namespace WinterMute { - -class CBFile : public CBBase { -public: - uint32 _pos; - uint32 _size; - virtual uint32 GetSize() { - return _size; - }; - virtual uint32 GetPos() { - return _pos; - }; - virtual HRESULT Seek(uint32 Pos, TSeek Origin = SEEK_TO_BEGIN) = 0; - virtual HRESULT Read(void *Buffer, uint32 Size) = 0; - virtual HRESULT Close() = 0; - virtual HRESULT 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/BFileManager.cpp b/engines/wintermute/Base/BFileManager.cpp index 8a8de885c0..06130092ac 100644 --- a/engines/wintermute/Base/BFileManager.cpp +++ b/engines/wintermute/Base/BFileManager.cpp @@ -32,11 +32,11 @@ #include "engines/wintermute/Base/BFileManager.h" #include "engines/wintermute/utils/StringUtil.h" #include "engines/wintermute/utils/PathUtil.h" -#include "engines/wintermute/Base/BDiskFile.h" -#include "engines/wintermute/Base/BResourceFile.h" -#include "engines/wintermute/Base/BSaveThumbFile.h" +#include "engines/wintermute/Base/file/BDiskFile.h" +#include "engines/wintermute/Base/file/BResourceFile.h" +#include "engines/wintermute/Base/file/BSaveThumbFile.h" #include "engines/wintermute/Base/BFileEntry.h" -#include "engines/wintermute/Base/BPkgFile.h" +#include "engines/wintermute/Base/file/BPkgFile.h" #include "engines/wintermute/Base/BPackage.h" #include "engines/wintermute/Base/BRegistry.h" #include "engines/wintermute/Base/BGame.h" diff --git a/engines/wintermute/Base/BFontTT.cpp b/engines/wintermute/Base/BFontTT.cpp index 003cada4c7..6ec9382a63 100644 --- a/engines/wintermute/Base/BFontTT.cpp +++ b/engines/wintermute/Base/BFontTT.cpp @@ -29,7 +29,7 @@ //#include //#include FT_FREETYPE_H #include "engines/wintermute/dcgf.h" -#include "engines/wintermute/Base/BFile.h" +#include "engines/wintermute/Base/file/BFile.h" #include "engines/wintermute/Base/BFontTT.h" #include "engines/wintermute/FontGlyphCache.h" #include "engines/wintermute/utils/PathUtil.h" diff --git a/engines/wintermute/Base/BGame.cpp b/engines/wintermute/Base/BGame.cpp index 7febffbab5..287092e02d 100644 --- a/engines/wintermute/Base/BGame.cpp +++ b/engines/wintermute/Base/BGame.cpp @@ -30,7 +30,7 @@ #include "engines/wintermute/dcgf.h" #include "engines/wintermute/Base/BGame.h" #include "engines/wintermute/Base/BFader.h" -#include "engines/wintermute/Base/BFile.h" +#include "engines/wintermute/Base/file/BFile.h" #include "engines/wintermute/Base/BFileManager.h" #include "engines/wintermute/Base/BFontTT.h" #include "engines/wintermute/Base/BFontStorage.h" diff --git a/engines/wintermute/Base/BPkgFile.cpp b/engines/wintermute/Base/BPkgFile.cpp deleted file mode 100644 index a48ccf7555..0000000000 --- a/engines/wintermute/Base/BPkgFile.cpp +++ /dev/null @@ -1,161 +0,0 @@ -/* 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/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 { - -////////////////////////////////////////////////////////////////////////// -CBPkgFile::CBPkgFile(CBGame *inGame): CBFile(inGame) { - _fileEntry = NULL; - _file = NULL; - _compressed = false; - -} - -////////////////////////////////////////////////////////////////////////// -CBPkgFile::~CBPkgFile() { - Close(); -} - - -////////////////////////////////////////////////////////////////////////// -HRESULT CBPkgFile::Open(const Common::String &Filename) { - Close(); - - char fileName[MAX_PATH]; - strcpy(fileName, Filename.c_str()); - - // correct slashes - for (uint32 i = 0; i < strlen(fileName); i++) { - if (fileName[i] == '/') fileName[i] = '\\'; - } - - _fileEntry = Game->_fileManager->GetPackageEntry(fileName); - if (!_fileEntry) return E_FAIL; - - _file = _fileEntry->_package->GetFilePointer(); - if (!_file) return E_FAIL; - - // TODO: Cleanup - _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); - } - - SeekToPos(0); - - return S_OK; -} - - -////////////////////////////////////////////////////////////////////////// -HRESULT CBPkgFile::Close() { - if (_fileEntry) { - _fileEntry->_package->CloseFilePointer(_file); - _fileEntry = NULL; - } - _file = NULL; - - // TODO: Do we really need to take care of our position and size at all (or could (Safe)SubStreams fix that for us? - _pos = 0; - _size = 0; - - return S_OK; -} - - -////////////////////////////////////////////////////////////////////////// -HRESULT CBPkgFile::Read(void *Buffer, uint32 Size) { - if (!_fileEntry) return E_FAIL; - - HRESULT ret = S_OK; - - if (_pos + Size > _size) { - Size = _size - _pos; - if (Size == 0) return E_FAIL; - } - - ret = _file->read(Buffer, Size); - - _pos += Size; - - return ret; -} - - -////////////////////////////////////////////////////////////////////////// -HRESULT CBPkgFile::Seek(uint32 Pos, TSeek Origin) { - if (!_fileEntry) return E_FAIL; - - uint32 NewPos = 0; - - switch (Origin) { - case SEEK_TO_BEGIN: - NewPos = Pos; - break; - case SEEK_TO_END: - NewPos = _size + Pos; - break; - case SEEK_TO_CURRENT: - NewPos = _pos + Pos; - break; - } - - if (NewPos < 0 || NewPos > _size) return E_FAIL; - - return SeekToPos(NewPos); -} - - -#define STREAM_BUFFER_SIZE 4096 -////////////////////////////////////////////////////////////////////////// -HRESULT CBPkgFile::SeekToPos(uint32 NewPos) { - HRESULT ret = S_OK; - - // seek compressed stream to NewPos - _pos = NewPos; - return ret; -} - -} // end of namespace WinterMute diff --git a/engines/wintermute/Base/BPkgFile.h b/engines/wintermute/Base/BPkgFile.h deleted file mode 100644 index e2817f8a00..0000000000 --- a/engines/wintermute/Base/BPkgFile.h +++ /dev/null @@ -1,64 +0,0 @@ -/* 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/BFile.h" -#include "engines/wintermute/Base/BFileEntry.h" -#include // Added by ClassView - -#define COMPRESSED_BUFFER_SIZE 4096 - -namespace Common { -class SeekableReadStream; -class File; -} - -namespace WinterMute { - -class CBPkgFile : public CBFile { -public: - CBPkgFile(CBGame *inGame); - virtual ~CBPkgFile(); - virtual HRESULT Seek(uint32 Pos, TSeek Origin = SEEK_TO_BEGIN); - virtual HRESULT Read(void *Buffer, uint32 Size); - virtual HRESULT Close(); - virtual HRESULT Open(const Common::String &Filename); -private: - bool _inflateInit; - HRESULT SeekToPos(uint32 NewPos); - bool _compressed; - CBFileEntry *_fileEntry; - Common::SeekableReadStream *_file; -}; - -} // end of namespace WinterMute - -#endif diff --git a/engines/wintermute/Base/BResourceFile.cpp b/engines/wintermute/Base/BResourceFile.cpp deleted file mode 100644 index 805868e5c8..0000000000 --- a/engines/wintermute/Base/BResourceFile.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* 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/BResourceFile.h" -#include "engines/wintermute/Base/BResources.h" - -namespace WinterMute { - -////////////////////////////////////////////////////////////////////////// -CBResourceFile::CBResourceFile(CBGame *inGame): CBFile(inGame) { - _data = NULL; -} - - -////////////////////////////////////////////////////////////////////////// -CBResourceFile::~CBResourceFile() { - Close(); -} - - -////////////////////////////////////////////////////////////////////////// -HRESULT CBResourceFile::Open(const Common::String &Filename) { - Close(); - - if (CBResources::GetFile(Filename.c_str(), _data, _size)) { - _pos = 0; - return S_OK; - } - return E_FAIL; -} - -////////////////////////////////////////////////////////////////////////// -HRESULT CBResourceFile::Close() { - _data = NULL; - _pos = 0; - _size = 0; - - return S_OK; -} - - -////////////////////////////////////////////////////////////////////////// -HRESULT CBResourceFile::Read(void *Buffer, uint32 Size) { - if (!_data || _pos + Size > _size) return E_FAIL; - - memcpy(Buffer, (byte *)_data + _pos, Size); - _pos += Size; - - return S_OK; -} - - -////////////////////////////////////////////////////////////////////////// -HRESULT CBResourceFile::Seek(uint32 Pos, TSeek Origin) { - if (!_data) return E_FAIL; - - int32 NewPos = 0; - - switch (Origin) { - case SEEK_TO_BEGIN: - NewPos = Pos; - break; - case SEEK_TO_END: - NewPos = _size + Pos; - break; - case SEEK_TO_CURRENT: - NewPos = _pos + Pos; - break; - } - - if (NewPos < 0 || NewPos > _size) return E_FAIL; - else _pos = NewPos; - - return S_OK; -} - -} // end of namespace WinterMute diff --git a/engines/wintermute/Base/BResourceFile.h b/engines/wintermute/Base/BResourceFile.h deleted file mode 100644 index 721134dd84..0000000000 --- a/engines/wintermute/Base/BResourceFile.h +++ /dev/null @@ -1,50 +0,0 @@ -/* 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_BRESOURCEFILE_H -#define WINTERMUTE_BRESOURCEFILE_H - -#include "engines/wintermute/Base/BFile.h" - -namespace WinterMute { - -class CBResourceFile : public CBFile { -public: - CBResourceFile(CBGame *inGame); - virtual ~CBResourceFile(); - virtual HRESULT Seek(uint32 Pos, TSeek Origin = SEEK_TO_BEGIN); - virtual HRESULT Read(void *Buffer, uint32 Size); - virtual HRESULT Close(); - virtual HRESULT Open(const Common::String &Filename); -private: - byte *_data; -}; - -} // end of namespace WinterMute - -#endif diff --git a/engines/wintermute/Base/BSaveThumbFile.cpp b/engines/wintermute/Base/BSaveThumbFile.cpp deleted file mode 100644 index 66f1e8a95f..0000000000 --- a/engines/wintermute/Base/BSaveThumbFile.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/* 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/BSaveThumbFile.h" -#include "engines/wintermute/PlatformSDL.h" - -namespace WinterMute { - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -CBSaveThumbFile::CBSaveThumbFile(CBGame *inGame): CBFile(inGame) { - _data = NULL; -} - - -////////////////////////////////////////////////////////////////////////// -CBSaveThumbFile::~CBSaveThumbFile() { - Close(); -} - - -////////////////////////////////////////////////////////////////////////// -HRESULT CBSaveThumbFile::Open(const Common::String &Filename) { - Close(); - - if (scumm_strnicmp(Filename.c_str(), "savegame:", 9) != 0) return E_FAIL; - - char *TempFilename = new char[strlen(Filename.c_str()) - 8]; - strcpy(TempFilename, Filename.c_str() + 9); - for (int 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 + 1]; - Game->GetSaveSlotFilename(Slot, SlotFilename); - CBPersistMgr *pm = new CBPersistMgr(Game); - if (!pm) return E_FAIL; - - Game->_dEBUG_AbsolutePathWarning = false; - if (FAILED(pm->InitLoad(SlotFilename))) { - Game->_dEBUG_AbsolutePathWarning = true; - delete pm; - return E_FAIL; - } - Game->_dEBUG_AbsolutePathWarning = true; - - HRESULT res; - - if (pm->_thumbnailDataSize != 0) { - _data = new byte[pm->_thumbnailDataSize]; - memcpy(_data, pm->_thumbnailData, pm->_thumbnailDataSize); - _size = pm->_thumbnailDataSize; - res = S_OK; - } else res = E_FAIL; - delete pm; - - return res; -} - - -////////////////////////////////////////////////////////////////////////// -HRESULT CBSaveThumbFile::Close() { - delete[] _data; - _data = NULL; - - _pos = 0; - _size = 0; - - return S_OK; -} - - -////////////////////////////////////////////////////////////////////////// -HRESULT CBSaveThumbFile::Read(void *Buffer, uint32 Size) { - if (!_data || _pos + Size > _size) return E_FAIL; - - memcpy(Buffer, (byte *)_data + _pos, Size); - _pos += Size; - - return S_OK; -} - - -////////////////////////////////////////////////////////////////////////// -HRESULT CBSaveThumbFile::Seek(uint32 Pos, TSeek Origin) { - if (!_data) return E_FAIL; - - uint32 NewPos = 0; - - switch (Origin) { - case SEEK_TO_BEGIN: - NewPos = Pos; - break; - case SEEK_TO_END: - NewPos = _size + Pos; - break; - case SEEK_TO_CURRENT: - NewPos = _pos + Pos; - break; - } - - if (NewPos < 0 || NewPos > _size) return E_FAIL; - else _pos = NewPos; - - return S_OK; -} - -} // end of namespace WinterMute diff --git a/engines/wintermute/Base/BSaveThumbFile.h b/engines/wintermute/Base/BSaveThumbFile.h deleted file mode 100644 index 71bdb46431..0000000000 --- a/engines/wintermute/Base/BSaveThumbFile.h +++ /dev/null @@ -1,51 +0,0 @@ -/* 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/BFile.h" - -namespace WinterMute { - -class CBSaveThumbFile : public CBFile { -public: - CBSaveThumbFile(CBGame *Game); - virtual ~CBSaveThumbFile(); - virtual HRESULT Seek(uint32 Pos, TSeek Origin = SEEK_TO_BEGIN); - virtual HRESULT Read(void *Buffer, uint32 Size); - virtual HRESULT Close(); - virtual HRESULT Open(const Common::String &Filename); -private: - byte *_data; -}; - -} // end of namespace WinterMute - -#endif diff --git a/engines/wintermute/Base/BSoundBuffer.cpp b/engines/wintermute/Base/BSoundBuffer.cpp index 2a3daf144a..dd269d5b4e 100644 --- a/engines/wintermute/Base/BSoundBuffer.cpp +++ b/engines/wintermute/Base/BSoundBuffer.cpp @@ -27,7 +27,7 @@ */ #include "engines/wintermute/dcgf.h" -#include "engines/wintermute/Base/BFile.h" +#include "engines/wintermute/Base/file/BFile.h" #include "engines/wintermute/Base/BGame.h" #include "engines/wintermute/Base/BSoundMgr.h" #include "engines/wintermute/Base/BSoundBuffer.h" diff --git a/engines/wintermute/Base/BSurfaceSDL.cpp b/engines/wintermute/Base/BSurfaceSDL.cpp index e4fc48d1e3..166fbc171b 100644 --- a/engines/wintermute/Base/BSurfaceSDL.cpp +++ b/engines/wintermute/Base/BSurfaceSDL.cpp @@ -27,7 +27,7 @@ */ #include "engines/wintermute/dcgf.h" -#include "engines/wintermute/Base/BFile.h" +#include "engines/wintermute/Base/file/BFile.h" #include "engines/wintermute/Base/BGame.h" #include "engines/wintermute/Base/BSurfaceSDL.h" #include "engines/wintermute/Base/BRenderSDL.h" diff --git a/engines/wintermute/Base/file/BDiskFile.cpp b/engines/wintermute/Base/file/BDiskFile.cpp new file mode 100644 index 0000000000..b807925772 --- /dev/null +++ b/engines/wintermute/Base/file/BDiskFile.cpp @@ -0,0 +1,230 @@ +/* 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/file.h" + +namespace WinterMute { + +////////////////////////////////////////////////////////////////////////// +CBDiskFile::CBDiskFile(CBGame *inGame): CBFile(inGame) { + _file = NULL; + _data = NULL; + _compressed = false; + _prefixSize = 0; +} + + +////////////////////////////////////////////////////////////////////////// +CBDiskFile::~CBDiskFile() { + Close(); +} + + +////////////////////////////////////////////////////////////////////////// +HRESULT CBDiskFile::Open(const Common::String &Filename) { + Close(); + + char FullPath[MAX_PATH]; + + for (int i = 0; i < Game->_fileManager->_singlePaths.GetSize(); i++) { + sprintf(FullPath, "%s%s", Game->_fileManager->_singlePaths[i], Filename.c_str()); + CorrectSlashes(FullPath); + //_file = Common::createFileStream(FullPath); + Common::File *tempFile = new Common::File(); + if (tempFile->open(FullPath)) { + _file = tempFile; + } else { + delete tempFile; + } + /* if (_file != NULL) { + error("Tried to open %s, but failed", Filename.c_str()); + break; + }*/ + } + + // if we didn't find it in search paths, try to open directly + if (!_file) { + strcpy(FullPath, Filename.c_str()); + CorrectSlashes(FullPath); + //error("Tried to open %s, TODO: add SearchMan-support", Filename.c_str()); + //_file = Common::createFileStream(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(); + + 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) { + Game->LOG(0, "Error allocating memory for compressed file '%s'", Filename.c_str()); + Close(); + return E_FAIL; + } + + _data = new byte[UncompSize]; + if (!_data) { + Game->LOG(0, "Error allocating buffer for file '%s'", Filename.c_str()); + delete [] CompBuffer; + Close(); + return E_FAIL; + } + _file->seek(DataOffset + _prefixSize, SEEK_SET); + _file->read(CompBuffer, CompSize); + + if (uncompress(_data, (uLongf *)&UncompSize, CompBuffer, CompSize) != Z_OK) { + Game->LOG(0, "Error uncompressing file '%s'", Filename.c_str()); + delete [] CompBuffer; + Close(); + return E_FAIL; + } + + delete [] CompBuffer; + _size = UncompSize; + _pos = 0; + delete _file; + _file = NULL; + } else { + _pos = 0; + _file->seek(0, SEEK_END); + _size = _file->pos() - _prefixSize; + _file->seek(_prefixSize, SEEK_SET); + } + + return S_OK; + } else return E_FAIL; +} + + +////////////////////////////////////////////////////////////////////////// +HRESULT CBDiskFile::Close() { + if (_file) { + delete _file; + } + _file = NULL; + _pos = 0; + _size = 0; + + delete[] _data; + _data = NULL; + + _compressed = false; + + return S_OK; +} + + +////////////////////////////////////////////////////////////////////////// +HRESULT CBDiskFile::Read(void *Buffer, uint32 Size) { + if (_compressed) { + memcpy(Buffer, _data + _pos, Size); + _pos += Size; + return S_OK; + } else { + + if (_file) { + size_t count = _file->read(Buffer, Size); + _pos += count; + return S_OK; + } else return E_FAIL; + } +} + + +////////////////////////////////////////////////////////////////////////// +HRESULT CBDiskFile::Seek(uint32 Pos, TSeek Origin) { + // TODO: Should this really need to use uint32? + if (_compressed) { + uint32 NewPos = 0; + + switch (Origin) { + case SEEK_TO_BEGIN: + NewPos = Pos; + break; + case SEEK_TO_END: + NewPos = _size + Pos; + break; + case SEEK_TO_CURRENT: + NewPos = _pos + Pos; + break; + } + + if (NewPos < 0 || NewPos > _size) return E_FAIL; + else _pos = NewPos; + return S_OK; + } else { + if (!_file) return E_FAIL; + int ret = 1; + + switch (Origin) { + case SEEK_TO_BEGIN: + ret = _file->seek(_prefixSize + Pos, SEEK_SET); + break; + case SEEK_TO_END: + ret = _file->seek(Pos, SEEK_END); + break; + case SEEK_TO_CURRENT: + ret = _file->seek(Pos, SEEK_CUR); + break; + } + if (ret == 0) { + _pos = _file->pos() - _prefixSize; + return S_OK; + } else return E_FAIL; + } +} + +////////////////////////////////////////////////////////////////////////// +void CBDiskFile::CorrectSlashes(char *fileName) { + for (size_t i = 0; i < strlen(fileName); i++) { + if (fileName[i] == '\\') fileName[i] = '/'; + } +} + +} // 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..89fd81b858 --- /dev/null +++ b/engines/wintermute/Base/file/BDiskFile.h @@ -0,0 +1,59 @@ +/* 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 + + +#include "engines/wintermute/Base/file/BFile.h" + +namespace Common { +class SeekableReadStream; +} + +namespace WinterMute { + +class CBDiskFile : public CBFile { +public: + CBDiskFile(CBGame *inGame); + virtual ~CBDiskFile(); + virtual HRESULT Seek(uint32 Pos, TSeek Origin = SEEK_TO_BEGIN); + virtual HRESULT Read(void *Buffer, uint32 Size); + virtual HRESULT Close(); + virtual HRESULT Open(const Common::String &Filename); +private: + void CorrectSlashes(char *fileName); + Common::SeekableReadStream *_file; + byte *_data; + bool _compressed; + uint32 _prefixSize; +}; + +} // 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..f3a37614a3 --- /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..ba20975b46 --- /dev/null +++ b/engines/wintermute/Base/file/BFile.h @@ -0,0 +1,65 @@ +/* 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" + +namespace Common { +class SeekableReadStream; +} + +namespace WinterMute { + +class CBFile : public CBBase { +public: + uint32 _pos; + uint32 _size; + virtual uint32 GetSize() { + return _size; + }; + virtual uint32 GetPos() { + return _pos; + }; + virtual HRESULT Seek(uint32 Pos, TSeek Origin = SEEK_TO_BEGIN) = 0; + virtual HRESULT Read(void *Buffer, uint32 Size) = 0; + virtual HRESULT Close() = 0; + virtual HRESULT 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..d1802f36a9 --- /dev/null +++ b/engines/wintermute/Base/file/BPkgFile.cpp @@ -0,0 +1,161 @@ +/* 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 { + +////////////////////////////////////////////////////////////////////////// +CBPkgFile::CBPkgFile(CBGame *inGame): CBFile(inGame) { + _fileEntry = NULL; + _file = NULL; + _compressed = false; + +} + +////////////////////////////////////////////////////////////////////////// +CBPkgFile::~CBPkgFile() { + Close(); +} + + +////////////////////////////////////////////////////////////////////////// +HRESULT CBPkgFile::Open(const Common::String &Filename) { + Close(); + + char fileName[MAX_PATH]; + strcpy(fileName, Filename.c_str()); + + // correct slashes + for (uint32 i = 0; i < strlen(fileName); i++) { + if (fileName[i] == '/') fileName[i] = '\\'; + } + + _fileEntry = Game->_fileManager->GetPackageEntry(fileName); + if (!_fileEntry) return E_FAIL; + + _file = _fileEntry->_package->GetFilePointer(); + if (!_file) return E_FAIL; + + // TODO: Cleanup + _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); + } + + SeekToPos(0); + + return S_OK; +} + + +////////////////////////////////////////////////////////////////////////// +HRESULT CBPkgFile::Close() { + if (_fileEntry) { + _fileEntry->_package->CloseFilePointer(_file); + _fileEntry = NULL; + } + _file = NULL; + + // TODO: Do we really need to take care of our position and size at all (or could (Safe)SubStreams fix that for us? + _pos = 0; + _size = 0; + + return S_OK; +} + + +////////////////////////////////////////////////////////////////////////// +HRESULT CBPkgFile::Read(void *Buffer, uint32 Size) { + if (!_fileEntry) return E_FAIL; + + HRESULT ret = S_OK; + + if (_pos + Size > _size) { + Size = _size - _pos; + if (Size == 0) return E_FAIL; + } + + ret = _file->read(Buffer, Size); + + _pos += Size; + + return ret; +} + + +////////////////////////////////////////////////////////////////////////// +HRESULT CBPkgFile::Seek(uint32 Pos, TSeek Origin) { + if (!_fileEntry) return E_FAIL; + + uint32 NewPos = 0; + + switch (Origin) { + case SEEK_TO_BEGIN: + NewPos = Pos; + break; + case SEEK_TO_END: + NewPos = _size + Pos; + break; + case SEEK_TO_CURRENT: + NewPos = _pos + Pos; + break; + } + + if (NewPos < 0 || NewPos > _size) return E_FAIL; + + return SeekToPos(NewPos); +} + + +#define STREAM_BUFFER_SIZE 4096 +////////////////////////////////////////////////////////////////////////// +HRESULT CBPkgFile::SeekToPos(uint32 NewPos) { + HRESULT ret = S_OK; + + // seek compressed stream to NewPos + _pos = NewPos; + return ret; +} + +} // 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..e4acdf1eb9 --- /dev/null +++ b/engines/wintermute/Base/file/BPkgFile.h @@ -0,0 +1,64 @@ +/* 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/file/BFile.h" +#include "engines/wintermute/Base/BFileEntry.h" +#include // Added by ClassView + +#define COMPRESSED_BUFFER_SIZE 4096 + +namespace Common { +class SeekableReadStream; +class File; +} + +namespace WinterMute { + +class CBPkgFile : public CBFile { +public: + CBPkgFile(CBGame *inGame); + virtual ~CBPkgFile(); + virtual HRESULT Seek(uint32 Pos, TSeek Origin = SEEK_TO_BEGIN); + virtual HRESULT Read(void *Buffer, uint32 Size); + virtual HRESULT Close(); + virtual HRESULT Open(const Common::String &Filename); +private: + bool _inflateInit; + HRESULT SeekToPos(uint32 NewPos); + bool _compressed; + CBFileEntry *_fileEntry; + Common::SeekableReadStream *_file; +}; + +} // end of namespace WinterMute + +#endif diff --git a/engines/wintermute/Base/file/BResourceFile.cpp b/engines/wintermute/Base/file/BResourceFile.cpp new file mode 100644 index 0000000000..8ec47f72c3 --- /dev/null +++ b/engines/wintermute/Base/file/BResourceFile.cpp @@ -0,0 +1,103 @@ +/* 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/BResourceFile.h" +#include "engines/wintermute/Base/BResources.h" + +namespace WinterMute { + +////////////////////////////////////////////////////////////////////////// +CBResourceFile::CBResourceFile(CBGame *inGame): CBFile(inGame) { + _data = NULL; +} + + +////////////////////////////////////////////////////////////////////////// +CBResourceFile::~CBResourceFile() { + Close(); +} + + +////////////////////////////////////////////////////////////////////////// +HRESULT CBResourceFile::Open(const Common::String &Filename) { + Close(); + + if (CBResources::GetFile(Filename.c_str(), _data, _size)) { + _pos = 0; + return S_OK; + } + return E_FAIL; +} + +////////////////////////////////////////////////////////////////////////// +HRESULT CBResourceFile::Close() { + _data = NULL; + _pos = 0; + _size = 0; + + return S_OK; +} + + +////////////////////////////////////////////////////////////////////////// +HRESULT CBResourceFile::Read(void *Buffer, uint32 Size) { + if (!_data || _pos + Size > _size) return E_FAIL; + + memcpy(Buffer, (byte *)_data + _pos, Size); + _pos += Size; + + return S_OK; +} + + +////////////////////////////////////////////////////////////////////////// +HRESULT CBResourceFile::Seek(uint32 Pos, TSeek Origin) { + if (!_data) return E_FAIL; + + int32 NewPos = 0; + + switch (Origin) { + case SEEK_TO_BEGIN: + NewPos = Pos; + break; + case SEEK_TO_END: + NewPos = _size + Pos; + break; + case SEEK_TO_CURRENT: + NewPos = _pos + Pos; + break; + } + + if (NewPos < 0 || NewPos > _size) return E_FAIL; + else _pos = NewPos; + + return S_OK; +} + +} // end of namespace WinterMute diff --git a/engines/wintermute/Base/file/BResourceFile.h b/engines/wintermute/Base/file/BResourceFile.h new file mode 100644 index 0000000000..77d8b629b1 --- /dev/null +++ b/engines/wintermute/Base/file/BResourceFile.h @@ -0,0 +1,50 @@ +/* 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_BRESOURCEFILE_H +#define WINTERMUTE_BRESOURCEFILE_H + +#include "engines/wintermute/Base/file/BFile.h" + +namespace WinterMute { + +class CBResourceFile : public CBFile { +public: + CBResourceFile(CBGame *inGame); + virtual ~CBResourceFile(); + virtual HRESULT Seek(uint32 Pos, TSeek Origin = SEEK_TO_BEGIN); + virtual HRESULT Read(void *Buffer, uint32 Size); + virtual HRESULT Close(); + virtual HRESULT Open(const Common::String &Filename); +private: + byte *_data; +}; + +} // 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..357a9606c7 --- /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(); +} + + +////////////////////////////////////////////////////////////////////////// +HRESULT CBSaveThumbFile::Open(const Common::String &Filename) { + Close(); + + if (scumm_strnicmp(Filename.c_str(), "savegame:", 9) != 0) return E_FAIL; + + char *TempFilename = new char[strlen(Filename.c_str()) - 8]; + strcpy(TempFilename, Filename.c_str() + 9); + for (int 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 + 1]; + Game->GetSaveSlotFilename(Slot, SlotFilename); + CBPersistMgr *pm = new CBPersistMgr(Game); + if (!pm) return E_FAIL; + + Game->_dEBUG_AbsolutePathWarning = false; + if (FAILED(pm->InitLoad(SlotFilename))) { + Game->_dEBUG_AbsolutePathWarning = true; + delete pm; + return E_FAIL; + } + Game->_dEBUG_AbsolutePathWarning = true; + + HRESULT res; + + if (pm->_thumbnailDataSize != 0) { + _data = new byte[pm->_thumbnailDataSize]; + memcpy(_data, pm->_thumbnailData, pm->_thumbnailDataSize); + _size = pm->_thumbnailDataSize; + res = S_OK; + } else res = E_FAIL; + delete pm; + + return res; +} + + +////////////////////////////////////////////////////////////////////////// +HRESULT CBSaveThumbFile::Close() { + delete[] _data; + _data = NULL; + + _pos = 0; + _size = 0; + + return S_OK; +} + + +////////////////////////////////////////////////////////////////////////// +HRESULT CBSaveThumbFile::Read(void *Buffer, uint32 Size) { + if (!_data || _pos + Size > _size) return E_FAIL; + + memcpy(Buffer, (byte *)_data + _pos, Size); + _pos += Size; + + return S_OK; +} + + +////////////////////////////////////////////////////////////////////////// +HRESULT CBSaveThumbFile::Seek(uint32 Pos, TSeek Origin) { + if (!_data) return E_FAIL; + + uint32 NewPos = 0; + + switch (Origin) { + case SEEK_TO_BEGIN: + NewPos = Pos; + break; + case SEEK_TO_END: + NewPos = _size + Pos; + break; + case SEEK_TO_CURRENT: + NewPos = _pos + Pos; + break; + } + + if (NewPos < 0 || NewPos > _size) return E_FAIL; + else _pos = NewPos; + + return S_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..0531d6a873 --- /dev/null +++ b/engines/wintermute/Base/file/BSaveThumbFile.h @@ -0,0 +1,51 @@ +/* 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 { + +class CBSaveThumbFile : public CBFile { +public: + CBSaveThumbFile(CBGame *Game); + virtual ~CBSaveThumbFile(); + virtual HRESULT Seek(uint32 Pos, TSeek Origin = SEEK_TO_BEGIN); + virtual HRESULT Read(void *Buffer, uint32 Size); + virtual HRESULT Close(); + virtual HRESULT Open(const Common::String &Filename); +private: + byte *_data; +}; + +} // end of namespace WinterMute + +#endif diff --git a/engines/wintermute/Base/scriptables/SXFile.cpp b/engines/wintermute/Base/scriptables/SXFile.cpp index 7761246ed6..ebdb436235 100644 --- a/engines/wintermute/Base/scriptables/SXFile.cpp +++ b/engines/wintermute/Base/scriptables/SXFile.cpp @@ -33,7 +33,7 @@ #include "engines/wintermute/Base/scriptables/ScScript.h" #include "engines/wintermute/utils/utils.h" #include "engines/wintermute/Base/BGame.h" -#include "engines/wintermute/Base/BFile.h" +#include "engines/wintermute/Base/file/BFile.h" #include "engines/wintermute/Base/BFileManager.h" #include "engines/wintermute/PlatformSDL.h" #include "engines/wintermute/Base/scriptables/SXFile.h" diff --git a/engines/wintermute/module.mk b/engines/wintermute/module.mk index 59caef82b1..47c41be5cc 100644 --- a/engines/wintermute/module.mk +++ b/engines/wintermute/module.mk @@ -40,13 +40,16 @@ MODULE_OBJS := \ Base/scriptables/SXMemBuffer.o \ Base/scriptables/SXStore.o \ Base/scriptables/SXString.o \ + Base/file/BDiskFile.o \ + Base/file/BFile.o \ + Base/file/BResourceFile.o \ + Base/file/BSaveThumbFile.o \ + Base/file/BPkgFile.o \ Base/BActiveRect.o \ Base/BBase.o \ Base/BDebugger.o \ - Base/BDiskFile.o \ Base/BDynBuffer.o \ Base/BFader.o \ - Base/BFile.o \ Base/BFileEntry.o \ Base/BFileManager.o \ Base/BGame.o \ @@ -62,7 +65,6 @@ MODULE_OBJS := \ Base/BPackage.o \ Base/BParser.o \ Base/BPersistMgr.o \ - Base/BPkgFile.o \ Base/BPoint.o \ Base/BQuickMsg.o \ Base/BRegion.o \ @@ -70,8 +72,6 @@ MODULE_OBJS := \ Base/BRenderer.o \ Base/BRenderSDL.o \ Base/BResources.o \ - Base/BResourceFile.o \ - Base/BSaveThumbFile.o \ Base/BSaveThumbHelper.o \ Base/BScriptable.o \ Base/BScriptHolder.o \ diff --git a/engines/wintermute/video/VidTheoraPlayer.h b/engines/wintermute/video/VidTheoraPlayer.h index 38f3fe85ae..9766988656 100644 --- a/engines/wintermute/video/VidTheoraPlayer.h +++ b/engines/wintermute/video/VidTheoraPlayer.h @@ -21,7 +21,7 @@ #define WINTERMUTE_VIDTHEORAPLAYER_H #include "engines/wintermute/Base/BBase.h" -#include "engines/wintermute/Base/BFile.h" +#include "engines/wintermute/Base/file/BFile.h" #include "engines/wintermute/Base/BSurface.h" #include "engines/wintermute/Base/BImage.h" //#include -- cgit v1.2.3