Permalink
Browse files

STARTREK: Formatting corrections

  • Loading branch information...
Drenn1 authored and sev- committed Jul 24, 2018
1 parent 0e85e19 commit aa68655742c94026c701dafc1ef6efb032774434
@@ -27,7 +27,6 @@
namespace StarTrek {

class FileStream {

public:
FileStream(Common::SeekableReadStream *stream, bool bigEndian);
~FileStream();
@@ -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));
@@ -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;
}
}
@@ -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) {
@@ -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();
@@ -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) {
@@ -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());
}
@@ -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) {

0 comments on commit aa68655

Please sign in to comment.