diff options
author | Einar Johan Trøan Sømåen | 2013-02-06 13:56:55 +0100 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2013-03-24 19:02:34 +0100 |
commit | ef61c64f3f84eb0e055593e1940fd1c2890a5dc9 (patch) | |
tree | 879e5632fc826cf80d9e52fac7f8e8487b290bfd /engines/wintermute | |
parent | d136e20d6e1851b1261db83787fea9d5fb42cd89 (diff) | |
download | scummvm-rg350-ef61c64f3f84eb0e055593e1940fd1c2890a5dc9.tar.gz scummvm-rg350-ef61c64f3f84eb0e055593e1940fd1c2890a5dc9.tar.bz2 scummvm-rg350-ef61c64f3f84eb0e055593e1940fd1c2890a5dc9.zip |
WINTERMUTE: Detach BaseQuickMsg from the class-hierarchy. (Remove useless inheritance)
Diffstat (limited to 'engines/wintermute')
-rw-r--r-- | engines/wintermute/base/base_quick_msg.cpp | 14 | ||||
-rw-r--r-- | engines/wintermute/base/base_quick_msg.h | 11 |
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 |