aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorjohndoe1232011-07-16 21:22:54 +0000
committerWillem Jan Palenstijn2013-05-08 20:38:48 +0200
commit438b6bb53c03db915f436a95427b6ab2c9504fce (patch)
treeb995a4c67626dcae77ba2af9cb9c16cfa920725c /engines
parent71da221507182398a1fe905f4cd293a4ed25eacd (diff)
downloadscummvm-rg350-438b6bb53c03db915f436a95427b6ab2c9504fce.tar.gz
scummvm-rg350-438b6bb53c03db915f436a95427b6ab2c9504fce.tar.bz2
scummvm-rg350-438b6bb53c03db915f436a95427b6ab2c9504fce.zip
NEVERHOOD: Implement Module2300 (just a bunch of NavigationScenes)
- Fix Smacker player by using a SafeSubReadStream - Fix NavigationMouse (cursors in type 1 were swapped)
Diffstat (limited to 'engines')
-rw-r--r--engines/neverhood/blbarchive.cpp3
-rw-r--r--engines/neverhood/gamemodule.cpp70
-rw-r--r--engines/neverhood/gamemodule.h6
-rw-r--r--engines/neverhood/module.cpp2
-rw-r--r--engines/neverhood/module.mk1
-rw-r--r--engines/neverhood/module1000.cpp7
-rw-r--r--engines/neverhood/module2300.cpp270
-rw-r--r--engines/neverhood/module2300.h57
-rw-r--r--engines/neverhood/mouse.cpp5
-rw-r--r--engines/neverhood/resource.cpp17
-rw-r--r--engines/neverhood/sprite.cpp5
11 files changed, 407 insertions, 36 deletions
diff --git a/engines/neverhood/blbarchive.cpp b/engines/neverhood/blbarchive.cpp
index 3138b9102d..2e29485d58 100644
--- a/engines/neverhood/blbarchive.cpp
+++ b/engines/neverhood/blbarchive.cpp
@@ -110,7 +110,8 @@ byte *BlbArchive::getEntryExtData(uint index) {
Common::SeekableReadStream *BlbArchive::createStream(uint index) {
const BlbArchiveEntry &entry = _entries[index];
- return new Common::SeekableSubReadStream(&_fd, entry.offset, entry.offset + entry.diskSize);
+ //debug("entry.offset = %08X; entry.offset + entry.diskSize = %08X", entry.offset, entry.offset + entry.diskSize);
+ return new Common::SafeSubReadStream(&_fd, entry.offset, entry.offset + entry.diskSize);
}
} // End of namespace Neverhood
diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp
index c2d3e6d887..4800923d2d 100644
--- a/engines/neverhood/gamemodule.cpp
+++ b/engines/neverhood/gamemodule.cpp
@@ -25,6 +25,7 @@
#include "neverhood/graphics.h"
#include "neverhood/module1000.h"
#include "neverhood/module1500.h"
+#include "neverhood/module2300.h"
namespace Neverhood {
@@ -63,7 +64,7 @@ void GameModule::handleMouseMove(int16 x, int16 y) {
NPoint mousePos;
mousePos.x = x;
mousePos.y = y;
- debug("GameModule::handleMouseMove(%d, %d)", x, y);
+ debug(2, "GameModule::handleMouseMove(%d, %d)", x, y);
_childObject->sendPointMessage(0, mousePos, this);
}
}
@@ -73,7 +74,7 @@ void GameModule::handleMouseDown(int16 x, int16 y) {
NPoint mousePos;
mousePos.x = x;
mousePos.y = y;
- debug("GameModule::handleMouseDown(%d, %d)", x, y);
+ debug(2, "GameModule::handleMouseDown(%d, %d)", x, y);
_childObject->sendPointMessage(1, mousePos, this);
}
}
@@ -106,9 +107,29 @@ uint32 GameModule::handleMessage(int messageNum, const MessageParam &param, Enti
void GameModule::startup() {
// TODO: Displaying of error text probably not needed in ScummVM
-// createModule1500(0); // Logos and intro video
+// createModule1500(0); // Logos and intro video //Real
+// createModule1000(0);
+ createModule2300(0);
+}
+
+void GameModule::createModule1000(int which) {
+ setGlobalVar(0x91080831, 0x03294419);
+ _childObject = new Module1000(_vm, this, which);
+ SetUpdateHandler(&GameModule::updateModule1000);
+}
- createModule1000(0);
+void GameModule::updateModule1000() {
+ if (!_childObject)
+ return;
+ _childObject->handleUpdate();
+ if (_done) {
+ _done = false;
+ // TODO _resourceTable3.load();
+ delete _childObject;
+ _childObject = NULL;
+ createModule2300(0);
+ _childObject->handleUpdate();
+ }
}
void GameModule::createModule1500(int which) {
@@ -131,24 +152,47 @@ void GameModule::updateModule1500() {
}
}
-void GameModule::createModule1000(int which) {
- setGlobalVar(0x91080831, 0x03294419);
- _childObject = new Module1000(_vm, this, which);
- SetUpdateHandler(&GameModule::updateModule1000);
+void GameModule::createModule2300(int which) {
+ setGlobalVar(0x91080831, 0x1A214010);
+ _childObject = new Module2300(_vm, this, which);
+ SetUpdateHandler(&GameModule::updateModule2300);
}
-void GameModule::updateModule1000() {
+void GameModule::updateModule2300() {
if (!_childObject)
return;
_childObject->handleUpdate();
if (_done) {
_done = false;
- // TODO _resourceTable3.load();
delete _childObject;
_childObject = NULL;
- error("Done...");
- // TODO createModule2300();
- // TODO _childObject->handleUpdate();
+ if (_field20 == 1) {
+ // TODO createModule2200(0);
+ // TODO _childObject->handleUpdate();
+ } else if (_field20 == 2) {
+ // TODO createModule1200(0);
+ // TODO _childObject->handleUpdate();
+ } else if (_field20 == 3) {
+ // TODO createModule2400(0);
+ // TODO _childObject->handleUpdate();
+ } else if (_field20 == 4) {
+ // TODO createModule3000(0);
+ // TODO _childObject->handleUpdate();
+ } else {
+ createModule1000(1);
+ _childObject->handleUpdate();
+ }
+ }
+ if (_field24 >= 0) {
+ if (_field24 == 2) {
+ // TODO _resourceTable4.load();
+ } else if (_field24 == 0) {
+ // TODO _resourceTable3.load();
+ }
+ _field24 = -1;
+ }
+ if (_field26 >= 0) {
+ _field26 = -1;
}
}
diff --git a/engines/neverhood/gamemodule.h b/engines/neverhood/gamemodule.h
index 876506ce0c..7977ea51a0 100644
--- a/engines/neverhood/gamemodule.h
+++ b/engines/neverhood/gamemodule.h
@@ -49,10 +49,12 @@ protected:
*/
uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
void startup();
- void createModule1500(int which);
- void updateModule1500();
void createModule1000(int which);
void updateModule1000();
+ void createModule1500(int which);
+ void updateModule1500();
+ void createModule2300(int which);
+ void updateModule2300();
};
} // End of namespace Neverhood
diff --git a/engines/neverhood/module.cpp b/engines/neverhood/module.cpp
index 03109c0c86..8f0b55625a 100644
--- a/engines/neverhood/module.cpp
+++ b/engines/neverhood/module.cpp
@@ -42,7 +42,6 @@ void Module::draw() {
}
uint32 Module::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
-
switch (messageNum) {
case 0x0008:
if (_parentModule)
@@ -68,7 +67,6 @@ uint32 Module::handleMessage(int messageNum, const MessageParam &param, Entity *
if (_childObject && sender == _parentModule)
return _childObject->sendMessage(messageNum, param, sender);
}
-
return 0;
}
diff --git a/engines/neverhood/module.mk b/engines/neverhood/module.mk
index af03c075cc..ed7077e337 100644
--- a/engines/neverhood/module.mk
+++ b/engines/neverhood/module.mk
@@ -12,6 +12,7 @@ MODULE_OBJS = \
module.o \
module1000.o \
module1500.o \
+ module2300.o \
mouse.o \
navigationscene.o \
neverhood.o \
diff --git a/engines/neverhood/module1000.cpp b/engines/neverhood/module1000.cpp
index dc28960e60..8ee5941d95 100644
--- a/engines/neverhood/module1000.cpp
+++ b/engines/neverhood/module1000.cpp
@@ -21,7 +21,6 @@
*/
#include "neverhood/module1000.h"
-#include "neverhood/navigationscene.h"//###
namespace Neverhood {
@@ -54,9 +53,10 @@ Module1000::Module1000(NeverhoodEngine *vm, Module *parentModule, int which)
break;
}
} else if (which == 0) {
- //createScene1001(0);
+ //createScene1001(0);//Real
// DEBUG: Jump to room
- createScene1002(0);
+ setGlobalVar(0x8306F218, 1);
+ createScene1002(2);
//createScene1005(0);
//createScene1004(0);
} else if (which == 1) {
@@ -80,7 +80,6 @@ void Module1000::createScene1001(int which) {
void Module1000::createScene1002(int which) {
_vm->gameState().sceneNum = 1;
_childObject = new Scene1002(_vm, this, which);
- // DEBUG _childObject = new NavigationScene(_vm, this, 0x004B67B8, 0, NULL);
// TODO ResourceTable_multiLoad(&_resourceTable3, &_resourceTable4, &_resourceTable1);
// TODO Music18hList_play(0x061880C6, 0, 0, 1);
SetUpdateHandler(&Module1000::updateScene1002);
diff --git a/engines/neverhood/module2300.cpp b/engines/neverhood/module2300.cpp
new file mode 100644
index 0000000000..32ce2a18ba
--- /dev/null
+++ b/engines/neverhood/module2300.cpp
@@ -0,0 +1,270 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "neverhood/module2300.h"
+#include "neverhood/navigationscene.h"
+#include "neverhood/smackerscene.h"
+
+namespace Neverhood {
+
+Module2300::Module2300(NeverhoodEngine *vm, Module *parentModule, int which)
+ : Module(vm, parentModule), _volume(0) {
+
+ debug("Create Module2300(%d)", which);
+
+ // TODO Sound1ChList_addSoundResources(0x1A214010, dword_4B6938, true);
+ // TODO Sound1ChList_setSoundValuesMulti(dword_4B6938, true, 50, 600, 10, 10, 150);
+
+ _flag = getGlobalVar(0x10938830) == 0;
+
+ if (_flag) {
+ // TODO Sound1ChList_setVolume(0x90F0D1C3, 0);
+ // TODO Sound1ChList_playLooping(0x90F0D1C3);
+ } else {
+ // TODO Sound1ChList_setSoundValues(0x90F0D1C3, false, 0, 0, 0, 0);
+ }
+
+ // TODO Sound1ChList_sub_407C70(0x1A214010, 0x48498E46, 0x50399F64, 0);
+ // TODO Sound1ChList_sub_407C70(0x1A214010, 0x41861371, 0x43A2507F, 0);
+
+ if (which < 0) {
+ switch (_vm->gameState().sceneNum) {
+ case 0:
+ createScene2301(-1);
+ break;
+ case 1:
+ createScene2302(-1);
+ break;
+ case 2:
+ createScene2303(-1);
+ break;
+ case 3:
+ createScene2304(-1);
+ break;
+ case 4:
+ createScene2305(-1);
+ break;
+ }
+ } else if (which == 1) {
+ createScene2303(0);
+ } else if (which == 2) {
+ createScene2304(0);
+ } else if (which == 3) {
+ createScene2305(-1);
+ } else if (which == 4) {
+ createScene2302(3);
+ } else {
+ createScene2301(1);
+ }
+
+}
+
+Module2300::~Module2300() {
+ // TODO Sound1ChList_sub_407A50(0x1A214010);
+}
+
+void Module2300::createScene2301(int which) {
+ _vm->gameState().sceneNum = 0;
+ _childObject = new NavigationScene(_vm, this, 0x004B67B8, which, NULL);
+ SetUpdateHandler(&Module2300::updateScene2301);
+}
+
+void Module2300::createScene2302(int which) {
+ _vm->gameState().sceneNum = 1;
+ _childObject = new NavigationScene(_vm, this, 0x004B67E8, which, NULL);
+ SetUpdateHandler(&Module2300::updateScene2302);
+ if (_flag) {
+ _volume = 15;
+ // TODO Sound1ChList_setVolume(0x90F0D1C3, 15);
+ }
+}
+
+void Module2300::createScene2303(int which) {
+ _vm->gameState().sceneNum = 2;
+ _childObject = new NavigationScene(_vm, this, 0x004B6878, which, NULL);
+ SetUpdateHandler(&Module2300::updateScene2303);
+}
+
+void Module2300::createScene2304(int which) {
+ _vm->gameState().sceneNum = 3;
+ if (getGlobalVar(0x10938830)) {
+ _childObject = new NavigationScene(_vm, this, 0x004B68F0, which, NULL);
+ } else {
+ // TODO Sound1ChList_setVolume(0x90F0D1C3, _volume);
+ _childObject = new NavigationScene(_vm, this, 0x004B68A8, which, NULL);
+ if (_flag) {
+ _volume = 87;
+ // TODO Sound1ChList_setVolume(0x90F0D1C3, 87);
+ }
+ }
+ SetUpdateHandler(&Module2300::updateScene2304);
+}
+
+void Module2300::createScene2305(int which) {
+ SmackerScene *smackerScene;
+ _vm->gameState().sceneNum = 4;
+ // TODO Sound1ChList_sub_4080B0(true);
+ smackerScene = new SmackerScene(_vm, this, true, true, false);
+ smackerScene->setFileHash(0x20080A0B);
+ smackerScene->nextVideo();
+ _childObject = smackerScene;
+ SetUpdateHandler(&Module2300::updateScene2305);
+}
+
+void Module2300::updateScene2301() {
+ _childObject->handleUpdate();
+ if (_done) {
+ _done = false;
+ delete _childObject;
+ _childObject = NULL;
+ if (_field20 == 1) {
+ createScene2302(4);
+ _childObject->handleUpdate();
+ } else {
+ _parentModule->sendMessage(0x1009, 0, this);
+ }
+ }
+ if (_field24 >= 0) {
+ if (_field24 == 0) {
+ _parentModule->sendMessage(0x100A, 0, this);
+ }
+ _field24 = -1;
+ }
+ if (_field26 >= 0) {
+ _parentModule->sendMessage(0x1023, 0, this);
+ _field26 = -1;
+ }
+}
+
+void Module2300::updateScene2302() {
+ _childObject->handleUpdate();
+#if 0 // TODO
+ NavigationScene *navigationScene = (NavigationScene*)_childObject;
+ if (_flag && navigationScene->getSoundFlag1() && navigationScene->getNavigationIndex() == 4 &&
+ navigationScene->getSmackerPlayer() && navigationScene->getSmackerPlayer()->getFrameNumber() % 2) {
+ _volume++;
+ Sound1ChList_setVolume(0x90F0D1C3, _volume);
+ }
+#endif
+#if 0 // TODO
+ if (navigationScene->getSoundFlag1() && navigationScene->getNavigationIndex() == 0 &&
+ navigationScene->getSmackerPlayer() && navigationScene->getSmackerPlayer()->getFrameNumber() == 50) {
+ Sound1ChList_sub_407C70(0x1A214010, 0x48498E46, 0x50399F64);
+ Sound1ChList_setVolume(0x48498E46, 70);
+ Sound1ChList_setVolume(0x50399F64, 70);
+ }
+#endif
+ if (_done) {
+ debug("SCENE 2302 DONE; _field20 = %d", _field20);
+ _done = false;
+ delete _childObject;
+ _childObject = NULL;
+ if (_field20 == 1) {
+ createScene2301(0);
+ _childObject->handleUpdate();
+ } else if (_field20 == 2) {
+ createScene2303(1);
+ _childObject->handleUpdate();
+ } else if (_field20 == 3) {
+ createScene2302(3);
+ _childObject->handleUpdate();
+ } else if (_field20 == 4) {
+ createScene2304(1);
+ _childObject->handleUpdate();
+ } else if (_field20 == 5) {
+ _parentModule->sendMessage(0x1009, 3, this);
+ } else {
+ _parentModule->sendMessage(0x1009, 4, this);
+ }
+ }
+}
+
+void Module2300::updateScene2303() {
+ _childObject->handleUpdate();
+ if (_done) {
+ _done = false;
+ delete _childObject;
+ _childObject = NULL;
+ if (_field20 == 1) {
+ _parentModule->sendMessage(0x1009, 3, this);
+ } else {
+ createScene2302(5);
+ _childObject->handleUpdate();
+ }
+ }
+ if (_field24 >= 0) {
+ if (_field24 == 1) {
+ // TODO _resourceTable1.setResourceList(ex_sub_479D00(0), true);
+ // TODO _resourceTable2.loadResources();
+ }
+ _field24 = -1;
+ }
+}
+
+void Module2300::updateScene2304() {
+ _childObject->handleUpdate();
+#if 0 // TODO
+ NavigationScene *navigationScene = (NavigationScene*)_childObject;
+ if (_flag && navigationScene->getSoundFlag1() && navigationScene->getSmackerPlayer() &&
+ navigationScene->getSmackerPlayer()->getFrameNumber() % 2) {
+ _volume--;
+ Sound1ChList_setVolume(0x90F0D1C3, _volume);
+ }
+#endif
+ if (_done) {
+ _done = false;
+ delete _childObject;
+ _childObject = NULL;
+ if (_field20 == 1) {
+ _parentModule->sendMessage(0x1009, 2, this);
+ } else {
+ createScene2302(1);
+ _childObject->handleUpdate();
+ }
+ }
+ if (_field24 >= 0) {
+ if (_field24 == 0) {
+ _parentModule->sendMessage(0x100A, 2, this);
+ }
+ _field24 = -1;
+ }
+ if (_field26 >= 0) {
+ if (_field26 == 1) {
+ _parentModule->sendMessage(0x1023, 2, this);
+ }
+ _field26 = -1;
+ }
+}
+
+void Module2300::updateScene2305() {
+ _childObject->handleUpdate();
+ if (_done) {
+ _done = false;
+ delete _childObject;
+ _childObject = NULL;
+ // TODO Sound1ChList_sub_4080B0(false);
+ createScene2302(2);
+ _childObject->handleUpdate();
+ }
+}
+
+} // End of namespace Neverhood
diff --git a/engines/neverhood/module2300.h b/engines/neverhood/module2300.h
new file mode 100644
index 0000000000..9f705db6d5
--- /dev/null
+++ b/engines/neverhood/module2300.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef NEVERHOOD_MODULE2300_H
+#define NEVERHOOD_MODULE2300_H
+
+#include "neverhood/neverhood.h"
+#include "neverhood/module.h"
+#include "neverhood/scene.h"
+
+namespace Neverhood {
+
+// Module2300
+
+class Module2300 : public Module {
+public:
+ Module2300(NeverhoodEngine *vm, Module *parentModule, int which);
+ virtual ~Module2300();
+protected:
+ // TODO ResourceTable _resourceTable1;
+ // TODO ResourceTable _resourceTable2;
+ bool _flag;
+ int _volume;
+ void createScene2301(int which);
+ void createScene2302(int which);
+ void createScene2303(int which);
+ void createScene2304(int which);
+ void createScene2305(int which);
+ void updateScene2301();
+ void updateScene2302();
+ void updateScene2303();
+ void updateScene2304();
+ void updateScene2305();
+};
+
+} // End of namespace Neverhood
+
+#endif /* NEVERHOOD_MODULE2300_H */
diff --git a/engines/neverhood/mouse.cpp b/engines/neverhood/mouse.cpp
index 63d98666d6..1eaf0cb843 100644
--- a/engines/neverhood/mouse.cpp
+++ b/engines/neverhood/mouse.cpp
@@ -258,6 +258,7 @@ void NavigationMouse::update() {
}
uint32 NavigationMouse::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
+ debug("NavigationMouse: _type = %d", _type);
uint32 messageResult = 0;
switch (messageNum) {
case 0x2064:
@@ -311,9 +312,9 @@ uint32 NavigationMouse::handleMessage(int messageNum, const MessageParam &param,
switch (_type) {
case 1:
if (_x >= 320)
- _mouseCursorResource.setCursorNum(6);
- else
_mouseCursorResource.setCursorNum(5);
+ else
+ _mouseCursorResource.setCursorNum(6);
break;
case 2:
default:
diff --git a/engines/neverhood/resource.cpp b/engines/neverhood/resource.cpp
index 8b2a19c07c..44fef14ebe 100644
--- a/engines/neverhood/resource.cpp
+++ b/engines/neverhood/resource.cpp
@@ -51,11 +51,11 @@ void SpriteResource::draw(byte *dest, int destPitch, bool flipX, bool flipY) {
}
bool SpriteResource::load(uint32 fileHash) {
- debug("SpriteResource::load(%08X)", fileHash);
+ debug(2, "SpriteResource::load(%08X)", fileHash);
// TODO: Later merge with load2 and make the mode a parameter
unload();
_resourceHandle = _vm->_res->useResource(fileHash);
- debug("SpriteResource::load(0x%08X) _resourceHandle = %d", fileHash, _resourceHandle);
+ debug(2, "SpriteResource::load(0x%08X) _resourceHandle = %d", fileHash, _resourceHandle);
if (_resourceHandle != -1) {
if (_vm->_res->getResourceType(_resourceHandle) == 2) {
byte *spriteData = _vm->_res->loadResource(_resourceHandle, true);
@@ -106,7 +106,7 @@ PaletteResource::~PaletteResource() {
}
bool PaletteResource::load(uint32 fileHash) {
- debug("PaletteResource::load(%08X)", fileHash);
+ debug(2, "PaletteResource::load(%08X)", fileHash);
unload();
_resourceHandle = _vm->_res->useResource(fileHash);
if (_resourceHandle != -1) {
@@ -170,7 +170,7 @@ void AnimResource::draw(uint frameIndex, byte *dest, int destPitch, bool flipX,
}
bool AnimResource::load(uint32 fileHash) {
- debug("AnimResource::load(%08X)", fileHash);
+ debug(2, "AnimResource::load(%08X)", fileHash);
if (fileHash == _fileHash)
return true;
@@ -304,7 +304,7 @@ int16 AnimResource::getFrameIndex(uint32 frameHash) {
frameIndex = (int16)i;
break;
}
- debug("AnimResource::getFrameIndex(%08X) -> %d", frameHash, frameIndex);
+ debug(2, "AnimResource::getFrameIndex(%08X) -> %d", frameHash, frameIndex);
return frameIndex;
}
@@ -324,7 +324,6 @@ void MouseCursorResource::load(uint32 fileHash) {
if (_currFileHash != fileHash) {
if (_cursorSprite.load(fileHash) && !_cursorSprite.isRle() &&
_cursorSprite.getDimensions().width == 96 && _cursorSprite.getDimensions().height == 224) {
- debug("load ok");
_currFileHash = fileHash;
} else {
unload();
@@ -417,7 +416,7 @@ DataResource::~DataResource() {
}
void DataResource::load(uint32 fileHash) {
- debug("DataResource::load(%08X)", fileHash);
+ debug(2, "DataResource::load(%08X)", fileHash);
byte *data = NULL;
uint32 dataSize = 0;
unload();
@@ -435,14 +434,14 @@ void DataResource::load(uint32 fileHash) {
Common::MemoryReadStream dataS(data, dataSize);
uint itemCount = dataS.readUint16LE();
uint32 itemStartOffs = 2 + itemCount * 8;
- debug("itemCount = %d", itemCount);
+ debug(2, "itemCount = %d", itemCount);
for (uint i = 0; i < itemCount; i++) {
dataS.seek(2 + i * 8);
DRDirectoryItem drDirectoryItem;
drDirectoryItem.nameHash = dataS.readUint32LE();
drDirectoryItem.offset = dataS.readUint16LE();
drDirectoryItem.type = dataS.readUint16LE();
- debug("%03d nameHash = %08X; offset = %04X; type = %d", i, drDirectoryItem.nameHash, drDirectoryItem.offset, drDirectoryItem.type);
+ debug(2, "%03d nameHash = %08X; offset = %04X; type = %d", i, drDirectoryItem.nameHash, drDirectoryItem.offset, drDirectoryItem.type);
dataS.seek(itemStartOffs + drDirectoryItem.offset);
switch (drDirectoryItem.type) {
case 1:
diff --git a/engines/neverhood/sprite.cpp b/engines/neverhood/sprite.cpp
index 2c772d7731..d0a6628d75 100644
--- a/engines/neverhood/sprite.cpp
+++ b/engines/neverhood/sprite.cpp
@@ -385,7 +385,6 @@ void AnimatedSprite::updatePosition() {
void AnimatedSprite::updateFrameIndex() {
if (!_playBackwards) {
- //debug("%08X ### _frameIndex = %d; _frameIndex2 = %d", _currAnimFileHash, _frameIndex, _frameIndex2);
if (_frameIndex < _frameIndex2) {
_frameIndex++;
} else {
@@ -437,7 +436,7 @@ void AnimatedSprite::createSurface1(uint32 fileHash, int surfacePriority) {
}
void AnimatedSprite::setFileHash(uint32 fileHash, int16 frameIndex3, int16 frameIndex4) {
- debug("AnimatedSprite::setFileHash(%08X, %d, %d)", fileHash, frameIndex3, frameIndex4);
+ debug(2, "AnimatedSprite::setFileHash(%08X, %d, %d)", fileHash, frameIndex3, frameIndex4);
_fileHash1 = fileHash;
_frameIndex3 = frameIndex3;
_frameIndex4 = frameIndex4;
@@ -454,7 +453,7 @@ void AnimatedSprite::setFileHash1() {
}
void AnimatedSprite::setFileHash2(uint32 fileHash, uint32 fileHash6, uint32 fileHash5) {
- debug("AnimatedSprite::setFileHash2(%08X, %08X, %08X)", fileHash, fileHash6, fileHash5);
+ debug(2, "AnimatedSprite::setFileHash2(%08X, %08X, %08X)", fileHash, fileHash6, fileHash5);
_fileHash1 = fileHash;
_fileHash6 = fileHash6;
_fileHash5 = fileHash5;