diff options
author | Max Horn | 2009-01-22 23:14:16 +0000 |
---|---|---|
committer | Max Horn | 2009-01-22 23:14:16 +0000 |
commit | 94bfe1aa6fc71872214784128461709a6e421eac (patch) | |
tree | 799d75db584e3d623bc875db929e8491a1b5df62 /backends/saves | |
parent | e260598bc9295d3c0ab6ea8eadc23a506e29af27 (diff) | |
download | scummvm-rg350-94bfe1aa6fc71872214784128461709a6e421eac.tar.gz scummvm-rg350-94bfe1aa6fc71872214784128461709a6e421eac.tar.bz2 scummvm-rg350-94bfe1aa6fc71872214784128461709a6e421eac.zip |
Get rid of the wrappers around the zlib stream wrapper wrappers ;)
svn-id: r36007
Diffstat (limited to 'backends/saves')
-rw-r--r-- | backends/saves/compressed/compressed-saves.cpp | 36 | ||||
-rw-r--r-- | backends/saves/compressed/compressed-saves.h | 53 | ||||
-rw-r--r-- | backends/saves/default/default-saves.cpp | 6 |
3 files changed, 3 insertions, 92 deletions
diff --git a/backends/saves/compressed/compressed-saves.cpp b/backends/saves/compressed/compressed-saves.cpp deleted file mode 100644 index 11cb1689cd..0000000000 --- a/backends/saves/compressed/compressed-saves.cpp +++ /dev/null @@ -1,36 +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. - * - * $URL$ - * $Id$ - * - */ - -#include "common/zlib.h" -#include "backends/saves/compressed/compressed-saves.h" - - -Common::InSaveFile *wrapInSaveFile(Common::InSaveFile *toBeWrapped) { - return Common::wrapCompressedReadStream(toBeWrapped); -} - -Common::OutSaveFile *wrapOutSaveFile(Common::OutSaveFile *toBeWrapped) { - return Common::wrapCompressedWriteStream(toBeWrapped); -} diff --git a/backends/saves/compressed/compressed-saves.h b/backends/saves/compressed/compressed-saves.h deleted file mode 100644 index 205c5db05b..0000000000 --- a/backends/saves/compressed/compressed-saves.h +++ /dev/null @@ -1,53 +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. - * - * $URL$ - * $Id$ - * - */ - -#ifndef BACKEND_SAVES_COMPRESSED_H -#define BACKEND_SAVES_COMPRESSED_H - -#include "common/savefile.h" - -/** - * Take an arbitrary InSaveFile and wrap it in a high level InSaveFile which - * provides transparent on-the-fly decompression support. - * Assumes the data it retrieves from the wrapped savefile to be either - * uncompressed or in gzip format. In the former case, the original - * savefile is returned unmodified (and in particular, not wrapped). - * - * It is safe to call this with a NULL parameter (in this case, NULL is - * returned). - */ -Common::InSaveFile *wrapInSaveFile(Common::InSaveFile *toBeWrapped); - -/** - * Take an arbitrary OutSaveFile and wrap it in a high level OutSaveFile which - * provides transparent on-the-fly compression support. - * The compressed data is written in the gzip format. - * - * It is safe to call this with a NULL parameter (in this case, NULL is - * returned). - */ -Common::OutSaveFile *wrapOutSaveFile(Common::OutSaveFile *toBeWrapped); - -#endif diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp index f5f321111b..b7949e3114 100644 --- a/backends/saves/default/default-saves.cpp +++ b/backends/saves/default/default-saves.cpp @@ -26,13 +26,13 @@ #if !defined(DISABLE_DEFAULT_SAVEFILEMANAGER) #include "backends/saves/default/default-saves.h" -#include "backends/saves/compressed/compressed-saves.h" #include "common/savefile.h" #include "common/util.h" #include "common/fs.h" #include "common/archive.h" #include "common/config-manager.h" +#include "common/zlib.h" #include <errno.h> // for removeSavefile() @@ -86,7 +86,7 @@ Common::InSaveFile *DefaultSaveFileManager::openForLoading(const char *filename) // Open the file for reading Common::SeekableReadStream *sf = file.openForReading(); - return wrapInSaveFile(sf); + return Common::wrapCompressedReadStream(sf); } Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const char *filename) { @@ -101,7 +101,7 @@ Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const char *filename) // Open the file for saving Common::WriteStream *sf = file.openForWriting(); - return wrapOutSaveFile(sf); + return Common::wrapCompressedWriteStream(sf); } bool DefaultSaveFileManager::removeSavefile(const char *filename) { |