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

sev- sev at scummvm.org
Wed Jan 8 14:54:19 CET 2014


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

Summary:
70f7770c6a FULLPIPE: Started fixing ObjstateCommand object inheritance
a40c607573 FULLPIPE: Complete ObjstateCommand class


Commit: 70f7770c6a5e5febc43ee81a8a1b33547c366c37
    https://github.com/scummvm/scummvm/commit/70f7770c6a5e5febc43ee81a8a1b33547c366c37
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-01-08T01:35:23-08:00

Commit Message:
FULLPIPE: Started fixing ObjstateCommand object inheritance

Changed paths:
    engines/fullpipe/messages.cpp
    engines/fullpipe/messages.h



diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp
index 3430897..9af4c59 100644
--- a/engines/fullpipe/messages.cpp
+++ b/engines/fullpipe/messages.cpp
@@ -234,12 +234,16 @@ ObjstateCommand::ObjstateCommand() {
 	_objCommandName = 0;
 }
 
+ObjstateCommand::~ObjstateCommand() {
+	free(_objCommandName);
+}
+
 bool ObjstateCommand::load(MfcArchive &file) {
 	debug(5, "ObjStateCommand::load()");
 
 	_objtype = kObjTypeObjstateCommand;
 
-	_cmd.load(file);
+	ExCommand::load(file);
 
 	_value = file.readUint32LE();
 
@@ -248,6 +252,12 @@ bool ObjstateCommand::load(MfcArchive &file) {
 	return true;
 }
 
+ObjstateCommand *ObjstateCommand::createClone() {
+	warning("STUB: ObjstateCommand::createClone()");
+
+	return this;
+}
+
 MessageQueue::MessageQueue() {
 	_field_14 = 0;
 	_parId = 0;
diff --git a/engines/fullpipe/messages.h b/engines/fullpipe/messages.h
index 7f70838..7534513 100644
--- a/engines/fullpipe/messages.h
+++ b/engines/fullpipe/messages.h
@@ -92,15 +92,18 @@ class ExCommand2 : public ExCommand {
 	virtual ExCommand2 *createClone();
 };
 
-class ObjstateCommand : public CObject {
+class ObjstateCommand : public ExCommand {
  public:
-	ExCommand _cmd;
 	char *_objCommandName;
 	int _value;
 
  public:
 	ObjstateCommand();
+	virtual ~ObjstateCommand();
+
 	virtual bool load(MfcArchive &file);
+
+	virtual ObjstateCommand *createClone();
 };
 
 class MessageQueue : public CObject {


Commit: a40c6075735869b6f802552f0a9966445f515d0d
    https://github.com/scummvm/scummvm/commit/a40c6075735869b6f802552f0a9966445f515d0d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-01-08T05:26:37-08:00

Commit Message:
FULLPIPE: Complete ObjstateCommand class

Changed paths:
    engines/fullpipe/messages.cpp
    engines/fullpipe/messages.h



diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp
index 9af4c59..b0abe30 100644
--- a/engines/fullpipe/messages.cpp
+++ b/engines/fullpipe/messages.cpp
@@ -234,6 +234,13 @@ ObjstateCommand::ObjstateCommand() {
 	_objCommandName = 0;
 }
 
+ObjstateCommand::ObjstateCommand(ObjstateCommand *src) : ExCommand(src) {
+	_value = src->_value;
+	_objCommandName = (char *)calloc(strlen(src->_objCommandName) + 1, 1);
+
+	strncpy(_objCommandName, src->_objCommandName, strlen(src->_objCommandName));
+}
+
 ObjstateCommand::~ObjstateCommand() {
 	free(_objCommandName);
 }
@@ -253,9 +260,7 @@ bool ObjstateCommand::load(MfcArchive &file) {
 }
 
 ObjstateCommand *ObjstateCommand::createClone() {
-	warning("STUB: ObjstateCommand::createClone()");
-
-	return this;
+	return new ObjstateCommand(this);
 }
 
 MessageQueue::MessageQueue() {
diff --git a/engines/fullpipe/messages.h b/engines/fullpipe/messages.h
index 7534513..2e8a29c 100644
--- a/engines/fullpipe/messages.h
+++ b/engines/fullpipe/messages.h
@@ -99,6 +99,7 @@ class ObjstateCommand : public ExCommand {
 
  public:
 	ObjstateCommand();
+	ObjstateCommand(ObjstateCommand *src);
 	virtual ~ObjstateCommand();
 
 	virtual bool load(MfcArchive &file);






More information about the Scummvm-git-logs mailing list