diff options
Diffstat (limited to 'engines/mohawk')
-rw-r--r-- | engines/mohawk/graphics.cpp | 10 | ||||
-rw-r--r-- | engines/mohawk/graphics.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/engines/mohawk/graphics.cpp b/engines/mohawk/graphics.cpp index 9121b5a571..84e9e57946 100644 --- a/engines/mohawk/graphics.cpp +++ b/engines/mohawk/graphics.cpp @@ -174,6 +174,16 @@ void GraphicsManager::copyAnimSubImageToScreen(uint16 image, uint16 subimage, in copyAnimImageSectionToScreen(images[subimage], srcRect, dstRect); } +void GraphicsManager::getSubImageSize(uint16 image, uint16 subimage, uint16 &width, uint16 &height) { + if (!_subImageCache.contains(image)) + _subImageCache[image] = decodeImages(image); + Common::Array<MohawkSurface *> &images = _subImageCache[image]; + + Graphics::Surface *surface = images[subimage]->getSurface(); + width = surface->w; + height = surface->h; +} + void GraphicsManager::copyAnimImageSectionToScreen(MohawkSurface *image, Common::Rect srcRect, Common::Rect dstRect) { uint16 startX = 0; uint16 startY = 0; diff --git a/engines/mohawk/graphics.h b/engines/mohawk/graphics.h index 969188457a..22dcb86aff 100644 --- a/engines/mohawk/graphics.h +++ b/engines/mohawk/graphics.h @@ -95,6 +95,8 @@ public: void copyAnimImageSectionToScreen(uint16 image, Common::Rect src, Common::Rect dest); void copyAnimSubImageToScreen(uint16 image, uint16 subimage, int left = 0, int top = 0); + void getSubImageSize(uint16 image, uint16 subimage, uint16 &width, uint16 &height); + protected: void copyAnimImageSectionToScreen(MohawkSurface *image, Common::Rect src, Common::Rect dest); |