aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/gfx
diff options
context:
space:
mode:
authorMax Horn2010-10-15 12:18:19 +0000
committerMax Horn2010-10-15 12:18:19 +0000
commit550073ee049ba30d84cb76c82fb18c045b07569f (patch)
tree0b67327d8f27969c6a6ebd1971fafee6cd7b70d9 /engines/sword25/gfx
parent2b5de8c8921d8ec012c689597870e5ae781e3b81 (diff)
downloadscummvm-rg350-550073ee049ba30d84cb76c82fb18c045b07569f.tar.gz
scummvm-rg350-550073ee049ba30d84cb76c82fb18c045b07569f.tar.bz2
scummvm-rg350-550073ee049ba30d84cb76c82fb18c045b07569f.zip
SWORD25: Do not use Kernel::GetService directly anymore
svn-id: r53477
Diffstat (limited to 'engines/sword25/gfx')
-rw-r--r--engines/sword25/gfx/animation.cpp2
-rw-r--r--engines/sword25/gfx/animationresource.cpp3
-rw-r--r--engines/sword25/gfx/dynamicbitmap.cpp2
-rw-r--r--engines/sword25/gfx/fontresource.cpp4
-rw-r--r--engines/sword25/gfx/graphicengine_script.cpp4
-rw-r--r--engines/sword25/gfx/image/renderedimage.cpp8
-rw-r--r--engines/sword25/gfx/image/swimage.cpp2
-rw-r--r--engines/sword25/gfx/panel.cpp2
-rw-r--r--engines/sword25/gfx/staticbitmap.cpp2
-rw-r--r--engines/sword25/gfx/text.cpp2
10 files changed, 15 insertions, 16 deletions
diff --git a/engines/sword25/gfx/animation.cpp b/engines/sword25/gfx/animation.cpp
index ffa682e569..3f51c8be4c 100644
--- a/engines/sword25/gfx/animation.cpp
+++ b/engines/sword25/gfx/animation.cpp
@@ -188,7 +188,7 @@ bool Animation::doRender() {
BitmapResource *pBitmapResource = static_cast<BitmapResource *>(pResource);
// Framebufferobjekt holen
- GraphicEngine *pGfx = static_cast<GraphicEngine *>(Kernel::GetInstance()->GetService("gfx"));
+ GraphicEngine *pGfx = Kernel::GetInstance()->GetGfx();
BS_ASSERT(pGfx);
// Bitmap zeichnen
diff --git a/engines/sword25/gfx/animationresource.cpp b/engines/sword25/gfx/animationresource.cpp
index 93b5934041..96a93f1890 100644
--- a/engines/sword25/gfx/animationresource.cpp
+++ b/engines/sword25/gfx/animationresource.cpp
@@ -54,8 +54,7 @@ AnimationResource::AnimationResource(const Common::String &filename) :
Common::XMLParser(),
_valid(false) {
// Get a pointer to the package manager
- Kernel *pKernel = Kernel::GetInstance();
- _pPackage = static_cast<PackageManager *>(pKernel->GetService("package"));
+ _pPackage = Kernel::GetInstance()->GetPackage();
BS_ASSERT(_pPackage);
// Switch to the folder the specified Xml fiile is in
diff --git a/engines/sword25/gfx/dynamicbitmap.cpp b/engines/sword25/gfx/dynamicbitmap.cpp
index 91d46e99f4..47ff68b932 100644
--- a/engines/sword25/gfx/dynamicbitmap.cpp
+++ b/engines/sword25/gfx/dynamicbitmap.cpp
@@ -99,7 +99,7 @@ uint DynamicBitmap::getPixel(int x, int y) const {
bool DynamicBitmap::doRender() {
// Framebufferobjekt holen
- GraphicEngine *pGfx = static_cast<GraphicEngine *>(Kernel::GetInstance()->GetService("gfx"));
+ GraphicEngine *pGfx = Kernel::GetInstance()->GetGfx();
BS_ASSERT(pGfx);
// Bitmap zeichnen
diff --git a/engines/sword25/gfx/fontresource.cpp b/engines/sword25/gfx/fontresource.cpp
index 9f23133a71..2e64a20daa 100644
--- a/engines/sword25/gfx/fontresource.cpp
+++ b/engines/sword25/gfx/fontresource.cpp
@@ -65,7 +65,7 @@ FontResource::FontResource(Kernel *pKernel, const Common::String &FileName) :
// Get a pointer to the package manager
BS_ASSERT(_pKernel);
- PackageManager *pPackage = static_cast<PackageManager *>(_pKernel->GetService("package"));
+ PackageManager *pPackage = _pKernel->GetPackage();
BS_ASSERT(pPackage);
// Load the contents of the file
@@ -105,7 +105,7 @@ bool FontResource::parserCallback_font(ParserNode *node) {
// Get a reference to the package manager
BS_ASSERT(_pKernel);
- PackageManager *pPackage = static_cast<PackageManager *>(_pKernel->GetService("package"));
+ PackageManager *pPackage = _pKernel->GetPackage();
BS_ASSERT(pPackage);
// Get the full path and filename for the bitmap resource
diff --git a/engines/sword25/gfx/graphicengine_script.cpp b/engines/sword25/gfx/graphicengine_script.cpp
index ee50f03636..405bebdf89 100644
--- a/engines/sword25/gfx/graphicengine_script.cpp
+++ b/engines/sword25/gfx/graphicengine_script.cpp
@@ -251,7 +251,7 @@ static const luaL_reg ANIMATION_TEMPLATE_METHODS[] = {
static GraphicEngine *GetGE() {
Kernel *pKernel = Kernel::GetInstance();
BS_ASSERT(pKernel);
- GraphicEngine *pGE = static_cast<GraphicEngine *>(pKernel->GetService("gfx"));
+ GraphicEngine *pGE = pKernel->GetGfx();
BS_ASSERT(pGE);
return pGE;
}
@@ -1525,7 +1525,7 @@ static const luaL_reg TEXT_METHODS[] = {
bool GraphicEngine::RegisterScriptBindings() {
Kernel *pKernel = Kernel::GetInstance();
BS_ASSERT(pKernel);
- ScriptEngine *pScript = static_cast<ScriptEngine *>(pKernel->GetService("script"));
+ ScriptEngine *pScript = pKernel->GetScript();
BS_ASSERT(pScript);
lua_State *L = static_cast<lua_State *>(pScript->getScriptObject());
BS_ASSERT(L);
diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp
index 96b6139a59..d758e66841 100644
--- a/engines/sword25/gfx/image/renderedimage.cpp
+++ b/engines/sword25/gfx/image/renderedimage.cpp
@@ -56,10 +56,10 @@ RenderedImage::RenderedImage(const Common::String &filename, bool &result) :
_height(0) {
result = false;
- PackageManager *pPackage = static_cast<PackageManager *>(Kernel::GetInstance()->GetService("package"));
+ PackageManager *pPackage = Kernel::GetInstance()->GetPackage();
BS_ASSERT(pPackage);
- _backSurface = (static_cast<GraphicEngine *>(Kernel::GetInstance()->GetService("gfx")))->getSurface();
+ _backSurface = Kernel::GetInstance()->GetGfx()->getSurface();
// Datei laden
byte *pFileData;
@@ -103,7 +103,7 @@ RenderedImage::RenderedImage(uint width, uint height, bool &result) :
_data = new byte[width * height * 4];
Common::set_to(_data, &_data[width * height * 4], 0);
- _backSurface = (static_cast<GraphicEngine *>(Kernel::GetInstance()->GetService("gfx")))->getSurface();
+ _backSurface = Kernel::GetInstance()->GetGfx()->getSurface();
_doCleanup = true;
@@ -112,7 +112,7 @@ RenderedImage::RenderedImage(uint width, uint height, bool &result) :
}
RenderedImage::RenderedImage() : _width(0), _height(0), _data(0) {
- _backSurface = (static_cast<GraphicEngine *>(Kernel::GetInstance()->GetService("gfx")))->getSurface();
+ _backSurface = Kernel::GetInstance()->GetGfx()->getSurface();
_doCleanup = false;
diff --git a/engines/sword25/gfx/image/swimage.cpp b/engines/sword25/gfx/image/swimage.cpp
index ac4463ea16..77ac109e48 100644
--- a/engines/sword25/gfx/image/swimage.cpp
+++ b/engines/sword25/gfx/image/swimage.cpp
@@ -55,7 +55,7 @@ SWImage::SWImage(const Common::String &filename, bool &result) :
_height(0) {
result = false;
- PackageManager *pPackage = static_cast<PackageManager *>(Kernel::GetInstance()->GetService("package"));
+ PackageManager *pPackage = Kernel::GetInstance()->GetPackage();
BS_ASSERT(pPackage);
// Datei laden
diff --git a/engines/sword25/gfx/panel.cpp b/engines/sword25/gfx/panel.cpp
index 3aa0516835..888f6f7468 100644
--- a/engines/sword25/gfx/panel.cpp
+++ b/engines/sword25/gfx/panel.cpp
@@ -95,7 +95,7 @@ bool Panel::doRender() {
if (_color >> 24 == 0)
return true;
- GraphicEngine *gfxPtr = static_cast<GraphicEngine *>(Kernel::GetInstance()->GetService("gfx"));
+ GraphicEngine *gfxPtr = Kernel::GetInstance()->GetGfx();
BS_ASSERT(gfxPtr);
return gfxPtr->fill(&_bbox, _color);
diff --git a/engines/sword25/gfx/staticbitmap.cpp b/engines/sword25/gfx/staticbitmap.cpp
index 7771eb8100..3184e4f971 100644
--- a/engines/sword25/gfx/staticbitmap.cpp
+++ b/engines/sword25/gfx/staticbitmap.cpp
@@ -114,7 +114,7 @@ bool StaticBitmap::doRender() {
BitmapResource *bitmapResourcePtr = static_cast<BitmapResource *>(resourcePtr);
// Framebufferobjekt holen
- GraphicEngine *gfxPtr = static_cast<GraphicEngine *>(Kernel::GetInstance()->GetService("gfx"));
+ GraphicEngine *gfxPtr = Kernel::GetInstance()->GetGfx();
BS_ASSERT(gfxPtr);
// Bitmap zeichnen
diff --git a/engines/sword25/gfx/text.cpp b/engines/sword25/gfx/text.cpp
index d3d77cb0d2..2089886493 100644
--- a/engines/sword25/gfx/text.cpp
+++ b/engines/sword25/gfx/text.cpp
@@ -169,7 +169,7 @@ bool Text::doRender() {
}
// Framebufferobjekt holen.
- GraphicEngine *GfxPtr = static_cast<GraphicEngine *>(Kernel::GetInstance()->GetService("gfx"));
+ GraphicEngine *GfxPtr = Kernel::GetInstance()->GetGfx();
BS_ASSERT(GfxPtr);
bool Result = true;