diff options
-rw-r--r-- | engines/fullpipe/messages.cpp | 24 | ||||
-rw-r--r-- | engines/fullpipe/messages.h | 2 |
2 files changed, 21 insertions, 5 deletions
diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp index 7db168d92d..dcca925226 100644 --- a/engines/fullpipe/messages.cpp +++ b/engines/fullpipe/messages.cpp @@ -145,18 +145,34 @@ void ExCommand::firef34() { } } -ExCommand2::ExCommand2(int messageKind, int parentId, const Common::Point *points, int pointsSize) : ExCommand(parentId, messageKind, 0, 0, 0, 0, 1, 0, 0, 0) { - _points = 0; +ExCommand2::ExCommand2(int messageKind, int parentId, const Common::Point **points, int pointsSize) : ExCommand(parentId, messageKind, 0, 0, 0, 0, 1, 0, 0, 0) { _objtype = kObjTypeExCommand2; - warning("STUB: ExCommand2::ExCommand2()"); + _pointsSize = pointsSize; + _points = (Common::Point **)malloc(sizeof(Common::Point *) * pointsSize); + + for (int i = 0; i < pointsSize; i++) { + _points[i] = new Common::Point; + + *_points[i] = *points[i]; + } } ExCommand2::ExCommand2(ExCommand2 *src) : ExCommand(src) { - warning("STUB: ExCommand2::ExCommand2()"); + _pointsSize = src->_pointsSize; + _points = (Common::Point **)malloc(sizeof(Common::Point *) * _pointsSize); + + for (int i = 0; i < _pointsSize; i++) { + _points[i] = new Common::Point; + + *_points[i] = *src->_points[i]; + } } ExCommand2::~ExCommand2() { + for (int i = 0; i < _pointsSize; i++) + delete _points[i]; + free(_points); } diff --git a/engines/fullpipe/messages.h b/engines/fullpipe/messages.h index d03cb77334..653bd9625e 100644 --- a/engines/fullpipe/messages.h +++ b/engines/fullpipe/messages.h @@ -85,7 +85,7 @@ class ExCommand2 : public ExCommand { Common::Point **_points; int _pointsSize; - ExCommand2(int messageKind, int parentId, const Common::Point *points, int pointsSize); + ExCommand2(int messageKind, int parentId, const Common::Point **points, int pointsSize); ExCommand2(ExCommand2 *src); virtual ~ExCommand2(); |