diff options
author | Paul Gilbert | 2016-03-08 18:57:17 -0500 |
---|---|---|
committer | Paul Gilbert | 2016-03-08 18:57:17 -0500 |
commit | d1a29a1d1ad3ab60737f3a9a837907cd72562b63 (patch) | |
tree | 5b61f1cf755b20e1808e40ec1f78e06b1a13c313 | |
parent | 0645a3dbde92fe4fbd46895cf24470535b7245aa (diff) | |
download | scummvm-rg350-d1a29a1d1ad3ab60737f3a9a837907cd72562b63.tar.gz scummvm-rg350-d1a29a1d1ad3ab60737f3a9a837907cd72562b63.tar.bz2 scummvm-rg350-d1a29a1d1ad3ab60737f3a9a837907cd72562b63.zip |
TITANIC: Moved CompressedFile class into simple_file.h
One of the joys of working with ScummVM was that, using existing
Common functionality, the entirety of the original's CompressedFile
class could be reduced to a couple of lines. As such, CompressedFile
doesn't really need it's own seperate files anymore.
-rw-r--r-- | engines/titanic/compressed_file.cpp | 35 | ||||
-rw-r--r-- | engines/titanic/compressed_file.h | 56 | ||||
-rw-r--r-- | engines/titanic/core/project_item.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/core/saveable_object.h | 1 | ||||
-rw-r--r-- | engines/titanic/module.mk | 1 | ||||
-rw-r--r-- | engines/titanic/simple_file.h | 28 |
6 files changed, 27 insertions, 96 deletions
diff --git a/engines/titanic/compressed_file.cpp b/engines/titanic/compressed_file.cpp deleted file mode 100644 index 3db93522dc..0000000000 --- a/engines/titanic/compressed_file.cpp +++ /dev/null @@ -1,35 +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. - * - */ - -#include "titanic/compressed_file.h" - -namespace Titanic { - -void CompressedFile::open(Common::SeekableReadStream *stream) { - SimpleFile::open(Common::wrapCompressedReadStream(stream)); -} - -void CompressedFile::open(Common::OutSaveFile *stream) { - SimpleFile::open(Common::wrapCompressedWriteStream(stream)); -} - -} // End of namespace Titanic diff --git a/engines/titanic/compressed_file.h b/engines/titanic/compressed_file.h deleted file mode 100644 index 3be852f3b4..0000000000 --- a/engines/titanic/compressed_file.h +++ /dev/null @@ -1,56 +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. - * - */ - -#ifndef TITANIC_COMPRESSED_FILE_H -#define TITANIC_COMPRESSED_FILE_H - -#include "common/scummsys.h" -#include "common/file.h" -#include "common/memstream.h" -#include "common/zlib.h" -#include "titanic/simple_file.h" -#include "titanic/string.h" - -namespace Titanic { - -/** - * Derived file that handles compressed files - */ -class CompressedFile : public SimpleFile { -public: - CompressedFile() : SimpleFile() {} - virtual ~CompressedFile() {} - - /** - * Set up a stream for read access - */ - virtual void open(Common::SeekableReadStream *stream); - - /** - * Set up a stream for write access - */ - virtual void open(Common::OutSaveFile *stream); -}; - -} // End of namespace Titanic - -#endif /* TITANIC_COMPRESSED_FILE_H */ diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp index 2fa65f9e33..354e373a53 100644 --- a/engines/titanic/core/project_item.cpp +++ b/engines/titanic/core/project_item.cpp @@ -20,10 +20,10 @@ * */ +#include "common/file.h" #include "common/savefile.h" #include "titanic/game_manager.h" #include "titanic/titanic.h" -#include "titanic/compressed_file.h" #include "titanic/core/dont_save_file_item.h" #include "titanic/core/project_item.h" #include "titanic/pet_control/pet_control.h" diff --git a/engines/titanic/core/saveable_object.h b/engines/titanic/core/saveable_object.h index b15dd13072..c4615c52b2 100644 --- a/engines/titanic/core/saveable_object.h +++ b/engines/titanic/core/saveable_object.h @@ -26,6 +26,7 @@ #include "common/scummsys.h" #include "common/array.h" #include "common/hash-str.h" +#include "common/list.h" #include "titanic/simple_file.h" namespace Titanic { diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk index b9f5b641ed..6309ac8d8f 100644 --- a/engines/titanic/module.mk +++ b/engines/titanic/module.mk @@ -1,7 +1,6 @@ MODULE := engines/titanic MODULE_OBJS := \ - compressed_file.o \ detection.o \ direct_draw.o \ font.o \ diff --git a/engines/titanic/simple_file.h b/engines/titanic/simple_file.h index 4426380966..cc68d2d54c 100644 --- a/engines/titanic/simple_file.h +++ b/engines/titanic/simple_file.h @@ -23,11 +23,10 @@ #ifndef TITANIC_SIMPLE_FILE_H #define TITANIC_SIMPLE_FILE_H -#include "common/scummsys.h" -#include "common/file.h" -#include "common/queue.h" #include "common/rect.h" #include "common/savefile.h" +#include "common/stream.h" +#include "common/zlib.h" #include "titanic/string.h" namespace Titanic { @@ -180,6 +179,29 @@ public: void writeClassEnd(int indent); }; +/** + * Derived file that handles compressed files + */ +class CompressedFile : public SimpleFile { +public: + CompressedFile() : SimpleFile() {} + virtual ~CompressedFile() {} + + /** + * Set up a stream for read access + */ + virtual void open(Common::SeekableReadStream *stream) { + SimpleFile::open(Common::wrapCompressedReadStream(stream)); + } + + /** + * Set up a stream for write access + */ + virtual void open(Common::OutSaveFile *stream) { + SimpleFile::open(Common::wrapCompressedWriteStream(stream)); + } +}; + } // End of namespace Titanic #endif /* TITANIC_SIMPLE_FILE_H */ |