aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2006-09-10 13:52:17 +0000
committerJohannes Schickel2006-09-10 13:52:17 +0000
commit65c0bdcaa0befc1f02502cb74945aa43669d8b76 (patch)
tree5d66ba2f87a6c0cb40ac5b95cf1e6e8d59dd3008 /engines
parent09f7e35196e5d07a04730b70cc81602be736cfaa (diff)
downloadscummvm-rg350-65c0bdcaa0befc1f02502cb74945aa43669d8b76.tar.gz
scummvm-rg350-65c0bdcaa0befc1f02502cb74945aa43669d8b76.tar.bz2
scummvm-rg350-65c0bdcaa0befc1f02502cb74945aa43669d8b76.zip
- Some little checks for shape usage.
- Less redrawing while loading a savegame. svn-id: r23864
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/saveload.cpp5
-rw-r--r--engines/kyra/screen.cpp31
-rw-r--r--engines/kyra/screen.h1
3 files changed, 24 insertions, 13 deletions
diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp
index d34dc66097..17e40b296e 100644
--- a/engines/kyra/saveload.cpp
+++ b/engines/kyra/saveload.cpp
@@ -192,6 +192,7 @@ void KyraEngine::loadGame(const char *fileName) {
in->readByte(); // Voice
}
+ _screen->_disableScreen = true;
loadMainScreen(8);
if (queryGameFlag(0x2D)) {
@@ -206,7 +207,7 @@ void KyraEngine::loadGame(const char *fileName) {
_screen->copyRegion(0, 0, 0, 0, 320, 200, 10, 8);
_screen->copyRegion(0, 0, 0, 0, 320, 200, 8, 0);
}
-
+
createMouseItem(_itemInHand);
_animator->setBrandonAnimSeqSize(3, 48);
redrawInventory(0);
@@ -222,6 +223,8 @@ void KyraEngine::loadGame(const char *fileName) {
_animator->prepDrawAllObjects();
_animator->copyChangedObjectsForward(0);
_screen->copyRegion(8, 8, 8, 8, 304, 128, 2, 0);
+ _screen->_disableScreen = false;
+ _screen->updateScreen();
_abortWalkFlag = true;
_abortWalkFlag2 = false;
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];
diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h
index f678c3f1f9..b3568ba22f 100644
--- a/engines/kyra/screen.h
+++ b/engines/kyra/screen.h
@@ -181,6 +181,7 @@ public:
uint8 *_currentPalette;
uint8 *_shapePages[2];
FontId _currentFont;
+ bool _disableScreen;
const ScreenDim *_curDim;