From 519c023e4b4300a2483b8512f9f81ea6d9453a2d Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Mon, 9 May 2005 06:36:27 +0000 Subject: 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 --- saga/interface.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'saga') 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); } -- cgit v1.2.3