aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/gfx
diff options
context:
space:
mode:
authorMax Horn2010-10-13 15:41:00 +0000
committerMax Horn2010-10-13 15:41:00 +0000
commit8f4f0d16fc4e5cd4803203f2aaeb0ddc99e57204 (patch)
treeb39380c6702b11d88ba2b95d7d0db9fc9afd62d9 /engines/sword25/gfx
parent17f9913a2419c558276a191be07a45ba8f8fc87f (diff)
downloadscummvm-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/gfx')
-rw-r--r--engines/sword25/gfx/animation.cpp6
-rw-r--r--engines/sword25/gfx/animationtemplate.cpp14
-rw-r--r--engines/sword25/gfx/animationtemplateregistry.h2
-rw-r--r--engines/sword25/gfx/graphicengine_script.cpp10
-rw-r--r--engines/sword25/gfx/renderobject.cpp6
-rw-r--r--engines/sword25/gfx/renderobjectmanager.cpp4
-rw-r--r--engines/sword25/gfx/renderobjectptr.h6
-rw-r--r--engines/sword25/gfx/renderobjectregistry.h2
8 files changed, 25 insertions, 25 deletions
diff --git a/engines/sword25/gfx/animation.cpp b/engines/sword25/gfx/animation.cpp
index 7ec445acb8..ffa682e569 100644
--- a/engines/sword25/gfx/animation.cpp
+++ b/engines/sword25/gfx/animation.cpp
@@ -583,7 +583,7 @@ void Animation::persistCallbackVector(OutputPersistenceBlock &writer, const Comm
// 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 @@ void Animation::unpersistCallbackVector(InputPersistenceBlock &reader, Common::A
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 @@ AnimationDescription *Animation::getAnimationDescription() const {
if (_animationResourcePtr)
return _animationResourcePtr;
else
- return AnimationTemplateRegistry::getInstance().resolveHandle(_animationTemplateHandle);
+ return AnimationTemplateRegistry::instance().resolveHandle(_animationTemplateHandle);
}
} // End of namespace Sword25
diff --git a/engines/sword25/gfx/animationtemplate.cpp b/engines/sword25/gfx/animationtemplate.cpp
index 2019d19565..c2dba550d7 100644
--- a/engines/sword25/gfx/animationtemplate.cpp
+++ b/engines/sword25/gfx/animationtemplate.cpp
@@ -49,7 +49,7 @@ uint AnimationTemplate::create(const Common::String &sourceAnimation) {
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 @@ uint AnimationTemplate::create(const AnimationTemplate &other) {
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 @@ uint AnimationTemplate::create(InputPersistenceBlock &reader, uint handle) {
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 @@ uint AnimationTemplate::create(InputPersistenceBlock &reader, uint handle) {
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 Common::String &sourceAnimation) {
AnimationTemplate::AnimationTemplate(const AnimationTemplate &other) : AnimationDescription() {
// Objekt registrieren.
- AnimationTemplateRegistry::getInstance().registerObject(this);
+ AnimationTemplateRegistry::instance().registerObject(this);
_valid = false;
@@ -118,7 +118,7 @@ AnimationTemplate::AnimationTemplate(const AnimationTemplate &other) : Animation
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 @@ AnimationTemplate::~AnimationTemplate() {
}
// Objekt deregistrieren
- AnimationTemplateRegistry::getInstance().deregisterObject(this);
+ AnimationTemplateRegistry::instance().deregisterObject(this);
}
void AnimationTemplate::addFrame(int index) {
diff --git a/engines/sword25/gfx/animationtemplateregistry.h b/engines/sword25/gfx/animationtemplateregistry.h
index 256cbab8cd..9c7140e585 100644
--- a/engines/sword25/gfx/animationtemplateregistry.h
+++ b/engines/sword25/gfx/animationtemplateregistry.h
@@ -47,7 +47,7 @@ class AnimationTemplate;
class AnimationTemplateRegistry : public ObjectRegistry<AnimationTemplate>, public Persistable {
public:
- static AnimationTemplateRegistry &getInstance() {
+ static AnimationTemplateRegistry &instance() {
if (!_instancePtr.get())
_instancePtr.reset(new AnimationTemplateRegistry);
return *_instancePtr.get();
diff --git a/engines/sword25/gfx/graphicengine_script.cpp b/engines/sword25/gfx/graphicengine_script.cpp
index d443023436..0f85f08d5b 100644
--- a/engines/sword25/gfx/graphicengine_script.cpp
+++ b/engines/sword25/gfx/graphicengine_script.cpp
@@ -88,9 +88,9 @@ Common::ScopedPtr<ActionCallback> ActionCallbackPtr;
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 @@ static AnimationTemplate *CheckAnimationTemplate(lua_State *L, int idx = 1) {
// 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 AnimationTemplate *CheckAnimationTemplate(lua_State *L, int idx = 1) {
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);
diff --git a/engines/sword25/gfx/renderobject.cpp b/engines/sword25/gfx/renderobject.cpp
index 5de6dde79e..ae8fc8cba1 100644
--- a/engines/sword25/gfx/renderobject.cpp
+++ b/engines/sword25/gfx/renderobject.cpp
@@ -76,9 +76,9 @@ RenderObject::RenderObject(RenderObjectPtr<RenderObject> parentPtr, TYPES type,
// Renderobject registrieren, abhängig 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 @@ RenderObject::~RenderObject() {
deleteAllChildren();
// Objekt deregistrieren.
- RenderObjectRegistry::getInstance().deregisterObject(this);
+ RenderObjectRegistry::instance().deregisterObject(this);
}
// Rendern
diff --git a/engines/sword25/gfx/renderobjectmanager.cpp b/engines/sword25/gfx/renderobjectmanager.cpp
index ab4e606270..3e142c627e 100644
--- a/engines/sword25/gfx/renderobjectmanager.cpp
+++ b/engines/sword25/gfx/renderobjectmanager.cpp
@@ -113,7 +113,7 @@ bool RenderObjectManager::persist(OutputPersistenceBlock &writer) {
}
// Alle BS_AnimationTemplates persistieren.
- result &= AnimationTemplateRegistry::getInstance().persist(writer);
+ result &= AnimationTemplateRegistry::instance().persist(writer);
return result;
}
@@ -143,7 +143,7 @@ bool RenderObjectManager::unpersist(InputPersistenceBlock &reader) {
}
// Alle BS_AnimationTemplates wieder herstellen.
- result &= AnimationTemplateRegistry::getInstance().unpersist(reader);
+ result &= AnimationTemplateRegistry::instance().unpersist(reader);
return result;
}
diff --git a/engines/sword25/gfx/renderobjectptr.h b/engines/sword25/gfx/renderobjectptr.h
index 894ba877d2..c22c6e83e7 100644
--- a/engines/sword25/gfx/renderobjectptr.h
+++ b/engines/sword25/gfx/renderobjectptr.h
@@ -54,7 +54,7 @@ public:
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 @@ public:
}
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;
}
diff --git a/engines/sword25/gfx/renderobjectregistry.h b/engines/sword25/gfx/renderobjectregistry.h
index b546ee56e1..416da27f08 100644
--- a/engines/sword25/gfx/renderobjectregistry.h
+++ b/engines/sword25/gfx/renderobjectregistry.h
@@ -58,7 +58,7 @@ class RenderObject;
class RenderObjectRegistry : public ObjectRegistry<RenderObject> {
public:
- static RenderObjectRegistry &getInstance() {
+ static RenderObjectRegistry &instance() {
if (!_instancePtr.get())
_instancePtr.reset(new RenderObjectRegistry);
return *_instancePtr.get();