From a230368de597e291ac4321fc77e3a6b5ffaafc12 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 4 Jan 2014 15:01:27 +0200 Subject: FULLPIPE: More code to ExCommand class --- engines/fullpipe/messages.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'engines/fullpipe/messages.cpp') diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp index cdb457e59e..7db168d92d 100644 --- a/engines/fullpipe/messages.cpp +++ b/engines/fullpipe/messages.cpp @@ -41,7 +41,10 @@ ExCommand::ExCommand(ExCommand *src) : Message(src) { _messageNum = src->_messageNum; _excFlags = src->_excFlags; _parId = src->_parId; +} +ExCommand *ExCommand::createClone(ExCommand *src) { + return new ExCommand(src); } ExCommand::ExCommand(int16 parentId, int messageKind, int messageNum, int x, int y, int a7, int a8, int sceneClickX, int sceneClickY, int a11) : @@ -78,6 +81,8 @@ bool ExCommand::load(MfcArchive &file) { _parId = file.readUint32LE(); } + _objtype = kObjTypeExCommand; + return true; } @@ -120,6 +125,50 @@ void ExCommand::handle() { } } +void ExCommand::setf3c(int val) { + if (val != -1) + _field_3C = val; + + _field_34 = 1; +} + +void ExCommand::firef34() { + if (_field_34) { + if (_field_3C >= _keyCode) { + _field_34 = 0; + + sendMessage(); + + if (!_field_30 ) + setf3c(_field_2C); + } + } +} + +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; + _objtype = kObjTypeExCommand2; + + warning("STUB: ExCommand2::ExCommand2()"); +} + +ExCommand2::ExCommand2(ExCommand2 *src) : ExCommand(src) { + warning("STUB: ExCommand2::ExCommand2()"); +} + +ExCommand2::~ExCommand2() { + free(_points); +} + +ExCommand *ExCommand2::createClone(ExCommand *src) { + if (_objtype == kObjTypeExCommand) + return new ExCommand(src); + else if (_objtype == kObjTypeExCommand2) + return new ExCommand2((ExCommand2 *)src); + + error("ExCommand2::createClone(): Wrong object type: %d", _objtype); +} + Message::Message() { _messageKind = 0; _parentId = 0; -- cgit v1.2.3