IMMORTAL: Fix formatting for switch statements

This commit is contained in:
Quote58 2023-01-22 16:25:55 -05:00 committed by Eugene Sandulenko
parent 9cbe97d557
commit 4103ebe600
4 changed files with 260 additions and 239 deletions

View File

@ -394,6 +394,7 @@ void ImmortalEngine::printChr(char c) {
case 'M':
case 'W':
_penX += 8;
// fall through
default:
break;
}
@ -407,11 +408,13 @@ void ImmortalEngine::printChr(char c) {
_penX -= 3;
break;
case 'j':
// fall through
case 't':
_penX -= 2;
break;
case 'l':
_penX -= 4;
// fall through
default:
break;
}
@ -1004,11 +1007,13 @@ void ImmortalEngine::fixPause() {
// This is a nasty bit of code isn't it? It's accurate to the source though :D
switch (_playing) {
case kSongText:
// fall through
case kSongMaze:
if (_themePaused) {
musicUnPause(_themeID);
break;
}
// fall through
default:
musicPause(_themeID);
break;
@ -1021,6 +1026,7 @@ void ImmortalEngine::fixPause() {
musicUnPause(_combatID);
break;
}
// fall through
default:
musicPause(_combatID);
break;

View File

@ -158,6 +158,7 @@ void ImmortalEngine::trapKeys() {
break;
case kActionSound:
toggleSound();
// fall through
default:
break;
}
@ -172,9 +173,12 @@ int ImmortalEngine::keyOrButton() {
switch (_pressedAction) {
case kActionKey:
button = _pressedAction;
break;
case kActionFire:
// fall through
case kActionButton:
button = 13;
// fall through
default:
break;
}
@ -382,7 +386,7 @@ bool ImmortalEngine::fromOldGame() {
if ((certInv & 4) != 0) {
//room.makeObject(3, 0, kSporesFrame, antiType);
}
// fall through
default:
break;
}
@ -442,17 +446,17 @@ void ImmortalEngine::makeCertificate() {
if (true/*room.monster[kPlayerID].hasObject(wowCharmType)*/) {
_certificate[kCertInvLo] |= 4;
}
// fall through
case 3:
if (true/*room.monster[kPlayerID].hasObject(faceRingType)*/) {
_certificate[kCertInvLo] |= 1;
}
// fall through
case 4:
if (true/*room.monster[kPlayerID].hasObject(coffeeType)*/) {
_certificate[kCertInvLo] |= 2;
}
// fall through
case 7:
if (true/*room.monster[kPlayerID].hasObject(bronzeType)*/) {
_certificate[kCertInvLo] |= 1;
@ -465,7 +469,7 @@ void ImmortalEngine::makeCertificate() {
if (true/*room.monster[kPlayerID].hasObject(antiType)*/) {
_certificate[kCertInvLo] |= 4;
}
// fall through
default:
_lastCertLen = 13;
uint8 checksum[4];

View File

@ -179,12 +179,16 @@ bool ImmortalEngine::textSub(Str s, FadeType f, int n) {
myDelay(5);
switch (chr) {
case '?':
// fall through
case ':':
myDelay(13);
// fall through
case '.':
myDelay(13);
// fall through
case ',':
myDelay(13);
// fall through
default:
break;
}
@ -273,11 +277,16 @@ void ImmortalEngine::textDoSpace(Common::String s, int index) {
index++;
switch (s[index]) {
case '=':
// fall through
case '@':
// fall through
case '%':
// fall through
case '[':
// fall through
case ' ':
foundEnd = true;
// fall through
default:
break;
}
@ -388,7 +397,9 @@ void ImmortalEngine::myDelay(int j) {
break;
case 0:
Utilities::delay(1);
// fall through
case 2:
// fall through
default:
break;
}