aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/composer/composer.cpp27
-rw-r--r--engines/composer/composer.h1
-rw-r--r--engines/composer/resource.h1
3 files changed, 29 insertions, 0 deletions
diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp
index 5c66d9f0bf..af08ad6e07 100644
--- a/engines/composer/composer.cpp
+++ b/engines/composer/composer.cpp
@@ -399,6 +399,13 @@ void ComposerEngine::loadLibrary(uint id) {
newLib._buttons.push_back(button);
}
+ Common::Array<uint16> ambientResources = library._archive->getResourceIDList(ID_AMBI);
+ for (uint i = 0; i < ambientResources.size(); i++) {
+ Common::SeekableReadStream *stream = library._archive->getResource(ID_AMBI, ambientResources[i]);
+ Button button(stream);
+ newLib._buttons.insert(newLib._buttons.begin(), button);
+ }
+
// add background sprite, if it exists
if (hasResource(ID_BMAP, 1000))
setBackground(1000);
@@ -526,6 +533,26 @@ Button::Button(Common::SeekableReadStream *stream, uint16 id, uint gameType) {
delete stream;
}
+// AMBI-style button
+Button::Button(Common::SeekableReadStream *stream) {
+ _id = 0;
+ _zorder = 0;
+ _active = true;
+ _type = kButtonSprites;
+ _scriptIdRollOn = 0;
+ _scriptIdRollOff = 0;
+
+ _scriptId = stream->readUint16LE();
+
+ uint16 count = stream->readUint16LE();
+ for (uint j = 0; j < count; j++) {
+ uint16 spriteId = stream->readUint16LE();
+ _spriteIds.push_back(spriteId);
+ }
+
+ delete stream;
+}
+
bool Button::contains(const Common::Point &pos) const {
switch (_type) {
case kButtonRect:
diff --git a/engines/composer/composer.h b/engines/composer/composer.h
index 0d11817b9f..d92add1e71 100644
--- a/engines/composer/composer.h
+++ b/engines/composer/composer.h
@@ -69,6 +69,7 @@ class Button {
public:
Button() { }
Button(Common::SeekableReadStream *stream, uint16 id, uint gameType);
+ Button(Common::SeekableReadStream *stream);
bool contains(const Common::Point &pos) const;
diff --git a/engines/composer/resource.h b/engines/composer/resource.h
index e2ce23511f..aeaa5b9c88 100644
--- a/engines/composer/resource.h
+++ b/engines/composer/resource.h
@@ -35,6 +35,7 @@ struct Animation;
#define ID_LBRC MKTAG('L','B','R','C') // Main FourCC
+#define ID_AMBI MKTAG('A','M','B','I') // Ambient (v1 sprite button)
#define ID_ANIM MKTAG('A','N','I','M') // Animation
#define ID_BMAP MKTAG('B','M','A','P') // Bitmap
#define ID_BUTN MKTAG('B','U','T','N') // Button