diff options
author | Torbjörn Andersson | 2005-05-09 06:36:27 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2005-05-09 06:36:27 +0000 |
commit | 519c023e4b4300a2483b8512f9f81ea6d9453a2d (patch) | |
tree | a2c6385bd560688a9e03625350a04ae2f4525c14 | |
parent | 4c7eb3d8544b46f6d82e04012c63e9d8b961c114 (diff) | |
download | scummvm-rg350-519c023e4b4300a2483b8512f9f81ea6d9453a2d.tar.gz scummvm-rg350-519c023e4b4300a2483b8512f9f81ea6d9453a2d.tar.bz2 scummvm-rg350-519c023e4b4300a2483b8512f9f81ea6d9453a2d.zip |
Fixed failed assertion when entering the Elk King's court. It looks like a
hack - perhaps it *is* a hack - but it's what the original engine did too,
as far as I can tell.
svn-id: r17992
-rw-r--r-- | saga/interface.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/saga/interface.cpp b/saga/interface.cpp index 7e1c5e500e..63545a9849 100644 --- a/saga/interface.cpp +++ b/saga/interface.cpp @@ -307,7 +307,10 @@ void Interface::setStatusText(const char *text, int statusColor) { int Interface::loadScenePortraits(int resourceId) { _scenePortraits.freeMem(); - return _vm->_sprite->loadList(resourceId, _scenePortraits); +warning("loadScenePortraits(%d)", resourceId); +int res = _vm->_sprite->loadList(resourceId, _scenePortraits); +warning("_scenePortraits.spriteCount = %d", _scenePortraits.spriteCount); +return res; } int Interface::setLeftPortrait(int portrait) { @@ -409,6 +412,14 @@ int Interface::draw() { rightPortraitPoint.x = _mainPanel.x + _vm->getDisplayInfo().rightPortraitXOffset; rightPortraitPoint.y = _mainPanel.y + _vm->getDisplayInfo().rightPortraitYOffset; + // This looks like hack - particularly since it's only done for + // the right-side portrait - and perhaps it is! But as far as I + // can tell this is what the original engine does. And it keeps + // ITE from crashing when entering the Elk King's court. + + if (_rightPortrait >= _scenePortraits.spriteCount) + _rightPortrait = 0; + _vm->_sprite->draw(backBuffer, _scenePortraits, _rightPortrait, rightPortraitPoint, 256); } |