[Scummvm-cvs-logs] scummvm master -> ef61c64f3f84eb0e055593e1940fd1c2890a5dc9

somaen einarjohants at gmail.com
Sun Mar 24 19:05:33 CET 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ef61c64f3f WINTERMUTE: Detach BaseQuickMsg from the class-hierarchy. (Remove useless inheritance)


Commit: ef61c64f3f84eb0e055593e1940fd1c2890a5dc9
    https://github.com/scummvm/scummvm/commit/ef61c64f3f84eb0e055593e1940fd1c2890a5dc9
Author: Einar Johan Trøan Sømåen (einarjohants at gmail.com)
Date: 2013-03-24T11:02:34-07:00

Commit Message:
WINTERMUTE: Detach BaseQuickMsg from the class-hierarchy. (Remove useless inheritance)

Changed paths:
    engines/wintermute/base/base_quick_msg.cpp
    engines/wintermute/base/base_quick_msg.h



diff --git a/engines/wintermute/base/base_quick_msg.cpp b/engines/wintermute/base/base_quick_msg.cpp
index 0a9907a..50a9031 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 67f9613..0d342b3 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






More information about the Scummvm-git-logs mailing list