WINTERMUTE: Avoid including BaseGame in BaseFader.
This commit is contained in:
parent
8f25b651e8
commit
32ace5f9d2
3 changed files with 8 additions and 7 deletions
|
@ -100,7 +100,7 @@ BaseSoundMgr *BaseEngine::getSoundMgr() {
|
||||||
|
|
||||||
BaseRenderer *BaseEngine::getRenderer() {
|
BaseRenderer *BaseEngine::getRenderer() {
|
||||||
if (instance()._gameRef) {
|
if (instance()._gameRef) {
|
||||||
return _gameRef->_renderer;
|
return instance()._gameRef->_renderer;
|
||||||
} else {
|
} else {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ public:
|
||||||
BaseGame *getGameRef() { return _gameRef; }
|
BaseGame *getGameRef() { return _gameRef; }
|
||||||
BaseFileManager *getFileManager() { return _fileManager; }
|
BaseFileManager *getFileManager() { return _fileManager; }
|
||||||
BaseSoundMgr *getSoundMgr();
|
BaseSoundMgr *getSoundMgr();
|
||||||
BaseRenderer *getRenderer();
|
static BaseRenderer *getRenderer();
|
||||||
static const Timer *getTimer();
|
static const Timer *getTimer();
|
||||||
static const Timer *getLiveTimer();
|
static const Timer *getLiveTimer();
|
||||||
static void LOG(bool res, const char *fmt, ...);
|
static void LOG(bool res, const char *fmt, ...);
|
||||||
|
|
|
@ -27,7 +27,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "engines/wintermute/base/base_fader.h"
|
#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 "engines/wintermute/base/gfx/base_renderer.h"
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
|
|
||||||
|
@ -71,7 +72,7 @@ bool BaseFader::update() {
|
||||||
if (_system) {
|
if (_system) {
|
||||||
time = g_system->getMillis() - _startTime;
|
time = g_system->getMillis() - _startTime;
|
||||||
} else {
|
} else {
|
||||||
time = _gameRef->getTimer()->getTime() - _startTime;
|
time = BaseEngine::getTimer()->getTime() - _startTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (time >= _duration) {
|
if (time >= _duration) {
|
||||||
|
@ -97,7 +98,7 @@ bool BaseFader::display() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_currentAlpha > 0x00) {
|
if (_currentAlpha > 0x00) {
|
||||||
_gameRef->_renderer->fadeToColor(_red, _green, _blue, _currentAlpha);
|
BaseEngine::getRenderer()->fadeToColor(_red, _green, _blue, _currentAlpha);
|
||||||
}
|
}
|
||||||
return STATUS_OK;
|
return STATUS_OK;
|
||||||
}
|
}
|
||||||
|
@ -129,7 +130,7 @@ bool BaseFader::fadeIn(uint32 sourceColor, uint32 duration, bool system) {
|
||||||
if (_system) {
|
if (_system) {
|
||||||
_startTime = g_system->getMillis();
|
_startTime = g_system->getMillis();
|
||||||
} else {
|
} else {
|
||||||
_startTime = _gameRef->getTimer()->getTime();
|
_startTime = BaseEngine::getTimer()->getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATUS_OK;
|
return STATUS_OK;
|
||||||
|
@ -155,7 +156,7 @@ bool BaseFader::fadeOut(uint32 targetColor, uint32 duration, bool system) {
|
||||||
if (_system) {
|
if (_system) {
|
||||||
_startTime = g_system->getMillis();
|
_startTime = g_system->getMillis();
|
||||||
} else {
|
} else {
|
||||||
_startTime = _gameRef->getTimer()->getTime();
|
_startTime = BaseEngine::getTimer()->getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue