aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMatthew Stewart2018-07-23 22:21:56 -0400
committerEugene Sandulenko2018-08-09 08:37:30 +0200
commitaa68655742c94026c701dafc1ef6efb032774434 (patch)
tree594adfd9be24b2c087ab71d07f5f78ffedf9905e /engines
parent0e85e19ee7530b4d41668982e0b10f04d6f29741 (diff)
downloadscummvm-rg350-aa68655742c94026c701dafc1ef6efb032774434.tar.gz
scummvm-rg350-aa68655742c94026c701dafc1ef6efb032774434.tar.bz2
scummvm-rg350-aa68655742c94026c701dafc1ef6efb032774434.zip
STARTREK: Formatting corrections
Diffstat (limited to 'engines')
-rw-r--r--engines/startrek/filestream.h1
-rw-r--r--engines/startrek/graphics.cpp2
-rw-r--r--engines/startrek/menu.cpp8
-rw-r--r--engines/startrek/room.cpp2
-rw-r--r--engines/startrek/room.h1
-rw-r--r--engines/startrek/sprite.cpp20
-rw-r--r--engines/startrek/startrek.cpp8
-rw-r--r--engines/startrek/text.cpp6
8 files changed, 17 insertions, 31 deletions
diff --git a/engines/startrek/filestream.h b/engines/startrek/filestream.h
index a3d9381101..c5f5ef38cc 100644
--- a/engines/startrek/filestream.h
+++ b/engines/startrek/filestream.h
@@ -27,7 +27,6 @@
namespace StarTrek {
class FileStream {
-
public:
FileStream(Common::SeekableReadStream *stream, bool bigEndian);
~FileStream();
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 5cbb528752..c58f16f47e 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -298,7 +298,7 @@ void Graphics::drawSprite(const Sprite &sprite, ::Graphics::Surface *surface) {
// sprite's actual, full rectangle.
void Graphics::drawSprite(const Sprite &sprite, ::Graphics::Surface *surface, const Common::Rect &rect) {
Common::Rect spriteRect = Common::Rect(sprite.drawX, sprite.drawY,
- sprite.drawX+sprite.bitmap->width, sprite.drawY+sprite.bitmap->height);
+ sprite.drawX + sprite.bitmap->width, sprite.drawY + sprite.bitmap->height);
assert(_screenRect.contains(rect));
assert(spriteRect.contains(rect));
diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp
index e7d0b9abc1..e9cebca6a5 100644
--- a/engines/startrek/menu.cpp
+++ b/engines/startrek/menu.cpp
@@ -157,14 +157,14 @@ void StarTrekEngine::chooseMousePositionFromSprites(Sprite *sprites, int numSpri
}
void StarTrekEngine::drawMenuButtonOutline(SharedPtr<Bitmap> bitmap, byte color) {
- int lineWidth = bitmap->width-2;
- int offsetToBottom = (bitmap->height-3)*bitmap->width;
+ int lineWidth = bitmap->width - 2;
+ int offsetToBottom = (bitmap->height - 3) * bitmap->width;
byte *dest = bitmap->pixels + bitmap->width + 1;
while (lineWidth--) {
*dest = color;
- *(dest+offsetToBottom) = color;
+ *(dest + offsetToBottom) = color;
dest++;
}
@@ -175,7 +175,7 @@ void StarTrekEngine::drawMenuButtonOutline(SharedPtr<Bitmap> bitmap, byte color)
while (lineHeight--) {
*dest = color;
- *(dest+offsetToRight) = color;
+ *(dest + offsetToRight) = color;
dest += bitmap->width;
}
}
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 9806fedc33..fae52503af 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -107,7 +107,7 @@ Room::~Room() {
}
uint16 Room::readRdfWord(int offset) {
- return _rdfData[offset] | (_rdfData[offset+1]<<8);
+ return _rdfData[offset] | (_rdfData[offset + 1] << 8);
}
bool Room::actionHasCode(const Action &action) {
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 19585c36ea..b8d5145c85 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -53,7 +53,6 @@ const int RDF_BEAM_IN_POSITIONS = 0xaa;
const int RDF_SPAWN_POSITIONS = 0xba;
class Room {
-
public:
Room(StarTrekEngine *vm, const Common::String &name);
~Room();
diff --git a/engines/startrek/sprite.cpp b/engines/startrek/sprite.cpp
index 2d5d4f8d3c..61ff6a5174 100644
--- a/engines/startrek/sprite.cpp
+++ b/engines/startrek/sprite.cpp
@@ -26,22 +26,10 @@
namespace StarTrek {
Sprite::Sprite() :
- pos(),
- drawPriority(),
- drawPriority2(),
- field8(),
- bitmap(),
- drawMode(),
- textColor(),
- bitmapChanged(),
- rect2Valid(),
- isOnScreen(),
- field16(),
- lastDrawRect(),
- drawRect(),
- rectangle2(),
- drawX(),
- drawY()
+ pos(), drawPriority(0), drawPriority2(0), field8(0),
+ bitmap(), drawMode(0), textColor(0), bitmapChanged(false),
+ rect2Valid(false), isOnScreen(false), field16(false), lastDrawRect(),
+ drawRect(), rectangle2(), drawX(0), drawY(0)
{}
void Sprite::setBitmap(SharedPtr<Bitmap> b) {
diff --git a/engines/startrek/startrek.cpp b/engines/startrek/startrek.cpp
index 9a553d1116..f678d21a3d 100644
--- a/engines/startrek/startrek.cpp
+++ b/engines/startrek/startrek.cpp
@@ -1085,7 +1085,7 @@ SharedPtr<Bitmap> StarTrekEngine::loadAnimationFrame(const Common::String &filen
SharedPtr<Bitmap> bitmapToReturn;
char basename[5];
- strncpy(basename, filename.c_str()+1, 4);
+ strncpy(basename, filename.c_str() + 1, 4);
basename[4] = '\0';
char c = filename[0];
@@ -1841,7 +1841,7 @@ SharedPtr<FileStream> StarTrekEngine::loadFile(Common::String filename, int file
basename = filename;
extension = filename;
basename.replace(i, filename.size()-i, "");
- extension.replace(0, i+1, "");
+ extension.replace(0, i + 1, "");
break;
}
}
@@ -1927,8 +1927,8 @@ SharedPtr<FileStream> StarTrekEngine::loadFile(Common::String filename, int file
// the last character being incremented by one.
if ((basename.lastChar() >= '1' && basename.lastChar() <= '9') ||
(basename.lastChar() >= 'B' && basename.lastChar() <= 'Z')) {
- basename.setChar(basename.lastChar()-1, basename.size()-1);
- return loadFile(basename + "." + extension, fileIndex+1);
+ basename.setChar(basename.lastChar() - 1, basename.size() - 1);
+ return loadFile(basename + "." + extension, fileIndex + 1);
} else
error("Could not find file \'%s\'", filename.c_str());
}
diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp
index 0d6d469e2d..b53b0b903b 100644
--- a/engines/startrek/text.cpp
+++ b/engines/startrek/text.cpp
@@ -68,7 +68,7 @@ const char *StarTrekEngine::getNextTextLine(const char *text, char *lineOutput,
}
if (*text == ' ') {
*lineOutput = '\0';
- return text+1;
+ return text + 1;
}
if (lastSpaceOutput == nullptr) { // Long word couldn't fit on line
*lineOutput = '\0';
@@ -165,7 +165,7 @@ String StarTrekEngine::skipTextAudioPrompt(const String &str) {
text++;
}
- return String(text+1);
+ return String(text + 1);
}
String StarTrekEngine::playTextAudio(const String &str) {
@@ -186,7 +186,7 @@ String StarTrekEngine::playTextAudio(const String &str) {
soundFile[len] = '\0';
playSpeech(soundFile);
- return String(text+1);
+ return String(text + 1);
}
int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, bool rclickCancelsChoice) {