[Scummvm-cvs-logs] SF.net SVN: scummvm:[48335] scummvm/trunk/engines/teenagent/detection.cpp

megath at users.sourceforge.net megath at users.sourceforge.net
Sat Mar 20 21:03:59 CET 2010


Revision: 48335
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48335&view=rev
Author:   megath
Date:     2010-03-20 20:03:58 +0000 (Sat, 20 Mar 2010)

Log Message:
-----------
removed local scopedptr

Modified Paths:
--------------
    scummvm/trunk/engines/teenagent/detection.cpp

Modified: scummvm/trunk/engines/teenagent/detection.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/detection.cpp	2010-03-20 20:01:44 UTC (rev 48334)
+++ scummvm/trunk/engines/teenagent/detection.cpp	2010-03-20 20:03:58 UTC (rev 48335)
@@ -25,7 +25,6 @@
 #include "common/system.h"
 #include "common/savefile.h"
 #include "common/algorithm.h"
-#include "common/noncopyable.h"
 
 #include "base/plugins.h"
 
@@ -77,42 +76,7 @@
 
 #define MAX_SAVES 20
 
-//add it to ptr.h?
-template<typename T>
-class ScopedPtr : Common::NonCopyable {
-protected:
-	T *object;
 
-public:
-	typedef T ValueType;
-	typedef T *PointerType;
-
-	inline explicit ScopedPtr(T *o = 0): object(o) {}
-
-	inline T& operator*() const { return *object; }
-	inline T *operator->() const { return object; }
-	inline operator T*() const { return object; }
-	inline operator bool() const { return object != NULL; }
-
-	inline ~ScopedPtr() { 
-		delete object; 
-	}
-
-	inline void reset(T *o = 0) {
-		delete object;
-		object = o;
-	}
-
-	inline T *get() const { return object; }
-
-	inline T *release() {
-		T *r = object;
-		object = NULL;
-		return r;
-	}
-};
-
-
 class TeenAgentMetaEngine : public AdvancedMetaEngine {
 public:
 	TeenAgentMetaEngine() : AdvancedMetaEngine(detectionParams) {
@@ -166,7 +130,7 @@
 			int slot;
 			const char *ext = strrchr(file->c_str(), '.');
 			if (ext && (slot = atoi(ext + 1)) >= 0 && slot < MAX_SAVES) {
-				ScopedPtr<Common::InSaveFile> in(g_system->getSavefileManager()->openForLoading(*file));
+				Common::ScopedPtr<Common::InSaveFile> in(g_system->getSavefileManager()->openForLoading(*file));
 				if (!in)
 					continue;
 
@@ -191,7 +155,7 @@
 
 	virtual SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const {
 		Common::String filename = generateGameStateFileName(target, slot);
-		ScopedPtr<Common::InSaveFile> in(g_system->getSavefileManager()->openForLoading(filename));
+		Common::ScopedPtr<Common::InSaveFile> in(g_system->getSavefileManager()->openForLoading(filename));
 		if (!in)
 			return SaveStateDescriptor();
 
@@ -210,7 +174,7 @@
 		ssd.setDeletableFlag(true);
 
 		//checking for the thumbnail
-		ScopedPtr<Graphics::Surface> thumb(new Graphics::Surface);
+		Common::ScopedPtr<Graphics::Surface> thumb(new Graphics::Surface);
 		if (Graphics::loadThumbnail(*in, *thumb))
 			ssd.setThumbnail(thumb.release());
 


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