aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/kyra_hof.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2012-06-13 04:13:16 +0200
committerJohannes Schickel2012-06-13 04:13:16 +0200
commit34c57519489186ae62a28072199b247211c05161 (patch)
tree82c2604d400e60a462a765099342cfe0d30e275c /engines/kyra/kyra_hof.cpp
parent2a1193a6b1d19664b876fb98568fa677463781a6 (diff)
downloadscummvm-rg350-34c57519489186ae62a28072199b247211c05161.tar.gz
scummvm-rg350-34c57519489186ae62a28072199b247211c05161.tar.bz2
scummvm-rg350-34c57519489186ae62a28072199b247211c05161.zip
KYRA: Reduce amount of updateScreen calls.
This fixes some slowdowns in Kyra2 with the OpenGL backend for me. Most of the updateScreen calls saved were introduced by us implementing the original behavior of hiding the mouse before drawing onto the screen and showing it again afterwards, since the mouse cursor is not drawn on the game screen in our implementation (and unlike in the original) this is not necessary.
Diffstat (limited to 'engines/kyra/kyra_hof.cpp')
-rw-r--r--engines/kyra/kyra_hof.cpp10
1 files changed, 0 insertions, 10 deletions
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp
index 0ba173d9d0..7fbecb7f53 100644
--- a/engines/kyra/kyra_hof.cpp
+++ b/engines/kyra/kyra_hof.cpp
@@ -419,8 +419,6 @@ void KyraEngine_HoF::startup() {
_screen->loadPalette("PALETTE.COL", _screen->getPalette(0));
_screen->loadBitmap("_PLAYFLD.CPS", 3, 3, 0);
_screen->copyPage(3, 0);
- _screen->showMouse();
- _screen->hideMouse();
clearAnimObjects();
@@ -784,20 +782,16 @@ void KyraEngine_HoF::updateMouse() {
if (type != 0 && _mouseState != type && _screen->isMouseVisible()) {
_mouseState = type;
- _screen->hideMouse();
_screen->setMouseCursor(xOffset, yOffset, getShapePtr(shapeIndex));
- _screen->showMouse();
}
if (type == 0 && _mouseState != _itemInHand && _screen->isMouseVisible()) {
if ((mouse.y > 145) || (mouse.x > 6 && mouse.x < 312 && mouse.y > 6 && mouse.y < 135)) {
_mouseState = _itemInHand;
- _screen->hideMouse();
if (_itemInHand == kItemNone)
_screen->setMouseCursor(0, 0, getShapePtr(0));
else
_screen->setMouseCursor(8, 15, getShapePtr(_itemInHand+64));
- _screen->showMouse();
}
}
}
@@ -914,7 +908,6 @@ void KyraEngine_HoF::showMessageFromCCode(int id, int16 palIndex, int) {
void KyraEngine_HoF::showMessage(const char *string, int16 palIndex) {
_shownMessage = string;
- _screen->hideMouse();
_screen->fillRect(0, 190, 319, 199, 0xCF);
if (string) {
@@ -932,7 +925,6 @@ void KyraEngine_HoF::showMessage(const char *string, int16 palIndex) {
}
_fadeMessagePalette = false;
- _screen->showMouse();
}
void KyraEngine_HoF::showChapterMessage(int id, int16 palIndex) {
@@ -1116,9 +1108,7 @@ int KyraEngine_HoF::getDrawLayer(int x, int y) {
void KyraEngine_HoF::backUpPage0() {
if (_screenBuffer) {
- _screen->hideMouse();
memcpy(_screenBuffer, _screen->getCPagePtr(0), 64000);
- _screen->showMouse();
}
}