diff options
author | Filippos Karapetis | 2011-10-22 12:19:40 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2011-11-20 22:43:12 +0100 |
commit | 5c3c9f4e6cbc65648635050ce6ab794603767a0f (patch) | |
tree | 459b7f4f476ede0f8e4a31ab96b8ef98e09ee4c0 | |
parent | 9841ce6b9f3b00f387a6f149221db05815f64801 (diff) | |
download | scummvm-rg350-5c3c9f4e6cbc65648635050ce6ab794603767a0f.tar.gz scummvm-rg350-5c3c9f4e6cbc65648635050ce6ab794603767a0f.tar.bz2 scummvm-rg350-5c3c9f4e6cbc65648635050ce6ab794603767a0f.zip |
TOLTECS: Added a hack to fix a crash when smoking the peace pipe
-rw-r--r-- | engines/toltecs/toltecs.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/engines/toltecs/toltecs.cpp b/engines/toltecs/toltecs.cpp index 7e3a294087..7414ab0e58 100644 --- a/engines/toltecs/toltecs.cpp +++ b/engines/toltecs/toltecs.cpp @@ -307,6 +307,15 @@ void ToltecsEngine::drawScreen() { if (_screen->_guiRefresh && _guiHeight > 0 && _cameraHeight > 0) { // Update the GUI when needed and it's visible + if (_cameraHeight + _guiHeight > 400) + // HACK: Sanity check - happens when smoking the peace pipe in the + // Indian village. + // FIXME: why does this happen? Fix the actual cause. + warning("Scene height (%d) and GUI height (%d) exceed the screen " + "height, cutting off the screen", _cameraHeight, _guiHeight); + _cameraHeight = 400 - _guiHeight; + } + _system->copyRectToScreen((const byte *)_screen->_frontScreen + _cameraHeight * 640, 640, 0, _cameraHeight, 640, _guiHeight); _screen->_guiRefresh = false; |