Moved cursor state setting (when entering a new room) from Game::loadRoom() to Game::start() (just after running the gate program). This fixes a black cursor bug when the game starts (the cursor should not be even displayed then).

svn-id: r43162
This commit is contained in:
Denis Kasak 2009-08-09 04:24:52 +00:00
parent f68ceeb88c
commit abedc7e9bb

View File

@ -183,6 +183,16 @@ void Game::start() {
// Run the program for the gate the dragon came through
runGateProgram(_newGate);
// Set cursor state
// Need to do this after we set the palette since the cursors use it
if (_currentRoom._mouseOn) {
debugC(6, kDraciLogicDebugLevel, "Mouse: ON");
_vm->_mouse->cursorOn();
} else {
debugC(6, kDraciLogicDebugLevel, "Mouse: OFF");
_vm->_mouse->cursorOff();
}
}
// Mimic the original engine by setting the loop status to Ordinary before
@ -614,16 +624,6 @@ void Game::loadRoom(int roomNum) {
f = _vm->_paletteArchive->getFile(_currentRoom._palette);
_vm->_screen->setPalette(f->_data, 0, kNumColours);
// Set cursor state
// Need to do this after we set the palette since the cursors use it
if (_currentRoom._mouseOn) {
debugC(6, kDraciLogicDebugLevel, "Mouse: ON");
_vm->_mouse->cursorOn();
} else {
debugC(6, kDraciLogicDebugLevel, "Mouse: OFF");
_vm->_mouse->cursorOff();
}
// HACK: Create a visible overlay from the walking map so we can test it
byte *wlk = new byte[kScreenWidth * kScreenHeight];
memset(wlk, 255, kScreenWidth * kScreenHeight);