diff options
author | Torbjörn Andersson | 2006-05-08 10:29:20 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2006-05-08 10:29:20 +0000 |
commit | 8179d3e80b7607b8078182644fbf59591b017752 (patch) | |
tree | 1b62189fb321947e66611e99ae88015a244e9b5f /engines | |
parent | 3830ac06b367b920ca012c5c734e1bc32fcbcd73 (diff) | |
download | scummvm-rg350-8179d3e80b7607b8078182644fbf59591b017752.tar.gz scummvm-rg350-8179d3e80b7607b8078182644fbf59591b017752.tar.bz2 scummvm-rg350-8179d3e80b7607b8078182644fbf59591b017752.zip |
Missed a couple of switch cleanups.
svn-id: r22385
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/screen.cpp | 173 | ||||
-rw-r--r-- | engines/kyra/seqplayer.cpp | 15 | ||||
-rw-r--r-- | engines/kyra/sequences_v1.cpp | 2 |
3 files changed, 104 insertions, 86 deletions
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 495626e539..196c83a602 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -964,17 +964,17 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int uint8 color = shapeBuffer[j * shapeWidth + xpos]; if (color != 0) { switch (ppc) { - case 0: - *dst = color; - break; + case 0: + *dst = color; + break; - case 1: - for (int i = 0; i < tableLoopCount; ++i) { - color = table[color]; - } - break; - - case 2: { + case 1: + for (int i = 0; i < tableLoopCount; ++i) { + color = table[color]; + } + break; + + case 2: { int temp = drawShapeVar4 + drawShapeVar5; if (temp & 0xFF00) { drawShapeVar4 = temp & 0xFF; @@ -984,28 +984,29 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int } else { drawShapeVar4 = temp; } - } break; - - case 7: - case 3: - color = *dst; - for (int i = 0; i < tableLoopCount; ++i) { - color = table[color]; - } - break; - - case 4: - color = table2[color]; - break; - - case 5: - color = table2[color]; - for (int i = 0; i < tableLoopCount; ++i) { - color = table[color]; - } - break; - - case 6: { + } + break; + + case 7: + case 3: + color = *dst; + for (int i = 0; i < tableLoopCount; ++i) { + color = table[color]; + } + break; + + case 4: + color = table2[color]; + break; + + case 5: + color = table2[color]; + for (int i = 0; i < tableLoopCount; ++i) { + color = table[color]; + } + break; + + case 6: { int temp = drawShapeVar4 + drawShapeVar5; if (temp & 0xFF00) { drawShapeVar4 = temp & 0xFF; @@ -1016,9 +1017,10 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int drawShapeVar4 = temp; color = table2[color]; } - } break; - - case 8: { + } + break; + + case 8: { int offset = dst - dstStart; uint8 pixel = *(_shapePages[0] + offset); pixel &= 0x7F; @@ -1026,9 +1028,10 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int if (drawLayer < pixel) { color = *(_shapePages[1] + offset); } - } break; - - case 9: { + } + break; + + case 9: { int offset = dst - dstStart; uint8 pixel = *(_shapePages[0] + offset); pixel &= 0x7F; @@ -1040,9 +1043,10 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int color = table[color]; } } - } break; - - case 10: { + } + break; + + case 10: { int offset = dst - dstStart; uint8 pixel = *(_shapePages[0] + offset); pixel &= 0x7F; @@ -1059,10 +1063,11 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int } drawShapeVar4 = temp & 0xFF; } - } break; + } + break; - case 15: - case 11: { + case 15: + case 11: { int offset = dst - dstStart; uint8 pixel = *(_shapePages[0] + offset); pixel &= 0x7F; @@ -1075,9 +1080,10 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int color = table[color]; } } - } break; - - case 12: { + } + break; + + case 12: { int offset = dst - dstStart; uint8 pixel = *(_shapePages[0] + offset); pixel &= 0x7F; @@ -1087,9 +1093,10 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int } else { color = table2[color]; } - } break; - - case 13: { + } + break; + + case 13: { int offset = dst - dstStart; uint8 pixel = *(_shapePages[0] + offset); pixel &= 0x7F; @@ -1102,9 +1109,10 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int color = table[color]; } } - } break; - - case 14: { + } + break; + + case 14: { int offset = dst - dstStart; uint8 pixel = *(_shapePages[0] + offset); pixel &= 0x7F; @@ -1124,17 +1132,19 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int color = table2[color]; } } - } break; - - case 16: { + } + break; + + case 16: { uint8 newColor = table3[color]; if (!(newColor & 0x80)) { color = *dst; color = table4[color + (newColor << 8)]; } - } break; + } + break; - case 17: { + case 17: { for (int i = 0; i < tableLoopCount; ++i) { color = table[color]; } @@ -1143,9 +1153,10 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int color = *dst; color = table4[color + (newColor << 8)]; } - } break; - - case 18: { + } + break; + + case 18: { int temp = drawShapeVar4 + drawShapeVar5; if (temp & 0xFF00) { drawShapeVar4 = temp & 0xFF; @@ -1160,10 +1171,11 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int } else { drawShapeVar4 = temp; } - } break; - - case 23: - case 19: { + } + break; + + case 23: + case 19: { color = *dst; for (int i = 0; i < tableLoopCount; ++i) { color = table[color]; @@ -1173,18 +1185,20 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int color = *dst; color = table4[color + (newColor << 8)]; } - } break; + } + break; - case 20: { + case 20: { color = table2[color]; uint8 newColor = table3[color]; if (!(newColor & 0x80)) { color = *dst; color = table4[color + (newColor << 8)]; } - } break; + } + break; - case 21: { + case 21: { color = table2[color]; for (int i = 0; i < tableLoopCount; ++i) { color = table[color]; @@ -1194,9 +1208,10 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int color = *dst; color = table4[color + (newColor << 8)]; } - } break; + } + break; - case 22: { + case 22: { int temp = drawShapeVar4 + drawShapeVar5; if (temp & 0xFF00) { drawShapeVar4 = temp & 0xFF; @@ -1217,9 +1232,10 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int color = table4[color + (newColor << 8)]; } } - } break; + } + break; - case 24: { + case 24: { int offset = dst - dstStart; uint8 pixel = *(_shapePages[0] + offset); pixel &= 0x7F; @@ -1232,11 +1248,12 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int color = *dst; color = table4[color + (newColor << 8)]; } - } break; - - default: - warning("unhandled ppc: %d", ppc); - break; + } + break; + + default: + warning("unhandled ppc: %d", ppc); + break; } *dst = color; } diff --git a/engines/kyra/seqplayer.cpp b/engines/kyra/seqplayer.cpp index 3233afcd58..57cc2a173b 100644 --- a/engines/kyra/seqplayer.cpp +++ b/engines/kyra/seqplayer.cpp @@ -346,13 +346,14 @@ void SeqPlayer::s1_copyRegionSpecial() { _screen->copyRegion(152, 56, 152, 56, 48, 48, 2, 0); break; case 4: { - _screen->_charWidth = -2; - const int x = (Screen::SCREEN_W - _screen->getTextWidth(copyStr)) / 2; - const int y = 179; - _screen->setTextColorMap(colorMap); - _screen->printText(copyStr, x + 1, y + 1, 0xB, 0xC); - _screen->printText(copyStr, x, y, 0xF, 0xC); - } break; + _screen->_charWidth = -2; + const int x = (Screen::SCREEN_W - _screen->getTextWidth(copyStr)) / 2; + const int y = 179; + _screen->setTextColorMap(colorMap); + _screen->printText(copyStr, x + 1, y + 1, 0xB, 0xC); + _screen->printText(copyStr, x, y, 0xF, 0xC); + } + break; case 5: _screen->_curPage = 2; break; diff --git a/engines/kyra/sequences_v1.cpp b/engines/kyra/sequences_v1.cpp index 2760455e95..502b2405f7 100644 --- a/engines/kyra/sequences_v1.cpp +++ b/engines/kyra/sequences_v1.cpp @@ -831,6 +831,7 @@ void KyraEngine::seq_playDrinkPotionAnim(int item, int unk2, int flags) { red = 33; green = 66; blue = 100; + break; } red = (uint8)((double)red * 0.63); green = (uint8)((double)green * 0.63); @@ -1355,7 +1356,6 @@ int KyraEngine::handleBeadState() { timer2 = 0; _lastDisplayedPanPage = 0; return 1; - break; case 1: if (beadState1.x != -1) { |