[Scummvm-cvs-logs] SF.net SVN: scummvm:[53430] scummvm/trunk/engines/sword25
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Wed Oct 13 17:41:01 CEST 2010
Revision: 53430
http://scummvm.svn.sourceforge.net/scummvm/?rev=53430&view=rev
Author: fingolfin
Date: 2010-10-13 15:41:00 +0000 (Wed, 13 Oct 2010)
Log Message:
-----------
SWORD25: Renamed getInstance() -> instance()
Modified Paths:
--------------
scummvm/trunk/engines/sword25/gfx/animation.cpp
scummvm/trunk/engines/sword25/gfx/animationtemplate.cpp
scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.h
scummvm/trunk/engines/sword25/gfx/graphicengine_script.cpp
scummvm/trunk/engines/sword25/gfx/renderobject.cpp
scummvm/trunk/engines/sword25/gfx/renderobjectmanager.cpp
scummvm/trunk/engines/sword25/gfx/renderobjectptr.h
scummvm/trunk/engines/sword25/gfx/renderobjectregistry.h
scummvm/trunk/engines/sword25/input/inputengine.cpp
scummvm/trunk/engines/sword25/input/inputengine_script.cpp
scummvm/trunk/engines/sword25/kernel/callbackregistry.h
scummvm/trunk/engines/sword25/kernel/filesystemutil.h
scummvm/trunk/engines/sword25/kernel/persistenceservice.cpp
scummvm/trunk/engines/sword25/math/geometry_script.cpp
scummvm/trunk/engines/sword25/math/region.cpp
scummvm/trunk/engines/sword25/math/regionregistry.h
Modified: scummvm/trunk/engines/sword25/gfx/animation.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animation.cpp 2010-10-13 15:06:14 UTC (rev 53429)
+++ scummvm/trunk/engines/sword25/gfx/animation.cpp 2010-10-13 15:41:00 UTC (rev 53430)
@@ -583,7 +583,7 @@
// Alle Callbacks einzeln persistieren.
Common::Array<ANIMATION_CALLBACK_DATA>::const_iterator it = vector.begin();
while (it != vector.end()) {
- writer.write(CallbackRegistry::getInstance().resolveCallbackPointer((void (*)(int))it->Callback));
+ writer.write(CallbackRegistry::instance().resolveCallbackPointer((void (*)(int))it->Callback));
writer.write(it->Data);
++it;
@@ -604,7 +604,7 @@
Common::String callbackFunctionName;
reader.read(callbackFunctionName);
- callbackData.Callback = reinterpret_cast<ANIMATION_CALLBACK>(CallbackRegistry::getInstance().resolveCallbackFunction(callbackFunctionName));
+ callbackData.Callback = reinterpret_cast<ANIMATION_CALLBACK>(CallbackRegistry::instance().resolveCallbackFunction(callbackFunctionName));
reader.read(callbackData.Data);
@@ -705,7 +705,7 @@
if (_animationResourcePtr)
return _animationResourcePtr;
else
- return AnimationTemplateRegistry::getInstance().resolveHandle(_animationTemplateHandle);
+ return AnimationTemplateRegistry::instance().resolveHandle(_animationTemplateHandle);
}
} // End of namespace Sword25
Modified: scummvm/trunk/engines/sword25/gfx/animationtemplate.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationtemplate.cpp 2010-10-13 15:06:14 UTC (rev 53429)
+++ scummvm/trunk/engines/sword25/gfx/animationtemplate.cpp 2010-10-13 15:41:00 UTC (rev 53430)
@@ -49,7 +49,7 @@
AnimationTemplate *animationTemplatePtr = new AnimationTemplate(sourceAnimation);
if (animationTemplatePtr->isValid()) {
- return AnimationTemplateRegistry::getInstance().resolvePtr(animationTemplatePtr);
+ return AnimationTemplateRegistry::instance().resolvePtr(animationTemplatePtr);
} else {
delete animationTemplatePtr;
return 0;
@@ -60,7 +60,7 @@
AnimationTemplate *animationTemplatePtr = new AnimationTemplate(other);
if (animationTemplatePtr->isValid()) {
- return AnimationTemplateRegistry::getInstance().resolvePtr(animationTemplatePtr);
+ return AnimationTemplateRegistry::instance().resolvePtr(animationTemplatePtr);
} else {
delete animationTemplatePtr;
return 0;
@@ -71,7 +71,7 @@
AnimationTemplate *animationTemplatePtr = new AnimationTemplate(reader, handle);
if (animationTemplatePtr->isValid()) {
- return AnimationTemplateRegistry::getInstance().resolvePtr(animationTemplatePtr);
+ return AnimationTemplateRegistry::instance().resolvePtr(animationTemplatePtr);
} else {
delete animationTemplatePtr;
return 0;
@@ -80,7 +80,7 @@
AnimationTemplate::AnimationTemplate(const Common::String &sourceAnimation) {
// Objekt registrieren.
- AnimationTemplateRegistry::getInstance().registerObject(this);
+ AnimationTemplateRegistry::instance().registerObject(this);
_valid = false;
@@ -93,7 +93,7 @@
AnimationTemplate::AnimationTemplate(const AnimationTemplate &other) : AnimationDescription() {
// Objekt registrieren.
- AnimationTemplateRegistry::getInstance().registerObject(this);
+ AnimationTemplateRegistry::instance().registerObject(this);
_valid = false;
@@ -118,7 +118,7 @@
AnimationTemplate::AnimationTemplate(InputPersistenceBlock &reader, uint handle) {
// Objekt registrieren.
- AnimationTemplateRegistry::getInstance().registerObject(this, handle);
+ AnimationTemplateRegistry::instance().registerObject(this, handle);
// Objekt laden.
_valid = unpersist(reader);
@@ -141,7 +141,7 @@
}
// Objekt deregistrieren
- AnimationTemplateRegistry::getInstance().deregisterObject(this);
+ AnimationTemplateRegistry::instance().deregisterObject(this);
}
void AnimationTemplate::addFrame(int index) {
Modified: scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.h 2010-10-13 15:06:14 UTC (rev 53429)
+++ scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.h 2010-10-13 15:41:00 UTC (rev 53430)
@@ -47,7 +47,7 @@
class AnimationTemplateRegistry : public ObjectRegistry<AnimationTemplate>, public Persistable {
public:
- static AnimationTemplateRegistry &getInstance() {
+ static AnimationTemplateRegistry &instance() {
if (!_instancePtr.get())
_instancePtr.reset(new AnimationTemplateRegistry);
return *_instancePtr.get();
Modified: scummvm/trunk/engines/sword25/gfx/graphicengine_script.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/graphicengine_script.cpp 2010-10-13 15:06:14 UTC (rev 53429)
+++ scummvm/trunk/engines/sword25/gfx/graphicengine_script.cpp 2010-10-13 15:41:00 UTC (rev 53430)
@@ -88,9 +88,9 @@
struct CallbackfunctionRegisterer {
CallbackfunctionRegisterer() {
- CallbackRegistry::getInstance().registerCallbackFunction("LuaLoopPointCB", (void ( *)(int))AnimationLoopPointCallback);
- CallbackRegistry::getInstance().registerCallbackFunction("LuaActionCB", (void ( *)(int))AnimationActionCallback);
- CallbackRegistry::getInstance().registerCallbackFunction("LuaDeleteCB", (void ( *)(int))AnimationDeleteCallback);
+ CallbackRegistry::instance().registerCallbackFunction("LuaLoopPointCB", (void ( *)(int))AnimationLoopPointCallback);
+ CallbackRegistry::instance().registerCallbackFunction("LuaActionCB", (void ( *)(int))AnimationActionCallback);
+ CallbackRegistry::instance().registerCallbackFunction("LuaDeleteCB", (void ( *)(int))AnimationDeleteCallback);
}
};
static CallbackfunctionRegisterer Instance;
@@ -144,7 +144,7 @@
// Der erste Parameter muss vom Typ userdata sein und die Metatable der Klasse Gfx.AnimationTemplate
uint AnimationTemplateHandle;
if ((AnimationTemplateHandle = *reinterpret_cast<uint *>(my_checkudata(L, idx, ANIMATION_TEMPLATE_CLASS_NAME))) != 0) {
- AnimationTemplate *AnimationTemplatePtr = AnimationTemplateRegistry::getInstance().resolveHandle(AnimationTemplateHandle);
+ AnimationTemplate *AnimationTemplatePtr = AnimationTemplateRegistry::instance().resolveHandle(AnimationTemplateHandle);
if (!AnimationTemplatePtr)
luaL_error(L, "The animation template with the handle %d does no longer exist.", AnimationTemplateHandle);
return AnimationTemplatePtr;
@@ -159,7 +159,7 @@
static int NewAnimationTemplate(lua_State *L) {
uint AnimationTemplateHandle = AnimationTemplate::create(luaL_checkstring(L, 1));
- AnimationTemplate *AnimationTemplatePtr = AnimationTemplateRegistry::getInstance().resolveHandle(AnimationTemplateHandle);
+ AnimationTemplate *AnimationTemplatePtr = AnimationTemplateRegistry::instance().resolveHandle(AnimationTemplateHandle);
if (AnimationTemplatePtr && AnimationTemplatePtr->isValid()) {
NewUintUserData(L, AnimationTemplateHandle);
//luaL_getmetatable(L, ANIMATION_TEMPLATE_CLASS_NAME);
Modified: scummvm/trunk/engines/sword25/gfx/renderobject.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/renderobject.cpp 2010-10-13 15:06:14 UTC (rev 53429)
+++ scummvm/trunk/engines/sword25/gfx/renderobject.cpp 2010-10-13 15:41:00 UTC (rev 53430)
@@ -76,9 +76,9 @@
// Renderobject registrieren, abh\xE4ngig vom Handle-Parameter entweder mit beliebigem oder vorgegebenen Handle.
if (handle == 0)
- _handle = RenderObjectRegistry::getInstance().registerObject(this);
+ _handle = RenderObjectRegistry::instance().registerObject(this);
else
- _handle = RenderObjectRegistry::getInstance().registerObject(this, handle);
+ _handle = RenderObjectRegistry::instance().registerObject(this, handle);
if (_handle == 0)
return;
@@ -110,7 +110,7 @@
deleteAllChildren();
// Objekt deregistrieren.
- RenderObjectRegistry::getInstance().deregisterObject(this);
+ RenderObjectRegistry::instance().deregisterObject(this);
}
// Rendern
Modified: scummvm/trunk/engines/sword25/gfx/renderobjectmanager.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/renderobjectmanager.cpp 2010-10-13 15:06:14 UTC (rev 53429)
+++ scummvm/trunk/engines/sword25/gfx/renderobjectmanager.cpp 2010-10-13 15:41:00 UTC (rev 53430)
@@ -113,7 +113,7 @@
}
// Alle BS_AnimationTemplates persistieren.
- result &= AnimationTemplateRegistry::getInstance().persist(writer);
+ result &= AnimationTemplateRegistry::instance().persist(writer);
return result;
}
@@ -143,7 +143,7 @@
}
// Alle BS_AnimationTemplates wieder herstellen.
- result &= AnimationTemplateRegistry::getInstance().unpersist(reader);
+ result &= AnimationTemplateRegistry::instance().unpersist(reader);
return result;
}
Modified: scummvm/trunk/engines/sword25/gfx/renderobjectptr.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/renderobjectptr.h 2010-10-13 15:06:14 UTC (rev 53429)
+++ scummvm/trunk/engines/sword25/gfx/renderobjectptr.h 2010-10-13 15:41:00 UTC (rev 53430)
@@ -54,7 +54,7 @@
RenderObjectPtr(uint handle) : _handle(handle) {}
T *operator->() const {
- return static_cast<T *>(RenderObjectRegistry::getInstance().resolveHandle(_handle));
+ return static_cast<T *>(RenderObjectRegistry::instance().resolveHandle(_handle));
}
bool operator==(const RenderObjectPtr<T> & other) {
@@ -62,11 +62,11 @@
}
bool isValid() const {
- return RenderObjectRegistry::getInstance().resolveHandle(_handle) != 0;
+ return RenderObjectRegistry::instance().resolveHandle(_handle) != 0;
}
void erase() {
- delete static_cast<T *>(RenderObjectRegistry::getInstance().resolveHandle(_handle));
+ delete static_cast<T *>(RenderObjectRegistry::instance().resolveHandle(_handle));
_handle = 0;
}
Modified: scummvm/trunk/engines/sword25/gfx/renderobjectregistry.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/renderobjectregistry.h 2010-10-13 15:06:14 UTC (rev 53429)
+++ scummvm/trunk/engines/sword25/gfx/renderobjectregistry.h 2010-10-13 15:41:00 UTC (rev 53430)
@@ -58,7 +58,7 @@
class RenderObjectRegistry : public ObjectRegistry<RenderObject> {
public:
- static RenderObjectRegistry &getInstance() {
+ static RenderObjectRegistry &instance() {
if (!_instancePtr.get())
_instancePtr.reset(new RenderObjectRegistry);
return *_instancePtr.get();
Modified: scummvm/trunk/engines/sword25/input/inputengine.cpp
===================================================================
--- scummvm/trunk/engines/sword25/input/inputengine.cpp 2010-10-13 15:06:14 UTC (rev 53429)
+++ scummvm/trunk/engines/sword25/input/inputengine.cpp 2010-10-13 15:41:00 UTC (rev 53430)
@@ -339,7 +339,7 @@
{
Common::List<CommandCallback>::const_iterator It = m_CommandCallbacks.begin();
while (It != m_CommandCallbacks.end()) {
- writer.write(CallbackRegistry::getInstance().resolveCallbackPointer(*It));
+ writer.write(CallbackRegistry::instance().resolveCallbackPointer(*It));
++It;
}
}
@@ -351,7 +351,7 @@
{
Common::List<CharacterCallback>::const_iterator It = m_CharacterCallbacks.begin();
while (It != m_CharacterCallbacks.end()) {
- writer.write(CallbackRegistry::getInstance().resolveCallbackPointer(*It));
+ writer.write(CallbackRegistry::instance().resolveCallbackPointer(*It));
++It;
}
}
@@ -375,7 +375,7 @@
reader.read(CallbackFunctionName);
m_CommandCallbacks.push_back(reinterpret_cast<CommandCallback>(
- CallbackRegistry::getInstance().resolveCallbackFunction(CallbackFunctionName)));
+ CallbackRegistry::instance().resolveCallbackFunction(CallbackFunctionName)));
}
// Character-Callbackliste leeren.
@@ -390,7 +390,7 @@
Common::String CallbackFunctionName;
reader.read(CallbackFunctionName);
- m_CharacterCallbacks.push_back(reinterpret_cast<CharacterCallback>(CallbackRegistry::getInstance().resolveCallbackFunction(CallbackFunctionName)));
+ m_CharacterCallbacks.push_back(reinterpret_cast<CharacterCallback>(CallbackRegistry::instance().resolveCallbackFunction(CallbackFunctionName)));
}
return reader.isGood();
Modified: scummvm/trunk/engines/sword25/input/inputengine_script.cpp
===================================================================
--- scummvm/trunk/engines/sword25/input/inputengine_script.cpp 2010-10-13 15:06:14 UTC (rev 53429)
+++ scummvm/trunk/engines/sword25/input/inputengine_script.cpp 2010-10-13 15:41:00 UTC (rev 53430)
@@ -97,8 +97,8 @@
struct CallbackfunctionRegisterer {
CallbackfunctionRegisterer() {
- CallbackRegistry::getInstance().registerCallbackFunction("LuaCommandCB", TheCommandCallback);
- CallbackRegistry::getInstance().registerCallbackFunction("LuaCharacterCB", TheCharacterCallback);
+ CallbackRegistry::instance().registerCallbackFunction("LuaCommandCB", TheCommandCallback);
+ CallbackRegistry::instance().registerCallbackFunction("LuaCharacterCB", TheCharacterCallback);
}
};
static CallbackfunctionRegisterer Instance;
Modified: scummvm/trunk/engines/sword25/kernel/callbackregistry.h
===================================================================
--- scummvm/trunk/engines/sword25/kernel/callbackregistry.h 2010-10-13 15:06:14 UTC (rev 53429)
+++ scummvm/trunk/engines/sword25/kernel/callbackregistry.h 2010-10-13 15:41:00 UTC (rev 53430)
@@ -55,7 +55,7 @@
class CallbackRegistry {
public:
- static CallbackRegistry &getInstance() {
+ static CallbackRegistry &instance() {
static CallbackRegistry _instance;
return _instance;
}
Modified: scummvm/trunk/engines/sword25/kernel/filesystemutil.h
===================================================================
--- scummvm/trunk/engines/sword25/kernel/filesystemutil.h 2010-10-13 15:06:14 UTC (rev 53429)
+++ scummvm/trunk/engines/sword25/kernel/filesystemutil.h 2010-10-13 15:41:00 UTC (rev 53430)
@@ -38,7 +38,7 @@
* operations that do not have equivalents in the C/C++ libraries.
*
* Each supported platform must implement this interface, and the method
- * BS_FileSystemUtil Singleton::getInstance()
+ * BS_FileSystemUtil Singleton::instance()
*/
#ifndef SWORD25_FILESYSTEMUTIL_H
Modified: scummvm/trunk/engines/sword25/kernel/persistenceservice.cpp
===================================================================
--- scummvm/trunk/engines/sword25/kernel/persistenceservice.cpp 2010-10-13 15:06:14 UTC (rev 53429)
+++ scummvm/trunk/engines/sword25/kernel/persistenceservice.cpp 2010-10-13 15:41:00 UTC (rev 53430)
@@ -326,7 +326,7 @@
OutputPersistenceBlock Writer;
bool Success = true;
Success &= Kernel::GetInstance()->GetScript()->persist(Writer);
- Success &= RegionRegistry::getInstance().persist(Writer);
+ Success &= RegionRegistry::instance().persist(Writer);
Success &= Kernel::GetInstance()->GetGfx()->persist(Writer);
Success &= Kernel::GetInstance()->GetSfx()->persist(Writer);
Success &= Kernel::GetInstance()->GetInput()->persist(Writer);
@@ -445,7 +445,7 @@
bool Success = true;
Success &= Kernel::GetInstance()->GetScript()->unpersist(Reader);
// Muss unbedingt nach Script passieren. Da sonst die bereits wiederhergestellten Regions per Garbage-Collection gekillt werden.
- Success &= RegionRegistry::getInstance().unpersist(Reader);
+ Success &= RegionRegistry::instance().unpersist(Reader);
Success &= Kernel::GetInstance()->GetGfx()->unpersist(Reader);
Success &= Kernel::GetInstance()->GetSfx()->unpersist(Reader);
Success &= Kernel::GetInstance()->GetInput()->unpersist(Reader);
Modified: scummvm/trunk/engines/sword25/math/geometry_script.cpp
===================================================================
--- scummvm/trunk/engines/sword25/math/geometry_script.cpp 2010-10-13 15:06:14 UTC (rev 53429)
+++ scummvm/trunk/engines/sword25/math/geometry_script.cpp 2010-10-13 15:41:00 UTC (rev 53430)
@@ -205,7 +205,7 @@
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 @@
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 @@
}
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 @@
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 @@
// 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");
}
Modified: scummvm/trunk/engines/sword25/math/region.cpp
===================================================================
--- scummvm/trunk/engines/sword25/math/region.cpp 2010-10-13 15:06:14 UTC (rev 53429)
+++ scummvm/trunk/engines/sword25/math/region.cpp 2010-10-13 15:41:00 UTC (rev 53430)
@@ -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 @@
BS_ASSERT(true);
}
- return RegionRegistry::getInstance().resolvePtr(regionPtr);
+ return RegionRegistry::instance().resolvePtr(regionPtr);
}
uint Region::create(InputPersistenceBlock &reader, uint handle) {
@@ -85,11 +85,11 @@
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) {
Modified: scummvm/trunk/engines/sword25/math/regionregistry.h
===================================================================
--- scummvm/trunk/engines/sword25/math/regionregistry.h 2010-10-13 15:06:14 UTC (rev 53429)
+++ scummvm/trunk/engines/sword25/math/regionregistry.h 2010-10-13 15:41:00 UTC (rev 53430)
@@ -46,7 +46,7 @@
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();
}
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