diff options
Diffstat (limited to 'engines/kyra/screen.cpp')
-rw-r--r-- | engines/kyra/screen.cpp | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 3491be528c..482bc598a9 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -64,6 +64,7 @@ Screen::~Screen() { bool Screen::init() { debugC(9, kDebugLevelScreen, "Screen::init()"); + _disableScreen = false; // enable this for now _system->setFeatureState(OSystem::kFeatureAutoComputeDirtyRects, true); @@ -129,6 +130,9 @@ bool Screen::init() { void Screen::updateScreen() { debugC(9, kDebugLevelScreen, "Screen::updateScreen()"); + if (_disableScreen) + return; + _system->copyRectToScreen(getPagePtr(0), SCREEN_W, 0, 0, SCREEN_W, SCREEN_H); //for debug reasons (needs 640x200 screen) //_system->copyRectToScreen(getPagePtr(2), SCREEN_W, 320, 0, SCREEN_W, SCREEN_H); @@ -871,7 +875,7 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int int ppc = (flags >> 8) & 0x3F; const uint8 *src = shapeData; - if (_vm->features() & GF_TALKIE) { + if ((_vm->game() == GI_KYRA1) && (_vm->features() & GF_TALKIE)) { src += 2; } uint16 shapeFlags = READ_LE_UINT16(src); src += 2; @@ -922,7 +926,7 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int // only used if shapeFlag & 1 is NOT zero const uint8 *colorTable = shapeData + 10; - if (_vm->features() & GF_TALKIE) { + if ((_vm->game() == GI_KYRA1) && (_vm->features() & GF_TALKIE)) { colorTable += 2; } @@ -1585,7 +1589,7 @@ uint8 *Screen::encodeShape(int x, int y, int w, int h, int flags) { } int16 shapeSize2 = shapeSize; - if (_vm->features() & GF_TALKIE) { + if ((_vm->game() == GI_KYRA1) && (_vm->features() & GF_TALKIE)) { shapeSize += 12; } else { shapeSize += 10; @@ -1601,7 +1605,7 @@ uint8 *Screen::encodeShape(int x, int y, int w, int h, int flags) { assert(newShape); byte *dst = newShape; - if (_vm->features() & GF_TALKIE) + if ((_vm->game() == GI_KYRA1) && (_vm->features() & GF_TALKIE)) dst += 2; WRITE_LE_UINT16(dst, (flags & 3)); dst += 2; *dst = h; dst += 1; @@ -1669,7 +1673,7 @@ uint8 *Screen::encodeShape(int x, int y, int w, int h, int flags) { if (!(flags & 2)) { if (shapeSize > _animBlockSize) { dst = newShape; - if (_vm->features() & GF_TALKIE) { + if ((_vm->game() == GI_KYRA1) && (_vm->features() & GF_TALKIE)) { dst += 2; } flags = READ_LE_UINT16(dst); @@ -1677,7 +1681,7 @@ uint8 *Screen::encodeShape(int x, int y, int w, int h, int flags) { WRITE_LE_UINT16(dst, flags); } else { src = newShape; - if (_vm->features() & GF_TALKIE) { + if ((_vm->game() == GI_KYRA1) && (_vm->features() & GF_TALKIE)) { src += 2; } if (flags & 1) { @@ -1706,14 +1710,14 @@ uint8 *Screen::encodeShape(int x, int y, int w, int h, int flags) { } dst = newShape; - if (_vm->features() & GF_TALKIE) { + if ((_vm->game() == GI_KYRA1) && (_vm->features() & GF_TALKIE)) { dst += 2; } WRITE_LE_UINT16((dst + 6), shapeSize); if (flags & 1) { dst = newShape + 10; - if (_vm->features() & GF_TALKIE) { + if ((_vm->game() == GI_KYRA1) && (_vm->features() & GF_TALKIE)) { dst += 2; } src = &table[0x100]; @@ -1902,7 +1906,7 @@ void Screen::setMouseCursor(int x, int y, byte *shape) { // if mouseDisabled // return _mouseShape - if (_vm->features() & GF_TALKIE) + if ((_vm->game() == GI_KYRA1) && (_vm->features() & GF_TALKIE)) shape += 2; int mouseHeight = *(shape + 2); @@ -1922,7 +1926,10 @@ void Screen::setMouseCursor(int x, int y, byte *shape) { free(cursor); // makes sure that the cursor is drawn - updateScreen(); + // we do not use Screen::updateScreen here + // so we can be sure that changes to page 0 + // are NOT updated on the real screen here + _system->updateScreen(); } void Screen::copyScreenFromRect(int x, int y, int w, int h, uint8 *ptr) { @@ -1981,7 +1988,7 @@ byte Screen::getShapeFlag2(int x, int y) { int Screen::setNewShapeHeight(uint8 *shape, int height) { debugC(9, kDebugLevelScreen, "Screen::setNewShapeHeight(%p, %d)", (const void *)shape, height); - if (_vm->features() & GF_TALKIE) + if ((_vm->game() == GI_KYRA1) && (_vm->features() & GF_TALKIE)) shape += 2; int oldHeight = shape[2]; shape[2] = height; @@ -1990,7 +1997,7 @@ int Screen::setNewShapeHeight(uint8 *shape, int height) { int Screen::resetShapeHeight(uint8 *shape) { debugC(9, kDebugLevelScreen, "Screen::setNewShapeHeight(%p)", (const void *)shape); - if (_vm->features() & GF_TALKIE) + if ((_vm->game() == GI_KYRA1) && (_vm->features() & GF_TALKIE)) shape += 2; int oldHeight = shape[2]; shape[2] = shape[5]; |