diff options
author | Filippos Karapetis | 2016-12-20 02:17:58 +0200 |
---|---|---|
committer | Filippos Karapetis | 2016-12-20 02:17:58 +0200 |
commit | b4514bfe92307249d5b52c3c37d5838ea2e3c4d5 (patch) | |
tree | b85743d59a36061ff3d423fc50b87663b55fd67f /engines/fullpipe | |
parent | 8a16f9d7857e517bd2b87744c0bea17fab9d1eb3 (diff) | |
download | scummvm-rg350-b4514bfe92307249d5b52c3c37d5838ea2e3c4d5.tar.gz scummvm-rg350-b4514bfe92307249d5b52c3c37d5838ea2e3c4d5.tar.bz2 scummvm-rg350-b4514bfe92307249d5b52c3c37d5838ea2e3c4d5.zip |
FULLPIPE: Change _objCommandName and _queueName to Common::String
Diffstat (limited to 'engines/fullpipe')
-rw-r--r-- | engines/fullpipe/messagehandlers.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/messages.cpp | 11 | ||||
-rw-r--r-- | engines/fullpipe/messages.h | 4 | ||||
-rw-r--r-- | engines/fullpipe/scene.cpp | 2 |
4 files changed, 6 insertions, 13 deletions
diff --git a/engines/fullpipe/messagehandlers.cpp b/engines/fullpipe/messagehandlers.cpp index f53a705ea9..bd75e01232 100644 --- a/engines/fullpipe/messagehandlers.cpp +++ b/engines/fullpipe/messagehandlers.cpp @@ -519,7 +519,7 @@ int global_messageHandler3(ExCommand *cmd) { if (cmd->_objtype == kObjTypeObjstateCommand) { ObjstateCommand *c = (ObjstateCommand *)cmd; result = 1; - g_fp->setObjectState(c->_objCommandName, c->_value); + g_fp->setObjectState(c->_objCommandName.c_str(), c->_value); } return result; default: diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp index a9fc5210a3..111c70ce05 100644 --- a/engines/fullpipe/messages.cpp +++ b/engines/fullpipe/messages.cpp @@ -232,20 +232,17 @@ Message::Message(int16 parentId, int messageKind, int x, int y, int a6, int a7, ObjstateCommand::ObjstateCommand() { _value = 0; - _objCommandName = 0; _objtype = kObjTypeObjstateCommand; } ObjstateCommand::ObjstateCommand(ObjstateCommand *src) : ExCommand(src) { _value = src->_value; - _objCommandName = (char *)calloc(strlen(src->_objCommandName) + 1, 1); _objtype = kObjTypeObjstateCommand; - strncpy(_objCommandName, src->_objCommandName, strlen(src->_objCommandName)); + _objCommandName = src->_objCommandName; } ObjstateCommand::~ObjstateCommand() { - free(_objCommandName); } bool ObjstateCommand::load(MfcArchive &file) { @@ -273,7 +270,6 @@ MessageQueue::MessageQueue() { _id = 0; _isFinished = 0; _flags = 0; - _queueName = 0; _counter = 0; _field_38 = 0; _flag1 = 0; @@ -286,7 +282,6 @@ MessageQueue::MessageQueue(int dataId) { _id = g_fp->_globalMessageQueueList->compact(); _isFinished = 0; _flags = 0; - _queueName = 0; _counter = 0; _field_38 = 0; _flag1 = 0; @@ -312,7 +307,7 @@ MessageQueue::MessageQueue(MessageQueue *src, int parId, int field_38) { _id = g_fp->_globalMessageQueueList->compact(); _dataId = src->_dataId; _flags = src->_flags; - _queueName = 0; + _queueName = ""; g_fp->_globalMessageQueueList->addMessageQueue(this); @@ -338,8 +333,6 @@ MessageQueue::~MessageQueue() { } finish(); - - free(_queueName); } bool MessageQueue::load(MfcArchive &file) { diff --git a/engines/fullpipe/messages.h b/engines/fullpipe/messages.h index b99b842bf9..0bdfb23835 100644 --- a/engines/fullpipe/messages.h +++ b/engines/fullpipe/messages.h @@ -94,7 +94,7 @@ class ExCommand2 : public ExCommand { class ObjstateCommand : public ExCommand { public: - char *_objCommandName; + Common::String _objCommandName; int _value; public: @@ -111,7 +111,7 @@ class MessageQueue : public CObject { public: int _id; int _flags; - char *_queueName; + Common::String _queueName; int16 _dataId; CObject *_field_14; int _counter; diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp index b5258183b0..d560703fa5 100644 --- a/engines/fullpipe/scene.cpp +++ b/engines/fullpipe/scene.cpp @@ -400,7 +400,7 @@ MessageQueue *Scene::getMessageQueueById(int messageId) { MessageQueue *Scene::getMessageQueueByName(char *name) { for (uint i = 0; i < _messageQueueList.size(); i++) - if (!strcmp(_messageQueueList[i]->_queueName, name)) + if (!strcmp(_messageQueueList[i]->_queueName.c_str(), name)) return _messageQueueList[i]; return 0; |