From 5ddc251528b5588b9460d4e00fa90c44b34f6061 Mon Sep 17 00:00:00 2001 From: Jaromir Wysoglad Date: Tue, 25 Jun 2019 15:57:18 +0200 Subject: SUPERNOVA: Preload exit list on room entry --- engines/supernova/supernova1/state.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'engines/supernova/supernova1') diff --git a/engines/supernova/supernova1/state.cpp b/engines/supernova/supernova1/state.cpp index e9c4d34dee..1f9c81b864 100644 --- a/engines/supernova/supernova1/state.cpp +++ b/engines/supernova/supernova1/state.cpp @@ -1067,15 +1067,12 @@ void GameManager1::shock() { } void GameManager1::drawMapExits() { -// TODO: Preload _exitList on room entry instead on every call _vm->renderBox(281, 161, 39, 39, kColorWhite25); - for (int i = 0; i < 25; i++) - _exitList[i] = -1; - for (int i = 0; i < kMaxObject; i++) { - if (_currentRoom->getObject(i)->hasProperty(EXIT)) { - byte r = _currentRoom->getObject(i)->_direction; - _exitList[r] = i; + int idx; + for (int i = 0; i < 25; i++) { + if ((idx = _exitList[i]) != -1) { + byte r = _currentRoom->getObject(idx)->_direction; int x = 284 + 7 * (r % 5); int y = 164 + 7 * (r / 5); _vm->renderBox(x, y, 5, 5, kColorDarkRed); -- cgit v1.2.3