aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTravis Howell2009-03-16 23:58:19 +0000
committerTravis Howell2009-03-16 23:58:19 +0000
commit5f087d5ad68206d845c304b4c7209cf8a8bda272 (patch)
tree557fcd81d07d0fbddd1e11d44665df2078aea0f9 /engines
parent88ff058bd7d7c5e77ddd774d9996206733fa7717 (diff)
downloadscummvm-rg350-5f087d5ad68206d845c304b4c7209cf8a8bda272.tar.gz
scummvm-rg350-5f087d5ad68206d845c304b4c7209cf8a8bda272.tar.bz2
scummvm-rg350-5f087d5ad68206d845c304b4c7209cf8a8bda272.zip
Cleanup.
svn-id: r39463
Diffstat (limited to 'engines')
-rw-r--r--engines/parallaction/disk.h4
-rw-r--r--engines/parallaction/disk_br.cpp55
2 files changed, 30 insertions, 29 deletions
diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h
index 5e77d0cb97..0c13827220 100644
--- a/engines/parallaction/disk.h
+++ b/engines/parallaction/disk.h
@@ -260,6 +260,7 @@ public:
virtual void init();
+ Common::String selectArchive(const Common::String& name);
GfxObj* loadTalk(const char *name);
Font* loadFont(const char* name);
GfxObj* loadStatic(const char* name);
@@ -269,8 +270,7 @@ public:
GfxObj* loadObjects(const char *name, uint8 part = 0);
Common::SeekableReadStream* loadMusic(const char* name);
Common::ReadStream* loadSound(const char* name);
- Common::String selectArchive(const Common::String& name);
-
+ void loadMask(const char *name, MaskBuffer &buffer);
};
} // namespace Parallaction
diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp
index 21e73a8f09..952dcf40af 100644
--- a/engines/parallaction/disk_br.cpp
+++ b/engines/parallaction/disk_br.cpp
@@ -500,6 +500,25 @@ void AmigaDisk_br::loadBackground(BackgroundInfo& info, Common::SeekableReadStre
}
+void AmigaDisk_br::loadMask(const char *name, MaskBuffer &buffer) {
+ if (!name) {
+ return;
+ }
+
+ Common::SeekableReadStream *stream = openFile("msk/" + Common::String(name), ".msk");
+
+ byte *pal = 0;
+ Graphics::Surface* surf = new Graphics::Surface;
+ Graphics::ILBMDecoder decoder(*stream, *surf, pal);
+ decoder.decode();
+ free(pal);
+
+ buffer.create(surf->w, surf->h);
+ memcpy(buffer.data, surf->pixels, buffer.size);
+ buffer.bigEndian = false;
+ delete stream;
+}
+
void AmigaDisk_br::loadScenery(BackgroundInfo& info, const char* name, const char* mask, const char* path) {
debugC(1, kDebugDisk, "AmigaDisk_br::loadScenery '%s', '%s' '%s'", name, mask, path);
@@ -510,35 +529,17 @@ void AmigaDisk_br::loadScenery(BackgroundInfo& info, const char* name, const cha
loadBackground(info, *stream);
delete stream;
}
-#if 0
if (mask) {
- stream = tryOpenFile("msk/" + Common::String(mask), ".msk");
- if (stream) {
- Graphics::PackBitsReadStream unpackedStream(*stream);
- info._mask = new MaskBuffer;
- info._mask->bigEndian = false;
- info._mask->create(info.width, info.height);
- unpackedStream.read(info._mask->data, info._mask->size);
- // TODO: there is another step to do after decompression...
- delete stream;
- } else {
- debugC(1, kDebugDisk, "AmigaDisk_br::loadScenery: (%s) not found", mask);
- }
- }
+#if 0
+ info._mask = new MaskBuffer;
+ loadMask(mask, *info._mask);
#endif
+ }
+
if (path) {
- stream = tryOpenFile("pth/" + Common::String(path), ".pth");
- if (stream) {
- // NOTE: info.width and info.height are only valid if the background graphics
- // have already been loaded
- info._path = new PathBuffer;
- info._path->bigEndian = false;
- info._path->create(info.width, info.height);
- stream->read(info._path->data, info._path->size);
- delete stream;
- } else {
- debugC(1, kDebugDisk, "AmigaDisk_br::loadScenery: (%s) not found", path);
- }
+ info._path = new PathBuffer;
+ info._path->create(info.width, info.height);
+ loadPath(path, *info._path);
}
return;
@@ -568,7 +569,7 @@ GfxObj* AmigaDisk_br::loadStatic(const char* name) {
free(pal);
delete stream;
- return new GfxObj(0, new SurfaceToFrames(surf));
+ return new GfxObj(0, new SurfaceToFrames(surf), name);
}
Sprites* AmigaDisk_br::createSprites(Common::ReadStream &stream) {