aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Milburn2011-01-19 20:53:28 +0000
committerAlyssa Milburn2011-01-19 20:53:28 +0000
commita3e9197805f0d94cf17da366aeaa7b82a6b5e670 (patch)
tree069bac7974d1ff5b453f16f698a98105fe99968b
parentbad7f1ce9a67e71eaaa390ac56ae5a3720c3fb7a (diff)
downloadscummvm-rg350-a3e9197805f0d94cf17da366aeaa7b82a6b5e670.tar.gz
scummvm-rg350-a3e9197805f0d94cf17da366aeaa7b82a6b5e670.tar.bz2
scummvm-rg350-a3e9197805f0d94cf17da366aeaa7b82a6b5e670.zip
MOHAWK: Add getSubImageSize function.
svn-id: r55334
-rw-r--r--engines/mohawk/graphics.cpp10
-rw-r--r--engines/mohawk/graphics.h2
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);