diff options
author | Matthew Stewart | 2018-08-02 02:15:29 -0400 |
---|---|---|
committer | Eugene Sandulenko | 2018-08-09 08:37:30 +0200 |
commit | ba05b5539ba458c87cb804a5658b153a48f7338b (patch) | |
tree | 11619a5d27de22b53bb70e7770c3458f6818a909 /engines/startrek | |
parent | ce42cd940a8fd3706aebc9ba79de6823939ab53b (diff) | |
download | scummvm-rg350-ba05b5539ba458c87cb804a5658b153a48f7338b.tar.gz scummvm-rg350-ba05b5539ba458c87cb804a5658b153a48f7338b.tar.bz2 scummvm-rg350-ba05b5539ba458c87cb804a5658b153a48f7338b.zip |
STARTREK: Various code cleanup
Diffstat (limited to 'engines/startrek')
-rw-r--r-- | engines/startrek/filestream.cpp | 8 | ||||
-rw-r--r-- | engines/startrek/iwfile.cpp | 1 | ||||
-rw-r--r-- | engines/startrek/iwfile.h | 1 | ||||
-rw-r--r-- | engines/startrek/module.mk | 1 | ||||
-rw-r--r-- | engines/startrek/object.cpp | 27 | ||||
-rw-r--r-- | engines/startrek/object.h | 64 | ||||
-rw-r--r-- | engines/startrek/room.cpp | 2 |
7 files changed, 37 insertions, 67 deletions
diff --git a/engines/startrek/filestream.cpp b/engines/startrek/filestream.cpp index 1cb83f53fa..b4fa2d27e5 100644 --- a/engines/startrek/filestream.cpp +++ b/engines/startrek/filestream.cpp @@ -57,9 +57,9 @@ uint16 FileStream::readUint16() { assert(_pos + 2 <= size()); uint16 w; if (_bigEndian) - w = _data[_pos + 1] | (_data[_pos] << 8); + w = READ_BE_UINT16(_data + _pos); else - w = _data[_pos] | (_data[_pos + 1] << 8); + w = READ_LE_UINT16(_data + _pos); _pos += 2; return w; } @@ -68,9 +68,9 @@ uint32 FileStream::readUint32() { assert(_pos + 4 <= size()); uint32 w; if (_bigEndian) - w = _data[_pos + 3] | (_data[_pos + 2] << 8) | (_data[_pos + 1] << 16) | (_data[_pos] << 24); + w = READ_BE_UINT32(_data + _pos); else - w = _data[_pos] | (_data[_pos + 1] << 8) | (_data[_pos + 2] << 16) | (_data[_pos + 3] << 24); + w = READ_LE_UINT32(_data + _pos); _pos += 4; return w; } diff --git a/engines/startrek/iwfile.cpp b/engines/startrek/iwfile.cpp index e61f6a09b0..d1e7355517 100644 --- a/engines/startrek/iwfile.cpp +++ b/engines/startrek/iwfile.cpp @@ -1,4 +1,3 @@ - /* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names diff --git a/engines/startrek/iwfile.h b/engines/startrek/iwfile.h index dfd59d3ee7..f5144746d9 100644 --- a/engines/startrek/iwfile.h +++ b/engines/startrek/iwfile.h @@ -1,4 +1,3 @@ - /* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names diff --git a/engines/startrek/module.mk b/engines/startrek/module.mk index 51f38538d7..eebaad52d4 100644 --- a/engines/startrek/module.mk +++ b/engines/startrek/module.mk @@ -13,7 +13,6 @@ MODULE_OBJS = \ lzss.o \ math.o \ menu.o \ - object.o \ room.o \ saveload.o \ sound.o \ diff --git a/engines/startrek/object.cpp b/engines/startrek/object.cpp deleted file mode 100644 index f0eb6d6d98..0000000000 --- a/engines/startrek/object.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "object.h" - -namespace StarTrek { - -} // End of namespace StarTrek diff --git a/engines/startrek/object.h b/engines/startrek/object.h index 3abcbe9091..9c2bf0d610 100644 --- a/engines/startrek/object.h +++ b/engines/startrek/object.h @@ -133,45 +133,45 @@ struct Actor { public: Actor() : - spriteDrawn(), + spriteDrawn(false), //animFilename[16], - animType(), + animType(0), sprite(), //bitmapFilename[10], - scale(), + scale(0), animFile(), - numAnimFrames(), - animFrame(), - frameToStartNextAnim(), - pos(), - field60(), - field62(), - triggerActionWhenAnimFinished(), - finishedAnimActionParam(), + numAnimFrames(0), + animFrame(0), + frameToStartNextAnim(0), + pos(Common::Point(0, 0)), + field60(0), + field62(0), + triggerActionWhenAnimFinished(false), + finishedAnimActionParam(0), //animationString2[8](), - field70(), - field72(), - field74(), - field76(), - iwSrcPosition(), - iwDestPosition(), - granularPosX(), - granularPosY(), - speedX(), - speedY(), - - dest(), - field90(), - field92(), - - direction(), - field94(), - field96(), + field70(0), + field72(0), + field74(0), + field76(0), + iwSrcPosition(0), + iwDestPosition(0), + granularPosX(0), + granularPosY(0), + speedX(0), + speedY(0), + + dest(Common::Point(0, 0)), + field90(0), + field92(0), + + direction(0), + field94(0), + field96(0), //char animationString[10]; - fielda2(), - fielda4(), - fielda6() { + fielda2(0), + fielda4(0), + fielda6(0) { memset(animFilename, 0, sizeof(animFilename)); memset(bitmapFilename, 0, sizeof(bitmapFilename)); memset(animationString2, 0, sizeof(animationString2)); diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp index 7e5c50f797..73776d7fa6 100644 --- a/engines/startrek/room.cpp +++ b/engines/startrek/room.cpp @@ -113,7 +113,7 @@ Room::~Room() { } uint16 Room::readRdfWord(int offset) { - return _rdfData[offset] | (_rdfData[offset + 1] << 8); + return READ_LE_UINT16((_rdfData + offset)); } bool Room::actionHasCode(const Action &action) { |