LAB: Fix the coding style of a some if/else statements

This commit is contained in:
Strangerke 2015-12-14 15:27:14 +01:00 committed by Willem Jan Palenstijn
parent acaece288f
commit 52d0243eff
5 changed files with 16 additions and 28 deletions

View File

@ -315,8 +315,7 @@ bool LabEngine::doUse(uint16 curInv) {
if (_conditions->in(kCondLampOn)) {
drawStaticMessage(kTextTurnLampOff);
_conditions->exclElement(kCondLampOn);
}
else {
} else {
drawStaticMessage(kTextTurnkLampOn);
_conditions->inclElement(kCondLampOn);
}

View File

@ -89,8 +89,10 @@ void Image::blitBitmap(uint16 xs, uint16 ys, Image *imDest,
while (ww-- > 0) {
byte c = *ss++;
if (c) *dd++ = c - 1;
else dd++;
if (c)
*dd++ = c - 1;
else
dd++;
}
s += _width;

View File

@ -57,14 +57,12 @@ void Intro::introEatMessages() {
return;
}
if (msg == NULL)
if (!msg)
return;
else {
if (((msg->_msgClass == MOUSEBUTTONS) && (IEQUALIFIER_RIGHTBUTTON & msg->_qualifier)) ||
((msg->_msgClass == RAWKEY) && (msg->_code == 27))
)
_quitIntro = true;
}
if (((msg->_msgClass == MOUSEBUTTONS) && (IEQUALIFIER_RIGHTBUTTON & msg->_qualifier))
|| ((msg->_msgClass == RAWKEY) && (msg->_code == 27)))
_quitIntro = true;
}
}
@ -164,9 +162,7 @@ void Intro::doPictText(const char *filename, TextFont *msgFont, bool isScreen) {
delete[] textBuffer;
return;
}
else if (cls == MOUSEBUTTONS) {
} else if (cls == MOUSEBUTTONS) {
if (IEQUALIFIER_LEFTBUTTON & qualifier) {
if (end) {
if (isScreen)

View File

@ -159,8 +159,7 @@ Common::String Resource::translateFileName(Common::String filename) {
fileNameStrFinal = "GAME/SPICT/";
else
fileNameStrFinal = "GAME/PICT/";
}
else if (filename.hasPrefix("LAB:"))
} else if (filename.hasPrefix("LAB:"))
fileNameStrFinal = "GAME/";
else if (filename.hasPrefix("MUSIC:"))
fileNameStrFinal = "GAME/MUSIC/";

View File

@ -60,7 +60,6 @@ uint16 Utils::scaleY(uint16 y) {
return ((y * 10) / 24);
}
uint16 Utils::mapScaleX(uint16 x) {
if (_vm->_isHiRes)
return (x - 45);
@ -110,9 +109,8 @@ Common::Point Utils::vgaUnscale(Common::Point pos) {
if (_vm->_isHiRes) {
result.x = pos.x / 2;
result.y = (pos.y * 5) / 12;
} else {
} else
result = pos;
}
return result;
}
@ -213,9 +211,7 @@ void Utils::VUnDiffByteByte(byte *dest, byte *diff, uint16 bytesPerRow) {
if (skip == 255) {
counter += copy;
break;
}
else {
} else {
curPtr += (skip * bytesPerRow);
while (copy) {
@ -248,9 +244,7 @@ void Utils::VUnDiffByteWord(uint16 *dest, uint16 *diff, uint16 bytesPerRow) {
if (skip == 255) {
counter += copy;
break;
}
else {
} else {
curPtr += (skip * wordsPerRow);
while (copy) {
@ -283,9 +277,7 @@ void Utils::VUnDiffByteLong(uint32 *dest, uint32 *diff, uint16 bytesPerRow) {
if (skip == 255) {
counter += copy;
break;
}
else {
} else {
_curPtr += (skip * longsperrow);
while (copy) {