aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/screen.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2006-09-10 13:26:00 +0000
committerJohannes Schickel2006-09-10 13:26:00 +0000
commit09f7e35196e5d07a04730b70cc81602be736cfaa (patch)
treed61d1357c8887c6cc41f46e0bce4b8a8c3643b0a /engines/kyra/screen.cpp
parent854eac7f9b99893150c63a91aeb55726b54ef8d0 (diff)
downloadscummvm-rg350-09f7e35196e5d07a04730b70cc81602be736cfaa.tar.gz
scummvm-rg350-09f7e35196e5d07a04730b70cc81602be736cfaa.tar.bz2
scummvm-rg350-09f7e35196e5d07a04730b70cc81602be736cfaa.zip
Little bit cleanup.
svn-id: r23863
Diffstat (limited to 'engines/kyra/screen.cpp')
-rw-r--r--engines/kyra/screen.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index 5d74e0e97b..3491be528c 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -2242,6 +2242,18 @@ void Screen::loadBitmap(const char *filename, int tempPage, int dstPage, uint8 *
// kyra3 specific
+const uint8 *Screen::getPtrToShape(const uint8 *shpFile, int shape) {
+ debugC(9, kDebugLevelScreen, "KyraEngine::getPtrToShape(%p, %d)", (void *)shpFile, shape);
+ uint16 shapes = READ_LE_UINT16(shpFile);
+
+ if (shapes <= shape)
+ return 0;
+
+ uint32 offset = READ_LE_UINT32(shpFile + (shape << 2) + 2);
+
+ return shpFile + offset + 2;
+}
+
uint8 *Screen::getPtrToShape(uint8 *shpFile, int shape) {
debugC(9, kDebugLevelScreen, "KyraEngine::getPtrToShape(%p, %d)", (void *)shpFile, shape);
uint16 shapes = READ_LE_UINT16(shpFile);
@@ -2254,7 +2266,7 @@ uint8 *Screen::getPtrToShape(uint8 *shpFile, int shape) {
return shpFile + offset + 2;
}
-uint16 Screen::getShapeSize(uint8 *shp) {
+uint16 Screen::getShapeSize(const uint8 *shp) {
debugC(9, kDebugLevelScreen, "KyraEngine::getShapeSize(%p)", (void *)shp);
return READ_LE_UINT16(shp+6);