diff options
Diffstat (limited to 'engines/cryomni3d/fixed_image.cpp')
-rw-r--r-- | engines/cryomni3d/fixed_image.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/engines/cryomni3d/fixed_image.cpp b/engines/cryomni3d/fixed_image.cpp index 660190a09f..08bc78e595 100644 --- a/engines/cryomni3d/fixed_image.cpp +++ b/engines/cryomni3d/fixed_image.cpp @@ -60,6 +60,9 @@ void ZonFixedImage::run(const CallbackFunctor *callback) { delete _callback; _callback = nullptr; + + // Don't use the current _imageSurface, we may not own it anymore + _imageSurface = nullptr; } void ZonFixedImage::load(const Common::String &image) { @@ -294,4 +297,17 @@ void ZonFixedImage::handleMouseZones(const Common::Array<Zone>::const_iterator & } } +void ZonFixedImage::updateSurface(const Graphics::Surface *newSurface) { + if (newSurface->w != _imageSurface->w || + newSurface->h != _imageSurface->h || + newSurface->format != _imageSurface->format) { + error("New surface has invalid attributes"); + } + + // Be careful the surface must be destroyed after the fixed image has finished with it + _imageSurface = newSurface; + + display(); +} + } // End of namespace CryOmni3D |