aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/seqplayer.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2007-04-15 16:41:20 +0000
committerJohannes Schickel2007-04-15 16:41:20 +0000
commit21b2c7bceb5947e1eaa79890fe24f59def54aef9 (patch)
treed13d67e0c2c2db33651a51eb24679bac867a09d8 /engines/kyra/seqplayer.cpp
parente962db5b6d6856a31e52f7e3c4038a0f8f47e25d (diff)
downloadscummvm-rg350-21b2c7bceb5947e1eaa79890fe24f59def54aef9.tar.gz
scummvm-rg350-21b2c7bceb5947e1eaa79890fe24f59def54aef9.tar.bz2
scummvm-rg350-21b2c7bceb5947e1eaa79890fe24f59def54aef9.zip
Formatting/Cleanup.
svn-id: r26511
Diffstat (limited to 'engines/kyra/seqplayer.cpp')
-rw-r--r--engines/kyra/seqplayer.cpp64
1 files changed, 29 insertions, 35 deletions
diff --git a/engines/kyra/seqplayer.cpp b/engines/kyra/seqplayer.cpp
index cf5eb9cb90..591eb29f9b 100644
--- a/engines/kyra/seqplayer.cpp
+++ b/engines/kyra/seqplayer.cpp
@@ -74,11 +74,11 @@ uint8 *SeqPlayer::setPanPages(int pageNum, int shape) {
uint16 numShapes = READ_LE_UINT16(data);
if (shape < numShapes) {
uint32 offs = 0;
- if (_vm->gameFlags().useAltShapeHeader) {
+ if (_vm->gameFlags().useAltShapeHeader)
offs = READ_LE_UINT32(data + 2 + shape * 4);
- } else {
+ else
offs = READ_LE_UINT16(data + 2 + shape * 2);
- }
+
if (offs != 0) {
data += offs;
uint16 sz = READ_LE_UINT16(data + 6);
@@ -139,9 +139,8 @@ void SeqPlayer::s1_wsaOpen() {
void SeqPlayer::s1_wsaClose() {
uint8 wsaObj = *_seqData++;
assert(wsaObj < ARRAYSIZE(_seqMovies));
- if (_seqMovies[wsaObj].movie) {
+ if (_seqMovies[wsaObj].movie)
_seqMovies[wsaObj].movie->close();
- }
}
void SeqPlayer::s1_wsaPlayFrame() {
@@ -207,23 +206,21 @@ void SeqPlayer::s1_shuffleScreen() {
void SeqPlayer::s1_copyView() {
int y = 128;
- if (!_copyViewOffs) {
+ if (!_copyViewOffs)
y -= 8;
- }
- if (_specialBuffer && !_copyViewOffs) {
+
+ if (_specialBuffer && !_copyViewOffs)
_screen->copyToPage0(16, y, 3, _specialBuffer);
- } else {
+ else
_screen->copyRegion(0, 16, 0, 16, 320, y, 2, 0);
- }
}
void SeqPlayer::s1_loopInit() {
uint8 seqLoop = *_seqData++;
- if (seqLoop < ARRAYSIZE(_seqLoopTable)) {
+ if (seqLoop < ARRAYSIZE(_seqLoopTable))
_seqLoopTable[seqLoop].ptr = _seqData;
- } else {
+ else
_seqQuitFlag = true;
- }
}
void SeqPlayer::s1_loopInc() {
@@ -250,13 +247,13 @@ void SeqPlayer::s1_loadPalette() {
uint8 colNum = *_seqData++;
if (_vm->gameFlags().platform == Common::kPlatformAmiga) {
- if (!colNum) {
+ if (!colNum)
memcpy(_screen->_currentPalette, _screen->_currentPalette + 576, 3*32);
- } else if (colNum == 3) {
+ else if (colNum == 3)
memcpy(_screen->_currentPalette, _screen->_currentPalette + 672, 3*32);
- } else if (colNum == 4) {
+ else if (colNum == 4)
memcpy(_screen->_currentPalette, _screen->_currentPalette + 288, 3*32);
- }
+
_screen->setScreenPalette(_screen->_currentPalette);
} else {
uint32 fileSize;
@@ -304,31 +301,28 @@ void SeqPlayer::s1_printTalkText() {
uint8 fillColor = *_seqData++;
int b;
if (_seqTalkTextPrinted && !_seqTalkTextRestored) {
- if (_seqWsaCurDecodePage != 0 && !_specialBuffer) {
+ if (_seqWsaCurDecodePage != 0 && !_specialBuffer)
b = 2;
- } else {
+ else
b = 0;
- }
_vm->text()->restoreTalkTextMessageBkgd(2, b);
}
_seqTalkTextPrinted = true;
_seqTalkTextRestored = false;
- if (_seqWsaCurDecodePage != 0 && !_specialBuffer) {
+ if (_seqWsaCurDecodePage != 0 && !_specialBuffer)
b = 2;
- } else {
+ else
b = 0;
- }
_vm->text()->printTalkTextMessage(_vm->seqTextsTable()[txt], x, y, fillColor, b, 2);
}
void SeqPlayer::s1_restoreTalkText() {
if (_seqTalkTextPrinted && !_seqTalkTextRestored) {
int b;
- if (_seqWsaCurDecodePage != 0 && !_specialBuffer) {
+ if (_seqWsaCurDecodePage != 0 && !_specialBuffer)
b = 2;
- } else {
+ else
b = 0;
- }
_vm->text()->restoreTalkTextMessageBkgd(2, b);
_seqTalkTextRestored = true;
}
@@ -358,12 +352,11 @@ void SeqPlayer::s1_copyRegion() {
void SeqPlayer::s1_copyRegionSpecial() {
static const uint8 colorMap[] = { 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0 };
const char *copyStr = 0;
- if (!_vm->gameFlags().isTalkie) {
+ if (!_vm->gameFlags().isTalkie)
copyStr = "Copyright (c) 1992 Westwood Studios";
- } else {
+ else
copyStr = "Copyright (c) 1992,1993 Westwood Studios";
- }
-
+
uint8 so = *_seqData++;
switch (so) {
case 0:
@@ -625,9 +618,9 @@ bool SeqPlayer::playSequence(const uint8 *seqData, bool skipSeq) {
if (skipSeq && _vm->seq_skipSequence()) {
while (1) {
uint8 code = *_seqData;
- if (commands[code].proc == &SeqPlayer::s1_endOfScript || commands[code].proc == &SeqPlayer::s1_break) {
+ if (commands[code].proc == &SeqPlayer::s1_endOfScript || commands[code].proc == &SeqPlayer::s1_break)
break;
- }
+
_seqData += commands[code].len;
}
skipSeq = false;
@@ -644,11 +637,11 @@ bool SeqPlayer::playSequence(const uint8 *seqData, bool skipSeq) {
_screen->printText(charStr, _seqDisplayedTextX, 180, 0xF, 0xC);
_seqDisplayedTextX += _screen->getCharWidth(charStr[0]);
++_seqDisplayedChar;
- if (_vm->seqTextsTable()[_seqDisplayedText][_seqDisplayedChar] == '\0') {
+
+ if (_vm->seqTextsTable()[_seqDisplayedText][_seqDisplayedChar] == '\0')
_seqDisplayedTextTimer = 0xFFFFFFFF;
- } else {
+ else
_seqDisplayedTextTimer = _system->getMillis() + 1000 / ((_vm->gameFlags().lang == Common::FR_FRA) ? 120 : 60);
- }
}
}
@@ -670,3 +663,4 @@ bool SeqPlayer::playSequence(const uint8 *seqData, bool skipSeq) {
} // End of namespace Kyra
+