diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kpathing.cpp | 1 | ||||
-rw-r--r-- | engines/sci/graphics/transitions.cpp | 8 | ||||
-rw-r--r-- | engines/sci/video/seq_decoder.cpp | 16 |
3 files changed, 15 insertions, 10 deletions
diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp index dd446a2737..0f263fd1bb 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -1822,6 +1822,7 @@ reg_t kAvoidPath(EngineState *s, int argc, reg_t *argv) { if (argc > 7) opt = argv[7].toUint16(); } else { + // SCI1.1 and older games always ran with an internal resolution of 320x200 poly_list = argv[4]; width = 320; height = 190; diff --git a/engines/sci/graphics/transitions.cpp b/engines/sci/graphics/transitions.cpp index 565d628a67..c5cac0be89 100644 --- a/engines/sci/graphics/transitions.cpp +++ b/engines/sci/graphics/transitions.cpp @@ -170,7 +170,7 @@ void Transitions::doit(Common::Rect picRect) { // Now we do the actual transition to the new screen doTransition(_number, false); - if (picRect.bottom != 320) { + if (picRect.bottom != _screen->_height) { // TODO: this is a workaround for lsl6 not showing menubar when playing // There is some new code in the sierra sci in ShowPic that seems to do something similar to this _screen->copyToScreen(); @@ -305,10 +305,10 @@ void Transitions::pixelation (bool blackoutFlag) { do { mask = (mask & 1) ? (mask >> 1) ^ 0xB400 : mask >> 1; - if (mask >= 320 * 200) + if (mask >= _screen->_width * _screen->_height) continue; - pixelRect.left = mask % 320; pixelRect.right = pixelRect.left + 1; - pixelRect.top = mask / 320; pixelRect.bottom = pixelRect.top + 1; + pixelRect.left = mask % _screen->_width; pixelRect.right = pixelRect.left + 1; + pixelRect.top = mask / _screen->_width; pixelRect.bottom = pixelRect.top + 1; pixelRect.clip(_picRect); if (!pixelRect.isEmpty()) copyRectToScreen(pixelRect, blackoutFlag); diff --git a/engines/sci/video/seq_decoder.cpp b/engines/sci/video/seq_decoder.cpp index d3b1ea915d..e7137351c4 100644 --- a/engines/sci/video/seq_decoder.cpp +++ b/engines/sci/video/seq_decoder.cpp @@ -35,6 +35,10 @@ namespace Sci { +// SEQ videos always run at 320x200 +#define SCREEN_WIDTH 320 +#define SCREEN_HEIGHT 200 + enum seqPalTypes { kSeqPalVariable = 0, kSeqPalConstant = 1 @@ -59,8 +63,8 @@ bool SeqDecoder::loadFile(const char *fileName, int frameDelay) { // Seek to the first frame _videoInfo.currentFrame = 0; - _videoInfo.width = 320; - _videoInfo.height = 200; + _videoInfo.width = SCREEN_WIDTH; + _videoInfo.height = SCREEN_HEIGHT; _videoInfo.frameCount = _fileStream->readUint16LE(); // Our frameDelay is calculated in 1/100 ms, so we convert it here _videoInfo.frameDelay = 100 * frameDelay * 1000 / 60; @@ -129,7 +133,7 @@ bool SeqDecoder::decodeNextFrame() { _videoInfo.startTime = g_system->getMillis(); if (frameType == kSeqFrameFull) { - byte *dst = _videoFrameBuffer + frameTop * 320 + frameLeft; + byte *dst = _videoFrameBuffer + frameTop * SCREEN_WIDTH + frameLeft; byte *linebuf = new byte[frameWidth]; @@ -143,7 +147,7 @@ bool SeqDecoder::decodeNextFrame() { } else { byte *buf = new byte[frameSize]; _fileStream->read(buf, frameSize); - decodeFrame(buf, rleSize, buf + rleSize, frameSize - rleSize, _videoFrameBuffer + 320 * frameTop, frameLeft, frameWidth, frameHeight, colorKey); + decodeFrame(buf, rleSize, buf + rleSize, frameSize - rleSize, _videoFrameBuffer + SCREEN_WIDTH * frameTop, frameLeft, frameWidth, frameHeight, colorKey); delete[] buf; } @@ -151,14 +155,14 @@ bool SeqDecoder::decodeNextFrame() { } #define WRITE_TO_BUFFER(n) \ - if (writeRow * 320 + writeCol + (n) > 320 * height) { \ + if (writeRow * SCREEN_WIDTH + writeCol + (n) > SCREEN_WIDTH * height) { \ warning("SEQ player: writing out of bounds, aborting"); \ return false; \ } \ if (litPos + (n) > litSize) { \ warning("SEQ player: reading out of bounds, aborting"); \ } \ - memcpy(dest + writeRow * 320 + writeCol, litData + litPos, n); + memcpy(dest + writeRow * SCREEN_WIDTH + writeCol, litData + litPos, n); bool SeqDecoder::decodeFrame(byte *rleData, int rleSize, byte *litData, int litSize, byte *dest, int left, int width, int height, int colorKey) { int writeRow = 0; |