[Scummvm-cvs-logs] SF.net SVN: scummvm:[43542] scummvm/branches/branch-1-0-0/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Wed Aug 19 18:49:44 CEST 2009
Revision: 43542
http://scummvm.svn.sourceforge.net/scummvm/?rev=43542&view=rev
Author: lordhoto
Date: 2009-08-19 16:49:41 +0000 (Wed, 19 Aug 2009)
Log Message:
-----------
Backported screen update fixes of KYRA. (Revisions toching trunk: r43537, r43538, r43541)
Modified Paths:
--------------
scummvm/branches/branch-1-0-0/engines/kyra/animator_lok.cpp
scummvm/branches/branch-1-0-0/engines/kyra/animator_lok.h
scummvm/branches/branch-1-0-0/engines/kyra/gui.cpp
scummvm/branches/branch-1-0-0/engines/kyra/gui_lok.cpp
scummvm/branches/branch-1-0-0/engines/kyra/kyra_v1.cpp
scummvm/branches/branch-1-0-0/engines/kyra/screen.cpp
scummvm/branches/branch-1-0-0/engines/kyra/screen.h
scummvm/branches/branch-1-0-0/engines/kyra/script_lok.cpp
scummvm/branches/branch-1-0-0/engines/kyra/sequences_lok.cpp
scummvm/branches/branch-1-0-0/engines/kyra/text_lok.cpp
Modified: scummvm/branches/branch-1-0-0/engines/kyra/animator_lok.cpp
===================================================================
--- scummvm/branches/branch-1-0-0/engines/kyra/animator_lok.cpp 2009-08-19 16:48:55 UTC (rev 43541)
+++ scummvm/branches/branch-1-0-0/engines/kyra/animator_lok.cpp 2009-08-19 16:49:41 UTC (rev 43542)
@@ -37,7 +37,6 @@
_vm = vm;
_screen = vm->screen();
_initOk = false;
- _updateScreen = false;
_system = system;
_screenObjects = _actors = _items = _sprites = _objectQueue = 0;
_noDrawShapesFlag = 0;
@@ -382,15 +381,11 @@
_screen->copyRegion(xpos << 3, ypos, xpos << 3, ypos, width << 3, height, 2, 0);
curObject->refreshFlag = 0;
- _updateScreen = true;
}
}
}
- if (_updateScreen) {
- _screen->updateScreen();
- _updateScreen = false;
- }
+ _screen->updateScreen();
}
void Animator_LoK::updateAllObjectShapes() {
Modified: scummvm/branches/branch-1-0-0/engines/kyra/animator_lok.h
===================================================================
--- scummvm/branches/branch-1-0-0/engines/kyra/animator_lok.h 2009-08-19 16:48:55 UTC (rev 43541)
+++ scummvm/branches/branch-1-0-0/engines/kyra/animator_lok.h 2009-08-19 16:49:41 UTC (rev 43542)
@@ -95,7 +95,6 @@
int16 fetchAnimHeight(const uint8 *shape, int16 mult);
int _noDrawShapesFlag;
- bool _updateScreen;
uint16 _brandonDrawFrame;
int _brandonScaleX;
int _brandonScaleY;
Modified: scummvm/branches/branch-1-0-0/engines/kyra/gui.cpp
===================================================================
--- scummvm/branches/branch-1-0-0/engines/kyra/gui.cpp 2009-08-19 16:48:55 UTC (rev 43541)
+++ scummvm/branches/branch-1-0-0/engines/kyra/gui.cpp 2009-08-19 16:49:41 UTC (rev 43542)
@@ -228,10 +228,11 @@
menu.highlightedItem = i;
redrawHighlight(menu);
- _screen->updateScreen();
}
}
}
+
+ _screen->updateScreen();
}
void GUI::redrawText(const Menu &menu) {
@@ -412,7 +413,8 @@
Common::Point pos = _vm->getMousePos();
_vm->_mouseX = pos.x;
_vm->_mouseY = pos.y;
- _screen->updateScreen();
+
+ _vm->_system->updateScreen();
_lastScreenUpdate = now;
} break;
@@ -478,14 +480,24 @@
Common::Event event;
Common::EventManager *eventMan = _vm->getEventManager();
+ bool updateScreen = false;
+
while (eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_LBUTTONUP:
return true;
+
+ case Common::EVENT_MOUSEMOVE:
+ updateScreen = true;
+ break;
+
default:
break;
}
}
+
+ if (updateScreen)
+ _system->updateScreen();
return false;
}
Modified: scummvm/branches/branch-1-0-0/engines/kyra/gui_lok.cpp
===================================================================
--- scummvm/branches/branch-1-0-0/engines/kyra/gui_lok.cpp 2009-08-19 16:48:55 UTC (rev 43541)
+++ scummvm/branches/branch-1-0-0/engines/kyra/gui_lok.cpp 2009-08-19 16:49:41 UTC (rev 43542)
@@ -485,7 +485,6 @@
if (_menuRestoreScreen) {
restorePalette();
_screen->loadPageFromDisk("SEENPAGE.TMP", 0);
- _vm->_animator->_updateScreen = true;
} else {
_screen->deletePageFromDisk(0);
}
Modified: scummvm/branches/branch-1-0-0/engines/kyra/kyra_v1.cpp
===================================================================
--- scummvm/branches/branch-1-0-0/engines/kyra/kyra_v1.cpp 2009-08-19 16:48:55 UTC (rev 43541)
+++ scummvm/branches/branch-1-0-0/engines/kyra/kyra_v1.cpp 2009-08-19 16:49:41 UTC (rev 43542)
@@ -433,11 +433,8 @@
}
}
- // TODO: Check whether we should really call Screen::updateScreen here.
- // We might simply want to call OSystem::updateScreen instead, since Screen::updateScreen
- // copies changed screen parts to the screen buffer, which might not be desired.
if (updateScreen)
- screen()->updateScreen();
+ _system->updateScreen();
}
void KyraEngine_v1::removeInputTop() {
Modified: scummvm/branches/branch-1-0-0/engines/kyra/screen.cpp
===================================================================
--- scummvm/branches/branch-1-0-0/engines/kyra/screen.cpp 2009-08-19 16:48:55 UTC (rev 43541)
+++ scummvm/branches/branch-1-0-0/engines/kyra/screen.cpp 2009-08-19 16:49:41 UTC (rev 43542)
@@ -49,6 +49,7 @@
_sjisFont = 0;
_currentFont = FID_8_FNT;
+ _paletteChanged = true;
}
Screen::~Screen() {
@@ -219,19 +220,25 @@
}
void Screen::updateScreen() {
+ bool needRealUpdate = _forceFullUpdate || !_dirtyRects.empty() || _paletteChanged;
+ _paletteChanged = false;
+
if (_useOverlays)
updateDirtyRectsOvl();
else
updateDirtyRects();
if (_debugEnabled) {
+ needRealUpdate = true;
+
if (!_useOverlays)
_system->copyRectToScreen(getPagePtr(2), SCREEN_W, 320, 0, SCREEN_W, SCREEN_H);
else
_system->copyRectToScreen(getPagePtr(2), SCREEN_W, 640, 0, SCREEN_W, SCREEN_H);
}
- _system->updateScreen();
+ if (needRealUpdate)
+ _system->updateScreen();
}
void Screen::updateDirtyRects() {
@@ -270,6 +277,7 @@
_system->copyRectToScreen(dst, 640, it->left<<1, it->top<<1, it->width()<<1, it->height()<<1);
}
}
+
_forceFullUpdate = false;
_dirtyRects.clear();
}
@@ -635,6 +643,7 @@
screenPal[4 * i + 3] = 0;
}
+ _paletteChanged = true;
_system->setPalette(screenPal, 0, pal.getNumColors());
}
Modified: scummvm/branches/branch-1-0-0/engines/kyra/screen.h
===================================================================
--- scummvm/branches/branch-1-0-0/engines/kyra/screen.h 2009-08-19 16:48:55 UTC (rev 43541)
+++ scummvm/branches/branch-1-0-0/engines/kyra/screen.h 2009-08-19 16:49:41 UTC (rev 43542)
@@ -209,7 +209,6 @@
virtual bool init();
virtual void setResolution();
-
void updateScreen();
// debug functions
@@ -402,6 +401,7 @@
};
bool _forceFullUpdate;
+ bool _paletteChanged;
Common::List<Common::Rect> _dirtyRects;
void addDirtyRect(int x, int y, int w, int h);
Modified: scummvm/branches/branch-1-0-0/engines/kyra/script_lok.cpp
===================================================================
--- scummvm/branches/branch-1-0-0/engines/kyra/script_lok.cpp 2009-08-19 16:48:55 UTC (rev 43541)
+++ scummvm/branches/branch-1-0-0/engines/kyra/script_lok.cpp 2009-08-19 16:49:41 UTC (rev 43542)
@@ -429,7 +429,6 @@
while (running) {
_movieObjects[wsaIndex]->displayFrame(wsaFrame++, 0, xpos, ypos, 0, 0, 0);
- _animator->_updateScreen = true;
if (wsaFrame >= _movieObjects[wsaIndex]->frames())
running = false;
@@ -460,7 +459,6 @@
int wsaIndex = stackPos(4);
_screen->hideMouse();
_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
- _animator->_updateScreen = true;
uint32 continueTime = waitTime * _tickLength + _system->getMillis();
while (_system->getMillis() < continueTime) {
_sprites->updateSceneAnims();
@@ -502,7 +500,6 @@
for (; startFrame <= endFrame; ++startFrame) {
uint32 nextRun = _system->getMillis() + delayTime * _tickLength;
_movieObjects[wsaIndex]->displayFrame(startFrame, 0, xpos, ypos, 0, 0, 0);
- _animator->_updateScreen = true;
while (_system->getMillis() < nextRun) {
_sprites->updateSceneAnims();
_animator->updateAllObjectShapes();
@@ -586,7 +583,6 @@
int KyraEngine_LoK::o1_loadPageFromDisk(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_loadPageFromDisk(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
_screen->loadPageFromDisk(stackPosString(0), stackPos(1));
- _animator->_updateScreen = true;
return 0;
}
@@ -654,7 +650,6 @@
int srcPage = stackPos(4);
int dstPage = stackPos(5);
_screen->copyRegion(xpos, ypos, xpos, ypos, width, height, srcPage, dstPage);
- _animator->_updateScreen = true;
return 0;
}
@@ -684,7 +679,6 @@
_screen->hideMouse();
uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(frame, 2, xpos, ypos, 0, 0, 0);
- _animator->_updateScreen = true;
while (_system->getMillis() < continueTime) {
_sprites->updateSceneAnims();
_animator->updateAllObjectShapes();
@@ -767,8 +761,6 @@
while (endFrame >= frame) {
uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
- if (waitTime)
- _animator->_updateScreen = true;
while (_system->getMillis() < continueTime) {
_sprites->updateSceneAnims();
_animator->updateAllObjectShapes();
@@ -785,8 +777,6 @@
while (endFrame <= frame) {
uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
- if (waitTime)
- _animator->_updateScreen = true;
while (_system->getMillis() < continueTime) {
_sprites->updateSceneAnims();
_animator->updateAllObjectShapes();
@@ -1280,7 +1270,6 @@
snd_playSoundEffect(0x73);
amulet.displayFrame(code, 0, 224, 152, 0, 0, 0);
- _animator->_updateScreen = true;
while (_system->getMillis() < nextTime) {
_sprites->updateSceneAnims();
Modified: scummvm/branches/branch-1-0-0/engines/kyra/sequences_lok.cpp
===================================================================
--- scummvm/branches/branch-1-0-0/engines/kyra/sequences_lok.cpp 2009-08-19 16:48:55 UTC (rev 43541)
+++ scummvm/branches/branch-1-0-0/engines/kyra/sequences_lok.cpp 2009-08-19 16:49:41 UTC (rev 43542)
@@ -1682,8 +1682,9 @@
_screen->getPalette(0)[palPos++] = kyraGemPalette[i + _kyragemFadingState.gOffset];
_screen->getPalette(0)[palPos++] = kyraGemPalette[i + _kyragemFadingState.bOffset];
}
+
_screen->setScreenPalette(_screen->getPalette(0));
- _animator->_updateScreen = true;
+
switch (_kyragemFadingState.nextOperation) {
case 0:
--_kyragemFadingState.bOffset;
Modified: scummvm/branches/branch-1-0-0/engines/kyra/text_lok.cpp
===================================================================
--- scummvm/branches/branch-1-0-0/engines/kyra/text_lok.cpp 2009-08-19 16:48:55 UTC (rev 43541)
+++ scummvm/branches/branch-1-0-0/engines/kyra/text_lok.cpp 2009-08-19 16:49:41 UTC (rev 43542)
@@ -97,7 +97,6 @@
currPage = _screen->_curPage;
_screen->_curPage = 2;
_text->printCharacterText(chatStr, charNum, _characterList[charNum].x1);
- _animator->_updateScreen = true;
_screen->_curPage = currPage;
}
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