From 0745e61e70ae37a9c10448ad2c96d9e632c8ee58 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 4 Jan 2014 15:15:05 +0200 Subject: FULLPIPE: Implement ExCommand2 methods --- engines/fullpipe/messages.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'engines/fullpipe/messages.cpp') 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); } -- cgit v1.2.3