From 94bfe1aa6fc71872214784128461709a6e421eac Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 22 Jan 2009 23:14:16 +0000 Subject: Get rid of the wrappers around the zlib stream wrapper wrappers ;) svn-id: r36007 --- backends/module.mk | 1 - backends/platform/dc/vmsave.cpp | 6 +-- backends/saves/compressed/compressed-saves.cpp | 36 ----------------- backends/saves/compressed/compressed-saves.h | 53 -------------------------- backends/saves/default/default-saves.cpp | 6 +-- 5 files changed, 6 insertions(+), 96 deletions(-) delete mode 100644 backends/saves/compressed/compressed-saves.cpp delete mode 100644 backends/saves/compressed/compressed-saves.h (limited to 'backends') diff --git a/backends/module.mk b/backends/module.mk index e6e0ba1a2f..e14a949318 100644 --- a/backends/module.mk +++ b/backends/module.mk @@ -33,7 +33,6 @@ MODULE_OBJS := \ plugins/win32/win32-provider.o \ saves/savefile.o \ saves/default/default-saves.o \ - saves/compressed/compressed-saves.o \ saves/posix/posix-saves.o \ saves/psp/psp-saves.o \ timer/default/default-timer.o \ diff --git a/backends/platform/dc/vmsave.cpp b/backends/platform/dc/vmsave.cpp index 05b459f40f..f91ec63128 100644 --- a/backends/platform/dc/vmsave.cpp +++ b/backends/platform/dc/vmsave.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include // Savegame can not be bigger than this @@ -323,13 +323,13 @@ class VMSaveManager : public Common::SaveFileManager { public: virtual Common::OutSaveFile *openForSaving(const char *filename) { - return wrapOutSaveFile(new OutVMSave(filename)); + return Common::wrapCompressedWriteStream(new OutVMSave(filename)); } virtual Common::InSaveFile *openForLoading(const char *filename) { InVMSave *s = new InVMSave(); if (s->readSaveGame(filename)) { - return wrapInSaveFile(s); + return Common::wrapCompressedReadStream(s); } else { delete s; return NULL; 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 // 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) { -- cgit v1.2.3