aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/math/regionregistry.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sword25/math/regionregistry.h')
-rw-r--r--engines/sword25/math/regionregistry.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/engines/sword25/math/regionregistry.h b/engines/sword25/math/regionregistry.h
index 78c2c08fc3..560d4ae4a9 100644
--- a/engines/sword25/math/regionregistry.h
+++ b/engines/sword25/math/regionregistry.h
@@ -35,7 +35,8 @@
#ifndef SWORD25_REGIONREGISTRY_H
#define SWORD25_REGIONREGISTRY_H
-#include "common/ptr.h"
+#include "common/singleton.h"
+
#include "sword25/kernel/common.h"
#include "sword25/kernel/persistable.h"
#include "sword25/kernel/objectregistry.h"
@@ -44,21 +45,17 @@ namespace Sword25 {
class Region;
-class RegionRegistry : public ObjectRegistry<Region>, public Persistable {
+class RegionRegistry :
+ public ObjectRegistry<Region>,
+ public Persistable,
+ public Common::Singleton<RegionRegistry> {
public:
- static RegionRegistry &instance() {
- if (!_instancePtr.get()) _instancePtr = Common::SharedPtr<RegionRegistry>(new RegionRegistry());
- return *_instancePtr.get();
- }
-
virtual bool persist(OutputPersistenceBlock &writer);
virtual bool unpersist(InputPersistenceBlock &reader);
private:
virtual void logErrorLn(const char *message) const;
virtual void logWarningLn(const char *message) const;
-
- static Common::SharedPtr<RegionRegistry> _instancePtr;
};
} // End of namespace Sword25