aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2010-01-06 12:17:03 +0000
committerFilippos Karapetis2010-01-06 12:17:03 +0000
commitbcf7535c97ef6a49bbc9d110257caf7de49cfaed (patch)
tree7c2204ac4c31756f6ba5e5ac633cbfdb0ec8cdf8 /engines/sci
parent1c6ccf8000c8eb34e4ae3d68312a23261f87862c (diff)
downloadscummvm-rg350-bcf7535c97ef6a49bbc9d110257caf7de49cfaed.tar.gz
scummvm-rg350-bcf7535c97ef6a49bbc9d110257caf7de49cfaed.tar.bz2
scummvm-rg350-bcf7535c97ef6a49bbc9d110257caf7de49cfaed.zip
Removed all hardcoded screen sizes
svn-id: r47072
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/kpathing.cpp1
-rw-r--r--engines/sci/graphics/transitions.cpp8
-rw-r--r--engines/sci/video/seq_decoder.cpp16
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;