From 3473e8c6da4565d3c0729ba106b5405dc6039d29 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 16 Jul 2010 08:03:26 +0000 Subject: Clarified variable used for scene node loading, and added in extra blank nodes for player movement like the original game does svn-id: r50932 --- engines/m4/mads_scene.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/engines/m4/mads_scene.cpp b/engines/m4/mads_scene.cpp index c30e8db5da..1972e2d989 100644 --- a/engines/m4/mads_scene.cpp +++ b/engines/m4/mads_scene.cpp @@ -765,7 +765,7 @@ void MadsSceneResources::load(int sceneNumber, const char *resName, int v0, M4Su stream->skip(24); - int objectCount = stream->readUint16LE(); + int nodeCount = stream->readUint16LE(); _yBandsEnd = stream->readUint16LE(); _yBandsStart = stream->readUint16LE(); _maxScale = stream->readSint16LE(); @@ -775,14 +775,20 @@ void MadsSceneResources::load(int sceneNumber, const char *resName, int v0, M4Su stream->skip(2); // Load in any scene objects - for (int i = 0; i < objectCount; ++i) { + for (int i = 0; i < nodeCount; ++i) { SceneNode rec; rec.load(stream); _nodes.push_back(rec); } - for (int i = 0; i < 20 - objectCount; ++i) + for (int i = 0; i < 20 - nodeCount; ++i) stream->skip(48); + // Add two extra nodes in that will be used for player movement + for (int i = 0; i < 2; ++i) { + SceneNode rec; + _nodes.push_back(rec); + } + int setCount = stream->readUint16LE(); stream->readUint16LE(); for (int i = 0; i < setCount; ++i) { -- cgit v1.2.3