aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2013-02-06 13:56:55 +0100
committerEinar Johan Trøan Sømåen2013-03-24 19:02:34 +0100
commitef61c64f3f84eb0e055593e1940fd1c2890a5dc9 (patch)
tree879e5632fc826cf80d9e52fac7f8e8487b290bfd
parentd136e20d6e1851b1261db83787fea9d5fb42cd89 (diff)
downloadscummvm-rg350-ef61c64f3f84eb0e055593e1940fd1c2890a5dc9.tar.gz
scummvm-rg350-ef61c64f3f84eb0e055593e1940fd1c2890a5dc9.tar.bz2
scummvm-rg350-ef61c64f3f84eb0e055593e1940fd1c2890a5dc9.zip
WINTERMUTE: Detach BaseQuickMsg from the class-hierarchy. (Remove useless inheritance)
-rw-r--r--engines/wintermute/base/base_quick_msg.cpp14
-rw-r--r--engines/wintermute/base/base_quick_msg.h11
2 files changed, 10 insertions, 15 deletions
diff --git a/engines/wintermute/base/base_quick_msg.cpp b/engines/wintermute/base/base_quick_msg.cpp
index 0a9907ac6b..50a9031eee 100644
--- a/engines/wintermute/base/base_quick_msg.cpp
+++ b/engines/wintermute/base/base_quick_msg.cpp
@@ -32,26 +32,20 @@
namespace Wintermute {
//////////////////////////////////////////////////////////////////////////
-BaseQuickMsg::BaseQuickMsg(BaseGame *inGame, const char *text) : BaseClass(inGame) {
- _text = new char [strlen(text) + 1];
- if (_text) {
- strcpy(_text, text);
- }
+BaseQuickMsg::BaseQuickMsg(BaseGame *inGame, const char *text) {
+ _text = text;
_startTime = _gameRef->_currentTime;
}
//////////////////////////////////////////////////////////////////////////
BaseQuickMsg::~BaseQuickMsg() {
- if (_text) {
- delete[] _text;
- }
}
//////////////////////////////////////////////////////////////////////////
-char *BaseQuickMsg::getText() {
- return _text;
+const char *BaseQuickMsg::getText() const {
+ return _text.c_str();
}
} // end of namespace Wintermute
diff --git a/engines/wintermute/base/base_quick_msg.h b/engines/wintermute/base/base_quick_msg.h
index 67f9613461..0d342b3b12 100644
--- a/engines/wintermute/base/base_quick_msg.h
+++ b/engines/wintermute/base/base_quick_msg.h
@@ -29,18 +29,19 @@
#ifndef WINTERMUTE_BASE_QUICKMSG_H
#define WINTERMUTE_BASE_QUICKMSG_H
-#include "engines/wintermute/base/base.h"
+#include "common/str.h"
namespace Wintermute {
-
-class BaseQuickMsg : public BaseClass {
+class BaseGame;
+class BaseQuickMsg {
public:
- char *getText();
+ const char *getText() const;
uint32 _startTime;
BaseQuickMsg(BaseGame *inGame, const char *text);
virtual ~BaseQuickMsg();
private:
- char *_text;
+ BaseGame *_gameRef;
+ Common::String _text;
};
} // end of namespace Wintermute