WINTERMUTE: Avoid including BaseGame in BaseFader.

This commit is contained in:
Einar Johan Trøan Sømåen 2013-04-18 12:13:12 +02:00
parent 8f25b651e8
commit 32ace5f9d2
3 changed files with 8 additions and 7 deletions

View File

@ -100,7 +100,7 @@ BaseSoundMgr *BaseEngine::getSoundMgr() {
BaseRenderer *BaseEngine::getRenderer() {
if (instance()._gameRef) {
return _gameRef->_renderer;
return instance()._gameRef->_renderer;
} else {
return nullptr;
}

View File

@ -64,7 +64,7 @@ public:
BaseGame *getGameRef() { return _gameRef; }
BaseFileManager *getFileManager() { return _fileManager; }
BaseSoundMgr *getSoundMgr();
BaseRenderer *getRenderer();
static BaseRenderer *getRenderer();
static const Timer *getTimer();
static const Timer *getLiveTimer();
static void LOG(bool res, const char *fmt, ...);

View File

@ -27,7 +27,8 @@
*/
#include "engines/wintermute/base/base_fader.h"
#include "engines/wintermute/base/base_game.h"
#include "engines/wintermute/base/base_engine.h"
#include "engines/wintermute/base/timer.h"
#include "engines/wintermute/base/gfx/base_renderer.h"
#include "common/util.h"
@ -71,7 +72,7 @@ bool BaseFader::update() {
if (_system) {
time = g_system->getMillis() - _startTime;
} else {
time = _gameRef->getTimer()->getTime() - _startTime;
time = BaseEngine::getTimer()->getTime() - _startTime;
}
if (time >= _duration) {
@ -97,7 +98,7 @@ bool BaseFader::display() {
}
if (_currentAlpha > 0x00) {
_gameRef->_renderer->fadeToColor(_red, _green, _blue, _currentAlpha);
BaseEngine::getRenderer()->fadeToColor(_red, _green, _blue, _currentAlpha);
}
return STATUS_OK;
}
@ -129,7 +130,7 @@ bool BaseFader::fadeIn(uint32 sourceColor, uint32 duration, bool system) {
if (_system) {
_startTime = g_system->getMillis();
} else {
_startTime = _gameRef->getTimer()->getTime();
_startTime = BaseEngine::getTimer()->getTime();
}
return STATUS_OK;
@ -155,7 +156,7 @@ bool BaseFader::fadeOut(uint32 targetColor, uint32 duration, bool system) {
if (_system) {
_startTime = g_system->getMillis();
} else {
_startTime = _gameRef->getTimer()->getTime();
_startTime = BaseEngine::getTimer()->getTime();
}