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.
This commit is contained in:
Colin Snover 2017-11-16 10:32:47 -06:00 committed by Eugene Sandulenko
parent 715d4bd76a
commit a475cec2aa
5 changed files with 3 additions and 57 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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);
};

View File

@ -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;