diff options
author | Max Horn | 2010-10-13 15:41:00 +0000 |
---|---|---|
committer | Max Horn | 2010-10-13 15:41:00 +0000 |
commit | 8f4f0d16fc4e5cd4803203f2aaeb0ddc99e57204 (patch) | |
tree | b39380c6702b11d88ba2b95d7d0db9fc9afd62d9 /engines/sword25/math | |
parent | 17f9913a2419c558276a191be07a45ba8f8fc87f (diff) | |
download | scummvm-rg350-8f4f0d16fc4e5cd4803203f2aaeb0ddc99e57204.tar.gz scummvm-rg350-8f4f0d16fc4e5cd4803203f2aaeb0ddc99e57204.tar.bz2 scummvm-rg350-8f4f0d16fc4e5cd4803203f2aaeb0ddc99e57204.zip |
SWORD25: Renamed getInstance() -> instance()
svn-id: r53430
Diffstat (limited to 'engines/sword25/math')
-rw-r--r-- | engines/sword25/math/geometry_script.cpp | 10 | ||||
-rw-r--r-- | engines/sword25/math/region.cpp | 10 | ||||
-rw-r--r-- | engines/sword25/math/regionregistry.h | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/engines/sword25/math/geometry_script.cpp b/engines/sword25/math/geometry_script.cpp index dac766927b..b96fe90e66 100644 --- a/engines/sword25/math/geometry_script.cpp +++ b/engines/sword25/math/geometry_script.cpp @@ -205,7 +205,7 @@ static uint tableRegionToRegion(lua_State *L, const char *className) { case LUA_TNUMBER: { Polygon polygon; tablePolygonToPolygon(L, polygon); - RegionRegistry::getInstance().resolveHandle(regionHandle)->init(polygon); + RegionRegistry::instance().resolveHandle(regionHandle)->init(polygon); } break; @@ -217,7 +217,7 @@ static uint tableRegionToRegion(lua_State *L, const char *className) { int polygonCount = luaL_getn(L, -1); if (polygonCount == 1) - RegionRegistry::getInstance().resolveHandle(regionHandle)->init(polygon); + RegionRegistry::instance().resolveHandle(regionHandle)->init(polygon); else { Common::Array<Polygon> holes; holes.reserve(polygonCount - 1); @@ -230,7 +230,7 @@ static uint tableRegionToRegion(lua_State *L, const char *className) { } BS_ASSERT((int)holes.size() == polygonCount - 1); - RegionRegistry::getInstance().resolveHandle(regionHandle)->init(polygon, &holes); + RegionRegistry::instance().resolveHandle(regionHandle)->init(polygon, &holes); } } break; @@ -283,7 +283,7 @@ static Region *checkRegion(lua_State *L) { uint *regionHandlePtr; if ((regionHandlePtr = reinterpret_cast<uint *>(my_checkudata(L, 1, REGION_CLASS_NAME))) != 0 || (regionHandlePtr = reinterpret_cast<uint *>(my_checkudata(L, 1, WALKREGION_CLASS_NAME))) != 0) { - return RegionRegistry::getInstance().resolveHandle(*regionHandlePtr); + return RegionRegistry::instance().resolveHandle(*regionHandlePtr); } else { luaL_argcheck(L, 0, 1, "'" REGION_CLASS_NAME "' expected"); } @@ -436,7 +436,7 @@ static WalkRegion *checkWalkRegion(lua_State *L) { // The first parameter must be of type 'userdate', and the Metatable class Geo.WalkRegion uint regionHandle; if ((regionHandle = *reinterpret_cast<uint *>(my_checkudata(L, 1, WALKREGION_CLASS_NAME))) != 0) { - return reinterpret_cast<WalkRegion *>(RegionRegistry::getInstance().resolveHandle(regionHandle)); + return reinterpret_cast<WalkRegion *>(RegionRegistry::instance().resolveHandle(regionHandle)); } else { luaL_argcheck(L, 0, 1, "'" WALKREGION_CLASS_NAME "' expected"); } diff --git a/engines/sword25/math/region.cpp b/engines/sword25/math/region.cpp index 454f90a8ba..ae9b76d077 100644 --- a/engines/sword25/math/region.cpp +++ b/engines/sword25/math/region.cpp @@ -44,11 +44,11 @@ namespace Sword25 { Region::Region() : _valid(false), _type(RT_REGION) { - RegionRegistry::getInstance().registerObject(this); + RegionRegistry::instance().registerObject(this); } Region::Region(InputPersistenceBlock &reader, uint handle) : _valid(false), _type(RT_REGION) { - RegionRegistry::getInstance().registerObject(this, handle); + RegionRegistry::instance().registerObject(this, handle); unpersist(reader); } @@ -67,7 +67,7 @@ uint Region::create(REGION_TYPE type) { BS_ASSERT(true); } - return RegionRegistry::getInstance().resolvePtr(regionPtr); + return RegionRegistry::instance().resolvePtr(regionPtr); } uint Region::create(InputPersistenceBlock &reader, uint handle) { @@ -85,11 +85,11 @@ uint Region::create(InputPersistenceBlock &reader, uint handle) { BS_ASSERT(false); } - return RegionRegistry::getInstance().resolvePtr(regionPtr); + return RegionRegistry::instance().resolvePtr(regionPtr); } Region::~Region() { - RegionRegistry::getInstance().deregisterObject(this); + RegionRegistry::instance().deregisterObject(this); } bool Region::init(const Polygon &contour, const Common::Array<Polygon> *pHoles) { diff --git a/engines/sword25/math/regionregistry.h b/engines/sword25/math/regionregistry.h index bbe2fb8370..78c2c08fc3 100644 --- a/engines/sword25/math/regionregistry.h +++ b/engines/sword25/math/regionregistry.h @@ -46,7 +46,7 @@ class Region; class RegionRegistry : public ObjectRegistry<Region>, public Persistable { public: - static RegionRegistry &getInstance() { + static RegionRegistry &instance() { if (!_instancePtr.get()) _instancePtr = Common::SharedPtr<RegionRegistry>(new RegionRegistry()); return *_instancePtr.get(); } |