aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorColin Snover2017-11-16 10:32:47 -0600
committerEugene Sandulenko2017-11-18 22:35:12 +0100
commita475cec2aab9a56e618e7858373b40b0cbda5aed (patch)
treeda68cca3d6b76d7284316230379193d0b22241e8 /engines
parent715d4bd76ab749b88f888ea8196ce252de6140ad (diff)
downloadscummvm-rg350-a475cec2aab9a56e618e7858373b40b0cbda5aed.tar.gz
scummvm-rg350-a475cec2aab9a56e618e7858373b40b0cbda5aed.tar.bz2
scummvm-rg350-a475cec2aab9a56e618e7858373b40b0cbda5aed.zip
FULLPIPE: Remove unnecessary constructors
These appear to be default member-wise copy constructors or POD constructors that zero all members. I suspect that quite a few pointer-taking constructors are actually supposed to be copy-constructors but since they don't all just do default member-wise copies I do not feel confident in changing them without verifying that there are not separate copy constructors in the disassembly, and I don't have the database for this game.
Diffstat (limited to 'engines')
-rw-r--r--engines/fullpipe/input.cpp24
-rw-r--r--engines/fullpipe/input.h3
-rw-r--r--engines/fullpipe/messages.cpp18
-rw-r--r--engines/fullpipe/messages.h2
-rw-r--r--engines/fullpipe/motion.cpp13
5 files changed, 3 insertions, 57 deletions
diff --git a/engines/fullpipe/input.cpp b/engines/fullpipe/input.cpp
index 6bd992a4d2..d692f87366 100644
--- a/engines/fullpipe/input.cpp
+++ b/engines/fullpipe/input.cpp
@@ -71,7 +71,7 @@ void setInputDisabled(bool state) {
}
void InputController::addCursor(CursorInfo *cursor) {
- CursorInfo *newc = new CursorInfo(cursor);
+ CursorInfo *newc = new CursorInfo(*cursor);
const Dims dims = cursor->picture->getDimensions();
newc->width = dims.x;
@@ -119,28 +119,6 @@ void InputController::setCursor(int cursorId) {
}
}
-CursorInfo::CursorInfo() {
- pictureId = 0;
- picture = 0;
- hotspotX = 0;
- hotspotY = 0;
- itemPictureOffsX = 0;
- itemPictureOffsY = 0;
- width = 0;
- height = 0;
-}
-
-CursorInfo::CursorInfo(CursorInfo *src) {
- pictureId = src->pictureId;
- picture = src->picture;
- hotspotX = src->hotspotX;
- hotspotY = src->hotspotY;
- itemPictureOffsX = src->itemPictureOffsX;
- itemPictureOffsY = src->itemPictureOffsY;
- width = src->width;
- height = src->height;
-}
-
void FullpipeEngine::setCursor(int id) {
if (_inputController)
_inputController->setCursor(id);
diff --git a/engines/fullpipe/input.h b/engines/fullpipe/input.h
index 6a1d0f8b07..8efb1c40c6 100644
--- a/engines/fullpipe/input.h
+++ b/engines/fullpipe/input.h
@@ -39,8 +39,7 @@ struct CursorInfo {
int width;
int height;
- CursorInfo();
- CursorInfo(CursorInfo *src);
+ CursorInfo() { memset(this, 0, sizeof(*this)); }
};
typedef Common::Array<CursorInfo *> CursorsArray;
diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp
index 632e0546cf..ece904d682 100644
--- a/engines/fullpipe/messages.cpp
+++ b/engines/fullpipe/messages.cpp
@@ -37,7 +37,7 @@ ExCommand::ExCommand() {
_parId = 0;
}
-ExCommand::ExCommand(ExCommand *src) : Message(src) {
+ExCommand::ExCommand(ExCommand *src) : Message(*src) {
_field_3C = 1;
_messageNum = src->_messageNum;
_excFlags = src->_excFlags;
@@ -174,22 +174,6 @@ Message::Message() {
_field_34 = 0;
}
-Message::Message(Message *src) {
- _parentId = src->_parentId;
- _messageKind = src->_messageKind;
- _x = src->_x;
- _y = src->_y;
- _field_14 = src->_field_14;
- _sceneClickX = src->_sceneClickX;
- _sceneClickY = src->_sceneClickY;
- _field_20 = src->_field_20;
- _field_24 = src->_field_24;
- _param = src->_param;
- _field_2C = src->_field_2C;
- _field_30 = src->_field_30;
- _field_34 = src->_field_34;
-}
-
Message::Message(int16 parentId, int messageKind, int x, int y, int a6, int a7, int sceneClickX, int sceneClickY, int a10) {
_messageKind = messageKind;
_parentId = parentId;
diff --git a/engines/fullpipe/messages.h b/engines/fullpipe/messages.h
index 74af61ca5d..91677a172d 100644
--- a/engines/fullpipe/messages.h
+++ b/engines/fullpipe/messages.h
@@ -53,8 +53,6 @@ class Message : public CObject {
public:
Message();
- Message(Message *src);
- virtual ~Message() {}
Message(int16 parentId, int messageKind, int x, int y, int a6, int a7, int sceneClickX, int sceneClickY, int a10);
};
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 005ed707c0..4f854b6304 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -713,19 +713,6 @@ MctlConnectionPoint::MctlConnectionPoint() {
_mctlmirror = 0;
}
-MctlMQ::MctlMQ(MctlMQ *src) {
- index = src->index;
- pt1 = src->pt1;
- pt2 = src->pt2;
- distance1 = src->distance1;
- distance2 = src->distance2;
- subIndex = src->subIndex;
- item1Index = src->item1Index;
- items = src->items;
- itemsCount = src->itemsCount;
- flags = src->flags;
-}
-
void MctlMQ::clear() {
index = 0;
pt1.x = pt1.y = 0;