diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp index d037cf55c0be..f22a0d12e566 100644 --- a/engines/neverhood/gamemodule.cpp +++ b/engines/neverhood/gamemodule.cpp @@ -400,9 +400,9 @@ void GameModule::startup() { // <<gameState().which = 0; - _vm->gameState().sceneNum = 0; - createModule(2500, -1); + _vm->gameState().which = 1; + _vm->gameState().sceneNum = 1; + createModule(1000, -1); #endif #if 0 _vm->gameState().sceneNum = 5; diff --git a/engines/neverhood/resource.cpp b/engines/neverhood/resource.cpp index 869bebbcfeaf..269d13ded27a 100644 --- a/engines/neverhood/resource.cpp +++ b/engines/neverhood/resource.cpp @@ -353,7 +353,9 @@ DataResource::~DataResource() { } void DataResource::load(uint32 fileHash) { - debug(2, "DataResource::load(%08X)", fileHash); + if (_resourceHandle.fileHash() == fileHash) + return; + debug("DataResource::load(%08X)", fileHash); const byte *data = NULL; uint32 dataSize = 0; unload(); @@ -497,7 +499,6 @@ void DataResource::load(uint32 fileHash) { } void DataResource::unload() { - _vm->_res->unloadResource(_resourceHandle); _directory.clear(); _points.clear(); for (Common::Array::iterator it = _pointArrays.begin(); it != _pointArrays.end(); ++it) @@ -516,6 +517,7 @@ void DataResource::unload() { for (Common::Array::iterator it = _drSubRectLists.begin(); it != _drSubRectLists.end(); ++it) delete (*it); _drSubRectLists.clear(); + _vm->_res->unloadResource(_resourceHandle); } NPoint DataResource::getPoint(uint32 nameHash) { diff --git a/engines/neverhood/scene.cpp b/engines/neverhood/scene.cpp index 30b93bdadab1..866b75d39989 100644 --- a/engines/neverhood/scene.cpp +++ b/engines/neverhood/scene.cpp @@ -397,7 +397,16 @@ void Scene::processMessageList() { _messageListStatus = 0; } - if (_messageList && _klayman) { + if (_messageList && _klayman) { + +#if 0 + debug("MessageList: %p, %d", (void*)_messageList, _messageList->size()); + for (uint i = 0; i < _messageList->size(); ++i) { + if (i == _messageListIndex) debugN("**"); else debugN(" "); + debug("(%08X, %08X)", (*_messageList)[i].messageNum, (*_messageList)[i].messageValue); + } + debug("--------------------------------"); +#endif while (_messageList && _messageListIndex < _messageListCount && !_isKlaymanBusy) { uint32 messageNum = (*_messageList)[_messageListIndex].messageNum; diff --git a/engines/neverhood/staticdata.cpp b/engines/neverhood/staticdata.cpp index 45935945f7ec..3f89c2236faa 100644 --- a/engines/neverhood/staticdata.cpp +++ b/engines/neverhood/staticdata.cpp @@ -42,7 +42,7 @@ void StaticData::load(const char *filename) { // Load message lists uint32 messageListsCount = fd.readUint32LE(); - debug("messageListsCount: %d", messageListsCount); + debug(3, "messageListsCount: %d", messageListsCount); for (uint32 i = 0; i < messageListsCount; i++) { MessageList *messageList = new MessageList(); uint32 id = fd.readUint32LE(); @@ -58,7 +58,7 @@ void StaticData::load(const char *filename) { // Load rect lists uint32 rectListsCount = fd.readUint32LE(); - debug("rectListsCount: %d", rectListsCount); + debug(3, "rectListsCount: %d", rectListsCount); for (uint32 i = 0; i < rectListsCount; i++) { RectList *rectList = new RectList(); uint32 id = fd.readUint32LE(); @@ -87,7 +87,7 @@ void StaticData::load(const char *filename) { // Load hit rects uint32 hitRectListsCount = fd.readUint32LE(); - debug("hitRectListsCount: %d", hitRectListsCount); + debug(3, "hitRectListsCount: %d", hitRectListsCount); for (uint32 i = 0; i < hitRectListsCount; i++) { HitRectList *hitRectList = new HitRectList(); uint32 id = fd.readUint32LE(); @@ -106,7 +106,7 @@ void StaticData::load(const char *filename) { // Load navigation lists uint32 navigationListsCount = fd.readUint32LE(); - debug("navigationListsCount: %d", navigationListsCount); + debug(3, "navigationListsCount: %d", navigationListsCount); for (uint32 i = 0; i < navigationListsCount; i++) { NavigationList *navigationList = new NavigationList(); uint32 id = fd.readUint32LE(); @@ -127,7 +127,7 @@ void StaticData::load(const char *filename) { // Load HallOfRecordsInfo items uint32 hallOfRecordsInfoItemsCount = fd.readUint32LE(); - debug("hallOfRecordsInfoItemsCount: %d", hallOfRecordsInfoItemsCount); + debug(3, "hallOfRecordsInfoItemsCount: %d", hallOfRecordsInfoItemsCount); for (uint32 i = 0; i < hallOfRecordsInfoItemsCount; i++) { HallOfRecordsInfo *hallOfRecordsInfo = new HallOfRecordsInfo(); uint32 id = fd.readUint32LE(); @@ -142,7 +142,7 @@ void StaticData::load(const char *filename) { // Load TrackInfo items uint32 trackInfoItemsCount = fd.readUint32LE(); - debug("trackInfoItemsCount: %d", trackInfoItemsCount); + debug(3, "trackInfoItemsCount: %d", trackInfoItemsCount); for (uint32 i = 0; i < trackInfoItemsCount; i++) { TrackInfo *trackInfo = new TrackInfo(); uint32 id = fd.readUint32LE();