aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute
diff options
context:
space:
mode:
authorEinar Johan T. Sømåen2013-05-23 14:03:06 +0200
committerEinar Johan T. Sømåen2013-05-23 14:03:06 +0200
commit81282b52e77dbaa3497c91c50e5abab478d46397 (patch)
treeff8449a5e528fb0bce41e2fdf4fd948320530b88 /engines/wintermute
parentf06f335a7c2d08432d77eac0de0cd7704a81f545 (diff)
downloadscummvm-rg350-81282b52e77dbaa3497c91c50e5abab478d46397.tar.gz
scummvm-rg350-81282b52e77dbaa3497c91c50e5abab478d46397.tar.bz2
scummvm-rg350-81282b52e77dbaa3497c91c50e5abab478d46397.zip
WINTERMUTE: Fix erroneous _gameRef in BaseQuickMSG
CID 1002323
Diffstat (limited to 'engines/wintermute')
-rw-r--r--engines/wintermute/base/base_game.cpp4
-rw-r--r--engines/wintermute/base/base_quick_msg.cpp10
-rw-r--r--engines/wintermute/base/base_quick_msg.h8
3 files changed, 13 insertions, 9 deletions
diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp
index e97e342149..4d8e79b5c2 100644
--- a/engines/wintermute/base/base_game.cpp
+++ b/engines/wintermute/base/base_game.cpp
@@ -2558,7 +2558,7 @@ bool BaseGame::displayQuickMsg() {
// update
for (uint32 i = 0; i < _quickMessages.size(); i++) {
- if (_currentTime - _quickMessages[i]->_startTime >= QUICK_MSG_DURATION) {
+ if (_currentTime - _quickMessages[i]->getStartTime() >= QUICK_MSG_DURATION) {
delete _quickMessages[i];
_quickMessages.remove_at(i);
i--;
@@ -2583,7 +2583,7 @@ void BaseGame::quickMessage(const char *text) {
delete _quickMessages[0];
_quickMessages.remove_at(0);
}
- _quickMessages.add(new BaseQuickMsg(_gameRef, text));
+ _quickMessages.add(new BaseQuickMsg(_currentTime, text));
}
diff --git a/engines/wintermute/base/base_quick_msg.cpp b/engines/wintermute/base/base_quick_msg.cpp
index 50a9031eee..9f19dfd74a 100644
--- a/engines/wintermute/base/base_quick_msg.cpp
+++ b/engines/wintermute/base/base_quick_msg.cpp
@@ -27,14 +27,13 @@
*/
#include "engines/wintermute/base/base_quick_msg.h"
-#include "engines/wintermute/base/base_game.h"
namespace Wintermute {
//////////////////////////////////////////////////////////////////////////
-BaseQuickMsg::BaseQuickMsg(BaseGame *inGame, const char *text) {
+BaseQuickMsg::BaseQuickMsg(uint32 startTime, const char *text) {
_text = text;
- _startTime = _gameRef->_currentTime;
+ _startTime = startTime;
}
@@ -48,4 +47,9 @@ const char *BaseQuickMsg::getText() const {
return _text.c_str();
}
+//////////////////////////////////////////////////////////////////////////
+uint32 BaseQuickMsg::getStartTime() const {
+ return _startTime;
+}
+
} // end of namespace Wintermute
diff --git a/engines/wintermute/base/base_quick_msg.h b/engines/wintermute/base/base_quick_msg.h
index 0d342b3b12..377f7733fd 100644
--- a/engines/wintermute/base/base_quick_msg.h
+++ b/engines/wintermute/base/base_quick_msg.h
@@ -32,16 +32,16 @@
#include "common/str.h"
namespace Wintermute {
-class BaseGame;
+
class BaseQuickMsg {
public:
const char *getText() const;
- uint32 _startTime;
- BaseQuickMsg(BaseGame *inGame, const char *text);
+ uint32 getStartTime() const;
+ BaseQuickMsg(uint32 startTime, const char *text);
virtual ~BaseQuickMsg();
private:
- BaseGame *_gameRef;
Common::String _text;
+ uint32 _startTime;
};
} // end of namespace Wintermute