From 0df4d0aed1678f81cb75bb56cb2a1fc19603312c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 12 Mar 2014 23:45:57 -0400 Subject: MADS: Fixed loading of scene depth surface for Rex Nebular --- engines/mads/nebular/nebular_scenes.cpp | 9 +++++++-- engines/mads/nebular/nebular_scenes.h | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'engines/mads/nebular') diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp index baee40cc47..3587822f19 100644 --- a/engines/mads/nebular/nebular_scenes.cpp +++ b/engines/mads/nebular/nebular_scenes.cpp @@ -68,6 +68,13 @@ void SceneInfoNebular::loadCodes(MSurface &depthSurface) { MadsPack codesPack(&f); Common::SeekableReadStream *stream = codesPack.getItemStream(0); + loadCodes(depthSurface, stream); + + delete stream; + f.close(); +} + +void SceneInfoNebular::loadCodes(MSurface &depthSurface, Common::SeekableReadStream *stream) { byte *destP = depthSurface.getData(); byte *endP = depthSurface.getBasePtr(0, depthSurface.h); @@ -85,8 +92,6 @@ void SceneInfoNebular::loadCodes(MSurface &depthSurface) { if (destP < endP) Common::fill(destP, endP, 0); - delete stream; - f.close(); } } // End of namespace Nebular diff --git a/engines/mads/nebular/nebular_scenes.h b/engines/mads/nebular/nebular_scenes.h index da36c71905..5ac708d398 100644 --- a/engines/mads/nebular/nebular_scenes.h +++ b/engines/mads/nebular/nebular_scenes.h @@ -115,6 +115,8 @@ class SceneInfoNebular : public SceneInfo { protected: virtual void loadCodes(MSurface &depthSurface); + virtual void loadCodes(MSurface &depthSurface, Common::SeekableReadStream *stream); + /** * Constructor */ -- cgit v1.2.3