From 6e628f59dcbbcdfbccfee569c20450dbb1b48523 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 20 Mar 2010 20:03:58 +0000 Subject: removed local scopedptr svn-id: r48335 --- engines/teenagent/detection.cpp | 42 +++-------------------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) (limited to 'engines') diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp index 7dd058d6b2..e3c99a432c 100644 --- a/engines/teenagent/detection.cpp +++ b/engines/teenagent/detection.cpp @@ -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,41 +76,6 @@ static const ADParams detectionParams = { #define MAX_SAVES 20 -//add it to ptr.h? -template -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: @@ -166,7 +130,7 @@ public: int slot; const char *ext = strrchr(file->c_str(), '.'); if (ext && (slot = atoi(ext + 1)) >= 0 && slot < MAX_SAVES) { - ScopedPtr in(g_system->getSavefileManager()->openForLoading(*file)); + Common::ScopedPtr in(g_system->getSavefileManager()->openForLoading(*file)); if (!in) continue; @@ -191,7 +155,7 @@ public: virtual SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const { Common::String filename = generateGameStateFileName(target, slot); - ScopedPtr in(g_system->getSavefileManager()->openForLoading(filename)); + Common::ScopedPtr in(g_system->getSavefileManager()->openForLoading(filename)); if (!in) return SaveStateDescriptor(); @@ -210,7 +174,7 @@ public: ssd.setDeletableFlag(true); //checking for the thumbnail - ScopedPtr thumb(new Graphics::Surface); + Common::ScopedPtr thumb(new Graphics::Surface); if (Graphics::loadThumbnail(*in, *thumb)) ssd.setThumbnail(thumb.release()); -- cgit v1.2.3