aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorDenis Kasak2009-07-18 03:05:20 +0000
committerDenis Kasak2009-07-18 03:05:20 +0000
commit18fda1b2f374e57b10f7ed3bce7e193998cb0014 (patch)
treecbfd6957936a9076694b84ed2871ce21cf5b0db7 /engines
parent94417e77438e779ee1a03e366d96dc49bff04e03 (diff)
downloadscummvm-rg350-18fda1b2f374e57b10f7ed3bce7e193998cb0014.tar.gz
scummvm-rg350-18fda1b2f374e57b10f7ed3bce7e193998cb0014.tar.bz2
scummvm-rg350-18fda1b2f374e57b10f7ed3bce7e193998cb0014.zip
Fixed a bug where the cursor was not shown when the first room is loaded and has mouse enabled.
svn-id: r42582
Diffstat (limited to 'engines')
-rw-r--r--engines/draci/game.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index 161f1d82d7..c322a5b286 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -157,8 +157,6 @@ void Game::init() {
_currentRoom._roomNum = _info._startRoom;
changeRoom(_info._startRoom);
-
- _vm->_mouse->setCursorType(kNormalCursor);
}
void Game::loop() {
@@ -237,21 +235,15 @@ void Game::loadRoom(int roomNum) {
debugC(4, kDraciLogicDebugLevel, "EscRoom: %d", _currentRoom._escRoom);
debugC(4, kDraciLogicDebugLevel, "Gates: %d", _currentRoom._numGates);
- // Set cursor state
- if (_currentRoom._mouseOn) {
- debugC(6, kDraciLogicDebugLevel, "Mouse: ON");
- _vm->_mouse->cursorOn();
- } else {
- debugC(6, kDraciLogicDebugLevel, "Mouse: OFF");
- _vm->_mouse->cursorOff();
- }
+ // Read in the gates' numbers
Common::Array<int> gates;
for (uint i = 0; i < _currentRoom._numGates; ++i) {
gates.push_back(roomReader.readSint16LE());
}
+ // Load the room's objects
for (uint i = 0; i < _info._numObjects; ++i) {
debugC(7, kDraciLogicDebugLevel,
"Checking if object %d (%d) is at the current location (%d)", i,
@@ -274,6 +266,7 @@ void Game::loadRoom(int roomNum) {
}
}
+ // Load the room's GPL program and run the init part
f = _vm->_roomsArchive->getFile(roomNum * 4 + 3);
_currentRoom._program._bytecode = f->_data;
_currentRoom._program._length = f->_length;
@@ -288,9 +281,22 @@ void Game::loadRoom(int roomNum) {
_vm->_script->run(_currentRoom._program, gates[i]);
}
+ // Set room palette
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();
+ }
+
+ _vm->_mouse->setCursorType(kNormalCursor);
+
// 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);