aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2013-04-18 12:31:18 +0200
committerEinar Johan Trøan Sømåen2013-04-18 12:31:27 +0200
commita00c372f9eff8da8820cb06ed784fefb5cac247f (patch)
tree5f4cf82f15351b905f594af581abc55052961f6a
parent8bcaf3e06c5c61d82686be4cbf5699f71db3e4a3 (diff)
downloadscummvm-rg350-a00c372f9eff8da8820cb06ed784fefb5cac247f.tar.gz
scummvm-rg350-a00c372f9eff8da8820cb06ed784fefb5cac247f.tar.bz2
scummvm-rg350-a00c372f9eff8da8820cb06ed784fefb5cac247f.zip
WINTERMUTE: Get Renderer from BaseEngine, not BaseGame in BaseClasses.
-rw-r--r--engines/wintermute/base/base_active_rect.cpp3
-rw-r--r--engines/wintermute/base/base_sub_frame.cpp4
-rw-r--r--engines/wintermute/base/base_surface_storage.cpp2
-rw-r--r--engines/wintermute/base/base_transition_manager.cpp5
4 files changed, 8 insertions, 6 deletions
diff --git a/engines/wintermute/base/base_active_rect.cpp b/engines/wintermute/base/base_active_rect.cpp
index 4c62cf9561..7a91854c57 100644
--- a/engines/wintermute/base/base_active_rect.cpp
+++ b/engines/wintermute/base/base_active_rect.cpp
@@ -28,6 +28,7 @@
#include "engines/wintermute/base/base_active_rect.h"
#include "engines/wintermute/base/base_game.h"
+#include "engines/wintermute/base/base_engine.h"
#include "engines/wintermute/base/base_region.h"
#include "engines/wintermute/base/gfx/base_renderer.h"
#include "engines/wintermute/platform_osystem.h"
@@ -89,7 +90,7 @@ void BaseActiveRect::clipRect() {
Rect32 rc;
bool customViewport;
_gameRef->getCurrentViewportRect(&rc, &customViewport);
- BaseRenderer *Rend = _gameRef->_renderer;
+ BaseRenderer *Rend = BaseEngine::getRenderer();
if (!customViewport) {
rc.left -= Rend->_drawOffsetX;
diff --git a/engines/wintermute/base/base_sub_frame.cpp b/engines/wintermute/base/base_sub_frame.cpp
index f71935be03..d93cf667f1 100644
--- a/engines/wintermute/base/base_sub_frame.cpp
+++ b/engines/wintermute/base/base_sub_frame.cpp
@@ -239,9 +239,9 @@ bool BaseSubFrame::draw(int x, int y, BaseObject *registerOwner, float zoomX, fl
if (registerOwner != nullptr && !_decoration) {
if (zoomX == 100 && zoomY == 100) {
- _gameRef->_renderer->addRectToList(new BaseActiveRect(_gameRef, registerOwner, this, x - _hotspotX + getRect().left, y - _hotspotY + getRect().top, getRect().right - getRect().left, getRect().bottom - getRect().top, zoomX, zoomY, precise));
+ BaseEngine::getRenderer()->addRectToList(new BaseActiveRect(_gameRef, registerOwner, this, x - _hotspotX + getRect().left, y - _hotspotY + getRect().top, getRect().right - getRect().left, getRect().bottom - getRect().top, zoomX, zoomY, precise));
} else {
- _gameRef->_renderer->addRectToList(new BaseActiveRect(_gameRef, registerOwner, this, (int)(x - (_hotspotX + getRect().left) * (zoomX / 100)), (int)(y - (_hotspotY + getRect().top) * (zoomY / 100)), (int)((getRect().right - getRect().left) * (zoomX / 100)), (int)((getRect().bottom - getRect().top) * (zoomY / 100)), zoomX, zoomY, precise));
+ BaseEngine::getRenderer()->addRectToList(new BaseActiveRect(_gameRef, registerOwner, this, (int)(x - (_hotspotX + getRect().left) * (zoomX / 100)), (int)(y - (_hotspotY + getRect().top) * (zoomY / 100)), (int)((getRect().right - getRect().left) * (zoomX / 100)), (int)((getRect().bottom - getRect().top) * (zoomY / 100)), zoomX, zoomY, precise));
}
}
if (_gameRef->getSuspendedRendering()) {
diff --git a/engines/wintermute/base/base_surface_storage.cpp b/engines/wintermute/base/base_surface_storage.cpp
index d0e6042d33..8dbd6a6d2a 100644
--- a/engines/wintermute/base/base_surface_storage.cpp
+++ b/engines/wintermute/base/base_surface_storage.cpp
@@ -122,7 +122,7 @@ BaseSurface *BaseSurfaceStorage::addSurface(const Common::String &filename, bool
}
BaseSurface *surface;
- surface = _gameRef->_renderer->createSurface();
+ surface = BaseEngine::getRenderer()->createSurface();
if (!surface) {
return nullptr;
diff --git a/engines/wintermute/base/base_transition_manager.cpp b/engines/wintermute/base/base_transition_manager.cpp
index 6ae51d8e83..1c869e6a2b 100644
--- a/engines/wintermute/base/base_transition_manager.cpp
+++ b/engines/wintermute/base/base_transition_manager.cpp
@@ -28,6 +28,7 @@
#include "engines/wintermute/base/base_transition_manager.h"
#include "engines/wintermute/base/base_game.h"
+#include "engines/wintermute/base/base_engine.h"
#include "engines/wintermute/base/gfx/base_renderer.h"
namespace Wintermute {
@@ -103,7 +104,7 @@ bool BaseTransitionMgr::update() {
uint32 time = g_system->getMillis() - _lastTime;
int alpha = (int)(255 - (float)time / (float)FADE_DURATION * 255);
alpha = MIN(255, MAX(alpha, 0));
- _gameRef->_renderer->fade((uint16)alpha);
+ BaseEngine::getRenderer()->fade((uint16)alpha);
if (time > FADE_DURATION) {
_state = TRANS_MGR_READY;
@@ -115,7 +116,7 @@ bool BaseTransitionMgr::update() {
uint32 time = g_system->getMillis() - _lastTime;
int alpha = (int)((float)time / (float)FADE_DURATION * 255);
alpha = MIN(255, MAX(alpha, 0));
- _gameRef->_renderer->fade((uint16)alpha);
+ BaseEngine::getRenderer()->fade((uint16)alpha);
if (time > FADE_DURATION) {
_state = TRANS_MGR_READY;