[Scummvm-cvs-logs] SF.net SVN: scummvm:[47999] scummvm/trunk

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Mon Feb 8 18:48:44 CET 2010


Revision: 47999
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47999&view=rev
Author:   peres001
Date:     2010-02-08 17:48:35 +0000 (Mon, 08 Feb 2010)

Log Message:
-----------
Moved ArjFile to drascula.

Modified Paths:
--------------
    scummvm/trunk/common/unarj.cpp
    scummvm/trunk/common/unarj.h
    scummvm/trunk/engines/drascula/drascula.h
    scummvm/trunk/engines/drascula/module.mk

Added Paths:
-----------
    scummvm/trunk/engines/drascula/resource.cpp

Modified: scummvm/trunk/common/unarj.cpp
===================================================================
--- scummvm/trunk/common/unarj.cpp	2010-02-08 16:56:04 UTC (rev 47998)
+++ scummvm/trunk/common/unarj.cpp	2010-02-08 17:48:35 UTC (rev 47999)
@@ -819,26 +819,4 @@
 	return new Common::MemoryReadStream(uncompressedData, hdr->origSize, DisposeAfterUse::YES);	
 }
 
-#pragma mark ArjFile implementation
-
-ArjFile::ArjFile() {
-	_fallBack = false;
-}
-
-ArjFile::~ArjFile() {
-}
-
-void ArjFile::registerArchive(const String &filename) {
-	add(filename, new ArjArchive(filename));
-}
-
-SeekableReadStream *ArjFile::open(const Common::String &filename) {
-	if (_fallBack && SearchMan.hasFile(filename)) {
-		return SearchMan.createReadStreamForMember(filename);
-	}
-
-	return createReadStreamForMember(filename);
-}
-
-
 } // End of namespace Common

Modified: scummvm/trunk/common/unarj.h
===================================================================
--- scummvm/trunk/common/unarj.h	2010-02-08 16:56:04 UTC (rev 47998)
+++ scummvm/trunk/common/unarj.h	2010-02-08 17:48:35 UTC (rev 47999)
@@ -54,24 +54,6 @@
 	virtual SeekableReadStream *createReadStreamForMember(const String &name) const;
 };
 
-// TODO: Get rid of this class, by implementing an ArjArchive subclass of Common::Archive.
-// Then ArjFile can be substituted by a SearchSet full of ArjArchives plus SearchMan.
-class ArjFile : public SearchSet {
-public:
-	ArjFile();
-	~ArjFile();
-
-	void enableFallback(bool val) { _fallBack = val; }
-
-	void registerArchive(const String &filename);
-
-	SeekableReadStream *open(const Common::String &filename);
-
-private:
-	bool _fallBack;
-
-};
-
 } // End of namespace Common
 
 #endif

Modified: scummvm/trunk/engines/drascula/drascula.h
===================================================================
--- scummvm/trunk/engines/drascula/drascula.h	2010-02-08 16:56:04 UTC (rev 47998)
+++ scummvm/trunk/engines/drascula/drascula.h	2010-02-08 17:48:35 UTC (rev 47999)
@@ -36,6 +36,7 @@
 #include "common/events.h"
 #include "common/keyboard.h"
 #include "common/unarj.h"
+#include "common/archive.h"
 
 #include "sound/mixer.h"
 
@@ -251,6 +252,22 @@
 	byte charType;	// 0 - letters, 1 - signs, 2 - accented
 };
 
+class ArjFile : public Common::SearchSet {
+public:
+	ArjFile();
+	~ArjFile();
+
+	void enableFallback(bool val) { _fallBack = val; }
+
+	void registerArchive(const Common::String &filename);
+
+	Common::SeekableReadStream *open(const Common::String &filename);
+
+private:
+	bool _fallBack;
+
+};
+
 #define NUM_SAVES		10
 #define NUM_FLAGS		50
 #define DIF_MASK		55
@@ -365,7 +382,7 @@
 
 	byte cPal[768];
 
-	Common::ArjFile _arj;
+	ArjFile _arj;
 
 	int actorFrames[8];
 
@@ -754,6 +771,7 @@
 	void freeTexts(char **ptr);
 };
 
+
 } // End of namespace Drascula
 
 #endif /* DRASCULA_H */

Modified: scummvm/trunk/engines/drascula/module.mk
===================================================================
--- scummvm/trunk/engines/drascula/module.mk	2010-02-08 16:56:04 UTC (rev 47998)
+++ scummvm/trunk/engines/drascula/module.mk	2010-02-08 17:48:35 UTC (rev 47999)
@@ -10,6 +10,7 @@
 	interface.o \
 	objects.o \
 	palette.o \
+	resource.o \
 	rooms.o \
 	saveload.o \
 	sound.o \

Added: scummvm/trunk/engines/drascula/resource.cpp
===================================================================
--- scummvm/trunk/engines/drascula/resource.cpp	                        (rev 0)
+++ scummvm/trunk/engines/drascula/resource.cpp	2010-02-08 17:48:35 UTC (rev 47999)
@@ -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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "drascula/drascula.h"
+
+namespace Drascula {
+
+#pragma mark ArjFile implementation
+
+ArjFile::ArjFile() {
+	_fallBack = false;
+}
+
+ArjFile::~ArjFile() {
+}
+
+void ArjFile::registerArchive(const Common::String &filename) {
+	add(filename, new Common::ArjArchive(filename));
+}
+
+Common::SeekableReadStream *ArjFile::open(const Common::String &filename) {
+	if (_fallBack && SearchMan.hasFile(filename)) {
+		return SearchMan.createReadStreamForMember(filename);
+	}
+
+	return createReadStreamForMember(filename);
+}
+
+} // End of namespace Drascula
+


Property changes on: scummvm/trunk/engines/drascula/resource.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list