[Scummvm-cvs-logs] SF.net SVN: scummvm: [23864] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Sun Sep 10 15:52:26 CEST 2006
Revision: 23864
http://svn.sourceforge.net/scummvm/?rev=23864&view=rev
Author: lordhoto
Date: 2006-09-10 06:52:17 -0700 (Sun, 10 Sep 2006)
Log Message:
-----------
- Some little checks for shape usage.
- Less redrawing while loading a savegame.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/saveload.cpp
scummvm/trunk/engines/kyra/screen.cpp
scummvm/trunk/engines/kyra/screen.h
Modified: scummvm/trunk/engines/kyra/saveload.cpp
===================================================================
--- scummvm/trunk/engines/kyra/saveload.cpp 2006-09-10 13:26:00 UTC (rev 23863)
+++ scummvm/trunk/engines/kyra/saveload.cpp 2006-09-10 13:52:17 UTC (rev 23864)
@@ -192,6 +192,7 @@
in->readByte(); // Voice
}
+ _screen->_disableScreen = true;
loadMainScreen(8);
if (queryGameFlag(0x2D)) {
@@ -206,7 +207,7 @@
_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 @@
_animator->prepDrawAllObjects();
_animator->copyChangedObjectsForward(0);
_screen->copyRegion(8, 8, 8, 8, 304, 128, 2, 0);
+ _screen->_disableScreen = false;
+ _screen->updateScreen();
_abortWalkFlag = true;
_abortWalkFlag2 = false;
Modified: scummvm/trunk/engines/kyra/screen.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen.cpp 2006-09-10 13:26:00 UTC (rev 23863)
+++ scummvm/trunk/engines/kyra/screen.cpp 2006-09-10 13:52:17 UTC (rev 23864)
@@ -64,6 +64,7 @@
bool Screen::init() {
debugC(9, kDebugLevelScreen, "Screen::init()");
+ _disableScreen = false;
// enable this for now
_system->setFeatureState(OSystem::kFeatureAutoComputeDirtyRects, true);
@@ -129,6 +130,9 @@
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 @@
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 @@
// 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 @@
}
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 @@
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 @@
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 @@
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 @@
}
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 @@
// 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 @@
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 @@
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::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];
Modified: scummvm/trunk/engines/kyra/screen.h
===================================================================
--- scummvm/trunk/engines/kyra/screen.h 2006-09-10 13:26:00 UTC (rev 23863)
+++ scummvm/trunk/engines/kyra/screen.h 2006-09-10 13:52:17 UTC (rev 23864)
@@ -181,6 +181,7 @@
uint8 *_currentPalette;
uint8 *_shapePages[2];
FontId _currentFont;
+ bool _disableScreen;
const ScreenDim *_curDim;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list