mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-08 10:51:11 +00:00
SUPERNOVA: Preload exit list on room entry
This commit is contained in:
parent
09975e10c2
commit
5ddc251528
@ -689,6 +689,15 @@ void GameManager::roomBrightness() {
|
||||
void GameManager::changeRoom(RoomId id) {
|
||||
_currentRoom = _rooms[id];
|
||||
_newRoom = true;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GameManager::wait(int ticks) {
|
||||
|
@ -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);
|
||||
|
@ -451,19 +451,16 @@ void GameManager2::handleTime() {
|
||||
}
|
||||
|
||||
void GameManager2::drawMapExits() {
|
||||
// TODO: Preload _exitList on room entry instead on every call
|
||||
_vm->renderBox(281, 161, 39, 39, kColorWhite25);
|
||||
|
||||
if ((_currentRoom >= _rooms[PYR_ENTRANCE] && _currentRoom <= _rooms[HOLE_ROOM]) ||
|
||||
(_currentRoom >= _rooms[FLOORDOOR] && _currentRoom <= _rooms[BST_DOOR]))
|
||||
compass();
|
||||
else {
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user