aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorVladimir Menshakov2010-03-20 20:03:58 +0000
committerVladimir Menshakov2010-03-20 20:03:58 +0000
commit6e628f59dcbbcdfbccfee569c20450dbb1b48523 (patch)
tree75fba52a69c154d107e8e76edeb0cfbf709eab8e /engines
parentabdfbafa45bb65f7ce315a04411d1a8ffb9e5d50 (diff)
downloadscummvm-rg350-6e628f59dcbbcdfbccfee569c20450dbb1b48523.tar.gz
scummvm-rg350-6e628f59dcbbcdfbccfee569c20450dbb1b48523.tar.bz2
scummvm-rg350-6e628f59dcbbcdfbccfee569c20450dbb1b48523.zip
removed local scopedptr
svn-id: r48335
Diffstat (limited to 'engines')
-rw-r--r--engines/teenagent/detection.cpp42
1 files changed, 3 insertions, 39 deletions
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<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:
@@ -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<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 @@ public:
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 @@ public:
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());