From 91d0f43cbffddf413d6f8abe9c8015ce37482133 Mon Sep 17 00:00:00 2001 From: Le Philousophe Date: Sun, 5 May 2019 12:32:46 +0200 Subject: CRYOMNI3D: Add ability to choose ZON file That's only used for workaround when an unused image file hasn't any ZON file for it --- engines/cryomni3d/fixed_image.cpp | 7 +++++-- engines/cryomni3d/fixed_image.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'engines/cryomni3d') diff --git a/engines/cryomni3d/fixed_image.cpp b/engines/cryomni3d/fixed_image.cpp index d4b9f37e0c..f4e900f333 100644 --- a/engines/cryomni3d/fixed_image.cpp +++ b/engines/cryomni3d/fixed_image.cpp @@ -65,7 +65,8 @@ void ZonFixedImage::run(const CallbackFunctor *callback) { _imageSurface = nullptr; } -void ZonFixedImage::load(const Common::String &image) { +// Just pass a const char * for zone because it's for workarounds and constructing a null String at almost each load call is inefficient +void ZonFixedImage::load(const Common::String &image, const char *zone) { _imageSurface = nullptr; delete _imageDecoder; _imageDecoder = nullptr; @@ -76,7 +77,9 @@ void ZonFixedImage::load(const Common::String &image) { } _imageSurface = _imageDecoder->getSurface(); - loadZones(image); + const Common::String &zoneFName = zone == nullptr ? image : zone; + loadZones(zoneFName); + #if 0 // This is not correct but to debug zones I think it's OK Graphics::Surface *tmpSurf = (Graphics::Surface *) _imageSurface; diff --git a/engines/cryomni3d/fixed_image.h b/engines/cryomni3d/fixed_image.h index 3cabfa3077..7321a30e05 100644 --- a/engines/cryomni3d/fixed_image.h +++ b/engines/cryomni3d/fixed_image.h @@ -69,7 +69,7 @@ public: void display() const; /* These functions and attributes are used in image handler */ - void load(const Common::String &image); + void load(const Common::String &image, const char *zone = nullptr); void manage(); void updateSurface(const Graphics::Surface *newSurface); const Graphics::Surface *surface() const { return _imageSurface; } -- cgit v1.2.3